{"_id":"@material/slider","_rev":"1750-73f3e5df2f7931a87b5b5c108fdb2465","name":"@material/slider","description":"The Material Components for the web slider component","dist-tags":{"next":"4.0.0-alpha.0","nightly":"12.0.0-nightly.778a0e8a.0","latest":"14.0.0","canary":"15.0.0-canary.423edc3dc.0"},"versions":{"0.1.0":{"name":"@material/slider","version":"0.1.0","keywords":["material components","material design","slider"],"license":"Apache-2.0","_id":"@material/slider@0.1.0","maintainers":[{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"ljepsen3541","email":"ljepsen3541@gmail.com"},{"name":"yeelan0319","email":"yiranmao@gmail.com"},{"name":"amsheehan","email":"alex.m.sheehan@gmail.com"},{"name":"cristobalchao","email":"cchao87@gmail.com"},{"name":"traviskaufman","email":"travis.kaufman@gmail.com"},{"name":"sgomes","email":"mail@sgomes.io"},{"name":"material-admin","email":"traviskaufman+npm@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"dd1df402ca2072c5a8f336ab050453e840e2b21a","tarball":"https://registry.npmjs.org/@material/slider/-/slider-0.1.0.tgz","integrity":"sha512-2iUGnd8h8dkWFS9JnEmC0h811vkuRITahkgW6evO4QmNJUAqMkGjnGX/D2Kdaf7uuJ9TQ+Of7peHMfdr3hoR6w==","signatures":[{"sig":"MEQCIEFzOCOFy5hh/RUsOHjgRHI34a2OjjUCsajqx71ZKvRTAiAG+86SvhWpjGoNfNpI15+9QcKmdyIe17jufKnCjTM5ig==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"index.js","_npmUser":{"name":"traviskaufman","email":"travis.kaufman@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git"},"_npmVersion":"5.0.3","description":"The Material Components for the web slider component","directories":{},"_nodeVersion":"8.0.0","dependencies":{"@material/rtl":"^0.1.5","@material/base":"^0.2.0","@material/theme":"^0.1.5","@material/animation":"^0.2.2"},"publishConfig":{"access":"public"},"_npmOperationalInternal":{"tmp":"tmp/slider-0.1.0.tgz_1497282806749_0.2643103178124875","host":"s3://npm-registry-packages"}},"0.1.1":{"name":"@material/slider","version":"0.1.1","keywords":["material components","material design","slider"],"license":"Apache-2.0","_id":"@material/slider@0.1.1","maintainers":[{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"yeelan0319","email":"yiranmao@gmail.com"},{"name":"amsheehan","email":"alex.m.sheehan@gmail.com"},{"name":"cristobalchao","email":"cchao87@gmail.com"},{"name":"traviskaufman","email":"travis.kaufman@gmail.com"},{"name":"sgomes","email":"mail@sgomes.io"},{"name":"material-admin","email":"lynnjepsen+npm@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"d46bb1c80a9534892ccec9fa098e151b69886023","tarball":"https://registry.npmjs.org/@material/slider/-/slider-0.1.1.tgz","integrity":"sha512-NLsaoNwXYIqqJUweZ5fMkm6YSNuyuDVU0IgTr0m7TL19zYP9sjcJyExeSrkN3TPNthfRWMFO71GKj7yAAdlKYA==","signatures":[{"sig":"MEUCIQCFQG1IU4PUw1KkpLflQPmmRw/31NM1lFBSfpoZqE4/1wIgDvBbV/hj3yM0gQr2G4tlzsaDm7GLscDDCWRUMavutHY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"index.js","_from":".","_shasum":"d46bb1c80a9534892ccec9fa098e151b69886023","scripts":{},"_npmUser":{"name":"amsheehan","email":"alex.m.sheehan@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git"},"_npmVersion":"3.10.9","description":"The Material Components for the web slider component","directories":{},"_nodeVersion":"6.9.2","dependencies":{"@material/rtl":"^0.1.6","@material/base":"^0.2.1","@material/theme":"^0.1.5","@material/animation":"^0.2.2"},"publishConfig":{"access":"public"},"_npmOperationalInternal":{"tmp":"tmp/slider-0.1.1.tgz_1498493463886_0.9452153698075563","host":"s3://npm-registry-packages"}},"0.2.0":{"name":"@material/slider","version":"0.2.0","keywords":["material components","material design","slider"],"license":"Apache-2.0","_id":"@material/slider@0.2.0","maintainers":[{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"yeelan0319","email":"yiranmao@gmail.com"},{"name":"amsheehan","email":"alex.m.sheehan@gmail.com"},{"name":"cristobalchao","email":"cchao87@gmail.com"},{"name":"traviskaufman","email":"travis.kaufman@gmail.com"},{"name":"sgomes","email":"mail@sgomes.io"},{"name":"material-admin","email":"lynnjepsen+npm@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"1a929384503ca3b20fcf22db584f034b1e2062e3","tarball":"https://registry.npmjs.org/@material/slider/-/slider-0.2.0.tgz","integrity":"sha512-jNOlS4F6Kcm0fft9LiYghWnDCD5Qm5Rh44pqQ0hn1QLEK0zaCI95jkMBt9vaVUjKnzh1Ry/UgHL3UMGPcZvhhw==","signatures":[{"sig":"MEUCIQDdZC1k3u0mAz3lF0ks1iov7f4BXWp9qShJNSRB6vrarwIgO7vT/G2xI/PYtS0il2Y6B72rv+i8ocy/W96z/26ip2o=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"index.js","_from":".","_shasum":"1a929384503ca3b20fcf22db584f034b1e2062e3","scripts":{},"_npmUser":{"name":"lynnjepsen","email":"lynnjepsen@google.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git"},"_npmVersion":"4.2.0","description":"The Material Components for the web slider component","directories":{},"_nodeVersion":"7.10.0","dependencies":{"@material/rtl":"^0.1.6","@material/base":"^0.2.2","@material/theme":"^0.1.5","@material/animation":"^0.2.2"},"publishConfig":{"access":"public"},"_npmOperationalInternal":{"tmp":"tmp/slider-0.2.0.tgz_1499702336744_0.6294548758305609","host":"s3://npm-registry-packages"}},"0.2.1":{"name":"@material/slider","version":"0.2.1","keywords":["material components","material design","slider"],"license":"Apache-2.0","_id":"@material/slider@0.2.1","maintainers":[{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"yeelan0319","email":"yiranmao@gmail.com"},{"name":"amsheehan","email":"alex.m.sheehan@gmail.com"},{"name":"cristobalchao","email":"cchao87@gmail.com"},{"name":"traviskaufman","email":"travis.kaufman@gmail.com"},{"name":"sgomes","email":"mail@sgomes.io"},{"name":"material-admin","email":"lynnjepsen+npm@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"c7dc6e5a88f4366bbed41ba45e555c7d07903f63","tarball":"https://registry.npmjs.org/@material/slider/-/slider-0.2.1.tgz","integrity":"sha512-L+am+rBu8NPk76/gseygyjfxZdXrwvN1JifoI+PcdEEXYKez88bH+32CvF1UViMWApFj7uPB0gQ8ij/XT00xjg==","signatures":[{"sig":"MEYCIQDp4M40FkMlljuZF/uAbFZNW4t7IpnA/HywxgN7MSrE8QIhANGDFns5oImBLvGDtf6Q1rMx37IGHLGPDNqNSzoLlNHv","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"index.js","_from":".","_shasum":"c7dc6e5a88f4366bbed41ba45e555c7d07903f63","scripts":{},"_npmUser":{"name":"yeelan0319","email":"yiranmao@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git"},"_npmVersion":"3.10.10","description":"The Material Components for the web slider component","directories":{},"_nodeVersion":"7.2.1","dependencies":{"@material/rtl":"^0.1.7","@material/base":"^0.2.3","@material/theme":"^0.1.6","@material/animation":"^0.3.0"},"publishConfig":{"access":"public"},"_npmOperationalInternal":{"tmp":"tmp/slider-0.2.1.tgz_1500911366684_0.06170412851497531","host":"s3://npm-registry-packages"}},"0.2.2":{"name":"@material/slider","version":"0.2.2","keywords":["material components","material design","slider"],"license":"Apache-2.0","_id":"@material/slider@0.2.2","maintainers":[{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"yeelan0319","email":"yiranmao@gmail.com"},{"name":"amsheehan","email":"alex.m.sheehan@gmail.com"},{"name":"cristobalchao","email":"cchao87@gmail.com"},{"name":"traviskaufman","email":"travis.kaufman@gmail.com"},{"name":"sgomes","email":"mail@sgomes.io"},{"name":"material-admin","email":"lynnjepsen+npm@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"f79f72795bf473ce1a2e21e678cd1934446dc937","tarball":"https://registry.npmjs.org/@material/slider/-/slider-0.2.2.tgz","integrity":"sha512-/Kp8ZfKAUhJbnZOLNuj5rOysxhKjErm766Clq4g2TzsJqa1FmNuBIr5SILUCFMWLe3a2yQg6+MZM8jsbu83Q+A==","signatures":[{"sig":"MEQCIAy6bKMfcUme+dDK+GAFvJ1Xn/ZTR0UJLvLC0pqphOwQAiAOrJ6V7EL/ycWvDRMt5BhopEDAfbLEJHeAlDU7Ge2kuw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"index.js","_from":".","_shasum":"f79f72795bf473ce1a2e21e678cd1934446dc937","scripts":{},"_npmUser":{"name":"acdvorak","email":"acdvorak@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git"},"_npmVersion":"4.2.0","description":"The Material Components for the web slider component","directories":{},"_nodeVersion":"7.10.1","dependencies":{"@material/rtl":"^0.1.7","@material/base":"^0.2.3","@material/theme":"^0.1.7","@material/animation":"^0.3.1"},"publishConfig":{"access":"public"},"_npmOperationalInternal":{"tmp":"tmp/slider-0.2.2.tgz_1502138913162_0.4841553757432848","host":"s3://npm-registry-packages"}},"0.2.3":{"name":"@material/slider","version":"0.2.3","keywords":["material components","material design","slider"],"license":"Apache-2.0","_id":"@material/slider@0.2.3","maintainers":[{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"yeelan0319","email":"yiranmao@gmail.com"},{"name":"amsheehan","email":"alex.m.sheehan@gmail.com"},{"name":"cristobalchao","email":"cchao87@gmail.com"},{"name":"traviskaufman","email":"travis.kaufman@gmail.com"},{"name":"sgomes","email":"mail@sgomes.io"},{"name":"material-admin","email":"lynnjepsen+npm@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"056658ce29c6f42146ef04988b3caf0a6988d97f","tarball":"https://registry.npmjs.org/@material/slider/-/slider-0.2.3.tgz","integrity":"sha512-JPIHq1z24JPBxTrxXfnZJC6YgyQ5Hh3W1K9Ub5UWhPuJWJkSWFEA9N+IZJvmwL5jQ4fRzNAyqfKn2z8VYC28yg==","signatures":[{"sig":"MEUCICp2/W+qQU+qBmCA+enyUodYrRDmOUnu6MKTtNVHWtXYAiEAqqgJ/KJJEqweHW86Q3tyymdyI0qOxxy2XLSh0gJ5Fpk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"index.js","_npmUser":{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git"},"_npmVersion":"5.3.0","description":"The Material Components for the web slider component","directories":{},"_nodeVersion":"8.1.4","dependencies":{"@material/rtl":"^0.1.7","@material/base":"^0.2.4","@material/theme":"^0.2.0","@material/animation":"^0.3.1"},"publishConfig":{"access":"public"},"_npmOperationalInternal":{"tmp":"tmp/slider-0.2.3.tgz_1503336480895_0.9902663787361234","host":"s3://npm-registry-packages"}},"0.2.4":{"name":"@material/slider","version":"0.2.4","keywords":["material components","material design","slider"],"license":"Apache-2.0","_id":"@material/slider@0.2.4","maintainers":[{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"yeelan0319","email":"yiranmao@gmail.com"},{"name":"amsheehan","email":"alex.m.sheehan@gmail.com"},{"name":"cristobalchao","email":"cchao87@gmail.com"},{"name":"traviskaufman","email":"travis.kaufman@gmail.com"},{"name":"sgomes","email":"mail@sgomes.io"},{"name":"material-admin","email":"lynnjepsen+npm@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"a42b6beed83a09c20c09ff5c6a39490675f9bc74","tarball":"https://registry.npmjs.org/@material/slider/-/slider-0.2.4.tgz","integrity":"sha512-/UZwBfM59vPHoy1jEqWLwj5q2XCRn4QoeEFJIpOhmV8yTMQ1d/PVK1Z8PDFTmJ3bRccZPobSXseNF4fNGnFDlg==","signatures":[{"sig":"MEQCIFsChU2cO+b/qDmRoGmw5k0cA/VbYznR1f7K8oAK/mPDAiA5iDUCra8VPKE5UFo8nafdjU0OkYDQST/Zs/cVnHHOQg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"index.js","_npmUser":{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git"},"_npmVersion":"5.3.0","description":"The Material Components for the web slider component","directories":{},"_nodeVersion":"8.1.4","dependencies":{"@material/rtl":"^0.1.7","@material/base":"^0.2.5","@material/theme":"^0.2.0","@material/animation":"^0.3.1"},"publishConfig":{"access":"public"},"_npmOperationalInternal":{"tmp":"tmp/slider-0.2.4.tgz_1503586015814_0.0660302231553942","host":"s3://npm-registry-packages"}},"0.2.5":{"name":"@material/slider","version":"0.2.5","keywords":["material components","material design","slider"],"license":"Apache-2.0","_id":"@material/slider@0.2.5","maintainers":[{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"yeelan0319","email":"yiranmao@gmail.com"},{"name":"amsheehan","email":"alex.m.sheehan@gmail.com"},{"name":"cristobalchao","email":"cchao87@gmail.com"},{"name":"traviskaufman","email":"travis.kaufman@gmail.com"},{"name":"sgomes","email":"mail@sgomes.io"},{"name":"material-admin","email":"lynnjepsen+npm@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"26e9448925333857d64473ed15bc276dfa700be3","tarball":"https://registry.npmjs.org/@material/slider/-/slider-0.2.5.tgz","integrity":"sha512-Nlp4ugl5m29+QDBRLvFAtMP87g+yEHF5CXlLp0RDzjuGNdGk6LOk/WpXLN4tCbHCP2dwKqbjCIGoCL/KLAzvww==","signatures":[{"sig":"MEUCIQCU+2WQikXOw12v3ZMvE1vQkdvUUcQaGCZkqcxPubmlQAIgXJKzo3aw5Mp8vFJsaaFjRiImJLZJka/vhE8P3jSs2b8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"index.js","_from":".","_shasum":"26e9448925333857d64473ed15bc276dfa700be3","scripts":{},"_npmUser":{"name":"lynnjepsen","email":"lynnjepsen@google.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git"},"_npmVersion":"4.2.0","description":"The Material Components for the web slider component","directories":{},"_nodeVersion":"7.10.0","dependencies":{"@material/rtl":"^0.1.7","@material/base":"^0.2.5","@material/theme":"^0.3.0","@material/animation":"^0.3.1"},"publishConfig":{"access":"public"},"_npmOperationalInternal":{"tmp":"tmp/slider-0.2.5.tgz_1504642577647_0.2744755046442151","host":"s3://npm-registry-packages"}},"0.2.6":{"name":"@material/slider","version":"0.2.6","keywords":["material components","material design","slider"],"license":"Apache-2.0","_id":"@material/slider@0.2.6","maintainers":[{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"yeelan0319","email":"yiranmao@gmail.com"},{"name":"amsheehan","email":"alex.m.sheehan@gmail.com"},{"name":"traviskaufman","email":"travis.kaufman@gmail.com"},{"name":"material-admin","email":"lynnjepsen+npm@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"219670aed967fe1932ba9a0ae52c6c389f50b641","tarball":"https://registry.npmjs.org/@material/slider/-/slider-0.2.6.tgz","integrity":"sha512-mXhieBaIwjgj2+KoBRIiJkMbqOcmp1vG3qxwnvdu5+OOpYgHiRSbFz2UmlLXNf/Z2llB56R0YUD39jyoVtqCtw==","signatures":[{"sig":"MEYCIQC/jLYAsfnJQMLbmPakX155FW2nzZhgCaGTqeLpYTNPawIhAPJ/3Z6POZZuhXmG7WLyasod+fuoD7Sp7A2C7cQVs6ff","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"index.js","_npmUser":{"name":"amsheehan","email":"alex.m.sheehan@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git"},"_npmVersion":"5.3.0","description":"The Material Components for the web slider component","directories":{},"_nodeVersion":"6.9.2","dependencies":{"@material/rtl":"^0.1.8","@material/base":"^0.2.5","@material/theme":"^0.3.1","@material/animation":"^0.4.0"},"publishConfig":{"access":"public"},"_npmOperationalInternal":{"tmp":"tmp/slider-0.2.6.tgz_1505759754910_0.30054841842502356","host":"s3://npm-registry-packages"}},"0.2.7":{"name":"@material/slider","version":"0.2.7","keywords":["material components","material design","slider"],"license":"Apache-2.0","_id":"@material/slider@0.2.7","maintainers":[{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"yeelan0319","email":"yiranmao@gmail.com"},{"name":"amsheehan","email":"alex.m.sheehan@gmail.com"},{"name":"traviskaufman","email":"travis.kaufman@gmail.com"},{"name":"material-admin","email":"lynnjepsen+npm@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"a40dfb13d2a0e92199aec1cf18a63ab294af5bc8","tarball":"https://registry.npmjs.org/@material/slider/-/slider-0.2.7.tgz","integrity":"sha512-f4ZQfv95ielNxocz2c6hPdyE9NGomybBGaCanoc8DLDDv0Ome4T23gd453NlpfMBuPuDZ3Fv7DSFP8Jx0QCW0w==","signatures":[{"sig":"MEQCIDmosQwXSXRPA0ERbOlIfXY8qrOAV62RJ0d2niisYySRAiAXbvRAztPFln1h8rSQzzSmaZT7unXE6k2Te07X+UUIjA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"index.js","_from":".","_shasum":"a40dfb13d2a0e92199aec1cf18a63ab294af5bc8","scripts":{},"_npmUser":{"name":"acdvorak","email":"acdvorak@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git"},"_npmVersion":"4.2.0","description":"The Material Components for the web slider component","directories":{},"_nodeVersion":"7.10.1","dependencies":{"@material/rtl":"^0.1.8","@material/base":"^0.2.6","@material/theme":"^0.4.0","@material/animation":"^0.4.1"},"publishConfig":{"access":"public"},"_npmOperationalInternal":{"tmp":"tmp/slider-0.2.7.tgz_1506978715072_0.9465524114202708","host":"s3://npm-registry-packages"}},"0.23.0":{"name":"@material/slider","version":"0.23.0","keywords":["material components","material design","slider"],"license":"Apache-2.0","_id":"@material/slider@0.23.0","maintainers":[{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"yeelan0319","email":"yiranmao@gmail.com"},{"name":"amsheehan","email":"alex.m.sheehan@gmail.com"},{"name":"traviskaufman","email":"travis.kaufman@gmail.com"},{"name":"material-admin","email":"lynnjepsen+npm@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"db069f8b9bee554bad8ca48d734c70be4abcf8eb","tarball":"https://registry.npmjs.org/@material/slider/-/slider-0.23.0.tgz","integrity":"sha512-aREWE+OKfcfPWlX1MGfYafY0DbQu29tuL3Ks697gQG+ZbINhTfptVT0U5esDJ1x1YHNFBpujXC64jANOAGGDtQ==","signatures":[{"sig":"MEYCIQDTS/fLmvrMKd+xyGIekq0UQntzfXOthxHgyB/EDeA67wIhANt8pBhizbbY+Q6R7P8PtgZeYOVb2sfvSdWHMC7Dye9a","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"index.js","_npmUser":{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git"},"_npmVersion":"5.3.0","description":"The Material Components for the web slider component","directories":{},"_nodeVersion":"8.1.4","dependencies":{"@material/rtl":"^0.1.8","@material/base":"^0.2.6","@material/theme":"^0.4.0","@material/animation":"^0.4.1"},"publishConfig":{"access":"public"},"_npmOperationalInternal":{"tmp":"tmp/slider-0.23.0.tgz_1508187747980_0.8420496857725084","host":"s3://npm-registry-packages"}},"0.24.0":{"name":"@material/slider","version":"0.24.0","keywords":["material components","material design","slider"],"license":"Apache-2.0","_id":"@material/slider@0.24.0","maintainers":[{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"yeelan0319","email":"yiranmao@gmail.com"},{"name":"amsheehan","email":"alex.m.sheehan@gmail.com"},{"name":"traviskaufman","email":"travis.kaufman@gmail.com"},{"name":"material-admin","email":"lynnjepsen+npm@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"48e111a86512e9d41e2f82a1f7ba7307fd31b109","tarball":"https://registry.npmjs.org/@material/slider/-/slider-0.24.0.tgz","integrity":"sha512-8j9Vmcq7NaBtSsRL7fPsDWWr1xJpWalLeaAyaSbIZqGUiIRddxGpEzHqVviOkZPQ/4SpsinJj8FfgXE7MkjpIA==","signatures":[{"sig":"MEUCIQCmZnYDC7r85ntm6jzjlJem4AHp5sGq3ek21TnWK91RsAIgBWba6GKwqINYqPQrfratjBLSq5B30OmfJpgjyjBpPXk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"index.js","_npmUser":{"name":"lynnjepsen","email":"lynnjepsen@google.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git"},"_npmVersion":"5.3.0","description":"The Material Components for the web slider component","directories":{},"_nodeVersion":"8.4.0","dependencies":{"@material/rtl":"^0.1.8","@material/base":"^0.24.0","@material/theme":"^0.24.0","@material/animation":"^0.4.1"},"publishConfig":{"access":"public"},"_npmOperationalInternal":{"tmp":"tmp/slider-0.24.0.tgz_1509390694911_0.8539400666486472","host":"s3://npm-registry-packages"}},"0.25.0":{"name":"@material/slider","version":"0.25.0","keywords":["material components","material design","slider"],"license":"Apache-2.0","_id":"@material/slider@0.25.0","maintainers":[{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"yeelan0319","email":"yiranmao@gmail.com"},{"name":"amsheehan","email":"alex.m.sheehan@gmail.com"},{"name":"traviskaufman","email":"travis.kaufman@gmail.com"},{"name":"material-admin","email":"lynnjepsen+npm@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"8b9c035e308b9be03728857c93af76fff648c079","tarball":"https://registry.npmjs.org/@material/slider/-/slider-0.25.0.tgz","integrity":"sha512-arjfJBJ6W3yYfGzoiRV3CQELqsQs/AZ6zO1eEBMtUFXXl1frL1g02t0qhNC1AaFs+4hzQEX4bFECE6pGeT83mw==","signatures":[{"sig":"MEUCIAIzz4Nzaym35QH8UQcrHtmlonqXA4hzy1tGpNK3TePoAiEAoMBRHvXw9oOG7RXT9XSpPKSc0U7RfSFEEB++e0E+v4U=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"index.js","_npmUser":{"name":"amsheehan","email":"alex.m.sheehan@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git"},"_npmVersion":"5.5.1","description":"The Material Components for the web slider component","directories":{},"_nodeVersion":"6.9.2","dependencies":{"@material/rtl":"^0.1.8","@material/base":"^0.24.0","@material/theme":"^0.25.0","@material/animation":"^0.25.0"},"publishConfig":{"access":"public"},"_npmOperationalInternal":{"tmp":"tmp/slider-0.25.0.tgz_1510603354069_0.6040753766428679","host":"s3://npm-registry-packages"}},"0.26.0":{"name":"@material/slider","version":"0.26.0","keywords":["material components","material design","slider"],"license":"Apache-2.0","_id":"@material/slider@0.26.0","maintainers":[{"name":"bonniez","email":"bonniez@google.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"amsheehan","email":"alex.m.sheehan@gmail.com"},{"name":"material-admin","email":"lynnjepsen+npm@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"a8af739a3c820b493d1926f7a17e84602cd0103d","tarball":"https://registry.npmjs.org/@material/slider/-/slider-0.26.0.tgz","integrity":"sha512-H8VM91ixBsQoKTuJflwU0Qho2HMqQAjpLJS8F5pNGokQ7f304Y5iK0tvqjLalXNJSBJUTPJqVQxGuwLFIQplCA==","signatures":[{"sig":"MEUCIQDOEVatI83fCj3Cm3mI5p9n47YE4VFBjvFM7rnd803VogIgMvKKcjcIgXZv5jR8Ly27WqkkycuyLeSSET+5kocxxFE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"index.js","_npmUser":{"name":"bonniez","email":"bonniez@google.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git"},"_npmVersion":"5.5.1","description":"The Material Components for the web slider component","directories":{},"_nodeVersion":"8.7.0","dependencies":{"@material/rtl":"^0.1.8","@material/base":"^0.24.0","@material/theme":"^0.25.0","@material/animation":"^0.25.0"},"publishConfig":{"access":"public"},"_npmOperationalInternal":{"tmp":"tmp/slider-0.26.0.tgz_1511821589291_0.8596761282533407","host":"s3://npm-registry-packages"}},"0.27.0":{"name":"@material/slider","version":"0.27.0","keywords":["material components","material design","slider"],"license":"Apache-2.0","_id":"@material/slider@0.27.0","maintainers":[{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"amsheehan","email":"alex.m.sheehan@gmail.com"},{"name":"material-admin","email":"lynnjepsen+npm@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"e624fb1b9d5d30f25e7d74ad836d9995a2efaabc","tarball":"https://registry.npmjs.org/@material/slider/-/slider-0.27.0.tgz","integrity":"sha512-RVZTEI+KHuDVSbs234hr0FHBYYtuCaZpI2YhDEUrkdD57iVKPqLNCROmCtoxvuselVanho3awAKUJZw6Jj6ovA==","signatures":[{"sig":"MEUCIE8Brj77c/DodOQfjPAqAKxmuZYF60n1wQ4Zx5rO7UBfAiEA7633x8UOXnoTeYmoT9VbvOx7NHSyWLhvjKGbGWKsazw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"index.js","_npmUser":{"name":"amsheehan","email":"alex.m.sheehan@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git"},"_npmVersion":"5.5.1","description":"The Material Components for the web slider component","directories":{},"_nodeVersion":"8.9.2","dependencies":{"@material/rtl":"^0.1.8","@material/base":"^0.24.0","@material/theme":"^0.27.0","@material/animation":"^0.25.0"},"publishConfig":{"access":"public"},"_npmOperationalInternal":{"tmp":"tmp/slider-0.27.0.tgz_1513020939438_0.9980873877648264","host":"s3://npm-registry-packages"}},"0.28.0":{"name":"@material/slider","version":"0.28.0","keywords":["material components","material design","slider"],"license":"Apache-2.0","_id":"@material/slider@0.28.0","maintainers":[{"name":"williamernest","email":"williamernest@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"amsheehan","email":"alex.m.sheehan@gmail.com"},{"name":"material-admin","email":"lynnjepsen+npm@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"65ecab6f9ce453c1fb42e20c3b1efbff0b9112a2","tarball":"https://registry.npmjs.org/@material/slider/-/slider-0.28.0.tgz","integrity":"sha512-aCF4WyFRu7TSr/n2AjhAJKGobck5KFJ2QG0RNXcdBOAteuFZMy6/mcbpzQbHdW+RJPLWGYtxLiVsJJBaGQmSJQ==","signatures":[{"sig":"MEYCIQDsdSGgA5JwsI+HmvHFs9Ri2BvWSvyb1kU9RHEl+4HOnQIhAOdW7BXQvH3hDDfobz1R+VlqyZhWzYJhLbidHoZ7Y4fV","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"index.js","_npmUser":{"name":"acdvorak","email":"acdvorak@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git"},"_npmVersion":"5.6.0","description":"The Material Components for the web slider component","directories":{},"_nodeVersion":"8.1.4","dependencies":{"@material/rtl":"^0.1.8","@material/base":"^0.24.0","@material/theme":"^0.28.0","@material/animation":"^0.25.0"},"publishConfig":{"access":"public"},"_npmOperationalInternal":{"tmp":"tmp/slider-0.28.0.tgz_1515437716523_0.731936005409807","host":"s3://npm-registry-packages"}},"0.29.0":{"name":"@material/slider","version":"0.29.0","keywords":["material components","material design","slider"],"license":"Apache-2.0","_id":"@material/slider@0.29.0","maintainers":[{"name":"williamernest","email":"williamernest@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"amsheehan","email":"alex.m.sheehan@gmail.com"},{"name":"material-admin","email":"lynnjepsen+npm@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"3edccd812e554fba018f9516bc031720218a6c7e","tarball":"https://registry.npmjs.org/@material/slider/-/slider-0.29.0.tgz","integrity":"sha512-rJTTptTlabt6RWuuGEePM+kckOnB95hK6tWIdiQFgjv/y1usmkQSC3OdtacQMw4SNysIWpECdUyBrhjkUH/syg==","signatures":[{"sig":"MEYCIQD/aB6YHM/To8Sx8KLA5ojPi4Vn6pXpQjN2oRQpcrbW2gIhAN8BHXcZX1W8RXcZG7aUjlpS2brsRS015Q7fNvsPSJbI","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"index.js","_npmUser":{"name":"bonniez","email":"bonniez@google.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git"},"_npmVersion":"5.6.0","description":"The Material Components for the web slider component","directories":{},"_nodeVersion":"8.7.0","dependencies":{"@material/rtl":"^0.29.0","@material/base":"^0.29.0","@material/theme":"^0.29.0","@material/animation":"^0.25.0"},"publishConfig":{"access":"public"},"_npmOperationalInternal":{"tmp":"tmp/slider-0.29.0.tgz_1516645861548_0.19549636403098702","host":"s3://npm-registry-packages"}},"0.30.0":{"name":"@material/slider","version":"0.30.0","keywords":["material components","material design","slider"],"license":"Apache-2.0","_id":"@material/slider@0.30.0","maintainers":[{"name":"williamernest","email":"williamernest@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"amsheehan","email":"alex.m.sheehan@gmail.com"},{"name":"material-admin","email":"lynnjepsen+npm@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"caf218a01a454c4085f6cae8c872dc49df7fc90a","tarball":"https://registry.npmjs.org/@material/slider/-/slider-0.30.0.tgz","integrity":"sha512-/qAq4INRBF//wgNVlZoD2PgTThlffOUxQ0Q6TCIlUUO/vUrJybaPZZIxHTtSfq9Z1sxgmFV6p/2RFcc9HC7DZQ==","signatures":[{"sig":"MEQCIDUVIDJ5KLnfT80LPIKvwQirgwDtF4KOWkSmtdD85WoeAiAMAYlBde/dNPvrNhBAk5ruYw/sNu8TnpaINgadv980qg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"index.js","_npmUser":{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git"},"_npmVersion":"5.3.0","description":"The Material Components for the web slider component","directories":{},"_nodeVersion":"8.1.4","dependencies":{"@material/rtl":"^0.30.0","@material/base":"^0.29.0","@material/theme":"^0.30.0","@material/animation":"^0.25.0"},"publishConfig":{"access":"public"},"_npmOperationalInternal":{"tmp":"tmp/slider-0.30.0.tgz_1517868182080_0.9698272862005979","host":"s3://npm-registry-packages"}},"0.32.0":{"name":"@material/slider","version":"0.32.0","keywords":["material components","material design","slider"],"license":"Apache-2.0","_id":"@material/slider@0.32.0","maintainers":[{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"amsheehan","email":"alex.m.sheehan@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"lynnjepsen+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"36aa6c3f89793817f88db395b1781182d6fe2456","tarball":"https://registry.npmjs.org/@material/slider/-/slider-0.32.0.tgz","fileCount":14,"integrity":"sha512-FmV9tjzhj9KfTpxXL2YNgV3STQTWXmROp7SJqrz8v2JpDXiVyI/pq/DhcFLEMvs096cIZWgH+iyZPQGFTPH12A==","signatures":[{"sig":"MEUCIQD8ZRe5SpImhlmWf2UjtaVC9oG0vNqeALMIJgEmTXnWJgIgM62idlGKpYzPQsYtwJLePTk1P8QtnudZ51JQort/j2E=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":165495},"main":"index.js","_npmUser":{"name":"patrickrodee","email":"prodee@google.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git"},"_npmVersion":"5.5.1","description":"The Material Components for the web slider component","directories":{},"_nodeVersion":"8.7.0","dependencies":{"@material/rtl":"^0.30.0","@material/base":"^0.29.0","@material/theme":"^0.30.0","@material/animation":"^0.25.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/slider_0.32.0_1520287730008_0.22172486982548345","host":"s3://npm-registry-packages"}},"0.33.0":{"name":"@material/slider","version":"0.33.0","keywords":["material components","material design","slider"],"license":"Apache-2.0","_id":"@material/slider@0.33.0","maintainers":[{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"amsheehan","email":"alex.m.sheehan@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"lynnjepsen+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"3d8a061758da9ae17b3b0bfbc13e429bf0ae2db5","tarball":"https://registry.npmjs.org/@material/slider/-/slider-0.33.0.tgz","fileCount":14,"integrity":"sha512-HFh1Ajv/pAG6Yu30swzhhN8u3+mYJTi/1P2zMUADT1KHs3Zex3/KRxAbdBaiN2BeCTVtko7zU+lOfx1OuaUsSw==","signatures":[{"sig":"MEUCIQCzB4ppIFCPRuLp9HbqvJf0hfk4WYBzp9q+WSRX9eBNNwIgZYK/InmcH9l8MwRdvkypgt9hKA+OIK7IVAcKKrcb+n8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":165317},"main":"index.js","_npmUser":{"name":"williamernest","email":"williamernest@google.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git"},"_npmVersion":"5.6.0","description":"The Material Components for the web slider component","directories":{},"_nodeVersion":"9.4.0","dependencies":{"@material/rtl":"^0.33.0","@material/base":"^0.29.0","@material/theme":"^0.33.0","@material/animation":"^0.25.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/slider_0.33.0_1521477609445_0.03283536790558772","host":"s3://npm-registry-packages"}},"0.34.0":{"name":"@material/slider","version":"0.34.0","keywords":["material components","material design","slider"],"license":"Apache-2.0","_id":"@material/slider@0.34.0","maintainers":[{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"amsheehan","email":"alex.m.sheehan@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"lynnjepsen+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"851d4613c946942b31cffdc9783fe47fa1ea8739","tarball":"https://registry.npmjs.org/@material/slider/-/slider-0.34.0.tgz","fileCount":14,"integrity":"sha512-yv62H/b3ZYqZCJUToHuU5k8WcMYY2p2vFFeD4pBpGF405ECN4q78W23UqP5YGQb9s7ZxX8Kz16U7h+SYCI+cEw==","signatures":[{"sig":"MEUCIQCBqoUrLE61KlsryFv+XP0XzlrYztTU2doq9iLnSDnOkwIgMQj4nR2PZ7tTW+TyKiD3niom32hkPmeikp1WqBliYo4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":165316},"main":"index.js","_npmUser":{"name":"acdvorak","email":"acdvorak@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git"},"_npmVersion":"5.6.0","description":"The Material Components for the web slider component","directories":{},"_nodeVersion":"8.11.0","dependencies":{"@material/rtl":"^0.34.0","@material/base":"^0.34.0","@material/theme":"^0.34.0","@material/animation":"^0.34.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/slider_0.34.0_1522705925033_0.42535726827253373","host":"s3://npm-registry-packages"}},"0.35.0":{"name":"@material/slider","version":"0.35.0","keywords":["material components","material design","slider"],"license":"Apache-2.0","_id":"@material/slider@0.35.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"lynnjepsen+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"0599b8dfdbdc0a7e1d67beb37bf8eb290a8b9860","tarball":"https://registry.npmjs.org/@material/slider/-/slider-0.35.0.tgz","fileCount":14,"integrity":"sha512-xslQkMWdnvuUTso/bSzjfkRPu9IuTMRYsWubVLrTaNTsQK6qUu6NPBK/lidm/y/oCFFyRjtIaytotNlqblqjQg==","signatures":[{"sig":"MEQCIAKH0CiFcrXefSCTKV5V4UqQldReCTKn6OPPz+Y6gie3AiAiQ7L6y+j8Vr6BGb6mkZBNy47ldyt3enNMW3OU3TWCvQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":161573,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa3mDsCRA9TVsSAnZWagAAXO4P/j/zrlXRkpJVOWbj4nvW\nkpBKT3RujTPwik6+96c2QtkNMuGB4EbdwCep09oM1PqU1zKozGBHx0kZareJ\ndGZ+b1ciJ1LDDP/KH8E7m2Q32DlcI0NrUK/zSL9tL5hqdtSc5uKSo6C2sZIn\nEKrod5MFCawdCg+jp9wdiFqvd+UJA/qhXFighM6ZDC9FLzdhK/XSAeDY0k/v\nr0jNDKaZ9H9yq3QzEMAHK+fumWvarHy0dXUGpR6pAoxM3sVWOphpRbp7qXop\nugPwr0aTTJaNXxh6qJQy4DCk9/sqAEVgPOape44M6DgINA9PlXNw7Qcz/kV0\njLQMdmwdmpmpi+E48ThzHQ+kQHdWyCVXhVHtwcv7oQZUBA/ZlaVcDx6J4i9f\nIU7hMy/RRbPusPG016tXahOUfkY1q3nYuS02549T7Red+E+cvE+KQy0o6LiJ\n8tDFyzxXIblalArc+1gFPptAndNetHjklAgKVTBwOQSvgVfa6k4L19zn95er\nIQRVSTvnRyRXsyEaMalmiOcAQqIVp9nuNoD4VKn9ppEt+YwM1QOSvlUgOcH2\nyGKEfKttv4VzCAho3C49EaJ8NlEWg6NLqj5moewPhbPGTNJXEcTJnMFqtMx0\n2oHmXnqVRwfVeGFNfNswtqCmfU8oQUEJ9HMow6zHAfDQB449U4JrJrRtqLGI\nEjyY\r\n=lFce\r\n-----END PGP SIGNATURE-----\r\n"},"main":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components-web.appspot.com/slider.html\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/guidelines/components/sliders.html\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components-web.appspot.com/slider.html\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `appendTrackMarkers(numMarkers: number) => void` | Appends track marker element to track container. |\n| `removeTrackMarkers() => void` | Removes existing marker elements to track container. |\n| `setLastTrackMarkersStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the last element of the track markers. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`mdc-slider-color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`mdc-slider-highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`mdc-slider-rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`mdc-slider-rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`mdc-slider-thumb-color($color)` | Sets the color of the thumb (grab handle)\n`mdc-slider-focus-halo-color($color)` | Sets the color of the focus halo\n`mdc-slider-value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`mdc-slider-value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`mdc-slider-value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","_npmUser":{"name":"bonniez","email":"bonniez@google.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git"},"_npmVersion":"5.6.0","description":"The Material Components for the web slider component","directories":{},"_nodeVersion":"8.7.0","dependencies":{"@material/rtl":"^0.35.0","@material/base":"^0.35.0","@material/theme":"^0.35.0","@material/animation":"^0.34.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_0.35.0_1524523243035_0.2059501010753828","host":"s3://npm-registry-packages"}},"0.36.0":{"name":"@material/slider","version":"0.36.0","keywords":["material components","material design","slider"],"license":"Apache-2.0","_id":"@material/slider@0.36.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"lynnjepsen+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"340955e88504402c25c2dcce0cdf4062a7725fc7","tarball":"https://registry.npmjs.org/@material/slider/-/slider-0.36.0.tgz","fileCount":14,"integrity":"sha512-WB4j62IzrQgToWrDwe5ssSX/7wUD2cvCNlVkehz0syjUMWLCDv3ZrWTJQhd3K6XE3TjSjtTa5JjhkuezAAr41A==","signatures":[{"sig":"MEQCIFhoyAMXN9IbTAJ2jNi9zXqGkCPlQbVBb03EeXQBcFQ8AiBIYdAlP/GyNgDcXkIT9qU4s0WMUC5W65EyDfP1225hXA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":161629,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbFVzwCRA9TVsSAnZWagAAarIP/RwJ5AR2SDSY0zblowp7\neSHVt37djtSBg904TMCI3DHrsVA5WMchn0MQmIXtyZXaS8M/95tirXU+qsiN\n4cCrpEmXi7wWIKZI1mkXteFsWkq2/R6HR2nTtGBKuAh3Mdnan+C5AHzyQlNc\nbQuImlSFjgHcDvSyfHtj51xVnUuYpSf6Da360P+rtuBEOycNDisRBUqltpN4\n1+bI7483WcTluyxrL2F0tpDRCQ5spoHWblczEyHTXdaWHxmDIrqWm/4cSIfQ\nS6Ej0VB4fHxKzmjOTsj+Ttc5+2CaBhz4qWctmyLGvJZBra7XAw5lhsYs4/ZG\ngyeFo4c2ofBGRxGR7BHrIW9PHVPAC/3CPqwD0ZTwmOj7Svbsuf4N5humFYbu\nV9BTlr9b4tduGD5HgrmJhwBBf89/7cPKKnkN4nNUSW580HZG2w6/v6OpQhr2\ng9Bi24aE9n22UADQp6KBIBUfMOeLNg89tUAAg7QyTMmC5xplsQO9xe0lrM1j\ncKL3tYPOFB2TEBBF5K9HRVObV8Zmds310eYOAmXBbv+Pzp8Ak9Kd+snfJ5gp\n1hHEFZYEbQMGFOSm839adSYJzADIa72d8gcFBf+5rSOXI3RidQGm6IEMsngD\n+Oqa1YEGIloyzhi/u4hf/zO3CiyZNi9Lwg0txgRFyi5S+M9BR/C962y+aRoW\nJnWC\r\n=tuxg\r\n-----END PGP SIGNATURE-----\r\n"},"main":"index.js","_npmUser":{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git"},"_npmVersion":"6.0.1","description":"The Material Components for the web slider component","directories":{},"_nodeVersion":"8.11.1","dependencies":{"@material/rtl":"^0.36.0","@material/base":"^0.35.0","@material/theme":"^0.35.0","@material/animation":"^0.34.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/slider_0.36.0_1528126703170_0.007963858393532641","host":"s3://npm-registry-packages"}},"0.38.0":{"name":"@material/slider","version":"0.38.0","keywords":["material components","material design","slider"],"license":"Apache-2.0","_id":"@material/slider@0.38.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"lynnjepsen+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"be5826a79765721b6b2b8ecf5fee05976b6d82ab","tarball":"https://registry.npmjs.org/@material/slider/-/slider-0.38.0.tgz","fileCount":14,"integrity":"sha512-HF0XPteiS8IpT1xyGi1dYLd5CW3FxXlDKteNsuhroSFXON2CNH+voHdfT+jW1WfkWcDKSthmSTB1iabD8+9xDg==","signatures":[{"sig":"MEQCIH822SRoYFGX1XuTVeYIWm2zU1Lo/FOe+aSGKW8/LrWPAiAFBm6TRh0C5zC7+LfSk6IgoP8JktFPf7rJcfVW7ERbmQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":161898,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbX0WYCRA9TVsSAnZWagAAlaYP/R3V0Wag3krh0r4lw/n7\nfeeoDKucpByyzdCxDQcoAF0RSBxC+0NjfFVXPnC+Ea/PTco6UEEY9EL+VY9/\nzqJ+xPZQblQR43HzCIV9mm/EkOKGcmixchWzamANKYwx3GfQby9nreLfkRz+\nWaipyKE9wPzKajOctcpnx1Qi/Y8Dd8Z+EH8oKeMr/NREC2Cos43aq+HA0KNX\nFiI9JORkpT+l3muruMiXjvRrmPwkvDvDepVDZLxSrSPIU11E1XDGgk7r+QSn\nogLOYJB5vCNa77blXtR5g0ADQrcZbpPazSgyAkG5ydhZ9D7VF9NzHRF3edg6\n+72/skMR6IjMzdvtqOBrWK3DadtNBB8QCZDdTHf221JDo2fk+urp+X613aPR\nu0z+cBqYSq1N37Kjba9u9T3EMDZ781/mRW5zMG+WcNE3OGpptxezC9ynnNCO\n0BNgBS+NFuywl/jqL2pXlFBiF+FN2dOc1mGCOYIoYgbAnPTMc30WWodEIVxy\n3yzjEbS9qTa/La8/HiMcXdO17mutlZHW/+dg1RD1McJkXLxB6tCQTbZ1BqLZ\ne4IeQ/7aQJk3XqgJKAGyKNweV52lOn51r45d1F4my0ELXPP20fezPPFqVBaw\noEbVnLgEfEAfilsiUX4Q7lvfNS6lZcBT5qsX1cUd0hJjG08CDKaPh9pbC8Hy\nWH5p\r\n=uxNe\r\n-----END PGP SIGNATURE-----\r\n"},"main":"index.js","_npmUser":{"name":"acdvorak","email":"acdvorak@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git"},"_npmVersion":"6.2.0","description":"The Material Components for the web slider component","directories":{},"_nodeVersion":"9.11.1","dependencies":{"@material/rtl":"^0.36.0","@material/base":"^0.35.0","@material/theme":"^0.38.0","@material/animation":"^0.34.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/slider_0.38.0_1532970392193_0.9854350315114773","host":"s3://npm-registry-packages"}},"0.39.0":{"name":"@material/slider","version":"0.39.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@0.39.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"lynnjepsen+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"24ad77a3c6284d26e53efbec9fc888b09d68fb39","tarball":"https://registry.npmjs.org/@material/slider/-/slider-0.39.0.tgz","fileCount":14,"integrity":"sha512-/IkkneIj3NNoLa/dKQfwIydSZ0B0qfIFWsR2m0AmxQcGQhi8DzoY1En6zuKgScOnFf6FEOymVsw+9DRfzsgNwQ==","signatures":[{"sig":"MEUCIQDH0Gp7qV7d85lcnFjp7ja+V8nNkgThZEYErghBWv2m+QIgVMfntBdaptDXjGewyiuQC9uEl54UAFPNw+It9Vv0vq0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":170389,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbhDeJCRA9TVsSAnZWagAA3yAP/1IesjdoYqf7M208OIKG\nfldXH7eK8CvO2QMm/y4teVnucER/TACiekwxqVz9cpyw9BeyfWOhT4Q8bQD8\n2CD96F3qmXO/go/nqrAU/a1uVom21L0Gt3G3DkmsHZr2jc+rFnnFJ9ZvlzN/\njYYBcZTbCt1Q9fiVYVHT04/+p6c1bmAMD7GJYLQBVHg1JEQvvbGVYFqaugWv\np8USo2dfIso1hnPp2Gj8A3G1wV7cmO5fzx4b3GA/RpOcRCdzzttFPDsdI8EF\ncz+P8r8SOUHu2BlUkERm3aYPwejOV9pXm8pqw1ENOT3SADreSr+9FPlIdAUX\n6Jm0Taqw/qxv/K3zJOpiIqHDj8ikoiKcocxxtOx9RoVhvpnKv9A5NzFGPIsA\nHDLOTomsRTXH1zDkeoZrPmwlSQRiZQEgt7dOEZ4kBcU9ban8YLs/ccO3BrgQ\n5l1IoEBA2bVeBPMvwpDF2Q5n0JGSnCrR6mAf3I5X6Ah8qumfOe1INNo9EqBC\n2d4VQ2XTh7Dk7fJoxEinRYnkM/Ofjl+7SSQPUkdI4s9wgmUP8qc3DSRMGcxp\n6sIAF1Uc9zzIOprBL01CS/MSRHQR/8ldqUEPEEzP21mij8afhYtiGw+Z7/ZM\nk8/GyPIXSenK252ZJLGf9I+RB3Opzfe9zQcHuIadM36FMBCLh85iF1W5iSgI\nAUos\r\n=14ZI\r\n-----END PGP SIGNATURE-----\r\n"},"main":"index.js","_npmUser":{"name":"williamernest","email":"williamernest@google.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git"},"_npmVersion":"6.3.0","description":"The Material Components for the web slider component","directories":{},"_nodeVersion":"9.4.0","dependencies":{"@material/rtl":"^0.39.0","@material/base":"^0.39.0","@material/theme":"^0.39.0","@material/animation":"^0.39.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/slider_0.39.0_1535391624194_0.15521103132957492","host":"s3://npm-registry-packages"}},"0.39.1":{"name":"@material/slider","version":"0.39.1","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@0.39.1","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"lynnjepsen+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"3662f8a3bc9ae353d77b70ee921063162e03a255","tarball":"https://registry.npmjs.org/@material/slider/-/slider-0.39.1.tgz","fileCount":14,"integrity":"sha512-pv3FrqLgEGqzt4CoN94SGIND9YyGp39NFIk5h9OruQZah8zjPm2lh7CGJ9UkkMGR7Zpxm44E+eqjvEli9LNniw==","signatures":[{"sig":"MEUCIQDJ/Oo0stJEQ4RFuOj1ll3OOe57kYfi2h9YcMOJ0hCuqQIgOLxQ+plyN/7263g8v0W9jU1yPxRlCIGiIxakDETM0n4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":170389,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbibTSCRA9TVsSAnZWagAAHcYP/0LM5cWK9rgt4Z6mN4mg\nvYC/2KSD+2WsEP4UEjXH/fH/0N4/H3DmWwmBKuZ9DH7HjZQSmWA6R+ayUhen\nntcmUC6WOF58ioUg8iKyRGX20cYB4ipU5NaMI/s9WnqBmZE3xydqZtLwJ1cY\n5hd/Es3IoHHrA9unMSyDyjfszgMZNLQf04iLH1d9eiEVNPwavzya9cV7uctW\nYwk+BD4fFBgYUeghysAAqtObE81dxUKCYH8CW/pLaqQnYAvME9BvIownpu59\nlabAQN3aAE4yU0u1wknoycDZxR6oL1Cwh3V5uxiVwT8L/DtBONGkus81pFeL\neERCcmNgtyiyKs3anLakxpAZHDvLMBIBBaUDORvA8YKOcF/CKB16OdS77Bl+\nRFhSgimMKhiDekfC24OYSLKXgqy0KTDFEqapg9+OsnkBOuYiwk0Qt6K5aeTp\nTVN7EiWWMKAf/DyTimi4u7xmEYaeoEwF+XTll8hBvQ4ocNnyZFHE9xt0xaWg\nKoewYyV5MFq1YPmrv5fPEZk8f4TVfxjBEUhh8qGAH1QekLja1OyZrifr5nMU\nYOOkE7ExZCoSRvBumD39WvZ2eWWO8/N93NM+eQLvN0ZJkmyF6wyqa6PZfeNA\njT9rR8uak8EoifG9+hXofQh80UR0gRj6Uu3eU33CbnhAz1VBPidRNVIZ/xcC\nw/jc\r\n=+2Ig\r\n-----END PGP SIGNATURE-----\r\n"},"main":"index.js","_npmUser":{"name":"williamernest","email":"williamernest@google.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git"},"_npmVersion":"6.3.0","description":"The Material Components for the web slider component","directories":{},"_nodeVersion":"9.4.0","dependencies":{"@material/rtl":"^0.39.1","@material/base":"^0.39.0","@material/theme":"^0.39.1","@material/animation":"^0.39.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/slider_0.39.1_1535751377082_0.3622765135309174","host":"s3://npm-registry-packages"}},"0.40.0":{"name":"@material/slider","version":"0.40.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@0.40.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"lynnjepsen+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"75bd25d21291eb4b071bef122531665688708852","tarball":"https://registry.npmjs.org/@material/slider/-/slider-0.40.0.tgz","fileCount":14,"integrity":"sha512-VDneb9reLPM5gtBGsjVYVxNfS1aqOPmmndo4dHflCUJevGncELZ4rxItZLypP1xY5NN/oPrfpJo7GGLzrcIwNQ==","signatures":[{"sig":"MEUCIQDHr6ObhS2K/3tKzSxnmqslofQwMkBupYPY7BD5yW3FaAIgHYBvEuh/gXoCr7N3+tE3UjVGubvhXGnmxyO3jcKocZo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":170428,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbqUJ4CRA9TVsSAnZWagAACjgP/j5Xb1Xe+/fVQNxQQJIu\n4zw9hIVNPUsedd8yIa3EVqdgwd6Ex4yl6E0pbc4DEn7OEigCOl6wnw9ulL4e\nu85V+JfBWTCpMLG2S5AjecOtlXIqbx0+7/nLRhaTCX1Lz//8s+LxF4iguckr\niDLjaOvVICvjchFj7oxDxebTTPpVCwmFdZiKBXc+nAvyteg9lwUBkx/Q5IoU\nAelQ0PJN8JOCx5lxVfLHkcoSceaEKWF6zMwR5Ys/OD3UoCYFxKT8uy+hO0sH\npRSusMGzbRbOBK8dHuLaFINBWsrQ2glg/hHQEVLjrjiQ0gfRwcAQyx0DE0cE\nHNEzsDnymxDbXFIaTkXefzOgXO5Ycs7kDZSewnUP3UptZXowPiUWYoG9mEmP\nOpuxO+OLNAIl1dnpyVZYGZ9QViVZ2SUOeiRokWWuN2D+/9AYAYUJWTKZ07DU\nrMwthaE8SYuNa4XY7/MRq2pcotlAB1yvvr21DtWN3prSsLz5umOOiopmqQiQ\nuqR9ReWSQ/RHHem1nNabDURKwv+vzQZWF0FgJ2dpIgAuGWYFVNWxmGCfTgRv\nLmfkv2q5fXcQHHclnnlCcduw8Y/MMKuyNVHSg3FHz34ygXNfQ7H1yzdHobNc\nQ2iOV4yOo4UJqD9qCPd2q1wZvlixYE20XhW4AZ5kcuDvW7t8DlFuKLRmRNqr\n6ak4\r\n=EDbe\r\n-----END PGP SIGNATURE-----\r\n"},"main":"index.js","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git"},"_npmVersion":"6.4.1","description":"The Material Components for the web slider component","directories":{},"_nodeVersion":"10.9.0","dependencies":{"@material/rtl":"^0.39.1","@material/base":"^0.39.0","@material/theme":"^0.40.0","@material/animation":"^0.39.0","@material/typography":"^0.39.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/slider_0.40.0_1537819255452_0.9215281032460909","host":"s3://npm-registry-packages"}},"0.40.1":{"name":"@material/slider","version":"0.40.1","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@0.40.1","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"lynnjepsen+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"f5e177b3252f6d822ebc339a50095a1dcd20eee5","tarball":"https://registry.npmjs.org/@material/slider/-/slider-0.40.1.tgz","fileCount":14,"integrity":"sha512-fkqGqw3MoN1rcBAIbcqC+f4fOA/xBUDtrqaflaLTK/S6/XJctFK0wwrehyhkD0o+/ayu6SZQenOibUs0bGy6dQ==","signatures":[{"sig":"MEYCIQCy/fPJFep6CFamFaKMezpfSoAzotgklY0ayGfGk+S5LQIhANTcv20Kwgy/6xPGZ5myQg3RanZgcwJ0RtnAC0WNnqDo","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":170412,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbu8P7CRA9TVsSAnZWagAA8iMP+QFHh6EgLINukWdRMqRC\n1W3qzwH8WC3piHijVk/xUhK1QYC/4mGVIwAHiEIAv0pc+2fT9HufDtm1KrE5\nzqMSO1Pcqpq8GAtNmFjxFSLwZoAx5Pe/vck/LCxzdOSMvpi5eeqF9yucgwFp\nUTeKkg1j32ef6CFzgm2x0LioTOemEqpO02OfAMx50C2e/FtusyqdCIByavZO\n9wZOKDzIvVy0q5JGu95VqfZkmG/X/EARnaRddI9Ly3/7Qa5Bp8Kzdcm8YgqR\nbaUbRSCh2HksWj/nP//JkVfCkjbaWYHX1FfM4FEkmw0RbZLJWygUCLJCRgfk\n5/pvOv0ZZcX/9bGbtjs1tMYNXvAsIaEyp/MO+4uWv9FcoC9W0b5dGWbQghPw\n7QE/CHisUC8RJKiPsVyMH0vryBzh79G392AJABNd8Bi7lhL24eZXh9f+61YD\nToT4iu2/z+VvzQboSHcz9A4e/VYOmEBnxHiofPt/eCIO5W2l1SkWYv1bZqn3\n1DRcq9lc4oKlwrmM2Z3D1BBvlLlv32iuZJfbqrrf9u0dW4bY3mBktyi8dTxO\nG2x0ixWm0kgcGiO7IPONdUWB2h9DWp5qnaKfRus9Qr2cQ9x9fh9cAVxZzNs9\nnst8ocTT+8a8eaSp+o2e8uewq7nLz7kmniqBOX5L9szZFtqGV6dwZDe0IhcF\nE713\r\n=GufU\r\n-----END PGP SIGNATURE-----\r\n"},"main":"index.js","_npmUser":{"name":"acdvorak","email":"acdvorak@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git"},"_npmVersion":"6.4.1","description":"The Material Components for the web slider component","directories":{},"_nodeVersion":"9.11.1","dependencies":{"@material/rtl":"^0.40.1","@material/base":"^0.40.1","@material/theme":"^0.40.1","@material/animation":"^0.40.1","@material/typography":"^0.40.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/slider_0.40.1_1539032058669_0.39671135429243587","host":"s3://npm-registry-packages"}},"0.41.0":{"name":"@material/slider","version":"0.41.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@0.41.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"lynnjepsen+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"a3c197da7f6f9c4c9b974d481aac3669c1d46a06","tarball":"https://registry.npmjs.org/@material/slider/-/slider-0.41.0.tgz","fileCount":14,"integrity":"sha512-u+riWFMeEiczu9bv+Am+28ICX6ba8S55Z+c5JUFtegZNILC76DAuYe++jy0huZw4j/RJXq8hDtj4wJQwvaFTyw==","signatures":[{"sig":"MEUCIQCUOpwXnAsAfjBFRaLalzwZVd2fuQL4tKtHGT0pia0gyQIgCiRpQJ0TegnxceXFhLiPx+qGj7DWpU8svOmFDSBoZBA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":170422,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb12vjCRA9TVsSAnZWagAA/K4P/2fyOFZDdtJblSlZ0Ijw\no0OYNG8/qUhGTFrqxxwirrKIp9p15+hd19ugtsn9+3JXw+SCmelWf6q0V5b/\n2cO0V6tnJ7IHMBh7UryDhiPY8I8aE70H3pACrb0PaGYEmIEgaO63HMd7uqgB\nROyZmjtnoOj6nt3PmBIVr3OlWs8C0Kqm1tw31N8IXagEcoVDnKJmB/31sNCI\nkOj0wJGgOoXVwWuud/ARij49+3niQeog+GFULAmadrqhLJKmAvFwFrUJ0tms\nsqMGyxhiYSUu89HaDD6RbTYi6qUSV9KcFOK9oHVvGdn0KBEqgmn5kseb6d87\ngXhvfoJxQ33Kgrtebm7H7P6+ixWEeG8v+iFjZf5lFOoTE3+IF1wT590x6IOa\nojonZEGiHnDKTNooLGKC5z1Ot9uKKMEdCeMYoFeeRml+AqAyzCaH57GPlGjw\nXLmSc78oMsazBKcASb/Yrg/eHUcOm3iJy68KGKn6W3HjCnrzeA4r/8mWNSBi\na9GgihD+x7l6YGQrSr9AKD+T9prooWy+PzcBswd4/yG6i+WTlP2dOwGlCs2h\nuixS9VIC/gvoftUuMAMJKZFP3IWyjqqHTJLt3ntpftUqYfIr/4RzRYDpz2Hi\n/JZ/9ABlgHl7yHWJZBcVtRwhWizyLUPWS8If3rcETjlgGCgKehpMdYrRlpqd\no/wv\r\n=qtoQ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","_npmUser":{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git"},"_npmVersion":"6.4.0","description":"The Material Components for the web slider component","directories":{},"_nodeVersion":"8.11.1","dependencies":{"@material/rtl":"^0.40.1","@material/base":"^0.41.0","@material/theme":"^0.41.0","@material/animation":"^0.41.0","@material/typography":"^0.41.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/slider_0.41.0_1540844514919_0.5312682060439433","host":"s3://npm-registry-packages"}},"0.42.0":{"name":"@material/slider","version":"0.42.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@0.42.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"lynnjepsen+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"286ab7c2074cdf8ecdf5239b5915930046b506e1","tarball":"https://registry.npmjs.org/@material/slider/-/slider-0.42.0.tgz","fileCount":14,"integrity":"sha512-9vcr6X5Jj4AoLndK0X/1Pi3jmiLqkYcRVwh6N0dIk2MeKujsr6vI3+tPZxNg5Zg34eED/sE+MPj1QjaDcZmtow==","signatures":[{"sig":"MEUCIBvIurOX3kDHr2Rx0kgFdZiRat+2uppmCbMZkyjN3slcAiEAmvA2gLgYPFDVrLXVoG8lpNOesy8ov6TJipCpES9Yvbk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":170047,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcBwXFCRA9TVsSAnZWagAAAK0P/3WPZyGYK3EryK/1PdBS\nj/ejNosxe9cqO+GhXpvvrwbIJeizW2PlAQFxcM7Z5T0jaqQqPMwBFZWw86uT\nun3U0yTv7nAAFYLFJ0i9SXCtVuc94VhjyuCZ7/GBH1vOnNT8Ba3jGwcwzXZA\nbQ2ZFVB7HE1fSI2zscWx0msVJkkR8n8WB5uyCnlGoVLy7r32dlZjsxCcInWF\n3HeITQzR2HIzpy/lQGQzuwJy+sny4azRBTpopsFqAe9chHu654P4904vhSXK\nSdoYlIwwRboZkGreXLe8O73iokUknJlZhwNs1+3t4042IVH2qiClz5oL4SjT\nAfj8uqxEc6AAKusBz/PRsCHXzfcGyYhPmzeTuLrSxaWI2tfKuF2CvjWQvlfZ\n441sLFw+LEO0dTY/uNXFAA0p/9LnDttxTyGl9WrmydOoOGRxLBB4wdMKBnj+\nQRlZ94/PQ+oAqoGJXPSrSrZ4Gt39vREGyGQnWEWWbfkkeaII9PyO1dlrKE6W\niGmnm5FHbtQASr7KQrCjHNq50DoqCh0zNUvpzTvQickuZV1J1XfC561Bic4L\nVvuNy75cuZU0et5tZXNP/yNw0NiGeakiQbdwQurUAbMr0Pr6CPsVY6FaOi09\nYF4fZv+qODNGTquLsgUBMJlaAMPXp3ukRLxoMbKSDv3OKsNTFCVsIf9pMHld\nBGQJ\r\n=bSYR\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","_npmUser":{"name":"williamernest","email":"williamernest@google.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git"},"_npmVersion":"6.4.1","description":"The Material Components for the web slider component","directories":{},"_nodeVersion":"10.13.0","dependencies":{"@material/rtl":"^0.42.0","@material/base":"^0.41.0","@material/theme":"^0.41.0","@material/animation":"^0.41.0","@material/typography":"^0.42.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/slider_0.42.0_1543964100695_0.3321387223365553","host":"s3://npm-registry-packages"}},"0.42.1":{"name":"@material/slider","version":"0.42.1","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@0.42.1","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"lynnjepsen+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"db7783afb03aeecfeb4e9c89c41469007c682741","tarball":"https://registry.npmjs.org/@material/slider/-/slider-0.42.1.tgz","fileCount":14,"integrity":"sha512-ftWntDdkk3fwmZWRQWZuE+1uFv2Y7i3L22IXAAzG9wl75+jmiF3G9q2aM1/JeFWC95TXtHZEZ4GrFaAVhp7c9A==","signatures":[{"sig":"MEYCIQCNA39coUIHTKsFQiaatGTaV11IP1NfabEnN0o8tVe0jgIhAPazmpxzO+2ODLOd90pNzyt0tIK3RXwzWoDSTC9nRanA","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":170657,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcGCJXCRA9TVsSAnZWagAAGBwQAJWnEG3j07G0KeOMPgC5\n6syrBYpusjyqzVE8aNER8C7te04EWm+i6/crVxezFpeq5Xvz+KZ9tpCe2Guq\nJsvEyoE1qpdHbEvuniaJXAeoI+5peH7bh276l2T9EphZ3wLZgzrdo7rM9HsL\nhXt21Mz2aX/1KDFU4HFZ2du1pKOOTnuL/gJ5NG4LXxx72NR+0opVR7SEQESi\nfeun3A468Zf5QutLJoYQAqy87W+qNGuYwOS+iFM/m53dD3pvq8ZwRdwVWPh8\nSVqSwSIwavbjeMWbe/EkiunD1owwz5DYZwCxqVZihSbpMapwWqeQ1x/qVQO2\nnpveiMYAlBhFuRuzC96M99JcUYjK/l46eui3SypHTRhx8tWYQ9gpPeDjHzgY\nPOnuye0ZtGAR1s36HQBhr/QHg7zoRjftoU5PhiGseRChyQgPQ8MZ86d9E0Zl\n2R5k1TwM/p3mBx8TfYv1+Mq3LD/o14gVwoWlSHQY0lSc+Alpr1B5d003RJS/\nq17JfZ29THk4YlfFCKxm4w9zjVHVaHBLQYYozJoTXOQdJiAA4wjFue4sdCAu\nkyOJBid1uImGA/F/Pu0i1qMgMEr4r6ciTnRG8VLX9FN9wcI2tc+uTu3vWJD+\nI1QeMUMbJK6r6MGPXQNOhYy3IBQyCcvILD6UeYHvXP8P2q1Z8+sv00g5o/dL\nkjgL\r\n=MCo3\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","_npmUser":{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git"},"_npmVersion":"6.5.0","description":"The Material Components for the web slider component","directories":{},"_nodeVersion":"10.9.0","dependencies":{"@material/rtl":"^0.42.0","@material/base":"^0.41.0","@material/theme":"^0.41.0","@material/animation":"^0.41.0","@material/typography":"^0.42.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/slider_0.42.1_1545085526097_0.6316583394237152","host":"s3://npm-registry-packages"}},"0.43.0":{"name":"@material/slider","version":"0.43.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@0.43.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"lynnjepsen+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"0812b49343bd5605372f36d1361a9c4809d43231","tarball":"https://registry.npmjs.org/@material/slider/-/slider-0.43.0.tgz","fileCount":18,"integrity":"sha512-iwAKseZAz7UcIROCTtUYsNQHbt8FsH4s/N6XXjSeGds+X/pj8FkidkDmLZDtGpQNFmfR7MbXIlXssjSzDlA95g==","signatures":[{"sig":"MEYCIQDnZzucHcamUYJBMmnrxwDvx+jxNI+JwqtJbNJz+tWAaQIhALzGEXF9BOf3/itolkDj3t3GDO3r+SuWxg9s98ytYPgF","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":447794,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcM60uCRA9TVsSAnZWagAAp0YP/A66mxZjIYCm1t3xuDOV\nY+mRMM44vvZR4Ig0DoxlOq4NJoxlALZ4T8I6GGmS6LluG4gJeHeUArLuL7Gt\n1nSrKApD2uP2I5v2VBif12Tfd4Lsbepfx/BbANJqTN5YFND7MFHPMkNM1Zus\nuLwzuV6/oX1WMyIn4tqPdRsq4ArPYp4mzKrrExaVqnOOjG9aAU5I/yFo8SmK\noLVQzWcOtk7Rua+5xj9ZHb6pIkYYPVTfW3Id4Sk1nxrVWDWDh/iT/B6zukkv\n51jDZzf0eDvhK6/H4nzk7yVzAFfwsZopGuMg5E8i7Kcpc5wF+ShdvYAhkiAk\ndP4mp1ay1EjvkKetHvlsQ9zSmU+cvCCitqFSNQo0oQ/GwRi7nSwHdwq1yOmD\nJt8+I1KCnDJcQofeJbelDDxzVr00BH86MjRGcohL2TWnZtpSGhYkPH/NtSPg\nNByC8nwfBGl+SiVOwncw5oxifkTPXUNR9NbQdNF9glLFzn+cyxizn2oQH3BY\nxT/fn0YXw8/PtXUOFWB/B9z77YIr/Sh4bie0uPoO0eS5bCep53KFzPvJ+SdU\nXPAc0eoY8RLYrtp3dk7L2c+buNgf7mni5filFTpZmDmnIHRXjvDqreZd68DB\n1m+EEebyS69+HeUxjH0aXiyIaBzSFsXdxeDYyf0CDIJbYgUzAZ1ig98DuVc/\nSnz+\r\n=3A95\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","_npmUser":{"name":"acdvorak","email":"acdvorak@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git"},"_npmVersion":"6.4.1","description":"The Material Components for the web slider component","directories":{},"_nodeVersion":"10.14.2","dependencies":{"@material/rtl":"^0.42.0","@material/base":"^0.41.0","@material/theme":"^0.43.0","@material/animation":"^0.41.0","@material/typography":"^0.43.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/slider_0.43.0_1546890541134_0.8047929093774981","host":"s3://npm-registry-packages"}},"0.44.0":{"name":"@material/slider","version":"0.44.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@0.44.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"lynnjepsen+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"2055df894eb725e541cde50a544719c07934755b","tarball":"https://registry.npmjs.org/@material/slider/-/slider-0.44.0.tgz","fileCount":18,"integrity":"sha512-Lnn2fdUesXX4O0UpJzveEuOj+og+dXCwhal73u3l3NXEdc/eRgYxwWdF3ww4MmCZ786EwUmjb4vIc9olN4DO3A==","signatures":[{"sig":"MEYCIQDGM2lebiH/SMb78IexSplRkIgthBPGyGrt7mdsMa4jdwIhAJYD6Dy5r+uqVIMTabUHYNqakWbWqNoV89LYTuS75CZp","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":449823,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcWIMuCRA9TVsSAnZWagAAQA8P/jIVaSv006VepLq9JEfP\nFgMjkIZmkEhjiItoaah3k/3Uly/L4JwCxZQPE06l+6HUwcPqFD0Ih9I9fYEo\nMGobDjex8b1Qpp2l94jJM4ZLrFqDjAesMU+9uUV22a7+nzlBBFdrNeyYDe2E\n2m5MnkhSaBCfb91AQ7vXbM7njyz9dX2xDI22UEIC9UTzPSldObKv0p8eghHI\nOiRJ/IaDA4q0RcAdRY5VOPEajaI7pcPRjv2mCwhnkvtT7MNNdFNVpr5O0uLZ\nXHkweVg13h/JqKtUWhkziUvfE6ePNjPGfkEmvXkA+u7HkYy/kcuHIDMJyf61\nZ8R2GHlOwHgwO7gvRRzFSjMVAdI9aH6DxBKO7Adj9yU2al6aa2xNyfXV4TZe\nxSJVC9ngPDy1LL22/5ufM+YZqTi/LLgn4FD8ahfSI6N1KR5TLI3PvVzkoJJX\n8sANwhu5V5XC9UU9NdjV7814DyfbvM4D3zVVnNSizPmRl5xMQJgblX2w6P/q\na04o26Q7tZGKBYNvyOw7z8CoKUblACbL/QASA/gHAU9oIalrqdQ1bV3ilH80\nDX11SSPns03PzdkrZApXnSv4LViZZDBGB/hF7VdbBEQGN5bv7uH1tHRW+e/O\nYqn/51gBsQjRrr9SUFrmqFnj/eFWRZOBAgPsAniDaqddgL/wVw5IrWA915Vs\n5O8d\r\n=z4bD\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git"},"_npmVersion":"6.4.1","description":"The Material Components for the web slider component","directories":{},"_nodeVersion":"10.12.0","dependencies":{"@material/rtl":"^0.42.0","@material/base":"^0.41.0","@material/theme":"^0.43.0","@material/animation":"^0.41.0","@material/typography":"^0.44.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/slider_0.44.0_1549304621666_0.414040244454309","host":"s3://npm-registry-packages"}},"0.44.1":{"name":"@material/slider","version":"0.44.1","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@0.44.1","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"lynnjepsen+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"ceffde0e70af6f6b583c943f8cf7fce5a855509f","tarball":"https://registry.npmjs.org/@material/slider/-/slider-0.44.1.tgz","fileCount":18,"integrity":"sha512-6sgpIaALviuUQqjSOmcm9APuPZR+29qNSLTFi3kj4vDFb1RXDjdN2uo60/qlWxeOOt0XOuYa825bW8VrJlZO/Q==","signatures":[{"sig":"MEYCIQDKHdguAYV8QlSDEWouucE5hULp3E/Cynmu6jDDsdw6rgIhAOL3zxJXX3tZflvvz6cj6rZsG0q8jJ8ZwmODQzN7RfGJ","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":449823,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcbIspCRA9TVsSAnZWagAAoI0P/jxbOo3M18SFkwSXId6o\n4wO4Po6emxWhxaKKh7OWW747bDX+oqvra8M9BGzN6j9MjQAFFpMHyUCA3jRt\nz/YXV3yAliKucmpaCrnXO2tjT1F6RewEehhnM8hVCnFLYyIAFB++L25KXtUS\nZBzYSRsj+EzDVOTA3oH7qGcv/uCIuMXdpThqNLO/8ReC00QG4GoB/23EFvVC\nrqPNpXGlgvG19pH5v5lkaViWWuNAJJOMqA9P3kltyvl5SEIe/5/uWRYbBiIt\n/ggMsAtTFzCdspTmAOetSoRQlLkcYVgPuaZ0U6eY7QczMRteB8ASDh3kHgfW\nX93s2s6wzydaWqlvdlDVd6HzVkne61TMvMNnRw3ngG9efrRo0n7yxquwlkFR\nEHbsEvPCh3SW/2XMMDZXI8+wrRcNk6nctii4Xrx82BOG4ei8lUMOCtQox2Xe\n12WIIVvOhJ+sLBeroJhs73JWEa7XMWKEebV1TGJ5xlkdf8DmTNIjyrizUUFS\niOVc+E7ZaD6sdtfvMQobrKT/26uF/Ea2f2CElBCb3vZWHXYOu9RILfKeDqZu\nrRLTb8La/PpNruAKeF4tkKYu8Dxl/tGsopC+faRzrTlzIIMyDbP6apSWm9+7\nECi4szRYsnkywuc3AuPXtBI7LhOvh8Lb4KHt22rTpQQNBr0UfZ5QcepLkx2j\nQIpQ\r\n=e+7Z\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","_npmUser":{"name":"acdvorak","email":"acdvorak@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git"},"_npmVersion":"6.8.0","description":"The Material Components for the web slider component","directories":{},"_nodeVersion":"10.14.2","dependencies":{"@material/rtl":"^0.42.0","@material/base":"^0.41.0","@material/theme":"^0.43.0","@material/animation":"^0.41.0","@material/typography":"^0.44.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/slider_0.44.1_1550617384559_0.3664881731529994","host":"s3://npm-registry-packages"}},"1.0.0-0":{"name":"@material/slider","version":"1.0.0-0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@1.0.0-0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"lynnjepsen+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"d9f722d9c6f0229527389ec1e759e29d9092c9da","tarball":"https://registry.npmjs.org/@material/slider/-/slider-1.0.0-0.tgz","fileCount":30,"integrity":"sha512-kuGuDBLWVLMZ3oiy/klqdJuzfVgqOCKrkQlxpbWpVdhVhv5G6jeyqVXKizEgRFSk4xVhmUsXVDE8djmZKIKIYg==","signatures":[{"sig":"MEQCIAzQGjForIAFS8/hAnWPwyJW1idb5InPhplDw6+5IqfOAiA9Z6+FkUUEs1YgYWnE3YfP/uc8mGG6pQOeb3RHLrEIjA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":561954,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcdyReCRA9TVsSAnZWagAAphQP/0S1nVvHYghjgxh21tmL\npCKR/uGuRuXzgHFFddhgtqHbVVnyNMLfM26bESg3BT2e1z1c871m+Wz44PK7\nXFr+k4M26V0bSzAsK/T8eXa41sysm9Xd+f6q71Yqs1V5I5fTxt8pnWq2rpjU\n5XfU6MNdsfoMEztuHgP5lpT/8e7QjENfSbFM44LwAf6fL1+T1A0OJguh2ooc\nNc8bLgZ3WiKH0AgZGiZU4rQT4yZn/T/PnQWfRs/pw4TUtPU6bKIvooSBZaVr\nSAYehrdDRav+R1pie3EXtoyW8Kt0VNvfyJXHGr6sn5XJtmeYZEpLbaJ/7N99\nNCR2wmHqey6VMgxtu1U8PYBWxwR0vDBt9fEe4JDp/y1Ri793I0+4flh8D2Ht\n1zyzeboCvGG0jgMj614sF0dTqhoWM6TvZfhRpXKNaK5aqrwIzRI3o1DRtuKH\nlNl+h/iziIT1cSKQ3LaHT9/Y1Z1fwunPQxXYJjy4esdwIFdduf9N5PBR7Z9z\n+gAFhUy9VW84hKUsAl+Q7QS15CbIJndwm93USbz5xoh5Yxaaf3sGRccwfTqA\nX4wHQUU4evJG2BD/bxVHuA3fkxeL0FqRL8T+32Tz33vUDwlyAXefb9O2nUQT\n78VXBkt/JIWoy3KxHxMd8EKTDruiLHA+D+eDbokViIQUqGlLGcmEhrrVMnsn\nZR5O\r\n=UKl1\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `appendTrackMarkers(numMarkers: number) => void` | Appends track marker element to track container. |\n| `removeTrackMarkers() => void` | Removes existing marker elements to track container. |\n| `setLastTrackMarkersStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the last element of the track markers. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`mdc-slider-color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`mdc-slider-highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`mdc-slider-rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`mdc-slider-rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`mdc-slider-thumb-color($color)` | Sets the color of the thumb (grab handle)\n`mdc-slider-focus-halo-color($color)` | Sets the color of the focus halo\n`mdc-slider-value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`mdc-slider-value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`mdc-slider-value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","_npmUser":{"name":"acdvorak","email":"acdvorak@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git"},"_npmVersion":"6.8.0","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.14.2","dependencies":{"tslib":"^1.9.3","@material/rtl":"^0.42.0","@material/base":"^1.0.0-0","@material/theme":"^1.0.0-0","@material/animation":"^1.0.0-0","@material/typography":"^1.0.0-0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_1.0.0-0_1551311965832_0.20754409997902568","host":"s3://npm-registry-packages"}},"1.0.0-1":{"name":"@material/slider","version":"1.0.0-1","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@1.0.0-1","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"lynnjepsen+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"f9250f6aa132194e314b78f8f30950520b6b507b","tarball":"https://registry.npmjs.org/@material/slider/-/slider-1.0.0-1.tgz","fileCount":30,"integrity":"sha512-TanU0DW5lAXOLZDiUyqqrEAJAISahTJVmQjObbSPwg0xAvEkdqJeL/kjcHph29o4eQ5uYMjlKfV9qgxRj63fwA==","signatures":[{"sig":"MEUCIQCOq9iLQh3wBWItrsfqtgnKBneuPVBsGFNFXAzklGLjFAIgMANouj9P/cRHyLVNrOHFUKnaH6mUIyPfnNVThsuBINA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":562008,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcfbW+CRA9TVsSAnZWagAAZ7MP+gL/5oVdMMd0Gyg4Layo\nCoG3C9dQ1NmGSL3Qn2LUu18hKNmZ4iOi14CZnOmtJqDZh65oerYjTPRglzaW\nOLr7W+qyBO8CuSCQKInJWBCKDKSrnf4AAL8eVpKs96TGhcjwzuhs4Dxot57h\n2Uts/Wy+tcCMLHleZlkaZi/fdbzeORNOaU7Yopx2xu9vLQF1e/mFq4DRi5l9\nrpzmjQim8HKaX4qhqxR61fvQBqXApw+d8coolSqGtksaR3PUCRZtwX+xKfRy\n+98kE1Eaw277byJmVKaHQfLXTYoB4Y+LmS1/yc5UYYodqnqs/hmnsMTH8WDC\nCmY3h9R/yHWsg81OO5+8rg2wasClc0amlSotpL1G9/QXnSV5PEWxUAXV+Tar\nj+GPfYnB5sfD7bL7t32sN20gW+x2lxJaArQBkDvEWXrlK6Vg6FWufRE9BCst\n4PyNWDCNXPVl8Z2KQ4QlTHj+WHaukC5Jx1ddqV1OztL5HvbWH1thvXz3fMxh\nPKo3pen8X03/LbhnCwQUkb3mfgPF5cu9jO9weHNo/V7aStU2SJnmn12BZRMf\n1A7KsKG8in4IrBD2irvtJTt+Pm0EbfXLSkEg5jkkwl59qySf/4AiIUiVYO2T\niXXVBBLO9JhC96j3nPmwg0TJLHAW7APu1dGC+MfmxbhA7xgyuXOaDJWT2XV+\nSBHI\r\n=04kE\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `appendTrackMarkers(numMarkers: number) => void` | Appends track marker element to track container. |\n| `removeTrackMarkers() => void` | Removes existing marker elements to track container. |\n| `setLastTrackMarkersStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the last element of the track markers. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`mdc-slider-color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`mdc-slider-highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`mdc-slider-rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`mdc-slider-rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`mdc-slider-thumb-color($color)` | Sets the color of the thumb (grab handle)\n`mdc-slider-focus-halo-color($color)` | Sets the color of the focus halo\n`mdc-slider-value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`mdc-slider-value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`mdc-slider-value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","_npmUser":{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git"},"_npmVersion":"6.7.0","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.9.0","dependencies":{"tslib":"^1.9.3","@material/rtl":"^0.42.0","@material/base":"^1.0.0-1","@material/theme":"^1.0.0-1","@material/animation":"^1.0.0-1","@material/typography":"^1.0.0-1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_1.0.0-1_1551742397770_0.9167136208243374","host":"s3://npm-registry-packages"}},"1.0.0":{"name":"@material/slider","version":"1.0.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@1.0.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"lynnjepsen+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"c5058cc89f0109861cba2c70950e9d762924cbed","tarball":"https://registry.npmjs.org/@material/slider/-/slider-1.0.0.tgz","fileCount":30,"integrity":"sha512-34DoVKWeZf9tnHjWU7Zmbn59vSh3NZ9Px7dQlWeCek7p/27hQqK4Rd2SjuIK1ewV0BYpboS2KcUSSyB4gcScrg==","signatures":[{"sig":"MEUCIQCXOmLAdVancuqOnzYJ4Tjr5hzYC2oKVDleJyTJHH9E4wIgAIb3i5pyCKI5bD+CiqX7+nyQSeZk4wk3841E/3/Djps=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":561998,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcgDa2CRA9TVsSAnZWagAA+lQP/RI+IiS6SDZEMpzY+J2l\n2jp5ASdQdYmP0Dw16DkicTUmmwGS9azZ3Emod2EXCnfXoOaEZdRTnPAqcCFs\naI8QWdk8MlsWQUMuD+OueqooalNNOYaszxMzNVlFXpzjoDkVjw4dS7aAskVe\nHzhHaugFFHjawY3O8oUS8LsMvuYAEoaRrX0r8wBvdzWtdiqf+fU2cvSFz7/S\nUQmmP7UR9Q4uEpyG6kIgC7RnlYCHND+Gb81/7NOcVEp7I5Z5PsSdRto2yGlb\n+CA5qfRoWTDm4zxFUZbMAB2jYeWzEIE8rUksLoCSV/vuzWov/2jit7Y3WLTa\nX83700iCeRcxSfgrecG60rR6NXqb2wCOHudQy0Oh+4xBxOZlthM1x9S1vHcx\nXbK0qxMIsN6PBWfQT7UDiAhGGxE3P0pZ6uaMtTQ+23ieJOTpWGBLAXHp/+Cr\n/MEecJw23ohglXm+JLXiTcPvPiw2sKVkBnwITYo6Ox5M+OwXKdrXP5ryqjF0\nn63huFj8PiRDPRlootBrgk0jJ3+0FDJbdRotoDhlwAeSr3EABVQADAfFGE8Z\nO3vWUcDFKkuHCleqbq7awf65MNnDVKjflXFxhV3z+VVdc/e+cdhWBkmJ1yye\nAiBOkSnocaZ7A0lvBCvOLL5Tsf1/wPMLQ0Ol96FgPmUG3SWyUW7+EbLZoCpl\nI+zy\r\n=/hZL\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","_npmUser":{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git"},"_npmVersion":"6.7.0","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.9.0","dependencies":{"tslib":"^1.9.3","@material/rtl":"^0.42.0","@material/base":"^1.0.0","@material/theme":"^1.0.0","@material/animation":"^1.0.0","@material/typography":"^1.0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/slider_1.0.0_1551906485440_0.6172477077705327","host":"s3://npm-registry-packages"}},"1.1.0":{"name":"@material/slider","version":"1.1.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@1.1.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"lynnjepsen+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"a4940b345d80e2b08d68ba284b9f724119a0a8e8","tarball":"https://registry.npmjs.org/@material/slider/-/slider-1.1.0.tgz","fileCount":30,"integrity":"sha512-JV/Phpt38LUVb2sQCr2pBsf0faw0E5LI7ag3dNF3hDq1f3F9Vcu+a8oNADi2M+TNlyelltAMKnc9guARwhDLKw==","signatures":[{"sig":"MEQCICww1PoRS2Q2RVCRtGzhmBJua3oqOuCuh4Vz3PXRVvZjAiAi1/oTUFO9U2d78F83xwpMpBhgzT/tWNUdnSetitFahg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":457844,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcmny9CRA9TVsSAnZWagAAukUP/3a2grK0ZfPjynvNZaFg\nk4B6Jig0Zh/HkSvAiej/TV/Th67Si+IBp6AbaSKjpUopZRvoVOLfmLIS2JeA\nZW90YYotd1pq6wuCKoTxZRvn7dJsu+rHtgFXqasPYxLt/zrgF8lT3pDfnoNj\n8ElArWegbztBbBnVODECaDK4Yv4FO6PYuk3Y3myj6gE1xqnBt5VKau1qod7U\n8U8DMsiyaEpaciyrY1LJ0uHWiqnSaCgbjTp5YsKNRdj/qqvVZ5kaQWXHTKcp\nB8UvMu4Of8scsOkZh2tTVecSqBFxnHwnAA1dYR66bkx2b/LIGcJREwIdqm58\nHrUNdwblRMaKiphUNdPrVkr/O43X1aqPv+rJj4ljJ6scQ8ZakgDhtkeJgw4s\nSbAgh7jpBZRZwqcYQSE0Qn7gIUdvxtSHMmnxfrEMKDWL9LyPZE7LNwiCMwuh\nw/O/hFQTniFdp0qqhfKwebX+X9WXyq9rgwKWuWfCp7HgDYetrm+7Qf9bwSri\nRadCLzVxZ7mm5E3HiGsJMshsu/L1tYofbkcuMSXPCOmLvUAkLRGlLdUwsR1M\nPyHak29WFjguUPM7C+WHBvHbJRUFRb8Omg3fWQxgSrJ6TvRVhB6zmsjXCT3W\ncQwrGTsRh7V982TWTcz6EmpmOT0LmsH8muxSlsSfrOmX+BAF7vPJ8hmonTtc\nKEJP\r\n=M5AX\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","_npmUser":{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git"},"_npmVersion":"6.9.0","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.15.3","dependencies":{"tslib":"^1.9.3","@material/rtl":"^0.42.0","@material/base":"^1.0.0","@material/theme":"^1.1.0","@material/animation":"^1.0.0","@material/typography":"^1.0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/slider_1.1.0_1553628348268_0.37649957101828213","host":"s3://npm-registry-packages"}},"2.3.0":{"name":"@material/slider","version":"2.3.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@2.3.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"lynnjepsen+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"abf8c17b0e51842c807f26eac0519728185f2c9d","tarball":"https://registry.npmjs.org/@material/slider/-/slider-2.3.0.tgz","fileCount":30,"integrity":"sha512-TlSwQ0d8ciD2qsZjrNrj0Qmw6AWlqkNJ3CrXVyqeaaL4JzS/oKKk7Ib83fJbwsSSeK6ipH3zGM7138R8OSj94g==","signatures":[{"sig":"MEUCIHN3rePaXPmXtjahKGFsTyFMSsNMleeP2wchslezOHIWAiEA7Li9VrFqKxySeEXwCBNQ+MLxIh+Xzah9wyFdiPOOV8w=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":516538,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJc7abyCRA9TVsSAnZWagAAJBwP/iosgk4j5cDDr9wec6QL\nkI1AJlSaq0D+Ngt8oS+I0EtFfmlrWwjOf3k7OM1axmn/gBi59voVCkEyUbjM\ngGwqkulcSO/7HhdOUckhcaDH5pbRW9yz72+lwh+BPEKN1E2oHc2mIXTfz/T/\n7//ZhbvNrJjtoCxbgUMBKVUtIYLrisDRfo6kiV6LlUB64Fhqr6GRvSfMUvtt\nuMQJf/wTVjv0hrcK6uFdyAW+WIMEGIx8eOExXVyzzQQyn+SKDc3pLaMX9HMC\nXvGZBLrJgjCqspZDEOrPEqsf90a0XbsoCv9x22dXzlh54iZU56s/e7TTEaVT\nJJuJ7V3S42rwDHLsM8VHTH4f7AJqBCzLrlVDd5nZATlVAlteCSwDrv7VJHTF\nrpSlwWuiKnVmUoAxIZRFM9yDc+vPYIwfTVInEydXavdOR/iovnBll1Fuyzf9\nf4nC09LuLhjkOfYYLJX/Je/EnHl7qMXvUQCxO8wCiLu8/wYyRpp9v7A3dPSL\nIb4crA05ca/elEtMU/S8XEp1mac4WUubKZLhEVCmQpwUOLFFPUMgDYz19Hjr\n5lNqIX3+x4GOBmkB8JVdVKmzk2iXD7APGxox4wSWiksIW1Yk5h5FjZKXRIh4\nrHnLal8jY4LSOzQsBUJDhTHInsU5DI2zOsv8rZEEmy0KibppqbjpWfomYM1n\njSnU\r\n=mInr\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","_npmUser":{"name":"moog16","email":"mattgoo@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git"},"_npmVersion":"6.8.0","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.13.0","dependencies":{"tslib":"^1.9.3","@material/rtl":"^0.42.0","@material/base":"^1.0.0","@material/theme":"^1.1.0","@material/animation":"^1.0.0","@material/typography":"^2.3.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/slider_2.3.0_1559078641298_0.6636617900879684","host":"s3://npm-registry-packages"}},"3.0.0-alpha.0":{"name":"@material/slider","version":"3.0.0-alpha.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@3.0.0-alpha.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"lynnjepsen+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"13f17e4e0041de162ae08e1ec3f4f5635c1cbd05","tarball":"https://registry.npmjs.org/@material/slider/-/slider-3.0.0-alpha.0.tgz","fileCount":31,"integrity":"sha512-9MmJsKGNjYnyBVA76EH+01Kkvxam/ZQoOCHdTXE2FYcAi38meTkpUms6WA95EgatzfvW6aYg2zNC5H2d9Z/RhQ==","signatures":[{"sig":"MEUCIEg/fx/gdt1sCEaS+4aZaf1RxJwF68vqlyxWsWAiKlrlAiEA0/AwPKrxZuToan5Xs6qxEW2R2aqfWJRIsnuMiHXg6GU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":517697,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdAHpXCRA9TVsSAnZWagAABnEP/2JNO/8lYhuP5xvgnfgc\nvScd6p8KfuHFuAoEXEgPjXgnWjqlTMTAwFVL6vZzq5cgcpKdmpPECf2ZXI5U\n06TeXMD8S2tpeMp+s27wRmYbxTiSt8DQ5YCA/b1tD9RJA8KeJO9gcqPhtnRQ\ns5e9Nyz8jBSnVMw78IdS+MiqcytcB9Lfa1YtenuYV9rSRNlhBQt0sdHjirkW\nzLfhEn5QdBcjtdU4J3cABWe0JtpkP9gsqStlw3s33branPxLXrxgEFGBVcQ6\nzjGjKODc9G+puBtkkyq6fpGBPKdsMKEjU+07hwGqf5cN7+8KvrugK5uo24Qy\ngnG2hpR3BKwHaRAYHBzpndVUQ/T7Jqfcv/hlU3Lklkb1WDtaY5zXR00vgdmR\nLtZKrLbazNssFEegKzy4yWtL2PEslw6pg3q0gpqH7/uu8mK9qobD/I3c4ABI\nXuGnfwOnnT3IMvLtdIcYtevebemMjtnXU0gtAR6zDJREVAiRwT8VB6XdSs4+\ndf4Y527yynQCUz+W7TWYGIRIJne+2jjmyfKOOGDmBkNxkJCim8mAluTOB7Pz\njHyP+O2Wz/AQ007Hd1mD+DTukHtyejw5c+ZM5qFwfS4LNkMxTnkz6cy8KhCt\n3uIsVEGF16mSmiOmxCsbltU/0L8w22svypkKjF5iucPIBW+FwgGJjYqXLgs8\nZWu3\r\n=DHfW\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `appendTrackMarkers(numMarkers: number) => void` | Appends track marker element to track container. |\n| `removeTrackMarkers() => void` | Removes existing marker elements to track container. |\n| `setLastTrackMarkersStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the last element of the track markers. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`mdc-slider-color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`mdc-slider-highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`mdc-slider-rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`mdc-slider-rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`mdc-slider-thumb-color($color)` | Sets the color of the thumb (grab handle)\n`mdc-slider-focus-halo-color($color)` | Sets the color of the focus halo\n`mdc-slider-value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`mdc-slider-value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`mdc-slider-value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"094e507fcfb488303e5adec97f7f985b30e8567e","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git"},"_npmVersion":"lerna/3.14.1/node@v11.9.0+x64 (darwin)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"11.9.0","dependencies":{"tslib":"^1.9.3","@material/rtl":"^0.42.0","@material/base":"^1.0.0","@material/theme":"^3.0.0-alpha.0","@material/animation":"^1.0.0","@material/typography":"^3.0.0-alpha.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_3.0.0-alpha.0_1560312406323_0.5419733310159855","host":"s3://npm-registry-packages"}},"3.0.0-alpha.1":{"name":"@material/slider","version":"3.0.0-alpha.1","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@3.0.0-alpha.1","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"lynnjepsen+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"4dbcd58480d9d9e122c428c9398eaab8b6e1a9ff","tarball":"https://registry.npmjs.org/@material/slider/-/slider-3.0.0-alpha.1.tgz","fileCount":31,"integrity":"sha512-O5nbkBUgTCJdzu9eEb9q2V9X+qQbSqu9HfTHcxwXjX1Pgd300lX0PwoWWGKmLap20XqhPnYfhRBZOogZtVIuyw==","signatures":[{"sig":"MEYCIQD3Zklt8NA4OW3Cp9GHc/rWWdc5Osiwcnpzl9CU3fj2DwIhAK5XYyuAeKj+frmWgM/2acANFQwutwefbAxc1pmeOPtT","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":517701,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdAUwzCRA9TVsSAnZWagAA6kgP/0cXZ8Rsj1UfW/tH2zKS\nG+FKZ3wZZq2elmJlpzu23hG8KF7VaEuei4h/YaZhPC1x4MKzf5XY4jF3LAea\nANCGnnpzLdhZ0dtoI/BW9LUGMJPdsG9gor7OdKRQOwoyYvthzwjnpLHaOqLi\n6yYY1xhNzQrvnXgU6aOkCLT5a0QYVxgXNDZFjYdUwGvcYd3JFbuUIQCJOrWp\nVMLX9MnURKxgH60ukaXrdsWJzS+nYLIMznXcR+hdNeFOUZevOyYKNEvhw2GI\nTBfcXohw1yQL+82UkJ+UEG+bSUP8FtjSBymykyKkPrfhX2iQRped3FiMvyfO\nL4GOTBa1RPXUID4CacTAGpuSkRjPmBvL1I0cbm6JFkrTTeh8oYLK19rS72QR\nCmUf6Msy0i2q23i2c+9p8dbyUJ3EMY8zwXboX/uz74u/D2ejP/oZVlsYTJyS\nx2PfKirtdfrtYcyUxkGhLLKdi5vYFRww0rt8i6NX3K/eyC1tqMAOVzHpNGEv\n/VrVeTzi0BtnqdSrgzEsIIbFB9EZdZr79h4PXIUH6sZgP1y7hcl2MxljS0JM\no9u0lOuIc9Nw96Muv3RlD4uKsI46MSSuHoont11YPQbNhDA2AhN0L2ekv/p4\ntFnnqfvmzXiw41lMYecKgTXt0wwaW/g/4Ikv9Wrym1abPNsNm8vQUZPebUU4\nRSmN\r\n=fGAk\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `appendTrackMarkers(numMarkers: number) => void` | Appends track marker element to track container. |\n| `removeTrackMarkers() => void` | Removes existing marker elements to track container. |\n| `setLastTrackMarkersStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the last element of the track markers. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`mdc-slider-color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`mdc-slider-highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`mdc-slider-rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`mdc-slider-rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`mdc-slider-thumb-color($color)` | Sets the color of the thumb (grab handle)\n`mdc-slider-focus-halo-color($color)` | Sets the color of the focus halo\n`mdc-slider-value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`mdc-slider-value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`mdc-slider-value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"dae97b98c21bb93075a9688cf1f9076a4fe5a85d","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git"},"_npmVersion":"lerna/3.14.1/node@v11.9.0+x64 (darwin)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"11.9.0","dependencies":{"tslib":"^1.9.3","@material/rtl":"^0.42.0","@material/base":"^1.0.0","@material/theme":"^3.0.0-alpha.1","@material/animation":"^1.0.0","@material/typography":"^3.0.0-alpha.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_3.0.0-alpha.1_1560366131057_0.25485797223341056","host":"s3://npm-registry-packages"}},"3.0.0":{"name":"@material/slider","version":"3.0.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@3.0.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"lynnjepsen+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"fa11f1b8e724dc2022587d723fadd5db411014c0","tarball":"https://registry.npmjs.org/@material/slider/-/slider-3.0.0.tgz","fileCount":32,"integrity":"sha512-XBKR95qjRmDviKVD9wJPqz0oeEe8mJMiaA4hgXb4NFaD0IODBudkvXY6tkTou+lD8vYd0krNmZoyVSbTdjeQUQ==","signatures":[{"sig":"MEUCIAJgXwEm7wR7o7CCB7lpNOumGlFntIWjmfgmuoSvmO2zAiEA5bP68KVAfh/A6FhkViaTr9/ziQ9kTLQCj9+yrNR1OI0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":531939,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdEp/pCRA9TVsSAnZWagAArHUQAILuna0AuW3+VYjLSScp\nrmIlgOJYH/xpyi5XJr+U6hQ8/2zMG1PxCdPijxFuruMF5iQzkxJkRC17tENa\nOe/fVaGMNQrHgiNtS+vFClogycKl69RO1qr4uXBjfJtGo9LrvcoJdEjIc8iU\nidZVTrDkye6MCh6PrqMZU/7etL/6Axgxl4Vo3yEys/pq4VLU9qTodvvyXleP\nE/5HeC1McOhql5O89RJEtcxz8vJpFkX64XgUYD+Yl8QFkvTTWbTtfds4Z+qm\n++kHWnU1sQ/BYudBa5lWGcdAbwxHGqu8J/8L8gTCPU7X1P/gk8qkVvjYknvc\nROZkuDRG50QFP7GTvC4C038LHC862KohlLhsoc8KORSlDzRUT1J12pbQVQe7\nMPtE8KcdiePoFTfE3H4srZfBPiw5UPuNBZ0Ozo4DsiP+BZu1qYLQqucr0fTH\nn/8L84L4FjP2gl8jJBsd5NNfuq2eJClUMNh0cmg68PAxZ5Po9pIL3XNT3gbk\n29AM/r7MmVhedezI5UQGufjV9At0G2UK9l573+KtE+V90T7vNa3wvLYTFRhz\nvCjP881g/fXIrBOoMz3p4P1dod8lh7z/oiRQH/tBhwjWrR4vk4GiTPIjiIhL\nnvWoN+3X5FmP5Q/GCmiEyB8z1MYNbmF08GLH3PAnmNESeDl4PGAb2gv8Yphn\naV23\r\n=OnTP\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","gitHead":"747f6ed544e3a3bb3fde71ceaa51359f2212bfb9","_npmUser":{"name":"moog16","email":"mattgoo@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git"},"_npmVersion":"lerna/3.14.1/node@v10.13.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.13.0","dependencies":{"tslib":"^1.9.3","@material/dom":"^3.0.0","@material/rtl":"^3.0.0","@material/base":"^3.0.0","@material/theme":"^3.0.0","@material/animation":"^3.0.0","@material/typography":"^3.0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/slider_3.0.0_1561501672883_0.15212568897201528","host":"s3://npm-registry-packages"}},"3.1.0-alpha.0":{"name":"@material/slider","version":"3.1.0-alpha.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@3.1.0-alpha.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"lynnjepsen+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"2ac4d7ebd673880e8cbd57317e960fc6157cbbbc","tarball":"https://registry.npmjs.org/@material/slider/-/slider-3.1.0-alpha.0.tgz","fileCount":31,"integrity":"sha512-ObtEhCqwQ2tURGiP4zR3FcN5ga/QvL4/Yyk9TzqRWtes1V4W8EhTUDtctLPVfribITGmKq0WH4zYDTcnr0SsiA==","signatures":[{"sig":"MEUCIQDJc7QBEnOKNNdrtmlbkcXqaaUtSkTjNjCByCgqYaNntAIgHYK9/HOG9+d9tsMXlhAFr+J0RzmNwGHU/I3xhX0Ys+Q=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":353293,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdLdEjCRA9TVsSAnZWagAA3ksP/iKjSxaG3Ve87MhGjHO2\nnN9Pf3UYZ+iSMs/+x18NulAy3nh3/XLGn8TMieKJ5U9rXadMl1v8n3Z6ait5\ngsJTVy+Sp/HzN1UUJbR8GHwRApwVxBceDRbzVwgppk3fg3INi5zhZlF3YUqI\nx6Z9dgrNm2nfqGcLwkyFS7Vjd+BB937+fgbX6AheEFpmVGM/y3zLvNQodv/f\nFLYaNMAiFofKTZ1beO1lPMR/eoJacn+mv+sERXF08Dy7OaDu0uyxEz35pFUL\n7tALTuqSyGRxl5vFs60W6GXWBfDKUaKRtcdcGPo7Ld3u9nFyRCEKH4YxEiw1\nPPjIGvQD/b4mc95USRpDvd1h5fCR5pLlpWd9w2PjMnmSu+tI3CtOo0Y/NLxS\nDpMNRvbkH+LnKB7tSgkOrrt00dDNFSwBUd2W/aBQOtyJvhD5QAmAn/8dcTr0\npMEIA/YDvGxvdyr6gMGwBp/tFSijsUninBE8vpQvP79g7K2zatbhUVToKUfX\n+4Z5ltV3nTCPuVMLEfvXVMbyA15X3XDjmjuX9vTcvs3k4SROD1E80QCnh87g\nEnKlu6j9JkPSpBxnNW+Jy1kXiZsqXXrCuY2ePwZkh4sJDkFRMnG6qdxjDuDq\nUzRH3UiXUIAOqNfADCtmtr44pXk0kow4dAu1P1VPAaiNmjAd/h/f3J28inRo\nGteE\r\n=CUPo\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `appendTrackMarkers(numMarkers: number) => void` | Appends track marker element to track container. |\n| `removeTrackMarkers() => void` | Removes existing marker elements to track container. |\n| `setLastTrackMarkersStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the last element of the track markers. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`mdc-slider-color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`mdc-slider-highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`mdc-slider-rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`mdc-slider-rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`mdc-slider-thumb-color($color)` | Sets the color of the thumb (grab handle)\n`mdc-slider-focus-halo-color($color)` | Sets the color of the focus halo\n`mdc-slider-value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`mdc-slider-value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`mdc-slider-value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"42b485550d87a4c3328a07847b4070d15f09af8f","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git"},"_npmVersion":"lerna/3.14.1/node@v8.16.0+x64 (darwin)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"8.16.0","dependencies":{"tslib":"^1.9.3","@material/dom":"^3.0.0","@material/rtl":"^3.0.0","@material/base":"^3.0.0","@material/theme":"^3.1.0-alpha.0","@material/animation":"^3.0.0","@material/typography":"^3.0.0","@material/feature-targeting":"^3.0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_3.1.0-alpha.0_1563283746518_0.5398889187918452","host":"s3://npm-registry-packages"}},"3.1.0":{"name":"@material/slider","version":"3.1.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@3.1.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"lynnjepsen+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"76f8352c41fcdfc163e13f59609a868a3e77b825","tarball":"https://registry.npmjs.org/@material/slider/-/slider-3.1.0.tgz","fileCount":31,"integrity":"sha512-rrkiQk6zC1X8YqUhAcQxPArOq2+wkxhQZvrHeyCqjasX93RaJAuflr3/FZBpwR02OR07NtPvG6NoyEq1nvuKhA==","signatures":[{"sig":"MEUCIQDxenPwh2CET5SCG3lPX79i933GX/i9MxNAjvEFXk/qmwIgA+zFCxRZ3/IbvDWsvwPl+4WGcjEMQ2yftY8Vh37R+Q0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":353673,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdNjJ+CRA9TVsSAnZWagAAzpIP/25HhH2JdbPjhvOviYaB\n/YGStBk6pyCI65c0pgq3SDLk4UmLWjwnBcZ7FDQEIWVsOrJez4IdMZLLppfd\n3a1Eh9c2hlNKANkpqlFWh/5VOWibD7CfQLv6q2D7Pr5kCHzTPr4iJQ/NVyuq\nuaN0MbckI7X/2cbySnlaBXBljrgKPo2HomCNRdPc0ZoGPd1nu2H827KMsLk3\n1dU9yLMOgLing6AqMBupjpISVTcUsVeNyS85yUmGxWPie/q4AEYUJPl6/tVJ\n5WGI/5z+ODTVJmm8mVqKXa/2beChvRKDvmSicPvoZPk9hR8FMhMkEyNkawAz\n6w5LIQAtVZ7+czzGGGkopq8zUWW1A56ofsuZcRDIZtq91WQKdfupKywPglg1\ndCXOxS/q9GpnDVsVjNLLygnnMxn52jhpZHecG8KbB1i51wo2rDC7tXCokc5B\nMl57v0IOWKStSzODjhPxt3cKEULXPdzJmN0C3YMAS2gqdMpje09vXeif0zR6\nbuqAC+PrfbeI80Z1k0FJyf97z0NKjQjzj2vVW6mQHvYpMFLV4q8j3KBJDyuN\nAagLdtatS44vDnT+EuBz9Epp70MLzcHyEjdEOjth/pGVNajsPIK2qKBjTiOo\nk8fuY8/WBSq28in+D6KGA72aGCiHFmIADgXKgz6N81sInzZknPF2T24ruSXT\nlL8y\r\n=F7Ka\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","gitHead":"6b7e616da1a1ca53df2253f6207642739e13b5dc","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v8.16.0+x64 (darwin)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"8.16.0","dependencies":{"tslib":"^1.9.3","@material/dom":"^3.1.0","@material/rtl":"^3.1.0","@material/base":"^3.1.0","@material/theme":"^3.1.0","@material/animation":"^3.1.0","@material/typography":"^3.1.0","@material/feature-targeting":"^3.1.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/slider_3.1.0_1563832957614_0.3211448939921713","host":"s3://npm-registry-packages"}},"4.0.0-alpha.0":{"name":"@material/slider","version":"4.0.0-alpha.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@4.0.0-alpha.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"lynnjepsen+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"ef107137e67457ab0ea13e165a91e24fded60d25","tarball":"https://registry.npmjs.org/@material/slider/-/slider-4.0.0-alpha.0.tgz","fileCount":31,"integrity":"sha512-Lam6B2SMRDwJmSG7/3nDong1o7dfBWQcws5Cg1HTflaFYTT9h8ItzO6lwmy5MRrtUcYe4dO17sL4Wuu+nv/npQ==","signatures":[{"sig":"MEQCID0L7TlT+LheoBq2mrimV7kfQER9e7yWzC70e6W/v03YAiB5sXGRHIa22X7aXe/4S5umXoOrqtY2y/8Kkt7GMc8wtw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":347245,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdSz4HCRA9TVsSAnZWagAASb8P/1w3g/Qa7ZhXWPXuqaIQ\naJuavEWOuPFhVnk2jflPcz0TdRMOdXvC09FcedMBpS+YirdB5QEZzzV2G4bu\np+Lj/VjcLbNMSMxjOd5+mx1DwP9FfTOGVRqvveybawzvpeRcc1GLAezGHq3H\nKKYhGyJC9J0E6EwhxaemGJ5xCfJdsAQPHNNkvkiQPW0OhNm9eqcaRbyoeiTY\nSb96MqWur93f3mbJdA5vlMHzBDoxCFC3UeNTBR2JL2bZz68aF84gXMRBoX1L\nkgv9YnXVuqBgY6h/ccvTqeSNl3K1VNr299QukOjXuwy/3+lfJLRLyljQqij+\n2AVLBan/Y3423Qy+oIpSl1GX0I0oYykPfjWftoQaClM3K8obeao6e4+dK40i\nVpnYhwhTqzAQ+lAYCFymlcyeu1eXvKSvjXHv4R7zLJYixbpvRNJOAsIAgYBn\n2VbjTvrlqA4yQWMHPEtgWCiqLQ/7igH5Dv6tSiz1UMdaZcUQOuluUWFYLbPJ\nXDtQSTokhVczPUhc6Zgah3fD8ujVyPtrD8Ocm/Wr2MmLA6LxqWlpnQhU5vry\nzFBFgoOImD4A3sUlH8oyeA1ZY/dTeAK0SAchWlKHP9iJL0EKii6Sa/aVY+6D\nyA6pF/J9U2JeznsoMFwsQayfZykxA3gU1A4UhA8Ef5WDR6GTrX6NkuC4O4RA\nylQp\r\n=C7QZ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`mdc-slider-color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`mdc-slider-highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`mdc-slider-rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`mdc-slider-rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`mdc-slider-thumb-color($color)` | Sets the color of the thumb (grab handle)\n`mdc-slider-focus-halo-color($color)` | Sets the color of the focus halo\n`mdc-slider-value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`mdc-slider-value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`mdc-slider-value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"184b37f65b79a260f2835bd44e422dab2402d937","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v8.16.0+x64 (darwin)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"8.16.0","dependencies":{"tslib":"^1.9.3","@material/dom":"^4.0.0-alpha.0","@material/rtl":"^4.0.0-alpha.0","@material/base":"^4.0.0-alpha.0","@material/theme":"^4.0.0-alpha.0","@material/animation":"^4.0.0-alpha.0","@material/typography":"^4.0.0-alpha.0","@material/feature-targeting":"^4.0.0-alpha.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_4.0.0-alpha.0_1565212166715_0.39707999838772867","host":"s3://npm-registry-packages"}},"4.0.0-canary.0":{"name":"@material/slider","version":"4.0.0-canary.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@4.0.0-canary.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"7d43265f6d21f136f86499256455c766a3772ff5","tarball":"https://registry.npmjs.org/@material/slider/-/slider-4.0.0-canary.0.tgz","fileCount":31,"integrity":"sha512-6TtCj1Wjb6KxVyiuOIPBeyIm2+rpVD4n+UwirwtK2mUtZCfyT6MLuueeHzPPVoy+WsSN3qSD8z2G6HtlVwGAqw==","signatures":[{"sig":"MEUCIGnFY/p/oGadHzkG+ccm7BT8Ey037TjPQl8YmbHNknApAiEA337ux87fZAZBYsn+hk0F41iaq+U2YRsVBKLILMsRS78=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":350628,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdcJEgCRA9TVsSAnZWagAAOUIP/1fKqzIH6FIeph50SE04\n5g5CIE4rdxVwcyFQ3Fvf/aneBlgqESUppSonHguO0YQ4vAEJSxnn7E6YjUuC\nUAPkxAYcE7fl4y/ufrA5q2hXGK7GZnwsDmOLlHtkCeEWibmqTzTQ5CipJD0C\nI3MIzmFHDYrxeOKdfydjgdFfW53mF+kz0C1l2OxX8S9QPtssQiwugOi36MW9\nJ7v9Uu1+BI1DlpM+CFwtelaOn0WkP4VdXGveqvQTQexp054zxc8zdrp39Pkm\nEaGhK7dk2aBIvqZ5cjyYH+8pyxH+UwbZ0ZsS83fdhXPyyPKrDtrOUFYLtENu\nn7N/TcSGZQnGvQKTq08kd3+0mbnD/1HROawGOol00+gUpZvsjSv3lN6oMy2T\nbrk+bfM7TWQuB9fmfWqSEhWU8lb4rH6CeH1ixpxpkGgY6gyAadGOfltUtB7S\nRzKpkHDoBssIzaKLTrGQEj/04r9BQX5EFiLj0/dFvbNkOM9yVVDpWF9LyPav\nT/xtb4prB7wsIbfvCcvp98KBThqFSXnF4FB5+RVRC/4ZRwQ6DDi6QX48wnU7\nbwME60dFS0H3BfX5ZprU+RIlLkkzG3Hi8N5Zbk9GTWskfKGgS0/usS95Tqa5\n0gsNO9a4DcEmxVSfYrlGy4VPxtEdxL1sFx0MVUe/aieIa5Vac/YbuLgvXBqK\nf3hv\r\n=1Y5B\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`mdc-slider-color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`mdc-slider-highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`mdc-slider-rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`mdc-slider-rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`mdc-slider-thumb-color($color)` | Sets the color of the thumb (grab handle)\n`mdc-slider-focus-halo-color($color)` | Sets the color of the focus halo\n`mdc-slider-value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`mdc-slider-value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`mdc-slider-value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"a9e69493144f4246efe28a958126afc2fedebd60","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v8.16.0+x64 (darwin)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"8.16.0","dependencies":{"tslib":"^1.9.3","@material/dom":"^4.0.0-canary.0","@material/rtl":"^4.0.0-canary.0","@material/base":"^4.0.0-canary.0","@material/theme":"^4.0.0-canary.0","@material/animation":"^4.0.0-canary.0","@material/typography":"^4.0.0-canary.0","@material/feature-targeting":"^4.0.0-canary.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_4.0.0-canary.0_1567658271596_0.23624112088121674","host":"s3://npm-registry-packages"}},"4.0.0-canary.1":{"name":"@material/slider","version":"4.0.0-canary.1","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@4.0.0-canary.1","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"eacd79466516322c2a88f9fb2faac0e7d64a63b3","tarball":"https://registry.npmjs.org/@material/slider/-/slider-4.0.0-canary.1.tgz","fileCount":31,"integrity":"sha512-lkgsvvz/dFL6AdWkOxzJ8DD2tcWCZtJ8F4yG+ZEbZjndxJ4HAPd0p6FQkdfGWSIWYwVKM7RfecSx07I3vyPYVQ==","signatures":[{"sig":"MEYCIQDKsJPT4l8RHTgjPlGsR2wHK/UxutZ+NzD3LiTKfhbZvgIhAJPlqHh4EzG8eXHgj8LsP2A1bL7bht60eX8IOCsvTSRc","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":352330,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJddrQeCRA9TVsSAnZWagAAGygP/iWVZIFqPTUKzEPsDiKr\niDUy2UBDqb6MFRF3pMY2iOpT6FVRNIyKHmMOxjWqK80MBJOWZ5JkKzE4SdWD\nbFdL9thB208c4s+fzLmRlGkIx7BitWLDnVrpZiQdRUzinEcyNdHwIqASEWh/\nJvY8ihHxT4U+yPGNtM/7rau/4ZigyNwZu1MNpoMuWob+rJm+Ue9lJQKW0zNH\nj4ONNs4m0pHwQOXktO4wqwmnn18s7C1rBA+ZoPx7JmQiFc73uW1wa4GckoO2\nfQ9efuTvgliyTC/Or8FuBO6NKnRj3+Kiyx/oevhe/H3D0GTZSV1yovE0Uoof\nDAkJYZ9+T+AFJSlE1Q4Dc1r0Re9DxDp0OKbHZJBqI1JX98qGP1wxgNH9KrRO\ngQ8KwIXOiP4tUW5tcQPnB0NWx6G79mJ9Xrf1aunRJheB3X42qso0GV/2cipR\nq+FYNNsV+KZgga77jXb1C+5DMg9/gN5KvSTW8QfuBrCR01Td8MsYoiijA9Aw\nsxUrkp44W+lBtSTRUD092wWjeyR/Yy9OUQN4S8nbphAYvfKAOASnX44fIcef\nCkUwg0jRokwfZBwD/4BfRe1jqplAL9usGqLsQraClJvA1zTP7XH75nhmPj/6\n/5W0egBhL0vh4NKw8hffomGutqfShUO4vwS5Dn1gr6EPAQFz3KBhtyLvoled\n9NJJ\r\n=XI7D\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`mdc-slider-color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`mdc-slider-highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`mdc-slider-rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`mdc-slider-rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`mdc-slider-thumb-color($color)` | Sets the color of the thumb (grab handle)\n`mdc-slider-focus-halo-color($color)` | Sets the color of the focus halo\n`mdc-slider-value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`mdc-slider-value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`mdc-slider-value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"edc72a4d7d6a61d61620fd05a80e2491e518bccf","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v8.16.0+x64 (darwin)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"8.16.0","dependencies":{"tslib":"^1.9.3","@material/dom":"^4.0.0-canary.1","@material/rtl":"^4.0.0-canary.1","@material/base":"^4.0.0-canary.1","@material/theme":"^4.0.0-canary.1","@material/animation":"^4.0.0-canary.1","@material/typography":"^4.0.0-canary.1","@material/feature-targeting":"^4.0.0-canary.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_4.0.0-canary.1_1568060446154_0.3683735193201101","host":"s3://npm-registry-packages"}},"3.2.0":{"name":"@material/slider","version":"3.2.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@3.2.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"82f7adae771b0ec546383eef7213155c52eb7a99","tarball":"https://registry.npmjs.org/@material/slider/-/slider-3.2.0.tgz","fileCount":31,"integrity":"sha512-8c1u9jfulYqTNtNgaiZnAHyLDyJovQ7oHms+tzLaRV9rENT2pu3Z9H/2KIlpYkYx/5DI0Uv8ogC3s2+zzMc1Dg==","signatures":[{"sig":"MEQCICYSWuSOcIeeEU4NHvbK+PLprYZI//riWnbink9HmOiIAiATuFn6DhDpTeC8Go3ZiPGQq3bPEoyKtOhn/OxAij07MA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":359938,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJder5qCRA9TVsSAnZWagAAKzQP/1Zpd78dDqKs99SzIO6j\nVE6kAZXr7tPknmA6COHQbUgKaLBz1JpxQvhb84NJUuUHGJnqmSZxvE/spWL6\nkFT9J7hOEQ9ULtGXebQamqiTSuHyVylqnItuULc9bykyIQcaotkcDxABxdq2\n8qCkvX8hIHF+F/uJTI/OPQUaHcZI+MYvbPHhrTVvQRR3aGw1MWLT9dCA8uVX\njRtlj/NbQlOu7HWGcioS2MXNqh76XHNCIGp7kWnsgIQ1NSfsMzYGJEx/L7Ur\nnvrx5xJitty5lMu2pM7Wh11WFcqsm6lMhzjIZ5c8qp4s8ekGPOKg9OCUcpGH\nkdQfhbAPSt+tpJdMkLGWHfraEigndaf1h2OXBeiudHZ9wxBTaAJnlHXbrUkD\nVGOKosx85FtfHhwkeBGJzGiFInWdcvweveHSZ3iqSiz3tHNZuDqKMXVJmOFc\n7pm4cr+BYEoqnoNlwLEDQC9nQzTFqPxt8QU9S+0NgjfjmEpf1SoOU2imzmMO\ncl+iZt8otmIpSLMSvHJJZqQrKM42FXJAoO5LcvFSiGqLEhursgAtPH4g1aN2\n4SrTpousZhwce9gK32fFtaXyA1kkTRPiz88WdB7NYTSsdE2p3DoAEddpmghv\nts293yoYmaIe2+uQi37CBnqadxDgQGhfqNndvH9YbvMV1F/wWvM4Hlmp9LPg\nDnrr\r\n=HxV/\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","gitHead":"abf67305fa705591abea3972006a18ab5fac7f63","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v8.16.0+x64 (darwin)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"8.16.0","dependencies":{"tslib":"^1.9.3","@material/dom":"^3.1.0","@material/rtl":"^3.2.0","@material/base":"^3.1.0","@material/theme":"^3.1.0","@material/animation":"^3.1.0","@material/typography":"^3.1.0","@material/feature-targeting":"^3.1.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/slider_3.2.0_1568325225850_0.9619785480366148","host":"s3://npm-registry-packages"}},"4.0.0-canary.79d881baf.0":{"name":"@material/slider","version":"4.0.0-canary.79d881baf.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@4.0.0-canary.79d881baf.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"ee911bafc32b0f51ade90cdc397f701b8f92984b","tarball":"https://registry.npmjs.org/@material/slider/-/slider-4.0.0-canary.79d881baf.0.tgz","fileCount":31,"integrity":"sha512-igQHQ33RzuzEL6MncKTOfpKXBN1vzPYnuFQ+R3xRgOd+bBNpNpjwlky/KQInKl6Sihqr3U8I5Rz68NVksQnHaA==","signatures":[{"sig":"MEUCIFUABAWsnbQRHk1POpIdNC+8FOwuW3q7sWRm5W29a7mrAiEA+Op2WvvBrcDqmGEJGZtCEfiHvk51uoBhSs/G1u84L+E=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":356200,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdev0vCRA9TVsSAnZWagAAHUcP/3dAcEOcYlIP+mk+ap0W\nNMYIYta8EEgeF958zn7xHl60JGV537WCBTnvtKNzDSdWih9EDYXI7zFcq2h0\ne83jyidBAY+bC2ChrJky15v9fRAFZIepPofKSQYtYOWw229gRbN6KBNDqA3i\na8e4ScOMJ+07vIjEO1YytnEkvhenhxgUp+HDAeXmEo86IjZo2OT48o7JKCfP\nteg2TAPQSvqs9Bn4iTAR6I1Pu0IBDMz30HWPsPG72o4oylIO8VKC0xH7pkjW\nASuHkYGsw9KYBZozz7HBr8nHocfixqdJCpAo8+rNpopd6R1RunORNKzRj5nz\nZFNdwG23gsR1M8TRCul5digPtPSLe5/McAD3aEX2Gym9tIogwKXDpGSBRY47\njIKB8rRUFrVOTyS0hlAD8UYUSYOaHiwLj5P+JczZTdpvh9I/qahm32o/r+9A\nA+yLeizRR2xZy0cYwTq1t7bPTROvKPAQ57MRvWH4loUyPEG2qu6r8uCxgyK/\nNCeosYl02BEtV98RHjPinBJyBXX8P/+vRee9Id3H7QyVcJZ1LgczA9tRphJw\ngHsjyecKl92GwNlIzieNfvVKppDDmgOl5OcJl2FXz2bxmilVo/AK5wsSbfhp\njSJa+214MqeYSfpTXOAtQrHkUjUy63vUH/OkqibtMb3p+50aCj7eRgi6e4ep\nEtMm\r\n=CKRB\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`mdc-slider-color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`mdc-slider-highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`mdc-slider-rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`mdc-slider-rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`mdc-slider-thumb-color($color)` | Sets the color of the thumb (grab handle)\n`mdc-slider-focus-halo-color($color)` | Sets the color of the focus halo\n`mdc-slider-value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`mdc-slider-value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`mdc-slider-value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"756806a2389389441b5b3c130de02948130d96b9","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v12.10.0+x64 (darwin)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"12.10.0","dependencies":{"tslib":"^1.9.3","@material/dom":"^4.0.0-canary.79d881baf.0","@material/rtl":"^4.0.0-canary.79d881baf.0","@material/base":"^4.0.0-canary.79d881baf.0","@material/theme":"^4.0.0-canary.79d881baf.0","@material/animation":"^4.0.0-canary.79d881baf.0","@material/typography":"^4.0.0-canary.79d881baf.0","@material/feature-targeting":"^4.0.0-canary.79d881baf.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_4.0.0-canary.79d881baf.0_1568341295047_0.7679168166560661","host":"s3://npm-registry-packages"}},"4.0.0-canary.e851d4f40.0":{"name":"@material/slider","version":"4.0.0-canary.e851d4f40.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@4.0.0-canary.e851d4f40.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"06aa2e3900f29ba07182d1a79b44be704a6a28ff","tarball":"https://registry.npmjs.org/@material/slider/-/slider-4.0.0-canary.e851d4f40.0.tgz","fileCount":31,"integrity":"sha512-CVNrgoML+VCmm1o+C1bUWtzyxzlyIGMKCUZuxgBwwfBKiZ58pJvRdYwQJnpdMYaPxeftb4EPEU+UskK7f3hnfg==","signatures":[{"sig":"MEUCIQCjxflRKNkisrzf6SvTfyYJz/VM/eWl/zF00WzRT+0sXgIgEkyGd33xIz4BrlvEAhMJQCTvKYyJ+CdzW3ELm9MK9fc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":361040,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdexX8CRA9TVsSAnZWagAAd5YP/1z/JBj9ojTiVx1ywNhn\nIoBYDv4Ca0313Rw5va5CjRQMlPvav3+Lzs5WqXPujttkpWOMLSXefQ2hfgqz\nNbv85+EgWr6bskWnHvfw/B8pfLGue4lPQLC4aDofdBYb8XBikrMuf/ezIqpz\nNXaeaDxIDIglxLxAvjlKRqyjlMr+L0yigCb44zZ/n+Z4QHiqHysQq9o3qC9W\ndS08dz3R4npfpoaTlPvdF7JgTMdbT1M6daInGWlX9lVSdm0Z7S4FoZUakmNf\ngmMRa/ZubhWSp6/dOLoX7RzwFSnlFVauseYJUj1cWm3oT2huM2GDLO76hjJN\n8ga3XG1ykMYILCwThU+RF8gZ1k38zVGi2uxtL8tNdU+yh0zAxqlQhro8yOzs\nAzw4HJpcgevys8AwDfLzfKhqBprs5Y/JxSBXDsAvpBhUPnx1uhkMwCw5JML6\nkf6Zo/iaQ6WyQZUwyoZDZhJF1PCWDA6mSL6NjcGyTGLpGLhY9muDDcErxuS+\nWj1r+0JvuyEknY/uQyDhBpHl9dPQyt72MGVXKkfe8Vy9IH1zhUTMsGzHKVIH\nqIKmAgklquWfNqP8iVNCiwgS5EQB4lnYV+tNA2IEsJAGWymylYhNnrJQvBp2\nyION5DeKrjfANd816ga3xuSxeCVQOX6dGpkPYJGz4AEQ2Pwz1EEJQIMqCf7E\nHp6e\r\n=rwep\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`mdc-slider-color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`mdc-slider-highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`mdc-slider-rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`mdc-slider-rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`mdc-slider-thumb-color($color)` | Sets the color of the thumb (grab handle)\n`mdc-slider-focus-halo-color($color)` | Sets the color of the focus halo\n`mdc-slider-value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`mdc-slider-value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`mdc-slider-value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"353401bd143fdc2b4a85abf330176228e21dfe13","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v12.10.0+x64 (darwin)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"12.10.0","dependencies":{"tslib":"^1.9.3","@material/dom":"^4.0.0-canary.e851d4f40.0","@material/rtl":"^4.0.0-canary.e851d4f40.0","@material/base":"^4.0.0-canary.e851d4f40.0","@material/theme":"^4.0.0-canary.e851d4f40.0","@material/animation":"^4.0.0-canary.e851d4f40.0","@material/typography":"^4.0.0-canary.e851d4f40.0","@material/feature-targeting":"^4.0.0-canary.e851d4f40.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_4.0.0-canary.e851d4f40.0_1568347643845_0.37647849001548406","host":"s3://npm-registry-packages"}},"4.0.0-canary.905884690.0":{"name":"@material/slider","version":"4.0.0-canary.905884690.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@4.0.0-canary.905884690.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"10e8564295773794833ba4a78fa1f32a90fa0a56","tarball":"https://registry.npmjs.org/@material/slider/-/slider-4.0.0-canary.905884690.0.tgz","fileCount":31,"integrity":"sha512-Y3FgBQBXYiFib7F11AlQbUE3D0tuQ4cglNt2soXGWGjx2LaAr8PVyJ8RN72PHXCvvqKncJl9UQeM1Cx4VOAbBA==","signatures":[{"sig":"MEUCIGzI0Ym9yOjzC2F+/zV84Gbj9TC4YR0+RkBdKQ6f4/ZDAiEA24or9wT10REO7ulTi8+A2FXTv6DC93MDqGDZVt9ctls=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":361645,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdgB87CRA9TVsSAnZWagAA0OYP/2F0xJscrQ7ZfG2uLdeo\nBnsare/n07frfH6TlJLfNvDO3GtP+ZOOEXjCXxYx87So04cgu3Rl177q0mVY\nP+/qofGTl0V9tdv4zEvYPsYdJBEr/ObHE876EFY4McwaQRDNElK6NX25x+/g\nBLBbbB+VYPFWpQlMgp8X+Nf6mTOrsB7sTnyqRfPAOVyjysM9IWFUkhqgZHI9\nDan7ZjeTCEFdeDH4npmq8SXBcNxhUa+5rcq1jzmQD9M0jCb4CR1Djvl6U7SG\npumkJKz/oSw1U62ydQKsriwNbgRIXfCXqE3pcyDudOEm3wVbzOelJbY0F7+S\nN+Xrd9wQW1fjYpYoa1rr+5pEwht1YuzN7wyz+RK00CfrSxDLPhi7y82dRnxy\nQgFu3EgExp/iopiHBjwKYesbyyLiEX8523ZeEqewjFi5ZVFg8ebN9kSlHJCq\nLlVo5bTcps2GQEH7Xz26CdkKeSiiVsuagRpOjaLP6JwW1leRNvpLrH7VLB0c\npgdpcR8iNKLh65okXfSQfPy1J8dg6WgFrpIl/Lc/aUinSfQQJiwtMxZ5Na4/\nT8zyz8GhbshtYHTHteDgE8wvgMZ0z1D0EBacbl51tJ81lifK1wpgYEtKpyIx\ngEcKPKwwD4OS+rI4xkYELLI4lLERDePGNJQjfXFnKpVXjBPcgXwKMicX6DHw\nFi8f\r\n=CNdh\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`mdc-slider-color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`mdc-slider-highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`mdc-slider-rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`mdc-slider-rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`mdc-slider-thumb-color($color)` | Sets the color of the thumb (grab handle)\n`mdc-slider-focus-halo-color($color)` | Sets the color of the focus halo\n`mdc-slider-value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`mdc-slider-value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`mdc-slider-value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"df7fbf65943b1227b1bf145a2774abe7710b1e30","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.16.3+x64 (darwin)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.16.3","dependencies":{"tslib":"^1.9.3","@material/dom":"^4.0.0-canary.905884690.0","@material/rtl":"^4.0.0-canary.905884690.0","@material/base":"^4.0.0-canary.905884690.0","@material/theme":"^4.0.0-canary.905884690.0","@material/animation":"^4.0.0-canary.905884690.0","@material/typography":"^4.0.0-canary.905884690.0","@material/feature-targeting":"^4.0.0-canary.905884690.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_4.0.0-canary.905884690.0_1568677691242_0.9192104879586498","host":"s3://npm-registry-packages"}},"4.0.0-canary.199534d61.0":{"name":"@material/slider","version":"4.0.0-canary.199534d61.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@4.0.0-canary.199534d61.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"cccee3c72489f9bdb12b1f6af4d48b466b1c1f73","tarball":"https://registry.npmjs.org/@material/slider/-/slider-4.0.0-canary.199534d61.0.tgz","fileCount":31,"integrity":"sha512-488ATC+amlCnRI3DiWpQxhs+2VWD3sUPtDI8OdtVZmP+uaakzERMAETjfDZwdV/Fb5gYALfiDUW/iOoBXXWq7w==","signatures":[{"sig":"MEUCIQCN64nYW9hCUNDKsk/BLrO0L1UE70WGoJ7D+m3jHXAVbAIgB2Hu3VxpQEnOPP4uey13vhVnIp28VzF0GkTZDsDqa64=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":362250,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdjlutCRA9TVsSAnZWagAAyaIP/17Dd++nOH9WxT1sbhFQ\nqIIVhcBdBqvocJ2iib7bXURMq1mG4xPQOCJ0mTykYUJ4oFARnRVWOZYitp7+\njxGfIRCjWGf5nP9VeXu7vsnz8SalAImhFyLkZxjNva6p+sgZr7ks3q9WXo1S\nszHxjUxqYRdq4qkPo3k3vmmruDwBF/m4RtAmgZE48T5mV3bqemNg6Fn7XCS/\nfQqngdTPjjRg/1jPREJivUYTZejZR4K2X14plBoNBnE0P2DBXoYohkEkMxvb\nYKL2ibfRKB2pV5STuqbsfQTS//DURF/VApm46khnbwAXTWYmjEIMKoYMI8ce\nHhGHJzo2c4sb+lKXju2ggdanP+7WYWgrPlHxlpfUadsQqZGuBD/cHckoSK8l\nlb616BHRap82C1fvVp/LJsuD9kOE/EmNuAqv5QfcrCIRy+hlQgjOcLE+OMUV\nBmWD1YWv90yDeT2RFhMuF3w92eHRctsKRnhC1y4ABXPn5KELo6dUXJGSa8Me\nR7O0XqpqSwJifAbjQ0yJ3BygmRHSXQOIticelQhyIagyq5UF4GQC511dmmoP\nVHRbI1bIVhzMY+qtAICUpHHmNExypmgaapKCvPTnhCLffSObMv/luVfuheL8\nt4vV1bp4XVcoLtKwhB8Aj1pIDoDzQaKP89migu26c3ZhlSTBrhHJfP236HFt\nN/Z2\r\n=gWr0\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`mdc-slider-color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`mdc-slider-highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`mdc-slider-rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`mdc-slider-rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`mdc-slider-thumb-color($color)` | Sets the color of the thumb (grab handle)\n`mdc-slider-focus-halo-color($color)` | Sets the color of the focus halo\n`mdc-slider-value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`mdc-slider-value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`mdc-slider-value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"c35810420b70c99e38a1438e1fd44e4bb84e21be","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.16.3+x64 (darwin)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.16.3","dependencies":{"tslib":"^1.9.3","@material/dom":"^4.0.0-canary.199534d61.0","@material/rtl":"^4.0.0-canary.199534d61.0","@material/base":"^4.0.0-canary.199534d61.0","@material/theme":"^4.0.0-canary.199534d61.0","@material/animation":"^4.0.0-canary.199534d61.0","@material/typography":"^4.0.0-canary.199534d61.0","@material/feature-targeting":"^4.0.0-canary.199534d61.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_4.0.0-canary.199534d61.0_1569610668641_0.8337110453120409","host":"s3://npm-registry-packages"}},"4.0.0-canary.22d7ad2fb.0":{"name":"@material/slider","version":"4.0.0-canary.22d7ad2fb.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@4.0.0-canary.22d7ad2fb.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"c01c9465c478ad82b61c303305dcc507277a7616","tarball":"https://registry.npmjs.org/@material/slider/-/slider-4.0.0-canary.22d7ad2fb.0.tgz","fileCount":31,"integrity":"sha512-P8K0IDL+YPECTB7ds0FWMt9e6K0xx26fJqLv4ar8atYFeL/U5xgSkaXaMFOS/TYS+fdB/6I/cNuV4+kWLz0Snw==","signatures":[{"sig":"MEYCIQDR7yHv5fd7PZOeZJgMFxeXgjhOHr4CcmyhkfhWfzJI6gIhAKdA0ZZmbr4AbIzrLXPnHanOF0cq2/qpd6AiQ4SjKtHQ","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":362855,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdphaMCRA9TVsSAnZWagAA05MP/0/On+VQ+gGNb6i5XeLM\nfYiqTfhLa6u2r0JksQ5eTh69F38NGDcOnN9MgZBhCbIspxWTLyIwylVt6fHm\n2CasZf/JJ52oa4davU59DmzY9wiwZmW5KIqSufTs/l1z8wjQ7ptLRMdVe6x3\nMuC9XHQPvK6k7lFzklOHhhx4hr6uQHePfQC3muEgtIj31S6MZYxmomUL8b5J\nLBslE+55lK7EOBGxoUbQfHkRspvFPOEkcQ0oFyOqXun1B1LboxhQStgronyc\nzaR3fIlsnF4ou4VcKICnjBf4zAYexGt6RF0UmA2yBcPMYGm8jM2QG0vMfYT7\npszHvGQmTg7qp/bd5xI6KzWToY9zhUEQB0DZ40CTjajpqOa6igwf/o2QD+gC\nvf88zvrtCUPO7UHuNUYtXRl1+Hha9mi0bvYpfbpUlFcuFLpM1QODLoomYHb6\nerbqiqm9iQc3UijlvwsfmmRv2EJScawM77KuKTXwJmdJI0CGES6RXL+uoRYq\nQHkt6s/U/dqkBIfdwVoKjKdnmFleRuMdje13lF5l1nBx6zH3alT3qs5elvst\nTEeu9d0J3cWt+oqPch43zXhEf/6/+RLjncRvSVPHFgZLuGMVfhGQxQPm9R62\n7XEIDeKTyRQAeQiMUvYXYtkwvTOPB93Q/HRvv1j15p+wLYlHnZCmIW74yj1c\n/6za\r\n=QiT1\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`mdc-slider-color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`mdc-slider-highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`mdc-slider-rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`mdc-slider-rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`mdc-slider-thumb-color($color)` | Sets the color of the thumb (grab handle)\n`mdc-slider-focus-halo-color($color)` | Sets the color of the focus halo\n`mdc-slider-value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`mdc-slider-value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`mdc-slider-value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"bdc05bd56f8cbc11face1f0f2787fdb17f450fe3","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.16.3+x64 (darwin)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.16.3","dependencies":{"tslib":"^1.9.3","@material/dom":"^4.0.0-canary.22d7ad2fb.0","@material/rtl":"^4.0.0-canary.22d7ad2fb.0","@material/base":"^4.0.0-canary.22d7ad2fb.0","@material/theme":"^4.0.0-canary.22d7ad2fb.0","@material/animation":"^4.0.0-canary.22d7ad2fb.0","@material/typography":"^4.0.0-canary.22d7ad2fb.0","@material/feature-targeting":"^4.0.0-canary.22d7ad2fb.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_4.0.0-canary.22d7ad2fb.0_1571165835979_0.820043715359156","host":"s3://npm-registry-packages"}},"4.0.0-canary.735147131.0":{"name":"@material/slider","version":"4.0.0-canary.735147131.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@4.0.0-canary.735147131.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"46549e33d02138a792ea51b4c5e47366bef2a403","tarball":"https://registry.npmjs.org/@material/slider/-/slider-4.0.0-canary.735147131.0.tgz","fileCount":31,"integrity":"sha512-q5Ax5gouCDRHn/AjXtlyjeodmqcrTX2vALCiLZy4UfBn+FpWvMP5GbFhrMbwXQtFM0hdYrlnDLWwVD7Ow7gmZg==","signatures":[{"sig":"MEQCICC0UWP/yG7iXAkhvNHpRxhwOk15xhDkst1OcP0PgUdNAiB65Ojh7vNc2l0NReaSjUaXFi1cr7uEKS3RO0GFn/jJvw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":364058,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdpnEYCRA9TVsSAnZWagAArXoP/2LnZiLFVcDP7/5RM+JU\nksLHhl6gFIBYdWJib3925VfPWb/qWGeXmNBoFrS9SeqVBx3zWvpDZh4QQLCp\nC21pcMYbpWof0SMp9dpskTaTti07g5lI/IRI3OVrYw9r6Dttw2TPtcrH1BPA\nz52++p0/lBilj7iuxLS8RysdAGGFjVz5v7i/7fgr++VUiIiqelgmJxPkdIKr\nGiRx4DFYqPJlzhsHovKKfn0Vy0x23KCdiuClU3eDXFs3XP66MeoPgIxROZtd\n9z5u90pAR/xqDEtW0wZwFcCJF/3Ijo82cPXYuudlDfkcLAx1JN6eVW+hnm0U\nqjOEmAjt0mUpR2bi2eNcJ8BGlhgzR2ySKcDjYJgtTD/J8alNtactmOKkg3ou\n0Gnr1Ftt8XJppTwnZ+9+ps6T4Gx+Rjz8lv8tyI5ejtZt5ALvU6BwrGtKjZay\ntIdb1DJsZbyfM9leAU2TM2hhuAHENswQ0sz+rAQbfv+3SyZsu5ckbMx+eGU+\nCJXw3TDnFQX8a5H1C4HcpAbDnyTZJvR25nAWpmEAaRFThripdzF8DuaPLosP\nK3UxO15J1xnqKZdV/1QEANnPxNGgsRQVR9UBJ8SuuGvr7LbfemwABtYjTQZv\nGkx6a3do2SiwLaFrrnhlwrS8HkMFqOS8LFrl7SSe6ytTwhPGMPxcaJhS+d2V\nwlRc\r\n=ATKt\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`mdc-slider-color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`mdc-slider-highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`mdc-slider-rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`mdc-slider-rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`mdc-slider-thumb-color($color)` | Sets the color of the thumb (grab handle)\n`mdc-slider-focus-halo-color($color)` | Sets the color of the focus halo\n`mdc-slider-value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`mdc-slider-value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`mdc-slider-value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"d7bebbe119e39bd973d398066f5601862aface5d","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.16.3+x64 (darwin)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.16.3","dependencies":{"tslib":"^1.9.3","@material/dom":"4.0.0-canary.735147131.0","@material/rtl":"4.0.0-canary.735147131.0","@material/base":"4.0.0-canary.735147131.0","@material/theme":"4.0.0-canary.735147131.0","@material/animation":"4.0.0-canary.735147131.0","@material/typography":"4.0.0-canary.735147131.0","@material/feature-targeting":"4.0.0-canary.735147131.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_4.0.0-canary.735147131.0_1571189015791_0.9037761469212495","host":"s3://npm-registry-packages"}},"4.0.0-canary.062ade5c0.0":{"name":"@material/slider","version":"4.0.0-canary.062ade5c0.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@4.0.0-canary.062ade5c0.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"4bd891cac800704d4b211d6a9ae2ce0fcfba3891","tarball":"https://registry.npmjs.org/@material/slider/-/slider-4.0.0-canary.062ade5c0.0.tgz","fileCount":31,"integrity":"sha512-fBz2IfkP14pQqp4gm7QPoL98RbXiNF9VtCPKjjhRCTnIGMt54imbs8UnmYBG6v4q8VIH1W89FtulNxD/BdPLiQ==","signatures":[{"sig":"MEYCIQCmPM0C/rsBvI4eWYrQpIsbtrDIObcFqgsZfTgLkbDnGAIhALveKLzOV3Cz3NM1XOuIT+jCSIBGlIbFAkPKGRbhWFcD","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":364663,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdp71wCRA9TVsSAnZWagAAkHIP/innT1Jn3kGxo/vkUu1n\n08mk25hTBF9WPrBnqI6BNTHmluqsDe1B0UDbaSKNNfKr0Z12Kf2AWHoBwzw5\nYbo+UmAjLvOA4N/FrLEABL9oxeSXWIpblwf4H23G0pXkHxxYnv4vP+imyis4\nvRoCKWMu770+A+mjx9aLatKHLITHXTObZdK9Jav54RuZYXmZj6gC6y4Vq2yO\nOKxHFbNhlxwV4ZCuWm2RMr90w0X9bYPNHLhkMyVliGDySwVhJOPhFNKL99Kk\nkmIhKjzFDBItjhpZ5O2wrmKXOXHhCQPxlvrVg8YoxdtgIxBSNUpXXsoTd7zm\nOaK7jhizyK48xBbxA+mUc5mwzvL1H1iKV752IfeiqSbMFjibZpXkheLKBTDS\ngDAB67fhq9suZbEoghmDajOKCRQj1qNuFNZ3zHzECmNv+pnrxGEnvKTMKBnu\ncZxcUUU+H5yZL7Gbhfz19zOVyifGXi8qoSVes2eNGR49GdxQ2yKc4sOCniFV\nHQ/TbJb1csSlyL+ur222HZ2mzhJdT3Bd1oJmQhhO6v5hJ15tbZ10Xpwtzi0Y\nOzHrJxsD08g36nuje2f9J3s9gCmDpP3xpLR5kMKLHPg88hecxdNz/ArY+oUR\nE/KKeedqTIIG0ep84HxVVDYoIn/XZNocjE3HlbiVMxfnTOUngtwtcweulZvK\nEbBC\r\n=e2SG\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`mdc-slider-color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`mdc-slider-highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`mdc-slider-rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`mdc-slider-rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`mdc-slider-thumb-color($color)` | Sets the color of the thumb (grab handle)\n`mdc-slider-focus-halo-color($color)` | Sets the color of the focus halo\n`mdc-slider-value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`mdc-slider-value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`mdc-slider-value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"e2025b4ba4d9837dcc1063934417df1eefaf29ec","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.16.3+x64 (darwin)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.16.3","dependencies":{"tslib":"^1.9.3","@material/dom":"4.0.0-canary.062ade5c0.0","@material/rtl":"4.0.0-canary.062ade5c0.0","@material/base":"4.0.0-canary.062ade5c0.0","@material/theme":"4.0.0-canary.062ade5c0.0","@material/animation":"4.0.0-canary.062ade5c0.0","@material/typography":"4.0.0-canary.062ade5c0.0","@material/feature-targeting":"4.0.0-canary.062ade5c0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_4.0.0-canary.062ade5c0.0_1571274096017_0.21674659543087338","host":"s3://npm-registry-packages"}},"4.0.0-canary.774ad4f8.0":{"name":"@material/slider","version":"4.0.0-canary.774ad4f8.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@4.0.0-canary.774ad4f8.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"0fb0713544988c3407730e131d26a6b152d63de5","tarball":"https://registry.npmjs.org/@material/slider/-/slider-4.0.0-canary.774ad4f8.0.tgz","fileCount":31,"integrity":"sha512-aJ1f/gx9zSndt1YMOL3sV/VfGXZ3q0vkOg11vSuEhIz9P8VtNlTSfLyCr4tDOIalTcer2okIZCbCXKUUO6TJ1A==","signatures":[{"sig":"MEYCIQCaa0JiXx4UH6xPemsLkSMwBB7gLiMnhexWavk3K9zPYQIhANLG6MAflwzm6GCUS9nC5Rux0tPbvpUBevyA8bswX825","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":346725,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdp+hWCRA9TVsSAnZWagAATVUP/Rh61Ok5B9JJyWe9qS3y\nfZbD1PFhkglu960pvJ7rdeXD1ck0+KK4siqE2Vg3Iarb1fvxQbNaIHqWl4bN\ntv79D1pZElmPA30GF9kXAziaDeJCejv8YojLiIGDsl9hGJITJ1J/uox8BbFq\nG3in5lpLUjUZJ/SHc+iY9AbGJmqn6wqzxkIOe+asFJZASa3rtZ+/Rgqf8Ulu\nM3PWCZmJvpZ1AlylbkCAldXKnGzKmuCKekMD/XtK9Wus4N/ArDnkcpnYyLYr\niHnTJCm/jaZ67BcMqkLSYpozfgvQgMKQfenIPS+JcuaGlIw46F07OnKF4n2m\nVo0W3T8iQE8GtE31DVop+zEs0ySxHmivDPa11jMXUN45zaBgvxDiA2FpmW8g\nkmJbKJUlx6uPK1OSc/zWISv+/pBn7/vrOiwLhWKD2Za+K7/yP3GoecKDYXC/\ndWyCwoic2Z+LjnN5ugPWx7eq5EIWEd8OiFLQez4vIV/PUbK5Gp9hYHlszSCz\nONpWZ5gUcuftZzkICWbtKuuaPVo1Tu+VJRZq/yxvAU/ZECY54cP4E3Zvf8Bs\nfdO+FW0YwN45KIH9rXw+ZgH6njgeWOmX3UfuTtRZSo7zIl5YSOVkUz4/jdU9\nGolWHnJMGODl+epWpOaea02lorG72wXhmW+ykdTstheqT9MdhledeF01SjWh\ndqvr\r\n=Xbp9\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`mdc-slider-color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`mdc-slider-highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`mdc-slider-rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`mdc-slider-rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`mdc-slider-thumb-color($color)` | Sets the color of the thumb (grab handle)\n`mdc-slider-focus-halo-color($color)` | Sets the color of the focus halo\n`mdc-slider-value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`mdc-slider-value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`mdc-slider-value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"66607256fd6f9e4fe92319b094d8476583109bac","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.16.3+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.16.3","dependencies":{"tslib":"^1.9.3","@material/dom":"4.0.0-canary.774ad4f8.0","@material/rtl":"4.0.0-canary.774ad4f8.0","@material/base":"4.0.0-canary.774ad4f8.0","@material/theme":"4.0.0-canary.774ad4f8.0","@material/animation":"4.0.0-canary.774ad4f8.0","@material/typography":"4.0.0-canary.774ad4f8.0","@material/feature-targeting":"4.0.0-canary.774ad4f8.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_4.0.0-canary.774ad4f8.0_1571285077699_0.8216721418078696","host":"s3://npm-registry-packages"}},"4.0.0-canary.5916d18c.0":{"name":"@material/slider","version":"4.0.0-canary.5916d18c.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@4.0.0-canary.5916d18c.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"4ba4ad5d0a3a31a0a978824fe5a589732c4e0f69","tarball":"https://registry.npmjs.org/@material/slider/-/slider-4.0.0-canary.5916d18c.0.tgz","fileCount":31,"integrity":"sha512-DXBCHRa/Zq555w54EQFll1eP0nl4K56qVrfNi7xEYOR8htx7Ogst0WnjrfOkrVfejT2w4wQpBzy8Dra7QOJNfA==","signatures":[{"sig":"MEYCIQDyNoFSNwCJjVp3kbhkVUcJVQZFwWdAaU67Yyxw9daUVQIhAJY1vkPqd+ZlWRmGIpxhmYboGCmix9cnAlq2iNLsFe7t","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":346912,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdqhvKCRA9TVsSAnZWagAAWz0P/jZu3xkae/m5nRe7CvkG\nG6okayZg/mmSUnVtK25f1UAZccOxuMnuNqFev9Kh9RvTPvhkVzScV0q8t0aL\ndJVFXSGBxqLrxiQLmlIq9J7eCSaWYKiMOOA23ekzQbZyvrjOnPFA0kDHpQJr\nRiYwBwVG/fmKMkmJulbZ/ms86xMv5c2UeVoWWu5YR9Ohb4nr1/RDZKidDq09\na6zqz7Q+OMNgaDujkI03xGqlxgov24wW+9+/tzr5mRUWTmnvq3Xv0EehnHDC\nK1Zaqx7w+RYoztsPhCzugPratqcH1gGaYVhcQMBWIlKY4sOadFedChZLOQa9\nRJq1dEdMJudZrX1ZKMbhxx2XDxpWcxflyoNX+4+WwqtLQdP2xoB4gKvY7rqw\nP95rLgYeI7fTdHHCj9OQdjW3zCJlf8g3Sx96EHUvbBrMAv623cyT1eyU6Cfe\n23Odix+T/aJKkJTBd4w1YN5caXxVC5r4TPYyJhPjMbipEGRD11qZBI0P4XvT\n9ez9ymhtKZD17V1lLXssRhoOKH2uT8pFbaI70w5OAisr9/BxEVcp3J5FL+Md\nFE5SAJUnWs0Pgw/19dk4z6ww5om6PtyrpkLZDxWdZymT1RoZb1Cg+aog+brN\nLbWAPw6pumcGNxtyGamRMq504iMoGMAQNuL4y+lou1Y1nDN3kwSAihtvGwXx\nx4Pw\r\n=5/gx\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`mdc-slider-color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`mdc-slider-highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`mdc-slider-rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`mdc-slider-rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`mdc-slider-thumb-color($color)` | Sets the color of the thumb (grab handle)\n`mdc-slider-focus-halo-color($color)` | Sets the color of the focus halo\n`mdc-slider-value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`mdc-slider-value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`mdc-slider-value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"e3338b891c5ab3207ef8340a75490415e30e313a","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.16.3+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.16.3","dependencies":{"tslib":"^1.9.3","@material/dom":"4.0.0-canary.5916d18c.0","@material/rtl":"4.0.0-canary.5916d18c.0","@material/base":"4.0.0-canary.5916d18c.0","@material/theme":"4.0.0-canary.5916d18c.0","@material/animation":"4.0.0-canary.5916d18c.0","@material/typography":"4.0.0-canary.5916d18c.0","@material/feature-targeting":"4.0.0-canary.5916d18c.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_4.0.0-canary.5916d18c.0_1571429321748_0.7159562843005121","host":"s3://npm-registry-packages"}},"4.0.0-canary.d4141c95.0":{"name":"@material/slider","version":"4.0.0-canary.d4141c95.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@4.0.0-canary.d4141c95.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"897c51ef504d90e1e9c04ba05cb637bb1cb5bbf9","tarball":"https://registry.npmjs.org/@material/slider/-/slider-4.0.0-canary.d4141c95.0.tgz","fileCount":31,"integrity":"sha512-2Z1IRzkSSvJB/CYADqyhmsRElXB4rH2SC8a6rJmSjg2tueG7ZVWKCDmwzUxVUdHJUUdn8yNl6NcdqnX9RhIf9Q==","signatures":[{"sig":"MEUCIQDRif7OqU68MnrDEWxewtkyihk87qVkEq9uWGCWoolS2QIgf1dCvb7KJcEQCFgfle2bFBdiM3slEOY1uwPQMgE7Ql4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":346911,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdsQCMCRA9TVsSAnZWagAA16AP/1O9EBHqfMEZvX7HEYfm\ntPwesbym8ZCBjInSYYD2bGw24+cofW+h7xfeq9rE2n2sTHMAbejjiyr8LifG\nfhxChItGwI5d3f2vm+XM4VLlvMCHobSTORBeIQcgYJZD2Y38L7H6QBi9SsvM\n+TYQCpCNqcjD8IITJiuq96nUJEblUYnK6jMRrAZs/djG8Uojf6efSqcRjzwm\nDOQs9e9ls36ZS72TfcZtJhYv6LWNOKEqRpmBpvkOAXJDYAlqPZVL4IYG+/Dh\ngYZ4KUKdLtYpiGr2LdT4X69kt6zh31LgG8F6uFun0JNHtD1E9JnU5g/5EPWQ\n8naKZFZ3xC1TnziqA0Ej4pgk06ybx95RdsmTTCAx59DVl2wMQgornNGNnbpM\nm/xdnAshpVGiiM3vPE5aVJVGpsCKWDG2ZBtM2eHTuA0i0nUDKZYZ5BwFYsnR\n/4me4UoURxx1mncR/oGsdre6xE4zfU/JzI9ty4yZY7JMdTjnpkolADddqRC1\nJleZHuvfxMUaUoHf4mgIlwOO5CDchNkmDakRUr43z0SbMS+s75Zj0Giwt7y2\nTan75c7Em4G2hlpqDFXUrv9RPVqX3oQbyjqVx9lsAvkrK4bLxoKV05pbESq2\ngKYMteBAjrvWwwLP0dwgdrnTtzApYIjztm3DQQgFC4yv2M9Isgpi0JPiCamv\n7i7b\r\n=IDoF\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`mdc-slider-color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`mdc-slider-highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`mdc-slider-rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`mdc-slider-rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`mdc-slider-thumb-color($color)` | Sets the color of the thumb (grab handle)\n`mdc-slider-focus-halo-color($color)` | Sets the color of the focus halo\n`mdc-slider-value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`mdc-slider-value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`mdc-slider-value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"10ba5eadec617b7fd2711c838dbbff788d6f209b","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.17.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.17.0","dependencies":{"tslib":"^1.9.3","@material/dom":"4.0.0-canary.d4141c95.0","@material/rtl":"4.0.0-canary.d4141c95.0","@material/base":"4.0.0-canary.d4141c95.0","@material/theme":"4.0.0-canary.d4141c95.0","@material/animation":"4.0.0-canary.d4141c95.0","@material/typography":"4.0.0-canary.d4141c95.0","@material/feature-targeting":"4.0.0-canary.d4141c95.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_4.0.0-canary.d4141c95.0_1571881099853_0.03652738923247423","host":"s3://npm-registry-packages"}},"4.0.0-canary.2b878b3e.0":{"name":"@material/slider","version":"4.0.0-canary.2b878b3e.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@4.0.0-canary.2b878b3e.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"0147f559b0daa5e2006e7281a211627cc84ee2b0","tarball":"https://registry.npmjs.org/@material/slider/-/slider-4.0.0-canary.2b878b3e.0.tgz","fileCount":31,"integrity":"sha512-dnxdMYzliheTeGZbzOm1+dVTJIsMJhYhdRtxN6I2Rf28RBVCa5VWf6LYsCmxfwyxmJWtwVkVVoCImeDrbkqn3g==","signatures":[{"sig":"MEUCIGKFz7i8NGxG2hRU7lSEBq2EP6+9DfCB6v6XP1I0xZxCAiEAtd0WTmCH2W/1qyuQE2tB+2Mhc3i8yMHjwKBTQhFslf0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":347021,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdslmlCRA9TVsSAnZWagAARxwP/3C5Fb3hba9j1z2RGoOr\nPq6hxfWt/hopGXUA83A9lAfsW8e7sL1NeMJ0FOMz60U+55zLokWiEUVO60W5\nHDfItnFlR6bNjAPFJMfPbbhn+KXN2HSks9yGAaA8nhMIa9Tj3ouxbVYF2VM0\nDYcuIzDMFjjOwnlnp4vB7G13u7imZuC8O+a4SWk9qD5ppemTZ06ukcUKkZrk\ntz4JcE0TBhR10+mgitj9cIVSPYIj1AMonezglD5xDHinqo4zir8C1/usHkeb\noXlIuVC8op45swkwZqsCMnMsZl1IwLB+Rt+0yZyCNvWbzV//4BH4m0RFNQg7\nbJskaxuN3+m7LMWOffvBC36FyL9aqqPwcHDcgthjLXQwlTsAU+HeE29uxmHz\n0Wk85wiCdd6eBGcU/nOlwXZHj7qmZeITyOVYz6snCpt3BNpKfpaDqa7JsAnC\nN+24EnZRHj0DzirmiqvpSKzOs+zmtg6UY5WtqLtMNVn1+n23WR4cnOL6frt/\njj7zaVeWM/bGsVagorfghDrwsDvLeYlNnoIbW0Kcm+cYBcYfyWZW+cjWIuyk\n/pQWN8tjg3LkmFRekwCGlphHW6YuYWrKzjxzOC4scGgiLkhKfGoOE6B8Ea3q\nDDl6aRlp/0eFsSGZ/xyC/GZopd6/tTU7+Od3LEwIG9W2FjNaCbWmk81u+c1Z\n0Hhn\r\n=W7Fj\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`mdc-slider-color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`mdc-slider-highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`mdc-slider-rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`mdc-slider-rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`mdc-slider-thumb-color($color)` | Sets the color of the thumb (grab handle)\n`mdc-slider-focus-halo-color($color)` | Sets the color of the focus halo\n`mdc-slider-value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`mdc-slider-value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`mdc-slider-value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"29ace6a085b0e37c6546b4613abba6356aa82430","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.17.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.17.0","dependencies":{"tslib":"^1.9.3","@material/dom":"4.0.0-canary.2b878b3e.0","@material/rtl":"4.0.0-canary.2b878b3e.0","@material/base":"4.0.0-canary.2b878b3e.0","@material/theme":"4.0.0-canary.2b878b3e.0","@material/animation":"4.0.0-canary.2b878b3e.0","@material/typography":"4.0.0-canary.2b878b3e.0","@material/feature-targeting":"4.0.0-canary.2b878b3e.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_4.0.0-canary.2b878b3e.0_1571969445055_0.5719155012255781","host":"s3://npm-registry-packages"}},"4.0.0-canary.b06c0efe.0":{"name":"@material/slider","version":"4.0.0-canary.b06c0efe.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@4.0.0-canary.b06c0efe.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"2474d4734b69a69b8f3cc100c920b0704eb24bf6","tarball":"https://registry.npmjs.org/@material/slider/-/slider-4.0.0-canary.b06c0efe.0.tgz","fileCount":31,"integrity":"sha512-bq5Nf/7Gt+FcE2+np++Z+LHz7qcEkQtTQc3ItnYDM57mpxhbMSk75Tqi5yq2XeSpd7jwzCKJEFOsUyHp3806LA==","signatures":[{"sig":"MEQCIAiCKqU++ornlK1Ht51P1Slf3htvSCiylGEJ++l5CapuAiAXO4jFRpuH/7ZqwqHP0BWWzQEWhL66Xb2XQgtPw1S68Q==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":346725,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJds6LSCRA9TVsSAnZWagAAsfsQAIlDhbFh3nw/RwEDBJHc\nkRMsRjDUKMH7lYoJg94NDxQufl2txGUXt08lnAdGxAETbkkBHEyAGfMmrO4D\nKERI4InObEB84rtn4V13d+54ISzAq//NnDqS2g4B/l2n5rKK3+9VW+rQixZz\nlFO49zknlP8jfGmwbN8muorhQC3OoFAnOodLkBVmDI47Bok24iHc8iYM0asn\noEjCKtg4FXBjh5gsK61Uc6rv3I1XIi03htEv0in2P05fs0+hFD6rgKnn1P1D\nNOTneIu+7qxtAvCL+4j96ZeMTCS2RTatTPUbjbdfnh5R/czWZ7MDLOni8WVL\nO+qLRUrkxnPxaUZasKrv06D/EZA7gJTLqbwmfguoV8ls1l7iFTR5ymZ+DSWq\nG8mQz8+nfTX0r8Tzxe4ifv3CLoJyVaWcvdyvxvdRaZagEgqMJu2RNyBzV/Pz\nVkJjxVEJ8EeuCesKl0UoqSSYw6dd0KfPOR08atrhcCictrQLHWMqcqunmaFQ\nBB7/dmF2xci1TvVn3zPuR55YOwbkXdZiwHkxdX9EkdkkqEAfkHlIxdKhGn1L\nS5Yx4jCXw5HlF2ezHCUYzIFA3+kFILiq6emO9VUOoa/6PIXnySCXf+QGEtK7\nYq1lVoEaJVKW7tivYDESpJWwWNz73EgfBk6Iix6b4qukpJ1z3tMPTu9MuB2d\nZ0q9\r\n=FB3m\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`mdc-slider-color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`mdc-slider-highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`mdc-slider-rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`mdc-slider-rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`mdc-slider-thumb-color($color)` | Sets the color of the thumb (grab handle)\n`mdc-slider-focus-halo-color($color)` | Sets the color of the focus halo\n`mdc-slider-value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`mdc-slider-value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`mdc-slider-value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"023500a209a10669d135ecd0a8f00995f84b135b","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.17.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.17.0","dependencies":{"tslib":"^1.9.3","@material/dom":"4.0.0-canary.b06c0efe.0","@material/rtl":"4.0.0-canary.b06c0efe.0","@material/base":"4.0.0-canary.b06c0efe.0","@material/theme":"4.0.0-canary.b06c0efe.0","@material/animation":"4.0.0-canary.b06c0efe.0","@material/typography":"4.0.0-canary.b06c0efe.0","@material/feature-targeting":"4.0.0-canary.b06c0efe.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_4.0.0-canary.b06c0efe.0_1572053713609_0.29402190354471136","host":"s3://npm-registry-packages"}},"4.0.0-canary.01628efa.0":{"name":"@material/slider","version":"4.0.0-canary.01628efa.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@4.0.0-canary.01628efa.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"7ecff2836e38e549959706470cdbdca4c2b67053","tarball":"https://registry.npmjs.org/@material/slider/-/slider-4.0.0-canary.01628efa.0.tgz","fileCount":31,"integrity":"sha512-GoiSxSdnvk4BtggT4ClGLfgZihPpZFTSeI6h6XfRKuI7QCMrdEAtRT6/ITTBYVmwGdTSccDHGpck7SQRAtZiZw==","signatures":[{"sig":"MEUCIGHSmGsO+JJ+Z7HAHJRonPTh6JGJqzwhfC9ad2e+Dq88AiEA5x+NQ7PSeXr2EA+ahqJB2ghn33QnfNakn8RBAM+wdQs=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":347018,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdt4G7CRA9TVsSAnZWagAAjoAP/3Z5A0XQlXFO51ATLgzS\n56exRj4r7qEL/f3V5hefdXURhYlZTgVk7q7nqNwXx8WdKUIC2VyDTGfFBtnF\nzuSHd7pS1dFN8fMCoD3cNVJT/JLLpzRinJ2axX9RKey4ClOc5zwozmaLsn3n\nHesKrewjxOoHJmexQERyMOyXj+omV7xZL1n16jZnxaOsk72KKFuIw5UXKwST\nB4GmjKgEgBHed8x1lxi/ephACrFsLuiL2m4XHIxUvK4l1oCMVozUzJz7fJSg\nGDhd64U3ufPoA3dcvxlGsZRtJGg4eoqLKP5uf5T9WJEZuafWfnLw6/47pCiW\nUSmA/aCbzYNxWTpMWz7rRC57plYDjTGv51N3Js7w6y1hwTtdK9tOTwFMeoH2\nVHodkpJO9neSF0shlJiKenbNuNb2eQZnknw6FbPmKyj0RTCUVgtCVHp/XGoj\nUFoaazI3GPtKYxVjnDt70sgUpS9lfsKN7UFOIbX9tkC0TP3raj98rAOG/elm\nWU6NmxBfqSOBxRiEpCyvNnbPDWLwuHPYfmb2nPKRnfJpfRg6jGJYKAA4bQE6\nUthjW4lEH6YV1w2XkueRWspcsetadpAE1olqwQJveHgg7SOWLzsjxiZerOPa\nubwzzo9u+d4NdGjpadeVsEVZ9czMR2b3udG7rwBciiIsl7Z1hnupJ7wo94fm\n+8XI\r\n=d7sf\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`mdc-slider-color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`mdc-slider-highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`mdc-slider-rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`mdc-slider-rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`mdc-slider-thumb-color($color)` | Sets the color of the thumb (grab handle)\n`mdc-slider-focus-halo-color($color)` | Sets the color of the focus halo\n`mdc-slider-value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`mdc-slider-value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`mdc-slider-value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"d736a6d7c49f31b52dc64101effcb7cb18ca6cc1","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.17.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.17.0","dependencies":{"tslib":"^1.9.3","@material/dom":"4.0.0-canary.01628efa.0","@material/rtl":"4.0.0-canary.01628efa.0","@material/base":"4.0.0-canary.01628efa.0","@material/theme":"4.0.0-canary.01628efa.0","@material/animation":"4.0.0-canary.01628efa.0","@material/typography":"4.0.0-canary.01628efa.0","@material/feature-targeting":"4.0.0-canary.01628efa.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_4.0.0-canary.01628efa.0_1572307387612_0.955017752939342","host":"s3://npm-registry-packages"}},"4.0.0-canary.b5c6d66b.0":{"name":"@material/slider","version":"4.0.0-canary.b5c6d66b.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@4.0.0-canary.b5c6d66b.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"6ab9c80390cff7981569d6664c79c2e73b92b619","tarball":"https://registry.npmjs.org/@material/slider/-/slider-4.0.0-canary.b5c6d66b.0.tgz","fileCount":31,"integrity":"sha512-Y2gmWeL/A7a/cQbSE9QHSIPfhRtfCJ0VMcnrmVwH9l39gSnwH3j2DpXotCzw8yyJzifDWGyBLju9FOqVzwwJMg==","signatures":[{"sig":"MEUCIHmakaj+cTOpry+Z/nM60hB/mkP4dHk/N/dQ3ExSMawUAiEA56Sdtp+vVqEDLB3UQynJXYoRO/5k1zyu1tWheGDNCvM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":346905,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJduH1iCRA9TVsSAnZWagAA0QMQAKEgsLd5CabyfgcdOSfn\nKrgwtIqp9RojayW6ng4GjAruo98RPc0xVklUlPHMFhkb4Os17swlq1TR/Ay5\nIrvdN+DlG8eQGpGeVO6EGZ2NladVOsiJXC5td4Y3eaxMFz//ixEzYr022i9Q\nT5LegD26MxJoGxfpJEpMeTnyq+ntHiq/2zC9lHGnfleic0hbQWjjyqInNg46\nTmBgCF5h2MAmqHFvRMBwqdV1mTvee/gRxUirXT1FBQS+Ne8l3ItNSDugd4an\nO9ANJAPyOcYNs/Dt4Jy1kj8+7X/HKkk5bKhY+AEa31gv43L8nw9puBjA+qxi\n5Qb/4uga24xkftlvRTXjwKAPlg9l6X5dVMk0HHmBOrHPKBu0DGmver8eubl5\nS/wRoc+EdEI7KbnXMVi/+kO9+JbX/xDBV8SPotFUayZKmfpCjnP1Km5Q80Jw\nBg32cBAjbnYZM4HWIpChgDJB/E9SwRTAov5BJ0MKOn/l584f2UBMTRaPAlOe\nR5QVuqlEZHYjv3kWVaX9nHhhcqRVOk3Q9o4qHyIuunIrfcJJdk1P7wulES3X\n8dfAfkgQB+B3+ZuJi3w2oHbuO8MpKilTZPuErA7Gz1xV4+6s1DtACfyYJJOo\nLG7lL76oTk0LOhlberT3nOOMM0PssQ4w5yrvB65auiAXZp5+fwZwnwvyC2K7\nRMmJ\r\n=gU7w\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`mdc-slider-color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`mdc-slider-highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`mdc-slider-rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`mdc-slider-rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`mdc-slider-thumb-color($color)` | Sets the color of the thumb (grab handle)\n`mdc-slider-focus-halo-color($color)` | Sets the color of the focus halo\n`mdc-slider-value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`mdc-slider-value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`mdc-slider-value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"a29efb24799035b1ee49295daebf1ae46a92b529","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.17.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.17.0","dependencies":{"tslib":"^1.9.3","@material/dom":"4.0.0-canary.b5c6d66b.0","@material/rtl":"4.0.0-canary.b5c6d66b.0","@material/base":"4.0.0-canary.b5c6d66b.0","@material/theme":"4.0.0-canary.b5c6d66b.0","@material/animation":"4.0.0-canary.b5c6d66b.0","@material/typography":"4.0.0-canary.b5c6d66b.0","@material/feature-targeting":"4.0.0-canary.b5c6d66b.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_4.0.0-canary.b5c6d66b.0_1572371808070_0.9095402256322136","host":"s3://npm-registry-packages"}},"4.0.0-canary.cdf858ea.0":{"name":"@material/slider","version":"4.0.0-canary.cdf858ea.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@4.0.0-canary.cdf858ea.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"f2dd166766d9b069ac70470f1a2e85a7fb740f71","tarball":"https://registry.npmjs.org/@material/slider/-/slider-4.0.0-canary.cdf858ea.0.tgz","fileCount":31,"integrity":"sha512-raYWnzM0o+hBir++vINiApJbsKaRxL/yxLxDlWPXE3uJu+Byh3OXIvaaXpQ6k2dY6KB42FBL0973HDYPx8sgfg==","signatures":[{"sig":"MEUCIQD4d7i1KOSjO4JwJh6N7B09F8dHepmZ5VkU67p5xPafygIgQHBsYBfP5+8JBEorSC8UIjl+S3SW4McyL2FAm5SnWbc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":346725,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdvHJjCRA9TVsSAnZWagAALzwP/3MdhZCD3iQPyYypHR5I\nhpwifNY5O3xQ4mx6ltBWGqDSP1W3heUIBQfBumnaz+DI8tELbHTInTFKbfZC\naiBQ1F0S/4EBS0ovuhRYqP++kX+QrsrD5vv/pncXE5ZY6aNPwvvE+hfa6T8N\ngtWmmLb25NE4oKU2i0tuEhdFJlheo54AD5JRO5qV+AraBbUAfEirWfOauRSN\nXI0cI3uRUv+BqXsEyTIIVfkbO66j5Eu3PJDUF+TaUzagOuxAeiQZOZsVTkDd\n+480N5MIMOO83iOL+tybZihrzIPlBMXdOCIwDNita9g5zBSZSwfqSmwI1zh6\nrY46VDeuOuB3Zvkgfb9WdjYeUa7Pc3PY04TcJ6/LMeN3jU7wusw+608/johd\ncQpeWLdSSzfELB3M9MxC4lpQEJT7S8L3DCk16dPc5Ub/WH7cpjnXzP7TWF9n\nue7nEKMmMcWxm1IRl4K9PfPOMcXpKzX0SRZDxefRQ3zuG0p0QL9bYr8LPNzx\nbLFomLk3Nc1O1xs+JG5jNpmDLGFYpRjBmm3Q4cdHwKTDkhHMaTLhjMnda/77\nGa8aZjq3TDarVuaiigU++IeQDMk418hsysScqanZ5I57z7/BeK0hHX/wByvC\nEsLn6egH8uTm7YnEMyiqFUzTiqZFU96QsuuyWDzPX8Sd+SWIDI4Q1ps3NtaP\n/6aw\r\n=iMqo\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`mdc-slider-color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`mdc-slider-highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`mdc-slider-rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`mdc-slider-rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`mdc-slider-thumb-color($color)` | Sets the color of the thumb (grab handle)\n`mdc-slider-focus-halo-color($color)` | Sets the color of the focus halo\n`mdc-slider-value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`mdc-slider-value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`mdc-slider-value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"436b9be1155a7b7c0fd4aefe795809bcebe8dfda","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.17.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.17.0","dependencies":{"tslib":"^1.9.3","@material/dom":"4.0.0-canary.cdf858ea.0","@material/rtl":"4.0.0-canary.cdf858ea.0","@material/base":"4.0.0-canary.cdf858ea.0","@material/theme":"4.0.0-canary.cdf858ea.0","@material/animation":"4.0.0-canary.cdf858ea.0","@material/typography":"4.0.0-canary.cdf858ea.0","@material/feature-targeting":"4.0.0-canary.cdf858ea.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_4.0.0-canary.cdf858ea.0_1572631138891_0.22901909333342574","host":"s3://npm-registry-packages"}},"4.0.0-canary.719b57e1.0":{"name":"@material/slider","version":"4.0.0-canary.719b57e1.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@4.0.0-canary.719b57e1.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"2bbdb039313961d9af7abe7af84c6329e29615ac","tarball":"https://registry.npmjs.org/@material/slider/-/slider-4.0.0-canary.719b57e1.0.tgz","fileCount":31,"integrity":"sha512-19WgliYf4SgkzkWjAEEHLJEvP9Gepji4BPDJfylqzBQ0iC1znoBiElwNzNuxq/NC2ryd6CFGFqTYxSzlMJo6BQ==","signatures":[{"sig":"MEUCIQDu3pmb4VsyVFI9voBeh9TrpBjWsf6Mz5m3aVbHvXB98QIgL+hmcG1OxokASJfD2jEym8TaGarnA+CD7/YjFWe1B48=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":346921,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdvI8kCRA9TVsSAnZWagAA0HAP/3J1mK8ElwjFInpJzJge\nqEcF78cvxWbkkXsewHfLK9ZCYyYfTKNwqKwS2GuebXKSVbfzs/KRYuUXxbXq\nBuAoON9+SOZ8XyhOQVDtXUlzEyCppqo/JjFgCApASQQNNi64OBl03yVIMIM4\nsb14Q4CQtKHvuNuvTPJDlLhEqHwJIo5CJUjXiizmKwHvWwF0uIR62oWXw2L0\nmamgMeXoN/nKpy93DU46ldKBoCysUeNG+897H9DSIcWeDk+72djW3sjj8xw7\nrefZQknlIyoxcQMVUad6Qy/dMIgXZXwbs/4UGJpW+VMUjKvs1iayOlGKBJWI\n7igcxX5AFWlIwdkyl3xuneES0Adu/ZmR0CxO5O8AJZNdpCgCLd6NSHsLe0ZZ\nUts8Wv+JN89J4oDN/KlMzMChfl5yHnUki2wiBnh85a8Yq48xFneXm7yMszu8\nEscPHM351BnJO5L5k6g8j603rgzknbkWzsJDvbvQElSauGW3Nbk8acc56QH0\nPmM1kS3cCI8EfAY6xWnk7lmcEyxbKpHjoLNpMV4cv5UMhPDk1LAaLT4Zmgcb\nv6/TF9oxM92zZpL7sgS1gnjg5D3bmRIv9+fjSQrZMYHJ1/rgo3K1R5x7mP6J\nezC6Xa7v1BKXlqWVIFtHnUMamkuls7HeUxc2VG+kkG2Bsd6EuOWZ8XzgQlCI\ntGz4\r\n=HBpX\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`mdc-slider-color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`mdc-slider-highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`mdc-slider-rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`mdc-slider-rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`mdc-slider-thumb-color($color)` | Sets the color of the thumb (grab handle)\n`mdc-slider-focus-halo-color($color)` | Sets the color of the focus halo\n`mdc-slider-value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`mdc-slider-value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`mdc-slider-value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"4184aa06e4862418697a150eaf45a13500e1c4ff","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.17.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.17.0","dependencies":{"tslib":"^1.9.3","@material/dom":"4.0.0-canary.719b57e1.0","@material/rtl":"4.0.0-canary.719b57e1.0","@material/base":"4.0.0-canary.719b57e1.0","@material/theme":"4.0.0-canary.719b57e1.0","@material/animation":"4.0.0-canary.719b57e1.0","@material/typography":"4.0.0-canary.719b57e1.0","@material/feature-targeting":"4.0.0-canary.719b57e1.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_4.0.0-canary.719b57e1.0_1572638500444_0.5339698115319742","host":"s3://npm-registry-packages"}},"4.0.0-canary.97cbbdc2.0":{"name":"@material/slider","version":"4.0.0-canary.97cbbdc2.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@4.0.0-canary.97cbbdc2.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"b4ad889717a8549d20d1b2f0ffdde0f2bd2cf275","tarball":"https://registry.npmjs.org/@material/slider/-/slider-4.0.0-canary.97cbbdc2.0.tgz","fileCount":31,"integrity":"sha512-Ji4l1IcT2yBwf++UWFLNAHVx6RwQ8xCzoLDpXTVp9to0QmElPIC5uQQCPvKK5tiFR4gVL54/F3BNZqE0cuHNZg==","signatures":[{"sig":"MEUCIQDak5HP8cGTVuOSqYB/BmxnRmrTIEEK1NEe8PmO0XuVOQIgb0c0hPLTPJ1RFrr2Vqg0KJoguotasXgYE5X7NBUzWmU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":346934,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdvJWeCRA9TVsSAnZWagAArUoP/AzU/OMqpZabU9HjdHRR\n37ZvkeTy0sm7oyDAYYS2lc2pNLE6XjEgccC0Li2jnGMjiM2mcXL6onFmLOew\n00vIk5Y6tIoznVEB1N3FqyqiDo7UTxTKM3DcpnzNs2/rwZPZ4XpkxfBaO7Bj\nJjHD5IXPiBqh0xfC4+RVpdFc3BOO+tdDBmH6FV1/Tnr23QTgbPkBiMSSAWhF\nQulMGymL50HFdRmTvWFAQ+Hal9CicwjydZRw/yndH2/jnw49MBs3INoGjubH\n+0vw4wYT5GtNDikgASaIN64xVjWV7HfXhDQPPkuRs1yuQRynmRQuXhWE/Lm8\n9AqzMRAFYrrQcvB/2iUhuYh7YfzGzqAhxTWNbj1P5DtPHvPxAeYBFqinD6W4\n3WJXoTCAemGDuql22baICAalYXAT+rxW+V3fJRKn/v5jea9gp7ulvi+PwUef\nb+nZcBVGLIn+ycyNrjbbCzYj84YW77uFsyUMf01Gt91stnJlKKpAq8z7AQNm\n9Iuigj3wsVxNB4e/yeaNQLig0C7/dHAdKWNRVyRzzSV/o0nl54J8saz9FNff\niONuGRnNWgYgHpoUaOtM+HS/z+GCRncXv7KBTx7TWYePYOw0HlFOuGDt6Vi4\nD1VxBVbYV0qb3WHR6xZd5Tbctn3dy21fIIvUFs0jUBLAVLW/VpAn6KGZeeKf\nITIV\r\n=VLT2\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`mdc-slider-color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`mdc-slider-highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`mdc-slider-rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`mdc-slider-rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`mdc-slider-thumb-color($color)` | Sets the color of the thumb (grab handle)\n`mdc-slider-focus-halo-color($color)` | Sets the color of the focus halo\n`mdc-slider-value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`mdc-slider-value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`mdc-slider-value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"49d37bbcdfa0f5872581945f58c03e62abb97090","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.17.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.17.0","dependencies":{"tslib":"^1.9.3","@material/dom":"4.0.0-canary.97cbbdc2.0","@material/rtl":"4.0.0-canary.97cbbdc2.0","@material/base":"4.0.0-canary.97cbbdc2.0","@material/theme":"4.0.0-canary.97cbbdc2.0","@material/animation":"4.0.0-canary.97cbbdc2.0","@material/typography":"4.0.0-canary.97cbbdc2.0","@material/feature-targeting":"4.0.0-canary.97cbbdc2.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_4.0.0-canary.97cbbdc2.0_1572640158428_0.6503203934377384","host":"s3://npm-registry-packages"}},"4.0.0-canary.8e36b3b7.0":{"name":"@material/slider","version":"4.0.0-canary.8e36b3b7.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@4.0.0-canary.8e36b3b7.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"9bc90e4095a616cc16ca1bdbd6f60557152752c7","tarball":"https://registry.npmjs.org/@material/slider/-/slider-4.0.0-canary.8e36b3b7.0.tgz","fileCount":31,"integrity":"sha512-f1z2YkjxzBthpzm4nNfqw99hUJXimVlrBLBvKRP2HFUVasdgO4Y1otW+e7++wf8XmgxYHhtYETsoUr7F4DvTLA==","signatures":[{"sig":"MEUCIQCQNZjjUgSnKGnpdfCQxJZir2wI3Duywzoj162Xmw0LXgIgAa8OP4gen19GHV6C14BQVMbA2uhYDVN8znr5MdWEcLE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":346725,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdvJ0kCRA9TVsSAnZWagAA0F4P/jEHo4iuuYCEaav2GHOC\nIlE0adzpFqH7dC6e7GQAwthQlAQs0V6oOQvzgdC/MosQ9y/ayCKXjF3u9R8p\nvCU2iigvQelRm4Pl+DqOuLSN9rMcQMkQis9o8ZEn83LOhAIQ6DBrK4+O8X9Y\nbLqvnWjj3LIKMddQsDX99dtxZdaVOPbblpHGfllSqQnqbYTRhbCXC0IoBthE\nCKX6FyAZ5SiTsIw/vA+f3D0RdRVQiuM+cPiV75tkudPNAGjND7lyS89WNEsV\neohBJ+FkYLMvyqQ8X+ibSL4jL5UM+e5f6Its/yEtcJhvfaG983+WxbBsF1UB\nZM2+ZFybnR1sRIPBzD2zmzsMulNX9LaVVLD3TnclnFhtXdf3+UOcTx5l8VD/\nuEEA7xhcHqFqxclzgOjiVdYnBVJ3y7gFaxb/PHsj8CChfpbA4JF76RD0pNkc\nivDZimoCRsqGaoBnkdxXi2mldNYUuYURHsMX/4tCbU7QPMsq5Oefc6LLqDZv\nTYFZh3LkNA67zbhaaUyopl8inpG2OCIiNJj1MiNeK4mjZBeNtT8/F8Wj35Bb\nsvkRsi/WPo2ynE28BjM8Oi6KivXWloOPVxkmWLaOBfANXT4cue7Av0qXkOS/\nT6O6uMwDAM8iqtlMGlBiRq6mqxGVhDp/cxG1Fx6JMrW4+0WHRbMBu8wBl1NR\nuGv3\r\n=8RaW\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`mdc-slider-color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`mdc-slider-highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`mdc-slider-rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`mdc-slider-rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`mdc-slider-thumb-color($color)` | Sets the color of the thumb (grab handle)\n`mdc-slider-focus-halo-color($color)` | Sets the color of the focus halo\n`mdc-slider-value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`mdc-slider-value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`mdc-slider-value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"62f51968b94685823af7942f779c63658f2b0350","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.17.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.17.0","dependencies":{"tslib":"^1.9.3","@material/dom":"4.0.0-canary.8e36b3b7.0","@material/rtl":"4.0.0-canary.8e36b3b7.0","@material/base":"4.0.0-canary.8e36b3b7.0","@material/theme":"4.0.0-canary.8e36b3b7.0","@material/animation":"4.0.0-canary.8e36b3b7.0","@material/typography":"4.0.0-canary.8e36b3b7.0","@material/feature-targeting":"4.0.0-canary.8e36b3b7.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_4.0.0-canary.8e36b3b7.0_1572642084160_0.8254580613837736","host":"s3://npm-registry-packages"}},"4.0.0-canary.62d3a09b.0":{"name":"@material/slider","version":"4.0.0-canary.62d3a09b.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@4.0.0-canary.62d3a09b.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"9dfee62d8e0127b16db92abd1be554a2c10ebd04","tarball":"https://registry.npmjs.org/@material/slider/-/slider-4.0.0-canary.62d3a09b.0.tgz","fileCount":31,"integrity":"sha512-1d2771BC4NhQpp3Ilk+lDRHBZsgFWZ4NAFFIzk3a3e+0WTgqGGtknb0nL9/q6p3MKgqFdKOXJOxFarRoJortfg==","signatures":[{"sig":"MEUCIFDR4GjzpslNTtDi4Nw28k+4S4DQuxx9AA/KIE755+zcAiEAjZgqV3PlNpK8iSbTbGe/LwSb4UJxisrW44Ryb9pIO+w=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":346725,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdvJ9eCRA9TVsSAnZWagAAwHsP/A76SJoMZC94Kjro67cT\nIDIKoCl1wcg3+5YCJjYx6zoVeoMbvgFvbT8sRkf9oPwhDeKhaEoUwh3CdQKZ\nOrFI0r6j42YJ4t7a9nwVezuUFCqi75up9MKHjy0xqV1F4/qefLChRAvoMmU2\nSp48GIacM5gYOoSB0+XtaQw9piTx3mIkon/T2FiBvHx26Q9rn9dZ/TcVBat7\nRw41gVqGJl1KFfYZaYT7o425mALoVOPMzKPs2GqFWfSXafRSf1auUbNGDtKz\nYpihKSBbor+/G8Hpj5qu2OaQ5Dtg6jCl/CdpVpPgV7mkCF5NwaXMrreFs0y2\nk1AfocyAxdwe4A0ehGdpk9Rq7pygDqpTJtoM8J4q6vlxHTvWg9lstkoM766g\nP6F4eog6RcD52CiYCb/470DAgHs/lcb+eBVmFVRfVnyhG70tUD0g7IHckMIU\nOd4NcSplke8NyLnFrLvDcZ/N7h7Jpa0XCthcCQ14063gy+1TQZGADuco1Nfh\nGG3d8Cdy6KTKowWxZMEcCxjFwh4J2GN4soPEgcZItaNQUK91q7BI54brCUod\nMDio8EBVezovLNsgzfJNcDnyoYy8nXwBPjbRsAcXyGupXvJctVL7/IPIlXf9\n8VFY4eCVRNmCEPmA16sGas9YKPhpshlOHCc8/RtMTdbkExKHcP9dhYGlpjTk\ne7K/\r\n=IppB\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`mdc-slider-color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`mdc-slider-highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`mdc-slider-rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`mdc-slider-rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`mdc-slider-thumb-color($color)` | Sets the color of the thumb (grab handle)\n`mdc-slider-focus-halo-color($color)` | Sets the color of the focus halo\n`mdc-slider-value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`mdc-slider-value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`mdc-slider-value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"e00a9686a58b0fd5ec957d4008b6674dafd4dad2","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.17.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.17.0","dependencies":{"tslib":"^1.9.3","@material/dom":"4.0.0-canary.62d3a09b.0","@material/rtl":"4.0.0-canary.62d3a09b.0","@material/base":"4.0.0-canary.62d3a09b.0","@material/theme":"4.0.0-canary.62d3a09b.0","@material/animation":"4.0.0-canary.62d3a09b.0","@material/typography":"4.0.0-canary.62d3a09b.0","@material/feature-targeting":"4.0.0-canary.62d3a09b.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_4.0.0-canary.62d3a09b.0_1572642654100_0.06968470239153257","host":"s3://npm-registry-packages"}},"4.0.0":{"name":"@material/slider","version":"4.0.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@4.0.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"7a1596f7a31838e18cb7bbe15dec2d1131f82bb1","tarball":"https://registry.npmjs.org/@material/slider/-/slider-4.0.0.tgz","fileCount":31,"integrity":"sha512-00lrfgvVJWSgI1ovnixzsY6YDJPDSfxO3DRpY15d1mW5UThh6Knb9MQFTWShj5NaMEOTepOpH1m9P79+TyBlTA==","signatures":[{"sig":"MEUCIQDkeSjmBWlj2HwEQsYNWj52hk2JSRo0dLvS5X2D9ZsJagIgK2kcRrcl4FcfdR9UTzZZDYZXHvBX7rMoucJGmjmH48o=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":365085,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdvcbiCRA9TVsSAnZWagAA9zAQAIDemGTirnAMmKjiiNeY\nuE2pukTZbxV6VYR01s6ELpGerSnZh6PiGoLkfvcmQm6q0fo4vWErCWvcnQ86\n36/pL0Inx8gqdozJteXQjqoLQEUNwvkGzDzJipxy9GgAGVTcY+taYGcvNsZh\n2Zh6/nqH/DjXqRGjY8VSo9aj8SOzU4iVT1/MW2BqVpBVk4acs4juzqeDFR9Q\nJ6gPXw51d4/5Jy50mIzoHyX5yu2CB2QfNZMAZeP0WbIKMyGWAFAtjgTpZXXv\nQTw2r5YJpv3hXS1Miy6jPvUkCXoIB4rmroWN9iUcLjm9rhlF+4PjlpDj/Gae\nyf7Urnx3HcQyYFyGFDLKGPLl51SPoubow82GqOL/iD0PMtt9e/8zEyDrN2z9\nViBZ5YrtpKHXLfuXzCMh8Jib+iS8tGrFkK9YO3qf2mEv6V6+S0PAeEGVve4T\neDys+hw1XqeeSVjfqjdBc+YcsRJ+JvOjc/YLdZPOthjlGDu26aaGEpZE/4/l\nDiiUp+y4SS8o7jnidvxjE4dU4jE5WNvzKvXV3qpatmuyn66FLC+afwysqxb+\nMrfo9+wF3aOfV3oYY7OFf3chbTWRl/6XJ+XsyGhvfUekbbWB79GCdC5jdkUD\nlNy6dX+GWEMVSoSmkonBhzM+HptCY/lK//PPnLsXP4V5irI73fKFeGlF9eem\nkXXh\r\n=D9Z7\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","gitHead":"8fcbb009cd3b5cc004b302613dd55ab4b5d6ef72","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.16.3+x64 (darwin)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.16.3","dependencies":{"tslib":"^1.9.3","@material/dom":"^4.0.0","@material/rtl":"^4.0.0","@material/base":"^4.0.0","@material/theme":"^4.0.0","@material/animation":"^4.0.0","@material/typography":"^4.0.0","@material/feature-targeting":"^4.0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/slider_4.0.0_1572718305962_0.9450242907951414","host":"s3://npm-registry-packages"}},"5.0.0-canary.b5eb51e94.0":{"name":"@material/slider","version":"5.0.0-canary.b5eb51e94.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@5.0.0-canary.b5eb51e94.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"2340fbaf937d844cdcad0cf3e0ef9c9ce435068d","tarball":"https://registry.npmjs.org/@material/slider/-/slider-5.0.0-canary.b5eb51e94.0.tgz","fileCount":31,"integrity":"sha512-kVnjn6RZi7NOr9UF2Vc7IvB0Hv8RrpjZU125CxKHu2SYfXc+asjV6RMavNhu67nxPy+5yPYPxR8k5YEiVLUfWw==","signatures":[{"sig":"MEUCIQC6TEnpfEHfjQAPYRN2FOg59HIZsKiTh/1UVXysARH9ZgIgFvilzhnkO21Z7r1ObmuEB4a3C+fjaKaLri/SLWRRKQg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":346843,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdxGOLCRA9TVsSAnZWagAAIvoP/0Nvk1O9O7DJX6xgs/s3\nALx9YC9lpvQh9cE/A5Jd30gaY1yyqGX22NQUStIs9o5JRakVu89tmPr7SCk/\nSz6pQP/269GHkBW5w2NCCaTDM0Zi91qp3nfhXEu+TdIIqDaMD2VVPhkfKo8+\nm/MAscNrtRglSEgdo15wslmogV6IzPd/16Y0Croef9z7eSqUtbpvUbQToxdA\nqmPX3yg6n4BFlrLlKq58ZqZj/FxHYdOtoSTKuMb/Jo+/xfIN94+av6Qrm1/A\nPTATKfW4vBpYcQDWlz0I7ABITuJshi6ESLoOhoVIeSS3eQ6lJ8f9X7ru/f+L\nrA/YXMe3lMA1NGcdD4HoBkBGOL1Rztc85WfbRzv0njJTG5Ff8THhGbNG9hd7\nMu1T0OqShWwKj6q1vVnfONTKvojDQPCnhljQ/LLgNqIV2K9Ju1WAsjJNeJ6m\nHzdX/DmDm9eQgRP+4mEfkCL5+Tjb1GgzRvcy6F3q3vCfq+2B6R0fqExpang/\nnmUYg9g48CVPqPA2H7wbZnr9gufgfsy40graXtEAznZA4IZY+wuWaGgJnsDk\n+Tpy9OGXFnKXRafR4U0ix9esIxOUwfgtNGppDbSUw1NgGOwfWmOWvaixU7Ic\n1XrYc6wD4aJAWcH8294bIjEq7xbtFpUvI1RdOTpctn4qFm5Dmwaxkg773qpd\n+8Nu\r\n=Byot\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`mdc-slider-color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`mdc-slider-highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`mdc-slider-rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`mdc-slider-rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`mdc-slider-thumb-color($color)` | Sets the color of the thumb (grab handle)\n`mdc-slider-focus-halo-color($color)` | Sets the color of the focus halo\n`mdc-slider-value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`mdc-slider-value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`mdc-slider-value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"7e8d43f563cf6b162c2aed47d2a006564994e4d2","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.17.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.17.0","dependencies":{"tslib":"^1.9.3","@material/dom":"5.0.0-canary.b5eb51e94.0","@material/rtl":"5.0.0-canary.b5eb51e94.0","@material/base":"5.0.0-canary.b5eb51e94.0","@material/theme":"5.0.0-canary.b5eb51e94.0","@material/animation":"5.0.0-canary.b5eb51e94.0","@material/typography":"5.0.0-canary.b5eb51e94.0","@material/feature-targeting":"5.0.0-canary.b5eb51e94.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_5.0.0-canary.b5eb51e94.0_1573151626848_0.6072983115362569","host":"s3://npm-registry-packages"}},"5.0.0-canary.58500806e.0":{"name":"@material/slider","version":"5.0.0-canary.58500806e.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@5.0.0-canary.58500806e.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"9967f2b6a6902da472dc01375c4ddb477feff2a4","tarball":"https://registry.npmjs.org/@material/slider/-/slider-5.0.0-canary.58500806e.0.tgz","fileCount":31,"integrity":"sha512-+SuMwn2wpYRrBTiQtMPdzP90YH6qzfxj2WNsp9vwlYHMqQG4TcKeZo+92YdD1Tb43qujdP/b2McmvNla6AWOOQ==","signatures":[{"sig":"MEUCIQDprLiTa1XPFHrxDScrdMRgidhHKXkL6NTnHASdCeosQwIgH3+co27T8tOfs7epIXmt1Ex68qwfAO7r6UcqhOe4UeQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":346843,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdxYtXCRA9TVsSAnZWagAASE4P/ArK3shCQrqRFgyRJAok\nfIrh8vs8d2XU1sMgCg7QWD8rUvDYdxup3liIgotJWj0sckTqfVKAodfihb03\nWv+LtqsEoaCi3a8v5uGTFBBxz4VCnkXoAbfBiWtzrRjR/+YUfS0ThMeSB/Tl\n5zZgScVYen9jeHsRFJ6b/pR8g/uhwv0R6KnyiKKxVdzbTmtumFlWcLfBukT5\naqeeudkJ8ihGoGXLlmHMDE0D43QMFW/pH8eMuH9lnOhl8rAM3HAA77obbsda\nuvNd7FkcKEYQr5O0nywzQL4x0P7+x65S7llmkIM1beptE0due2KBSqmu75N+\niEo7nLune3YJY+ySnpCvVttUmo85FLRfT1dHIgsVWheg3oFFWmPN0hgjSBvX\nqrEfoJ32zwcy/XD86RCi+144GQVwPy792fmNk2hZGQfQxFHR+5Sn3J9bjnA8\npax4WXxjN2mp8T1HdFbSOs7R9VB76pLQdGqSzpGdxlpvFCOln8rVdNQ8d/Mj\nc2t1T+3WAFIlYwQaGPuUD/tp6ZfPdIN0oGlkWXb8zXb2BKF51sTELiVFrQmT\nv6LEDc1RQRmUzRR3QL9CEsH4vcKM2xhmYgptHdROuJ5xGOF21Kixw41b20YM\nSf6zgE5+ahAPJj3bS0anPLx/iQEfNHyQEmBR0DPQs5xRYrbQ5oabFjWCqE7c\n/gap\r\n=cz1u\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`mdc-slider-color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`mdc-slider-highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`mdc-slider-rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`mdc-slider-rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`mdc-slider-thumb-color($color)` | Sets the color of the thumb (grab handle)\n`mdc-slider-focus-halo-color($color)` | Sets the color of the focus halo\n`mdc-slider-value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`mdc-slider-value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`mdc-slider-value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"b155f26dba1f11e3c9d7d0fe036cca6da8b37a3c","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.17.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.17.0","dependencies":{"tslib":"^1.9.3","@material/dom":"5.0.0-canary.58500806e.0","@material/rtl":"5.0.0-canary.58500806e.0","@material/base":"5.0.0-canary.58500806e.0","@material/theme":"5.0.0-canary.58500806e.0","@material/animation":"5.0.0-canary.58500806e.0","@material/typography":"5.0.0-canary.58500806e.0","@material/feature-targeting":"5.0.0-canary.58500806e.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_5.0.0-canary.58500806e.0_1573227351217_0.34329414255885826","host":"s3://npm-registry-packages"}},"5.0.0-canary.66299b646.0":{"name":"@material/slider","version":"5.0.0-canary.66299b646.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@5.0.0-canary.66299b646.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"e4d1b249c65c01af6802ae6d096ec483e2f4344f","tarball":"https://registry.npmjs.org/@material/slider/-/slider-5.0.0-canary.66299b646.0.tgz","fileCount":31,"integrity":"sha512-YNjjPH90X7XLoP2y5hMBTgYybm3eTLlaEusgxAtP0dEqhbQHRWtDdPWHMFO2GTiNgCnVdamBQaV/VqMGYRhbeQ==","signatures":[{"sig":"MEUCIDP0fpJnXjFHPcseIoNYcgykQwuLx3fQ3mSkyv4/YFXOAiEAtm64DsiT06fzvd7xYqqT4pjs6um+eZX7j7fxnE4yeFc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":346843,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdxdEsCRA9TVsSAnZWagAA8/gQAI8xnjWVcMaklM2NR54h\n2WxDdTxfjTclTn1aDW5K5Pnw3qmHoo7xPMSt7G8SG12x/rUiGIX20QemdYvA\neOPBcykWGu/4ZzRqNpVoR1wrCoZSQ+Sv2d/r4lBQjdsKtmzmwhR/Nq44AwQI\neXR7wjd6FGFkexS0gjyvIzYZLCrkesxiHWX+2G/i909fA52CM2NBjzL363Vw\nC/6ZGQ6anncSjR8/LZTg01xFc4D8fKPFZsCOzquT2X3dXzCMheg999mpEHR+\nJrCEET16PCtU3cqQTsm+O2XNhJ08g7qAcpSvT2uxHE2Nlnnejt5nQzNVO18z\nG5sxoi6+aLL/joJ4AsxJTdiDuj+UrBjfh8MmJz3qDJVYszouy11363hCAxPX\nrqUymQCdCswVMIihSm5wMEKjwRWe6RQfpXbWzYbyruC4/XunyvoqFNz23gVB\nNKGsa0M3l3v1taleDHStq6a6Qrs8HbJ/fyQVEv/G7wcPDScG+Qa/DLJJ5Ybu\na8nziOweTz/UZ17EG/HBB94EhsktDBkBMz6TApHjs72YeM1yRC42+FVfOmzd\nUzEiTt/cO62JvBX7oyRNjVJ0CtFwa45UAgZdy16jQt2EnQAEBjYT/RUxYvtx\noRX/TNW4Z3Y7jUqkRvcivm9DwwiT2SC03kHy7ilhzf+eb802Yo1eofl1CApY\n4rIS\r\n=2jvJ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`mdc-slider-color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`mdc-slider-highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`mdc-slider-rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`mdc-slider-rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`mdc-slider-thumb-color($color)` | Sets the color of the thumb (grab handle)\n`mdc-slider-focus-halo-color($color)` | Sets the color of the focus halo\n`mdc-slider-value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`mdc-slider-value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`mdc-slider-value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"4bcc7c183ed18cfdcbaf564e317231824ea91b6b","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.17.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.17.0","dependencies":{"tslib":"^1.9.3","@material/dom":"5.0.0-canary.66299b646.0","@material/rtl":"5.0.0-canary.66299b646.0","@material/base":"5.0.0-canary.66299b646.0","@material/theme":"5.0.0-canary.66299b646.0","@material/animation":"5.0.0-canary.66299b646.0","@material/typography":"5.0.0-canary.66299b646.0","@material/feature-targeting":"5.0.0-canary.66299b646.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_5.0.0-canary.66299b646.0_1573245228427_0.9163945506991948","host":"s3://npm-registry-packages"}},"5.0.0-canary.821871e04.0":{"name":"@material/slider","version":"5.0.0-canary.821871e04.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@5.0.0-canary.821871e04.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"c54ee1fb274106e6e2055aec416a5cf73d2f52d1","tarball":"https://registry.npmjs.org/@material/slider/-/slider-5.0.0-canary.821871e04.0.tgz","fileCount":31,"integrity":"sha512-27esxzTXrc7aGiT9+kWX1BQG0CpUO3gMVJwH8HTHir8CsLu16H/dyYvWpYl62jgi9bWmylOERMtc/sS4URSIxA==","signatures":[{"sig":"MEYCIQDcHFOFnoRWuPF9D9cHIpxVSQmgflaRNPOXx5D8jA3y1wIhAJCTfJOYZ34TIE9vTAVYml/ubag3Bi/HzhcCl0s36wPZ","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":346843,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdxd3yCRA9TVsSAnZWagAAdpkP/39CntSUClLTTBflL7yb\n0HBkyHQwO9598bwEkWFhc3Xcq94qI7gNTc01999OmE30BPJ7Ek7oq7JmSmYu\nC/lVNR1IgQINBcqObFvwwBIZd6hpK7ZaY3xFcadbPInbBNNPS6g1eKqqd7p9\niN9b98BE+oxeac7mcB9eK+kVvGkOvmLP2wvbqJ65E171DlB4q1CEcL7XPyag\nt8l2ODKQ8QNBtwCgLynrQLH1lh9y0+qm6qGxlCYnh5KbHy6IeMecd7y8byjc\nu4LHl8e3S9fEsBqIPRR8z0xaDpq3DImOocr7Xmjg1JybPbD36dY1RDSCeQ5Q\n9mZkhQgQeU5zuN8TWfvj2qPiTYQOvW/p/YWwYDbe+bvWHdJkWkMnl077tY+6\nNDdXuT4jGYnKvs/M0VSAQzKcBywtVh55Q8insn2HOVy1mP1dCnFFy4JOyXi/\navnp0lSk/6kUj1oCaHcXD17It2Z1yywSqumDgJ+ibiZBTL5MelRq9q2HsO94\nyrRl0YoAlRz2glCnSyNDiAM13VNlo4/ex0mLjwYKiXitFrjU4U6oShaDOa3A\ndh3JH/tAEUY47SPYKx/iBK7ABol9V/vyAkwfwhY2tx37gn6Ho+u+wyiOOOUW\npDopQUbkcNNm2ouiGVitTFzuwh//G3/30wPN4UeyyBEw8Vy0M7anUGN/0uJE\nZKcF\r\n=SqM4\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`mdc-slider-color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`mdc-slider-highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`mdc-slider-rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`mdc-slider-rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`mdc-slider-thumb-color($color)` | Sets the color of the thumb (grab handle)\n`mdc-slider-focus-halo-color($color)` | Sets the color of the focus halo\n`mdc-slider-value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`mdc-slider-value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`mdc-slider-value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"20a91d4645dd0fd2db7a61459d752f390e050899","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.17.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.17.0","dependencies":{"tslib":"^1.9.3","@material/dom":"5.0.0-canary.821871e04.0","@material/rtl":"5.0.0-canary.821871e04.0","@material/base":"5.0.0-canary.821871e04.0","@material/theme":"5.0.0-canary.821871e04.0","@material/animation":"5.0.0-canary.821871e04.0","@material/typography":"5.0.0-canary.821871e04.0","@material/feature-targeting":"5.0.0-canary.821871e04.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_5.0.0-canary.821871e04.0_1573248498082_0.37199593075237036","host":"s3://npm-registry-packages"}},"5.0.0-canary.491fddc31.0":{"name":"@material/slider","version":"5.0.0-canary.491fddc31.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@5.0.0-canary.491fddc31.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"2bbc4342762ec000dc4eda49e8ef1a4bf0783bd0","tarball":"https://registry.npmjs.org/@material/slider/-/slider-5.0.0-canary.491fddc31.0.tgz","fileCount":31,"integrity":"sha512-vzaIODGS7guUBBwBkrLP3T+5y/OZ0+U4tPy3HssUp0hztJurj7t2IT279fYt2pGUi6Dv456OZKNZ1W/vfCftnQ==","signatures":[{"sig":"MEYCIQC0AJBCh+YNA+P7mfwi2mp/MTMybBBor9FcKCOzBL/fJAIhAM7qEwntDEW3QvrJcNg0OgVSiF3vXcS/PE8J1xSt5sWv","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":346843,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdxecZCRA9TVsSAnZWagAAxBUP/3hnKdkyfoFq175yFFXM\nAx5O8SN2Z7CKnA46U4ry9g7UegoP7ztwuE+eUoEkljBtyInUwTuPIj9OAZIi\nup5HOSw2ed+wg/9O0+UBSSA0dIbhA8I7NB6Z/lvDj0a02KLk2+jlJPVP5evE\ny8obk9aI+/Edpb2AC7ugWk2P9NE+08uw4ar5DVsiICvtYhpDXxNCZkskskkf\nyTJJtk7OqZdgGZvwqafPGuu+ulJ3QAgLJ3Be2wB8aYaSHKftcMgVUkgLk8uD\nnseuGa4Dpj3WD2DYMKDB0f6aIjJJ6DmSPFDeyKFIpHkOeTi7vv4tE18JN2gB\nJ4h8YBml5DAzhoIM5TrWcOJ5h1NwqdWlPJHpFNOBmtm8+G63b5luRZDvyNOi\nuf7sa1F8BEGm1zIw+CEndyMpQzpkfDH4qpBa9h4rEjVtE4TJAk3xY0f+/IGt\nNPpu+VwE8aNQeXi5Te3D7o1mDfie4qW7wztW+wEOGHowe/u03WfxneoxFELZ\n0X5Qx07HfuDAifjwLWrICmmRs16qmCwMJvdgeEH/77WGwQjpnyNN0W30yUoY\n9oglOnw7zjVEcwXyLkRptt/aNyn+LBbBvRBA+P+sXxEjKJayD0P0hYNXLauZ\nYRkk6jLkFc2Hs1Qqo3LCMJ+1NRIAFtp0rgG4VyjVCdxiPi29o3U0NwtsTFeG\nw7jz\r\n=iuN5\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`mdc-slider-color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`mdc-slider-highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`mdc-slider-rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`mdc-slider-rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`mdc-slider-thumb-color($color)` | Sets the color of the thumb (grab handle)\n`mdc-slider-focus-halo-color($color)` | Sets the color of the focus halo\n`mdc-slider-value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`mdc-slider-value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`mdc-slider-value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"36ec62985e32e24263ca2d444e04a01d98ba02eb","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.17.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.17.0","dependencies":{"tslib":"^1.9.3","@material/dom":"5.0.0-canary.491fddc31.0","@material/rtl":"5.0.0-canary.491fddc31.0","@material/base":"5.0.0-canary.491fddc31.0","@material/theme":"5.0.0-canary.491fddc31.0","@material/animation":"5.0.0-canary.491fddc31.0","@material/typography":"5.0.0-canary.491fddc31.0","@material/feature-targeting":"5.0.0-canary.491fddc31.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_5.0.0-canary.491fddc31.0_1573250840656_0.41390183867025243","host":"s3://npm-registry-packages"}},"5.0.0-canary.b0cecf145.0":{"name":"@material/slider","version":"5.0.0-canary.b0cecf145.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@5.0.0-canary.b0cecf145.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"5ad036730ce470172a4ff211b2bd6196f01c9e3e","tarball":"https://registry.npmjs.org/@material/slider/-/slider-5.0.0-canary.b0cecf145.0.tgz","fileCount":31,"integrity":"sha512-Tf2iNBlw792gmLJX2R/9ouaLiHykuJWyR4h7j5ByrfmvRjgBGw+kO/x6/kzk3aRhE1awgKEn1Zdzq7D1HVc8gg==","signatures":[{"sig":"MEUCIQCFZeJWmRVJe5NczOr+ZokrsuANNR6sVjmqg3QHX+7TKgIgYwwf4p6TvHIQI5TEhHFYdhHE/WAcc6cHJr1/DUx0lm0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":346843,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdxwiXCRA9TVsSAnZWagAAlvMP+gO0BBFUsDVAyESiPzzG\nlgbVfCmkHzsXhwLWXxKGJPdryZntiHrR8wIlSLNVWtUK8Bd19GS+Z0mqo2tL\nxa4bbD0pKW/i0KjJ28nWcJa+O0B30Ak++ckx0I+CDXqh/CYW6rBA8kWXYdw7\no7QNTHsh6Nk/ndeqoXzFNjPRTCq8VaqrpFk2xdLTXoabaqEcbHcuMiX7S9JR\n3HA14xcE5/9NBcw3DORw+vSMlWWIM6cyXyfqrdB4nPPJtZQkaLPxqpNt372d\nwI/bVJqH1z3hSbkttw6oe4BUX5x8+fBICZrFQ+DBVpOoKWZHEZWANL0991uL\nr4cCJxvdlvAydZ/GIsO/zwTt7ArRkcgjl6qOWBkMPA8otKtyl3fsLeVV2IYP\n/9MRDoaxsz1njBaz5Xh+cImZUpa3gQKBD40QNt2nLp0bJk4L71pne7wntzSp\nAkS3BasQiajTUpSQ/LwDXCwkw2LvXK7zghE3h7+Qm+/m4+D8qA/OmCgXGYow\no9xqvO7lORYhOU64EsaInA5AHqRFRvp9jxw5smh8UMmbQ5bC/hEwtBS7DVv4\nkmqhEDdjhYUGt6DZXYGReAZToEwS0cPneZn7WVKDgdSFb1w5IilFenrrEkzs\nSschGvg9Fg3LKovHBxfuPx0F+xyN1lEq9VRHiCSkJbIS5jRD2OSFpg+63PDS\n6ENV\r\n=sI+9\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`mdc-slider-color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`mdc-slider-highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`mdc-slider-rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`mdc-slider-rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`mdc-slider-thumb-color($color)` | Sets the color of the thumb (grab handle)\n`mdc-slider-focus-halo-color($color)` | Sets the color of the focus halo\n`mdc-slider-value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`mdc-slider-value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`mdc-slider-value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"c20143ddd0d46da106e793fe5b768b628d433923","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.17.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.17.0","dependencies":{"tslib":"^1.9.3","@material/dom":"5.0.0-canary.b0cecf145.0","@material/rtl":"5.0.0-canary.b0cecf145.0","@material/base":"5.0.0-canary.b0cecf145.0","@material/theme":"5.0.0-canary.b0cecf145.0","@material/animation":"5.0.0-canary.b0cecf145.0","@material/typography":"5.0.0-canary.b0cecf145.0","@material/feature-targeting":"5.0.0-canary.b0cecf145.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_5.0.0-canary.b0cecf145.0_1573324951131_0.4271335393013449","host":"s3://npm-registry-packages"}},"5.0.0-canary.afe0dd1bc.0":{"name":"@material/slider","version":"5.0.0-canary.afe0dd1bc.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@5.0.0-canary.afe0dd1bc.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"bfc2e7e4d73c90c120c9e4be2376e6cd85983ca6","tarball":"https://registry.npmjs.org/@material/slider/-/slider-5.0.0-canary.afe0dd1bc.0.tgz","fileCount":31,"integrity":"sha512-NFmzl1HKj9UFJ+uxfq9lGJjgRLES6WkwTGNznnfSc05G9tAHqguRgN81U27iUWEESZJLCJjtOwrZcTeBQ2PFFg==","signatures":[{"sig":"MEQCIBU5sOhx27gnf/3/RHgARXbRXAFrvlssJ+7crouMwexoAiA4bI6AdteN0z4KXTR1HdKt2YBk3/a8eLst1fyoXIwR5g==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":346843,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdyYBMCRA9TVsSAnZWagAAMOwQAJFk8RHaM62HBA7Njx6b\nqFia+E8UPm1nMDAtQhyjDujtI7AwNLA9/QHEEj0oiVS7UfTI2RLUO/MUGB9U\n5r3p8LtzMiqvHF/ZRqx7xMitoI0ySP4uHMe4REIiiFP9J9CH1G8aEAxTl9/l\nE/FUPsm63nfEZ7s6jVlxaxraYaic7EeU0KEYbCcmKhSZekJ9nWcPd8SUkgia\nkmb/BNJvu63zlG6ftWFsFSm1xysy3Xailt5x2NIEv6xFS7kxHO+yfuDEdjkm\nT6eznPLXrnVHxR6KZF+Sms58x+VuqQFtA5zfZviEm6xV2czE48p949ddNhpc\nyK+rAMmtcwG7Vd0L85gYLjg1VBR5KZPWtaiLTvDRegCfTzzrLn+Pyaz/ANGA\njHbWE3Hmb2JEPmzp32TcJZoR+c5qtOSh9DSResJNRBgeVPDrx/axFXxL1RYO\n0mzTpw0eGqNIiUDzJMu6qibNir11OaKxuhZOEjYdwzPplKosA7pwwtiPWHZn\nhTZMtbUm1N1mc6zEhgbBAsySafcAsHUjzUc8AQ5iAMFNbPXd6NvPaCneqCNJ\nmff8t9L0CMStZr9k45WAhOpS914KVJFflnC2cNsoGZTdFr9367d9hziWk/lM\nj6d1pPQmYUJHElEwB292XdUYxka42oL0N19fYmwAqDkgVBsChsDaNu3OOnLO\nFqlj\r\n=Uiq8\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`mdc-slider-color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`mdc-slider-highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`mdc-slider-rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`mdc-slider-rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`mdc-slider-thumb-color($color)` | Sets the color of the thumb (grab handle)\n`mdc-slider-focus-halo-color($color)` | Sets the color of the focus halo\n`mdc-slider-value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`mdc-slider-value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`mdc-slider-value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"3bacd69fa765f810b8bf40608eaa3aa2df12bdce","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.17.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.17.0","dependencies":{"tslib":"^1.9.3","@material/dom":"5.0.0-canary.afe0dd1bc.0","@material/rtl":"5.0.0-canary.afe0dd1bc.0","@material/base":"5.0.0-canary.afe0dd1bc.0","@material/theme":"5.0.0-canary.afe0dd1bc.0","@material/animation":"5.0.0-canary.afe0dd1bc.0","@material/typography":"5.0.0-canary.afe0dd1bc.0","@material/feature-targeting":"5.0.0-canary.afe0dd1bc.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_5.0.0-canary.afe0dd1bc.0_1573486667956_0.46559906149450714","host":"s3://npm-registry-packages"}},"5.0.0-canary.b4cfdc40b.0":{"name":"@material/slider","version":"5.0.0-canary.b4cfdc40b.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@5.0.0-canary.b4cfdc40b.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"7cc2c8b9e52b0c49553bc1c474d6a1e8bb80c13d","tarball":"https://registry.npmjs.org/@material/slider/-/slider-5.0.0-canary.b4cfdc40b.0.tgz","fileCount":31,"integrity":"sha512-UPDYvrkmfZn3gSmBFVl4YxeqEHTlVv80dhUYQXZnmcLeLLZlwJQGd1SXdG5uAsR/3stikYXfO1/3ykUIjPsM9Q==","signatures":[{"sig":"MEYCIQD6bi7zAMWlgTGSxYVmKJZEH4bewGNDC4ll5T62KjbzVgIhAKvp+e6kyQ4A6wYbJ1FIYaOhUWg6koAWSjLWt6jhHHdx","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":346843,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdzXm1CRA9TVsSAnZWagAAFtYP/3ptlDBBTcZgtVJDordX\nhyald4T946ZkAFabenFWrfgwLjxngyVGwnyGqFHY8tFHNHmELnS8qOJrwuih\nlYG3mAmJbYHRWbry7WO8MnRhiSzO3gpEKms003Brl1WcN1Pm2byBu1MFsnoX\ni6ID9zrlfCMX6zCpy+UnUkJB3GhdQAe/QLRDy4cLCLkJndIaOQsMYtcOcVC6\n9vdCBwg6j89B+4jRjBPrjWuMkVEjKyDgrBzhYIA88sfKY2btTVsefCLWB9+c\nCU1Bvp1es11p4vO4XxcRBl58DAaNk0TUq18bbAedjaAE3jrXqPH1xC/dHEoP\nD7m0noGWekxLRBYER/BOIBQBkegkra3xNzQjRTnSFSZERXH1qVch4uJpHSN7\nSkspxoDZnFRbltmi3E/Eo/vJxOXcz2JbnqdZEK5B8MV8/Ra2lOg34AjNhmof\nBBQyTIWmdBKhHqnkbqkATH0RvhjnIi5EV0ujns9VWroteL1qa23F1ztL/wCJ\nWx4S2EWMlzbQMFyTgcG69FXkrLOe2N0Fw0mAPXp6vv+/cxro11UyQsFjn4xp\n0nVkS2SRLmWV5n20WB2vlFCeEN5q//N61jDx76Bc83JXx0GKRPAuQfZ0iIcU\nBNtobfYWZuTy6PfBnHCBjEzota8ff9sI8krvusMONpZx/lyB1or7p3ECiRtE\nJlei\r\n=0zM1\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`mdc-slider-color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`mdc-slider-highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`mdc-slider-rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`mdc-slider-rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`mdc-slider-thumb-color($color)` | Sets the color of the thumb (grab handle)\n`mdc-slider-focus-halo-color($color)` | Sets the color of the focus halo\n`mdc-slider-value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`mdc-slider-value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`mdc-slider-value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"2a81ebd1a573a096ffb378bd1ce7bc223a3cb54d","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.17.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.17.0","dependencies":{"tslib":"^1.9.3","@material/dom":"5.0.0-canary.b4cfdc40b.0","@material/rtl":"5.0.0-canary.b4cfdc40b.0","@material/base":"5.0.0-canary.b4cfdc40b.0","@material/theme":"5.0.0-canary.b4cfdc40b.0","@material/animation":"5.0.0-canary.b4cfdc40b.0","@material/typography":"5.0.0-canary.b4cfdc40b.0","@material/feature-targeting":"5.0.0-canary.b4cfdc40b.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_5.0.0-canary.b4cfdc40b.0_1573747125445_0.5242961649467506","host":"s3://npm-registry-packages"}},"5.0.0-canary.525989b5d.0":{"name":"@material/slider","version":"5.0.0-canary.525989b5d.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@5.0.0-canary.525989b5d.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"53b97f7cd5e95eb948439790a4fe17132e522578","tarball":"https://registry.npmjs.org/@material/slider/-/slider-5.0.0-canary.525989b5d.0.tgz","fileCount":31,"integrity":"sha512-jqj27kOgYDx6EjgRjM0JLaK2BHPtcNJFTGBJv/lMN0l7lxnnLkB8d3drA21elQM1EyMjAFet/w1Osqqbq6P3DQ==","signatures":[{"sig":"MEUCIChKrtdA6PhfVX+JI2V9eBqturlfMn9jhx0TpguAmFt5AiEAiN7uxTMD8UgszzZrmkLRtyH8xTt9v1XsH4J7diKIf5Y=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":346843,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdzeOvCRA9TVsSAnZWagAAiNMP/A6d2IpowQ+WpMbw8Hwf\nVPHzgr+hBLM6QUoRc3Y5g5FK1vyNnU8DDd8ot6x9dWRam0XNhI1EzgXQJUDb\nYvBwQyLQCCODygVrSduXyy3To5OmxLHHg9Kdhs8Zs1TRm6zmiT1zh4Vz6DKz\nOwSHznYcB0JzBV09Um9U5f1vEu2LJZLGLqJqX/gMtP47zrsJKgdH5XMeWUKT\nDmof4zYjeElDBEGbfmmqne/PeToehqj4ykoprplEx2kGLWuJ2Nt61LjKVaqd\nlEkbkAyeL5dRqqRKTcJqxXh+UDgYNpfykeRfZMh6/VtzM6rRyYnBUlJPaqtb\ni5AjKwSmyv09lo2OFdZH9oBwXNlWOYwciTn5q7EVQXKiA3hYqNLYEDwi8ptT\nqySwE0XblgGcFvNRPGiEOOF4bQmia/fbMEeGynh85WRvOCSNSEVfHt3etAqU\nlXBEa8zI0MmYV2cGyDGZpfsh9F/fgFkl0mwdx9+0gO7YpQjfoTYIYevQJWhO\nlSBz2lHKQFrqUsUURVe+kx9dIJTfhyjTjEILhagSpX3NOnXdfwvTZ9sDYW3j\nbglNecALp+BzeUUpy08X7gC/Z5B+iKT2M6/piE4awUEDT9vG7kChbGYd1LFC\n5ImMtbs30sITNmys3V7h8MGyXx01bMLoMKlsipE5AicUGG8v1yPSj9t5zrrc\nrCFi\r\n=iYAj\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`mdc-slider-color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`mdc-slider-highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`mdc-slider-rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`mdc-slider-rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`mdc-slider-thumb-color($color)` | Sets the color of the thumb (grab handle)\n`mdc-slider-focus-halo-color($color)` | Sets the color of the focus halo\n`mdc-slider-value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`mdc-slider-value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`mdc-slider-value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"2fcf375cfb22882468cdbfe126d349a996b450ad","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.17.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.17.0","dependencies":{"tslib":"^1.9.3","@material/dom":"5.0.0-canary.525989b5d.0","@material/rtl":"5.0.0-canary.525989b5d.0","@material/base":"5.0.0-canary.525989b5d.0","@material/theme":"5.0.0-canary.525989b5d.0","@material/animation":"5.0.0-canary.525989b5d.0","@material/typography":"5.0.0-canary.525989b5d.0","@material/feature-targeting":"5.0.0-canary.525989b5d.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_5.0.0-canary.525989b5d.0_1573774254561_0.22756656660436336","host":"s3://npm-registry-packages"}},"5.0.0-canary.7084b403a.0":{"name":"@material/slider","version":"5.0.0-canary.7084b403a.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@5.0.0-canary.7084b403a.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"04ca718ddcc7fb8eb260b25c4dab3bd689b61559","tarball":"https://registry.npmjs.org/@material/slider/-/slider-5.0.0-canary.7084b403a.0.tgz","fileCount":31,"integrity":"sha512-L+yBOzpt26SomHkKcg2YfXHd0MKxhfBtVbyow4d1spJp8kqug1/E4C8mgk6Y/TOfwybdBhdj+yci1pVUG5kgVA==","signatures":[{"sig":"MEQCIEotpNtxStAN7iVosEQdbeuu0iqJXaovei4XBINebeQMAiBwWWTtkGe9NKVEUFoWy/UcIBgr7EdTcSCmR7iq9/Ib9g==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":346843,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdzfn5CRA9TVsSAnZWagAAKMIQAJvrrUXlmCXYoDNdmrf6\nGd3O8Mqh0QtOCPaHxkmRo2VxkbO0CKb/BtM6tFwAjvXk6N+m8HVeXhGLqD+e\nfNOgWCvXlXZ+Mw2+ZEWQf+LZyphd1Bb79RyR39PpuUIsDMJ+HKpT6SssH6bS\nDqwPOQgM3QWRPLOI8Y+XEZh+7E59cQNKirWeGcFnDQiB85T7sS2NlmkXYZGq\nyAE3fqLIyOdKWyG1ECRsVmCeQL3O/QXjlpSA6L5whE8OWZGH5GvN4XXUWKIB\nXK6hR9lCU6X6m9EKMhidZX6JIRhidfRyDUJGiumsDFVTP+SwXwNr+4lx0NuX\n6bCFvek0GjPwTVO2R2MqLhSLElrv3oqVGStC8qYIYr1maRr3YdQlLrENuNKb\n9ZDKDV6OxGiPdblyJcl56M5SwgtL7jFCm5kLHrdwwmmoSq3V8OqAzxixMbWC\nALBAud3gmzP/Huaiwqiqc1I5Cvokg7Sq2SK2NRXysJHPSDIBt/d1RU7MUYor\nWFjZezdazpvo+VFaJfN1PnzqLVshqLwSarebRiegGP/amDMhDoiW65TM7+yh\n2sAVSAN8WXKx4jEu6qqSCZF+j4MOL1W9cHYmCqQtZZyjgckkriRukrFs794g\n4wolOza3J/pnHfSt4d5jQ4IJBlkhh41TqWge2C9KzW4xmNezq+ENki35jwfI\nq5hD\r\n=x+VN\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`mdc-slider-color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`mdc-slider-highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`mdc-slider-rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`mdc-slider-rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`mdc-slider-thumb-color($color)` | Sets the color of the thumb (grab handle)\n`mdc-slider-focus-halo-color($color)` | Sets the color of the focus halo\n`mdc-slider-value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`mdc-slider-value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`mdc-slider-value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"6a82bd7664073498cf25876314019948f3295c87","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.17.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.17.0","dependencies":{"tslib":"^1.9.3","@material/dom":"5.0.0-canary.7084b403a.0","@material/rtl":"5.0.0-canary.7084b403a.0","@material/base":"5.0.0-canary.7084b403a.0","@material/theme":"5.0.0-canary.7084b403a.0","@material/animation":"5.0.0-canary.7084b403a.0","@material/typography":"5.0.0-canary.7084b403a.0","@material/feature-targeting":"5.0.0-canary.7084b403a.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_5.0.0-canary.7084b403a.0_1573779961139_0.6384908781454743","host":"s3://npm-registry-packages"}},"5.0.0-canary.3cbee6dac.0":{"name":"@material/slider","version":"5.0.0-canary.3cbee6dac.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@5.0.0-canary.3cbee6dac.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"ddd3052fc2d60a35f3ca1cfaedd1d5f5b95d1857","tarball":"https://registry.npmjs.org/@material/slider/-/slider-5.0.0-canary.3cbee6dac.0.tgz","fileCount":31,"integrity":"sha512-ifj0QMtfG/L0Y4AB0E9WVZNde6DotSi3JXDv2kwBHdZsuAQl+HovVk+hsmCeID7d6goj5M7UlPYVjnbzO73NhA==","signatures":[{"sig":"MEUCIQDT5mfNt6dogBOkt/CbeecF4MzvMcEjUQYaPiuR4bJV8gIgQSE4+hjKClERW9Bo0roupkGfFcEKGIYnhHhiQiOvLOs=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":346843,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdzyeZCRA9TVsSAnZWagAANfQQAJmi8fT7IEn1WFc0IsV+\nSZoDV6ALnmDSNrH7U0+bWzjjjBTOnVrSNwJqvc/ioSIwBZjdNHK2s+S8ihuy\nw48e6uQpJv8QgELVmoaqfta/j5LNANPWuXye+hRlOdzw6T1TEpxm38tnKxtA\nLd3gITku5Nd0ut3sqX878IedNomyNqUuY8wtCK95EfqbI58IUD93h4V98z1N\n3cabz0bMuYYQVbBXsVZuxEMwufozad0xGFQxN7Upw+eMIfDqRAkGTnacGqsg\npsDs0WIeGB3KDGYgtbKBzmFF9XJtFXhyb6yVh/QIbohYdpuHTB55Dsj5Myts\nBdEn564Rf2rheft5BxEzm8JY4W4GZnxnj7XPCE3joWo9SaegAubvx9xIIu+g\nEWr0lxF2HG6td9zKhkKMMkkOeuIKvDk+xXKF/gLhvO1JG11z8UqjYn5di7o5\n626w/A3EfVyZnKs4WvqUyI7w05Be5ObrA/5b9vDhlWW7Pqvsjdu7LFbGmQ5C\nGJBOJxA5t+JtJi2z/L6QhE2QjyqTPsng5ulLBfoz3TMzaBoY66e1lpkDFZXM\n84gvdsBrpVYmOMmYaThhUPxtrl012nekNaw2DkOrVUGI1EV6Dd+uvByoddcj\n2I4AtJb9cRaPXdoz2TbJlCMTki+YH3kRKLpYnjGI8zFtqybl3fa6f3qIufoH\ntTRM\r\n=9ozM\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`mdc-slider-color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`mdc-slider-highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`mdc-slider-rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`mdc-slider-rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`mdc-slider-thumb-color($color)` | Sets the color of the thumb (grab handle)\n`mdc-slider-focus-halo-color($color)` | Sets the color of the focus halo\n`mdc-slider-value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`mdc-slider-value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`mdc-slider-value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"5ae37026c572ffe6707702e535533859ddc81a48","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.17.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.17.0","dependencies":{"tslib":"^1.9.3","@material/dom":"5.0.0-canary.3cbee6dac.0","@material/rtl":"5.0.0-canary.3cbee6dac.0","@material/base":"5.0.0-canary.3cbee6dac.0","@material/theme":"5.0.0-canary.3cbee6dac.0","@material/animation":"5.0.0-canary.3cbee6dac.0","@material/typography":"5.0.0-canary.3cbee6dac.0","@material/feature-targeting":"5.0.0-canary.3cbee6dac.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_5.0.0-canary.3cbee6dac.0_1573857176768_0.6719902190582461","host":"s3://npm-registry-packages"}},"5.0.0-canary.591a6ad44.0":{"name":"@material/slider","version":"5.0.0-canary.591a6ad44.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@5.0.0-canary.591a6ad44.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"a9827ddd56be541be8267c871ce44c03955e86f5","tarball":"https://registry.npmjs.org/@material/slider/-/slider-5.0.0-canary.591a6ad44.0.tgz","fileCount":31,"integrity":"sha512-lGas6MZWCnYD1hlSdL0UG6ev0S7uJQOUz3ZFI/97CmjpeNmzuQbj4GDEdlnyMSWooeekoXle3C1LqcgXz4sX7A==","signatures":[{"sig":"MEUCIEXIarfB8iqJhfdCHCNlShQYv91q3prpL/U4VqRrjVzQAiEA14pG+9ZCeZNbG/jT36d777UPfUvFqmGW9H7C2/xkAzo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":346843,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd0y3YCRA9TVsSAnZWagAAH98P/0byc62qmG9tPE2VeFkN\nTTvkF6rFzyh1aR4XnqPgvfNx5ekLgOYwqzTBe/wmEKkoNGnOhjszcdo+Sef4\nlW+NjiZWeraXQkbb+ZatzzB71pp7yFoLsu5Pa4boLjG7Cq3vi995C9bqe2S7\nPsYdDnN42Sz1po1vSnFrZO0llYEzvChrgEuGhE3hsXIcBHen6sQG5dNYzCIo\nEtbXX2Hjnx/MMjp1ZAzbQwla2P1/6XXB9Pk1+16zrKIJNmZ/v4XDVoBfdYlp\n1Pfa8ftYxqlwvvZKpe9lavLeKVquipECbL1LOnjsdH5P/IjT/9WaPAJrohSU\nkmuDGE3d1gtSGiFq+HUtHn8LkCcXa7yvaEYwugd/w3cSsJ94itRDPLHYPYf7\nEhEx0CuZNv0/vWfqGgBkAexnBjHpWmbQCtNao2oXqTY97/IVOU/0BFbIRv4e\nxiG2rAnckBh2Lx710S8IW0PeIyyDTBwp5xnKvQff8U5yByQgmcfjIo7EDn85\n628jqUbykBTQ7MTkQNYyckGbFhbppsVei2e+umOJxJ7s0BJgvoXlK5kUtT0P\nRbB6QdaKMDa9OAVCmWVhl1gHg6z+7a+n4AGT+GffXzW2A3MEn4zuWwDYTP+E\nTgnja9rHZTs5d46PeqbjbCgBScnW1bie4ewXWAZI9Ft7Ev3Xws4RIAcmOweW\nI2/2\r\n=KCpZ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`mdc-slider-color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`mdc-slider-highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`mdc-slider-rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`mdc-slider-rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`mdc-slider-thumb-color($color)` | Sets the color of the thumb (grab handle)\n`mdc-slider-focus-halo-color($color)` | Sets the color of the focus halo\n`mdc-slider-value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`mdc-slider-value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`mdc-slider-value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"b5469bc1cbdcbb7c9926006be2d2a65c3211c220","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.17.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.17.0","dependencies":{"tslib":"^1.9.3","@material/dom":"5.0.0-canary.591a6ad44.0","@material/rtl":"5.0.0-canary.591a6ad44.0","@material/base":"5.0.0-canary.591a6ad44.0","@material/theme":"5.0.0-canary.591a6ad44.0","@material/animation":"5.0.0-canary.591a6ad44.0","@material/typography":"5.0.0-canary.591a6ad44.0","@material/feature-targeting":"5.0.0-canary.591a6ad44.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_5.0.0-canary.591a6ad44.0_1574120919702_0.014043148641753156","host":"s3://npm-registry-packages"}},"5.0.0-canary.5729943ba.0":{"name":"@material/slider","version":"5.0.0-canary.5729943ba.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@5.0.0-canary.5729943ba.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"09b19562f1c1b00ed0758f083ece45ef4c6cb17f","tarball":"https://registry.npmjs.org/@material/slider/-/slider-5.0.0-canary.5729943ba.0.tgz","fileCount":31,"integrity":"sha512-ucgR2Z5Fte246s9bGRQckN5Oy912s9jkWaJPbb/Bm2ngu/IZ8mEyJ5BE57pa/5wYkWDvUy+U+pEZCderUyOhvA==","signatures":[{"sig":"MEUCIQCBKOlHYQgAJExDgNbQJWe4Jx+Rroq5Xg49O7ghUNmR9wIgL2h0OJZzY1NfBO/1zgb2ZL4lLPDsIfRWe3hEF1mMUag=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":346843,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd1MzkCRA9TVsSAnZWagAALpoP/RQxrH67dfrVk1n7l7eg\ntyxj9TzxzRa7G16dnnCekMT0s82IxXzYDeKjhwGIefO6j31XAW84WBl/xYrq\nvfhpO4GGlV8Po+5KJJZvl1X73lLx6W7vLuUHa6BnZk7MDGkBVLXCaZ7q+KiJ\nbe0n+ZyXz38zc7wfbPlCYGaiLbgBu+hU4xERd0MsrNkIAeaTQFGMdtZSYpju\nlE6FocPEB0blz2a2tIupVtSZ9CDvxyXQCfHZmu2adikX/0M62YdXHXIQIxZ+\njoBT0BBbj/I5TaJqpCqTlEsvsyNy7obkULQgjRGTHJEsy3GV9vb2IR97l7jF\nd8Wx+mFA2IIYmzzoYOJ4QqgpCEwcKvsjF0BUdUxBwWNi9Oj7U0z4TAP8cirZ\n32gHygT2lfp35Wf8DfsUJqJXzJG4N6NIfgdMIyH3nmR+cfif3WA3MRjXs6wG\n8b064DZBIUAQKlUTzRK7z1w4udW8lrAa5bhCCQJjNbF4+ABDHLUVHfMOgFy6\nDqEG//jb+3hA+UommaRna8Rw5RDOs9wcrPmCbgQaxZDFOblgjT5JTuUsuH1p\nv7f1+1NQ3SjW9srCylof7gHfFl93wOoJZPxJ0LMvAoNJStdcsVn1xHoSy8R2\nPjtSvPvQvS0198rDSFpgbXXq1fkPxnal2HpLbJmJx68anHDQnV6Sbvwz6DPH\niICe\r\n=c8T5\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`mdc-slider-color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`mdc-slider-highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`mdc-slider-rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`mdc-slider-rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`mdc-slider-thumb-color($color)` | Sets the color of the thumb (grab handle)\n`mdc-slider-focus-halo-color($color)` | Sets the color of the focus halo\n`mdc-slider-value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`mdc-slider-value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`mdc-slider-value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"d49cf0658a3964963bb2b39b2e3a010615c815fe","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.17.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.17.0","dependencies":{"tslib":"^1.9.3","@material/dom":"5.0.0-canary.5729943ba.0","@material/rtl":"5.0.0-canary.5729943ba.0","@material/base":"5.0.0-canary.5729943ba.0","@material/theme":"5.0.0-canary.5729943ba.0","@material/animation":"5.0.0-canary.5729943ba.0","@material/typography":"5.0.0-canary.5729943ba.0","@material/feature-targeting":"5.0.0-canary.5729943ba.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_5.0.0-canary.5729943ba.0_1574227172018_0.7940515288532877","host":"s3://npm-registry-packages"}},"5.0.0-canary.e89750dc7.0":{"name":"@material/slider","version":"5.0.0-canary.e89750dc7.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@5.0.0-canary.e89750dc7.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"a4245106bd1ed8e208d3e751b820b4758762e5f3","tarball":"https://registry.npmjs.org/@material/slider/-/slider-5.0.0-canary.e89750dc7.0.tgz","fileCount":31,"integrity":"sha512-0P61RgITiPt3M58BLhNCIClwJGL3CG4JbpdrABLdV+J4ngNoiVWalEZH7PEMPviIsf+7Cv0nlkauz4yd7Or6lA==","signatures":[{"sig":"MEUCIE8acpaO15xebcxj9ww3d+bFj9oBua7NG5GBFfcnhYIrAiEAha16hRe8VCoqxg9lJgE693K5r49hjxlKKO4OzmHdVFY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":342371,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd3dr0CRA9TVsSAnZWagAAWfoP/jJx9sU9CFq0cJXy7Ltw\nIr8TTHE8E3t8oF0V4afPdnX7EXJKs9Gqj+oTKokVzFQZ0slXGaktELBCn2Bu\nMoQ/AswXq0ueg3v7OMYomkgrda2LrTmokdVXdUPgA7u0nWjFwIL1bK+mwbRe\nNILquwDT8PGsBMwO4dYVK9H/tSOsfVDkdDHsA3aekjInY/sXh0FEvaRAB7jV\ni48GR+xYRLdz7qhBZcLEOe/f6ZzamQIf0CcI4hLKis9gk64sQZs+7RzIDTsT\nege4AY2byEz5eyFx1oL1irmL51KyRPYdjCA2RlYgogFAqrF2p3gucIb6aK7D\ngbVMbdYe6ih80jCPTOrdqyuqzcxloJg7XaGJfDN8AYJ9FWv0vKxftx+Lc8EI\nyTFM/3k7kjimgRhUYuNs3XBS1nSFgKhzBwPXoY/TDiNqDY7SEyveObZ0i3wf\n4R2On3QR2xuSwpCCKGMrwHtQVx7jV7SaR3tVyAi1v8UlBaHk1djV4C5QJKl3\np/joF8MHI1bo5DwRibF8c+FmcB25RIlDQaDbJv3F13ZROH6iwp1Nh7L9C3de\n7Twz2m7QBOc+dxBjgPba6qq/XMEon0SrrC4o8bLeGEshcUapR7xKWFcvIkM/\n0lrkixajflg6cCR0vvW8BkXq+IirzwGLL+6rgMPeWrHX7Zjsy6DuIr34YrRV\nYyyq\r\n=wdgN\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`mdc-slider-color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`mdc-slider-highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`mdc-slider-rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`mdc-slider-rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`mdc-slider-thumb-color($color)` | Sets the color of the thumb (grab handle)\n`mdc-slider-focus-halo-color($color)` | Sets the color of the focus halo\n`mdc-slider-value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`mdc-slider-value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`mdc-slider-value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"2a166b3e817207f685f4b112635eeb21f5ef0789","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.17.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.17.0","dependencies":{"tslib":"^1.9.3","@material/dom":"5.0.0-canary.e89750dc7.0","@material/rtl":"5.0.0-canary.e89750dc7.0","@material/base":"5.0.0-canary.e89750dc7.0","@material/theme":"5.0.0-canary.e89750dc7.0","@material/animation":"5.0.0-canary.e89750dc7.0","@material/typography":"5.0.0-canary.e89750dc7.0","@material/feature-targeting":"5.0.0-canary.e89750dc7.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_5.0.0-canary.e89750dc7.0_1574820596113_0.737169461462071","host":"s3://npm-registry-packages"}},"5.0.0-canary.3e560b33a.0":{"name":"@material/slider","version":"5.0.0-canary.3e560b33a.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@5.0.0-canary.3e560b33a.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"cb8d85d5230de688bb89a9ef8a998542430078bb","tarball":"https://registry.npmjs.org/@material/slider/-/slider-5.0.0-canary.3e560b33a.0.tgz","fileCount":31,"integrity":"sha512-95xNTfzaY8srz8Answ7gvlv+66YBMYt8yHRuV0AQa2/5kRFP0alqHOOa5DWwJn8rkG67w9v1kvr5wmsUPIE7ig==","signatures":[{"sig":"MEUCIQCKMcnYcB49hVarrg3O5MX0ws3ahwXZC11KjDp6x8+K5QIgdPu487nkG8kkJ89d8zSLjT41Iq/lG52T1e3/bpJKs1M=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":342371,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd3dsjCRA9TVsSAnZWagAAjxkP/AhXKqh75MmkRLyb8M8r\nsl4WrbVyfdPuQww25/7iekCOg2ktzi+oJrFp8dznMmyAaGiMz3BGPoWBIKkc\net9B+siNd5W5m9NAvf8UusiJbHbY/Y15pxd3oldKpxJkn7+eiDAi6QoGfKGr\ng3QTvDhdyP4UsviS0E7mbD4V4tDTGHoYUxiRkAg3tM42ewF2yEznK1AQkXPC\nDeKeVsVRtCLsQ0JHdwqpNSu2jSi+/6r+ZM94AghKthxJ85Dv/RPoXa/Gy8pr\naTcpN87BG6UORGYcz0G3Wv7aU1Ni8kXCeorN3oEMYVf8YsbYw1v3rFLbhcxr\n9h1Mn5jlnlq/fEgl3219+SZr8T6vBDNJAYxtvxhxvl0Gs/6uGzs4GhNO/Qpf\ny9kn77afRWrFomdKBxwUEoQpjJH9jni0M/Xw8dYp4Z2UApmpVrrwkWJfRKPD\nVwkqJ2uy5DU3I/+HpMlvGHvvm+yB0jXJGi0nZCx7W4XCvU5Ra1pqtdeKeZos\nCnQHd8xjWzLvYt++Uy90m7hJqwABdoJheO7VKcHdhhBL3YP4aNTElisWNvpl\n8yLStO5dTXwOx/rJNW8KctrDaQTciPHh2wEN1ErouMQu6eOePRvN1FZmSBkf\nbuu3FsNfQ1Ax8saVZCg3tDU9/pbZSSKN6yZXnOl415jLChLDm4k152elqFK7\noeYN\r\n=pQfE\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`mdc-slider-color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`mdc-slider-highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`mdc-slider-rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`mdc-slider-rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`mdc-slider-thumb-color($color)` | Sets the color of the thumb (grab handle)\n`mdc-slider-focus-halo-color($color)` | Sets the color of the focus halo\n`mdc-slider-value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`mdc-slider-value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`mdc-slider-value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"a86efd68e1e91c0cae784ad70b0e36c13c923dba","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.17.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.17.0","dependencies":{"tslib":"^1.9.3","@material/dom":"5.0.0-canary.3e560b33a.0","@material/rtl":"5.0.0-canary.3e560b33a.0","@material/base":"5.0.0-canary.3e560b33a.0","@material/theme":"5.0.0-canary.3e560b33a.0","@material/animation":"5.0.0-canary.3e560b33a.0","@material/typography":"5.0.0-canary.3e560b33a.0","@material/feature-targeting":"5.0.0-canary.3e560b33a.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_5.0.0-canary.3e560b33a.0_1574820642867_0.8116113310591566","host":"s3://npm-registry-packages"}},"5.0.0-canary.7fd17ce5e.0":{"name":"@material/slider","version":"5.0.0-canary.7fd17ce5e.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@5.0.0-canary.7fd17ce5e.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"9fa40f4da14c8e1be36aaf007906a447fb21345c","tarball":"https://registry.npmjs.org/@material/slider/-/slider-5.0.0-canary.7fd17ce5e.0.tgz","fileCount":31,"integrity":"sha512-tJiXfoXYjTRCLZrDIJ3L3m8akMPRC+61Bax8Thqyyrla0QdVVdQ7UWWMrIuJUxGpXsydjm70gX41/H0/HSaxoA==","signatures":[{"sig":"MEYCIQCR7JlSuA5/56NrdTzMHk900mXrMxDQ3MXTd9VJJfGsJQIhALXZqjVSoqZIptMb1dBMhc5SrRSA0KqfUv+8t9g23u/l","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":342371,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd3ds0CRA9TVsSAnZWagAAPJkQAI16DzYzUmtrqhC6BK1J\nFpbKg2sN5RIfRbW16zP8SMvi6yWc6nC0qkmDUgBdZjD2a62jd14Ms/j4kf0o\nikQAuP/vIxXQBYfosxMfUTqpdchVHSkmR78wHUR5NzTU33XvhzVcOm8vLggb\nnSdJ44ylOdcsMXtkierdKXSt0iQDf/C81HR8byLvMTXDs0bSNaDMSn9inKLZ\nGjykDa+LUs5om//ln/K/Yj5hA09jxL/imC9ZtAKF4Y1ig3y7lZrtNEb5V368\nCGWnZXLWlm7BC8xHaKxbc9Uc7ODTu/+mv9s5+rQRhE3rXThyd5hu+gjamQ5K\nW5BFF/sP4XaaaONS9ERURuUZ+Tp3u8BCDVLvfhIQk/rj3gbM1DIwvcQL1UlT\nHQ5ulNk7gtqx/vJEZzhD5p+JxB+Gs8WMpbAhgBkaU8uoXOjiWGAIV7dzKL1t\nM6JqtRK+t9Yox9hTvvTdJn1JO7wCYv8muqWXSSeW4rrYwfKxUffmW5lE4dPG\n/YO0YOqdgUOouR1uZXTQlnRy2SIp32w8jN2UCgcXJOWaPa4mLDwJ/8oEA2CV\nc6Oncc+SsxWQpPT0R5qcFhe+/sA4Njc0Bw1dvhqWWRIVnNPosbvHj+oEvjZ3\n4ozLNlTM9ES+vHUbATf25CKzCmxKj/VkEHSmKHlum6w1GL8IZ7x8xnHk7Vcy\nUSio\r\n=d8ql\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`mdc-slider-color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`mdc-slider-highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`mdc-slider-rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`mdc-slider-rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`mdc-slider-thumb-color($color)` | Sets the color of the thumb (grab handle)\n`mdc-slider-focus-halo-color($color)` | Sets the color of the focus halo\n`mdc-slider-value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`mdc-slider-value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`mdc-slider-value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"e798e5bcdab4c998c88b2bde71412b2d38dfb262","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.17.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.17.0","dependencies":{"tslib":"^1.9.3","@material/dom":"5.0.0-canary.7fd17ce5e.0","@material/rtl":"5.0.0-canary.7fd17ce5e.0","@material/base":"5.0.0-canary.7fd17ce5e.0","@material/theme":"5.0.0-canary.7fd17ce5e.0","@material/animation":"5.0.0-canary.7fd17ce5e.0","@material/typography":"5.0.0-canary.7fd17ce5e.0","@material/feature-targeting":"5.0.0-canary.7fd17ce5e.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_5.0.0-canary.7fd17ce5e.0_1574820660535_0.949658892256835","host":"s3://npm-registry-packages"}},"5.0.0-canary.ec729683b.0":{"name":"@material/slider","version":"5.0.0-canary.ec729683b.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@5.0.0-canary.ec729683b.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"4f42838173df50e780b72e50785ebc9dbb6f9294","tarball":"https://registry.npmjs.org/@material/slider/-/slider-5.0.0-canary.ec729683b.0.tgz","fileCount":31,"integrity":"sha512-Dj7UvN7i0uA1rzuHnHUx8/khDLD3GIQySYZNw7FpDKJIKXLGHVUrO3rWNrszL4iZWklmd5Le88B/fa8P0ARRdg==","signatures":[{"sig":"MEUCIQCler0s6MPTf4J6VYjN7j/EPliavI/6omeO5q4nxeHC2wIgC7moS2AQFkqI7Y8iw7W68OVwuq4ofZsQKIApW4RvZU0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":342371,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd3pxgCRA9TVsSAnZWagAA390P/jKY/LD+bMFJoEG1Ngui\n51BKrDtVCCcNcBPgoirCi//azGPaqyCz+0a9xszDyokBFTtS1ffUCGaWBkmW\n+oIxMBcZfYEiHu3/Yycj1hv/fzQD3IHo6iDJIRWruvImHutUJeSrDcjiQY3s\n7drBn4uk1FtNZf41rm4HUu9KXpYkRJ7eIMVFEVtDMHQCo54OF83i8oe0GOfM\nw+rjpDHxeII1fhYQsixamy77EIHq1sxiWdiS8J9N1lKVx3RXtKAkfKXBkT1P\n2gDxABcG7D0z0JyuKiEm4ZFmBR8JU1v7L5RDZEQ+UN4qKHNHk0mw3iExQtgD\nKJevZ3L4zSJ1hz9r0K0Q3ed3gEaCshoTIvpAS2/Pen9xwnTOSCPknXOEFxZX\nyQw/mXl6fM/SnzBuimnzTVu5Vgw5mNJUnhj6njdH93HCOJFlT1pqT+MopVLe\nLgvm3tZCdLpeeKPrlHGM9/v6EvzfysXI/s3+PYC3XqBmb+y1HKeNjYrRX6Lo\nheCKOpUBqAUf+w/nJTLh3InIPqYFY4BZbzEn1xQF8M9Qn50Mqh26M0yJEDVU\nRM3LI6UjwVVZXhtWPBVvY7Tdh/NDWqIVw1EcFvzqHBbu1SIMvtL6Elx6vabk\nkHY3o15ZVo/AJXut927Wp7jFL40ON2fw7+3wMp9Z7CczFxyAbv+9fcn2hzeK\noz3h\r\n=TXV4\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`mdc-slider-color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`mdc-slider-highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`mdc-slider-rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`mdc-slider-rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`mdc-slider-thumb-color($color)` | Sets the color of the thumb (grab handle)\n`mdc-slider-focus-halo-color($color)` | Sets the color of the focus halo\n`mdc-slider-value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`mdc-slider-value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`mdc-slider-value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"919526f37cd7606c0de4cc409ed4c1ead34b60eb","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.17.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.17.0","dependencies":{"tslib":"^1.9.3","@material/dom":"5.0.0-canary.ec729683b.0","@material/rtl":"5.0.0-canary.ec729683b.0","@material/base":"5.0.0-canary.ec729683b.0","@material/theme":"5.0.0-canary.ec729683b.0","@material/animation":"5.0.0-canary.ec729683b.0","@material/typography":"5.0.0-canary.ec729683b.0","@material/feature-targeting":"5.0.0-canary.ec729683b.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_5.0.0-canary.ec729683b.0_1574870111787_0.32684428376991836","host":"s3://npm-registry-packages"}},"5.0.0-canary.b8bc4a26e.0":{"name":"@material/slider","version":"5.0.0-canary.b8bc4a26e.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@5.0.0-canary.b8bc4a26e.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"9cfb8edad85b96c54e3d4f4fe13223366b1d7d7a","tarball":"https://registry.npmjs.org/@material/slider/-/slider-5.0.0-canary.b8bc4a26e.0.tgz","fileCount":31,"integrity":"sha512-Sk+OjM7Z1hdA22ZzSyFyM4xP3qTWa032/xxgnaHS9uxbDqt3GmL2X4ZDCzpfqI6LYRtlwNXnSgrNxECQYU/E2g==","signatures":[{"sig":"MEQCIEzzLvQ3YroAglRJqbmm8jGpCtNRbHso/ppQFeoRJCyKAiAZ5RjEh5zRBZp0hiDuZ88lnB2Q6QUKxDGTxINdyd7bzw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":342371,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd3sulCRA9TVsSAnZWagAArpsP/RRXfDISWwv7tOtuNwYP\nwGTji+ASi/pqYO0pNmYnmrzeDiVAhEJ8Ofu9xhNT6i+P3v+yJ3jsSjW7MDKM\nvScj8JbTxhHjYW0zd/dRIJxxqRl+SEuOx/k3Y7QTH/F8a72EZKW3qP357HRo\nKJpnUGX4yXq0DUumYQCOxwUuxn1QBz91cTFtB+sfi0pz9LjYDYdS114eO5Dp\nTHa1qaStRl0PC69ncJGzvM1nb3Sw1fkKEVaWBmnqLpgst852KtUbg2RZsCj7\npanZQ8ejRYcgfLZ8S2RDWVqM5b7t1i2NAn3Cmb40tad0ajpVXe0nbyCE5yn4\nd9cJD2Mj6ukzDFBTtKT9256bR0oOm/xOs54ZunKMIU5tzUopyBr8tK7t8u5W\ndCMW5/PmwdoBv7FN5FNC9l0YEJ0URcZd/VyuJcKuIn5HAUFkTPfJ/JWtFHiU\neNvnyvptChP278QsCxJru0OIWJYJgFgLeMvoXEGbVrOM1+usLy56OM3UyDIK\nFWaTmjzEA7bQuhuzg5xrYwg0rNoRkWeqjfIQGlvncWtdMv5JDTBU6UwyvAcJ\nkpMxwW4tUHaGdZltlUP4ag/8GYSLeoO/RDH9gyS+v7bjMbInImiT8y4NihTv\n3mIq5zIf41daPQl2PE29XX1NnqV90aGRnylaP1ov+W/OB9RmClWmcSN0dKrc\nXZ+a\r\n=LhI1\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`mdc-slider-color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`mdc-slider-highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`mdc-slider-rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`mdc-slider-rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`mdc-slider-thumb-color($color)` | Sets the color of the thumb (grab handle)\n`mdc-slider-focus-halo-color($color)` | Sets the color of the focus halo\n`mdc-slider-value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`mdc-slider-value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`mdc-slider-value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"d04615df572bbbf2ab2eeb76ea45696d0a40563c","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.17.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.17.0","dependencies":{"tslib":"^1.9.3","@material/dom":"5.0.0-canary.b8bc4a26e.0","@material/rtl":"5.0.0-canary.b8bc4a26e.0","@material/base":"5.0.0-canary.b8bc4a26e.0","@material/theme":"5.0.0-canary.b8bc4a26e.0","@material/animation":"5.0.0-canary.b8bc4a26e.0","@material/typography":"5.0.0-canary.b8bc4a26e.0","@material/feature-targeting":"5.0.0-canary.b8bc4a26e.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_5.0.0-canary.b8bc4a26e.0_1574882212861_0.4869963549722649","host":"s3://npm-registry-packages"}},"5.0.0-canary.f978109c3.0":{"name":"@material/slider","version":"5.0.0-canary.f978109c3.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@5.0.0-canary.f978109c3.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"aa179b7005c3921fd2e07172d99550c7d65e142f","tarball":"https://registry.npmjs.org/@material/slider/-/slider-5.0.0-canary.f978109c3.0.tgz","fileCount":31,"integrity":"sha512-h6UzJyAKAVOmDevuYLoKn/MnlpJRdDNI3kajKXzSJFWKzoOnz2fwvVJG0noc9XqDQYt3dJZ+fvlaX4qHCIiEZA==","signatures":[{"sig":"MEUCIQCEmI4Z8o2m9mEhA1PJrnFc2v7vHcckAal+8CT9Jwa0gwIgQmbt7/f1NM3ao2xdd8rGBR7rMxmmDM6GEaH/mSblMKI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":342371,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd5UTVCRA9TVsSAnZWagAAmP8P/0FfyZVn2SSNdCIMWQP4\nnR5LLJQsvFPOeLm7qu/wFKVQDJFSaHMbzSAc1uV3N7+C8t13lBOCXGh0Y5HB\nu8qEuKYkwC2SO0jshZ5rvFsylD+d9+/iN4FnjzTbByM/ktMJqb0MbezCGwjB\nM2gZkjqmc+2ivCNnW5KtVMAlqf+2QdzpQo1uKe+JLyCS1n43sTqwY9SUejEi\nxBPba0hU5liLJ32lOPGIJFqSUGekPmIlTpsOK8PxYlMM7bpmbtrt/VDHqkzc\nVIITDUqSqrfHoQHH/jtGHZpkblABbr1yGgfjkFi4aWLLhw5YltuvGFIOGIIV\nEROxtQe/4/PTGxkAzo6YTzStEx7AVOWhDzoJp8LmZHGOGL4HKbci4tIDWt2k\n7yXTEEdYeYOTkukAQn7wfU5sFQpSmnC9NuD9oKB0pneeHhItlMKJjlo8om3c\ndMb8yhJTV0qjnniNS7BKWZKAG1ovUt57RKkh+JXJhAf1N1h9TlkdvZvVdYj5\nIdhB+4qtVKpOA0sK7CqPz4aj/augSF7TBtQCZdTQeWhK/7+ntL76GrwbXHyI\ng7sHXAgHYRbbsYvVau1uZNYm+wrzvcpKV0ZbHF/KriTnWwSvICK/WZVkyq8o\nq6AIOje8xK1dEXx/PhHrHacQ1Q3rM0rmsUWI7SFkuuII/KaFBOJglY8xD2Bf\noUYx\r\n=0dbp\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`mdc-slider-color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`mdc-slider-highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`mdc-slider-rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`mdc-slider-rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`mdc-slider-thumb-color($color)` | Sets the color of the thumb (grab handle)\n`mdc-slider-focus-halo-color($color)` | Sets the color of the focus halo\n`mdc-slider-value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`mdc-slider-value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`mdc-slider-value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"27bb2072dd0bc0aec40da3282431f7513467bbd8","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.17.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.17.0","dependencies":{"tslib":"^1.9.3","@material/dom":"5.0.0-canary.f978109c3.0","@material/rtl":"5.0.0-canary.f978109c3.0","@material/base":"5.0.0-canary.f978109c3.0","@material/theme":"5.0.0-canary.f978109c3.0","@material/animation":"5.0.0-canary.f978109c3.0","@material/typography":"5.0.0-canary.f978109c3.0","@material/feature-targeting":"5.0.0-canary.f978109c3.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_5.0.0-canary.f978109c3.0_1575306452777_0.8638140984427116","host":"s3://npm-registry-packages"}},"5.0.0-canary.ad9dfe706.0":{"name":"@material/slider","version":"5.0.0-canary.ad9dfe706.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@5.0.0-canary.ad9dfe706.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"72f0d237bb089157fa8fd7e333a989d885daf770","tarball":"https://registry.npmjs.org/@material/slider/-/slider-5.0.0-canary.ad9dfe706.0.tgz","fileCount":31,"integrity":"sha512-yFJenlVTXrV+Ey7uk9i529A6uFhh/l04FHgvUnM+ZqcQhiWfJ4vmQuc3uUlct688pFjVQHcbyZhYRyqEC/i8QQ==","signatures":[{"sig":"MEUCIQC335i1uotn2qn+ECNLAg9S9WiWJPcsEuH3JXPFYXtvMwIgDpV+B+OgIngLYxcn4X/U7OOe1k7E1OxkuPQMYCynx50=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":342371,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd5u00CRA9TVsSAnZWagAAfr4P+gNzbfB7iW1u1Xn4JgpB\n0lDhVkZkNfAyZvcmleGiKMdIsHq7tJdsK7Sqo7yDFQEtE5PLLRt3MAcw2SJa\nINpDUNlvH6Ap5WTvNLGl87RZRHBYAYIm7F56Sg8nqAToQzfspSYFAkDlZ9HS\nGDigzFhQIceFAUbLXIcbyPk/SOWwtxOvbbzq164Qr3eiLe5pLkpyP2O++SOF\nljhl5FzVLyt6Y0A8si96gjWxDGpkV6RA6MhndsuSl53BHCltOXWqfOiDPIlG\n7iFCNXkClS9tHCTM2/ZbsntN+RTG3ubw5YMTDSGTpHEwvftVigiG/CCMMhpB\nHcq5XTUUxspjvn+tTxZHqqq8qBjmFUU4SC6UMXabyIASEgIbj6m2SRYog/3h\nlJwG3DqDnaw5BFDKEDcBKMOmQGE+b+MmUCOnopTLtCy26WwQFmMXGhCfHKB0\nHwd3YOQnFuqzVCdPaC7yxIC1o/ll6HrDG/d/H+wrcTfB5qF6aHqsAcM9Uxqz\nxb3La/XyqjsNXAZnT0JF+X81MvQPcZKgZ4DxXS5+tABlGSL3w1VlD4dKJZjr\n9X6d4b8hA/BKmkgMbwhnyihTAPBCYJ4tEWtIB/zJkHEg5rSYUWM8z3/u8sjb\nR3biuITjyyMjvtW6QgBtFmBXi7FQ2YWs6ENVMV4JhXrF1nJrcnwhZOZQ35+z\nDexy\r\n=ABwe\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`mdc-slider-color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`mdc-slider-highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`mdc-slider-rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`mdc-slider-rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`mdc-slider-thumb-color($color)` | Sets the color of the thumb (grab handle)\n`mdc-slider-focus-halo-color($color)` | Sets the color of the focus halo\n`mdc-slider-value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`mdc-slider-value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`mdc-slider-value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"ded1665c7a532bca8466d5bc100026f56ea99715","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.17.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.17.0","dependencies":{"tslib":"^1.9.3","@material/dom":"5.0.0-canary.ad9dfe706.0","@material/rtl":"5.0.0-canary.ad9dfe706.0","@material/base":"5.0.0-canary.ad9dfe706.0","@material/theme":"5.0.0-canary.ad9dfe706.0","@material/animation":"5.0.0-canary.ad9dfe706.0","@material/typography":"5.0.0-canary.ad9dfe706.0","@material/feature-targeting":"5.0.0-canary.ad9dfe706.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_5.0.0-canary.ad9dfe706.0_1575415092539_0.12499366481083163","host":"s3://npm-registry-packages"}},"5.0.0-canary.5e45d77f3.0":{"name":"@material/slider","version":"5.0.0-canary.5e45d77f3.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@5.0.0-canary.5e45d77f3.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"948377932ef75f0b2ab8b729ec8fa0b485fe4f09","tarball":"https://registry.npmjs.org/@material/slider/-/slider-5.0.0-canary.5e45d77f3.0.tgz","fileCount":31,"integrity":"sha512-36IzeVgKoOz14unse/lt7n226FxDhLB6Y0spP8msRQjUby3tHcozX61o9jGG0KnFsX4zt7dKd+xfefLpoc0lww==","signatures":[{"sig":"MEQCIG7YR6vsm85movmCWlkvzshpFDlkfoaAyRkd1fNP09wPAiBUWJeWLBflzMkpAYK2Q5TFnzX3qoZXLrvCmnoie3HaRQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":342371,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd5u2DCRA9TVsSAnZWagAAb58P+wXlfvKKwust1Xlhp+9x\nTExN2G/9GmtrX/gxMgxbqEsJDcAlHMmV6V9KmeiOkEoowuCkYD3UbkaoKUU7\nZcCE8vPfRuBgBNS6ve3oux6QZ+MntPu4qxiEiqQUeLgrUhO5vPVbFY0/4RP1\nNi0j3mpN219NvgdF3plOYTMrrYF9KupDcDz8oS/9UDzMDYckpMNUnXezcxBt\nv58n2/Uv+jkA3lWodjwrM8xS5mLvyle3msaQ1nxLgIYeOtFthmRRjgaGBgVd\no+2sfUZqONOynkrjkKCdHYzEF2MYeRAp0PLBp6f3FGV60hguFdUNzwKwggfZ\n3h9+PDYU2AMy/P9iFtpUZlQvLDwJjb6HcZrCu60tksSjeIW7KttZJnzUXdmo\nUxTtFjvv0JZW8pzhiUngwCEPbdjz2GdK6Ky8e3Iopwwt3eMwB4Kk9YBhdxU/\n1CxTsUglfMFzv3hBqNb5dUBysfKDYNKvkkrARZBs/grd0TtyBOkRN8tTFGL+\n79cZz3RgJrPxOfu3gq65v0B5PE69jqdTRa4q4e9YLAIHgLeIh1cdx4er35xq\nAnnR493UHTNeFRu1hULqZEbCCfBpWAxNHzFrTV5zUtwOdgKrFuFcgYMdoasB\nv6BVe4byKIgEOUIX8q1oUrg8E/HU8rM7fh8Rr+AM+WVWxnhQIQI2iLov7u7K\nzr0B\r\n=Zac+\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`mdc-slider-color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`mdc-slider-highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`mdc-slider-rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`mdc-slider-rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`mdc-slider-thumb-color($color)` | Sets the color of the thumb (grab handle)\n`mdc-slider-focus-halo-color($color)` | Sets the color of the focus halo\n`mdc-slider-value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`mdc-slider-value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`mdc-slider-value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"d7a20a5fb792fe297fffc09187b6dd3859babcd2","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.17.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.17.0","dependencies":{"tslib":"^1.9.3","@material/dom":"5.0.0-canary.5e45d77f3.0","@material/rtl":"5.0.0-canary.5e45d77f3.0","@material/base":"5.0.0-canary.5e45d77f3.0","@material/theme":"5.0.0-canary.5e45d77f3.0","@material/animation":"5.0.0-canary.5e45d77f3.0","@material/typography":"5.0.0-canary.5e45d77f3.0","@material/feature-targeting":"5.0.0-canary.5e45d77f3.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_5.0.0-canary.5e45d77f3.0_1575415171269_0.012806530768184388","host":"s3://npm-registry-packages"}},"5.0.0-canary.d10e8cdf3.0":{"name":"@material/slider","version":"5.0.0-canary.d10e8cdf3.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@5.0.0-canary.d10e8cdf3.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"1a421ed1c7f78fe674640d37349be53fb51c63eb","tarball":"https://registry.npmjs.org/@material/slider/-/slider-5.0.0-canary.d10e8cdf3.0.tgz","fileCount":31,"integrity":"sha512-hcZ6juY5zrLH3ee+XpDpelxRf454rHyg3nCHaVatrDKMcym6cvm7BDjOTnTaDc8YT3NEpj+j0r68tTBsuFpTiA==","signatures":[{"sig":"MEUCIH46JTFYliAmLv2iIRl3KFzWcMvN7GZ3EzwmneF/lXCEAiEA06z3zH1NHzcmxzYGgZOgpT/baMLBEYfK6vVPvQYGMqo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":342371,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd5u28CRA9TVsSAnZWagAAD6YP/28TosZDfrhcRdrf937i\nhTYuFEqJfc+WxN01bilP3rb5bB5BJrnOS0eimdHwSIWIVcAKTCVYaPQjZpAg\nADZiWY1FAa4QPC1y4zDcOX21HJHE+ohuEoxROxd4kecbn9HvSlWWec3GHMq8\ntxBwu0toTcppSVSA7gIW0K6Ktz3CUcBNULVEZjOFAmejG02qgYh5JXWavg5b\n05h333VoE9u6QqQ+MCGk7/lDbjV+xNcEsaUYUsHQhLPX3ECnKrdyGy795bCI\nv/jQGJlSwpiEFTRhB8Tk7iQ7Gm+efFCfd5M2tSxW0dPNLSxaX9EE8WrK3WNR\n5p53bX6xQSR6yZOm42XelY8WKPVtZPg8zLGjgzZRxJWK3MvAZmzb71ZW87GB\nQOIt/L5tMXDASN96jaQpRQgiGoUxcfGezvZ032XBXuh70P1/xykthMxJ5zfx\neh7CnvD72jYJM0tic3tR5tSIhf+dY44lHB3UK5AFCpKviIm/NmiovysP/F9Z\n95s4DTUPVrQnzDAQshPrr8i0oAgTwhaxJjEFiWyFpbRPoPq62JD/AGEX2EJ8\nmkSrhRTHIIrraycA2AzdW7WU8xXN2spPVaUrCRVWK/3KFK83TNYRNaPBc0Wf\nHzGfGVjQbnb0xgU/Ql3fxTMjHtsGPZ2uy0SgpBU91b0HXUDdDtBwdmy2dg9S\nGQ3n\r\n=DjIB\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`mdc-slider-color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`mdc-slider-highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`mdc-slider-rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`mdc-slider-rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`mdc-slider-thumb-color($color)` | Sets the color of the thumb (grab handle)\n`mdc-slider-focus-halo-color($color)` | Sets the color of the focus halo\n`mdc-slider-value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`mdc-slider-value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`mdc-slider-value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"855cf0e11682e4f0f44f50292556ce39ae2824a3","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.17.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.17.0","dependencies":{"tslib":"^1.9.3","@material/dom":"5.0.0-canary.d10e8cdf3.0","@material/rtl":"5.0.0-canary.d10e8cdf3.0","@material/base":"5.0.0-canary.d10e8cdf3.0","@material/theme":"5.0.0-canary.d10e8cdf3.0","@material/animation":"5.0.0-canary.d10e8cdf3.0","@material/typography":"5.0.0-canary.d10e8cdf3.0","@material/feature-targeting":"5.0.0-canary.d10e8cdf3.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_5.0.0-canary.d10e8cdf3.0_1575415228344_0.6361263373323256","host":"s3://npm-registry-packages"}},"5.0.0-canary.a5dbd8a2a.0":{"name":"@material/slider","version":"5.0.0-canary.a5dbd8a2a.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@5.0.0-canary.a5dbd8a2a.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"0e062c958039c81981d2bb00e5f38c6b0a4caf70","tarball":"https://registry.npmjs.org/@material/slider/-/slider-5.0.0-canary.a5dbd8a2a.0.tgz","fileCount":31,"integrity":"sha512-MPOtKVVoaJYP5cFU/kkDTCk9ew1dntqnBoly7tYQ1LQkUmOU+wgrC0mWNS7noXv/p2NayU3H1zfxnn0NX4Kgqw==","signatures":[{"sig":"MEQCIB2WcOXBajtN92Miecomwg3lwg1rLEiqVFbztbd3tU3NAiBHroGGkP8hB5+LSn9H+rtBCuGFjr3VsMFhWBhzqAdCOg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":342371,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd5vXeCRA9TVsSAnZWagAAMHwP/ROi7CWXd64Kty8vbCHH\nBz20zhdimkCi+s0V9EBJT83JJB7DS7/02FEQmYMZDp0Wm2B4k/SZ+jvwc5kj\njThqd0HwsqXZuI77AHXXg2PLhZ8pax1RrM2APklOE6045akHtgZgJxg5YKTU\nlPyGWLsnkZNR3QRtmzFhObw09O5rNeQR+oUW29tTbBBssOtfDV+RsDq7rKm/\nEpl/PWjAxXnoeSFA6u8zGA0RZW0gaWc6lCB3kHJ3Rn859QkkoSxsj0SeUgo1\npEmyypLndXOpma4CPMIlPoOGTWFFPI/BY3OPVrjSlbc1XTJoA5ezH+b6WD62\n2uiMfqdqYeAouTVDlMmhXJYP5vV7uj1/Aq38uoG+utq3pSGldmVIJjDAJIh/\nKXLMWWVzLum4HYBRiBxyZW0c0fg9qBwQ04f5ppwGCP954uTiLTzvN0Mn7XYd\nmjLNg2kkorGOcBmwtPbEmFQf+a+C4uzvkrMhONcNtsRI2c3njE4zqNjd0nzx\nXZpUg+ozgjyAJ2nLyqMiE2E3XM3h6NIItHk36u5IgHPRfh/OJFyIVkAjvqlK\n4+CTqhFS4rq9ob08W4QjrXUTSh83NeYeZarNDp2XLdIoCm/fOp0kjV4XMkDo\nzIfEjTXax9o76v7lN6loKkGBrgtxAc/A0P0Kajav3yXUwnktTfgzehcGr/qx\noOCJ\r\n=YtTK\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`mdc-slider-color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`mdc-slider-highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`mdc-slider-rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`mdc-slider-rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`mdc-slider-thumb-color($color)` | Sets the color of the thumb (grab handle)\n`mdc-slider-focus-halo-color($color)` | Sets the color of the focus halo\n`mdc-slider-value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`mdc-slider-value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`mdc-slider-value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"8a67c95c393a733414be4fc008baf7637a9509b2","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.17.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.17.0","dependencies":{"tslib":"^1.9.3","@material/dom":"5.0.0-canary.a5dbd8a2a.0","@material/rtl":"5.0.0-canary.a5dbd8a2a.0","@material/base":"5.0.0-canary.a5dbd8a2a.0","@material/theme":"5.0.0-canary.a5dbd8a2a.0","@material/animation":"5.0.0-canary.a5dbd8a2a.0","@material/typography":"5.0.0-canary.a5dbd8a2a.0","@material/feature-targeting":"5.0.0-canary.a5dbd8a2a.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_5.0.0-canary.a5dbd8a2a.0_1575417310134_0.5878865111200844","host":"s3://npm-registry-packages"}},"5.0.0-canary.ba879b68b.0":{"name":"@material/slider","version":"5.0.0-canary.ba879b68b.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@5.0.0-canary.ba879b68b.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"c4a818ded95eb35e44492d4ba54bf16a12a3a42b","tarball":"https://registry.npmjs.org/@material/slider/-/slider-5.0.0-canary.ba879b68b.0.tgz","fileCount":31,"integrity":"sha512-zzOKmUUyZTD9LI/HmjsG+OBR2OI1M8/xEIMVm8I0shTc4Sutcj/Y/wsJBEfYDgCD0h+W4mH+7+NGugaFgBiI4w==","signatures":[{"sig":"MEYCIQCouCKiwufxlmIkKwgN1DoS83rFQ924rrYErfKUfVDdhgIhANp/8dYOv8BznkgoRK6CucvmPo9WJkRM7xJ5+IdUlpMj","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":342371,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd6BWaCRA9TVsSAnZWagAAgNQP/iHSyilWzt9gb67AKeh7\n4DOciC0ufmU4dOXtbj2wiXJ5Igr8tDYORIGV7oYn/nbRwB+c9SYifibTSlDH\neBLa6LWJUZcebXzl1b/l4dGLh2LXFQX4/iHnowgdRL7dyzfb+dBqKwop/DEW\nnq9l2XMd5ZoQgfW1Ggy5esBbE93G5IplStD84WP7SCPegw2B13pF8r4hpYeC\n1rko4i+l0DSsY2b28KpkV4sQMrRIeNpjKaHgrQybNopf9j+qtkv+irDxOnki\nNYuoOATWMP5GoPW9oIotg8hVAX/eC3vdjuBN76XEBRQbcilNzz3NonpmYyVK\noPUk7UDFgqODEHkSSj9459FrYwfOF8DpwYMdRoiWrrRK+XuXz8acdoDp7/fA\n6la1E1NmGcvy+6wj3zV9I5ZFJulg8GuPKsWTq/C+ZpdWJEG/ED5ojJL3p/5T\novqs5kI+PYePVWoOnHWI//S779vzAphelUmZu8RxmonRlwu5ZTVZMv88F5PR\nr6vdHGRTSka6vyTf3X0Ha8KwXn/2GvKQ1/y9ixo3z/jFF4JDE2RDbA8iL44T\nYBEj/CuvnEPTQOx+C3DvhtMr2mSvnOdGU9L0YKpALXjjMEvD+GyYs1vqsY4P\nsX3LPYFNLUuHrn98LWTD4/EOiB7FdMrcVLVPgLVIXeitDMRW4XmcbqxJdfoS\nSBCA\r\n=IGBm\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`mdc-slider-color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`mdc-slider-highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`mdc-slider-rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`mdc-slider-rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`mdc-slider-thumb-color($color)` | Sets the color of the thumb (grab handle)\n`mdc-slider-focus-halo-color($color)` | Sets the color of the focus halo\n`mdc-slider-value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`mdc-slider-value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`mdc-slider-value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"83bad042ea5d5cc8b93df88a1d4730099550bc6d","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.17.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.17.0","dependencies":{"tslib":"^1.9.3","@material/dom":"5.0.0-canary.ba879b68b.0","@material/rtl":"5.0.0-canary.ba879b68b.0","@material/base":"5.0.0-canary.ba879b68b.0","@material/theme":"5.0.0-canary.ba879b68b.0","@material/animation":"5.0.0-canary.ba879b68b.0","@material/typography":"5.0.0-canary.ba879b68b.0","@material/feature-targeting":"5.0.0-canary.ba879b68b.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_5.0.0-canary.ba879b68b.0_1575490969853_0.686840731780318","host":"s3://npm-registry-packages"}},"5.0.0-canary.aa0eba489.0":{"name":"@material/slider","version":"5.0.0-canary.aa0eba489.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@5.0.0-canary.aa0eba489.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"a9f00892afd7bc66eb2b25a8bc9d5973fd5d87d6","tarball":"https://registry.npmjs.org/@material/slider/-/slider-5.0.0-canary.aa0eba489.0.tgz","fileCount":31,"integrity":"sha512-bIwL4a6twLkiTLDndmnfYr9ISD/XcElXzV/GVc/QdStyr9YLb9iSnyYU1U3UheYyz+EH8gMff7tdyDzF5aZQgA==","signatures":[{"sig":"MEUCIBUmS1Fnkw7Vbcx2DaqUvbMo18rHMCctyQUpjEX7GrGcAiEAobNSparep8KRU9O6zZrN9nKpsiAtMBvMdZH4N4gCHkI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":342371,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd6bXyCRA9TVsSAnZWagAAWEYP+wRIL6UC+eqFnjLWqBmB\nxHhv4FeM8XY+/lOvYEeXKUFG/ZqtS+zYwuJmNPCgUL/jRr4dvHhK+S1OGspQ\n6WKGJeP/6G6k7OnCufp1L4ke8rYcMkgOBcMTMNnTWMMZDaR6Jsh3EJaf6ZSr\nEULjblpW4wiWvywZrFvsjgWMjw3w9hpNgA6/MnWtDvRm+tYxMiw+ygGOKOC1\nhy5jXyxFvve9msAU7iB6XHIDb4auXlqHAw7YIsSdDISAK/nw9g9kL3s6w2Q4\nfWg3kjzjv3+Is03U8OFRwbilLZ/yJ3b3UtZZlnRbY1OF6Q9hHIzt6uwyIIHz\nRy7gABZyTVbPqIiYvI/cXAYwOmaoXhdddp16Q4ZWPEG/PGcsv0DrCIW1zSrz\nqUI20viFKW72kvLbmzdgxSgrCe5l3xutnXqtJY6YAj8mRJlyzhhLGWVSWs/F\nm54NvUZT8JVsunkc3sAPZntI32I70RkIwXcViKB3EHUpOhdEmjlzWOqbkxUt\nttPx6f6XZRA8xBPUjHI/HcwrQKchI2xt5JyaS1r8CFY8EZqzwRIKHl31X7Ia\nkVqPoK8p05rkgblyMV9Kd564NZ81DpG6gxNhTka7ZGOgHX45i08ujTY/lnHt\nuux35jxNnkV1ejG5mulS1FOLjOs9EcKj/dPF7e2TmPSAq470p37PEb1p63xQ\naPQI\r\n=HyTn\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`mdc-slider-color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`mdc-slider-highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`mdc-slider-rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`mdc-slider-rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`mdc-slider-thumb-color($color)` | Sets the color of the thumb (grab handle)\n`mdc-slider-focus-halo-color($color)` | Sets the color of the focus halo\n`mdc-slider-value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`mdc-slider-value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`mdc-slider-value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"50ef06854f8319df2975cafcb0b8c94fc399f155","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.17.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.17.0","dependencies":{"tslib":"^1.9.3","@material/dom":"5.0.0-canary.aa0eba489.0","@material/rtl":"5.0.0-canary.aa0eba489.0","@material/base":"5.0.0-canary.aa0eba489.0","@material/theme":"5.0.0-canary.aa0eba489.0","@material/animation":"5.0.0-canary.aa0eba489.0","@material/typography":"5.0.0-canary.aa0eba489.0","@material/feature-targeting":"5.0.0-canary.aa0eba489.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_5.0.0-canary.aa0eba489.0_1575597554207_0.5876019612724297","host":"s3://npm-registry-packages"}},"5.0.0-canary.cb7b71a86.0":{"name":"@material/slider","version":"5.0.0-canary.cb7b71a86.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@5.0.0-canary.cb7b71a86.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"00bf8bd803141ce5b0fd11ea92b0e885ffe1b01c","tarball":"https://registry.npmjs.org/@material/slider/-/slider-5.0.0-canary.cb7b71a86.0.tgz","fileCount":31,"integrity":"sha512-zrVIjgaOSIB0DaNKLbOthBTQnUl75u5l5dB0KOwuTS19lozdVEHs/sYRaMEvFeir1GNPYlR/2xX35UGCSKktHA==","signatures":[{"sig":"MEYCIQCEGoRsx2F8E77ECHlYOfryDY+kdisox5o5kZMJBvjFCQIhAJ0PkmfzCeqoYWBcH1WV4DEyiKvCeoMjWyXwIp3VbOuk","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":342371,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd6uqPCRA9TVsSAnZWagAArW0P/3eeKI6JSmvt2WJLS93Q\nmErSHJjtlfaE+hS9I9A/yNGbBpRzmUkWaZDGTKGqM3WUX4yHSe4ITU/t+6Vm\nDnAtMHAa8vEk7MlPbcW6u6jhmb02Jk7LVOiYT4KtXb/ZOa3ye6xuknxMPuL7\nzgDNvfUYP0GDJIG0kYGTy+ZithRijoCX6ok/9fMvb9gyI46aCei8zhzWuT/Y\nW9uq5fB7ex3w0PRh741mnAXht3KYpozDf1PcWBnjL22kriVKG2nh93kn+wo7\nYWn7QQ+JDWkdk5/nF+T+t7S1/INrLtjeUmS+OPIObs6gl8qRXSXxIW6GOZgK\nRZuVDuqlpzIhXOhA/Xu0J7VBlzVakk/dnlKP6TeTqny0oO1xjFiHr26RMcmb\nuJnG+iQOnnU574eCKJRQ/jMl8dT7H256TlBfmdAoi03txqHy1ZX4WFWrQHs4\nieXWsI5Jlu28t0XIVj6wDqNEiNtfTJaLo1UqbXoZN2V30DsipkID9ndSbdgq\nRbWkENqGhd2XqMU0+Uq4mdIRgZCGUPJTZMCERHp0DW0dosvqzzKOAUYAuAcA\nwO/8+sb39JRMUb4lXODyF3OncoQV6wJf9V1MT32JxqEZT0FWfRAZ2knczAvF\nJ4lPIg67gMQYJT7zSI4IfwIUxOy8tcFOTxi3WnMDqBLCm9P30WTt0R7NzOjw\nGzdv\r\n=hE7h\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`mdc-slider-color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`mdc-slider-highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`mdc-slider-rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`mdc-slider-rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`mdc-slider-thumb-color($color)` | Sets the color of the thumb (grab handle)\n`mdc-slider-focus-halo-color($color)` | Sets the color of the focus halo\n`mdc-slider-value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`mdc-slider-value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`mdc-slider-value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"2866cdc43c0ae69bc09927b490f0805ca21adfcb","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.17.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.17.0","dependencies":{"tslib":"^1.9.3","@material/dom":"5.0.0-canary.cb7b71a86.0","@material/rtl":"5.0.0-canary.cb7b71a86.0","@material/base":"5.0.0-canary.cb7b71a86.0","@material/theme":"5.0.0-canary.cb7b71a86.0","@material/animation":"5.0.0-canary.cb7b71a86.0","@material/typography":"5.0.0-canary.cb7b71a86.0","@material/feature-targeting":"5.0.0-canary.cb7b71a86.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_5.0.0-canary.cb7b71a86.0_1575676558917_0.2925705693309939","host":"s3://npm-registry-packages"}},"5.0.0-canary.50f110a6c.0":{"name":"@material/slider","version":"5.0.0-canary.50f110a6c.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@5.0.0-canary.50f110a6c.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"4a497109a40b435592a6dbb84aad87c282c0e9bc","tarball":"https://registry.npmjs.org/@material/slider/-/slider-5.0.0-canary.50f110a6c.0.tgz","fileCount":31,"integrity":"sha512-z1DL7TDInaEb3CylGGGKncEtjNloCqFgxaH8v2MKul87soqRVIu1QR/zPbjHV7j/QQ3f0Wm0EYKcBd+mQw6A7A==","signatures":[{"sig":"MEQCIBS8npezZraUTRT8lRJ/DQ6Lf2YGGmNga3c8V5a7U/1+AiBuHeLZIdXjBsvS6gKWQJpGMmYaVilXiLItqoULbVgG1g==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":342371,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd788MCRA9TVsSAnZWagAA23AP/jZVhpkzqmc2v1kYPpHz\nP/MyZio5gL3y0+V74EGfdIOuipikfyPXp1g86+v11wnFj8eMEMK4rx2LRxSW\n6GC2Bjx/0Z2U3VzWSM1w/xW8nA/DU/yItXhwidJ+sz+qF8pi+iHVOZ66+URC\n6ycPKh+0gdYOojdxJGok5gxFX3l1z+PC+5BxxkBgSLFVzS19Y7en3l6KKFDj\nP5bGlxZUaHMIqSyXBalMxrvozgC1TjxwoX7cm9saYYTVfqgMOl1L5XKYv1IS\nLtqaxwtq1NldDiyTXceN/iR3ljvrHrUuHQez9amWyDtCUgI7yh8D90bE8gLR\nKzfk4mNCRis9AamdXVAsl/A567WOhQJ6UUMtnImTW8Mqp/V2/n+P2DcNXI8y\nWTGJYxL9dgcNNIHoUXNbybj7epww3sK5mP/Ag6Z8LkSreUNhVHdwA9Zxd24/\nyTR/HUG7R16CCo86nvVJYBZcKJBT+ot7jvZcj8f60C8v5g+Tr4AFwwqohf0f\n6hr2hftkgqSxFG2YNyE7f4oDw9RQBtgwb5JM6EMSgyEeIWdCYFbJGGlcq2uV\n7Z9EsSoQKCDXJh9sYHedWkiPfK3K02/By02rjKRqrxK7eGbxinnuQLIc5ZuK\ngTLf7tR5JpQJV40cNll8EYRvZQBtNzXN2Ool9dqDBeCFmwkpsOukW5cLF0Ht\nOM9E\r\n=MiLW\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`mdc-slider-color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`mdc-slider-highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`mdc-slider-rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`mdc-slider-rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`mdc-slider-thumb-color($color)` | Sets the color of the thumb (grab handle)\n`mdc-slider-focus-halo-color($color)` | Sets the color of the focus halo\n`mdc-slider-value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`mdc-slider-value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`mdc-slider-value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"84e9b8113e75730b3079c429f751cf857a866b51","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.17.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.17.0","dependencies":{"tslib":"^1.9.3","@material/dom":"5.0.0-canary.50f110a6c.0","@material/rtl":"5.0.0-canary.50f110a6c.0","@material/base":"5.0.0-canary.50f110a6c.0","@material/theme":"5.0.0-canary.50f110a6c.0","@material/animation":"5.0.0-canary.50f110a6c.0","@material/typography":"5.0.0-canary.50f110a6c.0","@material/feature-targeting":"5.0.0-canary.50f110a6c.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_5.0.0-canary.50f110a6c.0_1575997195700_0.44656175713437163","host":"s3://npm-registry-packages"}},"5.0.0-canary.878a08b7c.0":{"name":"@material/slider","version":"5.0.0-canary.878a08b7c.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@5.0.0-canary.878a08b7c.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"ef9f4dfecdd17086f9cc0f45701f6cd09bc133a6","tarball":"https://registry.npmjs.org/@material/slider/-/slider-5.0.0-canary.878a08b7c.0.tgz","fileCount":31,"integrity":"sha512-XvhAGD1jRLdi1f1m+qttIv4ASvIPGbOJ+t5ibwhRL7tDY1tUql8h3poczCuQFOijIt9kQ5ZgncNAzj7HS80sKw==","signatures":[{"sig":"MEUCIEkM2W7gQKnQZax7mGitjiLktKmlGL8UogHBnPP+oYnYAiEArBiJd12P0RQc/KEpms+PDYy9uTxZMnQm9Nw4d7kYD8M=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":342371,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd8U6cCRA9TVsSAnZWagAAbZsQAIjDEhqZUmgNjAK4XN2K\nly7keyim2PWHtAOmqigfRA66O9h/cQrjYoXV95wmoN+N75tKaSFNK/LI7iYF\n1XUnGcFI3d+fST8IWqd1Jdb8k0Kq6zlmZzO1hG4aOKVJkWkkFxODZBOtgjQ0\nQCeSqnwp9kMU3dZ92aHHePWcaPmS0E3Cmwiob1zK/J4qz10aEQGxDmECVU1/\n33Kl6HenJxOcR5i5mNQGx9UM2gzmQmeatqkWUDku7CYS4G2Qkd9PnRe7yxx4\nGuntEBsZ3wxMsdxEp+TLTVOGlZTmOyEeNDyq+jwvvXpbe4gawtdjKtpaSeWS\nEI0Ny9iM9FqumsIYGnCCw1RVVeJTL/ZYb7yKvYk6m42GutMdd/NZbiUAFkCH\nDgqdcL1K5b3yhh51+U8z4JKsRPPIwpPSYVFCXPtlbdbZ2XqeDQiyD26iwEMZ\nZE1BUuPElg57akV/uHZpsF2Kdff1DfUmDFyubmJh7gZWHpcq6znJRgz5WKLe\nYSQt5+2lpMAju7tUNj/ohW0G4R9tluU57qQzJCJBjlrqoHG7CVQbTSt7jd28\nKh/JyAqbL+4j6oj1dFmXspJgi87DWu4alvN/hB46/IA05psKbd1DsTjkl3pC\nKDPgVV0ajYMzDH0kAHsVAW+cbn592uaKX2O0dRouUlefyYOWidwvhz9ig29/\nPq9z\r\n=MW0v\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`mdc-slider-color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`mdc-slider-highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`mdc-slider-rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`mdc-slider-rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`mdc-slider-thumb-color($color)` | Sets the color of the thumb (grab handle)\n`mdc-slider-focus-halo-color($color)` | Sets the color of the focus halo\n`mdc-slider-value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`mdc-slider-value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`mdc-slider-value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"13bdf58f09c0e231663da8e8e9856d7a442efad5","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.17.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.17.0","dependencies":{"tslib":"^1.9.3","@material/dom":"5.0.0-canary.878a08b7c.0","@material/rtl":"5.0.0-canary.878a08b7c.0","@material/base":"5.0.0-canary.878a08b7c.0","@material/theme":"5.0.0-canary.878a08b7c.0","@material/animation":"5.0.0-canary.878a08b7c.0","@material/typography":"5.0.0-canary.878a08b7c.0","@material/feature-targeting":"5.0.0-canary.878a08b7c.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_5.0.0-canary.878a08b7c.0_1576095387742_0.19369409723927888","host":"s3://npm-registry-packages"}},"5.0.0-canary.397905b4e.0":{"name":"@material/slider","version":"5.0.0-canary.397905b4e.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@5.0.0-canary.397905b4e.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"0ead75221e36481a9f9ca1341df54e9c2928ac40","tarball":"https://registry.npmjs.org/@material/slider/-/slider-5.0.0-canary.397905b4e.0.tgz","fileCount":31,"integrity":"sha512-5f19v1QhSLzr02svO1iEPviSrdHzqMoGvN6wEIMHaQbaM5mtXn8C/t2zSAasgXJv7cZtW2KrEEXt2ORPembRHg==","signatures":[{"sig":"MEQCIFV0eR4Iv0cjwK2RkyUy+dXkzyEvHtBQ7PJ6WbuxI3eTAiB8UheJBnMRzKIc/mxUkqcm008MF02oScNlzR0GyZU77w==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":342371,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd8ao9CRA9TVsSAnZWagAAw+YP+wUT0PReAxBE+5os4Ou8\nSEmbphdhP5/W7FVKxqYToYj21yyHLXotK/k4E+XYDKzmn2GRS3HDn/S2yrJ1\nty15Uw+eFQR0QD6rHmSrvL3zhiEmgo7o/utRBpWHsrlvONLrPFCnALJljXbI\nHgi8GSegaxO6VFHiMDpvYBwbofpvpHnP2W03i1jSL3uFIN3JmJpkxOOoF2ES\nizfKt3PTPtyHaAYaG+i55q3MHn7SghOTWorSzEIUIWkhisRoEJaQ8caG1ch/\nBl+MwnRH+upJ459mOo68vd5CpJyCGMAc0lsfhyRqcQAAZH2z3fjKlakvbr9l\niPzRXJax///UT2BLmXhS6LyIqngdu0HGkACKxPh7czPW1ISpJVPJ9dFGfgSW\nsnBFIxvAP++bsIU2AfgpYrW+CSU/L0Rksh1PB3bCzP0sx3vz0XbkQfIk+YsQ\nP1ElgvrGXQnLnl8uxv2/VDT4ZWb+fsxaf9gxwzS1jtJLD+fn+J5lYurtEaxB\nS+dhzVH2OjIWRzQqN3AwUFpOJt95XBSHvPTw1LaxHcAHgFRlkU47hZvqPK6M\nLyFeklmEeqG9uCtLCcl1xiNNG+ByJCTqxNKcZP3mcyDtoa3UhPXhu3+gvXNC\nbYv480+/iU3ivQ23VjngG3zcJVw6bgPegP0ZNGLfGQs1zN3aBEfhpm3NqxbR\nNmxp\r\n=lvGB\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`mdc-slider-color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`mdc-slider-highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`mdc-slider-rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`mdc-slider-rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`mdc-slider-thumb-color($color)` | Sets the color of the thumb (grab handle)\n`mdc-slider-focus-halo-color($color)` | Sets the color of the focus halo\n`mdc-slider-value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`mdc-slider-value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`mdc-slider-value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"43ff8b8aaa48d3a31fc6835290f1ea1822301146","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.17.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.17.0","dependencies":{"tslib":"^1.9.3","@material/dom":"5.0.0-canary.397905b4e.0","@material/rtl":"5.0.0-canary.397905b4e.0","@material/base":"5.0.0-canary.397905b4e.0","@material/theme":"5.0.0-canary.397905b4e.0","@material/animation":"5.0.0-canary.397905b4e.0","@material/typography":"5.0.0-canary.397905b4e.0","@material/feature-targeting":"5.0.0-canary.397905b4e.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_5.0.0-canary.397905b4e.0_1576118844538_0.1566568111509936","host":"s3://npm-registry-packages"}},"5.0.0-canary.1fbf5bd1d.0":{"name":"@material/slider","version":"5.0.0-canary.1fbf5bd1d.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@5.0.0-canary.1fbf5bd1d.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"228faa038e25cb6ed89d08e4c2a44d0fff2a4c4f","tarball":"https://registry.npmjs.org/@material/slider/-/slider-5.0.0-canary.1fbf5bd1d.0.tgz","fileCount":31,"integrity":"sha512-QcqG1b7G2butLpTPyGdhhaNTcB2yEvHujzcGr72OtpQR8ftNdlkeYntQSLzEeAfWvMPPkwco2sYWdDRLu8OCNg==","signatures":[{"sig":"MEUCIGsr22sDtfx6EbAKAU3pMy1/Bmuz/b5saOkClqKt2T2AAiEA5vf4+yrPza1yBapVuWFT4SwYMIEBAEPNHpmY4CR4uOc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":342371,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd8o4OCRA9TVsSAnZWagAAuxcP+gIVpxtAPtdWtdSUIz1c\nOmhO+D9UJ6xx/7bEiOuD4rcJSndwhk61CfnWxwSqBUIRsaOId1Vag66ys6vo\nvRqzpsO/Iv0xyWldGXKZWH9oRHxPWRZMIazfc60ptBabc9ufO2/ecbJdQuqC\nEnVhtRpmQ//b0V5xZ3M9YVIOgutdjtcU3NVTGLuoQvIqQywllUMg6Jjp1jnV\nurk8erfrkg9Kk9dZDwEjdga+O69osH9gx8xQ8nzXTrBUpdd047CsK6KMbN0Z\n0+6KiTm1X78ag7uBazdZ42mJKFwL9fP57bFTdhtat7LmEErrpTcNSaIr6Tra\nWLVyJmu589HFS893gfO/inJL9GMxALi7W0bTleqb9IkwKjo2bRTQ3cQsZCRO\nuDwfrzDo5c7BzvV24S1bJQ8gJrx66394773UmYhpLcXt782GL24F4pB27l89\nvzFu/BAsHgRZmBDRc4SJmV6gQ9YShRf9X5UP7VLiSl/66N6hGNzraIS4I89V\nezyrJkTX1rBitmF/96gctUGLXN2HT505e2LlaGrakFIzZd4pIIZwrIed+0Bs\noWJ2J5XK2Ge9VHukCOyocln/HecCaHHPivd2+jW2+3zb3lT1Jd8cBPkODr5N\nvre4oqBshG5Tb+j/LZ64ZP1mQR1HErO41LtjofvT+m1R+JNzbI8E0gqFBxm5\nIPwO\r\n=tG6M\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`mdc-slider-color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`mdc-slider-highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`mdc-slider-rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`mdc-slider-rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`mdc-slider-thumb-color($color)` | Sets the color of the thumb (grab handle)\n`mdc-slider-focus-halo-color($color)` | Sets the color of the focus halo\n`mdc-slider-value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`mdc-slider-value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`mdc-slider-value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"d1aaf5edd2a8bfd34d05df3e3c52dec6affd6812","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.17.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.17.0","dependencies":{"tslib":"^1.9.3","@material/dom":"5.0.0-canary.1fbf5bd1d.0","@material/rtl":"5.0.0-canary.1fbf5bd1d.0","@material/base":"5.0.0-canary.1fbf5bd1d.0","@material/theme":"5.0.0-canary.1fbf5bd1d.0","@material/animation":"5.0.0-canary.1fbf5bd1d.0","@material/typography":"5.0.0-canary.1fbf5bd1d.0","@material/feature-targeting":"5.0.0-canary.1fbf5bd1d.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_5.0.0-canary.1fbf5bd1d.0_1576177165875_0.5051027993499204","host":"s3://npm-registry-packages"}},"5.0.0-canary.b723dfa78.0":{"name":"@material/slider","version":"5.0.0-canary.b723dfa78.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@5.0.0-canary.b723dfa78.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"4ccebb3df5c559638338d3913488f181b6c7da23","tarball":"https://registry.npmjs.org/@material/slider/-/slider-5.0.0-canary.b723dfa78.0.tgz","fileCount":31,"integrity":"sha512-5NfIpAL5O9mzaGievo2Pa40VgNlCDMUaVenyKbTJsVQSOI+ZtxCVfrEmC4PzhAY1pED1yWwis90WEwHytRf1Ig==","signatures":[{"sig":"MEUCIG039jUYKDM7rFIpjmDKDfD4HAgKPS10TVXdBpg5a3rfAiEA5CM1xsxYr0W16NLk6ucU5iXBgwVlLV+TrnZqjtN9OwY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":342371,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd8p6lCRA9TVsSAnZWagAAEu0P/iiJr96tHUWt2amhw/3s\n5+EDC0+phwreIXgu0pWlhhzcHrJvrwcMGNG/dQQ6CoIq68mLaK4DtthH7eXj\n4U0sOmYg1UNliXWqKA+h/NwbQZ00oHs09sDcgB6Q2ZDSt7SjUTYM77cstaGr\nbJmbJ6AuyxtCyyb1J9E7R7m1jhf+TiHhw8OGaUn8YdXx/Z8hdHCaaC6hUAWO\nVhh1VoH1WK8eO+Op92mnhQEGi33BGhLi78hqgdfvz/R4mwOLBcQ/wvjQv2xz\ns7g11hWJC8u/Aopcw8I7W5wFllBDpUB7s7av2HjZjSyMjcM5pqYxn9tE4THs\nWOMonkoukBXPHclULbc5Oik4yT1S3geU5z/3fFd0EB7YZZfLVMKlJvcKigRW\n09UNqOqJnZDnp2BVtlr7cojB4UaCR2ErqkQzxeC59dfSU6LyW0m62Z6hzm1v\nHg39885arQqFYHDJ7+rmaZNKs0w1mtJAMVV76MloX1m5QNGRLFJ6dE+3Db+Z\nRviM7xTbcUasKFKNIrTk5iktKs0EfCLBreqEt+Uj//dlwYDofzPRLBm2CmXo\nIpryosjwR9uzp8lNyLHo9cp8BazsH9DsMKadRVb4QRruZii7/CwegE8VyhyG\nKiVD1G7MaWMdOwDbI1a6MmnE3/S3mURDB/bg9V7dkmmC9CTKpo80L6WKlBsl\nnw7E\r\n=HBrl\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`mdc-slider-color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`mdc-slider-highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`mdc-slider-rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`mdc-slider-rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`mdc-slider-thumb-color($color)` | Sets the color of the thumb (grab handle)\n`mdc-slider-focus-halo-color($color)` | Sets the color of the focus halo\n`mdc-slider-value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`mdc-slider-value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`mdc-slider-value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"643046d4c1ac458ec8eb1623c5951b3c9a17d2d0","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.17.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.17.0","dependencies":{"tslib":"^1.9.3","@material/dom":"5.0.0-canary.b723dfa78.0","@material/rtl":"5.0.0-canary.b723dfa78.0","@material/base":"5.0.0-canary.b723dfa78.0","@material/theme":"5.0.0-canary.b723dfa78.0","@material/animation":"5.0.0-canary.b723dfa78.0","@material/typography":"5.0.0-canary.b723dfa78.0","@material/feature-targeting":"5.0.0-canary.b723dfa78.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_5.0.0-canary.b723dfa78.0_1576181412689_0.94763833169041","host":"s3://npm-registry-packages"}},"5.0.0-canary.1c494e567.0":{"name":"@material/slider","version":"5.0.0-canary.1c494e567.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@5.0.0-canary.1c494e567.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"384d40ad985f385979daafd56669f8523e6f5c81","tarball":"https://registry.npmjs.org/@material/slider/-/slider-5.0.0-canary.1c494e567.0.tgz","fileCount":31,"integrity":"sha512-3Hk4WzIaadpOJA7KbiBcU+baLP3TL1/C7kuwkeTptWH/eGbfg8hcjiG0IgGEOxwAfTr0pitzurqNS1wsDZgskQ==","signatures":[{"sig":"MEQCICICuHh/xycXvv16/6/t8uEl1HqjjJJXqz0JNPOJMFquAiAUB+IJ9YupSMDCE64WNoO1ToF4R1ffNd7RwiSc+q3pVw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":342371,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd8s8lCRA9TVsSAnZWagAAVL8P/0teHUTLaDoijeBR39RD\nH//zdg5/bNn8QKNmvWE8OA7ULFH2FNGo3IWk6c861srsMEwCR5M5pnUWoYeY\nBGWilhbIwHITZLlSUVt1ResM6RA70saGgEEZ8vtGg4kouPM/el1TYcl4/OOi\nAZi0ZbRPoHS5eg8zgOjW2qo6G+0esB994dtXL0gpx4ahtJ4JfQeQmrKEL1pf\nSCe6i/D1zCWKTvRBQrBPydVdaEe6yOJGNs00ylGRjkjnSFDbOOs3EQQKJO9H\n/NBLLIjeH9O1MM3DtsQ0N9xgBLjzr03dzTlWYWSGC3rGT3TmuU6WVBBMeEyn\nP8y9VI+O2PcPFDnkNdUZZb8XUia6A0tjQw3rj9cIIDY+RSgJoEps/iTjp9QE\nUyxuDWjlUoUIJuohb1OYRRxtEfg9y9m6nSFXVHKUYBQ/LmH6GTllQwOgxNxE\n+tl9B/iAEH/XA3mJK9gST3Z64uXzL4WCaZJHnLAkeErDhtXxjgDWyU8R/0aF\nlXFb1IKnRexjDjBwcSpytF7dxAOqdVMVzbeOAMmnct4LPKGzChTQ9CVc1ydV\nfpkwDe7hZhiP85mJBm34I9vxwspM4K5oAWXxfJ3p9lKOmkDRCQ2+BobmL9x2\niVWsTy4LeUox+kgyylI9Lwfv9+GJlfFCh2FfiwWOeHWnfytLNW5c93Li8nw+\n++D2\r\n=QvWD\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`mdc-slider-color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`mdc-slider-highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`mdc-slider-rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`mdc-slider-rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`mdc-slider-thumb-color($color)` | Sets the color of the thumb (grab handle)\n`mdc-slider-focus-halo-color($color)` | Sets the color of the focus halo\n`mdc-slider-value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`mdc-slider-value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`mdc-slider-value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"d7e01eeb35d8a54be431b39b46b389f3b26262e7","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.17.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.17.0","dependencies":{"tslib":"^1.9.3","@material/dom":"5.0.0-canary.1c494e567.0","@material/rtl":"5.0.0-canary.1c494e567.0","@material/base":"5.0.0-canary.1c494e567.0","@material/theme":"5.0.0-canary.1c494e567.0","@material/animation":"5.0.0-canary.1c494e567.0","@material/typography":"5.0.0-canary.1c494e567.0","@material/feature-targeting":"5.0.0-canary.1c494e567.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_5.0.0-canary.1c494e567.0_1576193829606_0.15724942158168087","host":"s3://npm-registry-packages"}},"5.0.0-canary.c9e98a125.0":{"name":"@material/slider","version":"5.0.0-canary.c9e98a125.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@5.0.0-canary.c9e98a125.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"799ea700665439c2f5c82b1a186f26344eaaf8ad","tarball":"https://registry.npmjs.org/@material/slider/-/slider-5.0.0-canary.c9e98a125.0.tgz","fileCount":31,"integrity":"sha512-EzlmvXsKoOmPRg/0iyqbbEojaNg/9N6KBM2raPSg5bMf9Hm4+A11wsB9/0jV7PzL6TnmmnalxAvFGYA1DdUH0Q==","signatures":[{"sig":"MEUCIF+Xtbfpzut04EhggikwdieCntS2S8+Bv4jLg2xD67VXAiEAuhcso+h4tUdAhlE6ZbWaJoNRuhPwjwAKtMXVyRQhQ5w=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":342371,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd+RoACRA9TVsSAnZWagAAMVUQAJLsQ9ijBYzsXxC6jaOC\nsqt5zj59MrVEIZTGeFaBT3g5GD18qaTM7ol+vFQMzszVNcJZzidKIyzFbRLa\n1aqqjcuzZbbVkUHsD+sp5PCrlHhyyK4+Dko7LJXalqGeKCxG2yfdOWzx26S/\ndVb47O2Xqo2hDxjstsWQxydDhxTQOvKDzjKXsAFjmrfK24BtPwVF9Zi700KY\nEJ3f+dGLDsOsudtOPHl+9P7REkb9m3it5XHfWHtSwqUd3plrioqDPAUSWTfa\nbgOGSMOC5Xo6JWALL4ioafVopNpZEp4D8liCBZcY7yajw85+5ztDbVGmrara\nyY/NT6XuRG0/NTwfetkE9oifu/XAkT5YCKZdfFXJ7Jl++XFO/qGkUmloNI3w\nhoywd9xWFKve4QOx9/Uo3EL3qdpYQ7JyOivbdRdwE4SHR/GaOIEQWUhFapCu\noGJ0I4EW47p8kZHOPY6jVWXNswCdPbA10e9FEoQbuujB6jffRPqNjRiePjEQ\nSEkTlhhSVnVK+NiMsKz2agaL5kpDyBDwqk6RdlK8Zw8SyM6Mf+bB/YKTW9st\nP8l7f17gJfnp2dVYQ1owJQsmOKoxYg9H1dDcT2WnjNNcHIkMW+MG+Y9CTzeI\nqPv0XqJzJM/lXetPscLJH16K6cKvkNr/H9eRwyiUtVN3P0e1YsI3l+oJjBao\nFZtG\r\n=baO+\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`mdc-slider-color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`mdc-slider-highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`mdc-slider-rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`mdc-slider-rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`mdc-slider-thumb-color($color)` | Sets the color of the thumb (grab handle)\n`mdc-slider-focus-halo-color($color)` | Sets the color of the focus halo\n`mdc-slider-value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`mdc-slider-value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`mdc-slider-value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"34b4d9d0fdd6b65308344880ca9abcb67a41ec58","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.17.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.17.0","dependencies":{"tslib":"^1.9.3","@material/dom":"5.0.0-canary.c9e98a125.0","@material/rtl":"5.0.0-canary.c9e98a125.0","@material/base":"5.0.0-canary.c9e98a125.0","@material/theme":"5.0.0-canary.c9e98a125.0","@material/animation":"5.0.0-canary.c9e98a125.0","@material/typography":"5.0.0-canary.c9e98a125.0","@material/feature-targeting":"5.0.0-canary.c9e98a125.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_5.0.0-canary.c9e98a125.0_1576606208114_0.4607225143632956","host":"s3://npm-registry-packages"}},"5.0.0-canary.5ffe8f7e3.0":{"name":"@material/slider","version":"5.0.0-canary.5ffe8f7e3.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@5.0.0-canary.5ffe8f7e3.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"0ad4d07ce058572002b9bfa4c8252a21f044cb59","tarball":"https://registry.npmjs.org/@material/slider/-/slider-5.0.0-canary.5ffe8f7e3.0.tgz","fileCount":31,"integrity":"sha512-9miqopBj+IvAMvc6FBYe1wEEd4re100/9PmP0u/mvlphigqDV8PoZCkoSBplWRYu+u3vt0ERTlGSJgdNyi81tg==","signatures":[{"sig":"MEYCIQDzk4/t5f5sH5Kg9yTSv9qAF1xi1VmESip5BEUgFKSGmwIhANsjnR0AT8j1yK/MnyATDwZrk5CH9NMZxNPG/8Z7Zkef","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":342371,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd+Ve1CRA9TVsSAnZWagAA0VwP+gKOqzFIscjJWKxAWCj7\n6KmcNTrC7Bt572CA5VLj+HjPHpkTH1o7DBO8jC24CNBClhqhDACn4vATcBNW\nO2Yxr9JWZtHijK2RHQZt6IQaILt0WyGzO7xi7rfsgJFCMXidAb/Byievi9aY\nxm+/I0OTqs64NtHpiaDoK1AYXP1dWpK8LmdVFBD9cwqz1X7yr2iNf/yLb61N\nXGCaynBD3a6UpNsii8WXYPnEGaBPCK2VhHPlygEDokf3uD8pqxrywkIJNA7Q\nE0Eeyl+njFrTydd84lIAaIW673sygTW/7W3+cofrCWqMJBN1iN0ZZOpjbG9t\nYaw/3hbVbdvDzUqZzoPzflvxgWoKl1ykhXuexsHEA0t5aJmgd53rD7nmTfXT\nyV/9T6t2FJWHXrGF32NnE3DlZ/WwjQfJTUj5QdFFt4bOnJxKZ3BgzCPxyU8B\n5UAxEuPODTxiUhbaR6ldVAWaVIuy6iw41dfTgBt5NEdx19xXCAktXS4yOHSP\nTVuOj++S4a8xdE190kD7jBf7x2EbPpc6g2uEcW9RZAoRP2oqT3cGMSszMonn\nUaoPsNvjISbYNxdnzeFXz9V2VuAJumWEcXZuHYOkVwCzW0A7wTbN35dNwxTh\nGJ4aDG7jltwYrOS0NwDyko8MXPWGL384iL8+9sc+K4xpuf/rIYf7ICJoqJge\nPqNo\r\n=7kYm\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`mdc-slider-color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`mdc-slider-highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`mdc-slider-rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`mdc-slider-rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`mdc-slider-thumb-color($color)` | Sets the color of the thumb (grab handle)\n`mdc-slider-focus-halo-color($color)` | Sets the color of the focus halo\n`mdc-slider-value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`mdc-slider-value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`mdc-slider-value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"21e7c11057bb3bfef94ff10e24676b9da6f427b4","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.18.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.18.0","dependencies":{"tslib":"^1.9.3","@material/dom":"5.0.0-canary.5ffe8f7e3.0","@material/rtl":"5.0.0-canary.5ffe8f7e3.0","@material/base":"5.0.0-canary.5ffe8f7e3.0","@material/theme":"5.0.0-canary.5ffe8f7e3.0","@material/animation":"5.0.0-canary.5ffe8f7e3.0","@material/typography":"5.0.0-canary.5ffe8f7e3.0","@material/feature-targeting":"5.0.0-canary.5ffe8f7e3.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_5.0.0-canary.5ffe8f7e3.0_1576622005146_0.8511392686233199","host":"s3://npm-registry-packages"}},"5.0.0-canary.47949b08e.0":{"name":"@material/slider","version":"5.0.0-canary.47949b08e.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@5.0.0-canary.47949b08e.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"7e6a8152c562a1af6384285b34074789400c1973","tarball":"https://registry.npmjs.org/@material/slider/-/slider-5.0.0-canary.47949b08e.0.tgz","fileCount":31,"integrity":"sha512-uhDq7gopJP/zWtQcGFF4esv/9fLN+698QEFdja+eu4KkM9AqGTvW/+FkR6vW60SMg7sD6fGb6Dc/OC+mYKqMMw==","signatures":[{"sig":"MEYCIQCL+KI5a3HgdDdgVGlnWFq2DljgKDmqbW7sAlnBV9oQVgIhALoh/7FgTa6TPLzd5DyLF5jN3mA8LLrsKlWQZ2zc6L7S","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":342371,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd+mSdCRA9TVsSAnZWagAAG9UP/1u2S4TPtBhYHgjKFs9E\nk/mHNQtPPcI6OPBYWHYnD4TTBdELXfyPBSn5aumlljRzdfbq+ORHfz7IDfDs\nwn4jk5KPKtbmZIsLf2yPCXywpZzvyIShKlTzVU1PXmwLrh4zKo5ErQnmPaIt\njl9bYvyfl21TULSD8rnqajBFGCjSQVPnsrMDu5tjyf9frQisTB5YCbHZqf3d\nz0Cb+SVL6pFc2JUAoqrDD6+J6auH0LH22u0NiB5tsXpHgn8fZrjlJB/9mZ8t\nlDK90HT8vy9BAQQ277mcGSLfdIQz9dXeaQrxE8Uk4pSvUzDw0Ic+8dXId7Ap\nOt0qkYJZh5AgreAEIPz6D+9Wo66tKS1tasJLFgWGlAQIe3HeEUD3I07+RCA7\nYEhRtnN8xVdgMXdwNfM/xKLPQEq5M0QrVpI6B1uUGrBY2dpRtEJH3qH4a9Vr\nP2WceGDfCDNlsEi2H+QB+DAUanASnTpJUK6VoUGVJe84w9THSfpQlF9kkAFp\nNhW0dUyY6So5YrWmU+B4fUyugunahh9odcnAjh0PZ8JGcXN2hVQCn1Xw4DNV\nGqOwhFHDNZIcjaEtrehImr8ksG4lSkN/k1Dw3AH3KFJ4NKu+5DLomx5L936l\neEgyA4YS0oGxOmmE463VujYQjwaRV4CWobaBtpyiop+70TI8xejHi8Es/n0b\nvTR9\r\n=Rd5B\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`mdc-slider-color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`mdc-slider-highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`mdc-slider-rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`mdc-slider-rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`mdc-slider-thumb-color($color)` | Sets the color of the thumb (grab handle)\n`mdc-slider-focus-halo-color($color)` | Sets the color of the focus halo\n`mdc-slider-value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`mdc-slider-value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`mdc-slider-value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"dc8ea470b79b9134800af9e8866b99949c575024","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.18.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.18.0","dependencies":{"tslib":"^1.9.3","@material/dom":"5.0.0-canary.47949b08e.0","@material/rtl":"5.0.0-canary.47949b08e.0","@material/base":"5.0.0-canary.47949b08e.0","@material/theme":"5.0.0-canary.47949b08e.0","@material/animation":"5.0.0-canary.47949b08e.0","@material/typography":"5.0.0-canary.47949b08e.0","@material/feature-targeting":"5.0.0-canary.47949b08e.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_5.0.0-canary.47949b08e.0_1576690845061_0.9911089333657801","host":"s3://npm-registry-packages"}},"5.0.0-canary.b240bcc1b.0":{"name":"@material/slider","version":"5.0.0-canary.b240bcc1b.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@5.0.0-canary.b240bcc1b.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"76077775c7915872dc8f4b3dbb9439d2cb048aaf","tarball":"https://registry.npmjs.org/@material/slider/-/slider-5.0.0-canary.b240bcc1b.0.tgz","fileCount":31,"integrity":"sha512-VPv05SUoGV7B6LCpVrrzrGFRbvLFTjDKNIedQG7QIlWfqcwkogYq6h56+YnnKyFZ5Z08nkQHT5PHqCa+PqhMyw==","signatures":[{"sig":"MEUCIQC3WcpZnGrmFQdWUuRsVJVttrRFqmJ+MEX6oNSw3+eXhwIgSv8NeX45Gyc8sN2YutuitTAf0fYPYWU+SeADmZd3CaU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":342371,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd+nsqCRA9TVsSAnZWagAAiR4P/1JACgq6iDqw2Dpyt/hF\nAVRnppnJt3mwRoAE+UrgmTTM/B+3g4LO4mdm0Nu8ac9J2gfhIhLOVxQRelQ5\nBiyE27tQkh9yhcmDdEOf1YZTTM9EYAhqn/7xNzbu3bHvG4oP73q2vjaWu4Fs\naGRKinI3BRFl/pLSIszI2GE5AK/5j9lA8D6Mj7uOxcCUTftd33yGLeTv2zCJ\n34HAq3tyGGQ9Z6RkIY5e7hMRyxsOTjoAjol5vAP7vKGLzg9+/eCH6qtf0Kpf\nuSDrFp1UtxBIu54PCQvwVpAcZ/Jbe7bc9QfCdUL9REpDVVXWIJ/ct5U8Y3MY\nm7CnHKYIaock5m3rBsYdFJZRG9PxyKYk5FfocOpBLl2SCVlvjO6zgiEV3CFn\nQ2Z8km874tosOJP8DGczff9piBxWpq8EnQbYsxSrG7nsoI3nBZbtTfsby58k\nAAIdn3vRWjIa5bCdGicu8Z3ATUdH6ZwMXWGwSQx6VfOboM9ewxM6cju7wMzE\nZcsn3+PhMh++06sBIMUUEZYXi4fVmQghJ9piZgDssXIpjrL7Kqu5Sj/Nq2aN\nVIY1uoxg05o+IcBakOTFTQdrobJj7YU4Z72J/CZGFaDU7u/Yiqaf8Xf5BPVa\nPxziT/YjQTr6ApE9WduIJFpuVkjSr9Uqu+hkLocpXying+khiLHj5Kg/bzfm\nS9CX\r\n=3n53\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`mdc-slider-color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`mdc-slider-highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`mdc-slider-rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`mdc-slider-rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`mdc-slider-thumb-color($color)` | Sets the color of the thumb (grab handle)\n`mdc-slider-focus-halo-color($color)` | Sets the color of the focus halo\n`mdc-slider-value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`mdc-slider-value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`mdc-slider-value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"9915c413ced383747e1ca7f2069e170e38517b46","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.18.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.18.0","dependencies":{"tslib":"^1.9.3","@material/dom":"5.0.0-canary.b240bcc1b.0","@material/rtl":"5.0.0-canary.b240bcc1b.0","@material/base":"5.0.0-canary.b240bcc1b.0","@material/theme":"5.0.0-canary.b240bcc1b.0","@material/animation":"5.0.0-canary.b240bcc1b.0","@material/typography":"5.0.0-canary.b240bcc1b.0","@material/feature-targeting":"5.0.0-canary.b240bcc1b.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_5.0.0-canary.b240bcc1b.0_1576696618550_0.7194023644318082","host":"s3://npm-registry-packages"}},"5.0.0-canary.391674a26.0":{"name":"@material/slider","version":"5.0.0-canary.391674a26.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@5.0.0-canary.391674a26.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"803feeb36b5a694904a3faf5f09b172b83b9e4b9","tarball":"https://registry.npmjs.org/@material/slider/-/slider-5.0.0-canary.391674a26.0.tgz","fileCount":31,"integrity":"sha512-cjUhZSphilcrOOTRImQhlK2hKj79dLGP3/NPLecnCRBCbctWXb+wZ9Y9jHb6PBEUGbzMX2Zvfe680q0JV6daWg==","signatures":[{"sig":"MEQCIETL59Qe1Sqchf1d4BCJORu31pKs4o9kSk8VjbNB/KvBAiAFIE2FAj3sNUAqFfm5Jrv5bsskU1F2njf55HSMwySIQQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":342371,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd+ntGCRA9TVsSAnZWagAAX40P/2Yq4YFFZaf7GCJlOS5I\nrbpS6YO8L7vDy7WYjaYqBtoW8tPRc3wCjH5ggP3AiSjCkGMTBMcBEWu2qoQo\nHUWDbJYb8x8oc6FFbH7JTWyyn8BHXzfU567MjZE4gulzZxHTo4RwOVXsAfuu\n25n85ayQAGHitOI/oWhTVDUu4ih6kt19LCJb6IUjNag7pQPerdh13iQlz08r\n1l5VYVdVHrLX+zZHhcop4Y6hM0CB8z3h1F8QXx2C4sbdjqe3EkqjWqI+cyZ1\nUHx4WC/3zpldEpWsSpqWzAevBSMG0gUYAuPUA0GoQMaIKcklAW/MOPyOELMK\nwdTce6FYM7EO4c6+pPJsGQm85whqjrpIvLfOIlIfYGjKEWZbxRAx/Nhsrcy7\nW2x/z+nReI3Lm3yjuk0k12OrKPeELW4RFQyDmHz5Bjh5B0FQBaRe3l3gpBsO\ngP1OYYG8zRS91GwtdlejEGsk+7r5WgJ6UxJVcmHvvb/t91Ir2393K9JEOLxW\ncgtWvX/80qoNuKeK0ChR/mNUTXtDiFCKMk223kscgoDPPvY+1aNlh5mdPnkZ\n1nuh67ZfHwuPa6M0SPKNTHBBnShcRdh0pT8zTEGRWpASJW6ayBjzrGPE0f7Q\nwQPFSg9Ad2QO2TH+oxz/VO2qwY+BxxAhrWsu+a+FxNajvHqZmJ3mv2GDYBJ3\nHNqU\r\n=t7rG\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`mdc-slider-color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`mdc-slider-highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`mdc-slider-rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`mdc-slider-rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`mdc-slider-thumb-color($color)` | Sets the color of the thumb (grab handle)\n`mdc-slider-focus-halo-color($color)` | Sets the color of the focus halo\n`mdc-slider-value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`mdc-slider-value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`mdc-slider-value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"aa67ddaa5956be1096b1d442788cd4a5565d7598","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.18.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.18.0","dependencies":{"tslib":"^1.9.3","@material/dom":"5.0.0-canary.391674a26.0","@material/rtl":"5.0.0-canary.391674a26.0","@material/base":"5.0.0-canary.391674a26.0","@material/theme":"5.0.0-canary.391674a26.0","@material/animation":"5.0.0-canary.391674a26.0","@material/typography":"5.0.0-canary.391674a26.0","@material/feature-targeting":"5.0.0-canary.391674a26.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_5.0.0-canary.391674a26.0_1576696646655_0.7856165710395895","host":"s3://npm-registry-packages"}},"5.0.0-canary.c4837746c.0":{"name":"@material/slider","version":"5.0.0-canary.c4837746c.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@5.0.0-canary.c4837746c.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"e69a3ba9d117f855a96ba218b6ebd4cd2a29428f","tarball":"https://registry.npmjs.org/@material/slider/-/slider-5.0.0-canary.c4837746c.0.tgz","fileCount":31,"integrity":"sha512-VoOhBlNsYUVVmctk9fkUc2DKFZRNg1C2y1wWHgMGFRcOe4zH1OOmssc4bFhxphrtczmFlTqA+L0V4S2Yo7lrUg==","signatures":[{"sig":"MEUCIQDV5DHVOsR2sWDX4/Csjs1xof7vcTedNREAn4aGY0aX7QIgaw4dNwsXbKWHup8M+yyxmzC0aLDRa6+3FI5kHaMhdko=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":342371,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd+n92CRA9TVsSAnZWagAAQskP/0Bnz8IX3CJh1X30FeS2\n5JqCTmXvfdHWY/xCY/UfdNhfC6WKfWQN/MsEvrnVnbhYkwUu1ZFxxJ6qZNuM\n7+TpAikkL+UABjpqMuE7iTi9HVoV/dUrq7LHXQI4TgChyFj+bmywc793h9Tm\nmbSZctb/pgy1/vBSE2LqB/w4EJ90yONeZP37D90DOd9TJLeBM/GsLSvCteO7\nHwZZMb1ygwWPD5F12vgyAYD/FP7H9NrGLihf2/QDNoIgvXyEYEG3im+d4G44\nsvAXPKDk5HvPCSLk7PqJ+nU0cbI/rvPRZPSY7XzjvCGdFwq3YmJtTDTcKGMt\nqwgz9VmKQnTruVD0fQCXQBYeg9ew4WTmQTA5iYs7H7nRtEZ4L11Xm7nkyJTL\nSBrX0j3ykBk/VeYabfaff4DEC/fyEL0MhWF/eURs4hveaoJDJ2ZqgyYYv4Tf\nhpdTQSPCvOmUyWmM528VQZzUl7LneGNVqVZJApgEFTSGI1ky1/zwf37CPZB1\nyKSdEyZS5MnXzyXLR2fMgSVSehBFRTh0TXwfLCUXWP+lFPdlLAkCZVMjIpG3\nXyJxrKIm4tX2Ga/AkimX+5o6PSpSrQ/jSjA7r10YQ4rwMmJSfSiJMKr8Cf8A\nkVAiATL7YOBbPJFr6qURgNEvKVnuV6WOlkXYxr6/99PIyQ6b/+Q2N7Ul28oQ\nEw20\r\n=YGSK\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`mdc-slider-color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`mdc-slider-highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`mdc-slider-rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`mdc-slider-rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`mdc-slider-thumb-color($color)` | Sets the color of the thumb (grab handle)\n`mdc-slider-focus-halo-color($color)` | Sets the color of the focus halo\n`mdc-slider-value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`mdc-slider-value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`mdc-slider-value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"44ccab29aa0b806ec249d5f5117ac9f5d82fc7ba","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.18.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.18.0","dependencies":{"tslib":"^1.9.3","@material/dom":"5.0.0-canary.c4837746c.0","@material/rtl":"5.0.0-canary.c4837746c.0","@material/base":"5.0.0-canary.c4837746c.0","@material/theme":"5.0.0-canary.c4837746c.0","@material/animation":"5.0.0-canary.c4837746c.0","@material/typography":"5.0.0-canary.c4837746c.0","@material/feature-targeting":"5.0.0-canary.c4837746c.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_5.0.0-canary.c4837746c.0_1576697718222_0.014422960256483375","host":"s3://npm-registry-packages"}},"5.0.0-canary.e41a70425.0":{"name":"@material/slider","version":"5.0.0-canary.e41a70425.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@5.0.0-canary.e41a70425.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"207420f2bf94490befc108b5573c7fdad40e9337","tarball":"https://registry.npmjs.org/@material/slider/-/slider-5.0.0-canary.e41a70425.0.tgz","fileCount":31,"integrity":"sha512-/2Fk6mr69bkOtqsB3Jf/IfOghyqACAM9C7d8SgsLTr9koTPY5i/+NMTU9eYJV61Pgp71c/xU66oGmVruuPDEgQ==","signatures":[{"sig":"MEQCIAvnlPpxQlQenJNgqjcYZbcuZCmxJ2KtCzrU7KimGf+4AiBvwip8U84NDMRR+IuxBokP7AFt3dpp9b2kncTe/7D3XQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":342371,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd+rQ4CRA9TVsSAnZWagAAtgIP/30nYk+TRWlaE4dLv1b8\nyP6QewQXBeZggvSqWaCRv/meORXu1cQ9xHpfSMH1oAs1bPBCcwDu1WN6WOGa\nU5bZIMRAwe7l+lE3NlwIkrgLpnAECIUiJAyDxqnC7v+hVUhsewMMgLY5WgKR\nQHvDznxFtjjmWPhbEBXLRPBSo9juJ/EwmXT3HGHWNQVp1tTYfvkU806WGePq\nFcUMDacfpsq7rZNX3oo3Z6hmLQ6cNEZmMkNKB6jeXi97AVdDamcJb7yvYPFs\nMTzP3nAl3to1iHssoqfXay3XfdWc5CWZnN5goAzH93VZDA/KeV5bBHwRTG0O\nhA0a/gk8fvzuUOYC7mU9dyRI8RWmnqqGNutuqtf8NzwQSCo6QUrvgdYS6i8x\n83IYvKGrxNurfPbvSQHRyM9a1nK9g+Y9aOrmLWa1nu2LXa526z9z9w2RL/Xu\nW6eLKn+jMMGx6rbXZX7KROSAgjZsoURaSnLZjQERHRkH4QeqAcKWKmNg0uGF\ndOs5T7SCUvYdvCihW17PHNiLmkN3s5+gYfraI+m7SkFhAflgzEGdaWRxyNdd\nbebepMSMY/65sW0uu2CQjEfPdN3JhNXW5cPgiQK8Ej+Ianp3P5EfSjnh0sU5\n+KfcHP3ihWytA/1QwGUSUETn6mBy3JYsh4IXL370DxNNOeOm/nsU6CC4k+Uw\nupa1\r\n=lZ56\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`mdc-slider-color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`mdc-slider-highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`mdc-slider-rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`mdc-slider-rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`mdc-slider-thumb-color($color)` | Sets the color of the thumb (grab handle)\n`mdc-slider-focus-halo-color($color)` | Sets the color of the focus halo\n`mdc-slider-value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`mdc-slider-value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`mdc-slider-value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"2e938a63bb3297bc73cdf8f1f206885e2ec84a6c","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.18.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.18.0","dependencies":{"tslib":"^1.9.3","@material/dom":"5.0.0-canary.e41a70425.0","@material/rtl":"5.0.0-canary.e41a70425.0","@material/base":"5.0.0-canary.e41a70425.0","@material/theme":"5.0.0-canary.e41a70425.0","@material/animation":"5.0.0-canary.e41a70425.0","@material/typography":"5.0.0-canary.e41a70425.0","@material/feature-targeting":"5.0.0-canary.e41a70425.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_5.0.0-canary.e41a70425.0_1576711223702_0.6974153459152947","host":"s3://npm-registry-packages"}},"5.0.0-canary.bac43eb43.0":{"name":"@material/slider","version":"5.0.0-canary.bac43eb43.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@5.0.0-canary.bac43eb43.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"121b3580855a74a1da7decd042bfaef1cc2b896d","tarball":"https://registry.npmjs.org/@material/slider/-/slider-5.0.0-canary.bac43eb43.0.tgz","fileCount":31,"integrity":"sha512-HpAhYqm1Dw2SVPdOQKhrsdCVaYvHpAdGky+2tqQNH9w1wlGuzHoK335Ru1ZsoE2na6EtXgqMGjEe/zh6wXz5+Q==","signatures":[{"sig":"MEUCIQDS2NgIgO9KGgtrPcpN4NpkUOPL30BzGlkeDvAXYWJwHAIgEX36VGfHTSr9LwSJqE9+pbkDbPjd0uwatSlJXLyYB1w=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":342371,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd+rUdCRA9TVsSAnZWagAAWiMP/igfrha4G8PUm3pLFOCT\n4jgbURUfUnYvl3Aw+eJbtmGrUkHKIfvr9YJc7J1e9447I64CTcf/nHZP73aF\n2riK4Vdu5RABpFmtCQJt7NOmT1JzY5HhFrEYdUa1EpRQ27nFjnkivTGr8dp1\nKvtjYG/p5g5040u8qucp3CWwcyi12cUxDMr3QFqutxiVPhq3Eysuv69dcReb\ncDhiUGTMBWunmY2Hozi/dOrSDQWHcWcAeHf/48JeelZI649BEkuk7aDboERo\nm+mAYtYjpUGmoCyV6GzwYZwWKuZgwF1dONDd9qpL/z+B2jU9MNaqbx8eM+DQ\nfIWnmLot9x9jgHAnJkQ0+1rf37p6tYp0ipffpWhoQXTQkulKNFHeNUrYgMHp\nowrVx17ymd2yoxJaNrBLq7/OVcYAZjnqrObfQxFfixVn7IimkPkDgz66p/I9\nqxena2RvUFXw9ws6mc7YpZIwuB3ht1QYR8Car+NcBT5DIzgNcVn7Xrc/SJL8\nsUpPQpT4TNZ1A7ljWqLctkiA7RRQQysnozq0nRgJp6iQApJVpmb4xaWjCnk0\nzPj5qMx12cSd57jaZG9F5AQdAjXpbVHgA/D5l5RSYjOx+191MwNOpt3RcaEr\nTO7J0a86Gs1fWcA+PIkSmIVAoT7s52M1LkvF7aQRSjmtRRrkUbn9jK7MlITd\n695P\r\n=kaXc\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`mdc-slider-color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`mdc-slider-highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`mdc-slider-rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`mdc-slider-rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`mdc-slider-thumb-color($color)` | Sets the color of the thumb (grab handle)\n`mdc-slider-focus-halo-color($color)` | Sets the color of the focus halo\n`mdc-slider-value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`mdc-slider-value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`mdc-slider-value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"7035dfa39edc06f1b58f72c5e285bd2998747232","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.18.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.18.0","dependencies":{"tslib":"^1.9.3","@material/dom":"5.0.0-canary.bac43eb43.0","@material/rtl":"5.0.0-canary.bac43eb43.0","@material/base":"5.0.0-canary.bac43eb43.0","@material/theme":"5.0.0-canary.bac43eb43.0","@material/animation":"5.0.0-canary.bac43eb43.0","@material/typography":"5.0.0-canary.bac43eb43.0","@material/feature-targeting":"5.0.0-canary.bac43eb43.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_5.0.0-canary.bac43eb43.0_1576711452812_0.404706868167217","host":"s3://npm-registry-packages"}},"5.0.0-canary.2e491de55.0":{"name":"@material/slider","version":"5.0.0-canary.2e491de55.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@5.0.0-canary.2e491de55.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"faf72f488d48cb2abfa7ddb7a0b76933b1e058fa","tarball":"https://registry.npmjs.org/@material/slider/-/slider-5.0.0-canary.2e491de55.0.tgz","fileCount":31,"integrity":"sha512-F8kAwYjuSqREEoqDgxbKi7rJsjylB9BbyD6inbv9WkQZsGuRBD7qfQ9cVFrbsblW0RThijZNjijmiCVLHHX0eA==","signatures":[{"sig":"MEUCIAd1H+TyHpkdJqHlbl53fXdRLDVb4zclI7lDtw0/710aAiEA/uBs0fUgdpJiuxB+q0GI4jdmxvTlp5RWXmoWnTYaf/E=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":342371,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd+1XSCRA9TVsSAnZWagAA4g4P/RL4LAcMN693ygbJutA+\n83R5sQsnMFz2O7LS7uPULURkj2dekOSyROTX/8QOhkMTvOzpZqyFXCadqbSJ\nnlCyqFT4NcCgsuwhXhKHG18xjqhowjGSKOBD/AfXzDPxCsRjWDkj2shsEnZ1\nCLTLdeFAcYD2qFATzk9KudJ1uXFUW0ifyWaS6dQMCvJ8rL3H4VrzZRYpJLbE\n1YShgAGYM4JyU8fBaop3MuTWmoaF0oLMFlJ1sEYsmlIZdKJRtcW1d19ABnMC\nmt7+7V57F51ndKlRbKg+LBisoLis+dm3hgdWfUOkwP7APUo3yaVByzQJPD7A\neJeyKPtsN/xdf31ZwPf3b7YtN+85KEk8z2b2bJQawBUPyHxFTZb0RuRkOIGA\namvaq44tmvdyh9BltQNURGc6OrmPuXP3QjFtfhpCS/pNNxtDyrPAF2VeNDG0\nsR+rxYwtWNIf2GK1csNq1fhs/AtLYZhnVPBALchh/rfdK2dKeGaD6EtVP5oJ\nb21qdsHqlSpGHoFfcAe77euHAXycGq8AWAXnKhlF2WDohuPH6PmlBDzVoYcv\ncfjvNtF2eQMwkKGEYjPFhxU2AElKIE/FcDPvFFIqMSMt8QE8zRLFdYFzD8q7\npUKy+fB1cOfzumrQ6CS0F6ifTmrVFGQJvsOs8urcS49y5qNJF9ezuO/jqXUL\n1LFF\r\n=MQm3\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`mdc-slider-color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`mdc-slider-highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`mdc-slider-rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`mdc-slider-rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`mdc-slider-thumb-color($color)` | Sets the color of the thumb (grab handle)\n`mdc-slider-focus-halo-color($color)` | Sets the color of the focus halo\n`mdc-slider-value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`mdc-slider-value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`mdc-slider-value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"731b98f2f9caf1251d3a82a3abe09828a92eb434","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.18.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.18.0","dependencies":{"tslib":"^1.9.3","@material/dom":"5.0.0-canary.2e491de55.0","@material/rtl":"5.0.0-canary.2e491de55.0","@material/base":"5.0.0-canary.2e491de55.0","@material/theme":"5.0.0-canary.2e491de55.0","@material/animation":"5.0.0-canary.2e491de55.0","@material/typography":"5.0.0-canary.2e491de55.0","@material/feature-targeting":"5.0.0-canary.2e491de55.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_5.0.0-canary.2e491de55.0_1576752594311_0.8723128580297703","host":"s3://npm-registry-packages"}},"5.0.0-canary.ae101c144.0":{"name":"@material/slider","version":"5.0.0-canary.ae101c144.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@5.0.0-canary.ae101c144.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"2b323406397167eb34c6f9b660d09ddd22119ca8","tarball":"https://registry.npmjs.org/@material/slider/-/slider-5.0.0-canary.ae101c144.0.tgz","fileCount":31,"integrity":"sha512-Ldc6VJGjoGOK6XNR16/g8y3HvycCmjm2asE/En00Ixf/ggniQWUEjVEz9sp9cRrACyDzEfcoeRFi2+EGQyc2tg==","signatures":[{"sig":"MEUCIGtlPx4IM+Gjp386a6gf54zy7TbdQaVMPdRv0RQjrNgMAiEA0U1x8QSWJnjWYNkTAyPCSAz7zRqCwzikwMRHbiDmGAc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":342371,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd+6RcCRA9TVsSAnZWagAAJj4P+wf7dkmV7juOTjr27GXc\nSJEG2b7VSj3a5HY2K1xt6SH7+ahjJwQbPKiOchWduyLJ/BxjeuINBRZs5mc5\nkaG02bwbDBC4Cx4aZ+XiZxu+dllua3O2tbSgrAbHAi9Kud/wCfflKZ18UErS\n0iIX8ZvACnRUd5W9BT9/AWf0Rpq/q00V0By5uX5y82II3pbMyjoixQ9EqtHh\n/kcbHHYwQcgz5wjUedfLUWPNTxlqxLaORXCkWwVSNd4fUJJc58Z8v3gAM/3H\n+bnTPu5vXjnEN0Ey3qDh5l/wB+jTVVypwgUf3mNzsve5vcKuN6dcoKD1B9AC\nxjFAzroTIDydtctyZKSu3VI/6mxenKc3nMbadUOKQqPoG1q9EFHNgeTiwVQ2\nLn3aWKq4a1UV3NG1fQPiI27WLNNZuaNDjNNi3p/ZpMpt+B7glBnMpAlRmdpm\ncKiEF7YTQAIuCSCKPjcAdjHmVM5fwgyh8/SpyxP/3eidXulsfXiArG9ujCzV\ngdebY7hXslxLB4eABQXfRhs1K4rpRZT24Tt78IHHu6FsmjvWnjCJDkop4R7o\nF1SWvA3X40B7+IfZKAMeU9gP+3JKnuNxggHF09mEEZHKezoM2kjR7kppBNXN\nMEUEuTcrDSr0A5iRjtNg4+HzxXTgXpSytEx5pIrbNcdlyEZNVpDwItS6ugYH\niPv3\r\n=1G0p\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`mdc-slider-color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`mdc-slider-highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`mdc-slider-rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`mdc-slider-rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`mdc-slider-thumb-color($color)` | Sets the color of the thumb (grab handle)\n`mdc-slider-focus-halo-color($color)` | Sets the color of the focus halo\n`mdc-slider-value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`mdc-slider-value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`mdc-slider-value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"d11f348d85fc15df510c3e33822ce23f44ee661c","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.18.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.18.0","dependencies":{"tslib":"^1.9.3","@material/dom":"5.0.0-canary.ae101c144.0","@material/rtl":"5.0.0-canary.ae101c144.0","@material/base":"5.0.0-canary.ae101c144.0","@material/theme":"5.0.0-canary.ae101c144.0","@material/animation":"5.0.0-canary.ae101c144.0","@material/typography":"5.0.0-canary.ae101c144.0","@material/feature-targeting":"5.0.0-canary.ae101c144.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_5.0.0-canary.ae101c144.0_1576772700312_0.2466977940826558","host":"s3://npm-registry-packages"}},"5.0.0-canary.a51c31f26.0":{"name":"@material/slider","version":"5.0.0-canary.a51c31f26.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@5.0.0-canary.a51c31f26.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"7feae94f50a63adb8e596587df45889e28e3f149","tarball":"https://registry.npmjs.org/@material/slider/-/slider-5.0.0-canary.a51c31f26.0.tgz","fileCount":31,"integrity":"sha512-rO2LtLZi9Ik5vNLKqF20vLwT1g+NGoG3fEnK956mBvIV3E5abvblNXN7kD38S1BYJOAzncyeAYoRjLJ4eTCQ5Q==","signatures":[{"sig":"MEYCIQDQOVlzB/HpE95xds+ZA23F/4k6uM6dStqn+e+foc1QuAIhALD+max402/airyV0lAyErAXFcJR0q/mTPWTeWacaj16","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":342371,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd+6/wCRA9TVsSAnZWagAAkjUP/01lNuWDkCgkvCXpomrO\nmkS63B5t+FStJw0L8deWrwlFwDdW8HF7kKqvLATGjsOPgkxM319M8QgzcdOv\nROvEGigvG65Sxn/sxpOxAsP8DEfOClLWEAmBHpcOnKD5WhWHTzbE2U3tOTKm\ndie7OlTHr9erkq0i9Iou3V9MA1SGi28R5GYnWUrjwYmzejr093vsIAq/6Q4S\nVtMtCvtxPhNn8zWgn3bUvNDu1NQNpa7kLOBfO4iSN4I7cpQYFHfiqRsQZkyo\nK4mNbt4e058Qk5OJfwNoKBu4t1HucgbogzZ2EHMrkTuVD/ozJ7gyE4UQUjMn\nyMy4BoPQ7OTeYq2sUDn+hDthThlLgV0C91sh+6TdgXlprHFxhjTTxYZ/vI/s\nhVo0SsRsLCYNYLQcMGx4PsFSrXNdpHUF2VpbWmsRkv1Tu1DqBzxBIc0df3To\n0sk1ru5uF0uiv88Iu/mb6KENK6lg41Q+LEjRd8Grizb0zr3CrdIoFNIe57fd\nzVc05OqAB/ZCuv74XuegAP1Lz3pwFMXuFtAVvqfwffEHVWHlYgqG3gj2TnJq\ntYZxBDAI8QyURBrZmqirI84aumGY725s9dZR/Tbjmr1gY/1fZBTaI5Tp2Vf5\nNrmjrFyK4ifQb4HWPoV0tSD2ZMMAGfbWFhXVnxCWoJko8uhtYS6VEchetL3S\nzw49\r\n=Dsy5\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`mdc-slider-color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`mdc-slider-highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`mdc-slider-rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`mdc-slider-rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`mdc-slider-thumb-color($color)` | Sets the color of the thumb (grab handle)\n`mdc-slider-focus-halo-color($color)` | Sets the color of the focus halo\n`mdc-slider-value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`mdc-slider-value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`mdc-slider-value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"e2dd52b70a7e3cd011647222c15955dd4535cd6d","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.18.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.18.0","dependencies":{"tslib":"^1.9.3","@material/dom":"5.0.0-canary.a51c31f26.0","@material/rtl":"5.0.0-canary.a51c31f26.0","@material/base":"5.0.0-canary.a51c31f26.0","@material/theme":"5.0.0-canary.a51c31f26.0","@material/animation":"5.0.0-canary.a51c31f26.0","@material/typography":"5.0.0-canary.a51c31f26.0","@material/feature-targeting":"5.0.0-canary.a51c31f26.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_5.0.0-canary.a51c31f26.0_1576775663567_0.15733769512275853","host":"s3://npm-registry-packages"}},"5.0.0-canary.21fc4e13b.0":{"name":"@material/slider","version":"5.0.0-canary.21fc4e13b.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@5.0.0-canary.21fc4e13b.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"8840631c961424be6fd80c837f5e49e3e24c2801","tarball":"https://registry.npmjs.org/@material/slider/-/slider-5.0.0-canary.21fc4e13b.0.tgz","fileCount":31,"integrity":"sha512-v//Z3zAUg0Q3JzA954r79HyG9jQgY8gK62+JbtEF+JQlyEEHYTc4N5ruT0zchKWl6XeGkERtzOs3ZLAGoKaBWA==","signatures":[{"sig":"MEUCIQDPqkhPZPxB14hYftfxqz1wNtCCGJAk7homPXFVbo7cAQIgX/WFRrwhvsQpi1FpuATw/ePcXVPpt5ziYWrxbm49ypA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":342371,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd++sxCRA9TVsSAnZWagAAHMwP/3kFbrTazdh9zKXbZoIW\nw1KC6KyDJGjSPbLbInarcgOVEACf6IgOLUAUPtiioDvt8HxxjKuhillCDm6+\n6lZ+aEg/uv7cLS9+b7cLk7yP5HtoVlfDECpohijIW2MLOjbnDwxE7NbbPZPQ\n7dbTcil3gsgU/KyVWBXpVHC8MZjNBWhu8qdw8mV+Tqq1G8rIX3/CFk1w666F\nEIcVpak4+rlwxG7PrRm/SmlaFDCS2r2ZIcd5EXYVb3ecWOzZS7KCtO1/uROv\nhQAKdngNBvSue0gr/Neni0aM1w2btYzryocEa0Ay9JyijzqBim9OA/56iKjF\nBwnsSdGb7ZBsBsn11sLptq7JfBmGWcJYWx2J+KdWheyVgcg9EM7UC9+3IiBQ\nm/PZ301q3V+3tbk87caG2PxYan+jX8jkyQnQyOKO2+eDvuoJadZBhCNui0r5\nh50tjnVvnaKC8OycjpPLzG8f0LHkDfYnO9izBBkZyR69tRjUAn+FxG4kyW/8\nwpyQ48PO7QsWU57j+Sz79WkveflJneiNsBAOsB0eWKr/zbiptfqq8xE0xA26\nztGDaa+p8ghflk7HLxqSpfSifBOfV7p7EQMedfCInOXvXfZjCuGirQkNhXfy\niOySlyA2pHqAd/TL5hQezwkQdz5aj1NerlvoWwV4uYe1bLLObCOcA3XAg2Oa\nUbjr\r\n=eHn2\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`mdc-slider-color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`mdc-slider-highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`mdc-slider-rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`mdc-slider-rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`mdc-slider-thumb-color($color)` | Sets the color of the thumb (grab handle)\n`mdc-slider-focus-halo-color($color)` | Sets the color of the focus halo\n`mdc-slider-value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`mdc-slider-value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`mdc-slider-value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"ca71d599c2aed234cb9376ced1aadb512b071fb8","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.18.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.18.0","dependencies":{"tslib":"^1.9.3","@material/dom":"5.0.0-canary.21fc4e13b.0","@material/rtl":"5.0.0-canary.21fc4e13b.0","@material/base":"5.0.0-canary.21fc4e13b.0","@material/theme":"5.0.0-canary.21fc4e13b.0","@material/animation":"5.0.0-canary.21fc4e13b.0","@material/typography":"5.0.0-canary.21fc4e13b.0","@material/feature-targeting":"5.0.0-canary.21fc4e13b.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_5.0.0-canary.21fc4e13b.0_1576790833322_0.738653626323849","host":"s3://npm-registry-packages"}},"5.0.0-canary.d2ae6e17d.0":{"name":"@material/slider","version":"5.0.0-canary.d2ae6e17d.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@5.0.0-canary.d2ae6e17d.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"a7f797e86597b6cfdb8d1162cc468d12fbc9ce9e","tarball":"https://registry.npmjs.org/@material/slider/-/slider-5.0.0-canary.d2ae6e17d.0.tgz","fileCount":31,"integrity":"sha512-4wgDukFrYjLqfjvKnmVJiQKcEJwYdbu4o3u2X/FyNkRRsxPqHg+o3ZBwRdo1SnUrtFI6+EHFiPOZA0A/TsNK1Q==","signatures":[{"sig":"MEUCIG+1SeQaV11MVSSlaIIi0ARZVl9ebSzEZDfYiDnpfOKpAiEAmgFFvkzFWleUHrBfp9MRo/npx0tOzfZDpS7VnFVWVio=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":342371,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd+/iPCRA9TVsSAnZWagAAPB8P/ivvCO7JCTbtIqnoiRD9\nS/4oRI7/3MBtLvggGOJOWI5vkJwI8WSdMoWC1gQV2XpmESbu5J74CyCF3pwG\nc/fybJ5y/Q7LI1hD+poMFI0skyhL/2Em+le6nz4NSkqg9LLiIKcTkH8MLvbD\nLBs95VjNfMxTVSKoOR+CuX2Q8huoaHJvYKbsTHB4gEo1gEKzcrtzWXR83p8N\notojwWpzQPZBmc6OZVUorJcGbrbUXhGWl12adupAPAkbSo29r+teLuML5jHg\nW5FMumgq92c8NtiinXSluahUzB2ugVhxHlP4slBig7REgvOpZDnPzoE3+oAC\n2g2lE25vfBn4PWoVXHNGOSa3MI1WCNe8F1Ms5oFc+UuQviUdhXTtxuJvicZW\ntDisxSxcPl3Wz9ID/7Ykk/1LxctGpBt5uMyvgNuo4H4SxRa7uOvHcQ+7YvP5\n9s2ea2nN2CJmEUfhd4md/kGgHCoTd5OwFf6w9ZiNJl1o5wcU/v4Gb4Hnviys\niyPIpaA+yel+NLq5Ok8DffeV5SOiFvpNKyOx2gWeXHDQZEU5PePDGr1k4wG9\nYaqgapgnzJfJjwqUYSQH/zC564rMbTOMuTvwEciCiSDTmH+2ZhY4pJ/AQeMH\nlPkgAV5zn8LhjImnE/5704rRAd1G4GGzmUNyA0mMiwErD6I/TqpV5QDvxHzs\namzL\r\n=vk+Q\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`mdc-slider-color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`mdc-slider-highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`mdc-slider-rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`mdc-slider-rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`mdc-slider-thumb-color($color)` | Sets the color of the thumb (grab handle)\n`mdc-slider-focus-halo-color($color)` | Sets the color of the focus halo\n`mdc-slider-value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`mdc-slider-value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`mdc-slider-value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"aeb622d14d533f70c26396fb7db6c8bc48eaf8e5","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.18.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.18.0","dependencies":{"tslib":"^1.9.3","@material/dom":"5.0.0-canary.d2ae6e17d.0","@material/rtl":"5.0.0-canary.d2ae6e17d.0","@material/base":"5.0.0-canary.d2ae6e17d.0","@material/theme":"5.0.0-canary.d2ae6e17d.0","@material/animation":"5.0.0-canary.d2ae6e17d.0","@material/typography":"5.0.0-canary.d2ae6e17d.0","@material/feature-targeting":"5.0.0-canary.d2ae6e17d.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_5.0.0-canary.d2ae6e17d.0_1576794255569_0.21961892246812598","host":"s3://npm-registry-packages"}},"5.0.0-canary.ba30399ad.0":{"name":"@material/slider","version":"5.0.0-canary.ba30399ad.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@5.0.0-canary.ba30399ad.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"31e2026b2ee7fa7101b5d2b7352914d1c4cf63dc","tarball":"https://registry.npmjs.org/@material/slider/-/slider-5.0.0-canary.ba30399ad.0.tgz","fileCount":31,"integrity":"sha512-Vy23dB1ackQ+Z9u/6OUjmnv1xLftZ0ggV/DdPB9L3Xuw1UYJcYEGXSNaNan8iuYRrAzclhje9VCljvSglBOlBg==","signatures":[{"sig":"MEUCIDdVPBbHuL4JhoV3bDM6ByFU6FqIsg4cqOiHIP7HztQVAiEAqk02JAA6ih3cnAgEPx6Nbu+0w1+fmKCnAdAbcns3nRA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":342371,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd/B9cCRA9TVsSAnZWagAAMXAQAKQRW62qich2u7oXOv5h\n7EQ8/Kml960oIa2NAjz8UGgvcvYmHtpWvsQIDedmqez8TuaTcwGywQl1WFBI\n7QPxinYsV+03/FPxwk9UbBBHbKX3LrD4SbdUg8hWdlYd1SD2iwjeZraMhRsp\neMpnZZ4t+1ZUSnCcKrlASoxCHqvj51a3d8S89yhasc+A8xIPnTLzzeVWiVA6\nkezGR9xDPYDK04Gzrx+szGfoW+zU6SbN97J3A6ZtAVlFJYt7crc0cIqI06NR\niU5eDCyjasrUU+b11nV1vSREHtWteoIQGkrDEMlT6A8ceockWvzeRiQDxK7T\nB0laJRCYfaxbDB+iOK82ZURnJkpdw6R8XAncVxDl/BYca/xYyToDgABkxAsu\nl0+V0+wRRi4q9awnkG/d98yezROyWa+BfMYU1w4fXC5IRIA9mvGiIyyY/njE\no5fcRvXZFtxFLvUN7q5nEnMdEFiBi5q3csqkaU3kK8U4hEAc2zWW8nIxAAJO\nyy9TbklxSdE1EWA7xxbESwwBDEO8iowS2ExDTwVkYEYicHTE9nlfNTx3vHA3\ntX2acoqQuoNtGGsnvRuv5r+cMzFprDp3kaGpjCyhP6GuFxz/J8BVArcUk2XV\nxaGgn2nLkLE83woD3ix+fnd0rL8xTOHb1N7tD66LdgeBNc8NeAVL03JrVsap\n7aQf\r\n=qQyX\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`mdc-slider-color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`mdc-slider-highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`mdc-slider-rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`mdc-slider-rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`mdc-slider-thumb-color($color)` | Sets the color of the thumb (grab handle)\n`mdc-slider-focus-halo-color($color)` | Sets the color of the focus halo\n`mdc-slider-value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`mdc-slider-value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`mdc-slider-value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"75ab7f122d8d469963211d9f9591a84602711f72","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.18.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.18.0","dependencies":{"tslib":"^1.9.3","@material/dom":"5.0.0-canary.ba30399ad.0","@material/rtl":"5.0.0-canary.ba30399ad.0","@material/base":"5.0.0-canary.ba30399ad.0","@material/theme":"5.0.0-canary.ba30399ad.0","@material/animation":"5.0.0-canary.ba30399ad.0","@material/typography":"5.0.0-canary.ba30399ad.0","@material/feature-targeting":"5.0.0-canary.ba30399ad.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_5.0.0-canary.ba30399ad.0_1576804187749_0.1396331640793418","host":"s3://npm-registry-packages"}},"5.0.0-canary.a08ccec35.0":{"name":"@material/slider","version":"5.0.0-canary.a08ccec35.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@5.0.0-canary.a08ccec35.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"4229016598507de2aa657b88e4f5e21b155287b2","tarball":"https://registry.npmjs.org/@material/slider/-/slider-5.0.0-canary.a08ccec35.0.tgz","fileCount":31,"integrity":"sha512-btSs9+XHLUbiCGPF0t32w7HB76a+6DD/a8EaCizLBshVDUC2MEtBimfGVxVon96NJ+fQIfuKf3FSyDjgfbypPg==","signatures":[{"sig":"MEUCIQDyEpvKYCWkI8Q/E/FVZt07x9dqizObQdEMuSnjqthM7gIgMCrsENyMLHncgRaoL3YQyN1bBr8I9ciWZIWxMwY9vt0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":342371,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd/Vi+CRA9TVsSAnZWagAADCAQAJEVdfj+RMNhblQR0WGB\nvvrYQd16bdBEM8WeSIz7eL+/lpscLdADHA2WqqDeu1sMrbMPDPZ4fuGEbiZu\nKjTZKEHsDjkKL/83mnnLQhSRruYrneTwe/PeD8E+1a/qc3UIvPvuWldDIJQ4\nk2JPSAAu5S2/s68sQbuqKYjuesMy4wU8QaaCiMxsXkb6nP33kntpY41EWKUA\nEiuiX0NSxOcVXxFtXERtfGJaFnOSHrIYN8/eSIvP9R3sKzS8qZhyZfjORbgS\nloH1F18YhfrtvaSzUTEbyenUIEJVRpVOh/zPhFKJAWtj445k1w/SpoZTIWym\n9TlrRTvpC4sTdNJmLaVzaK/TMQDz0Y+eKCsmdS5MZ/oJnEgBKANmFvsnFTtu\nNGLSoeeWkYhERnN2nIr6C7k0NKD4chDafCf39jYfMPJJY4guUbqLcVLwbacI\nT+thBNS3m7yjemt5pnTLYKzbVqk1ei18t+/cM6f64QzSTdv9yGbKFQmAewoa\nWvJ0Fk1G7Jn5e+vo/yL61PhxyoApn7pO3fLtrCyAyrwS2LmZxkt2aonlLGni\nwBGGj9JgDyWpOgwcU4rSN4AETB4naA7nOZv5btlrBejSMqkEN4ChU8T0pA6K\naNFVt0wvakEFl2RhN67hybv6KXl6FGaU1dK5ZFLKzAr4Qud0Iy+pXvJU3iiq\n3XGS\r\n=zMen\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`mdc-slider-color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`mdc-slider-highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`mdc-slider-rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`mdc-slider-rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`mdc-slider-thumb-color($color)` | Sets the color of the thumb (grab handle)\n`mdc-slider-focus-halo-color($color)` | Sets the color of the focus halo\n`mdc-slider-value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`mdc-slider-value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`mdc-slider-value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"121f2cfbbcf425b2c92760a0fcf0301dafb14636","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.18.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.18.0","dependencies":{"tslib":"^1.9.3","@material/dom":"5.0.0-canary.a08ccec35.0","@material/rtl":"5.0.0-canary.a08ccec35.0","@material/base":"5.0.0-canary.a08ccec35.0","@material/theme":"5.0.0-canary.a08ccec35.0","@material/animation":"5.0.0-canary.a08ccec35.0","@material/typography":"5.0.0-canary.a08ccec35.0","@material/feature-targeting":"5.0.0-canary.a08ccec35.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_5.0.0-canary.a08ccec35.0_1576884413584_0.5227570702175552","host":"s3://npm-registry-packages"}},"5.0.0-canary.a2f75105e.0":{"name":"@material/slider","version":"5.0.0-canary.a2f75105e.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@5.0.0-canary.a2f75105e.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"cf8b5f9608505d7f6a0a76fe0c9290490f1d8c7c","tarball":"https://registry.npmjs.org/@material/slider/-/slider-5.0.0-canary.a2f75105e.0.tgz","fileCount":31,"integrity":"sha512-rhH64cRuMncYMlS0ovTOc57l4r66WOsGwhGLK3hG+rAh3jaDYbuMaVQQB0fZ89ynqGh6evZ1fdLha3EQyJCBsg==","signatures":[{"sig":"MEQCIEPq59H7T6KwgFtHW8iTiOVEpiznWaTlX+XZmIAFZZ1jAiB0EEf1vz1C6nQEuTu5wIQN6tN9x2b6d9PTK9VgxqqlbA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":342371,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeARniCRA9TVsSAnZWagAAMKQQAKTYgayu39dXoySc/Ct1\nB3ZHB/CQjwVxG6CYLVw+T2jEkxp2nvzXvbN/pJGa0iBsSMOUF5/HsMVopNyd\nwyXIo4yxz9y1kwZv7wxoQLfbThPN9TCP+U0DSON/3k4qQCZQ2VVeD6ucwgdd\npDBEvDaL3lz+UvUXkgQgmZ+AcxHG/SzzLH8f6+Ic9bmbzpd7oVSkSotq1vt8\nIToOIqTDHWFHjphV3nYkrxR0up9108ujlb2N+L1enSXBWLJndGxZsNwQl36A\naatBkeT/xegb63oFge8M3N1q0ff9RqZhRGTQ4qk7r1+16MwX6ssV1U8qWVJy\n6YqfXEnbzDcyz7XuRrsNOah5IMv1S6uuW8vkn70Lj1g8hZ0uPIZM6I7qpq3L\nJtqI7oWIz7LSMSmhGulanWLtRW64cAZ1w6A9IbpliwVZVvyIYB2XkVjI4guk\nJ7BcB1DnjA/GAISOSdnR+lAv7ddJt/pSAnYC6Jebkv+BWp4NXOKIsdW/H/8X\nZ/r8+REhvBk8/l1WWN4deyTJeKldUB/rgvvClUauWP5WajEke7Lc+MIjCWla\n3btlzd4AeUtk5V4gZfK+8jgTOULLi1+9xBpicR3aqHyTeS2+yc5NIdO3E0Zl\nKW4Uesf84aeqcJkoeYMQeI8Hrnm9gE4QMxRcYxsiCfAON0pDj4hx6hOml1As\ntsbz\r\n=Sv+x\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`mdc-slider-color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`mdc-slider-highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`mdc-slider-rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`mdc-slider-rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`mdc-slider-thumb-color($color)` | Sets the color of the thumb (grab handle)\n`mdc-slider-focus-halo-color($color)` | Sets the color of the focus halo\n`mdc-slider-value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`mdc-slider-value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`mdc-slider-value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"7b2f4b595ae59e3e680ef1151ab400a3855144d5","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.18.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.18.0","dependencies":{"tslib":"^1.9.3","@material/dom":"5.0.0-canary.a2f75105e.0","@material/rtl":"5.0.0-canary.a2f75105e.0","@material/base":"5.0.0-canary.a2f75105e.0","@material/theme":"5.0.0-canary.a2f75105e.0","@material/animation":"5.0.0-canary.a2f75105e.0","@material/typography":"5.0.0-canary.a2f75105e.0","@material/feature-targeting":"5.0.0-canary.a2f75105e.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_5.0.0-canary.a2f75105e.0_1577130466245_0.7928206055002229","host":"s3://npm-registry-packages"}},"5.0.0-canary.c054a24c7.0":{"name":"@material/slider","version":"5.0.0-canary.c054a24c7.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@5.0.0-canary.c054a24c7.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"d495e09ed313988741b939ca7fd9b774b0c6f911","tarball":"https://registry.npmjs.org/@material/slider/-/slider-5.0.0-canary.c054a24c7.0.tgz","fileCount":31,"integrity":"sha512-AIj2tFE25TfUPMnqX45R8rmoUoCpoczMw5tqEuMbaDw68EW2dSxBxQixxf8H/an6Lu/I1lIMp7vz1tAsHvs77g==","signatures":[{"sig":"MEUCICBK6pqefX5r92IQ3KYehG5Fpr6ucGjTQYBnl6Sfmq6bAiEAg63tfjCcWWEQbCLxNqeOiQ6uFwBZVvZOGiXnaIZohm8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":342371,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeATaPCRA9TVsSAnZWagAAhSwP/2+tWSMyNxQgqUdOdkdu\nH+zxuZtFITMND2aYs61Q4aQ26mtQewTH8/l5o6J5pj1abivjK/nw3L7AUPR3\nQbQ1dbff0z5GGnbY+WFYBBFDmS4XNPvkwxdrwekTquk5fRwcUdDoiHqBwRmA\nO1/kdbCXG8y5YoOSt2fDQgb1EbnkUVHBFP6qQUPV27Wm3SXTHN0Zy1hwtMJl\n8cTFc32V0SziBLcgih9W+8U3DbIJLSbWM8g6EcgrRHF4MMyFxkkEmFIlu1bC\n0sXvqSdUr87BxQXBJ4Ag7Zhs/X97lsJRSJCOD63oJ9lkn26YkiihblX5dGR+\nLTpjqtj3feH1PIj9SF5LmY9OH0OMk6Ian69cQ+71JV6BdQYpPILpYaAC9luk\nKiSVmpsXslmF6M/fwotfaDl0dAXg9MXjqinbQtbAF1XDr+/3TJFjVozbptFn\nq4cKqkd+Z4BWPGUypfb/m6Kb40wkAggvbO+we5mu+XpmtqEak5brlusU+YqQ\nT9Uq7WJWEzxDjH3UJ9BIY9VV5SOx1aqD+h0Oz54kzVWu8xfjajte6sgB3cKj\n0nIxOKzRaiNgJNXI/W6fH6Pk/dkNhQ/TS4kNdgVg9tij4MefsD9VR1cMAfE4\nDjA3aAHszO1LjtZxu4znDGreWKo9YvBQFriYC4/pei7F+BWY8LwLLXKe3lam\nYojq\r\n=WSQL\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`mdc-slider-color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`mdc-slider-highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`mdc-slider-rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`mdc-slider-rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`mdc-slider-thumb-color($color)` | Sets the color of the thumb (grab handle)\n`mdc-slider-focus-halo-color($color)` | Sets the color of the focus halo\n`mdc-slider-value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`mdc-slider-value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`mdc-slider-value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"4e2a3c12859a131938df8918a9f43b9146056488","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.18.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.18.0","dependencies":{"tslib":"^1.9.3","@material/dom":"5.0.0-canary.c054a24c7.0","@material/rtl":"5.0.0-canary.c054a24c7.0","@material/base":"5.0.0-canary.c054a24c7.0","@material/theme":"5.0.0-canary.c054a24c7.0","@material/animation":"5.0.0-canary.c054a24c7.0","@material/typography":"5.0.0-canary.c054a24c7.0","@material/feature-targeting":"5.0.0-canary.c054a24c7.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_5.0.0-canary.c054a24c7.0_1577137807587_0.6820764152190546","host":"s3://npm-registry-packages"}},"5.0.0-canary.c6808c51c.0":{"name":"@material/slider","version":"5.0.0-canary.c6808c51c.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@5.0.0-canary.c6808c51c.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"22b536304e6e84c3a17d9bd8d50a2db30e21e282","tarball":"https://registry.npmjs.org/@material/slider/-/slider-5.0.0-canary.c6808c51c.0.tgz","fileCount":31,"integrity":"sha512-yiiMxCcR0Avlcd3IhyH3s3kEXpPeXKQ7AusJyAZKp+75yfPtpVhXbnnOApVqaPTfDoPN9idV4x4cOemxQWdlEw==","signatures":[{"sig":"MEYCIQCCf6kJtkeo1k8Wrxav1dTcx3orZkoxgTGnRu7XNLQ4GgIhANU1824JBz9gPnnv4wRu2z9X+u6zEihXPYNUF6nqqhdw","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":342371,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeATelCRA9TVsSAnZWagAAcQkP/2RQPEbEtKRt+NDj3c27\nP44FtEeP+Ut8GjZDfRP50UtCmaEW0joCASPfzdMQbCD8O74e9R0tNvxXcrnn\nGgAd3YG/8P080PvGxxJMQuK/SVwRpoGzc9GtRRdPDDHGXZK/kvFXNlpIS+fQ\nJ/3FEIC0k9C/M6qAnCEGuIXUN53kEEiZJazpijGc9Lis+Sklo2d0C22ShJqn\nT3HSHAwocw/2GmeUNZdAFOg+E5SE3+QejPvhndogJYFl5b4u6BwyabhiP7nO\naSgYnoB5rvdINEIzcjTwyicn1dXxnG8d90bXd1ozz470HIHt2lO5lHg8fYfb\n+zbnAH6i1Y17q4C8p3pFboXmrQUlIGCV0P/d2VceZI2ugU6dTZoJ5Jxv/JGt\nQrdt0Rm6mf+nQCVlcYy7CEj2cIB16bmZhAb5Xl75VKmOO42OLyZRTaDN6K1M\nv+PbNq9C8g5+TTLAokg/Q9TKAzpKfdsMRh2N2y8vK1YjXvb2nBxFQNOk2gHI\noVZJb3FR9Ocoo5kQ/JBXnwnYn8VfVUprmNxuenWk4/ww01lDN49SlkZv8OhJ\n9cpvCGUGJo2VXV0FILM+VHosbPNYOWtHQ3lrAkgSCHzsTJFyWnMhbIq8+dSO\n6Fgmf+3mrzhomlZOwq2HOLfXL6fHJ+N2UaHgO/tx4Uqj57Bj6t7H7Z81n89f\nal6t\r\n=mC0l\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`mdc-slider-color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`mdc-slider-highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`mdc-slider-rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`mdc-slider-rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`mdc-slider-thumb-color($color)` | Sets the color of the thumb (grab handle)\n`mdc-slider-focus-halo-color($color)` | Sets the color of the focus halo\n`mdc-slider-value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`mdc-slider-value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`mdc-slider-value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"02ee460be616b30da3c6d5daa7eddbc5f29d2500","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.18.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.18.0","dependencies":{"tslib":"^1.9.3","@material/dom":"5.0.0-canary.c6808c51c.0","@material/rtl":"5.0.0-canary.c6808c51c.0","@material/base":"5.0.0-canary.c6808c51c.0","@material/theme":"5.0.0-canary.c6808c51c.0","@material/animation":"5.0.0-canary.c6808c51c.0","@material/typography":"5.0.0-canary.c6808c51c.0","@material/feature-targeting":"5.0.0-canary.c6808c51c.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_5.0.0-canary.c6808c51c.0_1577138084679_0.9824852419005146","host":"s3://npm-registry-packages"}},"5.0.0-canary.7bce9cf77.0":{"name":"@material/slider","version":"5.0.0-canary.7bce9cf77.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@5.0.0-canary.7bce9cf77.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"668683cab5f80edae1ea25e2e8e22c4885a4e76e","tarball":"https://registry.npmjs.org/@material/slider/-/slider-5.0.0-canary.7bce9cf77.0.tgz","fileCount":31,"integrity":"sha512-f+sikzZ0SNmJHbmgMRhTcieJ97guUYJqtTlyTr7XlJp+6NLN4qv5K00dY0748Mqp6mqtfZaClSPpxB8lLTRv/w==","signatures":[{"sig":"MEYCIQDhhp06BCz/LEztuCfydb4Jj1dWApGYueYcH/dnmDBPUQIhAPar0Oijl70Xsc1yELC2WGPSBm/CBhtQpTAY2UuHNv8J","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":342371,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeBP/aCRA9TVsSAnZWagAAwh8P/j8yR3217GuFJ1QwAIjN\n+GCLBpvErRPcx17fZngj4LEitD95IpnLsw1zrXySm+/YB0hY+DE0ts7rCqNk\n3jqFP/nkcdvITmK8k3Kdc66cYU78JJPRKlcPu7H+/mpGoMV7fs9IW27IdYWY\nmxcd3Bsej2vsL8YyaWO1jIgOP9GRbVkAtnOSJos6fABzfcugenM8vql6L2KZ\nIC7U2DOJ2RtpiNIsXEIHsHZXQpZYu/A+8HSOL5otmDm2ub2XdofXIswk1gFn\nNTi1cJiF9qrobb6ABQCcbYoH/Dg2+XUEX+CZ67UfXyGqxea3Zu+QkH9hhP7X\nVp0VIaivXyPWtZiamRpQvYDXLIWhnWUKwtaRlV9hV+nmnto9qcQVrBwknfTP\niWhJf7gxVORU3GwAH4PGjrnMYsGA9pnEGYMUifOdW7qkc1s4RV1q6F+M+Su9\nQR4S8s7LghNoXNC4aoeWrlJymV+d4YM99g+G4XbCK/O9KZMsPjZDvUDtlvpM\nHE8ZRlQTcVTKjPiACNsY7MPwWg7usmAM1luIjsdOSSJuxXrSshxniVsbY3dA\nBdCTKntYPRD9jDgLwbQ4c31kkCQkzQnye8ITszRUEG65afDY+cLoToNd5T+I\npaIHiwAg4PwIlH58q+JPvmHbWqj4zESUfqZ26FCmAfQ09tIQqr6XpmjtHpdo\nU1xQ\r\n=QYwY\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`mdc-slider-color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`mdc-slider-highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`mdc-slider-rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`mdc-slider-rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`mdc-slider-thumb-color($color)` | Sets the color of the thumb (grab handle)\n`mdc-slider-focus-halo-color($color)` | Sets the color of the focus halo\n`mdc-slider-value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`mdc-slider-value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`mdc-slider-value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"1f5c1996d2328a53d1fc5cffe847b04aad48432d","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.18.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.18.0","dependencies":{"tslib":"^1.9.3","@material/dom":"5.0.0-canary.7bce9cf77.0","@material/rtl":"5.0.0-canary.7bce9cf77.0","@material/base":"5.0.0-canary.7bce9cf77.0","@material/theme":"5.0.0-canary.7bce9cf77.0","@material/animation":"5.0.0-canary.7bce9cf77.0","@material/typography":"5.0.0-canary.7bce9cf77.0","@material/feature-targeting":"5.0.0-canary.7bce9cf77.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_5.0.0-canary.7bce9cf77.0_1577385946201_0.03008021847571296","host":"s3://npm-registry-packages"}},"5.0.0-canary.c92f038c3.0":{"name":"@material/slider","version":"5.0.0-canary.c92f038c3.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@5.0.0-canary.c92f038c3.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"62414f20b847f809b79ea88011dc41c30829b349","tarball":"https://registry.npmjs.org/@material/slider/-/slider-5.0.0-canary.c92f038c3.0.tgz","fileCount":31,"integrity":"sha512-SYxfs4FXDVZlSkQa+vtb/VydPucDvbcJttupo4yf3+RsizibMgKPqZIvpTr910QYkK4kTRD6yNJYn5NHKeqj6g==","signatures":[{"sig":"MEUCIARNZVRpgoJn5ZUCb9w7Y+5lBOOL5Wak9gYF+ZMAC0jIAiEA8NSOZk47PE1BnD6zYp5rA03d+rHmXZQuOn3c9s7WEdk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":342371,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeCnQdCRA9TVsSAnZWagAAvV4QAIS80bCQHa//D8JjEvYe\n/8IAY2OnByxmiot35gvK9zJYzZ+GdsOalJvLeDsDY/evTy24kFIwk+Xl2RRi\n1FEZCtiKXVq23hRXwERVhB1xk2RN/29n+l/mvDN4aYXCnFOSPGUr/QHsGZ90\ni1/ZFKE1Leei6aWA3oA6Xmeq7i8Eo8FFgmm1x9Lw3A37pDDU/GK3jfQ86178\nTsK4FMerGvDYP5ek0+ZN7Jf0obpJatLu7HBCZaAbYbk/MVBiakNkeq67JrLS\nrrhMahOd9bU5HKRTxDVqKFTwP+5p0UkGeYuTtBDXmMHzVG+b99PXevQ8/3KZ\nNz1lRD4OpBTis3cFdRlKu6XLSLMZLlsKMpZiJ/gt+Mc5Trk3W24YyR7Ev56Y\nqN57ZJEL+2r4j5Otp1gwMXVq5C8+z0x0x86S5kFmn8U9akTPQppmTJdvrzbY\nlhVuZsg0Ssf8SiONq+dPlDcoVhS98YXyz8WbHsisV7wBNOfci5A7grDsjnR6\nH8S7ab3i+aMlNghx0gHwWuRB8eDGG2+hU2uOeqcWzMhaVJyTQIJWrwWLp9Ng\n1RjR5Ma5aonY9nYRXL25e2THqRdd2OZ/dKnN3ZPrZFRgUiu4h/89uCAgzNKW\nhtVuwaGGYZ0UQAPvOXdnbSo8o0IP7y1N0F7QR5qYrlJq08YBGV9JlR4fNudo\ngt1l\r\n=/dMe\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`mdc-slider-color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`mdc-slider-highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`mdc-slider-rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`mdc-slider-rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`mdc-slider-thumb-color($color)` | Sets the color of the thumb (grab handle)\n`mdc-slider-focus-halo-color($color)` | Sets the color of the focus halo\n`mdc-slider-value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`mdc-slider-value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`mdc-slider-value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"823f4f89b39f86d10ed69fa8a943c050c2d83a6f","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.18.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.18.0","dependencies":{"tslib":"^1.9.3","@material/dom":"5.0.0-canary.c92f038c3.0","@material/rtl":"5.0.0-canary.c92f038c3.0","@material/base":"5.0.0-canary.c92f038c3.0","@material/theme":"5.0.0-canary.c92f038c3.0","@material/animation":"5.0.0-canary.c92f038c3.0","@material/typography":"5.0.0-canary.c92f038c3.0","@material/feature-targeting":"5.0.0-canary.c92f038c3.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_5.0.0-canary.c92f038c3.0_1577743388748_0.4072004476458304","host":"s3://npm-registry-packages"}},"5.0.0-canary.1f1ac7558.0":{"name":"@material/slider","version":"5.0.0-canary.1f1ac7558.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@5.0.0-canary.1f1ac7558.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"914ede2a5868872c6152ec41b5876b9ecd13d92e","tarball":"https://registry.npmjs.org/@material/slider/-/slider-5.0.0-canary.1f1ac7558.0.tgz","fileCount":31,"integrity":"sha512-FFQwukAHYiA5GLF6h6vb79GUSG6woC6bxcKahfLDMOBlr+a7EQneBFJy7wynBWRpijzSKMXnhNu2drUZkS1NRA==","signatures":[{"sig":"MEYCIQDhuTc3x39u228bmLgNrSC73u1LK8YzoCNHGKYnhI5tkAIhAIe3imnXeBTbmjNfAQxy34MIUxUoRevZqCK6FCBl8Pkd","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":342371,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeDlh2CRA9TVsSAnZWagAAVDEP/3LXssc8HGaXbJtWbO56\nz+yCA/wyWJshL6at34RqlfMjnWk0mXjef0mV5lgYSltJiHHkJOTiGuOTBztP\nDlGh12vue8Aq0eLHeEsh/FBmaHcGWxnvoGAR6X8luin0MWONNDZE2Yfx4BZc\nueAIcuxrIlvQhZ27gYJmUgIoUZoOEM60uze9PBmjBYl+oUXLGxSNuuK5bgha\nn0/JQIfYXtBvNCWWr51Koo8HABtETa5m2Gr98HTCE4mM/cKCEQ7LkMItsFL/\npSFVSfEhEG7oAlZxpMZ/5euGchyDj0J60wFJ0EF1vf8932JB4y6+BsZxcGjN\nPP+Bl92iR210tUyYMH5bytO7PAH30rLJhpQ9AF8E76OfpHSDAL//mIEFoE5K\nRGPKwqO0shitqqPonW6IJtzAhOczel936quV4DBF3RWEteRRJCpSs9BGYRkV\n/fQT/SPj7XT67vqaHLn2eTkgGDhRX+rdDCK3cGYof6QuPx0daHyAP382pI3d\nzyntohAEsWfJlRVPU52iRcn4/8J0aYSbAvDFL31Mmin1RqSjAHyJygxdM2K4\nhazuOz41DQumZwjVsKGRFAsWonn/pLjfrDCG+ERWSI5dDdMmlqinK6CtHi5D\npss6I6Jup/dwKFmn+yL2DN3I8vS/ry2LEGEmzWYbpjUwzx57eD/e5hjv9Q3L\nEXsj\r\n=4HKO\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`mdc-slider-color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`mdc-slider-highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`mdc-slider-rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`mdc-slider-rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`mdc-slider-thumb-color($color)` | Sets the color of the thumb (grab handle)\n`mdc-slider-focus-halo-color($color)` | Sets the color of the focus halo\n`mdc-slider-value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`mdc-slider-value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`mdc-slider-value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"698a9278145ef0b4e06e9c33d51051b9650c5b11","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.18.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.18.0","dependencies":{"tslib":"^1.9.3","@material/dom":"5.0.0-canary.1f1ac7558.0","@material/rtl":"5.0.0-canary.1f1ac7558.0","@material/base":"5.0.0-canary.1f1ac7558.0","@material/theme":"5.0.0-canary.1f1ac7558.0","@material/animation":"5.0.0-canary.1f1ac7558.0","@material/typography":"5.0.0-canary.1f1ac7558.0","@material/feature-targeting":"5.0.0-canary.1f1ac7558.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_5.0.0-canary.1f1ac7558.0_1577998453700_0.37617860204202924","host":"s3://npm-registry-packages"}},"5.0.0-canary.ec26e799c.0":{"name":"@material/slider","version":"5.0.0-canary.ec26e799c.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@5.0.0-canary.ec26e799c.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"084e8833a6ff549b7379ac0377ef541fe96668ae","tarball":"https://registry.npmjs.org/@material/slider/-/slider-5.0.0-canary.ec26e799c.0.tgz","fileCount":31,"integrity":"sha512-K0jqSRZVxsjzJF5wcgNwmKjgwQQLGwAJFpNexSrgm9A60ds3w7rADuOHxIqsqzQTlJuVrslOHQTWDasxl3bjVA==","signatures":[{"sig":"MEUCIQD+aEYVr+qSAwYY2lBQDgO7KB/J+heuHTq4IBcQLAN7bAIgS3NjYhrF+SLSjO/713lnuuZWz9OWSsrAYWZ92tVlGns=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":342371,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeDmPDCRA9TVsSAnZWagAACL4P/jicKbyQScLf/UROjFGY\nn7sN0IRaj0dSSSktAUXLgr6VQgdo2bBYR5IBYxBoPPSLVrphts6hWtTkqElH\njYA/yXm4Q3h4THyxML2Fliv46i+rXluja6PxvIPX9WX083/Z72Q4LVfPMaTK\nQxtFCMdNGEXGzrj8eLyEIeYDKhLMxbF23EdbEUhsoS2QYo+YoOJ3FSY+Vnvy\naxNT+44ZNHncGMYblNyVNw/A1Pd2/yJplQZY9PG6ioUPh/Nd7xP89Xk/hfMc\nrMdHbNo/vV1pAqS169eiyYTiSMlC9FznvnxmBWT8b19VG7qpAspk52puipWF\na7ZkEFAjv4DnE5Ckdg1L2uF/0bwsxo7QVgTrXso3i9FX0PpNyDd8kneaAnh9\nAN5T29Uyj6NwG4ofY9koR1f/6HSchjNVFzfFSJwFUjtwjHcTUdp0RR38kdpu\nhJV3Okssrfh56kY1fqhR3iASaREXn0CIHyb0bxZEBCDPclUuTaO4lOMAO7WH\nDABrVGCM75oIPEUMV7/F+QDuketEXv+3Z777Id2bSWmwsBV5l/fpqFRLS8Lq\nxMijhTbjigv19KCQ7uMT16qxaU2axe0yGDyjLbyKkNu/vP/lEr9Js2yw8mAq\n5g/ZU5Z6oZWg2vYDG4GP5GKrJ4W+5rR8GlqZEqPwxHcGWFehUNz3tln3rCmX\ncydA\r\n=WqKg\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`mdc-slider-color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`mdc-slider-highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`mdc-slider-rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`mdc-slider-rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`mdc-slider-thumb-color($color)` | Sets the color of the thumb (grab handle)\n`mdc-slider-focus-halo-color($color)` | Sets the color of the focus halo\n`mdc-slider-value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`mdc-slider-value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`mdc-slider-value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"813829c13087aa9fccac08bcbdda0ffddacaebeb","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.18.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.18.0","dependencies":{"tslib":"^1.9.3","@material/dom":"5.0.0-canary.ec26e799c.0","@material/rtl":"5.0.0-canary.ec26e799c.0","@material/base":"5.0.0-canary.ec26e799c.0","@material/theme":"5.0.0-canary.ec26e799c.0","@material/animation":"5.0.0-canary.ec26e799c.0","@material/typography":"5.0.0-canary.ec26e799c.0","@material/feature-targeting":"5.0.0-canary.ec26e799c.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_5.0.0-canary.ec26e799c.0_1578001346655_0.8883831857450497","host":"s3://npm-registry-packages"}},"5.0.0-canary.0a40ced40.0":{"name":"@material/slider","version":"5.0.0-canary.0a40ced40.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@5.0.0-canary.0a40ced40.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"e0aa23fda48c76d9cfcf984ba12dc7cf7b010aa8","tarball":"https://registry.npmjs.org/@material/slider/-/slider-5.0.0-canary.0a40ced40.0.tgz","fileCount":31,"integrity":"sha512-kLFZ9dhQOPVop19fiCMLjn39pA2xwEeJ76B/RXN3gn1RESnOg9iOOpK5kwZ4lwk2ehN4oBPKsAiGyN7e2a53Mg==","signatures":[{"sig":"MEUCIGAsSWelArbzXiBcCnef3zjiy6yGFppmcT2/2xmppAAtAiEAmUQdmwqX+iuS77khMGZl4yAsmjCP9HS9amghBh6NH6A=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":342371,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeD3VPCRA9TVsSAnZWagAAamgP/099mtpIHtYwn7g5GMBA\nxkQSmovyVtqpN+MTY5qa/xjEZOMjqOvoJJD2QvfLIuXvlwHCEF/Yl01xECaR\n+vpo8qFVTL3ZdqtCTHBpqvxEzVvcQk1LntVUIDNPJM+gpMmUgTj2QbGGA/Vk\n5eEvInbIcFZd5V2/Mp6s2OY4GZrspmAsYFEs44eKJ4FMA9F4ank6wMIB9eqI\n4nGQ3t97FGLyhHe34ktqSkm8FeHFxcEgeYUvR/RTUALy9hL8Qk4zfZXNHr1J\nV7Ki027rZw4KDjyc13NirFWvsdkhnA2Lpej1W91gBmHhDlkp4EMe5PuE3vz7\nlVeSlEvISh8J4yg+snkmpzj9jNivuAtqdZsIMVKaUGM4BaR6j7dxODZs0sb8\njk1qDF1+P7709+Uk0wPq6GqStdu8IE5Svni4nNcE2JaUn5vSWx+afHPfwA4j\nXwDqikRUCFTlTQ7lukt0rq4dwYWFUwkmYhEiFf4VZjkjwLbQJ08K+wSGkC/3\nWvPyDoi2imuouIuxPSbIvrUVdoSs4L3L4gDqY0mGOCwW9x9n3yyJZe9usoh+\ncqz9vmDdp1rNKD1YDxLfz4mI8BEPKghZPU7EPsdXXon0FucSjdf0mRjwC3dg\nzHRTHvwr9p3WTzY48iDQoHsvGUQpwbaZep9Zdpytx0P04b6nbxL1luA2Ln8u\nSp0l\r\n=7kZr\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`mdc-slider-color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`mdc-slider-highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`mdc-slider-rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`mdc-slider-rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`mdc-slider-thumb-color($color)` | Sets the color of the thumb (grab handle)\n`mdc-slider-focus-halo-color($color)` | Sets the color of the focus halo\n`mdc-slider-value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`mdc-slider-value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`mdc-slider-value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"dcddd5ac583b29d0fffe1a54b6f634f6b90fa44c","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.18.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.18.0","dependencies":{"tslib":"^1.9.3","@material/dom":"5.0.0-canary.0a40ced40.0","@material/rtl":"5.0.0-canary.0a40ced40.0","@material/base":"5.0.0-canary.0a40ced40.0","@material/theme":"5.0.0-canary.0a40ced40.0","@material/animation":"5.0.0-canary.0a40ced40.0","@material/typography":"5.0.0-canary.0a40ced40.0","@material/feature-targeting":"5.0.0-canary.0a40ced40.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_5.0.0-canary.0a40ced40.0_1578071375037_0.24068713009430587","host":"s3://npm-registry-packages"}},"5.0.0-canary.3adf84899.0":{"name":"@material/slider","version":"5.0.0-canary.3adf84899.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@5.0.0-canary.3adf84899.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"35305cb0972ba5c638b0258ab4eb99a1b6a6dc11","tarball":"https://registry.npmjs.org/@material/slider/-/slider-5.0.0-canary.3adf84899.0.tgz","fileCount":31,"integrity":"sha512-MR0l1UQYOH1GG+lWttrAuppPH5DY8wVRz+6bTGhvTnF9lDkkDq1q/YfOOOimUP0JWLCsmqNAvleMaWL7mrVTSQ==","signatures":[{"sig":"MEYCIQCy41IDFaTi5hr69LSynwv19NiqJ1bsJ9yAYq5voynG/QIhAIMeFpmI8/F+/L06NxwuhX5z9eTRbE/1/c+IZ/KzGbqr","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":342371,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeD4ZnCRA9TVsSAnZWagAAduwP/RsUlwUN9rjwzO1SLSo4\nz//6qij6dpnw57GzMlr87P9BYxuLVaTFB8lYESYZ+9CaHck1FmKaEwnmOOw+\nuWb9USjwal4BNEJB0F+fDxFtGZ6UvpzV1f0D1D+5abGiOY01WUHFB7IS2yBU\nOuJdD2JsQfANdrMK+XzrpUMdBchlbtSRH/NQCi7krHmZRPobzZqgGRKlfUhy\ngRmfHBobwbr+C1OKEQ5FGRNr3ggjhzEcL5wIsc5eyX7fKpQYULd131dC66EJ\n4ko/eBThUrfhN4zyeLgpiq/5PDvcFZOkCzZY4YKmJqLO6x/ekTNddFNa+0ux\nWMU26bysiY4DAlZANc1Sg6r6wYHht/N0WWXbfCPojbnULVqeHR6u+D+utjZM\nOndS9WhF9e7YnY1slalMsuWncKopkOWhfIWZ8mkRJ4nSMUB0UeBItnscRis8\nDkAu9INjuyZUmYdVYHB1yhJwU6sWD4p0Rz+cTQ39JHddM/LYI1CLchSU+/9S\nfi/6nOfb3TwQ0ByZAEwCmhjIHI47U1l8sHMytpOuQp1v1Z5AylzG7hN/PdyN\nFpXEkjKEqXJBFtduMm62Z7CATI/LalboW8rUSlMtev111zvTFHh4O8aYlCan\nqsp1eVfxUgzqIScsaO6uL011LNshMEdLB06woc9ZRebgjh8fHSHIbidI1H+4\nhzkR\r\n=w8xP\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`mdc-slider-color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`mdc-slider-highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`mdc-slider-rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`mdc-slider-rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`mdc-slider-thumb-color($color)` | Sets the color of the thumb (grab handle)\n`mdc-slider-focus-halo-color($color)` | Sets the color of the focus halo\n`mdc-slider-value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`mdc-slider-value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`mdc-slider-value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"9f20ea5e081bb781aeb0d66d6db6a0ea7a0f5619","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.18.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.18.0","dependencies":{"tslib":"^1.9.3","@material/dom":"5.0.0-canary.3adf84899.0","@material/rtl":"5.0.0-canary.3adf84899.0","@material/base":"5.0.0-canary.3adf84899.0","@material/theme":"5.0.0-canary.3adf84899.0","@material/animation":"5.0.0-canary.3adf84899.0","@material/typography":"5.0.0-canary.3adf84899.0","@material/feature-targeting":"5.0.0-canary.3adf84899.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_5.0.0-canary.3adf84899.0_1578075751307_0.282295631853009","host":"s3://npm-registry-packages"}},"5.0.0-canary.0d42ee650.0":{"name":"@material/slider","version":"5.0.0-canary.0d42ee650.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@5.0.0-canary.0d42ee650.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"26d69b0de7b96e08500b8a5b0a6cc0e1407c17aa","tarball":"https://registry.npmjs.org/@material/slider/-/slider-5.0.0-canary.0d42ee650.0.tgz","fileCount":31,"integrity":"sha512-oissgsgaiOQeap4SMMGvmFZWdiFbpaiBf1Ev+utSkOe2Mlt+QzigZzIxrRa8jfmE11yjg16MeAS/QPHcXbyXOA==","signatures":[{"sig":"MEQCIHAaVrEX8nnY2ZKjqlYxWJbqMF4QDmWKA7Fvqsq6ibmOAiAZ46LIBvBS9IPo0VcaHUo8dRKB9TrceWz/OZqsjYUJYw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":342371,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeD7QCCRA9TVsSAnZWagAA5zEP/0EvCHBvOUva61/vlzBT\nwRi69FkuI6UrsSZ7xBNVFUijn7/SOCfNPglizlvesuoHg9iNDr2hgrPHfrLd\nrjSX8QQ1A8OWg4RkldkxaA/I9Z7iL3v33LIkZeh/uqoQqkXo7af3Xn12SjWU\njI12tuAxR5frV4wiVb53UbJIebQbDZwaFCypkHbdL0a+CAJnb4pEb2eG3P19\ndi3VzCCik+P8kZu+gB/hTkzjJDUQ8J2nWtCSS4J7GfLiWDQrTdpEDEaDhSau\nXTwsHx/9faOV/3KwYgdxmLHcFVFBbyvNyjFwTkUKc66ucvduFdhfnZq8/hQY\nZjHnZmJ7UpCqFh0S85GhfoyQEy4OnJEdyzOaBVW2rG720ZcOZwMAEKT698zk\niw9EW5km+8Sm4cZjpamO5i8i7Lxxeb3o0RefQuTua8oGOX/60IGcFBpeU6Ki\nn9+ZPELZRD/U+DhQ/lVLJw/olTD9GEXzTc7NZDCYcl6fzJwaTBG5NPdZpr5C\ncLT3gCPFvdeVn49ZzcaUw/h8jejzafZzMsdizHl4zteMnz/CwvaG2HHmc9mx\nQmpIIKsDRAnq0XpzhCdXxo51KEfpVckVNkql2d9foYwvAzU1s5FHwAtrDBOU\nKGYdC/B0YERBCbE2gXouFTDlfuYDEPWuibEX6eFT5stmq2RZKwQJ2KTto+CX\nkFI1\r\n=pbdb\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`mdc-slider-color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`mdc-slider-highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`mdc-slider-rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`mdc-slider-rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`mdc-slider-thumb-color($color)` | Sets the color of the thumb (grab handle)\n`mdc-slider-focus-halo-color($color)` | Sets the color of the focus halo\n`mdc-slider-value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`mdc-slider-value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`mdc-slider-value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"184f253632333982c2b642e450e6e98c9703fe85","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.18.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.18.0","dependencies":{"tslib":"^1.9.3","@material/dom":"5.0.0-canary.0d42ee650.0","@material/rtl":"5.0.0-canary.0d42ee650.0","@material/base":"5.0.0-canary.0d42ee650.0","@material/theme":"5.0.0-canary.0d42ee650.0","@material/animation":"5.0.0-canary.0d42ee650.0","@material/typography":"5.0.0-canary.0d42ee650.0","@material/feature-targeting":"5.0.0-canary.0d42ee650.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_5.0.0-canary.0d42ee650.0_1578087425965_0.05591745780992463","host":"s3://npm-registry-packages"}},"5.0.0-canary.847dd1ada.0":{"name":"@material/slider","version":"5.0.0-canary.847dd1ada.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@5.0.0-canary.847dd1ada.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"0eb1537b239e9de67536b275789b9a8bb3e663d3","tarball":"https://registry.npmjs.org/@material/slider/-/slider-5.0.0-canary.847dd1ada.0.tgz","fileCount":31,"integrity":"sha512-NtjT/piLn+6G9n1A8mVFBQ9uBaJ4OAgeDYY2UXtqL1SRa1wfcpRVamXNiKs415np0MUHQh8rURgsChgxYyePOg==","signatures":[{"sig":"MEYCIQCaYLEWFYMepWGKWIkxgw58VKVT2qyNx5qWbu7OkoMscAIhAJI5z+K6M+BxLHbuGzIBpunglgZB5wEukY79Zp/Oa+3X","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":342371,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeE4nhCRA9TVsSAnZWagAAE8gP/jRn8YwP3lPpkaqSulu8\ndSPubGQYrtmt9L1TeAk065UwXozzcm1FtzO0jaxcEOC2T53BAvZVC9+Hmr8H\nl6sIoXrvtgH4lm4A3mMRBV8Nx23NcqaVabysQ700j8QD5SBZaQIjAujNm0hB\nK8E4ufXj5ARIdAJmxEB9pqZk8L98HqQsEOE9dsyczJ8JGPqJF97E80zUE16G\nThdSFLnfWW+1c6+g8DTqyKV7tYq9oBpcAiuhYzEq0wFuI06cvq6IrGnk+KNc\nUmEiQG4Q4YMBzs7Nx/dPd+TtUKb/Os1H/8hb4sKM3OHH++eiV1/e5B4lwjx5\nJcN7953Xtm78Y2juA+jP7hgxtdeGcv7rtQ9q7YFTPXtJ96f4/XPD7MCfO+nr\n//zVja9PWpTOzNEWgPEQ9Gfjm2aA1sgNm3CZrbG9N+vt/mFmQQv2A2OSPB97\nJZvYH9/I3cNfswqgNkyF3ZytQn80tKbDss4uX7nb8ab2ziHx5tSK66tZmwwP\nsM6a2Y7foo0xvGDfwY9PubvFjakFUHrwpH13ESZuLJtpYWTroG/01zC4CB5T\nP4xiwWRrWCJsJ12+oZg/ix6pPsrk0Cglh2XnoIvXa85Wm1HxRtcTiFrzZWKo\nj7pQxArPOJc7H6Z4GecKO9VkHPEUqxUCm/vq9uu8mH1ProXYqHFlkkNCoKBc\nbrVI\r\n=yete\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`mdc-slider-color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`mdc-slider-highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`mdc-slider-rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`mdc-slider-rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`mdc-slider-thumb-color($color)` | Sets the color of the thumb (grab handle)\n`mdc-slider-focus-halo-color($color)` | Sets the color of the focus halo\n`mdc-slider-value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`mdc-slider-value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`mdc-slider-value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"cccb6b13f05f64e22210548991ad471df3de97f4","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.18.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.18.0","dependencies":{"tslib":"^1.9.3","@material/dom":"5.0.0-canary.847dd1ada.0","@material/rtl":"5.0.0-canary.847dd1ada.0","@material/base":"5.0.0-canary.847dd1ada.0","@material/theme":"5.0.0-canary.847dd1ada.0","@material/animation":"5.0.0-canary.847dd1ada.0","@material/typography":"5.0.0-canary.847dd1ada.0","@material/feature-targeting":"5.0.0-canary.847dd1ada.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_5.0.0-canary.847dd1ada.0_1578338784866_0.9504602362032488","host":"s3://npm-registry-packages"}},"5.0.0-canary.39df7e5df.0":{"name":"@material/slider","version":"5.0.0-canary.39df7e5df.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@5.0.0-canary.39df7e5df.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"78100350a5fc59742be09fef8915202f18439b0b","tarball":"https://registry.npmjs.org/@material/slider/-/slider-5.0.0-canary.39df7e5df.0.tgz","fileCount":31,"integrity":"sha512-a8d7hSuQtigm2ZnqiWbI2pIMenUf9xWBIpesUlF3/GwWrRHg4O6iTGw1hxRqZOU/T3Zv/nmZCrxJ1v5zWQvPKQ==","signatures":[{"sig":"MEYCIQC/acIIAS3WQZA2C2pCIBeWfyrYdBqygnU3QNEgWmRJRgIhAJ2nPttGCl3kRtxxY0jkxvVEJdb10o/TYBnrI05xNhnA","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":342371,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeE9cHCRA9TVsSAnZWagAAduUP/jRBysYpfdgRuJu64rCh\nrQOxMBzoJd5kuOsDc2hGqfcA2z1Mfb9F7A+RuTZTHsddZe/YJnyi3375LyCi\nXV6yBttrxKdsT03SwrcqP8ygELeCpY4a2lzIHdD78kWh7CvuQwwc8g83MUPh\nWG7CnEvsj4qODhCtuterqiD1BP5622os7xmVjmD3XXZJ7VL1aIbwgqrVvC7N\nyeZZJ82ssLQLTDN59HHcc7YOyxtNjrrJqzUjyJWADMzXWzkhwbj1XFmAgF62\nxGFi9SpFO4JL8Fm3WVa7q0vDSbWYvEOgDgwJUCtt3vG8zoOvl9B0m7jwCNjR\n1V1/8+668TOET34zPbQBH37HH2UkR1qFjpqBCoCTgtZ7GNo94su17J0jXPpT\neGB0cRSl0jHo79luIugZ60YIdce+QjcNb7mlRY+DdZAUCifqFZ+7n+3kwiYo\nFNLS6OBV5wrMLM+ZW1dLgEFg21z+Fa3kBwDEu6tWuU1MxqH2q4SwLcLL9aFI\nnzThn70GQtzCP3lCik/YiCJlxYzuqzulALgof2jKj/9FkSBvMfXvRmPKShbh\nFpzicf2QMlGa20IJpmylpZtwT5vJ0FAWUFkt5rpdgn15BsC8xGMElKa5MHvF\nBB2ZHEKhgD0dvD2NvhFe7SoSL9cF8ewTVKzC+S0vwEKWFNrRPe+zluxKqGsC\nGZlC\r\n=kCu4\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`mdc-slider-color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`mdc-slider-highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`mdc-slider-rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`mdc-slider-rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`mdc-slider-thumb-color($color)` | Sets the color of the thumb (grab handle)\n`mdc-slider-focus-halo-color($color)` | Sets the color of the focus halo\n`mdc-slider-value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`mdc-slider-value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`mdc-slider-value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"a6995715f8fc80d9a20e6b8ea90e80f4906ca595","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.18.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.18.0","dependencies":{"tslib":"^1.9.3","@material/dom":"5.0.0-canary.39df7e5df.0","@material/rtl":"5.0.0-canary.39df7e5df.0","@material/base":"5.0.0-canary.39df7e5df.0","@material/theme":"5.0.0-canary.39df7e5df.0","@material/animation":"5.0.0-canary.39df7e5df.0","@material/typography":"5.0.0-canary.39df7e5df.0","@material/feature-targeting":"5.0.0-canary.39df7e5df.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_5.0.0-canary.39df7e5df.0_1578358535291_0.38455091979196343","host":"s3://npm-registry-packages"}},"5.0.0-canary.f1a2581ab.0":{"name":"@material/slider","version":"5.0.0-canary.f1a2581ab.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@5.0.0-canary.f1a2581ab.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"01dde3a1341d589cc56fd00e678c4b4f7924660b","tarball":"https://registry.npmjs.org/@material/slider/-/slider-5.0.0-canary.f1a2581ab.0.tgz","fileCount":31,"integrity":"sha512-5KaM2QziOUpgsR9j8idDmywi4y3UYRmJA/3Got0lldZYes1SgbgCwjhfO5s+x8tFdQ8ZQNjO0ihhhiXzxbPOwg==","signatures":[{"sig":"MEUCIQD56WJJBIRkZi+uQW9RsACAcHyOjCO2nCL7d/O2+JWiowIgMlMo6wpNqWgI3HpY8DbX/nttFr+Kw6UGlBeXDEwe230=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":342371,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeFJzhCRA9TVsSAnZWagAAJrcQAIIfnd+wjPn3QLvvY+9D\n0IWZRI9hQISc7faHc7lFC2pobfoTL1clToADZxlCq3XQIPNcGmBtgQfuuTpj\nAcGUHIMFQhDZ2mqtehS45yrFh/3K+jMAObsACDGxvCJW67Toq6A0dUuvcns1\nMc369StPc4ChIyTeXmFhNPhKjlY0I0VR3yQkkbTWgmw+GsL7COb428Q/bpO7\nPaC0Ou+9+WsjjNlTaRY2ZLodUv9K0sllhujY6ji4QmUUQY46L4nfmKOd+zQ/\nuz9l/wGeoNPrxH+lwyIpU8JL0tPyxayituoRwOVqMQn+oEIlpRxRVctK4r7p\nDQ7a3/pjPKGpjsLoY/IbZcmzJ1VfpUWG3WOsVhN5XceI82OO+v7hOkkdpV6C\nNUWSd7hhKnOyQkXarafiARhcDuklCOoF2C134Jaoybg071QxHCYOKxAKfTmw\namlS+Q73anvHW51B8QPOhrRuKtdhFK00XQpFGih7q6pAB2fXFSfOLkqAjpus\nf0sN9HjTKbJpJ3IZgKBPqrIRjj6UwQ150QkK1LxA33WkDzaIyGZD6GXp5Nas\nPYQRfqvaDI7UDhC+og2AXU8wpRR2xF6CkWY5ponzRzQx3bVEr4rOZ8+zKR4w\nxAl7jM2doLVk4qmmnLDjnKqWi7hqVA5Eq1RA7yD+y6ADDWe6ysrCKCVxVSTy\nOS/G\r\n=4xJ0\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`mdc-slider-color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`mdc-slider-highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`mdc-slider-rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`mdc-slider-rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`mdc-slider-thumb-color($color)` | Sets the color of the thumb (grab handle)\n`mdc-slider-focus-halo-color($color)` | Sets the color of the focus halo\n`mdc-slider-value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`mdc-slider-value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`mdc-slider-value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"ae69ee79a4a22a7695be055fc67e5b974c2b989f","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.18.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.18.0","dependencies":{"tslib":"^1.9.3","@material/dom":"5.0.0-canary.f1a2581ab.0","@material/rtl":"5.0.0-canary.f1a2581ab.0","@material/base":"5.0.0-canary.f1a2581ab.0","@material/theme":"5.0.0-canary.f1a2581ab.0","@material/animation":"5.0.0-canary.f1a2581ab.0","@material/typography":"5.0.0-canary.f1a2581ab.0","@material/feature-targeting":"5.0.0-canary.f1a2581ab.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_5.0.0-canary.f1a2581ab.0_1578409184584_0.1669194359762629","host":"s3://npm-registry-packages"}},"5.0.0-canary.7c7ddf347.0":{"name":"@material/slider","version":"5.0.0-canary.7c7ddf347.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@5.0.0-canary.7c7ddf347.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"dd327625760926a38ae1f82054379306760c8cd0","tarball":"https://registry.npmjs.org/@material/slider/-/slider-5.0.0-canary.7c7ddf347.0.tgz","fileCount":31,"integrity":"sha512-u0QWTM+C2fSWG/W/ShdqbFiZ4pokVOTpPBEUL+0kFr88f2HM6WwoH6EIyu6W/fJWVukcVGc/88rzcSqHK2usng==","signatures":[{"sig":"MEYCIQD8RBxhyU4tZocc+j2ZyzJ2m100SW1Xx3uqQ3X6io1spgIhAOfQnNFexWUhLF6gloH79dTXjk1uVFbA2AhfrQzWuJhO","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":342371,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeFKC9CRA9TVsSAnZWagAAtegP/jpMsQiaMQidzTp7c64C\nwOtVkoE7nU2VYUpekCnL3GZPBOsC1r3xXcfUwipv90Dg1q/bwHPkawXR8sYi\nK5CASUc8s11vKOQBGny+hFgTCl6T4f5y1qR4TYWEZjL7Ow6XfjnntllrUbrv\nxyu1OzX/Ozr+f9aeAvXnHWoJyXxUxNneInrEpaYumbnaQ3VVV3Rsu0EVJaAe\nERVhqifB/D8DwjuHae9EfZcbEeeWnsmAapawzmIMgiKryeN1hDDAfNmXGH77\n+g8S8UbvPIVMxqQnX3W6wvQfl0bH3LXlG457CvZDpUvNMBlDJ3y2FDhPLucw\nliI9z/b7Mt5f/Z5A09IotIsp8QHVTL2g5ABwagoGsEPJSAKYjUjPwTS2FSGo\nFdmFR084ILk8SH7qgT89KG68uHx0PDb4aSTWS7D1g9qAt8EyRXnr1YDh5gb7\nba6VFGODOgv2uzp6CJ5Gsow9eFHLognVq0hgDRsRUcEnG9INqL88RDe997zf\nxwQhx1GM2AJbKpGYwhsmFv+jC9A4f2MotGuaT3FoB+rC4VO4wNjscTc8lxX7\nITS4m68w4l4+bViQ398fT5OsWd4CD7bU8xziZSiLwjljq1L0cfv9JSlKhdya\n1shkAvWL85wBK0iwzkFqgDuhKI+jFvmjM3fjS+EwhR8WP5uXSbsmv5sSor8o\nMDRn\r\n=h7cQ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`mdc-slider-color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`mdc-slider-highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`mdc-slider-rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`mdc-slider-rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`mdc-slider-thumb-color($color)` | Sets the color of the thumb (grab handle)\n`mdc-slider-focus-halo-color($color)` | Sets the color of the focus halo\n`mdc-slider-value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`mdc-slider-value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`mdc-slider-value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"940ae7448647ebd59a16a94b84c479f3f7bba9b6","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.18.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.18.0","dependencies":{"tslib":"^1.9.3","@material/dom":"5.0.0-canary.7c7ddf347.0","@material/rtl":"5.0.0-canary.7c7ddf347.0","@material/base":"5.0.0-canary.7c7ddf347.0","@material/theme":"5.0.0-canary.7c7ddf347.0","@material/animation":"5.0.0-canary.7c7ddf347.0","@material/typography":"5.0.0-canary.7c7ddf347.0","@material/feature-targeting":"5.0.0-canary.7c7ddf347.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_5.0.0-canary.7c7ddf347.0_1578410173471_0.5204195974412731","host":"s3://npm-registry-packages"}},"5.0.0-canary.a1c84d4b5.0":{"name":"@material/slider","version":"5.0.0-canary.a1c84d4b5.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@5.0.0-canary.a1c84d4b5.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"e25491055ada3cae695cbfa35fd0d20a9b11697e","tarball":"https://registry.npmjs.org/@material/slider/-/slider-5.0.0-canary.a1c84d4b5.0.tgz","fileCount":31,"integrity":"sha512-GF2bBg5Dn9zZYTbZFWbh619koCqoFxxJtXtpN4EmQbXb2WHz7GW+D3V4QznScpE3lYESdTpI82+awoV1VttXwA==","signatures":[{"sig":"MEYCIQDTfCaLeeZhIw9jSayXHFu8wgkU1qborm61imKp+GfrjwIhAMKquOOWvpFw8LVEAtM+A05AoPEzQBA4cfDjVujmFFGa","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":342371,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeFMmHCRA9TVsSAnZWagAAdiMQAIXM2kspjWb3a7aARPIe\nyvfAyoKCenvO9onfdYw0YJXwtJEA7d4V0/iDqg9AbLRHZoInlkVNglUcO/GM\nhulfsDn2WwCwqkACHiJ6FeWbRwXarBVNviPcRYqWAH+98343CIh5sOadPuOD\nieu7ejpxHQl2h7SO2sSeQ+QbHouO1cgbr9Uc3tbTxkcm3pxO+3i/btxiK8pG\n1SNIouftUK0bA+jqL6v+tO/5wcz2wg8EYuqksThJ/J0UwDxQXl975Mhnig7h\nI1QHGjHvWGU1yuSUMJBstbfE37142cGitQBBsL2cdrngPaeuGxdZMpPK/lmO\nBJ+3zOz9Tc4+ULK0w7TqJC2N8WqlWcyODdN4DMitbl1Tur9V83Ag36cxVCIw\nkcLMn/VHiwGPlGT3vFWXwhC88euS/XJN5zWrKYkQZ727DzSEy+tYRNkgOz6Y\nzI5SU783LCzUeHhCM64IBmRi4ArBuPExIWyfPSkulJsyBXN9f62n2F8PV0hq\naPiE0ggxrkX6xNEmU2hbC8mAckgshC3n3hVbXXEiy9zJgKhIiMMdD1SrtOCw\nrK8715aKWpC80zPOQjmTuLV3BEjpc/bEQi2s1W0ywN9liRmnmxFTQ+TpIUqC\nC36eDBOImFWBgyh3seEMFx35rFIucMGw4oK153IOzXhY/vYGzuf6O0iMpO3R\nsgwY\r\n=mcuW\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`mdc-slider-color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`mdc-slider-highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`mdc-slider-rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`mdc-slider-rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`mdc-slider-thumb-color($color)` | Sets the color of the thumb (grab handle)\n`mdc-slider-focus-halo-color($color)` | Sets the color of the focus halo\n`mdc-slider-value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`mdc-slider-value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`mdc-slider-value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"5ec624a1b571d87d94d5187056a0b6db214d229f","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.18.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.18.0","dependencies":{"tslib":"^1.9.3","@material/dom":"5.0.0-canary.a1c84d4b5.0","@material/rtl":"5.0.0-canary.a1c84d4b5.0","@material/base":"5.0.0-canary.a1c84d4b5.0","@material/theme":"5.0.0-canary.a1c84d4b5.0","@material/animation":"5.0.0-canary.a1c84d4b5.0","@material/typography":"5.0.0-canary.a1c84d4b5.0","@material/feature-targeting":"5.0.0-canary.a1c84d4b5.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_5.0.0-canary.a1c84d4b5.0_1578420615075_0.6557703849787055","host":"s3://npm-registry-packages"}},"5.0.0-canary.ec9f16578.0":{"name":"@material/slider","version":"5.0.0-canary.ec9f16578.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@5.0.0-canary.ec9f16578.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"11b7b3bd0a0550493c8612ccfc92b52a2bdaad1b","tarball":"https://registry.npmjs.org/@material/slider/-/slider-5.0.0-canary.ec9f16578.0.tgz","fileCount":31,"integrity":"sha512-aGqdR3KIW/Ui5RxkUU4U0P0BWTzB86OP2rPi7n0eDHOnFuwZLfh5cNdrllNcbH0XyPSbqAjlKYZUsvTl1LQJgg==","signatures":[{"sig":"MEQCIFrHuJ52OvkWsbn72Gkir5t+7GvJ/OWKAPUuu5JuEi7iAiBZJ/v/B5mIOLODhbRf8quvLDaUEsBO0DKjtTm+migjDA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":342371,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeFN54CRA9TVsSAnZWagAAnkcQAInMNOqnViIt4XWO9O+v\neEDRKPGpBWv/H/U7+Vrn2Yr39DAgbpwahOb4t0nBJ1d9oJ1m58nVDMhTntN+\n7tZJS0PXVcirjdQPjFAEqzC8b2l9r84I9C0suiBXttCtfu93Qfik7XEHYwYq\ngNz27g5LWc13kMzxUqDh9AoSqHxLXUWygGbbhdTTC3WbMenvvGdboAnD4ffR\nuMpIxbCmaWAxGYfnwYcip75RSstPePUGW8JKjDzXg/XpCVcQiwczl2j+iXsw\nKm+213ff+06bQYtoGyGVxTet4HYGtjmPgGSYWXlx6h4AOiWVcFS5Q/G4CKdM\nhw/JPc/UcNNGBnTguY+mqEjb100G7QHLWaBxvWWX7k1L3JcFmjNq+XZYx2YZ\nUvWKQb2lzRMXfRVAG2gmnfk5aw5jeS/D7pL5jYAqLW3r7Uk7/E1iTzPqLJwK\nOfB24SyiNGb1bpj/jREb0YCe2QVRBV03pleLK2f+slenWdvnmxtmVBplRN23\nyKzKGeS7Ba812vhT4HfVi6c2JVsanOEH+DOh6oeaF9xRjA38S3p55+58y3mf\nQP1RQtOQTNjUukgehDOH6QDMYl6wP4Mw/5fyV5V8uC8mwquf55cg9mgQWkKy\n9nw2l+rzjhNhKcs0gTMKXlmaPKHLmk3OrPf4eACjAxMKMpTtj3tMlcY4c9Vh\nwGEJ\r\n=oP2c\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`mdc-slider-color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`mdc-slider-highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`mdc-slider-rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`mdc-slider-rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`mdc-slider-thumb-color($color)` | Sets the color of the thumb (grab handle)\n`mdc-slider-focus-halo-color($color)` | Sets the color of the focus halo\n`mdc-slider-value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`mdc-slider-value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`mdc-slider-value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"23103621e66342865b8700c5948ef9134fa8d1fb","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.18.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.18.0","dependencies":{"tslib":"^1.9.3","@material/dom":"5.0.0-canary.ec9f16578.0","@material/rtl":"5.0.0-canary.ec9f16578.0","@material/base":"5.0.0-canary.ec9f16578.0","@material/theme":"5.0.0-canary.ec9f16578.0","@material/animation":"5.0.0-canary.ec9f16578.0","@material/typography":"5.0.0-canary.ec9f16578.0","@material/feature-targeting":"5.0.0-canary.ec9f16578.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_5.0.0-canary.ec9f16578.0_1578425976077_0.9241713630798472","host":"s3://npm-registry-packages"}},"5.0.0-canary.b602226ce.0":{"name":"@material/slider","version":"5.0.0-canary.b602226ce.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@5.0.0-canary.b602226ce.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"970ae6df304a81de7535ad8343056497c77419bd","tarball":"https://registry.npmjs.org/@material/slider/-/slider-5.0.0-canary.b602226ce.0.tgz","fileCount":31,"integrity":"sha512-2IL+5mEUKQp3x6Ims3NJO/i8pMiF6GAl1MxDESat+HQ9Y0YHfhBZM5P8xu5uiMRGMHoBlCIdbyAztEeKxWFyFQ==","signatures":[{"sig":"MEYCIQDVslusZ0SORIeiuX0ea9sXmbZDKdkh0AhSeSmqZnVzaAIhAMgz/xxB34/BCW0tT5u5ehQ+4ttJUSTgR4Ly670eESlc","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":342371,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeFObYCRA9TVsSAnZWagAACf0P/iL1tmMDO3hFoXEqkr7I\njywNu4O5WSqYkDg8V79zxaebEeh+v0yRZ46VEHoULy4rRG2yAOV5o3SE6732\n7OomuYJF5zPJrODboK/DRarTaUYRoEnynIQdsyGAtA+Cavv1Q754LPumCmNO\nbpoRVJggplvCxA+bR4yTmYKBwUi1FtwcwhPJequ9YQ0ZXdaSsmakEyubUrMG\nuzkQCC2pHJG4lGNRo5wpl46FgBMIj6hs/16h3qA2vjKmFn1kQ0kkXItVSD3o\nxj4lRT8GbBkyDvfozXXWdZyj3Fb6/hirPc9KHsqhCodhKvapJTzYn5XQ8v2g\nKCObUeb43g0y+ayhrVtOm8O/AKicFrBsiIT8ncZu2R9+thzqXc+Uk++m4Mxz\nSXojCFe2gszdQeS2iySX9yIOiqvZ5re2vJfSoHSJOKiY/LOF2LVhDTr+MKdj\nmm29hNYKdFIOQpm/GzTAgroSOxINcs+TfaU78NB+TVqTY3C6bccwt3+5EanH\nlA14iuclSJGcU5GQBqfTMvtizO3hV5BXnr+yYqkUnH9xniOlAH4Vw5IDh3iX\nGcSMpKug4IRHPFV9F59tKysKPfQcXjbeN1keNsg7GPjK6xPpIhhSzJV5tVuM\nzXm5f6qtaC50c4iAJy+XBx32tXXWL+XRpQeSEUo+w8gKvSXfc6+DBtNZJjvm\n7b5I\r\n=p+WN\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`mdc-slider-color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`mdc-slider-highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`mdc-slider-rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`mdc-slider-rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`mdc-slider-thumb-color($color)` | Sets the color of the thumb (grab handle)\n`mdc-slider-focus-halo-color($color)` | Sets the color of the focus halo\n`mdc-slider-value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`mdc-slider-value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`mdc-slider-value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"de0d35ec6a5285ea0c12a54a6e35051ccd0aac1e","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.18.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.18.0","dependencies":{"tslib":"^1.9.3","@material/dom":"5.0.0-canary.b602226ce.0","@material/rtl":"5.0.0-canary.b602226ce.0","@material/base":"5.0.0-canary.b602226ce.0","@material/theme":"5.0.0-canary.b602226ce.0","@material/animation":"5.0.0-canary.b602226ce.0","@material/typography":"5.0.0-canary.b602226ce.0","@material/feature-targeting":"5.0.0-canary.b602226ce.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_5.0.0-canary.b602226ce.0_1578428120249_0.20418814864360257","host":"s3://npm-registry-packages"}},"5.0.0-canary.b2d2dc08c.0":{"name":"@material/slider","version":"5.0.0-canary.b2d2dc08c.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@5.0.0-canary.b2d2dc08c.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"95ac0a5a72eca3c89c18454a1da0c003ebabe5e3","tarball":"https://registry.npmjs.org/@material/slider/-/slider-5.0.0-canary.b2d2dc08c.0.tgz","fileCount":31,"integrity":"sha512-ieH8ZCZ4fywESLSVxBj8duQqK/ec5Ajdal9v/e6QvRlLAj0uKhQmzv4zYOkHpSSba1G2uN2pwethe2G/wljCcQ==","signatures":[{"sig":"MEQCIDpUBCkNeU6aw8UqXg0ElowHEK2Vs3P+g3rW+f/4Iel3AiBfNsZni2tSohPCyi6E4yaf4kYI4Xha5mZwNXb1oBxboQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":342371,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeFPdqCRA9TVsSAnZWagAA+5YP/2SljUpA/8ULnubB2s6o\nUu3qtwZ2BCt2g+I0xhFXmgY7a35g2riwWGrzz9K6LKYHZU2B/j5m0LH4jIKw\nfuo+dgQB5dCr9vPZHEWmQY+MDv+MZ/9xTOT5QzBgb41CKHIwuI7IH+nbNraz\nCBUiBLtUiaiPJfl3L/XzSB69jQK1PfVJ2x7tPtEPBCowYRV/OIsPf5xGQnke\nhRw+ThwIduAZKwbB8ITRdjhUnZ5RhGU0Jl2TDe+Og9gVt1kALbNdDLYOSSfO\nDs7Eh1lgJCXWkh7LKW+gqw83OxHcJ9jHuJtqHUSyPPUqE4tH5o0n+9zVojDA\n19KV8Q7yTPPMzCTl9Vm7M3tP725uK2aN7BFBmnczQyeVVbX+u3OYRUlDeLrA\niknTRM0Rsc8/bTuPpeuzNB2s7mhnq3EcwUFA/2JZvY/M9izb6kd1eDCdTY0j\nuPCsjTMJmkS1kC17ueJwA4h6WszqFyVJrcG6y5JTyU5Pp2Erenn0iHWgiKIM\nUF4Unx5UHEw9/9+ZA0I2cYKq4NSqRNvKgc2e7r8jfIDXwKktCTmyBUK/h7+y\nNpk8JR+nwHFtY0pNrXWk3x402mA8VdcPDL5ZnSIymMM3vF29hnWmL0nFCMht\n5d3feqO7A2AG4oQvXf/a37ImsWxnp0zIZvGYUbWeFjnOBvIhUPmIEl6i15uG\niBRx\r\n=jcSI\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`mdc-slider-color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`mdc-slider-highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`mdc-slider-rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`mdc-slider-rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`mdc-slider-thumb-color($color)` | Sets the color of the thumb (grab handle)\n`mdc-slider-focus-halo-color($color)` | Sets the color of the focus halo\n`mdc-slider-value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`mdc-slider-value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`mdc-slider-value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"ec9aa1966e1f2e307207d815ccbe3f16750af94c","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.18.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.18.0","dependencies":{"tslib":"^1.9.3","@material/dom":"5.0.0-canary.b2d2dc08c.0","@material/rtl":"5.0.0-canary.b2d2dc08c.0","@material/base":"5.0.0-canary.b2d2dc08c.0","@material/theme":"5.0.0-canary.b2d2dc08c.0","@material/animation":"5.0.0-canary.b2d2dc08c.0","@material/typography":"5.0.0-canary.b2d2dc08c.0","@material/feature-targeting":"5.0.0-canary.b2d2dc08c.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_5.0.0-canary.b2d2dc08c.0_1578432362135_0.7623470716064633","host":"s3://npm-registry-packages"}},"5.0.0-canary.61f2d7580.0":{"name":"@material/slider","version":"5.0.0-canary.61f2d7580.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@5.0.0-canary.61f2d7580.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"43b4fde7d8f40b962c2ab5296f082758c5e0cb97","tarball":"https://registry.npmjs.org/@material/slider/-/slider-5.0.0-canary.61f2d7580.0.tgz","fileCount":31,"integrity":"sha512-WbT4LpZxb0tIhYpp2lJBlVcCAI70XtrGMlgCvAv0oh2AcNpK9rnLKD7gYhbzrHrNxmqLqWgbPnAXHG8z+Pt5SA==","signatures":[{"sig":"MEUCIQD8ntrx4nL8rvPlLaqU9qEaLRekdQF22bNDwW6Jx174oQIgC7bpo6hOU6g4Rpp530Tk6fo4smN1XfrnTkALIQaHXus=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":342371,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeFPqiCRA9TVsSAnZWagAAjm8P/0JSvVY86vAOFdrdfAx+\ndHpZm4swxfKwMh+eKcarSuEoi+8I7WrvdCEdbHZFQjpTkg46UxX2K2z9akh6\nteJqOmSE+bDQs/WcfYMMOq27m80Rjf9kabB1ALW2laehLSdMVAo5OlnKy/hN\njdX2D7zK7MpvNoT5lxGfElYekFWQoAEEjNaTWU9KpizmMsTA7c0oICkgsPVw\nN6qaSh9+x5x0qZtdOi45pC34tdDcFi6XxIlIxXY+obg7HDqmAN7HDxjGcw5n\nUsTZxuBScmzJeKgAOBoTLPMiYWmqkLxSd8FouOAUbirbcRwLuraNssUEH5wE\nyG19tuRc58dzXTEmuCFHx3FyqNl20NXuakdVuc4t0Lsfi9aCPDwN8TTp01Iv\nohQNe/3DONvTJ0jtxAcBg78Ho7m7KaaH299x/XyLKEW3oATPBdjIIUAfgHkx\nvCI34cNlMx8asJ44i4gZZvUdXcyCTtzc6Gzu0A9ARCON47ithIAOqYGPf4Lc\n9OzoqZMi8nmLHTr+MM9O+DBRFBAM/qA93ILBHpYYWvhPCXXXz8c7fsT/SHMG\n0oHmyOyPEqgp5ZFBiQygfyhi1v2F8Lwb9GacJBpwYyGYhfgaNMWtG4/qkcko\nkpOx33MkxDE7BPtNc9lKrUgvqxVi4VjiMgx9sxyQxWPeFMmD0pQdhnzY9jSi\nv/Ja\r\n=J9Mu\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`mdc-slider-color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`mdc-slider-highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`mdc-slider-rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`mdc-slider-rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`mdc-slider-thumb-color($color)` | Sets the color of the thumb (grab handle)\n`mdc-slider-focus-halo-color($color)` | Sets the color of the focus halo\n`mdc-slider-value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`mdc-slider-value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`mdc-slider-value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"a826fac64c34ef89005bede280cad29c76346e55","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.18.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.18.0","dependencies":{"tslib":"^1.9.3","@material/dom":"5.0.0-canary.61f2d7580.0","@material/rtl":"5.0.0-canary.61f2d7580.0","@material/base":"5.0.0-canary.61f2d7580.0","@material/theme":"5.0.0-canary.61f2d7580.0","@material/animation":"5.0.0-canary.61f2d7580.0","@material/typography":"5.0.0-canary.61f2d7580.0","@material/feature-targeting":"5.0.0-canary.61f2d7580.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_5.0.0-canary.61f2d7580.0_1578433185739_0.0056047402335419605","host":"s3://npm-registry-packages"}},"5.0.0-canary.d1be53a2e.0":{"name":"@material/slider","version":"5.0.0-canary.d1be53a2e.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@5.0.0-canary.d1be53a2e.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"8c34f43d089aeedf985b49e33f29d9fa8774917d","tarball":"https://registry.npmjs.org/@material/slider/-/slider-5.0.0-canary.d1be53a2e.0.tgz","fileCount":31,"integrity":"sha512-hifnj6X4Gu334hmrji/mkZu8WlubK66/HiHlrf5hCgyhvW0Aanjiyl3OT9WiDhBFQON3Q/D4v7PxHCab2cVZLQ==","signatures":[{"sig":"MEYCIQCS/+nA2iITHv8Xedch/m5qsGBL8f9qKmMQnZx+Pk+XNQIhANQqOKqU4yRlbsfi/G2l8LKeSJXLYKuOKT/CBGUQavaS","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":342371,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeFQNiCRA9TVsSAnZWagAAwpkP/j6qWlKGngAG8sHjh9EI\nwo9aGNoMYQiXll4J12digbNMc5skqazluVonm0iPRJ3zLuwwX3J7BQxA6iyc\ndBKni/qaqWmqBLXAwPgBXrJEwCzXqtkqDF3egHNxOTSvU1x6tDqX8Of9Yufu\npZs3CRpiWvobSOFYNc14gaP19nCGjUnOW6C7vkyopLFZBIZqu0pRL40/XfoV\ngJiCmMZfxpPhXr/3KGLlnUEuId2n4EHqX3qb0ZFmGKw+K9B/2tOzf26sdtYD\nxodOwvWM/xFrlXfIrWqGd4XWoxdv4ZhhojOgGTBBGFDl2IR4BlP41PbBCDDM\n1DEgL97cWpVLxOLM/s1UZOo5LlMokhD74lT8Cv1N/7dsMFsN1lZ4EXi4tcBk\nSKcTDtxFGJA2zxmm0iMuH9tkymlM6t36FbgBfcJY9SRmXLpmbpF2/4HNfzXJ\nJSdPK+NMqB3YPaKTrj2h+lqBE+4+NiNOaItOXzO7Ma64YMmFVRHnJJ6vOGJT\nGp7pMK168YsjzHHDDu8PJNQcN2qRQYDZ4I77+HzAdGlihPCetNpwEJ1ig/4S\nkI3hrLukjP8eg0KvpLOOosZjaaohnVomxp73JbRdE7FdmBmjkjj1UF+FB/LZ\nnqnrRpC098c83ONCoqIUYwjz+YORSLuSQhuo7B+7ZoXI02IOUpKghtsdhm0j\nF8Ec\r\n=MBbF\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`mdc-slider-color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`mdc-slider-highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`mdc-slider-rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`mdc-slider-rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`mdc-slider-thumb-color($color)` | Sets the color of the thumb (grab handle)\n`mdc-slider-focus-halo-color($color)` | Sets the color of the focus halo\n`mdc-slider-value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`mdc-slider-value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`mdc-slider-value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"5053f71f9a35d62630821c2c4084794f7bedf258","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.18.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.18.0","dependencies":{"tslib":"^1.9.3","@material/dom":"5.0.0-canary.d1be53a2e.0","@material/rtl":"5.0.0-canary.d1be53a2e.0","@material/base":"5.0.0-canary.d1be53a2e.0","@material/theme":"5.0.0-canary.d1be53a2e.0","@material/animation":"5.0.0-canary.d1be53a2e.0","@material/typography":"5.0.0-canary.d1be53a2e.0","@material/feature-targeting":"5.0.0-canary.d1be53a2e.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_5.0.0-canary.d1be53a2e.0_1578435425753_0.16335969454834176","host":"s3://npm-registry-packages"}},"5.0.0-canary.9b0d06e32.0":{"name":"@material/slider","version":"5.0.0-canary.9b0d06e32.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@5.0.0-canary.9b0d06e32.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"750b36eefe465eb14a49da19d724d4e317d385c5","tarball":"https://registry.npmjs.org/@material/slider/-/slider-5.0.0-canary.9b0d06e32.0.tgz","fileCount":31,"integrity":"sha512-G70IU45G9BVBbgy7miNu1HMxSmr6xBwAIdmPttIxRsJ78QfI3eDqWb6s0s2D1B30ClNPSFc0Y9tAgU6lsMsRlQ==","signatures":[{"sig":"MEYCIQCmI0aJ51FSAk8vdJWzdQlDjb+K1awDV0m7gLTQA/DTrgIhANVyciQUSGPwr5zLfbNx3BBUApZQiKvH665IF6xVxu8N","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":342371,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeFQPqCRA9TVsSAnZWagAAJwsP/1woaS+J/eh4R/PoxnBo\nfxjUSxJIi+/lwQSFTaQqHav7FvwP0z/Dmui85kCpeVeiVl3mPc1iaALujDHs\n72HqYXUPke5AbQJgkCsdCVj0yvmrwBdAaxAH1iARUBbIFrsEi/quKeQ8IMD+\nVCZaOxCDycxOceycNkRB8r2NksObn+MbDeRT8E//FP5ZvjXQTGQ57E5B/FxR\nMSMRczn+6a5WYBxfNtIqhWGhfJ9Jt3mam6mJFpMZbf03qOSm2YEGI0rvLWEM\n145YGmhiZb0WRubqI5gsSXHLUuTtlninAOwTHYvadvH/p2nGGO0g+YDp6v3u\n+DKvS6uylkPlcGCntpXV82Z6vmXyEDp0Vx/pH/vDRiGkGWx7BWgHT0VuKwxS\nr07a8+pgP3TqJiLjObz6a1GM4H1BptW6f3vroHIQP9MUzLtE0abjUFp/KQva\nreRAvF2cbtf+s2Qc/kcwMr7ADfwUfu2lOFVP7dX4nOnnJK/wGnKMZiDTB0O9\nQyjr9eHsCBZuW8rKXV5LiQ74/oUKGpKyYrVp18epuTWlZGN149dMGN4WAGvE\nUASmEruSlsi0yvygpEHPQLpmkqFRECtJidpz+8H+QmAX97/Plk1G3C9c5OG1\n4JyjqODq85R4PYwVB9r0UBFGMt6F3pbGpb0XeybX24ZXvSXxslddal0oIoad\nr+ck\r\n=iXYT\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`mdc-slider-color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`mdc-slider-highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`mdc-slider-rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`mdc-slider-rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`mdc-slider-thumb-color($color)` | Sets the color of the thumb (grab handle)\n`mdc-slider-focus-halo-color($color)` | Sets the color of the focus halo\n`mdc-slider-value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`mdc-slider-value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`mdc-slider-value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"485fa4920288a2a37995f4c736a1d429de15e53e","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.18.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.18.0","dependencies":{"tslib":"^1.9.3","@material/dom":"5.0.0-canary.9b0d06e32.0","@material/rtl":"5.0.0-canary.9b0d06e32.0","@material/base":"5.0.0-canary.9b0d06e32.0","@material/theme":"5.0.0-canary.9b0d06e32.0","@material/animation":"5.0.0-canary.9b0d06e32.0","@material/typography":"5.0.0-canary.9b0d06e32.0","@material/feature-targeting":"5.0.0-canary.9b0d06e32.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_5.0.0-canary.9b0d06e32.0_1578435562078_0.028215572939656264","host":"s3://npm-registry-packages"}},"5.0.0-canary.730c807a0.0":{"name":"@material/slider","version":"5.0.0-canary.730c807a0.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@5.0.0-canary.730c807a0.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"d6a1ba191533489ab89ead56ea8d9563d8128be4","tarball":"https://registry.npmjs.org/@material/slider/-/slider-5.0.0-canary.730c807a0.0.tgz","fileCount":31,"integrity":"sha512-8K6Cax5cQi3L2fMtA+CNM3JA0QdJ904i99A+0JlvWQfydJOIkYgwEzydTp/zf9C2/P+4S2b09AGwYxlM+0KGSg==","signatures":[{"sig":"MEQCIF2zuVmO54GzgcTjXGvNdCbN151P6dc+S8J7Buq9Zy8WAiAHZ5jZ3++YCoMyVkGB/w5usZCgxf9Kn0Ao4joRkzRvcg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":342371,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeFQRKCRA9TVsSAnZWagAA77EP/jO3QkkJfE3I3dIKaC5e\n3cxKGA5kObJFlZWK90ManDElMS63BITw6Wbsq14etS7DCI//x8PhPzHx+f76\nCQU4sKpEwEm2yJSUiFN1+u1dJDBakwcb//fb46fb94hClUTGmVE4iXApIER7\nU5gTOfxIycrWRnAXaWGrNzG9GXaFHQ4wuKNZ2iJoA/5HoivpXayFnF2+15Dm\nvZPDGwCoywynMg4PeXGVPwOSvXmlmwWKI89GyXHuIqBsMjVzbNF5Tu40xfTa\nQ0T1R/OlqdCxTNeQDPnXLivrwAcbeZ3Upww5ZmjymonRa8B0tQLqSCE0835u\nx2Jariz3hjttq7CHl3+qM6Tr8A31lbHZPx+JssKEvo+Y60GhoMKc/lr2tsFC\nOjV/FTs8ruN7p1SsbImXPiiIPl9CmSO6pQYrD1lteE4MgHATaqt2J5Qr3U9z\nLOaVE0BngGcyU6Sh0klSQzlP+13CTHiP5eXhMXUnB/TYB7e51NH7VLrytDXD\nuZaxP8OLjZ+eVXOZcn9FV0E5GXWjnjJoc6lfq87IjrQiUEYyHRgDdVDKmPSc\nttqLbQ+wDZB1uN9nDQmnC0IGl/wpycwZoHjl4Z5xV5YlJ9bvFPnY5VcnOn22\nEzGlyT54qD+V39CaoJLO4mTvynHtT9UBugey1f5Wco+tjEIJMU7YFO59B3Tp\nXf27\r\n=Z88n\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`mdc-slider-color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`mdc-slider-highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`mdc-slider-rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`mdc-slider-rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`mdc-slider-thumb-color($color)` | Sets the color of the thumb (grab handle)\n`mdc-slider-focus-halo-color($color)` | Sets the color of the focus halo\n`mdc-slider-value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`mdc-slider-value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`mdc-slider-value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"8860f1c513146b0f8c59a8c70750d1353e61feaf","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.18.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.18.0","dependencies":{"tslib":"^1.9.3","@material/dom":"5.0.0-canary.730c807a0.0","@material/rtl":"5.0.0-canary.730c807a0.0","@material/base":"5.0.0-canary.730c807a0.0","@material/theme":"5.0.0-canary.730c807a0.0","@material/animation":"5.0.0-canary.730c807a0.0","@material/typography":"5.0.0-canary.730c807a0.0","@material/feature-targeting":"5.0.0-canary.730c807a0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_5.0.0-canary.730c807a0.0_1578435658279_0.14803607121910756","host":"s3://npm-registry-packages"}},"5.0.0-canary.2213152cd.0":{"name":"@material/slider","version":"5.0.0-canary.2213152cd.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@5.0.0-canary.2213152cd.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"7d28c23d07735822c71f3f00a856b4f6419aa675","tarball":"https://registry.npmjs.org/@material/slider/-/slider-5.0.0-canary.2213152cd.0.tgz","fileCount":31,"integrity":"sha512-X01PmUSUdctlRPjLwVjY5e1g8rC7lJBC8tS2DOoG+EQFI5QdvcmcHP+B5g6KA/jBn+91esA5X4R2Eqt6NgxfNg==","signatures":[{"sig":"MEUCIQCD1nUo7G+cL5tFaCXQ337ZgS1wKggiOcyxyALHKRnrwgIgfCrpHzSWmpfJVZRh7VdE/TF1uJyaVTscFFRWmrYUVFM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":342371,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeFg/JCRA9TVsSAnZWagAAUfkP/14eRfzRmnptwb9WGlLq\nqgiTMunIJXwB7FeOk62x9h5U08pnaTjGqgnd2sBWhIoWVh0rXtExhPpXj6Em\nYKrv/WlQTAVLs2HmOE8ueh9MwPJu4cXLowTkKko65Vqmc+SB7RQ+E30XpPz2\nVMzPKfbh5qdzJZ7qWnQXqWLwBVPb6Y85fhEgzm0Hof+a1TiNISpnt8CG/1r0\nclvqftkq1Z5UiYdEyrD0VeMEGd20VxA35DLxA3m9+sMbAE2eJsM3PadEQyvS\nfX7Fv0Jk188GR6y1Qoj4KlNB2kpBEU9ZLeURAGzg9WnleVV8LY7jRh42iGSv\naxTfMj0rdX4qpERv4Diluap4Z/LtO1eKN+osPMmmJzgj5vudgB/SELXUttpV\nV31x3MIucVnkXLC+BwCgu+alGrhjxWiw4IE0gCOlXO97+j6+pvbfC64lzi4x\nsixtufUTibshdKP+ysZq3zDR80DCWI1kA+TORzaD+owK7495eVErZxKLTIzy\nTcedvwgdYgXLq6xYCZkyQ3B8dObmsw5rDibTrHvHD7bxsSLHeS6m7PxgZwq6\n3Tdx3DwbuzdF5/cdme/ZFh48AObj94EFG/dUlcMJdzlv+RPQOg4oWbadH8T7\naNsuCKXkPCBD93Ja1QLWaFzKEuVDGw5/9b0z/azEnFQwKxLNEvBGNofKB+3E\nGHKM\r\n=0DwW\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`mdc-slider-color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`mdc-slider-highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`mdc-slider-rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`mdc-slider-rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`mdc-slider-thumb-color($color)` | Sets the color of the thumb (grab handle)\n`mdc-slider-focus-halo-color($color)` | Sets the color of the focus halo\n`mdc-slider-value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`mdc-slider-value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`mdc-slider-value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"0a3677a82eb2000c085d0cab420c907dca8cf13a","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.18.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.18.0","dependencies":{"tslib":"^1.9.3","@material/dom":"5.0.0-canary.2213152cd.0","@material/rtl":"5.0.0-canary.2213152cd.0","@material/base":"5.0.0-canary.2213152cd.0","@material/theme":"5.0.0-canary.2213152cd.0","@material/animation":"5.0.0-canary.2213152cd.0","@material/typography":"5.0.0-canary.2213152cd.0","@material/feature-targeting":"5.0.0-canary.2213152cd.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_5.0.0-canary.2213152cd.0_1578504136973_0.06920490193374595","host":"s3://npm-registry-packages"}},"5.0.0-canary.5750f7169.0":{"name":"@material/slider","version":"5.0.0-canary.5750f7169.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@5.0.0-canary.5750f7169.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"075da2c4d59589958ca009f041d0fa412ee6a0b4","tarball":"https://registry.npmjs.org/@material/slider/-/slider-5.0.0-canary.5750f7169.0.tgz","fileCount":31,"integrity":"sha512-o6m/0J+9rLBq8JsyCPCNbTkkg604oyJwvXV1rs7/uCVVu5S+H//3H8ZHs5TtGS7LM9fqeykoMsRhiwaqBYGs2w==","signatures":[{"sig":"MEUCIQCYDFsAI1mX98KTADpd69QrO26fnYdrq22hQ+B345gSvgIgPeVPNY1G5viO4FKvCR6atf5tXcGu2CworEL1K4VOUus=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":342371,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeFhfsCRA9TVsSAnZWagAA058P/29rea6SnyAEM2l/hP9L\nqz7WFPOotNAr/AHxsPVhvRNPUs6R2e9aTV9A4jPZcaY9RqbEVwQC9AlvNCyf\nTY7SFmuvxufOkW6L6ZCVWXc/PtYAOOtRvhaZW+5jlMTxrtiGakSxM7mth770\nBKq1FRl8cY0xWgFPuxUiIvcdSZ3dSSc0aFAFcDXBBSLWjPMbBR7E5V+HorPb\n1x6KBEKzsqMXVnVffO3lYUieFOCyNZCHgz3hafr9463355STxw3+ChDOtON8\nzQ6vJ0Gba43dtpUkkRneqqHxnXrLPtT8GtVhxDyFrnDqTwemCVcM9+5ESnRi\n8exicUdaZX3qNop+BMOFZDYMYRr7JnWftgm/aCbXPfMZAvA/XOxHvEpEBHFZ\nvNRdSd/Ewkoxb43RwYX3jmyhYrhxWP06VHs31QKT0eoulRP7BOpnI6uC+oc0\nQl6OcHESKXWx1hWTNsohvZzjLZQvY7f2+H8Zt4oyAbkJccZqMFqY2l50NEqK\nqNsZOQlGTTqxfejH0KzTcpbUHIqiTeReRutCeiYaEMxr9HMVtdfA7x6PXwt1\nVoJPXRs3NoljtykVUsL12PISYSc/HVcJI4nmCJzeijqntws4BTRQa3jGJpgY\nwuqvYz523B5ebYCz0QPsY0EzkRIf7TnkxOG+lFPRRqxv4kc3WDgdZQtCnPr9\nfXyS\r\n=AR1C\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`mdc-slider-color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`mdc-slider-highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`mdc-slider-rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`mdc-slider-rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`mdc-slider-thumb-color($color)` | Sets the color of the thumb (grab handle)\n`mdc-slider-focus-halo-color($color)` | Sets the color of the focus halo\n`mdc-slider-value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`mdc-slider-value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`mdc-slider-value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"394a48c85aa714b74edbf6f2b4172e4b066f604f","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.18.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.18.0","dependencies":{"tslib":"^1.9.3","@material/dom":"5.0.0-canary.5750f7169.0","@material/rtl":"5.0.0-canary.5750f7169.0","@material/base":"5.0.0-canary.5750f7169.0","@material/theme":"5.0.0-canary.5750f7169.0","@material/animation":"5.0.0-canary.5750f7169.0","@material/typography":"5.0.0-canary.5750f7169.0","@material/feature-targeting":"5.0.0-canary.5750f7169.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_5.0.0-canary.5750f7169.0_1578506218398_0.5927338194505207","host":"s3://npm-registry-packages"}},"5.0.0-canary.f7abc7a43.0":{"name":"@material/slider","version":"5.0.0-canary.f7abc7a43.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@5.0.0-canary.f7abc7a43.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"3e7e227be00afec2c3a6771ee4028bff24d5dee3","tarball":"https://registry.npmjs.org/@material/slider/-/slider-5.0.0-canary.f7abc7a43.0.tgz","fileCount":31,"integrity":"sha512-mISWyc7zrhvGLe1FTgW/8srroUBiA8WbKHaKafDz5lF4tTRORgF+iS+N3vUHoGKwr9wnuS+re5Ib1O9ATFlRmg==","signatures":[{"sig":"MEYCIQCAFx+dP7xcjqk8FOB/c4+UYwVexK7QM/xE4krNQG28iwIhAJIfWzOPchpg4Qa0u4Aq/Wjf8jdM37+UBGrsfrjE2syq","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":342371,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeFh8mCRA9TVsSAnZWagAA4OIP/3ljr0cPTElrLw6eHrme\nBHQPmBKoADMOeFznAwaKc2NdnuUYGmX0PSvMZtqJsEKyd/oI0mIOulf39e9m\nyfm6s54jzVPf/oQEfH+nTxYH2kKOug74WKmA2F9c97WIdOrobzjg+C+3ThSg\n5AQQZqvQYagcLRLh5UwNBqOf0K942+YHViTWByj5Kbemde4ph3JJaTAlFDeD\n9Gusn0cNYNz+FP+rzIDxTmxfWuVTW5SnlJrMj0u/3O++cP+NqgC4G6G20ffZ\njaOKN9nNLZhxpigcKlJzoC5ksomu3UP//rjvmpFP3zKHP40rCZYoBWX+bQfJ\ntkOArirwDBaeyQO5itQsiWmtWveN3D+pd0M8pgDz+nt7fpRdIOfY4n/oQy2T\nm79kKYIkLbBXkeyDQyYHUt5TqFYdocRyLJPHagWKYRfNx7prJRkIFC/XCasB\nhrAd2U8006Z23qJKTe3q24BXAE9cMkhbEt4jE9G3qN4qtbwEr4emDExgB2YQ\nsYUKk//0/b29GbqdlCO0RjXQDOmCBMVC+MTeTG1G+Ilcz4HNWbzUZsJtTKJH\nNAr/iK6GDvBbKXNowz2/e/2Q/RjuGjhESRrU1/TtRcnJnO9Pvy5o2+kOKNZb\n3nefwYOiZ/tGGSwfSLxzmb2BiE7YztOcGQVw+jTYpBh1ztaN6u63ozcE9xEj\nCxDX\r\n=qHEi\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`mdc-slider-color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`mdc-slider-highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`mdc-slider-rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`mdc-slider-rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`mdc-slider-thumb-color($color)` | Sets the color of the thumb (grab handle)\n`mdc-slider-focus-halo-color($color)` | Sets the color of the focus halo\n`mdc-slider-value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`mdc-slider-value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`mdc-slider-value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"f7431b4b45a3e410e9cbc1ae6abe69c3b00221c9","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.18.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.18.0","dependencies":{"tslib":"^1.9.3","@material/dom":"5.0.0-canary.f7abc7a43.0","@material/rtl":"5.0.0-canary.f7abc7a43.0","@material/base":"5.0.0-canary.f7abc7a43.0","@material/theme":"5.0.0-canary.f7abc7a43.0","@material/animation":"5.0.0-canary.f7abc7a43.0","@material/typography":"5.0.0-canary.f7abc7a43.0","@material/feature-targeting":"5.0.0-canary.f7abc7a43.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_5.0.0-canary.f7abc7a43.0_1578508070236_0.19988938832669234","host":"s3://npm-registry-packages"}},"5.0.0-canary.bf7b4a061.0":{"name":"@material/slider","version":"5.0.0-canary.bf7b4a061.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@5.0.0-canary.bf7b4a061.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"ce6a4f077e0c343462e713d8130e5384cafdd744","tarball":"https://registry.npmjs.org/@material/slider/-/slider-5.0.0-canary.bf7b4a061.0.tgz","fileCount":31,"integrity":"sha512-5X7FD7ZPCNt/M2BXdxoQytJA5pppL5qsoVIr3VvS5xshDQgooPwQpABJGE1XGZgv1WvzPuZDMRNuf5CU+6Bo/g==","signatures":[{"sig":"MEQCIG3cmGv1ehOG89ft9zOxOZp2mQGf2PfnNyQ8PcXSeZYWAiAxyUOVo1Bfn5RmH8gRDDAFlLXiJxh1ZzCHxszuYWSbOg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":342371,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeFiJgCRA9TVsSAnZWagAASAAP/jsiX4miM1dPU0AhnsOD\nA7ryqYYQXS3q+2rGoqWuBAEg+xx11S5AY9NaId6WdvhkrC1mybcVIDBJnIa8\nn/kP3S4+LYPW4wwc3/io7UFNJE2fpv2k9thzPE1OUooakNfX3BDTbUSjoUF8\ndj0zBIIbVh3hNbYwoLVY1gKZ41QpRhcMoIy2b9y9J1XGrE68Kky4twh+eLJ6\nALJGIn8qL5W9Oai77Rap574jMAL8vOme55ebYObPG8+UN5qETxW5FPfqKoJg\nauvJpzG388J27Q0lCFfH4zASqEAjGGSVMoolwNxpXkNcK14go8bvSECmBUEJ\nAfO8swLsfH50o6gLPkhwWRlU3q5dBANuG0gSCYDI9eTpnUpMBhP85u+Z4Vsi\nshfAGvygKLOFeh0/UgCpsC9FT1Il9ibzS0hgiwp27szwRlI19zoZv0hioV5x\noROByS4tu4Rc8Yt1WbV4dBNeqrYVasKoUyTs1pFh+DDLWryeJrWEX2054KrW\nZaAskr/zRWKE5MrZx/AP7FrQsrqmn5Gtw0D5UZgJ/Zl6+04C0pqNtXYXsRwz\nixbwAGcphE8zntrwZcADKW+yjfwvXK/wtguJq34zYlntmbqcajvgQFFrK08/\npdPWHFrg/TWFVuO/MhZBFaGVxK6ZYMkDIHvedxXtatbyed4WzBxecILO+83n\nz292\r\n=GCcJ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`mdc-slider-color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`mdc-slider-highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`mdc-slider-rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`mdc-slider-rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`mdc-slider-thumb-color($color)` | Sets the color of the thumb (grab handle)\n`mdc-slider-focus-halo-color($color)` | Sets the color of the focus halo\n`mdc-slider-value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`mdc-slider-value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`mdc-slider-value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"2cbac03ca7852ef897dec80561a01faa8b537228","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.18.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.18.0","dependencies":{"tslib":"^1.9.3","@material/dom":"5.0.0-canary.bf7b4a061.0","@material/rtl":"5.0.0-canary.bf7b4a061.0","@material/base":"5.0.0-canary.bf7b4a061.0","@material/theme":"5.0.0-canary.bf7b4a061.0","@material/animation":"5.0.0-canary.bf7b4a061.0","@material/typography":"5.0.0-canary.bf7b4a061.0","@material/feature-targeting":"5.0.0-canary.bf7b4a061.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_5.0.0-canary.bf7b4a061.0_1578508896399_0.9885340446942501","host":"s3://npm-registry-packages"}},"5.0.0-canary.784fa7903.0":{"name":"@material/slider","version":"5.0.0-canary.784fa7903.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@5.0.0-canary.784fa7903.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"d3bdf74cfaafa4efb6bdc196b81c1af8f49efb54","tarball":"https://registry.npmjs.org/@material/slider/-/slider-5.0.0-canary.784fa7903.0.tgz","fileCount":31,"integrity":"sha512-I3/Lu3qk0U/8xOHSys81mZ39d8ZGc9uV+h7UWi0W38ZayvkDDI8lQZLyDyXoW7/B89JKmGzsj6rVAV6cxxt0dw==","signatures":[{"sig":"MEYCIQCBCu26tZLl6ARCDvC+iIQgtjPrbU2Yek3DZsh7MlTbtwIhALsgY9O4ynMlOZx/ueqJM92m8X4/jFHqLa3V6jjxyCvM","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":342371,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeFikgCRA9TVsSAnZWagAA+nsQAIDh3LtPVlMFhxWxFSLr\nnuqDU+MW1amSVIVoFWRMlAA81Gd9BE7ZJi4ssrocTP1cIeJdOGqOo3nVCPZ0\nwLeDijgkXvsb7MhOTdRWOECRwamPxbARIQ5GrTJt5UdAS8v0zHc043AZsSmJ\nx0PyWF/pp04yA/bP7r2utSQJldej8aSDBFWMFd7dLIfTkbJC2+VUUSyWuPau\nC+fdnLLShfoubBTlXlFPqXRB9q17liB0lM7JbWOLtxPBCpVWzB+Td9zT6/9y\nhb6nqKyDkYm3nRQPDQmUIGwIumC7IqhDgJIg6dFusq+NtmB2uA/VHG50kw9t\nvFuQwCKEXJ5NlihALIXvlBPmI6l97OwJur7RmzV1gSd3XD9524e6jNZO1DCq\njHJ6ydXjjyNgtTr6grgrzCX1GU0QOVvZa3TjyUAWCApb2kOymh9sGAHkrdqQ\n136FDj17Bme0dmygfncQ0X4C42ewhcTmdZArCtDPDYmyUCnUlYSeOO2xk0jW\n/RnSJdzTyYOUyPV8H13zt64bzHf5P6Zj1ixySLQPkGb/h3s34Tyaqxi8Phm3\nlDNDIL1kN2p4wF8xYRFcADrYyvhqOh2Od5lVMQAn1ozXmcd4mczjcbHSHn7E\nJqRb+TuXBYLTMBYlRU5RBxPiLaToIJ5+GFap5Oq4xkCGYvkmbztXly/KMP1T\nHqrz\r\n=Z7bk\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`mdc-slider-color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`mdc-slider-highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`mdc-slider-rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`mdc-slider-rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`mdc-slider-thumb-color($color)` | Sets the color of the thumb (grab handle)\n`mdc-slider-focus-halo-color($color)` | Sets the color of the focus halo\n`mdc-slider-value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`mdc-slider-value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`mdc-slider-value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"61b0d187c5c030042fb90bb59c1ebcd090186cb1","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.18.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.18.0","dependencies":{"tslib":"^1.9.3","@material/dom":"5.0.0-canary.784fa7903.0","@material/rtl":"5.0.0-canary.784fa7903.0","@material/base":"5.0.0-canary.784fa7903.0","@material/theme":"5.0.0-canary.784fa7903.0","@material/animation":"5.0.0-canary.784fa7903.0","@material/typography":"5.0.0-canary.784fa7903.0","@material/feature-targeting":"5.0.0-canary.784fa7903.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_5.0.0-canary.784fa7903.0_1578510623822_0.8832141708823766","host":"s3://npm-registry-packages"}},"5.0.0-canary.823c050ba.0":{"name":"@material/slider","version":"5.0.0-canary.823c050ba.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@5.0.0-canary.823c050ba.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"0bcccc5d51b5cccb19d55298715b549f655c4f48","tarball":"https://registry.npmjs.org/@material/slider/-/slider-5.0.0-canary.823c050ba.0.tgz","fileCount":31,"integrity":"sha512-aCwZiXlblbIwzYxuWKSaoPqFXUz2AJStsRpPftknEEIpKEe7B07YvW3qyemFaEAa2j/v9OLLZTHvHSjPn8/TXw==","signatures":[{"sig":"MEUCIBN8RtlKcHWR2T547zQZPwJiKQirMOqwNLZ67B/FLUamAiEA9ByXC5SlHZQf4FGl8694STWmPQ3feA17525sPMPjuE0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":342371,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeFjdHCRA9TVsSAnZWagAAKWcP/0+xUlx/btWRJJ4YJaQw\nPXHt6NCHFFrOHEZmrufEwdpd/09YMnWNmiAIYRCdhu9nM0ZLjrFKOFUkFc3L\nm0LlqTlM++GK9Cr3I8O6G1tvVDhowWox+AOYCxr+c9Txr76phwgAWHu8uUbV\nyorQkLz3Ji1rgx8vZe0R2iJPua6v3cut2E3Qrgprjzh5d+5Spt9QZMghqd2g\nKdqUCg4Ixq/GqL6XHCjK+dthJAx4TDeQGqJdCQmO8h4f50mLUAKqObjQOdyE\n7hft8ozjZp72lm42lMxWncPM6vtn8ZSk7xXHE8g6bgHaJGCLQ6QOXhAwvbq/\nAyxEnpRbsCVpsXs/8ByYivjvz5TH7RcnPjGAlHP01dFTk6IaJIvrSWQeryjm\n9lBOigJPH3rwu8UxfpvDTq+hYOYhvANZZZK/875AlLPX7IQYFQyOAH4ZTyYA\nKXMZ8ll3yCahQecCrw4bVJWQKkmLSQPYrq03uJHReFP17i3N1pLXSaiZ+Kkb\n9Tm0Y5l3OERZcx1OrdhwjHKAuIbBBYQgr3qKjLzt3O+kGsnxDpuZWL/NV9Th\nSa+EHG7RvDNQg5zpvE8oP+/gX5V/419UEoovisrNXF4uhmKZY2MOMlzExX4w\n5TRnhUUpQmi5Gz1bQO+WqDaKIbRK8RJfi6ZXMRxZxpO0EyHmd5nZ4rlDoNXW\nZBhG\r\n=Tkyi\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`mdc-slider-color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`mdc-slider-highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`mdc-slider-rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`mdc-slider-rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`mdc-slider-thumb-color($color)` | Sets the color of the thumb (grab handle)\n`mdc-slider-focus-halo-color($color)` | Sets the color of the focus halo\n`mdc-slider-value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`mdc-slider-value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`mdc-slider-value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"b08bf7fb482cc6c0e80d365ea2bf510d80680bdc","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.18.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.18.0","dependencies":{"tslib":"^1.9.3","@material/dom":"5.0.0-canary.823c050ba.0","@material/rtl":"5.0.0-canary.823c050ba.0","@material/base":"5.0.0-canary.823c050ba.0","@material/theme":"5.0.0-canary.823c050ba.0","@material/animation":"5.0.0-canary.823c050ba.0","@material/typography":"5.0.0-canary.823c050ba.0","@material/feature-targeting":"5.0.0-canary.823c050ba.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_5.0.0-canary.823c050ba.0_1578514247429_0.007517418025852152","host":"s3://npm-registry-packages"}},"5.0.0-canary.70c708dee.0":{"name":"@material/slider","version":"5.0.0-canary.70c708dee.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@5.0.0-canary.70c708dee.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"d052a6cfc5269cbb9b24a5df72b7bdc846bdc7ea","tarball":"https://registry.npmjs.org/@material/slider/-/slider-5.0.0-canary.70c708dee.0.tgz","fileCount":31,"integrity":"sha512-sxNQewyWdkHKNiXtym8DRVXsQ4mBmMRSXwH9lPOuHwUO3BmGFmgBMvBP6HG4PZFaH655n13chLITtbBfWLotbw==","signatures":[{"sig":"MEUCIAfVrWJxZIIPDNHTNFyq0MXuo7baMJbXvFRaRZGlRUYCAiEAx5ElJ/Yt2KbT14OdPG4A8TdwOfDUxthn/X9j88pcy50=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":342371,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeFjn9CRA9TVsSAnZWagAAL7UP/291liCgdBXQGMi0D0zf\nktl1FlkU7QvjycE5Si8lyPrxUWsDuOCF6wI2MI3/7FcNwwqFlLX7696b3tir\nm/YABOdrcp4+HlkX+Q9PLNueSeOBlDCaa+UoqI93XP51lwmCV3jzTmZ7j2jp\nK2si5axUb8TcXKZFSUpNZ/I0AWWhPlu2IvVECBmMW63j1QiG9FeoaT9EXkRb\nrDu5qS2qpA9UgoGIf3eW5fiVI9PA4ys4we0wyOzG2KPjlRG9dxrF8lQfECCO\n/3c9aKU3ARQQeqz2tXI/m4lrenUyNg3daE8r9RFhTWr7WvDH82DNALd/dsJ1\nnpiZVQo8pF4gx3o5oZ5vcrML+Li8bM8RadA3MAwaNwbAoPKT0z6XLeg+i4Yt\nPrNdQvaGq6ahicC7/aB0hAjvWrSJdg/ufCJV4pJ3JZjn3GmxD1LUDCscyDeN\nj/XsOxVAH2x/ciBabFa5bUC6S8nIqmMPYx6nclPrIT4pqkTA1tT48KA5IW3c\ntlnJF6+vvPyLvge2x73Pl8U+hho5grjc0zXFK60OLfR8QxlJAA50a50o7ShG\nz74O6wlu9ZMjiF9+GUhF0Gxf3aC1HxpBsaxipO2rv3rD+y1HWMIv/UyeOpDM\nnRJJXYpZnnr3ZfwETJpiSz/D4FODuad4MLL5RS6oM9i1gXm0f6DdogeGc39A\nH92/\r\n=1SYF\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`mdc-slider-color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`mdc-slider-highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`mdc-slider-rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`mdc-slider-rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`mdc-slider-thumb-color($color)` | Sets the color of the thumb (grab handle)\n`mdc-slider-focus-halo-color($color)` | Sets the color of the focus halo\n`mdc-slider-value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`mdc-slider-value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`mdc-slider-value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"096bee7c4a6fa97b650100f3d0e0cb484db375d2","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.18.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.18.0","dependencies":{"tslib":"^1.9.3","@material/dom":"5.0.0-canary.70c708dee.0","@material/rtl":"5.0.0-canary.70c708dee.0","@material/base":"5.0.0-canary.70c708dee.0","@material/theme":"5.0.0-canary.70c708dee.0","@material/animation":"5.0.0-canary.70c708dee.0","@material/typography":"5.0.0-canary.70c708dee.0","@material/feature-targeting":"5.0.0-canary.70c708dee.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_5.0.0-canary.70c708dee.0_1578514941119_0.44561657531152554","host":"s3://npm-registry-packages"}},"5.0.0-canary.5ed9d13d0.0":{"name":"@material/slider","version":"5.0.0-canary.5ed9d13d0.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@5.0.0-canary.5ed9d13d0.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"470e39e2f8a7dae62b890f17ef6311a508315a25","tarball":"https://registry.npmjs.org/@material/slider/-/slider-5.0.0-canary.5ed9d13d0.0.tgz","fileCount":31,"integrity":"sha512-1zmm5bsIblokt7RBCVna38L/WYoHFSdqVFBLYya69ERnUW0cV5u595gqfrf4xtMHxeHxy6KQ8oWq3AL/zxK2Hg==","signatures":[{"sig":"MEUCIHAmo84PbjD3+DrrBQSD78MTklg0KpzKrI41S3IirNy2AiEA2FywEnMLYRbo/GPT37BLvbEz7IyeNXjsCXMYxuhRXd8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":342371,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeFkzSCRA9TVsSAnZWagAA8ssQAJxpSWksvYMbHy6E6I7L\nm9z7L4Gv9a34HOPWcZlwXDhkREcA9avqYmEdGqEDe3lXEdftKsAkPtax1u+L\nnPhe2nxaEPba5QZvo+hBgNY7P4ah2I27ne+7eyfnq8bKN6Gsy2YawvZ6dFw1\ncF53Mppw+IselqNwBnQ40DBGtC23HSmDJyABUonuVCWZNhCwUpHsmFuxyLXI\nqlHWiUaMpQW+kipmH1Vz04lD79Okb0hfarxmTf4r2ON2RBlSmE/dFOf5vsf+\n+vVW00HNW1lhyiBFbmXo9JFEfpqv7ZwKM5ulSrHmCfVWhO7Pg2hwuG3vvGdD\nII0wrbwwTNn+b/mnzOI8DxcDyAYfiZqdFhtPFNCTdBAL8wggQy7fCC41NM3u\nJZaZEBQXBTBPAkYtMPsfr7iFd8vJNh6DY3OvYgD4wAF46HWACNAVhdpkm0ia\nphSdHjSnGe7CohOSQua/Z3FZcuWW9nF7q4UKduz88DdrUQOwJcpLlplzlhOz\nrNiFdy8U1t/GOSqDazEEUeSy9XN2zRNA7cRUH2Q2W8zBNQ+Sqxy/5eJCjHWv\nu1URy49wg9N//d9oYYFf+DKho7tCvqFzrjkfsDjezn3IrhhHidrjBbLZ8+b4\nhu7MOPXP2QsW3ovHXAfgg76BuVkdrTsbKQqizpye0KFdJMQ/oHV6HzOnIneV\n+hcT\r\n=H32L\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`mdc-slider-color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`mdc-slider-highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`mdc-slider-rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`mdc-slider-rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`mdc-slider-thumb-color($color)` | Sets the color of the thumb (grab handle)\n`mdc-slider-focus-halo-color($color)` | Sets the color of the focus halo\n`mdc-slider-value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`mdc-slider-value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`mdc-slider-value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"3c9ae4313970bc3335cb0223b3e10f3fa3ee8ae3","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.18.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.18.0","dependencies":{"tslib":"^1.9.3","@material/dom":"5.0.0-canary.5ed9d13d0.0","@material/rtl":"5.0.0-canary.5ed9d13d0.0","@material/base":"5.0.0-canary.5ed9d13d0.0","@material/theme":"5.0.0-canary.5ed9d13d0.0","@material/animation":"5.0.0-canary.5ed9d13d0.0","@material/typography":"5.0.0-canary.5ed9d13d0.0","@material/feature-targeting":"5.0.0-canary.5ed9d13d0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_5.0.0-canary.5ed9d13d0.0_1578519762018_0.3034343870935021","host":"s3://npm-registry-packages"}},"5.0.0-canary.4819cc7e5.0":{"name":"@material/slider","version":"5.0.0-canary.4819cc7e5.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@5.0.0-canary.4819cc7e5.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"9ef78c3090261a548364e4b91ad440ed3fafb708","tarball":"https://registry.npmjs.org/@material/slider/-/slider-5.0.0-canary.4819cc7e5.0.tgz","fileCount":31,"integrity":"sha512-XvFrGtq0aeUAGrrPsKCSXT9u+mj48gl3TwV0TLPP56N9+6ZGpMiNim1Yz9OT0iafBK/MYxibLfy4hIAcITU1+g==","signatures":[{"sig":"MEUCIQCq2QNKNycZOf4nxckZxznQHRkdHkDOouksQD2GA9MqCwIgW7YaScqC9a8qD3S+3/ByZ5AR/q8RwbEKCgBRcIX8940=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":342371,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeFlB2CRA9TVsSAnZWagAAVuAP/1JvQyyODOVTwXCki9LR\nNF2mtFYxbGoto1j1zJh7GvouDsrejEKBoqnMW5r/lmNCEVOzkG6SnT8rxd1j\na2fGKVnAF7Q1W9WAjjC7/gSpGclddODGdFqb3rjxgO1SIsnq+9N3jqwoDsKZ\ndgMOT5ORntIeBsI+nDopcT8MW/jdTG1Qc2d9i6FZvViGpTVdjl+yk7KRQUJk\nf3Qqj/qvAWlRfME8pSFr6hmDsaqINGwD1sDchfJtLbTEva8jrkDemADu/OUo\n40doieyfSfw+aFrEkBrr/2H6leShDidtkpzRjNUi3r63x3+4PldTn3tBQZls\nUq4c6Xn9S/IKt25ko+F84D/wM54cMAsob8HBI14G7NThSiWlzlEp5RaKGo0m\nEaOMKZYjSBNKCknSJ4QomFa6ROQyMh5aEn/lcft2l6zZtkW6/IGd9wl9Yeio\n4lMF5hXyE5qkICWC74rtFif/ZfCwX28bNzyG0EQTL8wJDuXvqGI7dx/s9UFJ\nU3h6vnD1TsDSa17S/3MpJeiaix59kQtULIxUAm9bXMM6sniFnl83ZLek2zck\n1KZxtujvbg++t/+5LCB8pcegHq5AHM/a2bvQCOC930hha5g1ofKcjhzz9T3q\nk6h6PNz3S6oL7olv4KyFTXJeuOO5EPICsywKZrgbPqWU7nK0jcj3H1fcdK6e\nyV4U\r\n=hG+a\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`mdc-slider-color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`mdc-slider-highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`mdc-slider-rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`mdc-slider-rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`mdc-slider-thumb-color($color)` | Sets the color of the thumb (grab handle)\n`mdc-slider-focus-halo-color($color)` | Sets the color of the focus halo\n`mdc-slider-value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`mdc-slider-value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`mdc-slider-value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"1cdb8bd7292ce5180cfeb2b5ea0cf8eb4aa6a931","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.18.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.18.0","dependencies":{"tslib":"^1.9.3","@material/dom":"5.0.0-canary.4819cc7e5.0","@material/rtl":"5.0.0-canary.4819cc7e5.0","@material/base":"5.0.0-canary.4819cc7e5.0","@material/theme":"5.0.0-canary.4819cc7e5.0","@material/animation":"5.0.0-canary.4819cc7e5.0","@material/typography":"5.0.0-canary.4819cc7e5.0","@material/feature-targeting":"5.0.0-canary.4819cc7e5.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_5.0.0-canary.4819cc7e5.0_1578520694540_0.7906550541680757","host":"s3://npm-registry-packages"}},"5.0.0-canary.fe3ffd2c3.0":{"name":"@material/slider","version":"5.0.0-canary.fe3ffd2c3.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@5.0.0-canary.fe3ffd2c3.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"fe8b62e17a727fc4572b398e8d138c5c3dbe109a","tarball":"https://registry.npmjs.org/@material/slider/-/slider-5.0.0-canary.fe3ffd2c3.0.tgz","fileCount":31,"integrity":"sha512-rIBCilSawnOMxscYykjUJB2A/YAcRHHXeMc9dqV8A0abbDNuDq03MbPeY0TvTumH0qPMIp20LkQfKFGHfkLidA==","signatures":[{"sig":"MEUCIEU9TGoWSuTtGEPtT7mzVS3moAgDU6O1cR5Gkk5PJwG0AiEAupQ4sYo8vPcmUAlhEHCApaefpeXu5UxBF0whzuiY0BI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":342371,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeFlSxCRA9TVsSAnZWagAAYgMP/1IBa+poRv20nnhsr6Ok\nOO6XK60iKIMCbnXMu+wuk+t/D/eqk3bpHk+NlbA3ZNcerdW6XEWfFaGjYlTf\naW2LfGBZACOAqmO34A/AEP9xMSBbUwzRoK4PaVJldOi801e2sOjZXGQB2OT4\nOtFQ8ck3nBanzRLedcX4Yu7FNO/VbipZBV6/mBpz8cjiwKSSGCebCywomiVF\ngj+WFL+3PvZyEDdq1av5nW5O+TL1txD+q4HQQc8ibpshOFhfgC877odsZ3PU\nDMJdmyWzMM1sP9kANevDHfAU3LodqL/aMh0hv3Vspxv1DdIY3DCW2dltFKN8\nGIjv/23jBbUaewx3HtYu3w1dVr4troaLrFjT3mhSRLH9oXX1XePF7B3U4tUN\nxn765ijuHGsQU1W4kFVASb0zGEAG64TVJFN+IN8LuyHEE3HEcPF8g0CAqzFF\n533Q5wVuTSmZ9HQtOHotjUmbS/FzvjqXypEB4lntSHLDkiIF3ZrD6G4Kl7Jw\nC0mdpsBuXbwBKY/mZrJeDi18DqKyMKkqVFD26xjmbpMaDC8eoOhhTRtwphrz\n0E7t85vknd5HDG+EPBNi7Y9/G1N6ix7ggMXJYnNurWK1aN+ZGzgvGDRcNwb5\n9333ILe1DiX7FEv4KSXVUEa+dLwvToWWIQPwPsRgeyWG+whcv+bCZQu4nv+z\nzsUX\r\n=Htz6\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`mdc-slider-color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`mdc-slider-highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`mdc-slider-rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`mdc-slider-rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`mdc-slider-thumb-color($color)` | Sets the color of the thumb (grab handle)\n`mdc-slider-focus-halo-color($color)` | Sets the color of the focus halo\n`mdc-slider-value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`mdc-slider-value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`mdc-slider-value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"ef82dd049d6c2d6439fc79408aab4567780d26f3","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.18.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.18.0","dependencies":{"tslib":"^1.9.3","@material/dom":"5.0.0-canary.fe3ffd2c3.0","@material/rtl":"5.0.0-canary.fe3ffd2c3.0","@material/base":"5.0.0-canary.fe3ffd2c3.0","@material/theme":"5.0.0-canary.fe3ffd2c3.0","@material/animation":"5.0.0-canary.fe3ffd2c3.0","@material/typography":"5.0.0-canary.fe3ffd2c3.0","@material/feature-targeting":"5.0.0-canary.fe3ffd2c3.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_5.0.0-canary.fe3ffd2c3.0_1578521777328_0.07434303642318407","host":"s3://npm-registry-packages"}},"5.0.0-canary.c0e850090.0":{"name":"@material/slider","version":"5.0.0-canary.c0e850090.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@5.0.0-canary.c0e850090.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"934460afb8182f490bd697460380734bc42a3cb8","tarball":"https://registry.npmjs.org/@material/slider/-/slider-5.0.0-canary.c0e850090.0.tgz","fileCount":31,"integrity":"sha512-e0BfQVALn8D0uEUzXHwhe/5T9VzZJcRwset8m1N3mAlusFNkG1xsV3UPzn56zsWxcS2L7ey5LrbkYSJNSQhhLA==","signatures":[{"sig":"MEUCIQDnLsiysIdRc6qUKe7fA4iB+asAaFLBkEEQqNvDR0GNAgIgUh5fU1g1a+P70fpZ1Mt0Hg3Xjmsi/b1iXxLVlTQyPFE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":342371,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeFlZUCRA9TVsSAnZWagAAthkP/iekQpKwTMn1Bwd5yeoC\n+jS8iY6r8a03S5z8Ut0AmfX3XfvMgXmnL/SRAEj0HFEawfL6BSmpJ9PgjpQt\npZncJey+j27IF+wGPtojsZBcigrcVqZX2VC+17u8WZvkAmbDqc9k6G4y/K86\n9wMIPN3XAlgPyOIPMHAme87cWdnCUhsuQrxm7A21mzIy6wxq1uLNneNPvKGk\nWbo9/s6QHQ3x7IOKhnni+e+iN7liwVgmK7iW6IqS90UuOAuKBHoeNAqGEYUR\n9RgeeIo+I3kKf7ZlgpVz4SB305lY8JnyjkUCHNDvqlVQzKWnzi35zrmLB1Hd\n8RIbGoxBuSIqFnYo7J3zhRIw28+n2FlHGBEsKaqGLSvaFTTgbYQaJ5hy7W2U\nP/f4ywJhC/AgZ8DUwD8p6dRPo1hqs2QClvbFAgNc3y931X6vy/6JwGFcOhwF\nTdZb10KTMC/klJHJGQahSUdf4bP5TOg7HiHXuPK8W++OhaXV26e3qZ3IYfW3\njTOkczByqUZC8K4stAtSlG3vGrQaIgQPmRBqVVH4IJZzfHV7gsoJJHW21ZjU\nUymNLZChLqlwjJw5h1DhbxtetypOMBEl/5WsIa1MDGQRBiMcnz2Y+C0u7T42\nFREXWDBXtiW0zKT+NZkyuLRLEo6DVJGwjDwkTkmzdyEAxWkQ6U2NgkJz2Zrf\n6MMm\r\n=FliX\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`mdc-slider-color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`mdc-slider-highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`mdc-slider-rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`mdc-slider-rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`mdc-slider-thumb-color($color)` | Sets the color of the thumb (grab handle)\n`mdc-slider-focus-halo-color($color)` | Sets the color of the focus halo\n`mdc-slider-value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`mdc-slider-value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`mdc-slider-value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"04d9e991ccc9d40d53d67d592c9532cb43e763a5","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.18.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.18.0","dependencies":{"tslib":"^1.9.3","@material/dom":"5.0.0-canary.c0e850090.0","@material/rtl":"5.0.0-canary.c0e850090.0","@material/base":"5.0.0-canary.c0e850090.0","@material/theme":"5.0.0-canary.c0e850090.0","@material/animation":"5.0.0-canary.c0e850090.0","@material/typography":"5.0.0-canary.c0e850090.0","@material/feature-targeting":"5.0.0-canary.c0e850090.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_5.0.0-canary.c0e850090.0_1578522196145_0.6024834768263461","host":"s3://npm-registry-packages"}},"5.0.0-canary.615f86f38.0":{"name":"@material/slider","version":"5.0.0-canary.615f86f38.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@5.0.0-canary.615f86f38.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"58852a15ca226f9e5b739b9271fe0e1152a1584f","tarball":"https://registry.npmjs.org/@material/slider/-/slider-5.0.0-canary.615f86f38.0.tgz","fileCount":31,"integrity":"sha512-NQ7lyY86ibWlNoaMK/5xVaRmO34M1Z2u9WBk6GNNtNSEM0EG4KTrufg4JthwR3CITIHIX7y/TVG1uO4WRZtciA==","signatures":[{"sig":"MEQCIFccTlaCO6LRsP50pJMfi/HShdx5XfEDC1XxS9vJe07XAiAS33t8fgWpcvHnRyRpxuFI7Uo6sgJ4gFq1Nn05CWw12Q==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":342371,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeFlpSCRA9TVsSAnZWagAANoAP/3kGSFuL96ntfDSYBe7f\nxfgsjSqXboUAXZmDdCl8jAv8iKZSKsy7YrdQ7hU5EQUa3X2j2uau5pUV2t8c\niz7WS0ZmpAbBnyIoMUMAM2M3slL11/J62jCnb1mz1jfcwHBQgz4bkCeOPvju\ntTeKPcnBS4dGF4oBCit1nSXtdioSowLz2MiobixstTZcazUTzCq9sRn4dJnB\nEFJCGzGp6scg6WIFRvAejaaXlkKOfMCZQcxr2YrXYW2bbtNPRoRlydwcAG9t\nxO6u/4gV35RqBGabyN1nSpDb6zXuEZpMADrvQyxrBXcjybwZy2D5apehpIw8\nJ/Ab9Zmpcr/zlWJPjOZBqGloMJgXpQ138SLcQq4JBmJ+zH+PeGT1Dw/kCxIA\nlMtL8afGDdl/P/B+1GUs2D6HbVfUfES/LXgPcr1M9y4npxDev0GbtE89z911\n000Q5pSkWHZMqV5SvHYkM8+m5LY/RI32IZ7LQ2hFey5r9T3blhNJZm+HPs6y\n5p0zosWU+1QvUJyMRB3/8Q29qTpZnq4Af8QzGovE7mTwwy/EptuQ3lRWHi9S\nPrctpWELd9z2Y0GRmqPjlUIqdrqpkQk7FEemBS8FpLATfkX4QMj3pMJstbzy\nls0BJds4V26x5d3+VVSluXPW3UdD+dCea/jfVx+OmfnzTv0A4ke9U2esbPAa\n8Rij\r\n=5aee\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`mdc-slider-color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`mdc-slider-highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`mdc-slider-rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`mdc-slider-rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`mdc-slider-thumb-color($color)` | Sets the color of the thumb (grab handle)\n`mdc-slider-focus-halo-color($color)` | Sets the color of the focus halo\n`mdc-slider-value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`mdc-slider-value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`mdc-slider-value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"5ae8bb946c188918a80b70e03e7d35b1e27089e3","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.18.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.18.0","dependencies":{"tslib":"^1.9.3","@material/dom":"5.0.0-canary.615f86f38.0","@material/rtl":"5.0.0-canary.615f86f38.0","@material/base":"5.0.0-canary.615f86f38.0","@material/theme":"5.0.0-canary.615f86f38.0","@material/animation":"5.0.0-canary.615f86f38.0","@material/typography":"5.0.0-canary.615f86f38.0","@material/feature-targeting":"5.0.0-canary.615f86f38.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_5.0.0-canary.615f86f38.0_1578523217943_0.511422822441856","host":"s3://npm-registry-packages"}},"5.0.0-canary.1eb032637.0":{"name":"@material/slider","version":"5.0.0-canary.1eb032637.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@5.0.0-canary.1eb032637.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"a3f2ea259f47856be77d8bfc770c83363ec2ae5a","tarball":"https://registry.npmjs.org/@material/slider/-/slider-5.0.0-canary.1eb032637.0.tgz","fileCount":31,"integrity":"sha512-K2hA57XvW/6Pt1xxTovjW+v2el91rmxQBcdv9RE1Ih8V1e7vK2qsfCskNyPirO8YTvQyH7kRYLZyR3hTnhYwyg==","signatures":[{"sig":"MEUCIDWjiMEu/6a5D/ekOcyPR5Nl9tESGOMfAWwWODXxzG7JAiEAhb7M7hUcQpexlmd8rYlqSwfgihhvzBgKiBLuAxSwTQs=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":342371,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeFl7yCRA9TVsSAnZWagAA1+QP/jpSeXY6AZYrvtKOrSQs\n+BJL4kogV6622fjUMIAxoUQ3CaS497HMLzOkgEIJfuvYH5MPK+Aka8CjrHi6\njnrYYJdO6z/zWEYHpmZxO7rT2pYn54Cun/ACN/nnV8/+Wo2X0w6oAKqqMSFA\niZiLsAPtNTnOysYKOR0//dxOFlTZf2o8UvRrekenlxGSn86/G+cgFSS7VzUg\nOnomlt8tZvtLxk6ydUpv78dnhv3CI0NDrl7WSLyJHYipVgw2P0DKWiUzSOca\nInOqM/zYRqyrFCTAYZqQiOYiI/qQCZ+Chzv5bwjY9YlT2WrjIIQJb5UGj4gE\nSVF/0httNA3GtQhlQkZm+SIREuxRnhBetVNm8c2rsZTSHEmIZxeHFPzcLrF3\njj9JnNLEiUoxglxPDferHCNMcrck8SbqifcBFNCCdvzrkPvPHPrVxICBgaXO\n+g1biaVCGWpNMzGsELgIrIZGLk6jxuSVnebkfvpqqR4XPdvryU2c64O32NQ6\nLp+3G0hFKqEOAwH4pMYr6OsVT/MihBB6aQ36Znm+cg8hLQYR2CZ+u3mrm76r\nuv01spINRHPfG50Iihp/txFSVBzkLVJM8B8pouT3C0CoLEIMYyz1k56pi8zF\n8GnAduQuFwgKewhOKgu2n0ZT49T2V7RDC8HbJdv3mV9uag0NgRujQvfeU4vR\nupqH\r\n=Q+OJ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`mdc-slider-color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`mdc-slider-highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`mdc-slider-rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`mdc-slider-rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`mdc-slider-thumb-color($color)` | Sets the color of the thumb (grab handle)\n`mdc-slider-focus-halo-color($color)` | Sets the color of the focus halo\n`mdc-slider-value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`mdc-slider-value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`mdc-slider-value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"ebd5efe5771491e06a78d3b1ca6b1af49af8e943","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.18.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.18.0","dependencies":{"tslib":"^1.9.3","@material/dom":"5.0.0-canary.1eb032637.0","@material/rtl":"5.0.0-canary.1eb032637.0","@material/base":"5.0.0-canary.1eb032637.0","@material/theme":"5.0.0-canary.1eb032637.0","@material/animation":"5.0.0-canary.1eb032637.0","@material/typography":"5.0.0-canary.1eb032637.0","@material/feature-targeting":"5.0.0-canary.1eb032637.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_5.0.0-canary.1eb032637.0_1578524402504_0.702871617142321","host":"s3://npm-registry-packages"}},"5.0.0-canary.5bc5ebfea.0":{"name":"@material/slider","version":"5.0.0-canary.5bc5ebfea.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@5.0.0-canary.5bc5ebfea.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"0cfa2eeaf18a621f263bc14b70e1ec9179afb8da","tarball":"https://registry.npmjs.org/@material/slider/-/slider-5.0.0-canary.5bc5ebfea.0.tgz","fileCount":31,"integrity":"sha512-1dKPKmVlO8XAGoxHGS5wlh98rNaGJNIH9eboDlshclHIsWo4a9lJswg60DUPai+7xYRwtGjVjAWuqf8vWM7BXg==","signatures":[{"sig":"MEUCIGXb+LWs5i9RW78da7Bu8+isycegoFnwu8PIpAGryvMNAiEAs/hKVI/Puwtg+ukdB/dRRx06mooVRXxYZ7cSdPFHZxU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":342371,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeFl8lCRA9TVsSAnZWagAALuoP/0Niy5fyN7kopygO3CQh\nufQsL+AW8YM+OdV0RJ1SkkO2aVF+ebrtGBXBtbtWczSS5mQBG8JoRBpqTPpX\noF5NgYbUPrD+dSzNUpShzwHGvPVp3cibLIjcRe1MxmVgYiORsvx6ss1kEh8i\nRv9FspWa3uCvV7zyi6O+7ZEjUINRH/fQp/E36Sn64aPvNaJlRXegxSpB0OFt\nSBQ9Fi1uOLSjzDlWD/zaA31PAMjjrNdl2Rm7A9jg4uzGezRhCIVzETHXE/iP\nqvXQGb0s/AtVO5PFijmJLaYMe8UAvz3qcnptf7m13cCHXASBRvGxT/wEOZv+\nKBg1ElikuRMTXb/AG3Wp332x6+uJwX+OqcNyqj9PiZtAOgOZYN9csEpl7JGs\nvCpU+sC+0Xu3oq7jNpl1rQlhL+DqrcaNvh/FAUxt+i+kmP4ScLnmvP0y4Gxh\nsHIz5lRVePg4KrAF6QRJjDtJEpjlzouMTb0HhK0qd5ViI9pwjrD+jtbShV41\nfUG9kGcixlkWH+vvZkTMB2jh70atneH240uMXXVhxgjrXNdz+mrSsVQebLDC\nM8nGg/fUhU5bAVAcI9pYULrs2ZmS4Go575PeV73VU/NBL7UE5sZnF5U+ioM6\ncgnDvweWWtNfgPJjy3coovZIEFteTVCNksfyMO60AkX5oK9gH8pU6Im58dQe\nuPsC\r\n=gHsa\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`mdc-slider-color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`mdc-slider-highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`mdc-slider-rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`mdc-slider-rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`mdc-slider-thumb-color($color)` | Sets the color of the thumb (grab handle)\n`mdc-slider-focus-halo-color($color)` | Sets the color of the focus halo\n`mdc-slider-value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`mdc-slider-value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`mdc-slider-value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"8d87a9536a0b9e4af0865ecc4d9b558a6c193f33","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.18.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.18.0","dependencies":{"tslib":"^1.9.3","@material/dom":"5.0.0-canary.5bc5ebfea.0","@material/rtl":"5.0.0-canary.5bc5ebfea.0","@material/base":"5.0.0-canary.5bc5ebfea.0","@material/theme":"5.0.0-canary.5bc5ebfea.0","@material/animation":"5.0.0-canary.5bc5ebfea.0","@material/typography":"5.0.0-canary.5bc5ebfea.0","@material/feature-targeting":"5.0.0-canary.5bc5ebfea.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_5.0.0-canary.5bc5ebfea.0_1578524452928_0.7818851912277829","host":"s3://npm-registry-packages"}},"5.0.0-canary.1112b8def.0":{"name":"@material/slider","version":"5.0.0-canary.1112b8def.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@5.0.0-canary.1112b8def.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"cf73905a92499b12e04ca296b47ef02b3cbefcba","tarball":"https://registry.npmjs.org/@material/slider/-/slider-5.0.0-canary.1112b8def.0.tgz","fileCount":31,"integrity":"sha512-p38c38OmGo4W2DLIJREv4buJSdHAr6cEkMpLk3iF/JsSC6H3KxPVmqa60mmZvHSz1nJRIvEgEBXe1iIVwwUoXA==","signatures":[{"sig":"MEUCIQC9+RvB77Ww+lMitDteaxz/mrQYViZhuZMmHuNQ4XXeZgIgCw3U/lRpHkv1jSf8LQobprJ8sKw7tYSdd4SUnKcI5lo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":342371,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeF6TKCRA9TVsSAnZWagAAOVcP/0TH/RKBFoepnpzWz16g\nOdfn/xp99LzDWdKE+CMfHhtalseVhXl09r+331fYi5GrDWNnFzDPB3+/eUlh\nMPbUwP1rtLBU5zyZ79b2dEHIwC7X0lgZh+eOw7r0KoQDgeJ6Pq2AlZ+nmsu+\nMnz1C0tt2e9k6dc/Q6361UptO7AX+JauqyNTlYWRtS/ZFEBJn8lZKChoycrM\n4zyuwgQEt02cDa01bjDICKblQNbqB4SeOW+IoS7sMTlBCjuXSunPTDb6pd8Y\n4IWUpRqY7SwBiijdegkkgyZKWp+DJJBt4nN2OP3pnVs/3IX+qAn5SBJPsKlS\n29zlWDsUimKQsNqmolPfgZoWW+47/lfSWy03ZFR7kHjMU5TdeD8IcQ7Zm+1r\nDJZOng/G54g/PyirY0xl5OzRJgI6ZeMgbY7y6wtpGFvem3i0+EbvO/yqgYgq\nPqdCxb3tY//t5Z2UAHlNfKhnvFwVCU/CPXw2jZfURtAS0XARW5RVkP0UlJu2\n8BTwFpjlgnL1T6AzWKE+i7U1cPdC591kXd0QW4NaJnLN6WmHg9VfNRK9xuQs\njfKsVPn5ei/cMpK0PeOytlzzCfWuB9Ytd49Y2uk8mwIwGUtdh7PKM9cWt6nL\n4iEJRr39YmzAp4XkC1ANxJRiyBQk8NXucRA12N2emZImS9R/IAZtIq28/7gW\nNSdl\r\n=TPHa\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`mdc-slider-color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`mdc-slider-highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`mdc-slider-rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`mdc-slider-rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`mdc-slider-thumb-color($color)` | Sets the color of the thumb (grab handle)\n`mdc-slider-focus-halo-color($color)` | Sets the color of the focus halo\n`mdc-slider-value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`mdc-slider-value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`mdc-slider-value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"3fdcad176780c1976528d217d2fb149875bb4b03","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.18.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.18.1","dependencies":{"tslib":"^1.9.3","@material/dom":"5.0.0-canary.1112b8def.0","@material/rtl":"5.0.0-canary.1112b8def.0","@material/base":"5.0.0-canary.1112b8def.0","@material/theme":"5.0.0-canary.1112b8def.0","@material/animation":"5.0.0-canary.1112b8def.0","@material/typography":"5.0.0-canary.1112b8def.0","@material/feature-targeting":"5.0.0-canary.1112b8def.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_5.0.0-canary.1112b8def.0_1578607817948_0.5203852338041097","host":"s3://npm-registry-packages"}},"5.0.0-canary.aab102017.0":{"name":"@material/slider","version":"5.0.0-canary.aab102017.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@5.0.0-canary.aab102017.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"b00f27401129cf7465e85ed158400ff7acacc0d3","tarball":"https://registry.npmjs.org/@material/slider/-/slider-5.0.0-canary.aab102017.0.tgz","fileCount":31,"integrity":"sha512-ZEeit9LH4capBBr2xCwKp6F23rcLOTWULEzICI9+mzWNnKbPu2tv7zVYSu/FCFxlKyrTBdUfqbEEt6CIImsC0Q==","signatures":[{"sig":"MEUCIQDm++/T0GiHAjD3w0HMok9vvM4fi1zBH6G69YGa+bBJcQIgdoFP0AI8ClvHZw6cKXfseVkwOIIafHonRaCuuGIa8DI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":342610,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeF8FoCRA9TVsSAnZWagAA/8UP/Ry+i9Yx4tRltu+fyLAu\noe+j0ac03t2GjTD79b+4fVRtubkfDt6mu1yPZW/Hg1D9uNGbgUe+H1/x1Gh2\n9+zdAGNwKxJVcpdtBl9o/TqnzxXljGxRSRX9y5mayjqkts6E8it7xnB3GzvB\n5SNN67Dm2RLYz5x+c5iFKXBtpX0gkGW3Gh/aF30qwUBdhEKOgVAznQRgP5Of\npwmof11vblg4qgsnxA+fKd4wOKJeNOlIoe4tIQ5qvEVKPLAyov5mXu32kK43\nbbnSo+oXpOAN1RFESzpbInBWnPpLpN2ovz/3puHOiuHJsTcyl4tkG73mjCSW\nsfR97ap73PPTjfsqT3OjP1hU8i4uzXJ+wA9/rAk3Lqd3lsJtqSMwEl9pv+6/\nMGQzuw3bcEGrkHTwg/neiONc+VOHUuRakbWiBYIPIb9VwoCNuyWI4p2XgCiW\nWNLbHbH/Spwj1uG6avIWzT66EGXALrJdxE3+eycDL5TUP9gOWupW7C7oFDUG\nupjd+yGqWS82ii1nya2LcfHS1Xpc93suVGa4QLz9YCVuaEFniVt2pZdBL2py\n0SisllGUnzv6wVt5aiYCTPQahu73NTsSFX59ErCiwgs8wCdYJfL0rnuu5DRh\nbAvo2nmfG+5so4jWJj+3iY0dOeugN/ENdt0DcxB3469nUVF44DreDCRSmr/B\nOlID\r\n=5F0R\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`mdc-slider-color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`mdc-slider-highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`mdc-slider-rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`mdc-slider-rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`mdc-slider-thumb-color($color)` | Sets the color of the thumb (grab handle)\n`mdc-slider-focus-halo-color($color)` | Sets the color of the focus halo\n`mdc-slider-value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`mdc-slider-value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`mdc-slider-value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"3f5eab02080f0c4fb48614a44647ed55d55eb9fb","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.18.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.18.1","dependencies":{"tslib":"^1.9.3","@material/dom":"5.0.0-canary.aab102017.0","@material/rtl":"5.0.0-canary.aab102017.0","@material/base":"5.0.0-canary.aab102017.0","@material/theme":"5.0.0-canary.aab102017.0","@material/animation":"5.0.0-canary.aab102017.0","@material/typography":"5.0.0-canary.aab102017.0","@material/feature-targeting":"5.0.0-canary.aab102017.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_5.0.0-canary.aab102017.0_1578615143971_0.2005951251081044","host":"s3://npm-registry-packages"}},"5.0.0-canary.426913342.0":{"name":"@material/slider","version":"5.0.0-canary.426913342.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@5.0.0-canary.426913342.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"c12c91548340db4f2f0780abfb8c302677c980e2","tarball":"https://registry.npmjs.org/@material/slider/-/slider-5.0.0-canary.426913342.0.tgz","fileCount":31,"integrity":"sha512-DKSKeuPrLhifhLwWl48nxgiZcy5N1isGWxuvh0gZ3T0xolgodXrlqEyZL1Z6/jwrAOpmRGGFGQ6blctS4qJoIA==","signatures":[{"sig":"MEUCIFi0c7z1v66+c17/gCF/yCjaU/YWcXAH10cQJLVWMrNFAiEAw/dhJeoEMyUaQ8ElO0leQkKDts835fMJn/JjnC8mIh8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":342610,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeF9bwCRA9TVsSAnZWagAAfBAP/12YgsTz6NmmKY3xWs4F\nh/mVYzneWicMIOpvuB9jZegWGNyIrPLlT6OBvzqfvkX/EZr0WF/BNlpLrtCG\nzgH+gW74j+fTVT/CLIf3iJRlF3ru13e/QYboPidvqeyi6S+FxUhCErDLs6yz\nJ66iB8QL6CQeEX0tnamwwnuttrI6A0l9zhoEXqv+V3SxtsXDn13Cmi631ch7\nADeeFy1CUUTh1FyyWj+s6gyNC7ugYL7u1iv8bPMcwBrPZGwRhX1CcfFFtnuP\ngd4aMWgtl90uxifb6r+QuXa81GoxSPU2ZJhtyStvIvil9DqJ8MruIgFk9bFV\n1Zq7EIt2H7R6paeQjVKgOsvdIV9J9vWP3Hm91sfPRYF+sECBt8P3ttGznAje\nsLAVtSpbXp+0BHfx70hDz/IbOw38arvNgIEPRfNIMpp81ZPSoiGwNc7osWtJ\nTKOc5pjIGTC6uIrArTtzWtwDLofDWPAEJVfOoLpxqwUKHpxrCqhMSZfSp9Oy\nA8Usa4xOBGYHNjWvH5ESAg03qDAqfdz9IvanfwgsfS3nDl+U7WGILSY5dxZh\nvB3wnlrq/m4b2Femxej6yiDOqtJ2IcwKcwxVwIxATPS84hrHEHi4b9kg4n9p\nrJbOSN3yIrMCK3hwmjjg7jCEbT0yEVRMZ+CV5CI6ImDFTE4qM49lBD9y9+Mu\ntIEN\r\n=n+UZ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`mdc-slider-color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`mdc-slider-highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`mdc-slider-rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`mdc-slider-rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`mdc-slider-thumb-color($color)` | Sets the color of the thumb (grab handle)\n`mdc-slider-focus-halo-color($color)` | Sets the color of the focus halo\n`mdc-slider-value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`mdc-slider-value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`mdc-slider-value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"7a6219dfe8ca1677971694ece39ab423ee8879b3","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.18.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.18.1","dependencies":{"tslib":"^1.9.3","@material/dom":"5.0.0-canary.426913342.0","@material/rtl":"5.0.0-canary.426913342.0","@material/base":"5.0.0-canary.426913342.0","@material/theme":"5.0.0-canary.426913342.0","@material/animation":"5.0.0-canary.426913342.0","@material/typography":"5.0.0-canary.426913342.0","@material/feature-targeting":"5.0.0-canary.426913342.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_5.0.0-canary.426913342.0_1578620656195_0.1003916820027595","host":"s3://npm-registry-packages"}},"5.0.0-canary.d4ea9a706.0":{"name":"@material/slider","version":"5.0.0-canary.d4ea9a706.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@5.0.0-canary.d4ea9a706.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"f636cde2fea7de65b73cd92cfe137574529a88f8","tarball":"https://registry.npmjs.org/@material/slider/-/slider-5.0.0-canary.d4ea9a706.0.tgz","fileCount":31,"integrity":"sha512-34hqqvYQW7gc5Ixr313LGDHmR0bYLWOWguW2mDRel1ggTfTBP2mRnTbwj4nomLkuxlQmgt7t5tCsOcYaJlhOYg==","signatures":[{"sig":"MEQCICXrYXTH8lNS4m5tlUjiWam4sr4KoL2JS+2MrGYAAxuqAiBLCIXmUskYF+UGfgHCzii+mczdgS8NtdSZ+lLDlSwixQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":342610,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeGLOGCRA9TVsSAnZWagAAn/0P+wXFCm7gW1T2YIBwBZ4Q\nfmBDc5ZZl6YpzLrf9RizvcFvOibAkKPf/VBVfKVTavxBid3GdrIFsNZ+TmR8\n4CtJnt9NsDXIhMHtA2D/jvg12+UXI7QNk4ZqddXloQFsTdJuGq2rwlOmq+ho\n6Aucv4c2ugIBAPtdUgarI+wxy8vL+IuFoiWlOifwBp4acRN3Ss0l0EoR68uc\nk3n4IUKuIw4eF18u1lKlaMoaCGWk9rMO9ETqwNkshNrLQfESiwaRfebo8JkY\nzdPJj7mjt1mCiQ1NUtYpVvBrNFtfaUx75xC+VBiAH+r8XCjCdZw4vXzHx/Gn\ne/5CaKgUSFTQvLVem7MaY5tHg3NBeUJDowyIBnRWFlediBA+O9d3eilYeGvu\nO7Bgd53mqwEIptdRzuVA45oUk9G/ntl/+c/bJESIxRDAJZBd0yV+g7pT2lMf\nFNPXEU7XOEwv+qeK0Km5xpOQt+jOJ5qlYMQaTrUq9PL9qbqGXT2VPNvsJ25F\nlR6HXmdfNPCHsrAAVnkFD5UjfTf/73gYic1qxiepXm0dudK5qtBPFLinZQaz\n7ICwJ59tnQbfaKHwbEOXBsHwrfbmS4ELnk+UgOAHksaS37AUJcr3zOpR7nr4\nVxYO2vfOiaJpDXC/Wo9ZmECPUjCf5jbQIee5rXx4Aau/q1dUOXvilhusYdi+\nbn6e\r\n=Fo5e\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`mdc-slider-color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`mdc-slider-highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`mdc-slider-rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`mdc-slider-rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`mdc-slider-thumb-color($color)` | Sets the color of the thumb (grab handle)\n`mdc-slider-focus-halo-color($color)` | Sets the color of the focus halo\n`mdc-slider-value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`mdc-slider-value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`mdc-slider-value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"f4f80c96af6c2e34c34a3ed8f01c1858ef738935","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.18.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.18.1","dependencies":{"tslib":"^1.9.3","@material/dom":"5.0.0-canary.d4ea9a706.0","@material/rtl":"5.0.0-canary.d4ea9a706.0","@material/base":"5.0.0-canary.d4ea9a706.0","@material/theme":"5.0.0-canary.d4ea9a706.0","@material/animation":"5.0.0-canary.d4ea9a706.0","@material/typography":"5.0.0-canary.d4ea9a706.0","@material/feature-targeting":"5.0.0-canary.d4ea9a706.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_5.0.0-canary.d4ea9a706.0_1578677125797_0.12814129302307808","host":"s3://npm-registry-packages"}},"5.0.0-canary.7d4ee2996.0":{"name":"@material/slider","version":"5.0.0-canary.7d4ee2996.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@5.0.0-canary.7d4ee2996.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"ba3905c71149d88fb809be591cd67a2f2fc2cfb7","tarball":"https://registry.npmjs.org/@material/slider/-/slider-5.0.0-canary.7d4ee2996.0.tgz","fileCount":31,"integrity":"sha512-goePPg87fpGF6cy/HbhoTKICnESIwDXSoSPFWy8M5F6p0ZZ357O9vHRl+AojxsT6oXNKPiqzzDab7y0BF93gDA==","signatures":[{"sig":"MEUCIQD2ukEHw4+vVhcZtgxDc5aj88Lx35vYVcLby8lxKxTZOwIgYx4Y8SSQIRYdbc+B2YlLHbKNdYp/B79TjgEZVTQGR28=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":342610,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeGLrpCRA9TVsSAnZWagAAG9MP/19+CsPPpOxYMkCBcCXo\nKw8CcStNglOsPUMgGuxX8XYQM6CHD71RUJ+zpgXsIY0MFM9LdnVPO/x/WvLN\nWbaf6LcOXf4/F2vooe6bHPcX/FjyBGOgn+ZHKnn7ZevKVNJMruKtt4niGwlP\n/+0aWbJz1s8KpzC9PfndTqmGIxtzDqFy4PWU+OsLD02vsMkHLrs1e9jX+mDa\nIFCSgT0b4JGa70HHGzwWylX+wIrCXZcxt3jH89uUtH/aSlXmDcmwoQKy4cIt\ntjqchJ5EQAOyuHDZX77dvX5Crc80dgOEax9l54Xr/xN2aZsQM5t612qr4HVN\n90j3Huc1cFL2utZHeKyfznlONjGxm8t1sLzHFvvXfWX0us7eqozUZI5MHgrG\ne+/nDKErs1JKHFBcyEFmqDCuPA+XKPUSIrQfgb9dAI6yiP8Ky/dZLpSb5d4R\nGgWAb07h5HxO3gM/Z63j6NRv13e/Yqgl525IdmF99c4eWTlGCP6jSL6BRTlM\neVCQ2TlDNl2ul1UJBLTknBS8PuAl7uQ6cHYdltS7kzr3BJy/Kvn+y+WTccXN\nlYG9IbIwYL+Dtmrl3ACQsX9gR9iitZTWRYUqqYeIlxSmHFhfdcI+K/L2CJq/\nVkU1t5ZMKtHbhzcKG4maSjHvPNiUnbwdtm+riTb6i/ml1Tpsp6NVlVZoz1qc\nFQo0\r\n=fmd6\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`mdc-slider-color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`mdc-slider-highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`mdc-slider-rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`mdc-slider-rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`mdc-slider-thumb-color($color)` | Sets the color of the thumb (grab handle)\n`mdc-slider-focus-halo-color($color)` | Sets the color of the focus halo\n`mdc-slider-value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`mdc-slider-value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`mdc-slider-value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"32cff7b459a8aa1e335c6ccc84213cff0f6e66a9","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.18.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.18.1","dependencies":{"tslib":"^1.9.3","@material/dom":"5.0.0-canary.7d4ee2996.0","@material/rtl":"5.0.0-canary.7d4ee2996.0","@material/base":"5.0.0-canary.7d4ee2996.0","@material/theme":"5.0.0-canary.7d4ee2996.0","@material/animation":"5.0.0-canary.7d4ee2996.0","@material/typography":"5.0.0-canary.7d4ee2996.0","@material/feature-targeting":"5.0.0-canary.7d4ee2996.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_5.0.0-canary.7d4ee2996.0_1578679017282_0.842867278455639","host":"s3://npm-registry-packages"}},"5.0.0-canary.981ec9b6f.0":{"name":"@material/slider","version":"5.0.0-canary.981ec9b6f.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@5.0.0-canary.981ec9b6f.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"008d3658e430d5b1cd83aef16a8c362b1a2a7c04","tarball":"https://registry.npmjs.org/@material/slider/-/slider-5.0.0-canary.981ec9b6f.0.tgz","fileCount":31,"integrity":"sha512-rrTZB9jjgeq4DLvHsU8qTLUMT4jONyhl3yWYn5iKMjBo6KeoK/UCpCdL9Ev8TdmAHniUP3DzSNncjFOCzzpkyQ==","signatures":[{"sig":"MEYCIQDZiYMJFXKPEtVKpZQl6zYss8VzB0+7bH51+vrAvMkBIAIhAMZQsBm5VCvm/5t/gaBorH4B7ofFotr308QsY3SlJvwI","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":342610,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeGM/yCRA9TVsSAnZWagAApmwP/016qL6Jz8yS1h+1qEu0\n9yNagTvJ/2C4G9kFfbRwkvgycfxF5tBPTOjBdVAF+yWCRsXVCn/7xW9a9fCZ\nF8a1Vbc6eKqqcvHa3U1ebSb4xd9vSXluPjRPbwvGl2ZVvrfibRCBSEJk9RbT\nosqZopA8jQs7NT/1xNElWxWtuj6n0YBHQUSX552pfQi1H6vtuerVUaB8SNDN\nPOeT7LaUbY96FN0G1XByf28L6Cv0n9wTONml4HnKnp/LiSHeJAKeb2EGrEil\nyPlyQ13+6o3y9KJN5r0gi0n4kUFBKKGYe1tF2ldq+NgswTDnk+mPRoDlnVy7\nuMiX8lftfLZI3gzPbXHTnlbX09z7w+MkzNJ2Rr+IJzpQoXsgTz9zb+OkLUfy\nYG0WMfL/2Jx/aebImzKnjDOMQxM5fQ7qLRQlv9lsmCg7mDTVT0KFb3qio7B4\nu2gfBGNFAwwNhNM0aNKjCrqerNTsHZmL7fb+xcjscFYlo3B4CEUB0UBbEAU9\nobrswoBpL9XEsr6s1Iarb7lVe0EN8i1zef3aJoURgeuvdtX/2JzjX98cQ0ht\nu9kTVhcnQler7Ernr37YhqZbfihlWor8HmuD2wfm3m8dtMc9Nj1yqhGjdm0o\nB9UaVTExyyndmdp0y/EbSnD4L+baBB3jhmfVg7L7/qOyEj1UAJJQIMTXR+lT\nog7T\r\n=8pZN\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`mdc-slider-color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`mdc-slider-highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`mdc-slider-rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`mdc-slider-rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`mdc-slider-thumb-color($color)` | Sets the color of the thumb (grab handle)\n`mdc-slider-focus-halo-color($color)` | Sets the color of the focus halo\n`mdc-slider-value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`mdc-slider-value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`mdc-slider-value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"e2e9ae33775d14566dd45608f66087b2761d454f","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.18.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.18.1","dependencies":{"tslib":"^1.9.3","@material/dom":"5.0.0-canary.981ec9b6f.0","@material/rtl":"5.0.0-canary.981ec9b6f.0","@material/base":"5.0.0-canary.981ec9b6f.0","@material/theme":"5.0.0-canary.981ec9b6f.0","@material/animation":"5.0.0-canary.981ec9b6f.0","@material/typography":"5.0.0-canary.981ec9b6f.0","@material/feature-targeting":"5.0.0-canary.981ec9b6f.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_5.0.0-canary.981ec9b6f.0_1578684402403_0.5468263269920779","host":"s3://npm-registry-packages"}},"5.0.0-canary.737da83fc.0":{"name":"@material/slider","version":"5.0.0-canary.737da83fc.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@5.0.0-canary.737da83fc.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"1b5cfc42c6dc7360d46d079569af54550e57122f","tarball":"https://registry.npmjs.org/@material/slider/-/slider-5.0.0-canary.737da83fc.0.tgz","fileCount":31,"integrity":"sha512-EpCqxO55fhJE8RoK4WdciB2hnwBPuWMj5gfu9UJ+oykqQQJrJOxSJaumB7wNl7HfQS6NVdooqWGyi9ONP6DhsQ==","signatures":[{"sig":"MEUCIQCTnROJ+A819f68KKBiEB+x3NnWy4cxoneaynS6rzpwtAIgPc2PxQoSDFWZ2IzNi/k/9J1MMGShzPuL+Qltd2C3xUQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":342610,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeGOo+CRA9TVsSAnZWagAAqHsP/A+9BN+mRJvU1pwjDYl3\n1JDISFQcoNoWPGcFNg29+ZuZAzA8I3YNn0pn1X2+VlMXk3TGRNnStzIOQQWt\nI1BIuI7by8eTsglbJB9uY0VyMkMnqtWBm5uh5v6wlKk2QswoTtWuWcBdK3nB\njDmr+UBqEH9j7FTJ2USnI5kP4iIuxfNvwXJzgvcvA9qfG9rxevLddncPVcCY\nwvtLmcVDfnXopqomMwwaGqeq55ArPN5OU6RCCjrxJi8HtMHW/N+8jP1dsBvv\nDejjgOLF3ix7w3gX4QmziJDGdgT4v3Cp+eMMfVapgi8xhScSA9CF2soXS/Np\naOqgBY9RtqtXEb2gLOW9xRw7I9tgkwZx7bVDBXifG0WOdJv8AU7n0vnkaT2x\nFK15ul87vbNGE3u3ovHAI0ZDPjLnm6sEwTgm7nNmCh4f4r0naBiWUauuGfI2\nipcqD//s0zei0h87jE+OH+5xRu9Tpll03k7jo6oU/jtgw9SGdQNklo486/ts\nKi5hhzfQJzCQhJlcz4/AhfRQwSU2UJGecEtc/BAHgFu5f5fbKC9AO/NTFTf6\nIEJuNqWViD59NDJVZJXHnn5hP9h2tZXqRynkZ6LzfZ0xYOMOvFKBmt1dCAmm\nq1YEOfDJzmGH8wQc8wA0ZQva9aafXLLqKpnkiEwdgE1xnvLEn37nmp9VXK0R\n5qmW\r\n=e5EV\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`mdc-slider-color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`mdc-slider-highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`mdc-slider-rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`mdc-slider-rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`mdc-slider-thumb-color($color)` | Sets the color of the thumb (grab handle)\n`mdc-slider-focus-halo-color($color)` | Sets the color of the focus halo\n`mdc-slider-value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`mdc-slider-value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`mdc-slider-value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"3ea8f6e8d81e688483ab007855dce5cba3b72015","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.18.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.18.1","dependencies":{"tslib":"^1.9.3","@material/dom":"5.0.0-canary.737da83fc.0","@material/rtl":"5.0.0-canary.737da83fc.0","@material/base":"5.0.0-canary.737da83fc.0","@material/theme":"5.0.0-canary.737da83fc.0","@material/animation":"5.0.0-canary.737da83fc.0","@material/typography":"5.0.0-canary.737da83fc.0","@material/feature-targeting":"5.0.0-canary.737da83fc.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_5.0.0-canary.737da83fc.0_1578691133807_0.9205081414007843","host":"s3://npm-registry-packages"}},"5.0.0-canary.aca8e6c18.0":{"name":"@material/slider","version":"5.0.0-canary.aca8e6c18.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@5.0.0-canary.aca8e6c18.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"f10e786c1aaafae1d4fb7fc887bcafa5452b986e","tarball":"https://registry.npmjs.org/@material/slider/-/slider-5.0.0-canary.aca8e6c18.0.tgz","fileCount":31,"integrity":"sha512-FnnJYUN4LahvSePWo2dry7cp3lcEmStrtWGvHjlHKv2QXh9Adv3svlDRd7rWhUnDdcjsCioQT5yUyAi61PaFBQ==","signatures":[{"sig":"MEYCIQCuocTBVLYLHnK5cNPqxrf7QW9RSBHvIvPq+EhxLda7cAIhAN7nplpHt6r4R3d7rJI+LbYt4UWhfPCIQyOWzriI9u+o","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":342610,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeHMWyCRA9TVsSAnZWagAAUEwQAIUHAq9lK1A+OlYIBGqX\nfvpBMyD+e81gqa2v7z2GYgUCsbsIIShW3hAC8toGgIjUggoUihkQ2cLG0Jnw\nyfeyhZGLViovI8Ytv9Oo7QJ/Kmugi0JgnL1REZXu2jF+4Mk7HAA8kjqZQMLk\nRpMl1+x33Q8eTQ/zRo0hzwyKJ9esrNbySxSAWxBVs+9JO3a8Ui2IwykvYGzl\nHfZWXspvDuT2M1XmUa9FR/XKzRIJ6M38ARpTlAhpEjj5j8wAYdhvfVDKr5Hk\nfCnkMXdZNkn64Nbh+hMl8U0t7Gv5W4WI+edRQ2Arnr0gxKl6H7Yzx2BHLKuc\nmoMAXlXx5veKnq+a0SYL91IzWb/10H16KSGzFRY6cve3XXnDwl3XRfWg8Ero\nWmAZ8/7wrjWF7xdE6ThpN61GAvWWT/EwdhUPN3m7NO8h36NCXtAzNIxQOw9B\non0eYQShch52DIBXZJHEW8pR0ct3TRgag3gtQRjO1SZYqjSDwXPPqvIg9g60\ngcDa6LZSGapH6u0AJFQATEthVw5hg/fUgFMeI/wFShaDP7jBAUTlqy2tDV4Z\na53duFzzcq4EAiQo4szDs4Eox1gg50iJGzReXrOPd3ewaGVCrkrrb/1RTsTW\n8pY5MchstgMInvmp2XAsGtTtwcvmZeU6u826zJtjrB0suxIq18VCVPMfm2t7\nKrOn\r\n=2hl2\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`mdc-slider-color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`mdc-slider-highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`mdc-slider-rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`mdc-slider-rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`mdc-slider-thumb-color($color)` | Sets the color of the thumb (grab handle)\n`mdc-slider-focus-halo-color($color)` | Sets the color of the focus halo\n`mdc-slider-value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`mdc-slider-value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`mdc-slider-value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"47bc251033c39b1b8f816f8ae77c888c07b20fee","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.18.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.18.1","dependencies":{"tslib":"^1.9.3","@material/dom":"5.0.0-canary.aca8e6c18.0","@material/rtl":"5.0.0-canary.aca8e6c18.0","@material/base":"5.0.0-canary.aca8e6c18.0","@material/theme":"5.0.0-canary.aca8e6c18.0","@material/animation":"5.0.0-canary.aca8e6c18.0","@material/typography":"5.0.0-canary.aca8e6c18.0","@material/feature-targeting":"5.0.0-canary.aca8e6c18.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_5.0.0-canary.aca8e6c18.0_1578943922518_0.9517061786758656","host":"s3://npm-registry-packages"}},"5.0.0-canary.c38d84e21.0":{"name":"@material/slider","version":"5.0.0-canary.c38d84e21.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@5.0.0-canary.c38d84e21.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"b28e60165348bb29c692539aed6378ad2b48765a","tarball":"https://registry.npmjs.org/@material/slider/-/slider-5.0.0-canary.c38d84e21.0.tgz","fileCount":31,"integrity":"sha512-BXSGT6NqQPq3MyBASB7xuCMWzjmMRlQ8rVH4tNLIPAhZbr7admTwaBuRzVNS2lyGvIM1EPYzHrBPQVoX1ejNKQ==","signatures":[{"sig":"MEYCIQC+g3HcfPKbPtHAOh0KUUYorsXEqd5eEfJuK2mKxb21MAIhALaHVrF7rVFDUN0tl2rago7vGagjhkzk+1uu1uBSC1+z","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":342610,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeHOuQCRA9TVsSAnZWagAAcuYP/0soqYzWTnw/FeZZNjXD\nLcRCSCtRh/LY7TnTpQsMGCTb0QlJGYbZ5eNxVaUHMsHFiPjiLrpR7CAbe6i/\n7kadkiPsejLgto2k5yALMf2DPjOM80pN1unc49n/Hku19OZkj8gikwdchMrs\ngklLjScO+8uKg8qavz1ikm/WXR5wVLgnVH750OqWqFCALCbT+dCYLIEs3jIm\ntoVHpFXJCL37NgK4COZbzpajhlJICOVP6aw+nQRP+1D1ZMd8o/O9Z/4tqDC2\nbWLpuenN0zaH7M9nPr0j6iru8Hv3GwsgQ1nmGcAlOrFeik8GWzkag2SKUbii\nOvrUoRpt2FIkbkSSpoj7kBFsUh3kYg/PjnpE18oNakAKmzxzw5PZJV1BYgG1\nKSPWrTQveBIFxM9ro/Z8UfwW/yoIw8rCwZyWqZpE7ngSlS2G9idviwOl3phd\nZUmyPbmX6b6zR76SkL+s5hZ5DOveJblbAz6kq0QelaTMO+oKhSa+ZcarSBET\nzr5kbX1wB5GYGSvfNey8LxrfHgkW1+2mzuLE2xbg50AzSBCxk1RPwFlpnXot\nVovX/UlE5bR5Qp7YVX0eekWAe5GCmg0b0/bqV3RsFW7EDdULh7owCOKgxtQP\n/TfNGu3CBs97t0r89vZZLGR6N0Bc03Mrg074L+HJIEdPH+/CsjhQg4ggno4J\n+6xj\r\n=wrxP\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`mdc-slider-color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`mdc-slider-highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`mdc-slider-rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`mdc-slider-rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`mdc-slider-thumb-color($color)` | Sets the color of the thumb (grab handle)\n`mdc-slider-focus-halo-color($color)` | Sets the color of the focus halo\n`mdc-slider-value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`mdc-slider-value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`mdc-slider-value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"f283cfd55cbe9b1863cb96e98011fe4badbb1fd0","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.18.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.18.1","dependencies":{"tslib":"^1.9.3","@material/dom":"5.0.0-canary.c38d84e21.0","@material/rtl":"5.0.0-canary.c38d84e21.0","@material/base":"5.0.0-canary.c38d84e21.0","@material/theme":"5.0.0-canary.c38d84e21.0","@material/animation":"5.0.0-canary.c38d84e21.0","@material/typography":"5.0.0-canary.c38d84e21.0","@material/feature-targeting":"5.0.0-canary.c38d84e21.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_5.0.0-canary.c38d84e21.0_1578953616160_0.15402925611895224","host":"s3://npm-registry-packages"}},"5.0.0-canary.a4db5fbad.0":{"name":"@material/slider","version":"5.0.0-canary.a4db5fbad.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@5.0.0-canary.a4db5fbad.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"892b2a14338022f65b9ff5caddb38ffeef129d35","tarball":"https://registry.npmjs.org/@material/slider/-/slider-5.0.0-canary.a4db5fbad.0.tgz","fileCount":31,"integrity":"sha512-Mg02EYV4BF+S8jMc2s4YSmiLiUkIUSr9sfX/e53+YKUigO9scvKrDw3RczKWx/c/8X68KCIJ0r3o/z7maDKQCw==","signatures":[{"sig":"MEUCICvEbm8TWLt8bVO25cwv2Qb99RtiyypRJ+5PKqjB5AX9AiEA0cGi5noGHgCanjio5oJOL1pawPHiM2fNfw+OKGs4t3Q=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":342610,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeHSQ/CRA9TVsSAnZWagAAW3IP/iJNGAnRD0waZyQqbx4i\nxwSbsb4rhaFjk3JHu2+VcwuPoM8l6E9a2PP7vfnZGUCGsUN9ZLepE4eseP6o\n9pGmhS5qwan8CjWfC9d8LUr/hzaeD4SEItpA158TGSnzkAR5eM1UdzCAbjCu\n5HDWtuBhFbAAYkSbEAxLcEEwX3NbZ1SotLKlR6g0uiaXetBpGRyIzRnCapcW\ncMbdc/DkbQaymFyhWt340CLFY7iXzHikzqPIxfNBUjGOhMMzP7UFKZcNAOSp\n7BX54izLcoK+En0ynOs10m5BW+SmIY5qnSz7a4tkpJlRFCe/NsusgyGhMWhu\n+HKOhsy6+ualSvRE7mj7rI0v2m3WhQQj7EYFk1Qt+CtH2fVCphH8Ml/LUcd6\no82alndij8lSa003LumWPHJqkoY+8zZVO3G5UxEj6OVGNj3KP2s7/wXYzpwb\nxcodanPSmLBw8hDnDaRabBFQ2Bj2aTwlfAOGiOwOqd8WfRb556OTX7+ncaZg\nkY5zb3rzwrX1VtuRoqhy9mcG8G4XNIr1nTVDojFsDWjWX4YklmnMKY+hG8WH\nS/FRrNTeuU9ABX5kGgs+Kjo5Ls0mMnND5yJu8fAntiDh5vklkIXO8ctojtGu\n4lUKyvtNTmj2imUT9Ph+AK7Cnr1B7BYhOB2ewUrcl/tyZweJ3aI0SZEgWN3G\nbXjy\r\n=dlCX\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`mdc-slider-color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`mdc-slider-highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`mdc-slider-rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`mdc-slider-rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`mdc-slider-thumb-color($color)` | Sets the color of the thumb (grab handle)\n`mdc-slider-focus-halo-color($color)` | Sets the color of the focus halo\n`mdc-slider-value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`mdc-slider-value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`mdc-slider-value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"bb5fe141944679686f178779345a5880a89943a9","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.18.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.18.1","dependencies":{"tslib":"^1.9.3","@material/dom":"5.0.0-canary.a4db5fbad.0","@material/rtl":"5.0.0-canary.a4db5fbad.0","@material/base":"5.0.0-canary.a4db5fbad.0","@material/theme":"5.0.0-canary.a4db5fbad.0","@material/animation":"5.0.0-canary.a4db5fbad.0","@material/typography":"5.0.0-canary.a4db5fbad.0","@material/feature-targeting":"5.0.0-canary.a4db5fbad.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_5.0.0-canary.a4db5fbad.0_1578968127494_0.4206029579934467","host":"s3://npm-registry-packages"}},"5.0.0-canary.faa9af310.0":{"name":"@material/slider","version":"5.0.0-canary.faa9af310.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@5.0.0-canary.faa9af310.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"db8d840723c83837eaef0ad3bde381ba73ce19ae","tarball":"https://registry.npmjs.org/@material/slider/-/slider-5.0.0-canary.faa9af310.0.tgz","fileCount":35,"integrity":"sha512-oiQ8SGAi+7pYpCFbDa87LcprOBKnQ32BEgtolajNG0bKO8rTSGoLKJqf6adRUPDf9lm4yLq6xU6MmHFDXzmA3A==","signatures":[{"sig":"MEYCIQC5z9Nglgxfsp9fxEiZTxY1r5p7ehhLS6LmqHHN3/EDxwIhAKwPhBKRmg6ricdia4koAa+rnOuD5DQA1qtWOSNRjNdZ","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":347082,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeHfHlCRA9TVsSAnZWagAAUUUP/1EHAQ7AhYtyvT5FDJgo\nIlvn3a0xoGfdGo9/tNctclw0usov/P3mUQDZZ6zgAAj6fbxVMRIJYrYi75H4\ngwgA0oxOJV1Jxeb5XFYkemt/6OU6eO3AAXX8dqUXvDbW7rPTRNfOKXifqUa+\nJhg7ii5gMqdpL+j0rwuqRXNyEdIR9ZCg4ezZYyJ4YWopJAHNEQ7ZT1G1C5U+\n/zbDf0pB+NzHMJfnERZ3XyHAmB66Z9naXtZ4ykaqs43hyRJvdbQLs4+fWN7Z\nOSr+GccbYvhiek9GFw4dM7Vij3szqggi4dB26pX+caiLkIlXmw5AK7O/QrdT\n38RPix/x1vyy2ugEHD7V44yJEgdm+QYhOKZ5ROeCjWpZVRC03mA643KOZgX2\nILgFTr8VpquocJ85KjNFTpeYlFwD8RySL9+gT2hctemvRHb7e9ZYMHODq4s0\nH+j2f9JzYP0hBBPGzUNsSMFkY7uzl7llLyNDL1BhF6BIlb61bw8eTx0WJXZJ\nf6Z4RYAGWpqclHQ5EWzx98gJVxP2NgGYDPshFTuDQ9BrvrQE+r1x4ke4s0TY\nPBIX5Ge65PNnk6M+AqJoW2kb3Op7KvQXf5LT08PLzPkW0I+btwFmsk0bJQzJ\n6WuWFOzvuXb8tkm0Am7CUKK3WfpNIs5vW10CByJgapx7qFfYB4rbdlUlWl+g\nT0aE\r\n=ZYwO\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`mdc-slider-color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`mdc-slider-highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`mdc-slider-rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`mdc-slider-rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`mdc-slider-thumb-color($color)` | Sets the color of the thumb (grab handle)\n`mdc-slider-focus-halo-color($color)` | Sets the color of the focus halo\n`mdc-slider-value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`mdc-slider-value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`mdc-slider-value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"ee374355df19027c59f24bdaa809bc18183453df","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.18.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.18.1","dependencies":{"tslib":"^1.9.3","@material/dom":"5.0.0-canary.faa9af310.0","@material/rtl":"5.0.0-canary.faa9af310.0","@material/base":"5.0.0-canary.faa9af310.0","@material/theme":"5.0.0-canary.faa9af310.0","@material/animation":"5.0.0-canary.faa9af310.0","@material/typography":"5.0.0-canary.faa9af310.0","@material/feature-targeting":"5.0.0-canary.faa9af310.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_5.0.0-canary.faa9af310.0_1579020772529_0.9976887933765941","host":"s3://npm-registry-packages"}},"5.0.0-canary.60354c577.0":{"name":"@material/slider","version":"5.0.0-canary.60354c577.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@5.0.0-canary.60354c577.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"b084f7078f00f21929bb6958c96797e446bc2242","tarball":"https://registry.npmjs.org/@material/slider/-/slider-5.0.0-canary.60354c577.0.tgz","fileCount":35,"integrity":"sha512-kw/klK30n5ef3Aa9QzXseNhzMRMvIWLwi7sDk53sB84vdF86vRPPf2sK5dQppLV35hTiAagBvnSpcko/no/skQ==","signatures":[{"sig":"MEQCIAlvzaZPysd9odkViqahfPrPeOzPITquuzO299/VcWKyAiAGIgV+mINntyzov3D4il6NE82sYRtIRpqvTF4Oy7EdBQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":347082,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeHkSnCRA9TVsSAnZWagAAyvoP/R5xllUcCZlGjm8CISP1\nKGhF6NmbdHWPoL9oE+C+PczEyspLlcWKfOsOnuE6xfpZWbeoBcrGI5tX3gpg\nEtLvul7CXPMtSTIgtenv5gBmFtfiEvyKH6vmdNb+B4Lq9UxDHknLXqdopID+\nKsy6ZK26b+87ny81xm3vM71/KTZWm5TLCOMtPbIohE85OszQ7Bm9AGWRJ1QW\nqRZl3Pmbi4IJzQn5BKEoimeGjnum2hF4FFwGWwm/a24SjrIxTxzeTCDkCoZ0\nUoMpF2gJUA0Z+LOExVXtUVT7J/vrDGd7dcMFBxApiSOGsyWVlgZnZylrNm3c\nMXpIi5AZKHIJAPcA+uQphZIJUABu7LJhz6FJcjUh7KDSJqzgs5heRw+adQ/j\nN0UQvk2MPxUDRFo7vEN3l3kMjBn3n9wOpF4sl2itqpPxHMuR/Brr2HbwAHJl\nq25+tIMxULOo4e6l2yh69YKa5ES7xTleSCQRlfgxDNNUmVBgwD1+G7BsCnvi\nnCJLnLHxoaok7JqkSUQGanxzmAsdJovfJpbRN9dE7SRKS30p+bzOg5tfOeK9\nxSoy1+ygsxHKgVlmnoEBT8w8hhGj5xN21Vjr3MrgK66mJeOK6txpKxT/c71l\nLdcaZRrvi784/WNW3BXE2FzqPc9xeeI2vSPewtU7rGhBXfHvECeL4GrCi5vR\n8o7L\r\n=Q6qS\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`mdc-slider-color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`mdc-slider-highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`mdc-slider-rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`mdc-slider-rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`mdc-slider-thumb-color($color)` | Sets the color of the thumb (grab handle)\n`mdc-slider-focus-halo-color($color)` | Sets the color of the focus halo\n`mdc-slider-value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`mdc-slider-value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`mdc-slider-value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"d9f4420da446050561084fce698a543b0dc6b543","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.18.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.18.1","dependencies":{"tslib":"^1.9.3","@material/dom":"5.0.0-canary.60354c577.0","@material/rtl":"5.0.0-canary.60354c577.0","@material/base":"5.0.0-canary.60354c577.0","@material/theme":"5.0.0-canary.60354c577.0","@material/animation":"5.0.0-canary.60354c577.0","@material/typography":"5.0.0-canary.60354c577.0","@material/feature-targeting":"5.0.0-canary.60354c577.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_5.0.0-canary.60354c577.0_1579041959330_0.8361138907883436","host":"s3://npm-registry-packages"}},"5.0.0-canary.d07c78daa.0":{"name":"@material/slider","version":"5.0.0-canary.d07c78daa.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@5.0.0-canary.d07c78daa.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"6d5bb2aa14a01b6f896c0d5085811ea911501bec","tarball":"https://registry.npmjs.org/@material/slider/-/slider-5.0.0-canary.d07c78daa.0.tgz","fileCount":35,"integrity":"sha512-1zozRJ5SnR3zn9MfPoF7gB6lc3UC0u9hhHJ3q13ZPkUYeHlJsyPbAp1/x8RMgYiR2CH6gS6ZbXJ90L2yGj6ZZg==","signatures":[{"sig":"MEUCIHjTNa5ksyE7TgmpttVuS3h51ACOdnAk94nTbXcsM6gYAiEAvA46/uMcR5uy9adbq6MSG5l4GWFkMtp1H6+gnp+enGQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":347082,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeHlD7CRA9TVsSAnZWagAAJYMP/1cj+f/kV68GtKqIHpj1\npNjMt7dj3iqiZYs1MsaZaXZnvbK3n4fjxrF0Rjm6Zn2u+990qp3usfmdHOQz\nTTysKGzXx24tCBSWqHFfmkG7T9JvkLkiuxDXNKz2+3BdIZqJc8PKEJd792ux\nj4Nq+sy+f7exbtUTLAJq617QgHQQVx9nf/Tm0ptBB+tJjM2X7hM+8xg/h0eH\nMg3vp12dw/0m6xkSckqubA9ZO2aGsJ3bx3BlmTCHmqH4Dbo4tjYmfLm+ImBm\n79EaAIaItLhHkzyf6gPlIZQu0qiaQBIxrWYgzxVCCH386SXpyAW1AK0Kt97T\nNXnAwyxo3bO5YECfISM9EyttbNb39+1zkHSofMpSOqitGZHR1kRqnU8npDPe\nHAXFypdqQiEeS9squFQnfgAUn+xjbBdMNHiqLz+uLiWc5k5ln5+3FQ/ZPfuS\nsjKdeQ4i1GJ6w7IhJFCV5Jk1M5m6fIKHOdhEgckMRaRJp7dXZlySk/g+9463\nlhj2E6/8qHsICFh4KJ0FToD2xR+VRPIqi1UuWU55rbQGa+B5tPh0mvoxhuNE\nHZUMSkOVKKDsZuG4ZJrA+zDWfGUIVD91OQpSsCMBqu4je1Vz4KQdzX8KxhYy\nN1yrb1+lk+KUZTjnl9XFfTHQkZnsSeuwzMw/xczOzBOVbKUrriZE4x2t85BL\ndO1p\r\n=XaAc\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`mdc-slider-color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`mdc-slider-highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`mdc-slider-rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`mdc-slider-rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`mdc-slider-thumb-color($color)` | Sets the color of the thumb (grab handle)\n`mdc-slider-focus-halo-color($color)` | Sets the color of the focus halo\n`mdc-slider-value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`mdc-slider-value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`mdc-slider-value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"3657a12b1a5b9b1742b2749f6991e06a32416314","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.18.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.18.1","dependencies":{"tslib":"^1.9.3","@material/dom":"5.0.0-canary.d07c78daa.0","@material/rtl":"5.0.0-canary.d07c78daa.0","@material/base":"5.0.0-canary.d07c78daa.0","@material/theme":"5.0.0-canary.d07c78daa.0","@material/animation":"5.0.0-canary.d07c78daa.0","@material/typography":"5.0.0-canary.d07c78daa.0","@material/feature-targeting":"5.0.0-canary.d07c78daa.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_5.0.0-canary.d07c78daa.0_1579045115387_0.5116703611848301","host":"s3://npm-registry-packages"}},"5.0.0-canary.8ddd5c6dc.0":{"name":"@material/slider","version":"5.0.0-canary.8ddd5c6dc.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@5.0.0-canary.8ddd5c6dc.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"3d88f74da5d8bff6f778f76a3efd9125868496f0","tarball":"https://registry.npmjs.org/@material/slider/-/slider-5.0.0-canary.8ddd5c6dc.0.tgz","fileCount":35,"integrity":"sha512-nQhMEmdk9VOqooL9bBq+i75Sm0KgncJVB8nJgvV7f1jBUSldv3wZMXis07hhGrYPacNitQL38uncg9TIxNbdsw==","signatures":[{"sig":"MEUCIAOtGbqOU+OTrOQWix3njsHED+TQzwEVS6ZhxUzOWuzxAiEAoK44cbE0b78T8l2vPTaeXCAj6wRfNgnU5McI4ICna/c=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":347082,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeHm4oCRA9TVsSAnZWagAAAwQQAJSlT9XUTAgyTaf5WsW+\n7QHSDDjxI8TM0o7zmNnrGnSYlXn4zYyKxJ2O6yJWXQF7I0WEJj/fLZAbdWcU\nEwduWmRZzohnMb/hXcISuUVBqq4LCyaBU3UXWtNpNh7zkr7YyotrbrNBgfd6\nl++XLsilOURPCmg5GVs/jHzgp5FnRPiByad7SoiTV42topqjtfmOuRi5nGdJ\nSp/yuVF7a1lsFTZq60g7crqkXQZjPIufFfkJtUnPQ3T0Nce5G/P535xVce6r\n/gTJWxbC9FDe6kbUfy+QE7RJIrwoB54t9t8tU6K6S4JrUK8kw5+2uolR93ex\nsyylhOsX2tzQshCPaBeGLGxq5dgKj5muuC/609ZEHzcp5JjXV/Dk7cKqYzxB\nzILBGaZxlEamm64DNBhdi6phxx0RFlkutpD7+OVI+Udu1kqZ1k4JHIA7yI43\n2Qg6IxiPD4LSbXOxBssfzVC/7REtbDBJLWnev2a8cBzlAuKF+Jl1HjU4qTLj\nX5sGuvb4XQ4dVCW8P05Xv3kJQAhS7AbmraMpbU4Z8M8U3HtS9jEcvLPsG/Je\njoR3E6LQjhq9OO88qFRUPNUNRf4Iwtf68D3htVbE55eK+LcIUD59KfZz8a69\nFzKBeuZEqbLhbRUeKy3Y05//FZ85lhU/O0i1tHETwJIZEqnB07RXF5pAY0DT\nQGtr\r\n=Uft1\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`mdc-slider-color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`mdc-slider-highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`mdc-slider-rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`mdc-slider-rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`mdc-slider-thumb-color($color)` | Sets the color of the thumb (grab handle)\n`mdc-slider-focus-halo-color($color)` | Sets the color of the focus halo\n`mdc-slider-value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`mdc-slider-value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`mdc-slider-value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"939fade350708e559f107b53d2ab9d27d6f84f1d","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.18.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.18.1","dependencies":{"tslib":"^1.9.3","@material/dom":"5.0.0-canary.8ddd5c6dc.0","@material/rtl":"5.0.0-canary.8ddd5c6dc.0","@material/base":"5.0.0-canary.8ddd5c6dc.0","@material/theme":"5.0.0-canary.8ddd5c6dc.0","@material/animation":"5.0.0-canary.8ddd5c6dc.0","@material/typography":"5.0.0-canary.8ddd5c6dc.0","@material/feature-targeting":"5.0.0-canary.8ddd5c6dc.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_5.0.0-canary.8ddd5c6dc.0_1579052584500_0.7040588387959108","host":"s3://npm-registry-packages"}},"5.0.0-canary.a9511d870.0":{"name":"@material/slider","version":"5.0.0-canary.a9511d870.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@5.0.0-canary.a9511d870.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"dc017d07472d31222c08a0c0272c8049f6293cd1","tarball":"https://registry.npmjs.org/@material/slider/-/slider-5.0.0-canary.a9511d870.0.tgz","fileCount":35,"integrity":"sha512-a5zqSX5Q3BgfgAPnWlTmwaRWcTmHBl7X8PxJz0UbIfb8sgzN1xl6Hf4h2yG1OU0yNDYsv1E+pt/Un3cF+Cpjpw==","signatures":[{"sig":"MEQCIAplNvbamqMTjUYgDE4w9p3zH7N/v6rg5/GA+xbifxY3AiApC+SYPiuG6MtMjK1QtiwRyMw5iAiw6wsUPrWWN6o7WQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":347082,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeH2OeCRA9TVsSAnZWagAAW7AP/R+TEYY4I+FiWQmF7+GY\nuxgdN06cQkHsJTcfEJJ0Ly+Nz5/Ky8XsMNInQkXNZGEv6qgM61aUELtxPu7m\nX6SyTQwXJwbScd3lPUZgc3nYO0pB8HvXmFJzhd19blXDijf/Vqe6A+VoS7Qn\n4iSDjrFy7WrrMazZxBss8UDHrA8V5e2gIamkd2Ed8o3Z1XnSV1JJmiKU4Fys\nMiPxihjQ/QG3V5jvPDJt8KIKCx1R3u/IhGMISfDWss2E32huCH+JAfNmOASY\nI7aeG/foEKXOXX1Y8avbt3HvdPWkZ5yymc4i7aG/uJQexYNh5/XM5L42m4ru\nrCohGw1DL35QqIDZ2cYQ1E2NH3Oc2qr3AH18j+8r/+q/o0c4rsdRGayl41pr\nmi5559OI/iuioarEL8Jxc1dWHP6h95/1fcSUcI9xubMRbMp9Op4pIDVgMW2q\nO6dIFQ+BoRsQHTSbVjP2sBKFfTLTk2IhVJUwYHkYmaZAl6eJ6UbfoHNO2KPL\nrsStfM7939QA2NYhfYTv/ufHbtvUVIcQU1QQ3+efN1plYYmieCg1X3T41gFe\nq+lYsDcsxdxpKRPk1VVU5AjLTEMBMGD+AUORE2x2rmH8UC4WL27bNkE3dtty\nvUMayS6pgNklGazLiEz48EpD8cqPyDzoc8N9rklHqsGEkpY2lZG7La7LApEf\njokv\r\n=aIdv\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`mdc-slider-color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`mdc-slider-highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`mdc-slider-rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`mdc-slider-rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`mdc-slider-thumb-color($color)` | Sets the color of the thumb (grab handle)\n`mdc-slider-focus-halo-color($color)` | Sets the color of the focus halo\n`mdc-slider-value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`mdc-slider-value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`mdc-slider-value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"69b4f620220b7e580f5273bb82be01e5990b894a","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.18.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.18.1","dependencies":{"tslib":"^1.9.3","@material/dom":"5.0.0-canary.a9511d870.0","@material/rtl":"5.0.0-canary.a9511d870.0","@material/base":"5.0.0-canary.a9511d870.0","@material/theme":"5.0.0-canary.a9511d870.0","@material/animation":"5.0.0-canary.a9511d870.0","@material/typography":"5.0.0-canary.a9511d870.0","@material/feature-targeting":"5.0.0-canary.a9511d870.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_5.0.0-canary.a9511d870.0_1579115422273_0.8528005500612117","host":"s3://npm-registry-packages"}},"5.0.0-canary.7c8583c4c.0":{"name":"@material/slider","version":"5.0.0-canary.7c8583c4c.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@5.0.0-canary.7c8583c4c.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"c4d9436c57bfa5951f0f70c75a06dc49a3560272","tarball":"https://registry.npmjs.org/@material/slider/-/slider-5.0.0-canary.7c8583c4c.0.tgz","fileCount":35,"integrity":"sha512-pP3EeIkwp2w3ChGxvircGuQ5No+XJJuQd+8pjIsojyn1BH1rb6ghZrRjE2M/Dr4Xx3GevMGYdsce5tyrYjNm1g==","signatures":[{"sig":"MEQCIGrQmcOz74E6rv2DmeRgV2GdYjUtq/wNxNP6IaPw+E4PAiAaVEOMKJXIxMLvSN2NFZ1PhzXQnezdsMXpLVY1L6S5yQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":347082,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeH5aSCRA9TVsSAnZWagAA5zQP+wX0e38CsYpHB6FZKrm2\nl5kXhYaecqShCZ3afMudGIt6pAzd9p3U3d3KJK0XMAuoHMj2rYRnV47r4Nhv\nMg62CgbsbTIM5x6hmQhA84Eod4MqQCHhN6C+tccjFsP2v9HHOH9WX2Y1E722\nMoSk3GsvRQaESumwhmo2jFhNgnRyvAjtWFDTPbTJXSF+eSN7Tfaoi/o9htyi\nKS1ucReIhaXQVGHOnJEMrPqkjbMKwujgn69tNtSP2NOh8ZiyWGD1HMDMDxvc\ngP3LGzHuB7bY257lxmvOYIkMukePb2REq+wI0e0VE7yrAOwElfVtJsbxcA99\n85Dtpxc80jZNCicEQ4PMNEsn/arfB/oRp/aDaIw6npyOcz4uFyCXrSGcETL2\nr/E2UImAnmP6t89cMxXyGTWkFCLvrYPFrAAc6biQTmAbExtbl02bOzhzlLW3\nNyYgEBwtfa5EiCJW5q0mXekz/jFGbXtymK+tKQBUgwWVEPgETyRAIDuTjavs\nbTntmOvwJKAI+PqC0eozQYchrZ+7ATKEBG+JPOhyUWJmutjKkPMBWPoK7gcP\n1pGkJNWffQYeGfJLbh7CpOWyZoryHyGSjW4KF+z2CA+X8EFnbX+f8WDFTDHz\nRrfke3GIvL2SLmhyjYnqza277VZbP0Ke9GbYAWq1oSwnT/36XVkWN8GCtYk/\noBNk\r\n=DqRz\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`mdc-slider-color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`mdc-slider-highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`mdc-slider-rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`mdc-slider-rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`mdc-slider-thumb-color($color)` | Sets the color of the thumb (grab handle)\n`mdc-slider-focus-halo-color($color)` | Sets the color of the focus halo\n`mdc-slider-value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`mdc-slider-value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`mdc-slider-value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"d89f2d9150d02c17271eeeb692f29f456fed4c1e","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.18.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.18.1","dependencies":{"tslib":"^1.9.3","@material/dom":"5.0.0-canary.7c8583c4c.0","@material/rtl":"5.0.0-canary.7c8583c4c.0","@material/base":"5.0.0-canary.7c8583c4c.0","@material/theme":"5.0.0-canary.7c8583c4c.0","@material/animation":"5.0.0-canary.7c8583c4c.0","@material/typography":"5.0.0-canary.7c8583c4c.0","@material/feature-targeting":"5.0.0-canary.7c8583c4c.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_5.0.0-canary.7c8583c4c.0_1579128465889_0.9937683469433858","host":"s3://npm-registry-packages"}},"5.0.0-canary.5d4b82bac.0":{"name":"@material/slider","version":"5.0.0-canary.5d4b82bac.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@5.0.0-canary.5d4b82bac.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"6935ce1a3ad78d45ea5656f9bb52394158851d00","tarball":"https://registry.npmjs.org/@material/slider/-/slider-5.0.0-canary.5d4b82bac.0.tgz","fileCount":35,"integrity":"sha512-D/1G8191MAqlUSmpEhK3XewkDpqSMR4l36uS1cWzFT7XwYatYz4cf4hvBU4wQw9x5kGqWzgfJ+83v4099Kz06A==","signatures":[{"sig":"MEUCIQCCRDDE9zXLGpO9snITuFJf6XV3HjRVNanj0GvMfFnkxwIgXGFo580kJOlwyW7fGHOlSCDStM0DOwuxbdZO8wsR0Vk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":347082,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeH5a1CRA9TVsSAnZWagAAJgIP+gIKqiEMXdFQYP8vssrM\nEqK4NfJknxCOw7BPkyomb7uM76bW7/EnmJWAy5BGWpchkOaU8zqcgraSJyF4\nDQbVkr8A3bJyqs0rYG9sEG0mhuaJ3SKippnLjy56EkvuSV/pkPe+lX2d9RRd\nun3jF3Pr+BQ1JjNOvU9LBOiLmGMYjMx7Ow9RZ1DGG4wCnbCrOwqysuEwC0V+\nQJDWLjI1nxCIKqEy01Gp0ETk+Cdg7+0iS3Xmskndnf93WTU9C44w+NNKi/Im\ncovUmp+KqrtQpkgOfQMhwLZJOQd3vniS9GS0o7xlogn7+oFd4sD9qZbqfChy\nSbRN3A01FyyVfuUaurOdOKSW5pMdWEziwpOA1t/m4ps0YYJbd8d5oU55jVv5\nKhFVR5YXgRKLdB5Xy35V+q/J25vCjc6C163dvHXsqirTU3myGL6MZ9Nl3V/r\nqKbKB4jwowxMt7lzpiiGc1SthBb7+oPR0D0xnMfiKLC4vy8m5+XC9cWhq4ga\nH605d/+s6ZlTPW0pTbfFRcNuJBcYl1qy6ZGd2FMTmsCrxJVmvc65J86xe/Gr\nEmAjiCbysgIz4AP6631tDlfSXAhcm7YRvm87xl6LVohgjAA6ViTHqPecyAWO\nCPxtkMjPrl78+VHeBE1NL87nplLJ7NzxtzYDolMEGfofRvVoR+VDr/HNrWh7\nq5/1\r\n=Iwz0\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`mdc-slider-color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`mdc-slider-highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`mdc-slider-rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`mdc-slider-rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`mdc-slider-thumb-color($color)` | Sets the color of the thumb (grab handle)\n`mdc-slider-focus-halo-color($color)` | Sets the color of the focus halo\n`mdc-slider-value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`mdc-slider-value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`mdc-slider-value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"e679f52745cb7c74219ab22354c6da39a642ecfb","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.18.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.18.1","dependencies":{"tslib":"^1.9.3","@material/dom":"5.0.0-canary.5d4b82bac.0","@material/rtl":"5.0.0-canary.5d4b82bac.0","@material/base":"5.0.0-canary.5d4b82bac.0","@material/theme":"5.0.0-canary.5d4b82bac.0","@material/animation":"5.0.0-canary.5d4b82bac.0","@material/typography":"5.0.0-canary.5d4b82bac.0","@material/feature-targeting":"5.0.0-canary.5d4b82bac.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_5.0.0-canary.5d4b82bac.0_1579128501271_0.8821903977892667","host":"s3://npm-registry-packages"}},"5.0.0-canary.57d0186e4.0":{"name":"@material/slider","version":"5.0.0-canary.57d0186e4.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@5.0.0-canary.57d0186e4.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"9b290775686a6d12dd5e70fff9263d78cb12e988","tarball":"https://registry.npmjs.org/@material/slider/-/slider-5.0.0-canary.57d0186e4.0.tgz","fileCount":35,"integrity":"sha512-wsHbr58CjoAssnqm3qqPDfbmqP+69N06nBJYLbOFmOH7y/qs+zxaHpx3d7XKWTKJ8yoyU6AM5FO03jMeMM2/bw==","signatures":[{"sig":"MEUCIGfHOCL3U/l6KdGqN0sEwia+EgRqGsg4Z9UWfXNIobYfAiEAiXOBRS+8ojaxTkxlXWlywsPoTE23bUjCNa93x0VxM3o=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":348379,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeIKi+CRA9TVsSAnZWagAAIZQQAIDVyfYyetZXjVKuRhAB\nm5nuXpRS5bdMx+Xe1b3e3QycumlTjna3sq59/MkWWHsa0AZz84VBGRo/9LoH\nyCwRae/cBL8UXoo82XVSEEeh+EbOm3o5MjTTcpQXxhLaImipyZT1yiEmRlVb\nm61Ljkl0LxlC4TGbvn889ZghmgOjfqvN3Aag315WAd1tQCjU2KdJOaUvRgYp\nAJjh8V3A4+MrtLLcOcoeAgSgEHsOY386lOvtCJRspu5I1YOjuSfXmt5druQ8\nUqYrwE1hkzI3AMy/9H8JBodDHV2A9BGsMHGo1SEZIAJ9h5xLGJkkTaaGrmkf\nLO3dnQoxuHS7hUfaJq+UD58Z9FYrcvkhCFKqyMkEJcBmM9Z2QVDAWcVyJY3Z\nvp/0MSCzE+78EZwL/Q/iAVwXLx24vLBkIFtNPJ3CMHpTPUcyVh4IO1PFFEA/\ntRBCBhcKajDPTPI/L0Z2tfZW8zLSIhWxZVjVlf/GpHETg3hawNCaLRi1Lni9\nnEKyHnM6GbdULqR2Tkcam5KaT9dABMUrCQuLmwVJafK2zb8iAEMKpWjUnyXV\nuyOT3JfpeEUQ7Esi03njRpxN3l1iRWA+3GVLcAcWHw/Kan3BmMx93MzqOwG6\nQwvonVC81tfDCZUdTVpkgAKc/6v+hQETlsFfUugg/41o/Ye6li3z0VRxPTtt\nDjql\r\n=S/Rt\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`mdc-slider-color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`mdc-slider-highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`mdc-slider-rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`mdc-slider-rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`mdc-slider-thumb-color($color)` | Sets the color of the thumb (grab handle)\n`mdc-slider-focus-halo-color($color)` | Sets the color of the focus halo\n`mdc-slider-value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`mdc-slider-value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`mdc-slider-value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"d0058bff117ed84df93c0a71b3aa8c8d6e34cb6d","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.18.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.18.1","dependencies":{"tslib":"^1.9.3","@material/dom":"5.0.0-canary.57d0186e4.0","@material/rtl":"5.0.0-canary.57d0186e4.0","@material/base":"5.0.0-canary.57d0186e4.0","@material/theme":"5.0.0-canary.57d0186e4.0","@material/animation":"5.0.0-canary.57d0186e4.0","@material/typography":"5.0.0-canary.57d0186e4.0","@material/feature-targeting":"5.0.0-canary.57d0186e4.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_5.0.0-canary.57d0186e4.0_1579198654146_0.5628733459584734","host":"s3://npm-registry-packages"}},"5.0.0-canary.071a6ab70.0":{"name":"@material/slider","version":"5.0.0-canary.071a6ab70.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@5.0.0-canary.071a6ab70.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"b2c32aed5bba8065407289c17e2c577294b3f94b","tarball":"https://registry.npmjs.org/@material/slider/-/slider-5.0.0-canary.071a6ab70.0.tgz","fileCount":35,"integrity":"sha512-vhol6fbpKjcz+Dw64LE4+qoaInbKVTcyfBn5jChRdWBrVSZz7Q2UELH1GWR9+AaWXuUHkklRm9xgy0hfISfn6Q==","signatures":[{"sig":"MEUCIFEmLQP++hVeG/JjerIhbWoA49OczdNoNXDGfrvg8nmVAiEAwrsc+d0HCAlBIVNi7eh0WMRVjYj9T4IqfDR/YJqk0X4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":348379,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeIKo8CRA9TVsSAnZWagAAaDsP/1ZWoolJg5Fr+z510X38\n4cfm9wdI4HaPBf6cnuQSrnGN9pe7yOK3DgTJK2UuYCoYLPTx7P6b7/tjNSa8\nUP5ZYy59ZL0c+7WOkLpD30d7CrSrNvwYcUwOj0+o2a8aM6IIQitBF9AvRqcp\nG8ktHGUtXyJMWvx0JWNwVxHE3XcSfWEmNb37qC/7D9FEO52UXpjCgZ2n63nv\nEOLB4SvXMvSGYxtbJ6VbQMRqq0RVSBXQyK4VrtRO2hV5RAbbmcjJW6VwKUH4\nA3e1CL773I2Q9Sg50pVJjiGXVdfg6EtA7BU6L1EQ+pbpCfFYIDe/+N3l+SWW\nY8zpqPc7wfElIw9tY5iDdWH5/KGq47FIV55lPhe5tPpGQ4YJI7m+tZpDg65e\nXKHU3+bmKwuS7PtgDbHFu+81W/7GvkgNtJxbBQgXlL5aCACOZ8hqUIp2Y5ez\njq8CJERwYTUjEg6s8UqnKjV+7iyofujyjV3LtJvPQ/2M0+75q6dSquNFcr1h\nYG/x87W6pR6te6dd7sJ7HWfLJhm4+qGcNVv0CKE+gyJFtVqvcG2tvgdwdMIM\ntNzivV4HL8/i6/GnBO6qbQC6Vi6iW/PXyDKACXENOwoXlxZ7jm+g/L7WxQ40\nbTnRYEmMl9eRShC6mnaPTM8XiW9eqy40XTukW6umxvkQfrgseuU+AuJecCju\n5baD\r\n=NF+s\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`mdc-slider-color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`mdc-slider-highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`mdc-slider-rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`mdc-slider-rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`mdc-slider-thumb-color($color)` | Sets the color of the thumb (grab handle)\n`mdc-slider-focus-halo-color($color)` | Sets the color of the focus halo\n`mdc-slider-value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`mdc-slider-value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`mdc-slider-value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"40ae26c99d00481950066e41e33aac0545186659","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.18.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.18.1","dependencies":{"tslib":"^1.9.3","@material/dom":"5.0.0-canary.071a6ab70.0","@material/rtl":"5.0.0-canary.071a6ab70.0","@material/base":"5.0.0-canary.071a6ab70.0","@material/theme":"5.0.0-canary.071a6ab70.0","@material/animation":"5.0.0-canary.071a6ab70.0","@material/typography":"5.0.0-canary.071a6ab70.0","@material/feature-targeting":"5.0.0-canary.071a6ab70.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_5.0.0-canary.071a6ab70.0_1579199035846_0.8460530996198832","host":"s3://npm-registry-packages"}},"5.0.0-canary.22e0cb618.0":{"name":"@material/slider","version":"5.0.0-canary.22e0cb618.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@5.0.0-canary.22e0cb618.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"a280585f60f129c9bc87d04de6a17f8c611d4269","tarball":"https://registry.npmjs.org/@material/slider/-/slider-5.0.0-canary.22e0cb618.0.tgz","fileCount":35,"integrity":"sha512-6lMHIlAzDRic3At3PnNmEwWlgLKLAkkUgL6dc3WeZXYIKq+5sFm/OAdM+K63g/de8RpeNr0R7pnvTBstq1KAkQ==","signatures":[{"sig":"MEYCIQCksbv+bGcrIzWzM+llAibI5JDDvxC44asoqMdzhxhqAwIhAMXnE7vV027O9Q1PU43kyRWcr21wfpmn6vQQFbBSxH7d","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":348379,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeIK+lCRA9TVsSAnZWagAA8h0P/2yTp/U09il56KUMrtRs\nqfpTIxBfX9k86zWFoIlX9rwaMDaFdp5rgwIFAmiP9vMECQr+AnlujT/qzCdQ\n4XCnyLhphNLIXRMJ62uGHBRcHol4gxI5UZ4j9iHLegpYYH8rVDZLY/yQpNUO\ni0nfHvpiFoE20mjZx30zqJhjPqr7y4+30SWauPHlp8gSdYjzPTHSSq9QqbOw\nAzJMc78HP2fpd29CtgG1QZY38/WGqHQ4HBzq0kj+GLz7GmLTNuYYpGfszBWY\nzTTCKzh80qQPffmblCHFrrJ0RA4PTnPsT8EdzNQTY6znOM9CU8DvCSsC6mDL\nv/KsZO+HwKoZKQXGdJltPXMLWdy9qXHiFWMF5AvCehsYxKsVCUPCNcL5rYLc\nXNcDK0NtoOkj0pU1jcfKnpo4MQPwVZzT2J0V2/N+sVJ/hZq7qmHpJKR4voRp\nRPByPo4vi8at19cc7R/nU8kViN5eiLEjLDonE6M/mJRPGqHU+D5oYD5jblkM\n154DGZKScKOInob3kPg2vYjJ4twpB6jk1Lrd2/myqW0K4RO2+3pVtq988Zel\nLN4wLpWTU0HwvJKLMAAXpeh/XOy+3Kvdn3ZOXpmTKb8VArloKYr3OFp/UZd/\nsEDf04TscXVOTu38wlyTXSd3Jq+Cuj8MR2Bnf91FiOzDdVHtfMn3etG05NkA\nhYM9\r\n=c645\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`mdc-slider-color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`mdc-slider-highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`mdc-slider-rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`mdc-slider-rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`mdc-slider-thumb-color($color)` | Sets the color of the thumb (grab handle)\n`mdc-slider-focus-halo-color($color)` | Sets the color of the focus halo\n`mdc-slider-value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`mdc-slider-value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`mdc-slider-value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"a2ebae5c07da66b94270b07b137673cf19d6d344","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.18.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.18.1","dependencies":{"tslib":"^1.9.3","@material/dom":"5.0.0-canary.22e0cb618.0","@material/rtl":"5.0.0-canary.22e0cb618.0","@material/base":"5.0.0-canary.22e0cb618.0","@material/theme":"5.0.0-canary.22e0cb618.0","@material/animation":"5.0.0-canary.22e0cb618.0","@material/typography":"5.0.0-canary.22e0cb618.0","@material/feature-targeting":"5.0.0-canary.22e0cb618.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_5.0.0-canary.22e0cb618.0_1579200420965_0.4981983343173648","host":"s3://npm-registry-packages"}},"5.0.0-canary.f16f15b8f.0":{"name":"@material/slider","version":"5.0.0-canary.f16f15b8f.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@5.0.0-canary.f16f15b8f.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"884b9732687f848ecd014a2fade7f2abdc27d818","tarball":"https://registry.npmjs.org/@material/slider/-/slider-5.0.0-canary.f16f15b8f.0.tgz","fileCount":35,"integrity":"sha512-EBLhr4ie7OJiSg5WqxvS9anzBF9fwm3yLzpzAb2NCmOzw7yn0PpklDmJU5tlnAszbNVVGzFholfLubzGgYG/Og==","signatures":[{"sig":"MEYCIQDNnUmoiP9kaA147hQvwZyjTIikVuYw9SOuSQT25PuEBAIhAPMPENqHRCyrqUBofiLHZmHhKzGReNd13CMGl+VTj5Wj","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":348379,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeIPqnCRA9TVsSAnZWagAAwdkP/iDxbwcv3xtXZsd3X7Fv\nXaQDNGGIMHA3mtGGQ6eclItFhSSJEMq5faEfOwoVrHcLkZCMBLVI+CZSbAYx\n3SA1XdBH7O5os90rjuoM8HVFuq25B0m1lzUHUfCeOBpIfqxdlUE7ziRC6Y13\nN5fHYnHhjy60pnciebAmu2jMyLkBZMJ+psN6VUzFw8QvaCKy3qSIZR6wG9/3\nh+XYU0ZO30CBRMtZk9cOsmQAk/KATYdbhatkolG8x5B66qogm8RoDB8UzbQX\n6n7qR7Wm6D+I5yIbYywSWuJtxhnEdtbFkSlLdB5pCovuWn07fe2g2AtQ2wuj\nzowTod+XX6Q9A++QcV52fPWzUfQLP54TjCZ5hNzIM1DEs9YTs6S/yQZxCE+3\nf1yBCW42j8zU5vRV3eRsS0fbwxSKen7kJCfbOuu1+VYiWuJtHys7iTz9ZHZB\n8+vBa2Qi19BLDvi4i+yqxlImX95Pni7eolKeUfGliueyEfDVRexZUpRf7ZSK\nXhd7xvB6QxKurpHHyhsQTzTqt8VHIM7h6RdaZky/kD39KJi7E9GSmknFKF+0\nv3Xl4fRzlvdeN7F/PIaa8u6H7KuqaN4wm8lN1yPxXSrTvyUSfTPNXMve3JY5\n9GyMVDAUR8Hkc31EvCkXUSZT/We8Xs7uGJn5TsomB3MKf5yBHhYawz6T9Old\nbU2P\r\n=nff7\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`mdc-slider-color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`mdc-slider-highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`mdc-slider-rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`mdc-slider-rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`mdc-slider-thumb-color($color)` | Sets the color of the thumb (grab handle)\n`mdc-slider-focus-halo-color($color)` | Sets the color of the focus halo\n`mdc-slider-value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`mdc-slider-value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`mdc-slider-value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"edeb2cce6b325b416aeba9bc6f4598eb518f8b24","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.18.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.18.1","dependencies":{"tslib":"^1.9.3","@material/dom":"5.0.0-canary.f16f15b8f.0","@material/rtl":"5.0.0-canary.f16f15b8f.0","@material/base":"5.0.0-canary.f16f15b8f.0","@material/theme":"5.0.0-canary.f16f15b8f.0","@material/animation":"5.0.0-canary.f16f15b8f.0","@material/typography":"5.0.0-canary.f16f15b8f.0","@material/feature-targeting":"5.0.0-canary.f16f15b8f.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_5.0.0-canary.f16f15b8f.0_1579219622682_0.7134582753358503","host":"s3://npm-registry-packages"}},"5.0.0-canary.aa8e43e9a.0":{"name":"@material/slider","version":"5.0.0-canary.aa8e43e9a.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@5.0.0-canary.aa8e43e9a.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"9753a57427958e8237f248b1c12ae07dece070bc","tarball":"https://registry.npmjs.org/@material/slider/-/slider-5.0.0-canary.aa8e43e9a.0.tgz","fileCount":35,"integrity":"sha512-OlQJi5iFVaEVyXl9y5lI8+YRcFjrGpRweael+Iag9r9C2yVJErQXfOTt13+vVXU8nlDQN2lU93coDRn3Y1sk1g==","signatures":[{"sig":"MEYCIQD1ApKM12a+lLfhaE9nmhpal588WOQpArz82NwUZMI90gIhAKigGZO5lcu7FeXPvxK66g4fDdh3Fq4YoSHPUY6yrno9","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":350709,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeIQGaCRA9TVsSAnZWagAA4EkQAIgNiY4XEmvj/Hb3wtkL\nZeJsu/psnBXLMy2YjtT02JJIuH+ya866x/RinXcuhhNibMru9gg2bPXCW6p1\ndYj9r84OcAbsP4di/j3Ho6Yi85+jK+8QverTIL61HpseDXnnr5itgg5EXlkH\nOOHanDy7RS482fda+2sdq2+b/e+sXXjw/yxxq2xGPLLc3KF8I3yEyHSkkXpv\nXYtVZZVwcvC+/xt/76CgEYxIXykaIS8TKZSXm2PDlC5ZW3582xGuWesd8pJW\naWbCsOVAKuNN/cgAhhhvhMm58+4egFCQdXKTmAJpe8O1hwM6UGhq5alyc8QF\nJzgVtkYWs6yVQvUyGUpyPQroLEpWCs2qdt96af/nL6/8s8bGeQxgZtldhhBp\nMyMC9erZrhR641em3XxNYSdoDHlhwSkbr4hPyfTjVCzn+ARvV+SJcsfsZYaW\nonwu9jmYBOjnK26HPfcYHy2BkNq+HyhjKVoQVvsebOyMzGsXGMo15dB4dZ1i\nshqOYMCp4yQB4B+5HryG81vQUjSKZQH7eUEfumyrBWA69hijgJ49nd6qyASU\nB6GT4wAeQSXaolskYhtKbmWGcf5IuCvKlua/EQK8cIcT4BbXeKbD8la2fvR4\nCgSl+Vx3zIojb3AWppSrRJZSncjkFLWYZEslvLNnh2KjaHRSN+NYzK2JtTQe\nBDvb\r\n=Cf5T\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`mdc-slider-color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`mdc-slider-highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`mdc-slider-rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`mdc-slider-rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`mdc-slider-thumb-color($color)` | Sets the color of the thumb (grab handle)\n`mdc-slider-focus-halo-color($color)` | Sets the color of the focus halo\n`mdc-slider-value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`mdc-slider-value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`mdc-slider-value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"b95162346a28c58839b2d3e52201e1f8c5fb9789","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.18.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.18.1","dependencies":{"tslib":"^1.9.3","@material/dom":"5.0.0-canary.aa8e43e9a.0","@material/rtl":"5.0.0-canary.aa8e43e9a.0","@material/base":"5.0.0-canary.aa8e43e9a.0","@material/theme":"5.0.0-canary.aa8e43e9a.0","@material/animation":"5.0.0-canary.aa8e43e9a.0","@material/typography":"5.0.0-canary.aa8e43e9a.0","@material/feature-targeting":"5.0.0-canary.aa8e43e9a.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_5.0.0-canary.aa8e43e9a.0_1579221402347_0.7507010721205065","host":"s3://npm-registry-packages"}},"5.0.0-canary.fe1f3ca07.0":{"name":"@material/slider","version":"5.0.0-canary.fe1f3ca07.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@5.0.0-canary.fe1f3ca07.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"6ea13b93d8eef97e85d9c7decb035c8443972adf","tarball":"https://registry.npmjs.org/@material/slider/-/slider-5.0.0-canary.fe1f3ca07.0.tgz","fileCount":35,"integrity":"sha512-Uvc2WRjSizkZ8tli4XfaSD13g0lmjWUkLOWU2kWLAPh2dOBPbz7++wmWaD3nQK6ZpiquxVY8QOspuWVDkU+HFg==","signatures":[{"sig":"MEUCIDKoILTzKWFzP0muKPEQCTNfvThUVxiGCe2DyRdPemHhAiEAw7qxjCPua1wFV/RcXlNgB0zEuL3XPQhwC7FIM+Tp6H4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":350710,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeIQchCRA9TVsSAnZWagAA14gQAI0NC9Kn47Z4C+q2g7Nj\nWsf78AXbvzjzAv8XnnANx9R3Bc/X/4V8WSIxkSbrTWQdqEi0aNlAn/5XPBfn\nvgVFKqsO8VBk2d+MqEVdDFtSn+k6iTm5B+7VpCz6tM1OUltJ3zLPHomYdUxq\nov2G08nVvz+K2ooqnNZ5zDdydgh/bz0E2ggcPupYLFEsFd8DirgKvRjiCL45\nxFY4KJJb5KFHD7wRx5PgG7wonpQ6kcSBf08bDkYK9NdnF+bVqWsYIbjTLWi5\nv0qLAfzfCx5sDDkIRY5j8YJEmiErmQWqcEcUHS+KGBrXKF2yhLm5+Bhj3cF2\nIOCvFDRCP2FryIOXpuF9yehx34hmTGHgXprdXQsJ+qzZyt1f0+rvJ21xDogi\nTWUZXZvhsgiZ6z/qiPseJtI8z17dA1x1h3+FZHYTUKsrOGbfjD/8MaLa40UH\n4kFL4a75CcU2dDna4vWeC7sp1Mev+GAxq4571XuZii6jYkkdH7hdw7M0KOXF\nW70lBn+saVX6jAdlppR9ejBsDAAvV5CfMnCvZURkKDhv2sRxuQixQe9tqehV\nTLuIogLvV9Zfn3PPO0fZWbL/GqtSpyrskuf4OHUECeKmjchcHUqiUn9lV1MQ\nklYNev7yPEbArJpRfjmJBE/+zRjbNAqUsmvAme3gWYLllDeYfp4TNGQRzb7X\n0liK\r\n=prwV\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`mdc-slider-color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`mdc-slider-highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`mdc-slider-rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`mdc-slider-rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`mdc-slider-thumb-color($color)` | Sets the color of the thumb (grab handle)\n`mdc-slider-focus-halo-color($color)` | Sets the color of the focus halo\n`mdc-slider-value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`mdc-slider-value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`mdc-slider-value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"55fb21a2166199c09c2ec1273c4d38c6c3eb8cb3","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.18.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.18.1","dependencies":{"tslib":"^1.9.3","@material/dom":"5.0.0-canary.fe1f3ca07.0","@material/rtl":"5.0.0-canary.fe1f3ca07.0","@material/base":"5.0.0-canary.fe1f3ca07.0","@material/theme":"5.0.0-canary.fe1f3ca07.0","@material/animation":"5.0.0-canary.fe1f3ca07.0","@material/typography":"5.0.0-canary.fe1f3ca07.0","@material/feature-targeting":"5.0.0-canary.fe1f3ca07.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_5.0.0-canary.fe1f3ca07.0_1579222816780_0.2485376569619755","host":"s3://npm-registry-packages"}},"5.0.0-canary.d405af26b.0":{"name":"@material/slider","version":"5.0.0-canary.d405af26b.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@5.0.0-canary.d405af26b.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"4b985c5026465c478eb0ed66d17f3230ef94a0d3","tarball":"https://registry.npmjs.org/@material/slider/-/slider-5.0.0-canary.d405af26b.0.tgz","fileCount":35,"integrity":"sha512-QCJqygQWZ/5xQshg2oy834CP83oRt+cGpIdTk7z1SEKBOCqklL31rw0R27o+fg0XA41bse2aQ/UxFiAW/1mO3w==","signatures":[{"sig":"MEUCIQD/Vkf1ofIUmuG2gBEZaKHV9AdDdgslm0uWGrC8rAQBoQIgCxg9vRzAKe5uEo14kqngyKnfpAyuTuFPS18OeRHdBSk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":350710,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeIfoxCRA9TVsSAnZWagAAYikP/3eryOnez8EOTi/ztfcu\n1IF0cdC+kPaZPuucO1wdHb/5mXgt0Lmokd3Dqb2eUr6bADoaWO9L8tTwTAtx\nplY9GulxU4UkV7muQaKkRSumwRcMnkCwYAXkK8cSXJI7qgpVLRjVO9Fh32Oe\nLAhmst9Lj8VW2fkRmmKzDp5JH+Oryd9u+DKLKjN9CQrp4X1g/wzvosNCZ6fg\nzNb485mQaa+4j59OscUlWHPmOLM0lRyhiVVkNepdU8CQ6of54DY82sfJOPfs\nZmt+ogFNvMzm7QuLGbnir6U9eb6/N+5J7sjEOy5GtI9qgNuCMShBr5rSaDRy\nLHAagBA7pQJTUGeJ38O1rhOwmh5asuU4Cp9GLgVmdKYQZpDNXlxa40pdD+ZQ\n8mQJgp1LitXqWUF3E6LVzj6wcwyG28IHX9oNpQ6WK3g2XxPkqIHs6rYNVAqS\n9YqYfg+n+Bwh96v7r2A7qPmL3BLzuuObupibyYg212c7S3cIJObUwyOMZqtH\nij4dLhYr6cJwf1r/+f7BsuukoOhUJVDL0I72m8u+2SoVjloUBsOJmsnBb13J\np8UouwxiRebeO396/lTu2hRTuy0BfQLLqgmcaQi5MCLnCoJYgZMqK/S0z8pi\nNgjfpSuNmGmIjXxAk31TK6eU9pvxm2wpKP68F5vcLZPtLfug6SFP926KLFjM\noGrT\r\n=0392\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`mdc-slider-color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`mdc-slider-highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`mdc-slider-rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`mdc-slider-rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`mdc-slider-thumb-color($color)` | Sets the color of the thumb (grab handle)\n`mdc-slider-focus-halo-color($color)` | Sets the color of the focus halo\n`mdc-slider-value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`mdc-slider-value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`mdc-slider-value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"0520800061215f99c3d58fbcb661327da2b8c126","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.18.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.18.1","dependencies":{"tslib":"^1.9.3","@material/dom":"5.0.0-canary.d405af26b.0","@material/rtl":"5.0.0-canary.d405af26b.0","@material/base":"5.0.0-canary.d405af26b.0","@material/theme":"5.0.0-canary.d405af26b.0","@material/animation":"5.0.0-canary.d405af26b.0","@material/typography":"5.0.0-canary.d405af26b.0","@material/feature-targeting":"5.0.0-canary.d405af26b.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_5.0.0-canary.d405af26b.0_1579285040952_0.8388401657605424","host":"s3://npm-registry-packages"}},"5.0.0-canary.6e857aae2.0":{"name":"@material/slider","version":"5.0.0-canary.6e857aae2.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@5.0.0-canary.6e857aae2.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"d876be828a0573f0d9042773554f9550c7aeb8b4","tarball":"https://registry.npmjs.org/@material/slider/-/slider-5.0.0-canary.6e857aae2.0.tgz","fileCount":35,"integrity":"sha512-FnKRc7y4Gne3gOiHfAdwPVOfyOHMi8N49+N611mF9HDGBAfvwGLfmRb+2yDu5WUHvhUaz9WBTEvNhV4I5VLT1g==","signatures":[{"sig":"MEQCIAyDjgHSnQHzCsTu5UDpAgV0kCY4wPjvTdrHAg/vkV4lAiBqfIGo9qw+xgm4JWL0eyd8IaHTAJwuQ0fBQcFYVH87wA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":350710,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeIfr/CRA9TVsSAnZWagAAmMoQAIZMjl+x/Gw+PYVA/zZi\nBym+Hekgdc74d36yS2UtxYspQ4MiFbpj8YZORQm/gdfYls5eOocD5n/O9rJo\nfTxUzv5E+VQc34ovuGcGbfXJufhTToWl92761X67Ti9e3Z3Lry/52fHgFr+y\nXA+aiTrG61J3u5dkmSsrBfDeXQWDWlLsCpZfSU25a45Bx4POpnGiX8M4KSop\na6XEyd0dnO4yTly4z39kFTnonl4+g+cHuPbFNVjFgQO2TU7XzfzQpJacpYmP\n04jhbnv9F7yKPXLQkp4uz6IGv8k6CsbVNUzz+dd/K+88HyOhXcvca0yYJDTw\nTGqdBjhu1cIBg+AU/CUXa4KQnhb7QXfT7p4o1Ox9Jpit/0eXa/q4CrwhQuzS\nCWjTFRD9l2vuAZFVToHmjJD36BKgD60ayMx7FXEaVyGj5gVQDQ7TIIYbgM6o\nX4ytA5NDDyG5pu6TVcDyo8BMdMvJY0F9ysY7hhX73aZymm7+PyVbXGRu3A7v\nbaxZRZb3YbKx3MwMsnI6Q21c2xvzwfDSwLOP1EKPEH1w6bVSO4HJMSYSWzXT\nC7HhyPM4M67YB0s16kXR6dfx4DvRfJmc59Oi0yhBwgFBAWVvBlsDK13Xu7at\nJj3IIiq3brKqL7Kq6913dxS/WKrullqpivtk/tKrAjHqVIOk9PkK5iR29fB7\nfGsf\r\n=Lv68\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`mdc-slider-color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`mdc-slider-highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`mdc-slider-rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`mdc-slider-rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`mdc-slider-thumb-color($color)` | Sets the color of the thumb (grab handle)\n`mdc-slider-focus-halo-color($color)` | Sets the color of the focus halo\n`mdc-slider-value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`mdc-slider-value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`mdc-slider-value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"2a53aa5d8048725819709e1279ce78762b8b6170","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.18.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.18.1","dependencies":{"tslib":"^1.9.3","@material/dom":"5.0.0-canary.6e857aae2.0","@material/rtl":"5.0.0-canary.6e857aae2.0","@material/base":"5.0.0-canary.6e857aae2.0","@material/theme":"5.0.0-canary.6e857aae2.0","@material/animation":"5.0.0-canary.6e857aae2.0","@material/typography":"5.0.0-canary.6e857aae2.0","@material/feature-targeting":"5.0.0-canary.6e857aae2.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_5.0.0-canary.6e857aae2.0_1579285246829_0.21291560928507636","host":"s3://npm-registry-packages"}},"5.0.0-canary.e2e764f7c.0":{"name":"@material/slider","version":"5.0.0-canary.e2e764f7c.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@5.0.0-canary.e2e764f7c.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"860c80272e3f5aedcad6199690e03b6a7cef042b","tarball":"https://registry.npmjs.org/@material/slider/-/slider-5.0.0-canary.e2e764f7c.0.tgz","fileCount":35,"integrity":"sha512-sqPnXWmCovRAOXoDuGCVRgUzsf+pGqhnpiTsyr0o/ubb9S3z6o2ZgfXNtLe1GVYJXuNPPGZgeY4gkGC10IRpWQ==","signatures":[{"sig":"MEUCIG41wyyre2Eq+4Dl1F5VOjOys88OMjSRjxcOqyyAZnECAiEA2K5hY1yJfUpz+Bhantg4Bv0Xa2MD9Xbt3zxEbgStxEY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":350710,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeIf6QCRA9TVsSAnZWagAAu3YP/00ZWqXcWvIzn0HcUKpK\n+dyyTwHw71YXv8eiVHrbW+y77Io+0Ipa2nmDLQUEtEMP1l/1hItvOdB5J7DI\nrjt/QncGPl2RuCtOGd5ElHl2MCuyzFQWwNzn9GCq3eNd8r7ViUDXuGsn+LMz\nGQVMEwql57qWF80Z1GmwgtJM/GUvAqvK542v8vz5ztPvsPHsG84JB6E70XPR\n/0zFJeG4QhndwZ4KxtW7vkOTTv6ewHMJM669lxRj0yht8Xm2Mm8y5byRdqq9\nFlLFwh1WnVekbMs42yOMW4k6KRC/38wi1759pO9OtpSNrUkYwYwHUQYXCxJx\nKs7P32QSX6UscYwk86sVe+P++6hOmB6f+e5IAsExgavenfjjatcVnEWfqThx\nLPl0AHXbIxwZpXnduv3oRmWc0IxUdLU2Q/cecxHVMtCKVqknok8bQ9jaZ7IU\nivyMnT/mF9XHO4b3k7pBB47xADpSF80iLuicDLLSLwf78IwF/3sMVOhsh84O\nZXi5JViQJm25lgJgYqrJRZv1GH61zPIgrOXMuwPRqoeeCIoJZcZd845S1NUT\nLCAPVn9XBGZaT0Az+/SjoTc+rVzsJCpY9aNHG7LTW0x4sJhjdKbRA2y8uhMd\nG9ARURistdKusi0hBGERtwbtQSzw4mrjN4+9YyFfSC/5NNkmAXhmFv6SuiYT\n5aMK\r\n=GwW8\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`mdc-slider-color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`mdc-slider-highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`mdc-slider-rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`mdc-slider-rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`mdc-slider-thumb-color($color)` | Sets the color of the thumb (grab handle)\n`mdc-slider-focus-halo-color($color)` | Sets the color of the focus halo\n`mdc-slider-value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`mdc-slider-value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`mdc-slider-value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"9dd6d44ba7288e1e0e80905a629b922c21b54e37","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.18.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.18.1","dependencies":{"tslib":"^1.9.3","@material/dom":"5.0.0-canary.e2e764f7c.0","@material/rtl":"5.0.0-canary.e2e764f7c.0","@material/base":"5.0.0-canary.e2e764f7c.0","@material/theme":"5.0.0-canary.e2e764f7c.0","@material/animation":"5.0.0-canary.e2e764f7c.0","@material/typography":"5.0.0-canary.e2e764f7c.0","@material/feature-targeting":"5.0.0-canary.e2e764f7c.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_5.0.0-canary.e2e764f7c.0_1579286160330_0.08269634870081011","host":"s3://npm-registry-packages"}},"5.0.0-canary.7ef986a87.0":{"name":"@material/slider","version":"5.0.0-canary.7ef986a87.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@5.0.0-canary.7ef986a87.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"e88771cd8888ad45f0207eb29dcbd46de5218eae","tarball":"https://registry.npmjs.org/@material/slider/-/slider-5.0.0-canary.7ef986a87.0.tgz","fileCount":35,"integrity":"sha512-wMUjRSQ5p0enZmWuqqSYJ6YYMq5yUP6/tpLi314wkuxwGkzSRwgvLCJaHpqRnLDciAD1jiv5gW8vHw/gTsBenw==","signatures":[{"sig":"MEUCIQCtuFhlZt3CZvnllXIjDsYg3uHKwS8t7DJS5e+rurj5kAIgaGAqPlju4glPVgptv8/bSN79Wjzuamh7DM0dPArchxI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":350710,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeIgtrCRA9TVsSAnZWagAAUPgP/2nI+3hf3F1ogOnfcjlD\n2BaNlIh3aDacfzIlZ8vXJE6cnGYPLoxExQmeO4o9gomnwosFH85H9AQ8L6oY\naMBL9gxzBgWpKSKAHlTs4Anu3eyuoG9DPzeHE4iFLDPC7w+Fp3w2vjRsO5TR\nODDbpsAWK8F9JWtO1bdCGKewlE6sV1pOo4SaPonz86RW0W3YigiKMse1lCmu\nUX8BgzLutV5IVxfHMnc0DkxAvZA9VRUx0nEbH+rKMtfDgtn7c38ilH1arBc5\nSXloF2+J2A7MyXn5yb8xj+Kp32l7wXjizhoidPDK2gDlLNLYoYi2THHYdVno\nPCWXdotO+yc3LT0GCJItBk7B+aFx47Y1ov6DrGTXqNHoNjrmb31mMQpKxxY1\nxm/tnH1o5qq05IotvV+UbTb6ihA1ybHeN7KrZ8AA3C2oOukX/GHF7aQImUWt\nGSY0P0t58BjWVjro73maL4gloO+TLJ0kxuiPPbjRwptzCNLr3Bzgsc8H7l3j\nf0OFFSzUn9vbS7qlUDdJxUaDFWanHab1YQHfeqx5VTMZ7jIe+A8uKSHn/DPn\n/1tM91cDlTbrGJaGwtgoQbIK29vWF4VXyRyx5/yy4+PFvC94yPW2/wYmYoul\nqSoSk6DD4nVgd9LEdpAAZzuVK8aRDV1EnrS9sy8X1jdQxzoZ9xwiliFx1Sx4\n43is\r\n=1u+b\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`mdc-slider-color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`mdc-slider-highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`mdc-slider-rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`mdc-slider-rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`mdc-slider-thumb-color($color)` | Sets the color of the thumb (grab handle)\n`mdc-slider-focus-halo-color($color)` | Sets the color of the focus halo\n`mdc-slider-value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`mdc-slider-value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`mdc-slider-value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"d18e160fa2a4eddeeddf0a07020cc2cecff9b573","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.18.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.18.1","dependencies":{"tslib":"^1.9.3","@material/dom":"5.0.0-canary.7ef986a87.0","@material/rtl":"5.0.0-canary.7ef986a87.0","@material/base":"5.0.0-canary.7ef986a87.0","@material/theme":"5.0.0-canary.7ef986a87.0","@material/animation":"5.0.0-canary.7ef986a87.0","@material/typography":"5.0.0-canary.7ef986a87.0","@material/feature-targeting":"5.0.0-canary.7ef986a87.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_5.0.0-canary.7ef986a87.0_1579289450773_0.38014501634609377","host":"s3://npm-registry-packages"}},"5.0.0-canary.29402e2d4.0":{"name":"@material/slider","version":"5.0.0-canary.29402e2d4.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@5.0.0-canary.29402e2d4.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"de10ae6edfa3fce1e3bfd350d7a3b15cede5fda4","tarball":"https://registry.npmjs.org/@material/slider/-/slider-5.0.0-canary.29402e2d4.0.tgz","fileCount":35,"integrity":"sha512-HFeXZ/ekVxUtaeP8q8H4OM1m54z15xiJocwfWHR4NegJw/Y8Gh7OesTXSvbCh/ab+nzZFsWQhcURFZhN2mrt4Q==","signatures":[{"sig":"MEYCIQDEuObV618EA4LxMiKgZ2ujb4PJSXbad8fTgAhXNkHlJQIhAOr+/xkAqpAX3q/AasUf0QH9UoH2ku/bOdwzeiZc/tfd","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":350710,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeIhuWCRA9TVsSAnZWagAAe90P+wVCpSvW3Wr5m/WygUx+\n5KSF/6oOO3mWBo7ZZrHevOs9xEVjybIH1UZSRBkf3ezmzzuRCM6XRzMul78C\nrdgmFyVN5BH5WTpDSL14D0dQqvLgAuZRBdsSDi57AJSsc5Xud2XFBeLQo9JD\nelqM/z8Suyq0oPL6Jn4banAbTaEHNJeF0BdCFlzhwXYe1k4v97gqrJkARWY4\nvk0SxlgX371NkEnVxLTqB5ewGWXPSjAkqpasKaP+J1x+ZdDFqKz5p5Yf7Lyf\nkAe8z5QeuphBVozIIMwkxSdV2JfoO4D3qJEMaOt1M9EcnzzL5z3Mycj7tKIV\nK0N3JDKHl/kv08B64z//uXK2Y/z1MqMvJ3VTHQAq8z3E2FgAjfUtCGYizrxt\ndWHJEOoZc0sGaZhBMz8W6wCqHKdqpFRRHoLiSdABMh5NL7ymMMr4bOuD8YXh\nXvqQL3l7yJfdkETct7CNd6TrG3WttoQVqCzoOf/mqgXnJDli8MQrJ5zM878N\n+pQsilb/5Bd4DZxHs7ro2Blyp5Zjv47YEIXZUYmsWlLF2eShzd9+zdTOM7/7\nU+oRJ/loG5I1liTGBk7JkegQK/EvGNarMGyCgNMLpP8NZgOxrvoVG5YRfu71\nd/wxWNJZbDygUx2lH0KgYNcfg6ARldrCJqiyw20O1vFJz1kP6MjVcSkE8IJD\n0pE/\r\n=NHC9\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`mdc-slider-color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`mdc-slider-highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`mdc-slider-rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`mdc-slider-rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`mdc-slider-thumb-color($color)` | Sets the color of the thumb (grab handle)\n`mdc-slider-focus-halo-color($color)` | Sets the color of the focus halo\n`mdc-slider-value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`mdc-slider-value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`mdc-slider-value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"6c6caf45e8fd759ec1c6409699c53250c8c41f25","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.18.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.18.1","dependencies":{"tslib":"^1.9.3","@material/dom":"5.0.0-canary.29402e2d4.0","@material/rtl":"5.0.0-canary.29402e2d4.0","@material/base":"5.0.0-canary.29402e2d4.0","@material/theme":"5.0.0-canary.29402e2d4.0","@material/animation":"5.0.0-canary.29402e2d4.0","@material/typography":"5.0.0-canary.29402e2d4.0","@material/feature-targeting":"5.0.0-canary.29402e2d4.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_5.0.0-canary.29402e2d4.0_1579293590340_0.4466983798580584","host":"s3://npm-registry-packages"}},"5.0.0-canary.2b3ec563c.0":{"name":"@material/slider","version":"5.0.0-canary.2b3ec563c.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@5.0.0-canary.2b3ec563c.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"966abff3cdeec3b297f13894f435dec548d9ed18","tarball":"https://registry.npmjs.org/@material/slider/-/slider-5.0.0-canary.2b3ec563c.0.tgz","fileCount":35,"integrity":"sha512-VnvYaZZFm7ZcWD4cSR5918sWoL3ijS/7xyvBPM6cvuXXmOTh+2zzzfoFDpQRXFA5Wow+hEGGdceLjtxJ0hb7ig==","signatures":[{"sig":"MEYCIQDdEU8cGEyuAn9AIn9V+1Y/WdYxOLHtRBS6u0qaI/5ERAIhALsoAO57xvDqTN/eyBdngrO5VA7Cbc0aGCZIHhwFWnS5","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":350710,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeIj8lCRA9TVsSAnZWagAAt6AP/j6k4cGMMpwRAbAA8RfB\n1pA8afI5TGBrsiSch/OpGdpAaKKruPcLAeAX7S1pS9XWvF0rwrysoeuf5RN5\nODbu41+9+G0gQnJ+orQ8EhlVD0JxBcgxt50mglLg8DiSoNGSIxRhaeD1YURj\nBnzUW+KHQHJanVYagy0M3PfP7Gfg/ERZeagqNYJTLiucSjSzn8k1AWahTwDW\nZivI4G5inPdGfNTxdEUa2XYVxV0sWVcgd3cIaFGeveVNUYv8lulnsBFp2aUh\nsrkWcRKofZ9k75fmIh0JvpSRhOoNFrygfcsFORi59BT20EbrjnNVTP6QYUA6\n1+AVXvgGvpKff3jfbg7yg3QMbb7tb4qycszpol9VJJu13I2AQRwCSMDVaxTB\nlcWcPycxy81iESS+2cMj2q8ERzJ1/VuLu//11mhV1c4m9NT9u75yiBNJAxX6\nbPiK9T6zrx6ibBDaFiI7PrCf2ZIQ+/RkzQsSrrF6DyUARtMgUOOvIrgxD13L\nkK9E4SoCFt84zuuQmEfx0xuJpUHyxV/6ZVE5KfiTqQxRdZO9LyfiHde4ytU8\nSIWznnWlAFAzIs7RS9EMpep2TD3xbM1/VxEyNMWM65NpezqUZ9km5XLLolYA\nqjS94bhiVFsTO6MyXmno2h+Pvzw1HXOG3MMPHWLHDgA7ITs9iLrvzWSFIZLo\nHgn+\r\n=H/yG\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`mdc-slider-color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`mdc-slider-highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`mdc-slider-rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`mdc-slider-rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`mdc-slider-thumb-color($color)` | Sets the color of the thumb (grab handle)\n`mdc-slider-focus-halo-color($color)` | Sets the color of the focus halo\n`mdc-slider-value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`mdc-slider-value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`mdc-slider-value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"e0de6399e32c2553a23c71775c8e5b54fc527e5f","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.18.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.18.1","dependencies":{"tslib":"^1.9.3","@material/dom":"5.0.0-canary.2b3ec563c.0","@material/rtl":"5.0.0-canary.2b3ec563c.0","@material/base":"5.0.0-canary.2b3ec563c.0","@material/theme":"5.0.0-canary.2b3ec563c.0","@material/animation":"5.0.0-canary.2b3ec563c.0","@material/typography":"5.0.0-canary.2b3ec563c.0","@material/feature-targeting":"5.0.0-canary.2b3ec563c.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_5.0.0-canary.2b3ec563c.0_1579302693012_0.8194373653811655","host":"s3://npm-registry-packages"}},"5.0.0-canary.e8a993677.0":{"name":"@material/slider","version":"5.0.0-canary.e8a993677.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@5.0.0-canary.e8a993677.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"503e31444bf828ad6ceadcb4cf0eb07b15136b92","tarball":"https://registry.npmjs.org/@material/slider/-/slider-5.0.0-canary.e8a993677.0.tgz","fileCount":35,"integrity":"sha512-XF/oushxxMYdnWMTCGCOhEdnWTgZnZgdlQaE0h9jQtB5GvZXOOZqBCm+qpIPXdMnKQwJnjDxVWlPwpxqqmGTXA==","signatures":[{"sig":"MEQCIBodg7AVUz/qzDUAHwoVJYvfpbrSkM1ckATUtWOYCHFLAiBSVeL4OyR8Yye0pcG7l+EYZd9zRyaTi3xxsPQrw8WgFQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":350710,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeJyulCRA9TVsSAnZWagAAGYMQAKSpMb81giySBzfqskl5\n2Xm0yB+QvwcCv++skCEwS79aCCIGL7SGF8f0iNGFD8YkROKujNEm4eufDMAx\noVbL2RyG2IKIbLfe+aWMmsxP2mEqAP9/esSF3lxcLAFwoPhn7aAwEuXBwdgF\nMw8u7A5DJuao/6KyzD58O1O/S83eupz1VkUA4lvuX+ciDUW49ah00sLNOm0S\n1gB9mv5cmlOpfyme3nl655kSfaVxTaUCYfxAzprNZn8IWavBTsLoh8L1eH4k\nXVPncY1qGrhv8R3LAhgMlKEJDctu3Kfe+rcw08z5HsBp8tlUUyBUyPmEowbp\nQanjHLv0ZkDqr9dsqHz8KagCET87V+mrrad0FTxl4tMasC64FNStPEmbKwon\nTbdwHITCRkYbJdVvR7Fo4B9pNPNMefcQHVEGI/aBHEOccNmJ4HrLnCugA57F\n7nWgumJfdWF3EktrpGvZDx9W5iAdxx4MeFX28G3wfvccwZeNCHKaQms7T01V\nTQMKzbDw1eg4Geb2Ue4vvLKLg1vgHdJewHTheFkC7ShctGEoWu/0a4rJ7bH1\nsRTwuUMO7EB9yOsgMcvfg3yUzZH+sMtzimjf0rzvO6Pk3Cj6Z6EM9eJ8Ii2Q\nvj1NAuDGDAgS7w/nry8YW8N8nkUHn7IrcqPT+M2I1Dg5V1lQh30bBXBU2SO2\n6zgq\r\n=88lC\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`mdc-slider-color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`mdc-slider-highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`mdc-slider-rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`mdc-slider-rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`mdc-slider-thumb-color($color)` | Sets the color of the thumb (grab handle)\n`mdc-slider-focus-halo-color($color)` | Sets the color of the focus halo\n`mdc-slider-value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`mdc-slider-value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`mdc-slider-value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"653e52310f90e65950905e8fd8fca6f99e87ba63","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.18.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.18.1","dependencies":{"tslib":"^1.9.3","@material/dom":"5.0.0-canary.e8a993677.0","@material/rtl":"5.0.0-canary.e8a993677.0","@material/base":"5.0.0-canary.e8a993677.0","@material/theme":"5.0.0-canary.e8a993677.0","@material/animation":"5.0.0-canary.e8a993677.0","@material/typography":"5.0.0-canary.e8a993677.0","@material/feature-targeting":"5.0.0-canary.e8a993677.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_5.0.0-canary.e8a993677.0_1579625381070_0.5073573411846528","host":"s3://npm-registry-packages"}},"5.0.0-canary.cd4903304.0":{"name":"@material/slider","version":"5.0.0-canary.cd4903304.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@5.0.0-canary.cd4903304.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"68b7cbc075eb3630e6bb778a4bb8f973cccc62e9","tarball":"https://registry.npmjs.org/@material/slider/-/slider-5.0.0-canary.cd4903304.0.tgz","fileCount":35,"integrity":"sha512-2+XJ7rHruxjbOZ0L9xJKeDPD5gq2G8qWSMyv9eiqpTEHhc66i2jj3rknIqM4ILgYjbhKQb77UmQK8bOO/+DzRg==","signatures":[{"sig":"MEYCIQDwmmE6e36GywTApAhYOja8C2n7iqqmg0cOyRfTWwGWQQIhANQDX2qv+nUR8Tgwg/j/6P2oswbofj0skbjA81mvLXd1","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":350710,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeJ28SCRA9TVsSAnZWagAAyLgQAJ+wctFnUvKg8p0DFPql\nOd0oAS6xwL7BkT+jOJjLEHkV+0E0Ihp/UKmkn7jFkZin1193fK5yPct38Z4I\ngBX30FC9wAvEjK9Ak0xL+sovKUxjeCNdu/K6OUrvU2FnCxZobZtBHklWv6bG\nqGgkdT+C3yxuAwIsXItiU1EXUfOCt320FXZRvlQgcBs14F7LhKyYDl2dV+2I\nhxh1BCMUFLwEIgFmJUl9uGxguokvd0eoIYZghKA+PElTPdANcZow9JDvRU82\n3inqyHw+SIB9/ZKwqItnsl7Yrf8O/FDehdpiX27UMjdHVVAeb2NRs4AGWaYy\num5ORTKbKTAxOJyTv1aZzXxwMkt7bSJIg5xYo0sW+0/pkN1BE3nineOVgvRJ\n8SMH29Gq+/BWQ0s1x8VAZT+ee7ygGIQifAZG2Wzg24F26sskblraldSJAR9u\n4V60LW9GbNspdQWyGYdjFVblq80AOQlizidxQPRcHGt205geJcj3oHWKk4cy\nK/BYlaHMRnrJhU5UeplZoMDN4WS7rA6JxFy2Xg8qA7DK7C/qjkKmkZd7fI8d\nr3KcWrXMoU8SScWMr7Q+GkIiKvLhSzZprUdkr82RUrutJjOvedimHT4n40ng\nTuj658uNW+2NaHgGrC57lrtwemut3WmUkGZrgy5leT/wNAwUoefN9+X6wKmI\nHxM+\r\n=cib/\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`mdc-slider-color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`mdc-slider-highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`mdc-slider-rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`mdc-slider-rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`mdc-slider-thumb-color($color)` | Sets the color of the thumb (grab handle)\n`mdc-slider-focus-halo-color($color)` | Sets the color of the focus halo\n`mdc-slider-value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`mdc-slider-value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`mdc-slider-value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"0a1f35ca90587cb380a06e8b6eb8650279b9953f","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.18.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.18.1","dependencies":{"tslib":"^1.9.3","@material/dom":"5.0.0-canary.cd4903304.0","@material/rtl":"5.0.0-canary.cd4903304.0","@material/base":"5.0.0-canary.cd4903304.0","@material/theme":"5.0.0-canary.cd4903304.0","@material/animation":"5.0.0-canary.cd4903304.0","@material/typography":"5.0.0-canary.cd4903304.0","@material/feature-targeting":"5.0.0-canary.cd4903304.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_5.0.0-canary.cd4903304.0_1579642642307_0.7321074699275496","host":"s3://npm-registry-packages"}},"5.0.0-canary.7e4b04b25.0":{"name":"@material/slider","version":"5.0.0-canary.7e4b04b25.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@5.0.0-canary.7e4b04b25.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"244fa80f40306be2433a477781949f1997e30f55","tarball":"https://registry.npmjs.org/@material/slider/-/slider-5.0.0-canary.7e4b04b25.0.tgz","fileCount":35,"integrity":"sha512-xB35kJQfr29v/G2MNaCJW+qJ6SzFLPkcAaztNZCnzgqIIaZRun+7KBBEsH/lIa0P8VF01ntc1QtgbyeknE9heA==","signatures":[{"sig":"MEUCIEAXw4JQPQ7BSZZiQtuYjlu3ezv/WOdGTt8e7FcPDQQRAiEAtKpyF8m2v4PFMo6EyZPFQF3Y4bVgvw5rk7d/PjXmqrg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":350710,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeJ38tCRA9TVsSAnZWagAABP8P/iM4sQAgqrG2vdHuoJjz\nvT0z4Y2PDj9cWcMHkgOOcnqfinWgUDt86gRnqwt58z49GnzLg30yqpvZHYpX\nbrD0bJzKhWUxwrLUawrfrVP95k7N5cprt2bP+MsdHTNpFIZ9kpUh4RSM56lt\n9fUAzvPsTL2VCCLnEsTzkVv6VKwxnYJcY5NWbjRIQKbu6CiWscRa8z7Re6hW\nVbu0OxaZRxGHkbpPdX8f2XjbEcy4jZx38AeB3OvJVf2j2F32yCn7MpgM5J8V\nZx6VPRJm5ZC4ohql3PhX/2SQt4rW72HFqhWdmr2Du0DEPf3PDIlTfs4jjJy2\nbvsF8z7Z38pIhSRn5VAy4HCmjlIaC+duia8cWFzOfSq3NUXeZPKsC8cwAJOL\nZCtKHcrZwizWxWhoU1s17Qzb5jYwY6r/rXkIORk5DL0Uc3ajYjd0EXcxa40V\nimprBqOrn7PCKrBrMVDuCIi4U9Y96Y3GJJeNPSNAQ+KJuaSjXvDwF4cCPFcn\n6W+eguOnmGVkmqBUjIHb9xuhiZt4txPEYIjDLbatMicrRHBuTlG8o56qMtRw\nVdoYlLwVK2lnSFvybSMA4IX4GzNDq2nlKZyKbUmgTzedGNr664er9JJlFAQP\nxNiuJyNbU6MA7ZzxQvJhANOWbOhMSJy+WPqwrZwVR0pdLSNnkk3SE96wfuH5\nM/8V\r\n=zfhh\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`mdc-slider-color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`mdc-slider-highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`mdc-slider-rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`mdc-slider-rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`mdc-slider-thumb-color($color)` | Sets the color of the thumb (grab handle)\n`mdc-slider-focus-halo-color($color)` | Sets the color of the focus halo\n`mdc-slider-value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`mdc-slider-value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`mdc-slider-value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"5ce556593315b470008c9bb156d98d7624231a5b","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.18.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.18.1","dependencies":{"tslib":"^1.9.3","@material/dom":"5.0.0-canary.7e4b04b25.0","@material/rtl":"5.0.0-canary.7e4b04b25.0","@material/base":"5.0.0-canary.7e4b04b25.0","@material/theme":"5.0.0-canary.7e4b04b25.0","@material/animation":"5.0.0-canary.7e4b04b25.0","@material/typography":"5.0.0-canary.7e4b04b25.0","@material/feature-targeting":"5.0.0-canary.7e4b04b25.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_5.0.0-canary.7e4b04b25.0_1579646765063_0.3374455194503254","host":"s3://npm-registry-packages"}},"5.0.0-canary.ebc296937.0":{"name":"@material/slider","version":"5.0.0-canary.ebc296937.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@5.0.0-canary.ebc296937.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"9f85f1c582c8ff12f879449d952ca3c16cf996ad","tarball":"https://registry.npmjs.org/@material/slider/-/slider-5.0.0-canary.ebc296937.0.tgz","fileCount":35,"integrity":"sha512-dfitlRdib+NWZbV9plKTQFLMienZuGw42S1hkglOyhi++LPuHSqc4DL8PfvqrowzhoKWSN4Rg2EDbTfQZB2TcA==","signatures":[{"sig":"MEYCIQDBJtJDZKFwD5syBBaDfFD8TWW/FmtlSef1oK0unueK2AIhAIeFuYtayfLEgGRr5Vw3ZRqaAKwozjtwFyykJXcyu+EM","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":350710,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeJ4z/CRA9TVsSAnZWagAAF7kP/iRzjmS069fYg/4qy5fO\ngaHr5Lh4GUDVlGQFH/auGE1VFRVssBDuicy89TY8zy8pngK05TKw1HRnZDHM\nP5yh4lvfZr8MrXksVhSjALoYdLwZ1bSSrJ+yvITtadPv4F17uGN5CbIDhFww\ncr3s+C6ud/qOoitNl3/nGFArLy1G6FUwKUY8nkOnAKc+OfMeSNn+hgCrTl3R\npEQQwRajJ3LkXKjbgwqURjGhtDM2Pvup5gFHVtBmtflZKASj1pcSNPTGSNY7\ncYWKUAWxmbnNiNCY8bBERY9/YH/emzp7LTEogJobZ3dCbzJtHRcDMugvds+I\nJZbUW3E6ttkUf5VGR4nyooMFzX1CnVEodt5vnCtIl5JGmmrdGr7w8b3UjphT\nQOahZZDp1ofMDykCyEnIbOEee+BVP0wqRdz5PJ57MaxWOHns7sfVSGcwwLoA\nAwbpW3vWIXH2+YzVvzZZ5Y2q8X8ssnjC5AKZ/+GvWi9wdVRpYPQ7m6dSwPYH\nb/gMG5SiFHVJs8vNFbCO0v64kU3jaeVGTklBpUohaMnitx09oerM/Fnk2L/f\n8WecNx35zPkPkUMFMpON12DmSJO9n3HJwSAfVlr61GxVLfsqbOxY5L63bVUu\nbehiRSZwqhY+Xk8XKxAXGK3KVz1LDJ83LAnWlBny8FC082wzRZs3N+XQvaxT\nWQ1i\r\n=FYLL\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`mdc-slider-color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`mdc-slider-highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`mdc-slider-rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`mdc-slider-rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`mdc-slider-thumb-color($color)` | Sets the color of the thumb (grab handle)\n`mdc-slider-focus-halo-color($color)` | Sets the color of the focus halo\n`mdc-slider-value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`mdc-slider-value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`mdc-slider-value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"56393bf41fd3e60f82b11c9571455b6e0b0f2025","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.18.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.18.1","dependencies":{"tslib":"^1.9.3","@material/dom":"5.0.0-canary.ebc296937.0","@material/rtl":"5.0.0-canary.ebc296937.0","@material/base":"5.0.0-canary.ebc296937.0","@material/theme":"5.0.0-canary.ebc296937.0","@material/animation":"5.0.0-canary.ebc296937.0","@material/typography":"5.0.0-canary.ebc296937.0","@material/feature-targeting":"5.0.0-canary.ebc296937.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_5.0.0-canary.ebc296937.0_1579650302418_0.642848605534537","host":"s3://npm-registry-packages"}},"5.0.0-canary.cf33f113d.0":{"name":"@material/slider","version":"5.0.0-canary.cf33f113d.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@5.0.0-canary.cf33f113d.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"72561b6ed6b7d2ccde445d20695193c80f09dede","tarball":"https://registry.npmjs.org/@material/slider/-/slider-5.0.0-canary.cf33f113d.0.tgz","fileCount":35,"integrity":"sha512-dsTSud6MemoKbxdgjRJNi2Zpq0aAgq3ZqezI89xgbT9guMntYx9TYprBEuWQBK4gO8YribsYe9mC4N13haVsFQ==","signatures":[{"sig":"MEYCIQDLIBjMnXR5vnL7G3/KjRAzoibxE89RFywEZE6SUDBbGwIhAJhcbh0fshNbi+aGB0dyiG9T1hHzRwBCaR7pvYLgUYyy","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":350710,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeJ6PLCRA9TVsSAnZWagAAJcsP/iVcBqXypC8OL8oE0I6k\ncAQtwWB+BAox41ctxQ/R7qqSgdCR8JQijC/MQjHx5yHufIavNxG3Upehilzv\n796Pkdhi5gwQKKrM9HtdtVrOdCUf6M8QwfiREoH7Mvw2qGZ7QIrrK1Rhzu8J\nCHb+YLew+t8UVKm5Sgwq4Q9c32E9qgbpNL79s0ZD93TUFxf/4TuEHo1MUhs6\nKtGBAyQxrcqlf0cvFzZ/tpOHoXAMx5G8Ct8oyUwwBXROWGgQ7dnxWG32QXod\nS37A2LmIDaefHc6t/eREVO9og1RnHlcxBoHs++c+tPFfXCaYJzTkuXSIHEH6\njD4DdwnfIBzrLR5WSJjjZ0lVPJHuuFiHe5GQ0wqhT585QuzXDulGZ7YbAcW/\nJtIuzD5wVH5CNvJn0lKfxje/Q20QQNrn9IZtjE5nLrJ8svc+BYSKdwwKDNUY\nHehoNwgOPU8NP8NNVo6+YWO65Bc+MM2vYzbInM3rDRxoMp0hmc4rCril3Dnf\nTfuIBCiqczkgV9LNujnb/dz+RGRpOh2LUuSvHytBqBfGze6QVUTW4nq27D/F\nVfrIEOqdWvIUHK05meHvoDfJgulL6LshivMhtqvcyyxpR7RESZPrGIwO/o1i\nNTHaeoMCMmKxDeU6AHRlJZr8KXm8qmubQqajFrYJ71xkiMUtUuR6qykrc203\nWXG5\r\n=59CE\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`mdc-slider-color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`mdc-slider-highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`mdc-slider-rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`mdc-slider-rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`mdc-slider-thumb-color($color)` | Sets the color of the thumb (grab handle)\n`mdc-slider-focus-halo-color($color)` | Sets the color of the focus halo\n`mdc-slider-value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`mdc-slider-value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`mdc-slider-value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"337736b1343fc4e03714756c4fc2ccfdfe1e5537","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.18.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.18.1","dependencies":{"tslib":"^1.9.3","@material/dom":"5.0.0-canary.cf33f113d.0","@material/rtl":"5.0.0-canary.cf33f113d.0","@material/base":"5.0.0-canary.cf33f113d.0","@material/theme":"5.0.0-canary.cf33f113d.0","@material/animation":"5.0.0-canary.cf33f113d.0","@material/typography":"5.0.0-canary.cf33f113d.0","@material/feature-targeting":"5.0.0-canary.cf33f113d.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_5.0.0-canary.cf33f113d.0_1579656138609_0.4186211611803732","host":"s3://npm-registry-packages"}},"5.0.0-canary.e1d5f1be5.0":{"name":"@material/slider","version":"5.0.0-canary.e1d5f1be5.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@5.0.0-canary.e1d5f1be5.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"f7597cdd7cff9ed379b1347dce994e0cc0af204d","tarball":"https://registry.npmjs.org/@material/slider/-/slider-5.0.0-canary.e1d5f1be5.0.tgz","fileCount":37,"integrity":"sha512-msup2UZjjXL5Fx4oYM3yiDwxA1/sJZULVqXSx9dcCIXSTeYNpaD9SMe36isrtv8XHmvmzQui2HpA6yFjMV1rgw==","signatures":[{"sig":"MEQCIA+KrhNxNgdgDYCl2ivtKROH2kpuTJTM5aYMU5oSAl+vAiAg7Fy9g8FT7QBsqcgQkYZGvknYXnIqwUYGEkttMiihUg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":351730,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeKH6CCRA9TVsSAnZWagAAyvYQAJJKLgiE83u5ZXfVc0C6\n5BfIlc4TT/7jYuWKLaxXpDXI37+MJvoznrBIQN6ONYIPZgbn1Q2huNMpqO4P\nBaqYAX6ruRlGMCYQzSATFED08Wr309IqjFQKV4sO4hHrTgNBje0nRXfZp7ZE\nRyAgQ1+vhTk0A32eeUTJvuEH2vfTFaTXzeBMo64OrlVR/cTqXMCe/gcUN8S3\nfdu1xxbj5v5zS87yEoHoOoGKFWmmP60Hcl9l/jcCFqysWPPlPHexLmL0Qjq1\n3dAqVBjC3porxG1TK8sRTSNt1uOilgbHmgq3bYlnKfBH+ZHGXil2fi9rcy+o\nY8DXpszzOQHVms6nIrhsaAsYmRmMWCIMiPomuWzASSsC9YRNUOH5+Uxihpsa\n8IL4vS8SqgCPoAIdaLiIDsLv6PzaA6KyUfbvjH6EeNG1KKquwkvgCmsse/ke\nJEsJCjhNdDK9As2cuV08yU1jVvqv0TicJFXCtJizu4LiF9ziahrjfasetEwm\nnk1iIWaMwfIQGPTRzNEAY5Zhb5Z25buDKFgj4vM13buVB5518GMcvxbBY0k/\nKLUKxE7it9njDDWnIJaK0EletYK6pW3toESmm3ilofYx7DhdrI1WHmUPD/pI\nZv3Jkc2e55RuU5g3yyTH7JvvsynIr+HUxIk4LOXn+1ddYd6l4n4aR2f0pt3g\niuvB\r\n=LxCi\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`mdc-slider-color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`mdc-slider-highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`mdc-slider-rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`mdc-slider-rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`mdc-slider-thumb-color($color)` | Sets the color of the thumb (grab handle)\n`mdc-slider-focus-halo-color($color)` | Sets the color of the focus halo\n`mdc-slider-value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`mdc-slider-value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`mdc-slider-value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"4726896d58f0dfdf4ec6ed819abc20912d43f2de","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.18.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.18.1","dependencies":{"tslib":"^1.9.3","@material/dom":"5.0.0-canary.e1d5f1be5.0","@material/rtl":"5.0.0-canary.e1d5f1be5.0","@material/base":"5.0.0-canary.e1d5f1be5.0","@material/theme":"5.0.0-canary.e1d5f1be5.0","@material/animation":"5.0.0-canary.e1d5f1be5.0","@material/typography":"5.0.0-canary.e1d5f1be5.0","@material/feature-targeting":"5.0.0-canary.e1d5f1be5.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_5.0.0-canary.e1d5f1be5.0_1579712122868_0.34577224035963305","host":"s3://npm-registry-packages"}},"5.0.0-canary.6b6a4ff92.0":{"name":"@material/slider","version":"5.0.0-canary.6b6a4ff92.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@5.0.0-canary.6b6a4ff92.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"3b5812d3650cbd646895f5734acfa3ed60f35d4e","tarball":"https://registry.npmjs.org/@material/slider/-/slider-5.0.0-canary.6b6a4ff92.0.tgz","fileCount":37,"integrity":"sha512-aJgmIZpXPpj2NHXzgimJV4hMnwB5Qk9Boi3mT9+gK3MwNxnLWjzsJqYXjkJAaNDbjgl4UUfw9oyZrz5E+oJb/Q==","signatures":[{"sig":"MEYCIQDoA9YAnFpkis10xZOwgPAGY/guamgRkQuPiq/oCJTvoAIhAMreIMfr/kFKi73RLgSHn3FGJ2VSPRpj0dDxE7N0/CJJ","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":351822,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeKI0ZCRA9TVsSAnZWagAAhtAP/Rk1lngEUaXp392ml3mm\n1KfeN/dGmU7niSxe5PG4A79+BZ0Jqp/SPwts3/4ZnvROa8AhRZke3DWvsXVl\nnF3j/SzaQPIag+3kx9t3w9jvEFlgBu38jGythnwhbp9djFSyAN5ubkKKcxnM\n0aBmOVvfR0iAQ7tN/KlmWITSxnBs7NExWNoXaqdJyER9ymd8HOlxby846hMC\n2ouKHqF0XHEKk+sBWqZ3oZbkGoeI/as2Rm9FwFctlzGwYCdKdkV0ju6Z2JAB\nFsejt8PY0oXOyE9oNsPDXFhe2qIwJb65n9FY0+bMj0rCXT+8fK2vjxpuQbh/\nIaaZlSUzO9uA0dJSwQFlgiS81HoSuHwghbszPStPAR22OSNR2tna4By41iXS\nBXafKiRL6NBhlmc8gUBdg7BjNAAPKAuGInMbq5OUNP6IcT7RiVWuLAz3NR20\nFaVzYP4GOcgTTZi/NUwZf8SAeYqkPFtPBbv+K7UpLzHPF7m8Y2YE6bgVhhsV\nrIhNpS5kODcJOS20sC3jALHXGfJJ/wImLPP07II7d0Dxej8xbR2kg3q261hi\nUP2jyjpMNooN921us8mrAcBkpvKiSHlO/Qm6RjyfOXx0CkYaLx8CNPVmWTDb\noQ9bnP+vsfW3Uy71BJtvIQuoKFzmVpXm31DH2ryfliOA2QnLS0Muly/j+QkQ\n8+PF\r\n=M9n5\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`mdc-slider-color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`mdc-slider-highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`mdc-slider-rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`mdc-slider-rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`mdc-slider-thumb-color($color)` | Sets the color of the thumb (grab handle)\n`mdc-slider-focus-halo-color($color)` | Sets the color of the focus halo\n`mdc-slider-value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`mdc-slider-value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`mdc-slider-value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"a4307ced3400e7b61e83495c8903f219bba0ae44","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.18.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.18.1","dependencies":{"tslib":"^1.9.3","@material/dom":"5.0.0-canary.6b6a4ff92.0","@material/rtl":"5.0.0-canary.6b6a4ff92.0","@material/base":"5.0.0-canary.6b6a4ff92.0","@material/theme":"5.0.0-canary.6b6a4ff92.0","@material/animation":"5.0.0-canary.6b6a4ff92.0","@material/typography":"5.0.0-canary.6b6a4ff92.0","@material/feature-targeting":"5.0.0-canary.6b6a4ff92.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_5.0.0-canary.6b6a4ff92.0_1579715864566_0.7870249031427505","host":"s3://npm-registry-packages"}},"5.0.0-canary.6092f71ee.0":{"name":"@material/slider","version":"5.0.0-canary.6092f71ee.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@5.0.0-canary.6092f71ee.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"b27ef2cc4d3436441512de60724c83dadcb938ef","tarball":"https://registry.npmjs.org/@material/slider/-/slider-5.0.0-canary.6092f71ee.0.tgz","fileCount":36,"integrity":"sha512-zuPXDKEe12jsTpnlG+b1DtpqYZJeP8tcWFcvuIUJNV7RXHxsRK48HVLP69AMJDrwwAzzwQ+iDbuyiKa6xO4JvA==","signatures":[{"sig":"MEUCIGUzgInqOoj718Is/lUF8iRTIYNRt04cDALU8tSZywdcAiEAhTzhxhw2NpVRUzH7P7wpvI38r1AZKF7XuOZw0td/vzY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":351585,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeKLvFCRA9TVsSAnZWagAA+ZUQAJWk05yIZY7W0DqYjUmq\nINvrs1F9UyBZt1DDO90CD4sdUHei8IgfXo89WBUxOIOhZdprjszP/SQ032eu\n9iTkGX2zcCXqmd9XtnFp8oQq9d7bfLHzfC//tIH/sdhLuzl2x5gtRcV9xx+d\n2rOQLA2x0F2TvTxT5Kjl0CQuJP4dyNSaZCDNqoiGyHUyEG4PQvb4fTPvPkWo\nbZrhisz7zUFQFKctfYSWO2nltKQrP7lroY329dl6RxGsuav1QpP1O9Q0hxVf\nU1z0+XNo99qv/xm6vE5zxfko/iTMUmmOPu8WckarC8eNX06cgeSnP/xWTc91\nMd/oJRHBlYWCsBndgVOleZzdJdF8GdhiGT4A6lwUKRmK/tIkEPwIix9htt1Z\n2IMiI6M+Fx4GTr7BFUSvDe2tYLHPPKnQUgiP/psgue6p1d5vth472GzeNSR6\npjSZ8heHjlrJPxeYS7WQf2pRfRAsaTqeIPzkmukty16K1q3ZeXAQKui8YK+N\nU0ofOHcz/vn/fKhRO6ghmFu+O63U3/DADue2ueT7GalIsmlcEoRjJAbLgpPt\n8CEqi7rdhbEfX7p42thYD8zx8ZEQfhuw78GSkgFq94t29BgoNkreOwXFQmrH\ntKjDHaeZqVapieybLGDfxmZthxanuYDaRiVY2YeVZ+wiBPv7Oo056s/gkjfS\nM385\r\n=9FK5\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`mdc-slider-color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`mdc-slider-highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`mdc-slider-rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`mdc-slider-rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`mdc-slider-thumb-color($color)` | Sets the color of the thumb (grab handle)\n`mdc-slider-focus-halo-color($color)` | Sets the color of the focus halo\n`mdc-slider-value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`mdc-slider-value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`mdc-slider-value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"da5d9e639c767fd3f9ad77c867d990afc21cd359","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.18.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.18.1","dependencies":{"tslib":"^1.9.3","@material/dom":"5.0.0-canary.6092f71ee.0","@material/rtl":"5.0.0-canary.6092f71ee.0","@material/base":"5.0.0-canary.6092f71ee.0","@material/theme":"5.0.0-canary.6092f71ee.0","@material/animation":"5.0.0-canary.6092f71ee.0","@material/typography":"5.0.0-canary.6092f71ee.0","@material/feature-targeting":"5.0.0-canary.6092f71ee.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_5.0.0-canary.6092f71ee.0_1579727812461_0.777555166926289","host":"s3://npm-registry-packages"}},"5.0.0-canary.d8d95020f.0":{"name":"@material/slider","version":"5.0.0-canary.d8d95020f.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@5.0.0-canary.d8d95020f.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"f60fc9115d77295890f9412821773ee93abd76ca","tarball":"https://registry.npmjs.org/@material/slider/-/slider-5.0.0-canary.d8d95020f.0.tgz","fileCount":36,"integrity":"sha512-dcgHHPOK6/KcKtSCRld4tr8/RuwoZ6tvJ2i1SULhr78BBgKJajsxaLsR6HCdwg6+E96XkXH+rXT968yPCoqMzA==","signatures":[{"sig":"MEYCIQDatbFSDRo3djfyYdYo2j8vnpJ2repeHMErBB0Jgl2hBgIhANQLxIZFN+nVIl066wPrdf1o4NLnwCiJDNgoE4HYDJgq","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":351585,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeKNYmCRA9TVsSAnZWagAA/FcP/iuu7EbAs8Lm5ZUL2irM\n2POeVLSaaZbokogAvUy+bViUhF5vogUI0vMrI4sM6GTz4E+oZ0OTRzuwpmZm\n+vXHzZKwJ7JOGb3JQGBfPArFFOTsGKFpAvKJqnUbymd+xm7E0/e8JZmphn8v\n0e6VDzJjdyHbDCln8LzCbfupeL1qRk8horQN2VDW4Bdzq1/8T37Rw9vg8NVt\nFzk6Sx2XL7v5BYZoBTycD/+ngwBHKFMsSC1sCsfIo06dQRgtqMkW/tNIBEJb\nLpkXO3zvvHyRFnCB+dJoRmKWO2sUf6sfJw8dJTZkE/0rOGmp9k+b9GUGAw9j\nLsyVH+d0WI9cWfXIKCs3CNQ01vwDwCCGWOhSD7YYmG6zj7mOZg/CMKpfZBf4\nuvBwAfDaWEYAR37KtoDTcXMtWMO1vyuUa21oKVeIYriBN6ZP3xmF/9qkLVjF\n6jmC6tETFhM8ifR6SnzPfBZEAIC35mAf/4Iov4uh2ypSOg7mh2iiatOdbL0m\nLlh9f1t+JAIqyh6c77YwA3QrG+RkLJUC4SS4XQKWcirVFpA9FU2mHrdQ3xyR\njHceq9lgdARVRCdqEIhwjZk79z26RLuM/7dSYliKKn4GQp3LNX3bsuluGRFA\nmmrIM4xjvkYh1C+ir6/wZogqYO+q7oe30m/N82tsy+tn8mtUh+bQWOnyvgiR\nOXCd\r\n=59la\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`mdc-slider-color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`mdc-slider-highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`mdc-slider-rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`mdc-slider-rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`mdc-slider-thumb-color($color)` | Sets the color of the thumb (grab handle)\n`mdc-slider-focus-halo-color($color)` | Sets the color of the focus halo\n`mdc-slider-value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`mdc-slider-value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`mdc-slider-value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"6360c5189134a77fd45542c27776ac2f86b16a49","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.18.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.18.1","dependencies":{"tslib":"^1.9.3","@material/dom":"5.0.0-canary.d8d95020f.0","@material/rtl":"5.0.0-canary.d8d95020f.0","@material/base":"5.0.0-canary.d8d95020f.0","@material/theme":"5.0.0-canary.d8d95020f.0","@material/animation":"5.0.0-canary.d8d95020f.0","@material/typography":"5.0.0-canary.d8d95020f.0","@material/feature-targeting":"5.0.0-canary.d8d95020f.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_5.0.0-canary.d8d95020f.0_1579734566147_0.037963476398986895","host":"s3://npm-registry-packages"}},"5.0.0-canary.b7facc628.0":{"name":"@material/slider","version":"5.0.0-canary.b7facc628.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@5.0.0-canary.b7facc628.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"aedb44ead98137028e9d82b783b7a09b1598dafb","tarball":"https://registry.npmjs.org/@material/slider/-/slider-5.0.0-canary.b7facc628.0.tgz","fileCount":36,"integrity":"sha512-dSkPNChkBQkp1IYdD7rjLy7Mj5Mbox1eKanHoE57r9hKSrrwEMhlxOVllsAbxGA9G0A2SsZqXmBwB3H0qgdIoA==","signatures":[{"sig":"MEUCIQCK3+tCMksyZ3T6XOr9LorthyweT2wGvB5p9yVXEqCpzgIgOjd2399cmdPTiNEr9mN9b8DlATMWlrPfYpDFOH2DazY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":351585,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeKeIZCRA9TVsSAnZWagAAz9YP/3RY9qsKQIArPEQ7kwrl\ncx9ruT7C+3BTR3B27CeWqB7xlEgZFQN+33lc9SarEXNcf9aWoLEJIiNDIlmG\neh9fqUbfCAwvWKjFICodEWOBHSFIu7wTlwfV1jd/xaqFDp56YLXPWQuCbE/N\n4LKhpO//CEYvrbDMH1nogJogkENR5eoO1cj/tUxp+FR2sXvh4xPws887zP3s\n+RLH7K6BCEWcwIX1MAZVo7mXf1mzQeHIfg+dGbTjEyJhpzm7L/Es+ZAS378N\ny9+l7teM4y4fTLv6zLtR9JA4yLnZxg0kxbN+4vGdPEiadj0CbWK8dnGPkumb\nDitZOUkCcWfhMHDCcJfMJRGIA9zhnnsdEdyexM0K/tAXYxLwdCy7zrM+go1A\nFVJqxCpn8kNC8v9zIW4nzowxPFjYOfyWlodcOC6knESF1JuVtfz2a7CCbq+K\nHhvcGzuUdWXZKAeqrnx6UvOrXXII8JHS7OCvDJAulkbxYSdfjjDkugFqndmO\n7+Q+8x4rQ5VjmaZTTdfiwOj8P8I20Wo0RaywkvkY0jlx66ehtbXsQChGsTZf\ntVSAJQLviGAhY18zA55cpHMh2o+EyxcQZa7LC9W8Pv4lg1UKB0lxkQ6fP/rC\nEZHq4vArBPLHmcy2DmVcyB67SEjOTfjOzA6XMxBP4mPhVOM+aFnw5TxObpcs\noYhl\r\n=lU9I\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`mdc-slider-color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`mdc-slider-highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`mdc-slider-rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`mdc-slider-rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`mdc-slider-thumb-color($color)` | Sets the color of the thumb (grab handle)\n`mdc-slider-focus-halo-color($color)` | Sets the color of the focus halo\n`mdc-slider-value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`mdc-slider-value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`mdc-slider-value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"265b39c05dba4587f44e16eb788b56c1cb0153a4","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.18.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.18.1","dependencies":{"tslib":"^1.9.3","@material/dom":"5.0.0-canary.b7facc628.0","@material/rtl":"5.0.0-canary.b7facc628.0","@material/base":"5.0.0-canary.b7facc628.0","@material/theme":"5.0.0-canary.b7facc628.0","@material/animation":"5.0.0-canary.b7facc628.0","@material/typography":"5.0.0-canary.b7facc628.0","@material/feature-targeting":"5.0.0-canary.b7facc628.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_5.0.0-canary.b7facc628.0_1579803160526_0.6533043525387099","host":"s3://npm-registry-packages"}},"5.0.0-canary.63f357dbf.0":{"name":"@material/slider","version":"5.0.0-canary.63f357dbf.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@5.0.0-canary.63f357dbf.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"6420db8e399bc67cb4268789c10436b200c8f8b6","tarball":"https://registry.npmjs.org/@material/slider/-/slider-5.0.0-canary.63f357dbf.0.tgz","fileCount":36,"integrity":"sha512-NQDI+xPr/9Bt1h9TSYPqnnGnrlsBjLN1TOb7805dpZ3EvrdnR8mpr+j64AVn6ni6xiG1zCiDsf/UEfCn9+rLtg==","signatures":[{"sig":"MEUCIQCfgCAagcO0Mj3OzF92yJSBmcx+/w86iviOCraMY3Z+/wIgXiojOwKGcfFFWCS7PqvLWKIMUZcEwahR4P1oeubLRrw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":351585,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeKhZDCRA9TVsSAnZWagAAAC0P/1wsf3EdHb7CKLvnzLuK\nUstAAQE7bBmp7RU+YrlJqRpPpMVV/FHIiKJ+rd1UX42edXeIsQWrA4QSjv2n\nZSRzKFDbynGBrYaZkYcNpJxy7H3mUbstORXXHXi1zD+u7SWq2SgGHXiRLfmZ\nDvTm2r66yIkZf48mlYxwwwfvy6TkJTjPsg9hzFepR4qmcgdGYqWVvlq8eoaN\nq7dSv12DbhizLKKtNjTW6TI3swZG05tvTULAhECr/XQErNesO28mZZUh+cvB\nW4SwtdTAv+DE01mFu24a+tfzymGYWK6UJU3mdJ2VPomeofXPsLZl7GZbXZJM\n1X6TMBcD3RbjJdNzcL2ymiVXuJoiX5fP3Ve5I4TCUgclWdQKk5h222Lnx8VN\nojlYjWwQA+pj33oeTvrXU8wenJOYfyqr0xVLiPDqi1xRd02Fal08nnrwtDIG\nBsejjLWWhbHn3TNUXq6/GAtw6CffD//hODePqXCFIg7QVRpWrVIuXUtkwkxU\npHIRCchCKx3KrsuKpD7NGwlyd9v8eRoBkdydLbbodkQPOn4Ql30VDGOCRvbG\n4TaMAORnouOzyfd4ArL2GHKalccWwV4e523C2GBM6VqXczv9f/NQluQyq4M2\noBX7r+Cd4q+1TdapRa7wA0IH9nQLw8g9a2lzP0cv/R7F/nbEHSE/Kj+mytvl\n4Isl\r\n=0ALH\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`mdc-slider-color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`mdc-slider-highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`mdc-slider-rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`mdc-slider-rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`mdc-slider-thumb-color($color)` | Sets the color of the thumb (grab handle)\n`mdc-slider-focus-halo-color($color)` | Sets the color of the focus halo\n`mdc-slider-value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`mdc-slider-value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`mdc-slider-value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"eeb2b38a1cd8ef32c66d35119a666a4b01da6d7d","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.18.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.18.1","dependencies":{"tslib":"^1.9.3","@material/dom":"5.0.0-canary.63f357dbf.0","@material/rtl":"5.0.0-canary.63f357dbf.0","@material/base":"5.0.0-canary.63f357dbf.0","@material/theme":"5.0.0-canary.63f357dbf.0","@material/animation":"5.0.0-canary.63f357dbf.0","@material/typography":"5.0.0-canary.63f357dbf.0","@material/feature-targeting":"5.0.0-canary.63f357dbf.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_5.0.0-canary.63f357dbf.0_1579816514680_0.3988455812954568","host":"s3://npm-registry-packages"}},"5.0.0-canary.f2426d26e.0":{"name":"@material/slider","version":"5.0.0-canary.f2426d26e.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@5.0.0-canary.f2426d26e.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"05abdb234ae9872032f2ed6bbc99cfaad43c6240","tarball":"https://registry.npmjs.org/@material/slider/-/slider-5.0.0-canary.f2426d26e.0.tgz","fileCount":36,"integrity":"sha512-oIGrKkWXVEAprIvYTSlYVLRhXPZW1hnM02ibLtoyWT5jPbx3G/IvYWvl8dzvPzf5IbgO7Q4sdknGO2xQ0vNgvg==","signatures":[{"sig":"MEQCIAeYQR64vcetHxeVELE1CtWutiwEGDkqe0AB1bnVyR04AiAVaeooktl0Egv9lS23mR+ZieDC6KVI0eHWuCYjraJ42A==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":353512,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeKjJhCRA9TVsSAnZWagAAP0oP/RIuAxb3Bj4rHruka7Wn\nFhamAAtgUmu6pOnWzBzqoqJ/FE7pYfKfqWVbTnH3cftjrfpIpIYkpdu+t8LZ\ngEwCoAOGxpX0ldKcFtn8MB7SmL09Qa3DzJWdql6MJ6IVfWuf++wcsebCZrU7\n3CLiqw5PbuxUVL2s6F4OQAgfeEA7ewrOczhiRwuF6qz6FUKUHgDh16mqOwSq\na/vIdrBqOV56iPcMMcRjOIcY89L9kmuHKHaXNJGy1hFJcGWmuEAWEYL8J3cy\nH8hycKkv2JPKbilkmTdg4MTWJeiPyNMOrTgsz/OFZUa8IsQwLyGBuv0rrySa\nT6SbR7/+vJVFG95lAp5M/ErUjqkMhXMr0iVwhCaSbxpYfZIH5OzNP0Fkp3Vg\n71iuJIBAFW+zgemTmJTGGPIhwccdN5tTBfqm52qyWpo9QyLA/ZBrB9Bqex9i\nITwwU443sRJ6JmtVNUn6bHy9s7Sv5wJ0y3+fiv9kfJsx+VxUhO0wPJQDvTeP\ndsXwGaiQOimz+CR68mVIuwt1o9FORrfnwwo2pfw1OY2w3AVmF17Kis+KTbBL\negrizoA285jHkldo2cxCkJ6Wr8BwwsbJoqMj5mbBDxK3CZQTzi5Cn/U2mGVb\npzexRiTBD2It+mw/Yly4W7Ww5yy+EWovqQCZ1PbDZucnqBLH8nQXp7DIEFVg\niPM9\r\n=bTO+\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`mdc-slider-color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`mdc-slider-highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`mdc-slider-rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`mdc-slider-rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`mdc-slider-thumb-color($color)` | Sets the color of the thumb (grab handle)\n`mdc-slider-focus-halo-color($color)` | Sets the color of the focus halo\n`mdc-slider-value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`mdc-slider-value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`mdc-slider-value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"f25cc47237fd4889c25ddd16c4d80cff95fe3c91","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.18.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.18.1","dependencies":{"tslib":"^1.9.3","@material/dom":"5.0.0-canary.f2426d26e.0","@material/rtl":"5.0.0-canary.f2426d26e.0","@material/base":"5.0.0-canary.f2426d26e.0","@material/theme":"5.0.0-canary.f2426d26e.0","@material/animation":"5.0.0-canary.f2426d26e.0","@material/typography":"5.0.0-canary.f2426d26e.0","@material/feature-targeting":"5.0.0-canary.f2426d26e.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_5.0.0-canary.f2426d26e.0_1579823713107_0.6242067007778902","host":"s3://npm-registry-packages"}},"5.0.0-canary.7f5e0c23f.0":{"name":"@material/slider","version":"5.0.0-canary.7f5e0c23f.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@5.0.0-canary.7f5e0c23f.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"5fe67ae787308b8c3a9610528f44c44530a914aa","tarball":"https://registry.npmjs.org/@material/slider/-/slider-5.0.0-canary.7f5e0c23f.0.tgz","fileCount":36,"integrity":"sha512-wCw2tHHahelhXPCFOSHortzcCeV/Ra7U96Yql511jt9MZdPWheJp0VfESTQlewwVGRll7PitO+XDTxq7DcIpUg==","signatures":[{"sig":"MEQCICuchtxOPuXunoDyeO8KDx/V+qM5V3zyW+zxGVGSVu24AiA3Hisrxads1a8p4WkVeAfQcaCmusdoFqcjB1SR1Aj/MQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":353512,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeKx+tCRA9TVsSAnZWagAAF/sP/2UvwBDoizgdVBrs4WGS\nB/B78GYYy5isPWUtgJn1Zlg+GTtYG/5LHaEWaCuZMCimegg0pzMOJ9LKkDaf\nxv41Q2IzkozU75efd5Elb9hlwsgVgT/0G21BEQWGB8qVAKXtt88PakG+wOSx\nzJHFdguWYuE9F2sVCy8x5rzAieoS+SnPLu4tc0J8nc3o1k/90ch7yN+wuwMO\nEqDHdZQGhyU7j22Rc4zSt5V/j4r+vBzAo/ALlI+AqUrHlZad9lee73N/JETc\neZq1sSrZaZso+PyokmTguT4M6TIKS8uRJvHZCZbXehAQ/GNToA6dQ6X2i9FJ\nnRPmol+Dzkhr8k/rIzJmHjrDuVNcCmqnm7ssvNzfy6S6Atv1WmkTot2WUGgI\nqBa1r+hJRnwMp57HyVf3dk7SRSSuLIUc5tDSWY5nNNnP2lcUVTMgsL19Louk\nUpP1wJVkovsux5aSVMc1mLfHCD1Ebw1XcbLW4FOhf8oAgWh0Ln2R7fFzoONO\ncnbK2fXumM3r/zp8FeCou7ueXulEsberpguGklfOGJxbGJlm3Qp8BXETc/fv\nEJ/q0Xlw8MWvN2gcEAVRhjzGRCNxZI6h6NBXgoA8A39qdWVBD+DkCFFPTpiG\nuWA1PUawLlzYB/DnFLqCuI5Slp9Bqj056phnaxINKy/fuI0pze3wqKDz8VjL\nYfzh\r\n=ohi7\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`mdc-slider-color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`mdc-slider-highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`mdc-slider-rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`mdc-slider-rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`mdc-slider-thumb-color($color)` | Sets the color of the thumb (grab handle)\n`mdc-slider-focus-halo-color($color)` | Sets the color of the focus halo\n`mdc-slider-value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`mdc-slider-value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`mdc-slider-value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"619b057dce90a552f56e341228cfddbfb7746acc","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.18.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.18.1","dependencies":{"tslib":"^1.9.3","@material/dom":"5.0.0-canary.7f5e0c23f.0","@material/rtl":"5.0.0-canary.7f5e0c23f.0","@material/base":"5.0.0-canary.7f5e0c23f.0","@material/theme":"5.0.0-canary.7f5e0c23f.0","@material/animation":"5.0.0-canary.7f5e0c23f.0","@material/typography":"5.0.0-canary.7f5e0c23f.0","@material/feature-targeting":"5.0.0-canary.7f5e0c23f.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_5.0.0-canary.7f5e0c23f.0_1579884461141_0.0971286451940856","host":"s3://npm-registry-packages"}},"5.0.0-canary.3fc3ab520.0":{"name":"@material/slider","version":"5.0.0-canary.3fc3ab520.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@5.0.0-canary.3fc3ab520.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"66d4f0a432a43340465177cb3da6aa8e5d9d8167","tarball":"https://registry.npmjs.org/@material/slider/-/slider-5.0.0-canary.3fc3ab520.0.tgz","fileCount":36,"integrity":"sha512-0ks4ASOB0tji/az3jMH/fLjMar8xVTgx3hcvBzsPX5e0NoFUHZHxlvEAejML067vijGCtWHZAONIO7xQzRNtRw==","signatures":[{"sig":"MEUCIEOVQujht6Ep+TuJkeUupr7CAINi7tWlLmB7Vsze0e6oAiEAtrEB/43cPw4VMi+fk4jDEFV/M454aBhGMGbDcZH2OD8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":353880,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeKydvCRA9TVsSAnZWagAABOEP/3mvyX+I10p8KHRS1bB8\nleXcKuvJVJcLGyBbs4u5k7Ay1qL3Ks4FZhztgcIY2lCZIq9Y2JQHAAyFE/CZ\nQSebkw0Zm+xj+G+ktqgK6goBXdCXMZ9axmJVmxToGLQTrgnXxi2DoA53UaX0\nLJBLQPXHNjcbGYO33bQuj3bls8EvQrzbh53a24zoP29yMoq9fHacNZe90Cyx\nOFFiD11TpSbritrBHrOr4VKk+lipTaJ1L2aapG5uWBUGqrKacqrLdA//vkPo\nhfI+6EiH3hpi1PGVbZ8PIAgzgzdltqaGx4fV+V4c9wPWp1mJkyR7LXvW/ZBF\n0ecvLzhw0jFfuAZwa2fPAaxhXovkVIRoocBwn/eo88Vc2nB5vOuDVHpuUEfg\nRXvV9NVOLhKFi/1ItYj0xEgAG0wwIQ70iEMAsWW7+8Y5hEvFMNhdUCSvaido\n+08Rv0GkbEtzZ417/J7Pt2NA5urx7uuQDwr5DXFLwMpIqDZ4iUE/V1aMnVZD\nW3awaF2w2c5gLXfO5yBpxrQSyuF6mEppaNdYcOqbr/7NIHM/rm5cG/0xVgqe\nQXb+WY3VwUWxVeUGtTOd5VyjwywhOAw3e804qIL0YykkIKfqx9YtIiwce5dV\n0e/L5vBa1TEpuCBhKAJMTdBLrNXqZ1q4058H/xcp5ZrTmfLYSsmYRsjAdjXU\nhQvi\r\n=llmg\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`mdc-slider-color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`mdc-slider-highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`mdc-slider-rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`mdc-slider-rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`mdc-slider-thumb-color($color)` | Sets the color of the thumb (grab handle)\n`mdc-slider-focus-halo-color($color)` | Sets the color of the focus halo\n`mdc-slider-value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`mdc-slider-value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`mdc-slider-value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"d15050fe97c7130fc9607ecc53a7eafd2b9c58ef","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.18.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.18.1","dependencies":{"tslib":"^1.9.3","@material/dom":"5.0.0-canary.3fc3ab520.0","@material/rtl":"5.0.0-canary.3fc3ab520.0","@material/base":"5.0.0-canary.3fc3ab520.0","@material/theme":"5.0.0-canary.3fc3ab520.0","@material/animation":"5.0.0-canary.3fc3ab520.0","@material/typography":"5.0.0-canary.3fc3ab520.0","@material/feature-targeting":"5.0.0-canary.3fc3ab520.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_5.0.0-canary.3fc3ab520.0_1579886446809_0.42168884661895545","host":"s3://npm-registry-packages"}},"5.0.0-canary.80a4d326f.0":{"name":"@material/slider","version":"5.0.0-canary.80a4d326f.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@5.0.0-canary.80a4d326f.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"3457af3c8828d38b6d1cd41a18586aacb6cfc5bf","tarball":"https://registry.npmjs.org/@material/slider/-/slider-5.0.0-canary.80a4d326f.0.tgz","fileCount":36,"integrity":"sha512-G/3qCMPrNEZ/Q9uNczu7M+WJco+7lBKwYAvOeMsXQHrHZLqOF/iXzG/Eq8A29M1k7DCFwgdL2P+FJ/o8PJDPAg==","signatures":[{"sig":"MEYCIQDE5FVZXm2o0lEI1a9v/7XHNzZSJ1NXO4IkYP947M2sAAIhAKKhGuzC46tN1YHbXzkgHKw39g4bv4/CA9lGpCjWPBun","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":353880,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeK1d7CRA9TVsSAnZWagAAkqkP+gO2rAF5eVeiFjO644ZL\nkoKbLbeeKZnTMjvDAzJXok4NXcaH7uPPwAgPWaLdSQjndXwoXTjtCASMRqEp\n4rCtdAh4fBiJMImO+DlxZ9ConGYdL5pCuvfQJ1pf03SwjZEATvFvMl26ZXqC\nQ7mxjMwRHpzpyvovKuWU3zmB6SFLNqtjofy82KXRMilh6bdXWeVYL7Dfl4QY\nEDbyNszIl+3Jl2W8fUO6o9hLlwyiBDhZ2pUTrmsIbn71eyGmaoPKtDPWFyZ5\nEVEnz621vECRx2XCFnFq/sR+O3T5QPtaOmiBh5pwcCb9k8TcrFpdXUwXg9OW\nAotrX+HA/I7hDqnpl787lxiLQ1ZedUpeUGyYuHLTijtbEbHLYAeCZ19S+Ifg\nNCQlcxvGUYcq2DJGtCAZbsU3XqaC2tP286YHI2GgcJ8IfVagwMcAoo1thtCg\nZXWrN4wdv5bEcL50DP/Kxoyxn+2z5hyyDEHKdVaNHU7fK7Iu4BKJI0YMgV8C\nJlbY2fuBal0JcxG93V26YiVM4PKrZKb3K0qPnUffS7eL1lATajAWDOp1yH3I\nAvW6LXHjrF2tfufZ/GxWPiJC4PIj1w/jscy2DPnRNcF+9xJFn7lmIhctjHPN\nVfM9E5B+XaHz0dJPUuKqF90IxBhriKVQAZizaSq0lYQInjCxb2mja+FYFXMO\n7HW9\r\n=VkrE\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`mdc-slider-color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`mdc-slider-highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`mdc-slider-rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`mdc-slider-rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`mdc-slider-thumb-color($color)` | Sets the color of the thumb (grab handle)\n`mdc-slider-focus-halo-color($color)` | Sets the color of the focus halo\n`mdc-slider-value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`mdc-slider-value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`mdc-slider-value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"b0001f5c4ba1986c74470e492e82bc13e15e2ad3","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.18.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.18.1","dependencies":{"tslib":"^1.9.3","@material/dom":"5.0.0-canary.80a4d326f.0","@material/rtl":"5.0.0-canary.80a4d326f.0","@material/base":"5.0.0-canary.80a4d326f.0","@material/theme":"5.0.0-canary.80a4d326f.0","@material/animation":"5.0.0-canary.80a4d326f.0","@material/typography":"5.0.0-canary.80a4d326f.0","@material/feature-targeting":"5.0.0-canary.80a4d326f.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_5.0.0-canary.80a4d326f.0_1579898746651_0.9013604995173521","host":"s3://npm-registry-packages"}},"5.0.0-canary.ef7de4def.0":{"name":"@material/slider","version":"5.0.0-canary.ef7de4def.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@5.0.0-canary.ef7de4def.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"50287a83091328aa9323611544e18f2b8ee1ee9a","tarball":"https://registry.npmjs.org/@material/slider/-/slider-5.0.0-canary.ef7de4def.0.tgz","fileCount":36,"integrity":"sha512-oNJfgYgD4rNBPAbZQQgjna08YFg2vSL3srJ6W2BuC/JjuoCpyOyxwBM6kShSzFDs9sCTxuH2tGZicpPeb4vngg==","signatures":[{"sig":"MEUCIQD7tcM9POW0OungSMTkRe3RrHjyzg3nK0cktJb95aKbxgIgbOOA8QTnCnR9CZaj8pe3xERKSoPW3i9ybgdJdHVWfMQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":353880,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeK2JWCRA9TVsSAnZWagAAD0UP/jG0m1Qp8BpE408guSUU\n1flTcCN8tABjCE7VCiwKaur9rh1ukiUEMvi2GS+xCzmDT7A2XIIMhFbNNCNE\nUIUmjWDmwzTWZRNuVrlfDeRY3E4bDwHoUU5dzOruyOiF1bp2ikr753LklfRE\nkDIXibke0EkvcoAHQwHohAAIjXVZxa7iNiPiTtPOO984WgtSm41i13EnyXm+\neWC+G6/gNNst7xFPquCgKo+h/UWxB7Mw//hunaDutNMRY490XHUg/s4rorKT\n8SO2P6f5WnWnPJnRlbVIKhfGM8WQqMy3LCUX/5eJg5w37e0RamHKps18DALA\nn0Gyfiufldawu6Mjtp69FawOW94tZEB+NrchA9OJP0ug9GMFc6r0UJA3WAah\nn51/pPObM2IdtzumlBXiYVCWOS7LfR1fWzQbxbq+BgfXZ9aGHZWQ9HU0+AhK\n10n+a5sabgeg761+UW6gwMUJPy39TiPngzCekpq4aKJ8MqQGh5LThLGrAU0m\nSqjiv8g+dgX2u6tXOz/yLu6eaiys/eYPns17l2sUB3UWMaMa/WafyYDs2+Cs\nERjTYH8YfcV+H/2wbkrljT8ZhBwR/xCFKzL/jxN9WiE1tZsDWZc1FQp3h9y2\nOJPKC1+HLOE0eVtlqcQ92U4Z9j3dtfzB27OsZRIG0+ldad30/p9mNii/WrXu\n5i6D\r\n=cCPs\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`mdc-slider-color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`mdc-slider-highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`mdc-slider-rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`mdc-slider-rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`mdc-slider-thumb-color($color)` | Sets the color of the thumb (grab handle)\n`mdc-slider-focus-halo-color($color)` | Sets the color of the focus halo\n`mdc-slider-value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`mdc-slider-value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`mdc-slider-value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"1ac98da12680a4581dd0427e23f1dd1b95a939a0","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.18.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.18.1","dependencies":{"tslib":"^1.9.3","@material/dom":"5.0.0-canary.ef7de4def.0","@material/rtl":"5.0.0-canary.ef7de4def.0","@material/base":"5.0.0-canary.ef7de4def.0","@material/theme":"5.0.0-canary.ef7de4def.0","@material/animation":"5.0.0-canary.ef7de4def.0","@material/typography":"5.0.0-canary.ef7de4def.0","@material/feature-targeting":"5.0.0-canary.ef7de4def.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_5.0.0-canary.ef7de4def.0_1579901525708_0.7776038358919839","host":"s3://npm-registry-packages"}},"5.0.0-canary.93e2288b6.0":{"name":"@material/slider","version":"5.0.0-canary.93e2288b6.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@5.0.0-canary.93e2288b6.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"1eaad74c464e33c6f66d03c0577528cebaf93e39","tarball":"https://registry.npmjs.org/@material/slider/-/slider-5.0.0-canary.93e2288b6.0.tgz","fileCount":36,"integrity":"sha512-PN94DZ83CMKwXbqokbt+ESQHGHxm/tYOljDu9HHtNgqONREmm9yaj7FeFT780kAN3oNFEpb86AzPtXEjPqIORA==","signatures":[{"sig":"MEUCIEgzl4IEDqpCNJoDGbzIdwgNNKY2NEo23WxJaX0lj7L1AiEAk/pjVLi/O07x3mqGAeXOVDF4ApNtv18yPuzl2ZMOzjw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":353880,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeMGebCRA9TVsSAnZWagAA4cwQAIWE4or0emtZRoj0V4y+\nz6DewVC3KSGkhQ3nBAFSoJCwDVLITBZnHyLdav+zQAbs8MxSpoVFlxpEbo/B\nHpMY2mzr9WBRLQdTLMvGUd63v6z4lBC4f6aaJzMYXfFY8KjedYnYYZPrkvVw\nitb24N2GV7kZhPitoArrjeC6LHMGqp7QS6cq3VrTH+dqgPKXykk/1B1fazgR\nKPdQ0J2Wd7cXhHRn736gUplINyzFBF8Z7bXwbTgh7Z/ln0/On2OF7Xs5jdk5\nBe01JRuBXqDOrGGEcRXx1vWDv/ZKYxOlTxAD7ifRZTF6Qh70SajliEgAIm9j\n789fWiT9MSbld4dBohPBAgSWwgtAm1G2O2GMPE6pjWXdy/S21YyLFA9MKRTX\n48d7sTmHTbEwCNeFWAgbRbw1W7ZX9D5CuXbc8gQ9L8Gt7yp/sjBl4mmXbgea\ne4H5fCiGf3l+J3hizvbbZivtQNnUPpzxMPzNf/jFoYkaFK99GVUs5ESFE3Ad\nfbU0RLQuSpFAk8Bbb1CpFaYEsMaXFPygKZ+8dShQZE5xjF73m86ocJORAbPg\nCRdxyPU2fMyVYloctTi7Nn7UMdBrFTF5l1ItQcXiqj8W6irl8wl46iw3DkD8\nmdUeRzyRRUT5wxXHuFRLu6aIwr93tis1WCoNuurungeOaLoclKxvuiPSzg63\nEpqN\r\n=C6K4\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`mdc-slider-color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`mdc-slider-highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`mdc-slider-rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`mdc-slider-rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`mdc-slider-thumb-color($color)` | Sets the color of the thumb (grab handle)\n`mdc-slider-focus-halo-color($color)` | Sets the color of the focus halo\n`mdc-slider-value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`mdc-slider-value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`mdc-slider-value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"00984d219befe7ef5ec7c042cd975979249ca8f0","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.18.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.18.1","dependencies":{"tslib":"^1.9.3","@material/dom":"5.0.0-canary.93e2288b6.0","@material/rtl":"5.0.0-canary.93e2288b6.0","@material/base":"5.0.0-canary.93e2288b6.0","@material/theme":"5.0.0-canary.93e2288b6.0","@material/animation":"5.0.0-canary.93e2288b6.0","@material/typography":"5.0.0-canary.93e2288b6.0","@material/feature-targeting":"5.0.0-canary.93e2288b6.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_5.0.0-canary.93e2288b6.0_1580230554784_0.6154925850528434","host":"s3://npm-registry-packages"}},"5.0.0-canary.34ef15f67.0":{"name":"@material/slider","version":"5.0.0-canary.34ef15f67.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@5.0.0-canary.34ef15f67.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"dc0152a5b3557edbce64e5f656463e5cf1fc1cd7","tarball":"https://registry.npmjs.org/@material/slider/-/slider-5.0.0-canary.34ef15f67.0.tgz","fileCount":36,"integrity":"sha512-TKnXhH2qmFS1+gXqKuSifQEPbnnJB21kLRfLeXynWDPO0GCIJsM8BCaOOU+yhlMwGq4qQBmCsmoNS/JFXbjERA==","signatures":[{"sig":"MEYCIQDKSNBzVQF0QxqK5/r/26p4jshifrVuNNbFYDiGYMpFbwIhAMSDYDu8s/PxZ/rlA2l6hTUU2UGxFeGEG7WTwOdhdQr7","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":353880,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeMG44CRA9TVsSAnZWagAAYgoP+QEuGTC/+Swp1hRtgiHa\n+RgVDCfDwdAcjD7IuxtUA6PP32rPwtsNwkQQbsSOJq3iDeZmke0GkC4aDys5\n55iMJoEmEjkMI0IPsFqXKWBsb3vb2xa5LPj8PfvyFqKOhOqzSeo2enc1Q3Jy\nazyTx1wOMhAuBwpcxwQOFWEm63R4QX1gZw0UujOW37SJbVK4c9SewdnDBZ28\nf9zeDzTvaKH0+pqrNE9YgvFC2G22Iqt9DaNrDgJrXjcVGwxfMNGFhaDfLy/W\nx/mW7z5LohgOWImXe+crXosO2K8hJ3ndRUsfYOYB5P76aUbdzk3vHRfOjTRC\n+uHsV43/90aL+r5MCG5IpBMUmvxN/cwnIH+OMrlpWoQStWXCgLrybtLhPb5q\n0xz/Hn83TGr5+0na4JRHmvXnvZHwkZEVskn8TN2GkyOFre1r/WW8PE9dVjAX\n1O9A5zTgPHQyS5J0pjGN0zluUETenWIUqBoaHDMHIis6bA7IKnNmG34XWBZQ\nw55ePyZQYnuavL7bv8otIDxdlbL1imae9hDFN1rBn8FxWRNNcd5gab54gSMS\nFVZR9Y+dxltGBBudiuPOlbcgbb/RMG4JBUc2cPvn9tue0tO/vZE1s+1nazLG\n7WEZ7e6r+5BkIR+R2QHF+k0qOq3HLPOwjBiwPdI8y6TrxHRcOk8KLeDpBLkd\n+wIo\r\n=q8KC\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`mdc-slider-color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`mdc-slider-highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`mdc-slider-rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`mdc-slider-rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`mdc-slider-thumb-color($color)` | Sets the color of the thumb (grab handle)\n`mdc-slider-focus-halo-color($color)` | Sets the color of the focus halo\n`mdc-slider-value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`mdc-slider-value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`mdc-slider-value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"21f8c61e71f0a9c48eb2042e25093b7a821e30f5","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.18.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.18.1","dependencies":{"tslib":"^1.9.3","@material/dom":"5.0.0-canary.34ef15f67.0","@material/rtl":"5.0.0-canary.34ef15f67.0","@material/base":"5.0.0-canary.34ef15f67.0","@material/theme":"5.0.0-canary.34ef15f67.0","@material/animation":"5.0.0-canary.34ef15f67.0","@material/typography":"5.0.0-canary.34ef15f67.0","@material/feature-targeting":"5.0.0-canary.34ef15f67.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_5.0.0-canary.34ef15f67.0_1580232248333_0.9614448310945372","host":"s3://npm-registry-packages"}},"5.0.0-canary.d3d176ba5.0":{"name":"@material/slider","version":"5.0.0-canary.d3d176ba5.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@5.0.0-canary.d3d176ba5.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"f9b921be2dead0c5fe650dcd3e0adc8c6c4979a0","tarball":"https://registry.npmjs.org/@material/slider/-/slider-5.0.0-canary.d3d176ba5.0.tgz","fileCount":36,"integrity":"sha512-0xsbe/3HbvoIYHfxYNW1LyxJjivDJ4tkc9TDTqGyPad8d3QV0d+EPBEd0Z5gQbNL7gWbPfJ0w+FXBzqe8M9b+Q==","signatures":[{"sig":"MEUCIQDBPoq0Ru4FKE2DOVSUyW0CPmcfoCe7o3hEOkmgoHBj7QIgXY5GkVGlGxavzbUmVEh4T8PIB/qA7xtHokSjTOBqFSQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":353880,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeMG9zCRA9TVsSAnZWagAAP/8P/0bnXmSXytB+lN2Uj8qZ\n/p3H9nJAkViAKk2kEW4umyWpGEGU11uLpRfzhLnEPgauz/YaWyfbKiuAKNJ9\nvmGLsQeGxV6+wHZnyBpiumsrTYyhH0+WPLYN3KTjNvzzB/1d3BWFBxsGZ1hy\n7uGhLnOdNClGdEY9KWwm65O4VpoGpZEy5djPu8LSc7kHKx11ptPCJPeFkS17\n/cpfpgoLU47eOYvSv7PQ1RWIOlu5ag7Mhl4fyAEB+9b1tSsNhM6d2ESl4P8F\nvy9H0h8FTUGM9zUKaNzahUkRZAoEaD9P/MT467Oe3pnbZi8su5bZoFpgPERd\nL8zaX6e7qhA1CvLg0gLyWp6HPxK+G4LrSBkLixHmPxkmmgsJWPbhuNQWHPgx\nppTzvh7u5q/99HOvFqALkHo5ZYQ1EOxN3Rww1cRrwYj9k2I2x8UOKKpY08Ma\nl+yuF/1TjFviAo9Sf1CGGYLGwbcLWqz9v10AhkcOGNVxuZEE1sFZtnnHjP34\n7vA3wuDYQ5FJa+1t65bsk6LE9SQCnTcuxdEpo8ubE1f1lLCmkVr85jVsU+6I\nNQmbF5MQhE7uzmczoddgDA1QsYr0udw8f8uHS/VRDKcHrUT6hipHI04fTBUD\nf7tKo9vvAo9IpaHqLuuGK4qfjOjMCuJ2HwjlwJHuIOZRdo4p/lO8xxeJ73u1\nrJwp\r\n=KOiu\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`mdc-slider-color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`mdc-slider-highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`mdc-slider-rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`mdc-slider-rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`mdc-slider-thumb-color($color)` | Sets the color of the thumb (grab handle)\n`mdc-slider-focus-halo-color($color)` | Sets the color of the focus halo\n`mdc-slider-value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`mdc-slider-value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`mdc-slider-value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"218eacd6961bf740e059146072cd9e6c710dcdc3","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.18.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.18.1","dependencies":{"tslib":"^1.9.3","@material/dom":"5.0.0-canary.d3d176ba5.0","@material/rtl":"5.0.0-canary.d3d176ba5.0","@material/base":"5.0.0-canary.d3d176ba5.0","@material/theme":"5.0.0-canary.d3d176ba5.0","@material/animation":"5.0.0-canary.d3d176ba5.0","@material/typography":"5.0.0-canary.d3d176ba5.0","@material/feature-targeting":"5.0.0-canary.d3d176ba5.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_5.0.0-canary.d3d176ba5.0_1580232562513_0.11175514059107394","host":"s3://npm-registry-packages"}},"5.0.0-canary.32c1df133.0":{"name":"@material/slider","version":"5.0.0-canary.32c1df133.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@5.0.0-canary.32c1df133.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"d83e9f9ef930be288b686c28b30f3a2f83202f1d","tarball":"https://registry.npmjs.org/@material/slider/-/slider-5.0.0-canary.32c1df133.0.tgz","fileCount":36,"integrity":"sha512-ueObS25O/SuIXf8rCCcEEONqNHmCNfo30pCAiDb0t5G+BUjDjufg2tCPDRaFm6w55YqAQv7VKHu6pywOpb2XMQ==","signatures":[{"sig":"MEUCIAOz0krvzqe/MPIu/UZJDA3CHLQgMs4F0fh4igh1oXRWAiEAtsy+oOjcdbvm4A63zgbmavhoSxCW4SbbYQvQpoYiepc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":353880,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeMI7XCRA9TVsSAnZWagAA7ycP/2WKauF2kJ4wkWZdE6Sj\ngkRUAU1YMXGBbt4VTmBJQdZLkrPR9BIjFWuNs/9MTCN3YJyjO+eZDAFQDjwr\nnp4n1xptGXcIvscYV53ch/i8AvXb3VCF/v8W7DLVIIF7VX/0ko2aBNpmJzh0\nd0AG6cbs/7593GY/Omw99O9WYv+Aqu1B78LtN54skAKVX9ZTXUp5wGXPaqKp\nLdazN4TgUfpA+n7YGeB5s8nIdQz2+06r7sPAc9tMBpqgAio+PnWN1Ho1Fc15\nxO9hcg4eF50bNIfrCGVQNABx6gXCtenihm3yYcOeLbfH2DuYo4GQ8KLr1h7H\nweMBZE6kVwmmpDhED09ndBvAgzTrER3vct1iiWMHj+MymkqLvZYJnOwKzZYw\nD9EfJggJQ0Y9Wn0Ein5Rewfz7iAAciSoIoOcV0YUdfvOuZT8FH9EjaTDhBNq\n0fcuyNWW4CsJgZs+x5OIedA6/Ia2PpGrdC/MdzmgqMoe569VoPFPZCFvfwal\nWVnSZKgt+BhFf8+fRwZKxCF3/pd03kg2UYnjV8AJpLS/RkbjtKtSfCLCHV1L\nIxfVAQD1DxJ3u5Oc4HUFxCnV2HAoBOU/3FfaES1Ig613jbDTseMcg2CD8Ug1\nyUKYGMmVAPS3TUr7l6CStWFZMuFDevaKtcVHqWvfeZlEHKzhaBy4j8Y3TbpN\noynj\r\n=PgP3\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`mdc-slider-color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`mdc-slider-highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`mdc-slider-rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`mdc-slider-rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`mdc-slider-thumb-color($color)` | Sets the color of the thumb (grab handle)\n`mdc-slider-focus-halo-color($color)` | Sets the color of the focus halo\n`mdc-slider-value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`mdc-slider-value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`mdc-slider-value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"1f36bc15da25ecb33aaa27693bbcee65c1d56eaa","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.18.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.18.1","dependencies":{"tslib":"^1.9.3","@material/dom":"5.0.0-canary.32c1df133.0","@material/rtl":"5.0.0-canary.32c1df133.0","@material/base":"5.0.0-canary.32c1df133.0","@material/theme":"5.0.0-canary.32c1df133.0","@material/animation":"5.0.0-canary.32c1df133.0","@material/typography":"5.0.0-canary.32c1df133.0","@material/feature-targeting":"5.0.0-canary.32c1df133.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_5.0.0-canary.32c1df133.0_1580240599230_0.8908874158596762","host":"s3://npm-registry-packages"}},"5.0.0-canary.f3adce86f.0":{"name":"@material/slider","version":"5.0.0-canary.f3adce86f.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@5.0.0-canary.f3adce86f.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"6c4d8cf364ba73f4f3ab7220f88d5d8a9cc6e8a0","tarball":"https://registry.npmjs.org/@material/slider/-/slider-5.0.0-canary.f3adce86f.0.tgz","fileCount":36,"integrity":"sha512-O9UGWjCkJfuTnDWSKgxxvCrtGnaN3DY+iOfo6yYMkQ+pILXV833RrBJuL5OnIbo7X+3xVdj0YWciU5O91UJymg==","signatures":[{"sig":"MEYCIQDO0n1ObQjKtOF2LIy3qmTjiF6PyN/zx/kutJuJKSWtLAIhALCw5zIZQORYdZQ/4/vVoaxbSOzbRF+a5ueGl+Zi0lfY","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":353880,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeMKxMCRA9TVsSAnZWagAA3RUP/3mhf3Eoa+0yRgyHZK/C\nXpfBf2Dm7kmk0hdKUAyuZj0A0QiLJa8yUP52RzbbNgfry4bjLu44XIPB0vRJ\nKQjG0lq80omX1WJGO/1fctbdKu8dk1/LUElwKxPLrVIAq9L/NnljktREOYlx\nWbPEfu1zU8ext7erBtmXxIv947fN6h+K6rUbucac+JP0M47GroVXI5aXr5uZ\neqcOXQHuGTve7cNHcEQPylpVCcLSoDrYFj1UZyW/DAm/nMEs+Dmd/B+HO7C2\nRECvRzKmD689jMKWtoKyLE2+3TYjrQfQFhJR2oySlPnVguM+36B6+GyoYQic\nIXow7B+GA45hEeCby8fqiOhgLICSICWPfsUSpgMLHbho1xSSi/THRnOqF4x2\n8Pu5FQRxMo1XQrvUS2qjkZL5maQKLf1C+TSOIXaPSWfEyFbwEVMVF/tjGwP/\nNegtl804mBA4yNN2lJwETY8S40ec0BT3UdKGUpU8k0aeuSQmtE19iY/eVEcl\nsV15KX8bc+MBo+JdGVF/Vpfxp3fo7Gj5Dbrut2Tcal7Ju9QR427U/vbCME8M\nYQsQE9WR/cQA6L3e/+KT24MMpjWLeyL2T//IXQ03QGP1s0A8ZFU6DuMfveOO\nFTO2Tha+H1bPg612zbxzNvDuT5/tsF2KvIOfI1ZelrnjftEYrnSUTeOxpNTF\nYNwT\r\n=SM3S\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`mdc-slider-color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`mdc-slider-highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`mdc-slider-rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`mdc-slider-rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`mdc-slider-thumb-color($color)` | Sets the color of the thumb (grab handle)\n`mdc-slider-focus-halo-color($color)` | Sets the color of the focus halo\n`mdc-slider-value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`mdc-slider-value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`mdc-slider-value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"c352913b9c3e29f7b404b08db88a506e692187d7","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.18.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.18.1","dependencies":{"tslib":"^1.9.3","@material/dom":"5.0.0-canary.f3adce86f.0","@material/rtl":"5.0.0-canary.f3adce86f.0","@material/base":"5.0.0-canary.f3adce86f.0","@material/theme":"5.0.0-canary.f3adce86f.0","@material/animation":"5.0.0-canary.f3adce86f.0","@material/typography":"5.0.0-canary.f3adce86f.0","@material/feature-targeting":"5.0.0-canary.f3adce86f.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_5.0.0-canary.f3adce86f.0_1580248140128_0.8466838586612884","host":"s3://npm-registry-packages"}},"5.0.0-canary.a4423f890.0":{"name":"@material/slider","version":"5.0.0-canary.a4423f890.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@5.0.0-canary.a4423f890.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"478aab11f9a08cbd20b3eec98bbd175c4a3fa099","tarball":"https://registry.npmjs.org/@material/slider/-/slider-5.0.0-canary.a4423f890.0.tgz","fileCount":36,"integrity":"sha512-UpdQ6S2EFTY3obv83g2Y8SRVBig1BkDPxYNk/rNFnMXKE+toCfjnd4ZA64I12Se+t+n1NPtECSNl7VRckC1Ing==","signatures":[{"sig":"MEQCIF0a/xE2zpjf3YEDcCvFbFjACsy2TuAZUAeQ97jYw0ghAiBs+vognsjUJoEFRF9MfEAhOS2Ys4Lz6k5NOGtpyqeIOA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":353880,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeMfSMCRA9TVsSAnZWagAAcHYP/RnfZrwVQDthvPZG1N6m\nijtA8eK2B5Ud/TjoBL49SrgnOcCnscKmvmglRSaNm7x9UIPgJz9zyLev3A+g\n8IwhYne5Eg7nzRwHKznf59svHpOIl2syNBeRcJBG237xkFs+bN7iHL90k+UE\ntLlmYWQam+Im9E3Fm35vAms+YqxWjinyPu9J1eIE3WcfvVJTOY8bgsLSLLm0\n3/fyWSxuXmIodhU/lUHSiLhFHOWbJk70i4OCFxLPxXbl7mOb2V0WORcA0gOk\nIDYznilb/NcqxvMAmZCN6+RVdYrZH39sdBpIPcwmKQ8iBMI3tjeYqcmrbw9J\nXuRlSkbdcpxkoGizXbtOp2I3gzU8THnzM1WJxNF4aO70+0HXPSNy7D1f/H4U\nvDmL4XXp0NNrOez0gWVUQrqSVy+0E1gXNad1sY0x8THcnZKZD67ggNKyLyWI\nZ+zzMpLer671Pm/1oxJPxL5ZnDUn84o8w3HDhyFWg6SifKeqatcFWWQpcAjA\nTWWyZ3Xy3Bz37IsqlaFRaL/2uHELwEshumdsp2JBXxLWCRKNQWRJMYxKuc9b\nB9vOn3Xi8OS3roEYqHqg03a8SeviVBTfIsvMy85i0JIOf2UFPtevLmiI8SZf\nZnsITahneW6UdXFgSL3SsBFH9DFV6Pyp4s8AyWkb6JQK1DgMmni6GpZDK3XM\nZJCF\r\n=Vuts\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`mdc-slider-color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`mdc-slider-highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`mdc-slider-rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`mdc-slider-rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`mdc-slider-thumb-color($color)` | Sets the color of the thumb (grab handle)\n`mdc-slider-focus-halo-color($color)` | Sets the color of the focus halo\n`mdc-slider-value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`mdc-slider-value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`mdc-slider-value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"981df6741191636b0a527b318fe896f47f74cc0d","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.18.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.18.1","dependencies":{"tslib":"^1.9.3","@material/dom":"5.0.0-canary.a4423f890.0","@material/rtl":"5.0.0-canary.a4423f890.0","@material/base":"5.0.0-canary.a4423f890.0","@material/theme":"5.0.0-canary.a4423f890.0","@material/animation":"5.0.0-canary.a4423f890.0","@material/typography":"5.0.0-canary.a4423f890.0","@material/feature-targeting":"5.0.0-canary.a4423f890.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_5.0.0-canary.a4423f890.0_1580332171559_0.8586539389024341","host":"s3://npm-registry-packages"}},"5.0.0-canary.9351f167d.0":{"name":"@material/slider","version":"5.0.0-canary.9351f167d.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@5.0.0-canary.9351f167d.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"7d2e30ee75cbb0fcc222640e7d72adc27399be24","tarball":"https://registry.npmjs.org/@material/slider/-/slider-5.0.0-canary.9351f167d.0.tgz","fileCount":36,"integrity":"sha512-RVELScq8y8Ozaoap9EtCXa1co88zB6AKzseWDbSojYwZcGSTy3lrDgDOgXyzJbMKfnhvgch6p+t1kuq06SpHmA==","signatures":[{"sig":"MEYCIQCNBHoxsmBdrZBnho1C7Ks13yYhw67N02D+xcvbCMmTigIhAJAVhbCSXtDwvo+r6sj5lYiztD+84/dD3TQyScv8Vc4R","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":353880,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeMf9YCRA9TVsSAnZWagAANo0P/38fYqSb9tIMBz1cEZ1p\nWD4z059xXds7/Az83YE/uok2RF8ancvzBGC+hzKLlcTmYO2MN6qwV/QFT7vG\nPHRGzh3k4gO95bj6z97FjgcwhygqxafiYHRT63x+rdlEiyLXOT80ukYhrRNW\n/4X7VrwpVHr7beWIpVkxf8vASsd8FCPacvlHj7kAejix5g0X6+gWap+U1zux\ncly+4SEV31yj/KvpFxHKt342Gy0uVos6ClL0XshT08n1DjpzKWk4WN00hdcH\nY4JzVokkZUEdBTzXGF14WMjt2TAUvBh4nh4XWctzkFgNKZ6JzVQWztHE3klk\nD4XGWMOBAvJqw5B5NonKGMnn1seIZv7wEgOxlSj2FhfumAI+vtbAweTpdf/g\nw43XpJ0JX1KrXQ8pBWABaYDYRFZgeAVjyfOUCbHCIsEj8TAgVYS/PoEI4J3D\njL7q3GeyLHPtLi4/AJnTHyqWK21DQkZMpAr2tt55k0/21W29w19PrDp/S1qH\n1DKvJj4FMCcuHN1oJ8LuGwG9r/zNq+VwRyDfAmUC6IT1enceg53J4Dnm+Uml\nznELgg7LMT/407qoDJHEJTpwFkVpJjrwysjmHeTMhqymjTRkE7FGdGKOkUwi\nhAKGmJmWHtyZ2QVGaHpTlBzAylosFW+FGJOFXLqHP9wwuPeexR1XVxh9hMPA\nKMOj\r\n=s7I0\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`mdc-slider-color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`mdc-slider-highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`mdc-slider-rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`mdc-slider-rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`mdc-slider-thumb-color($color)` | Sets the color of the thumb (grab handle)\n`mdc-slider-focus-halo-color($color)` | Sets the color of the focus halo\n`mdc-slider-value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`mdc-slider-value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`mdc-slider-value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"6c1a50ef6adf8852f326e285227923411e60a63b","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.18.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.18.1","dependencies":{"tslib":"^1.9.3","@material/dom":"5.0.0-canary.9351f167d.0","@material/rtl":"5.0.0-canary.9351f167d.0","@material/base":"5.0.0-canary.9351f167d.0","@material/theme":"5.0.0-canary.9351f167d.0","@material/animation":"5.0.0-canary.9351f167d.0","@material/typography":"5.0.0-canary.9351f167d.0","@material/feature-targeting":"5.0.0-canary.9351f167d.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_5.0.0-canary.9351f167d.0_1580334936448_0.6292053507413162","host":"s3://npm-registry-packages"}},"5.0.0-canary.29b89dbc1.0":{"name":"@material/slider","version":"5.0.0-canary.29b89dbc1.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@5.0.0-canary.29b89dbc1.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"7eeacbab72a5a2b762f098aa3ed0368413af0f37","tarball":"https://registry.npmjs.org/@material/slider/-/slider-5.0.0-canary.29b89dbc1.0.tgz","fileCount":36,"integrity":"sha512-SmI5Izp2g3mrQ7QXpaELPCJHdRCG1n70zb22vGRRmPhETb0TJjP/rzXhgczzSy/ZfEwH98TaMPrwHpz6nD2V1w==","signatures":[{"sig":"MEQCIHAwwXzZRNviJ4TtQvV/0e4mQD/3uvKZkUfTYeX000/BAiBzO9oLAH3f1u4elIKI1E+MKeGNityNm8OfRnOUt8wznw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":353880,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeMgRMCRA9TVsSAnZWagAAzvEP/im4CIM2/2OSFypXxIg0\n+9QW09Eeu2HYji4JGV64jAKxgmSfXos+xcXyXMZS5+TWGblVNJsR/Vo9KMzN\nWA8rbSvI5/3zCahKGa0xKRMv9Egke0qgdLXMyMnvxczK0icay1SsKLKr4/ur\nAKshB3LmKXXVLVnfCoKXlQs2osFsQbpHA8gJHWOR3K6ZZLxEFb3M/5l485fR\nNqjIUHklqYtlItW02JtBuNt9J/MYufKXSz+pkGlP0aineCQ4WT01e9o/lyYp\nwnTrHGrVeBp5QAtY56+SyJ5cBiwfQhS5j/tERIv7zol7WlLZ+2DBf1cwIPQr\n2kZwJpWoyMr1Fcm3KuZxw0Yxv3GouYFHnbKhm4YEHPq5/CSQGEt0RZLZwDy4\nO9zmeN07lbEUF2amNpOuPcl52lrHLBSdFuiyckg3jprFrACGNqDeifIBivY7\ne4W1W9f8wuSE6dVQbMkvBHItoxINo5T72l3Xv33fQ2tg1n7VwOxnmN3AaiJ8\nXj/bxamqae++fITMaRnnR3gpyskN1kCicjRe8bF64jl0h1uO7FpuFXSFc1dc\ni/O+M2dCMEuwCP/BJ5+xn/9VR2kyhTeG6hvor50VA/joII2TynAHt2jaHMB7\nGdTM3pAp8VZD1CwHpuRgzek6Jwh3jf2qEDS3tkENYSI1FosuhT8zF01bb4ar\nZcmP\r\n=thzE\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`mdc-slider-color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`mdc-slider-highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`mdc-slider-rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`mdc-slider-rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`mdc-slider-thumb-color($color)` | Sets the color of the thumb (grab handle)\n`mdc-slider-focus-halo-color($color)` | Sets the color of the focus halo\n`mdc-slider-value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`mdc-slider-value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`mdc-slider-value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"662c3c36b5ac6bb47c841a10193f2c717bf9ca86","_npmUser":{"name":"patrickrodee","email":"prodee@google.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.16.3+x64 (darwin)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.16.3","dependencies":{"tslib":"^1.9.3","@material/dom":"5.0.0-canary.29b89dbc1.0","@material/rtl":"5.0.0-canary.29b89dbc1.0","@material/base":"5.0.0-canary.29b89dbc1.0","@material/theme":"5.0.0-canary.29b89dbc1.0","@material/animation":"5.0.0-canary.29b89dbc1.0","@material/typography":"5.0.0-canary.29b89dbc1.0","@material/feature-targeting":"5.0.0-canary.29b89dbc1.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_5.0.0-canary.29b89dbc1.0_1580336204316_0.7697848676863477","host":"s3://npm-registry-packages"}},"5.0.0-canary.45985457b.0":{"name":"@material/slider","version":"5.0.0-canary.45985457b.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@5.0.0-canary.45985457b.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"8084b70f73fd79c2363ed7494325a9b25d8d2fe0","tarball":"https://registry.npmjs.org/@material/slider/-/slider-5.0.0-canary.45985457b.0.tgz","fileCount":36,"integrity":"sha512-jQbN6zuy+tcJAme0TwFwW6bF6JKH5wMNL6ByuPNcJWe5TSKpXbKp2Z+nv1jDy26SN+iLt8OW33sKQjtUohiZsQ==","signatures":[{"sig":"MEQCIBT+Wdk9OP4CJZH8Kupyrv++BLWQnGrUxOPmgpu3cIBxAiBDeSeKKV7TCzopzt1p9FgCCtLL7nJA9gHl2g4RRH2vhg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":354161,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeMhYoCRA9TVsSAnZWagAAxPgP/2k86P5fL72yqQ/XHmLN\nClAdnPFBh5Sb1PSwskKJgx9qfoXCWnKEON5ZNzUZoXtDgp4UfShgvbaWKt7U\nLxdp+y0Jnjm+/UFKSn8DaV+2Kk1IqimaKLks1cwBCwxLi3IlFk//3zUwdduA\neu1VZR5YgwMK3SxBfXjbdd0JgfQixNvhovrFUyvwiFFKgQ4It5DrCDgUofEb\nDBVbfDgzkGVCKb9V8/E7OSfCEE5FJfOIaxitKPBIaq2/KF2U+xthuus9esWJ\nQS/oi3/IgUDy1B/SzapizgCsDjq3UV8VpXOcq7IJvzWgqqnjf+H6mEWqFmes\nYlsmvmWOcEF+STUkW4ZpWJ+wRubk94qO2acC+CsZd1w9SSZzq3QOjAelLUsi\nTPgg5QID/OzlKUuGM4JI6BoFMeYjUP6mQBuVIV1qxQBZMpWlXRuF3+wW8T0i\n9GsRAlHnERcBYf5n/dqZDpFoHTV9d2GtOe5ClHWt6ljo/uNSGIqQj6i+g0FN\naCXjqO8n58LoAAnVmOdX5WWNK3lukzeL7nA43q4npNHKDLDO88kq0+HeR5B/\nN/OFsMt31/vVf8Y2FxIwAxLfgw3X9HoCHkditRXelmyFwN8xEcSuwq7BWZmG\nZagjudh8dcxd8ggrG4Y014lPaZsKHVvNeg9PKx0CQXg95kRmwsXCa8ZooiOz\nXCMl\r\n=Bl0u\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`mdc-slider-color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`mdc-slider-highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`mdc-slider-rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`mdc-slider-rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`mdc-slider-thumb-color($color)` | Sets the color of the thumb (grab handle)\n`mdc-slider-focus-halo-color($color)` | Sets the color of the focus halo\n`mdc-slider-value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`mdc-slider-value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`mdc-slider-value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"bfd13ab23e42c09d1390ffc6d7cf1caf1a237485","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.18.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.18.1","dependencies":{"tslib":"^1.9.3","@material/dom":"5.0.0-canary.45985457b.0","@material/rtl":"5.0.0-canary.45985457b.0","@material/base":"5.0.0-canary.45985457b.0","@material/theme":"5.0.0-canary.45985457b.0","@material/animation":"5.0.0-canary.45985457b.0","@material/typography":"5.0.0-canary.45985457b.0","@material/feature-targeting":"5.0.0-canary.45985457b.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_5.0.0-canary.45985457b.0_1580340774769_0.6127822352918937","host":"s3://npm-registry-packages"}},"5.0.0-canary.a1a0deb3e.0":{"name":"@material/slider","version":"5.0.0-canary.a1a0deb3e.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@5.0.0-canary.a1a0deb3e.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"5352ce0e6f86f11d342478d0ed3baf80796a6c8c","tarball":"https://registry.npmjs.org/@material/slider/-/slider-5.0.0-canary.a1a0deb3e.0.tgz","fileCount":36,"integrity":"sha512-kpqTaaKMZRn9o1C9FDgL/LgxdFYin0uGe/vWwJF2GQJ2g2Unsi4wT94I4SyJrhIXzj3ZzIj+xNJSRdLi7Xi1/g==","signatures":[{"sig":"MEYCIQCdsNf9LUyJmKaxJwhH7Yvu6NFE7h7DAwrlDn+Vp5UQ9AIhAOp5zOJF2/dmyRiUluPeD4ua8K8pkY3uhrtszmoAnw4i","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":354161,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeMxRICRA9TVsSAnZWagAAQ3kQAJau4Vyvu43VlBTbkkvN\nNQ1dF/e4eafPVS5HFSVjOujs7SOyPSFGV1c1jYK1J5HD4UkBV5y1axiLf2Lw\nnw5JAaEphzNrEmoGB8ReovJNQWgKuNr/8ynb5WqvFvvbdVm8dxkaZcqhI/Tk\npgjp24fCb6TakzXgKFtXMH6m+OGUB+Lw5qqe+ZXUeVHICsGE/UQwawtUE3NJ\nDHdbBlaefZKB5oNNzWF3GSTAxqcwqxxvULz5oLRPZNWOp71lJGMWMyHP2/pm\nctv3Jutbga8Wg482PA7ruWwtNwyTMuMaBJxjvRNz7Fey7FAjo88KW3KSJRNF\nrO4bHHzqbLj8UDMf88vyPJ6nBJ0yI3g8erN52RnLKhEC2xDc5ub0d4e+SLgk\nX30UtBkB5+9+euUkmXjylJ34x/dtDxUizjOUB5J3gbT/hdJZ4CHdQmRwnLOz\n35GelryIaf2Y71KnRK2toIq0gMCesdeInQxvuKiZ/bF3D8h/ZmuuhveS6UK1\nkx3TkrTK+/RunG4Fx3E1qWbBl7RFS9/NQG3xlersr+CfL3NngyxP0NQz+OxE\nmAI9VDndqJ08K1e4v1DLJS/EGy3mUCTXkaniUnqqGdQGiSLlk0+u1fiMVVl2\nFcMBB7+l4qlMWlNalt8dcV05s2RQzGNiRo3zfwqKLPlyu1tRWAs69RWlgat2\nkxmU\r\n=0JUq\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`mdc-slider-color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`mdc-slider-highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`mdc-slider-rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`mdc-slider-rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`mdc-slider-thumb-color($color)` | Sets the color of the thumb (grab handle)\n`mdc-slider-focus-halo-color($color)` | Sets the color of the focus halo\n`mdc-slider-value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`mdc-slider-value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`mdc-slider-value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"515cdf56b0195423f7134244b26cd7999b647d68","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.18.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.18.1","dependencies":{"tslib":"^1.9.3","@material/dom":"5.0.0-canary.a1a0deb3e.0","@material/rtl":"5.0.0-canary.a1a0deb3e.0","@material/base":"5.0.0-canary.a1a0deb3e.0","@material/theme":"5.0.0-canary.a1a0deb3e.0","@material/animation":"5.0.0-canary.a1a0deb3e.0","@material/typography":"5.0.0-canary.a1a0deb3e.0","@material/feature-targeting":"5.0.0-canary.a1a0deb3e.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_5.0.0-canary.a1a0deb3e.0_1580405831707_0.9523629736238939","host":"s3://npm-registry-packages"}},"5.0.0-canary.181486643.0":{"name":"@material/slider","version":"5.0.0-canary.181486643.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@5.0.0-canary.181486643.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"7cf295cc07d703b1de02daef0f6755fd7f4580e6","tarball":"https://registry.npmjs.org/@material/slider/-/slider-5.0.0-canary.181486643.0.tgz","fileCount":37,"integrity":"sha512-hmPptofbjpTK2meUw08G7zTzqDvuAGU6CMYqg8M13UHSFl0mbgqAZ/yGGdrtSf5/j5024wVZ58f3L6nVM3Jr3A==","signatures":[{"sig":"MEQCIEGzZNAix7+lG+QVieg8y3REt2baBGZ0iIAmj9jD+LqJAiBnvThENtqC9Nxth9+VUQdTRbL7/FuOuZztVgEIHi9y+Q==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":361071,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeM0LuCRA9TVsSAnZWagAA0DQP/3LDe5A0x+S4sEnWu3ss\nc3LYRECG3XkPhVCFAV9q5eQL5NKmpNhBm8QnFVgrkxeLI4ZmBIxkVz/Re//X\nnmxcaNPuHb5eSfeSwvsyT2SEYuKWQq0tO6uYyvFmRp97K++jw/0Z2Tt9iFs0\nWlblNmdJA8k9HSHYSG2qB6RZ/1475FTTgvYmr9WfHVfG7GpxokFX/W+CsEDd\nOLyNUnxx+MM/HhNBg8guEc08PG86/z8dwT7o/6GphZgv+gO2hFAFDs+lWgOm\neAlwEWohiCyHjo0LjXOLf2+gY/UfbND/PYtmmUVpCpAAstgamkvs+VLO3ec9\nRyY7dHoUmAZQialTkOymTPsU7SI8nYOtkRo28m3sHHXYoIfezOhwmdVU1dBY\nc5T1Pgy6YBU4JP0kf7PSYAFjVH7QeDLp2dfxc1+OeJLTRLTZ9u86qagJNRKd\n+E8nxAMPHPNA8p1Qj5SjJYYOkhASqqPo9sseRRI3ZtWWHgaqJpj2ThVmm6dq\nsEdoP8A7WsHjwezoiLMV1p0FIffYcF78ahaqaES2tz0LgJBCZl3KXzNcQC0X\nPQW2nJvJZpxLkNAPHIXgjicnlle1Qh2Py8sIsimxiaxR8v/BrbWL1moggtuc\nDtxQ1hJHG/P0jbMxzXIUUIzgRkqoLNhieWbLsAgU9cgCtxXPlmOLN/LPcqrb\nB5am\r\n=1WJ2\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`mdc-slider-color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`mdc-slider-highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`mdc-slider-rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`mdc-slider-rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`mdc-slider-thumb-color($color)` | Sets the color of the thumb (grab handle)\n`mdc-slider-focus-halo-color($color)` | Sets the color of the focus halo\n`mdc-slider-value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`mdc-slider-value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`mdc-slider-value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"8f29e2225089ac3fbbbbf9e1a64e9773ce276236","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.18.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.18.1","dependencies":{"tslib":"^1.9.3","@material/dom":"5.0.0-canary.181486643.0","@material/rtl":"5.0.0-canary.181486643.0","@material/base":"5.0.0-canary.181486643.0","@material/theme":"5.0.0-canary.181486643.0","@material/animation":"5.0.0-canary.181486643.0","@material/typography":"5.0.0-canary.181486643.0","@material/feature-targeting":"5.0.0-canary.181486643.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_5.0.0-canary.181486643.0_1580417773953_0.7421224463450065","host":"s3://npm-registry-packages"}},"5.0.0-canary.3a85313ac.0":{"name":"@material/slider","version":"5.0.0-canary.3a85313ac.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@5.0.0-canary.3a85313ac.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"733124d579c218c7f3cc3b89360622bab87a0870","tarball":"https://registry.npmjs.org/@material/slider/-/slider-5.0.0-canary.3a85313ac.0.tgz","fileCount":37,"integrity":"sha512-+mSmNaScCNhuV80SXvbaFilc2UL6xldWaQle/MvDz4ZnPGTVJI/nv16hWpVTy4qb9oYDdUqqqqrwJzzDNK8czg==","signatures":[{"sig":"MEQCIAzwonIiJwnGGD+E+d20YBFMt+EO3RCwB6jYNg8vMNFtAiBZXHS7+o/RZ7edBOoNNzt2X5CDo8v/LUGhd9Z1GvoQLA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":361071,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeNFRqCRA9TVsSAnZWagAA1Q4P/3RzMmAYPlQ4NVYiakjH\nphOFGadyqIaJemIpftC9yMe9fF1htJvIbbkeH2oyPL3PTiHbSwCH8QSV4tn2\nBoqhZl+1g+u46S3RORGZgufJE0730um70gulzpNsvJUJxgkQDsKERga8DNyK\nRLuE8BY/naiReNsUekDvV82RBFMmw4wcMXcBnx/+pQffCJgSLxm/pb+y8goo\nh41sQglhPbYCrOmMBc89XwbjWOhqtuo8sRwC6wniTk5chn+qtG9aIpr4zolJ\n+7093+fO4KVQAidRRH/hkwn/1vuIjHrr3lLx8agUS0BIhYn9XyLVh6Oq1Y1J\n4VLKaWJaFeD7Gfl/BaNNMgtTdrWVueMPYR+T/lFcU01O/1FaYGYRfJhQkqLx\n1PXQ4Y1vHrGv9T5DNlVfZFplhzgJqDrCccLmRGbTPeQJ+hSRpe421oKBxNkA\nfLahPFqjXQWz1CUL70w4jwt89wCpCoeM3lxpVvU7dznYANYhPqheloWqETVL\nI091r834nb76UOFu8DDBSw9+f0kOlmnSF8Q0Modba91YIX5VVlw/qUB72VRw\nqupQNUaB+Y0bC5bGLHg6z6Kti/VZNryVHHWnijN5CF0zjXOstFtN0/ZfBask\nU9kSNDhhDRzveJ08E1DuBsX5uXjBoUaLD9ORWcvSu18aIwQ1MWhdbQE1wvJy\nKl+p\r\n=Zqqw\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`mdc-slider-color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`mdc-slider-highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`mdc-slider-rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`mdc-slider-rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`mdc-slider-thumb-color($color)` | Sets the color of the thumb (grab handle)\n`mdc-slider-focus-halo-color($color)` | Sets the color of the focus halo\n`mdc-slider-value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`mdc-slider-value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`mdc-slider-value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"a37832202a98646a817d62c20ce70cd38f089d31","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.18.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.18.1","dependencies":{"tslib":"^1.9.3","@material/dom":"5.0.0-canary.3a85313ac.0","@material/rtl":"5.0.0-canary.3a85313ac.0","@material/base":"5.0.0-canary.3a85313ac.0","@material/theme":"5.0.0-canary.3a85313ac.0","@material/animation":"5.0.0-canary.3a85313ac.0","@material/typography":"5.0.0-canary.3a85313ac.0","@material/feature-targeting":"5.0.0-canary.3a85313ac.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_5.0.0-canary.3a85313ac.0_1580487786318_0.06473765124263053","host":"s3://npm-registry-packages"}},"5.0.0-canary.b6c7f624b.0":{"name":"@material/slider","version":"5.0.0-canary.b6c7f624b.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@5.0.0-canary.b6c7f624b.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"c105c97dc93e824079965873ecdc342a04329e0a","tarball":"https://registry.npmjs.org/@material/slider/-/slider-5.0.0-canary.b6c7f624b.0.tgz","fileCount":37,"integrity":"sha512-PH2Xkhi/B4MUiWaP4gyXApPyqcwiY+7WVn3kYxXXLxEzMhyj5sD9z/DnX2/rW6SLJ39qVxRaJEi/Km1Ah3d7XQ==","signatures":[{"sig":"MEUCIGq8V2ArW7h5InaW1mkqi2TA/P/mXfWPDnDf6/6mnwdmAiEAhBiQZyuq39Ic5VD7MOD9SUxcrXRhUVAi+LfHSLBowpY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":361071,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeNF3FCRA9TVsSAnZWagAAV4gP/28f5Fm5SD9F6ISdLQMH\nmwQwQP9NM72u1qHSw73YlnAoAszv/ywf3cnIJEdkp3417AI4MvVvV53DtVxX\nVd79FNNvuwGqQgHK/JfttuwdCNDcZpfEgYUbh4CKZ8c2eIhAn9Z81k+ut7SZ\nIuzR0JbiG43r691eyrLL6NCd3P5YfPH6MQrhdV6MfzReeqGy2KTwv/gAC/Vm\nwcYOeDiGj6RKcS1fMmSjYdn+7O7AvhdN/WFhSZC3qrDmr/UOY5tPflH7K/2v\nnzxRK9B5mS1sfiy8A+2i+dCBn9ia8qQ7xZ4V8AR5XuqnKA5teiAB81wneAt9\nZPo5AgezHhkRBKUrEMAWhlqHHOS6rEtyhdJytpn6iJ1NUfREWO3UR+N20P/8\nI7R1OpTaX2fXr4CuqeXyc9edIv6w6jrjuuVkvZfPQGjS/Pp2WxsAXFB7Ii3Q\nMdmvRyZcKZ/4A8C9KAjWI0tnHfzqSulB1IOxABkoZaS50Tycc8JF9D/5z5ga\nw8VAs4rqoPat68U8YEBZqbwefka/dYNwZdm0HmpbtD/oNVNzLsqDagCHQi37\nlWkjYZ4aNIfBkakPKG0Qc0R/gbUn03YSjzG/TU8IdEAFfsq2N6Gp+h8vleSm\npEGpKVdLaFKnBJsz8c3v8yhg23I+CCZwLUzVoZZfWVAikjKT/pxt1CUgW1jz\n19LC\r\n=PwtX\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`mdc-slider-color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`mdc-slider-highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`mdc-slider-rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`mdc-slider-rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`mdc-slider-thumb-color($color)` | Sets the color of the thumb (grab handle)\n`mdc-slider-focus-halo-color($color)` | Sets the color of the focus halo\n`mdc-slider-value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`mdc-slider-value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`mdc-slider-value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"eb607bfa0326630c63037143dc919ac8ec5c3636","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.18.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.18.1","dependencies":{"tslib":"^1.9.3","@material/dom":"5.0.0-canary.b6c7f624b.0","@material/rtl":"5.0.0-canary.b6c7f624b.0","@material/base":"5.0.0-canary.b6c7f624b.0","@material/theme":"5.0.0-canary.b6c7f624b.0","@material/animation":"5.0.0-canary.b6c7f624b.0","@material/typography":"5.0.0-canary.b6c7f624b.0","@material/feature-targeting":"5.0.0-canary.b6c7f624b.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_5.0.0-canary.b6c7f624b.0_1580490180655_0.4711620887753454","host":"s3://npm-registry-packages"}},"5.0.0-canary.b3f70ebde.0":{"name":"@material/slider","version":"5.0.0-canary.b3f70ebde.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@5.0.0-canary.b3f70ebde.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"31074241f67303492d77980c07b6388825224614","tarball":"https://registry.npmjs.org/@material/slider/-/slider-5.0.0-canary.b3f70ebde.0.tgz","fileCount":37,"integrity":"sha512-IPuIhOmAOOTWooMhAb+MUvJj91h2I1+8aJpZbIj5yUAI7HtOuH4yJQeysvEaM6sku/zlkh/+0AntiOuExsPT4g==","signatures":[{"sig":"MEYCIQClDSe/vUWMMe29Tnr03Ew5I6sBAv43WFR1FVLhhKnwhwIhAKZv1Y3H/hGaKJ7gMBoyv18K++jLi744F7saJYzvIYVj","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":361071,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeNImkCRA9TVsSAnZWagAAAmgP/1ZPT90DRYevmVAOulO9\nA3aqbhgtSWSHXxfddRjazmm+skirPnDBXhWaK6IjKUxtPg/AU2yn1zKekrqo\nNEUslNIPlhzNuGMQGFgPk1xnLZDMGV49TB7O/uXTRN3amHRk1uVS7A1R1Svi\neaW8f0GFJm/cjgLaBfiIAAoNPEgDYj2HQD0GGlYNrzTvmWYNrxxVgcviGwzn\nEOWvRwQ2ITO922Tk7++/xM/CcBx6YWBFfh0v+a8kVtcRbGs2ySavE0yK+T6Q\nd7wX9tqWTuLCqXrMhQb/pouZq9KOGMqFGg0tA2JT85TL3mgcXfIH6W+ryO2t\nBvjxPyykkzl2/AhCfNInaCv2fpHz7d7rakp7Y+/YVCSChTUUG18BhgMkOL8G\nGghEXzjudGxDo0E4AHFtXSVoasjB6tioivRNruV/luYyl2i8SID6A4kEWrh3\niXd95mJhTIaIoPDrBmYxo3wr0AEYbL0eTv/9w27nOlOgr6Bgx0Ah/hVph9z6\noa61bIbGzJc3SneFD2/dhfuigjki55lBvG1hv8wrU3kD9y2lYPlzbCpTdKyo\n0KMa+Xq0p78H/QerUJ9NRKTqONtu+jzS1Fc/Qg8VVVaeXnRUlYyu4a8PDsBy\n3iP5vA6RJoc+bv0golZDYmXs3Df3mhdqKFsrpY/LnrRJ4UKYrHHX3MCjN+uX\ny+kB\r\n=byMV\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`mdc-slider-color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`mdc-slider-highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`mdc-slider-rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`mdc-slider-rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`mdc-slider-thumb-color($color)` | Sets the color of the thumb (grab handle)\n`mdc-slider-focus-halo-color($color)` | Sets the color of the focus halo\n`mdc-slider-value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`mdc-slider-value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`mdc-slider-value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"00a0473670032b0ea60db83e614385e1e3166dc8","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.18.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.18.1","dependencies":{"tslib":"^1.9.3","@material/dom":"5.0.0-canary.b3f70ebde.0","@material/rtl":"5.0.0-canary.b3f70ebde.0","@material/base":"5.0.0-canary.b3f70ebde.0","@material/theme":"5.0.0-canary.b3f70ebde.0","@material/animation":"5.0.0-canary.b3f70ebde.0","@material/typography":"5.0.0-canary.b3f70ebde.0","@material/feature-targeting":"5.0.0-canary.b3f70ebde.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_5.0.0-canary.b3f70ebde.0_1580501412061_0.9386605897085656","host":"s3://npm-registry-packages"}},"5.0.0-canary.3e782d8f8.0":{"name":"@material/slider","version":"5.0.0-canary.3e782d8f8.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@5.0.0-canary.3e782d8f8.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"bee32d3e904e009a50af73e5fe3704e3aaccb0a4","tarball":"https://registry.npmjs.org/@material/slider/-/slider-5.0.0-canary.3e782d8f8.0.tgz","fileCount":37,"integrity":"sha512-DQdeWwt0BHbZmXBmQBrdnN9xP3oEPAG1CHNeSndUXdMH/gHm6WLauvAMqoPuNuPqCP9HEqAqcXyxPlUS3H3YaQ==","signatures":[{"sig":"MEUCIFjjscHYWFVrR2KKd9gBkf3Oqr1xjSHwroVhILY7D5DbAiEAxUogvCPB0bU+T9GqUONdbCGpsEZyrbVT0/PZCpj7C8w=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":361071,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeNiIGCRA9TVsSAnZWagAAhDoQAJqIemmRLPXnreZIoQPa\nZQVcRUDDveMabF4IuA26PQIu8tTKV7RLh3P89GKolLp8vmqAryTuw82BzRch\ne3KGc2ehwHmAcl+O2HsXuwClMH1jb7DA4NmTY5qaLtnHigbWqMDgWyOWj7Qt\niyGNTC1nQfNzYNk/76Ggn7Qx203nVDbb2Rf+K4pYgHXoUXje1XVHJdQg6bob\nXoxg4eSY5u0dwkYFTbvsP4xkj8Nq3zY7YTdx/2s5zkfroi1S+itdZM1T6NyP\nfEg3V5oVlC81zUT34aYhVMRHwYN/Tb3m2oq/MKpb1jvH6kVf8vKJQGhbCsm2\nqfhdcx5nuK3zdLUXIXbGMW/68Gb4JEdHBqfC7ebnFssef1LzNIgdBV4X6u5R\ngPtC7fuv8RdAHbP3GYtfoDd6l/3rck1faDhpui5HpSGqTjip4eGqFsqY2y/C\nc/LwJoe4iMbxnUkZPTYsr7AyNc0MsosVktnO06nicLdj5XfVeFzViXm+r50Y\nP8IPhBD/NZeXuGP0rIauv9nkuxYMNvpUMlmbXpDL5JoSjY6RzchMO6YsxGaN\nshU5TDGWLyNWwlGBiGZBhptDBFDSCTEga4d1WovKFvgmKMm20GfDIIN8cL04\nRdMfeOZLzN900C7Nm8iKx1UPzqUop6JX6DHeORIxN1rEkkn00tYe91PGVYHE\nNjgX\r\n=7FKs\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`mdc-slider-color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`mdc-slider-highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`mdc-slider-rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`mdc-slider-rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`mdc-slider-thumb-color($color)` | Sets the color of the thumb (grab handle)\n`mdc-slider-focus-halo-color($color)` | Sets the color of the focus halo\n`mdc-slider-value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`mdc-slider-value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`mdc-slider-value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"8aae1fd4299832f77f4d1d51398e5b28ed5af5a1","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.18.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.18.1","dependencies":{"tslib":"^1.9.3","@material/dom":"5.0.0-canary.3e782d8f8.0","@material/rtl":"5.0.0-canary.3e782d8f8.0","@material/base":"5.0.0-canary.3e782d8f8.0","@material/theme":"5.0.0-canary.3e782d8f8.0","@material/animation":"5.0.0-canary.3e782d8f8.0","@material/typography":"5.0.0-canary.3e782d8f8.0","@material/feature-targeting":"5.0.0-canary.3e782d8f8.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_5.0.0-canary.3e782d8f8.0_1580605958503_0.3726445654926782","host":"s3://npm-registry-packages"}},"5.0.0-canary.535398572.0":{"name":"@material/slider","version":"5.0.0-canary.535398572.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@5.0.0-canary.535398572.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"bb6f07a609f223d59b264e62f6000fb6be17657b","tarball":"https://registry.npmjs.org/@material/slider/-/slider-5.0.0-canary.535398572.0.tgz","fileCount":37,"integrity":"sha512-u5WOi5iDLmlO9OiNbJFWJ6OfohwBMP2F16MHctH4wsMn3YqGw1aGKpbYTm9Kh+Ni9IGAUCTO4hRjRSxXdoBjjQ==","signatures":[{"sig":"MEUCIQDlaj/2hFsYGmeMUdw/wi7Jgh6janW7yv3jYicMHJVSxgIgTmpBPSEl1LSE2906alg89ivGJHIFbLysm8nf+xLvBw4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":361071,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeOGJnCRA9TVsSAnZWagAAhOEQAKBtrOGCTUAZAkHagZuP\niLfeiAwLc1OJJWX070H2LZYxdPmMtKgU/qwImQWVFglATzxNvAz0a8HCkzMK\nHOlZD6ml8/LF9uB28zEg1fVFy0WAxAOC8/W8iWCPaYDsRqcgj/jQUnxHSI6V\np7TjHrKSLwm7LspsfYWeDnNwJYQS+UkolSCxZjAIrdx0tZOCJNPJViuB+JK4\nj14SiEqrVI1Rlz+qLBVcifiWYMWC5D4b3frFowPy8A9oLNQRP818yK0uJV5/\n1NOIcibNNG+ZLI087ZCJZNiV8hkuMgVbqsJE16UCybNc8wI1v21I/LVozcRY\nFmAEuRfeAkisPz8R8DVSJRqUVnefbMEiSRwhQTb6/QoGZEi+YQB+uhpV2DpV\nanV1l8JhqrjIaots/gkN1Ga7IZlNIwUU2xVmZVdtiHS4yCdAGD0J471bAiM5\n1xqugVX9+huuOKeHmGHSo9k74mGnXU8bfuwbLiZCKIRg/ZyzDMZJ7i1BxXtW\nvORQ5cLA+LF9NZmyC/xpEp9uRYBvChr/a0WjjueYIRE8ETNwLpBjFxMemZpx\ntS5cgPELE3tfMMg1RxN8LtrosgQMExEvNvI44/vtMrAxUN2sLYgjyIDhsisW\nYLhiiFuYdV7Jj4jHN31yj0RC6Asf09MKc5bbBW97X5hiAUKkci02ew58nI+6\n5jx4\r\n=QN0i\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`mdc-slider-color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`mdc-slider-highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`mdc-slider-rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`mdc-slider-rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`mdc-slider-thumb-color($color)` | Sets the color of the thumb (grab handle)\n`mdc-slider-focus-halo-color($color)` | Sets the color of the focus halo\n`mdc-slider-value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`mdc-slider-value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`mdc-slider-value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"7f68038e23db60e7b4c44c1b17a6a82329805553","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.18.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.18.1","dependencies":{"tslib":"^1.9.3","@material/dom":"5.0.0-canary.535398572.0","@material/rtl":"5.0.0-canary.535398572.0","@material/base":"5.0.0-canary.535398572.0","@material/theme":"5.0.0-canary.535398572.0","@material/animation":"5.0.0-canary.535398572.0","@material/typography":"5.0.0-canary.535398572.0","@material/feature-targeting":"5.0.0-canary.535398572.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_5.0.0-canary.535398572.0_1580753511555_0.5843564802220163","host":"s3://npm-registry-packages"}},"5.0.0-canary.5ff33802c.0":{"name":"@material/slider","version":"5.0.0-canary.5ff33802c.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@5.0.0-canary.5ff33802c.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"01fae392bca71dd36feb4e2341a2da4eccecd2e1","tarball":"https://registry.npmjs.org/@material/slider/-/slider-5.0.0-canary.5ff33802c.0.tgz","fileCount":37,"integrity":"sha512-e2Bu1FawnjRRDf9IyDbz7Jow8UYa4tvR7u9tJSRF99AG67caCIMUcF9v8jL0iLeDZzsLNH7zS2xxBRRhLjpXcg==","signatures":[{"sig":"MEQCICQls+RR0W/xCfYi3m4hrikIJWLSqfVzXaqUmrCTPjPBAiB0xNwCCG7//uJQujfdTPGc4ODjpGn5VDC2p9xhjZDm5Q==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":361071,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeObIDCRA9TVsSAnZWagAAdYQP/1Nc/+j7ebk4Jn8a0ZKJ\nmw36L6so94ryW34/E8W+Lza0fn+Clpp03KnkoMAEtWtKZoDdPoxdmFcm1I8+\niUUnYVc3kXbTd+t8aYXWd08Imv/NNdiNBik+t5e+IsRD8D/UEuYLd0ik9BgC\nnnRKqyKajRaklp+W1PkWtAa/ngmKK6upm9YA1WjOQj3AKROn9GESRnDvFpz7\naJF9posA1Wfizjf2RJvwkUtRdfG/jo7U4pn7S7wRM192LdutmxT+UAlQaKg0\ndGxg7C2oZGcar1WrXQNzgEIFiqhYGPylWmSE6go48Q8tbbyX04oYf6qctiqU\n5I2hxVpj76nNFyq1cNXbvLJo04YucI7RxhRsWG1r9fCiRfxJ76ilEH8sZigb\nTT1l/xTCjD8mS8lh3Sv71y+/tc2C7NmXXbeSYk5ddHs+LKDrN4j3wwaVIsaz\npdYSxDTdn85FTfxLSyghe2Z6S6vgaLYNK7DJFlE19gKcG4fhKsm0fMcEleuP\nVTo0/s1RbH8laX9DnjVqcG4gCrZojivycVd1a6HcPn/KUroUNMQ34ACJ4MFx\nM8YxXX8UYFuXWaMt6BUn3Z52kf/xCRdoEYjO9XqVLQ6s358psYH4QbvOuaaL\nI0xx1gIy4eDv+1mzAqSph/WqLCT3JuDtGuRT95zb3+xiWzdwgTVEbXx3s5Vl\nNJoT\r\n=CySk\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`mdc-slider-color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`mdc-slider-highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`mdc-slider-rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`mdc-slider-rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`mdc-slider-thumb-color($color)` | Sets the color of the thumb (grab handle)\n`mdc-slider-focus-halo-color($color)` | Sets the color of the focus halo\n`mdc-slider-value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`mdc-slider-value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`mdc-slider-value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"61246014f77c40c0d6594f32e40f4ce98d8f7c8a","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.18.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.18.1","dependencies":{"tslib":"^1.9.3","@material/dom":"5.0.0-canary.5ff33802c.0","@material/rtl":"5.0.0-canary.5ff33802c.0","@material/base":"5.0.0-canary.5ff33802c.0","@material/theme":"5.0.0-canary.5ff33802c.0","@material/animation":"5.0.0-canary.5ff33802c.0","@material/typography":"5.0.0-canary.5ff33802c.0","@material/feature-targeting":"5.0.0-canary.5ff33802c.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_5.0.0-canary.5ff33802c.0_1580839426636_0.9817044448366845","host":"s3://npm-registry-packages"}},"5.0.0-canary.1eb29491c.0":{"name":"@material/slider","version":"5.0.0-canary.1eb29491c.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@5.0.0-canary.1eb29491c.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"34ee1bd12c9bec1e844b9db175578d1698825186","tarball":"https://registry.npmjs.org/@material/slider/-/slider-5.0.0-canary.1eb29491c.0.tgz","fileCount":37,"integrity":"sha512-BpAr4gBNx0ZQ0DnDzeyTcelKi4yW1XP9KUt5F7qUC1sVt/i+uwzqAU4mYE6lWMEughPEzlamM0BQUONkVgfq1g==","signatures":[{"sig":"MEUCIBFV/7N1rAnUR4AYLgdduY744cnVaRoKtGBRyjbb67i2AiEAlPseJVWJFysgDYNz3x99pqUFA2qGR5fMGjD07UdGLP8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":361071,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeOdtnCRA9TVsSAnZWagAAqfsP+gMiIBEomVGrSdsNI/8w\n0yBySoRQwYlWe9vvwUf0Aya1/u5K/MjojpbJTP82C8mIPykJ9b0tsYfIxQBY\n8Odnp6oog46Y1dakdNWdHviS/mD3IQmT5Aax85/QaYrNGWWCJj7lxDfgFFJl\nQYw17RfP4aa19CmnaNaYlZeMNY44kIg1t+qfI3UrIwx/waX1nzSIkLmXKbAU\nnmPsCR+uZ36dN3qU2P2g1hKm/guNPk/0+Ann8Dsm7umgifI8l6wrJyKs36+b\nvHLpef5C1bYE1NYTKkrC7s5b3n/Itnpe+W9hehZ2u4CxGw//0SmAyavc3TsB\nrOayReOzGXQqTyAubQU/ntPXhUPTz7SlHdM4W3ENBHZMambWguIiuL22eJbU\np7jCU5Y1N161UVmrTdw7JgFAfbC+k3hfNcy16WEzWgWYt1JtxEmeAuvW+V5b\nOie4y46c1pf8zzL/DdNV+B04jtO3jdMgTaGo7NgxDWHRqNcGNO/VYcBZMX3T\naKx4VJA18KZ+ePTB5z3QaZywgnogIWYz3Iuhx1hqUu8VjtLmMoJu1yhd4mJJ\n/lT1Vvgkh3nNWBZLQJ6vvjwurduXsTjamgfpRKQm4VONIMmaVbcp3FQQ8fhS\nB3ofuPF24Y8ZeqmeP16HbpURn9DBjPBjo/W62eb2bBQYG8/crrHsGKIAtfLM\nUb2r\r\n=hUhP\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`mdc-slider-color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`mdc-slider-highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`mdc-slider-rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`mdc-slider-rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`mdc-slider-thumb-color($color)` | Sets the color of the thumb (grab handle)\n`mdc-slider-focus-halo-color($color)` | Sets the color of the focus halo\n`mdc-slider-value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`mdc-slider-value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`mdc-slider-value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"689b043c66790b1c63b5d2037a1ed800248443d1","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.18.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.18.1","dependencies":{"tslib":"^1.9.3","@material/dom":"5.0.0-canary.1eb29491c.0","@material/rtl":"5.0.0-canary.1eb29491c.0","@material/base":"5.0.0-canary.1eb29491c.0","@material/theme":"5.0.0-canary.1eb29491c.0","@material/animation":"5.0.0-canary.1eb29491c.0","@material/typography":"5.0.0-canary.1eb29491c.0","@material/feature-targeting":"5.0.0-canary.1eb29491c.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_5.0.0-canary.1eb29491c.0_1580850023264_0.22632546211763094","host":"s3://npm-registry-packages"}},"5.0.0-canary.4c7154b26.0":{"name":"@material/slider","version":"5.0.0-canary.4c7154b26.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@5.0.0-canary.4c7154b26.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"2e51f8400b3d1fdc4505cfbf0b208af21eee5c98","tarball":"https://registry.npmjs.org/@material/slider/-/slider-5.0.0-canary.4c7154b26.0.tgz","fileCount":37,"integrity":"sha512-4NLis35r0n4r7XnL1CWAmkOe6FjSlgq5iSmYSShc3tsTKxZwZb06SPU6FspchXKrQK75tcgQe1SYwUDifZ8TsA==","signatures":[{"sig":"MEYCIQDs5H8tF1L6Rpwn9eFPjK4isEVE67ZOffyJbQIJmTtRkgIhAMXQUgdWwEDLYEoLELBQWXmXTxGpt6FqNgI9HJRwX0tE","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":361071,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeOucmCRA9TVsSAnZWagAAhmEQAImGh77yLFwsmwEz2LrM\noSMqwpMKe/3FcNR/4mMYsnPrRHGzhdEP4hFs3G6gmZS1xDpmbVLYoUpdqfmT\nSpZ2tzfAJLl/gjXJqdbxQbAj5uXmD6MS0RG7+HfyAy5WZURJmZdNqfzYHnY3\nIAD/K3KrjcwNZnNDeXdL1N03OFAoG38YJzXT1FpxD8222xZuQ9TleT4U4jLr\ntQd68JOHqGpZ9J1/IMmU60CHgi7pYT5UbUpxf3hsnJRo5zMHSA2pa0weM8xP\ny4qmaP05whigvJJQJA6H2bQfE6h8zAgZ/UFFAnoTYb5ZmThiMChdWORlsrg4\nAaKuHU0+HxQ/lJI92SSoTP9LMOHc25Fv2QpxdBiqZdSugaj2LefuGlEytm0c\nLCFX0giL7ZTbLR9XBEu9Tx2sNynNNBMqkdXfOgojVzwTzJNoTds5FGsh+987\nZsp73wsFg28bLJTbdcFr2VU7v0sC2db2Wh5qLiYJaceeGQ9jH0SNeOIiKKVI\ng6lpZbJ3xjs4I1+9iNcvcmdp7670YoXkdtl6AX4Gu/C6eqYNbizkpLQ45vpT\nmCzuMcW/d6FO0VIA8pbE1Xmcl4yG/ZwttHFlrRkWtmmptsNia8ovH+YPk22Y\nPg+dxyEIKPdjGvmS7GXji6JqdK4epb6S1SFnmSGER4/aHzQ6R09K9YvMakYm\nJcFj\r\n=CJwc\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`mdc-slider-color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`mdc-slider-highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`mdc-slider-rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`mdc-slider-rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`mdc-slider-thumb-color($color)` | Sets the color of the thumb (grab handle)\n`mdc-slider-focus-halo-color($color)` | Sets the color of the focus halo\n`mdc-slider-value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`mdc-slider-value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`mdc-slider-value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"e15f799c180f6eb07455eb8d644b93db93df5402","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.18.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.18.1","dependencies":{"tslib":"^1.9.3","@material/dom":"5.0.0-canary.4c7154b26.0","@material/rtl":"5.0.0-canary.4c7154b26.0","@material/base":"5.0.0-canary.4c7154b26.0","@material/theme":"5.0.0-canary.4c7154b26.0","@material/animation":"5.0.0-canary.4c7154b26.0","@material/typography":"5.0.0-canary.4c7154b26.0","@material/feature-targeting":"5.0.0-canary.4c7154b26.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_5.0.0-canary.4c7154b26.0_1580918566039_0.5668291223372204","host":"s3://npm-registry-packages"}},"5.0.0-canary.ab5f49a2c.0":{"name":"@material/slider","version":"5.0.0-canary.ab5f49a2c.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@5.0.0-canary.ab5f49a2c.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"dcd3e12fc37b4b0c36115c0c5fa9b505535bc8b3","tarball":"https://registry.npmjs.org/@material/slider/-/slider-5.0.0-canary.ab5f49a2c.0.tgz","fileCount":37,"integrity":"sha512-vgHVeSm85CV5BdQIVabW7rdIVN65if0PAYKiNisSwhPfDYpQSDVgrInCBoGJZW9a37we3yg2Sphf3inyb5+NjQ==","signatures":[{"sig":"MEUCIQCU+6wzodluHRd6kD2LSLV9vGN4LLa8N5VaLSLKb/JNxwIgTe3MB4BftwKvc1Glap4ZqklgVYJwdvpEWuCZvtUdGeE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":361071,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeO1CzCRA9TVsSAnZWagAAtPwQAJA04jPjwhXrOpVQhAxe\nZFEijH/4Tr5vYckCgaZH7AFufsHelN2jAicIVuoAze432G0SvjxPaT+nqEL9\nFDvhgC7PAHdOm/ccodPspqtBZAAYzyITncy/ZR5ypwKG954y/MeIEkZzGzwP\n/SX6zVxPA2lb4Zj4nxFf1KqdNHsN1+4CrPIfxkX/uMKrqrd8v9wfFamvAl0W\ndClHlvISmfOvhGQ6poSFUiApGYpQnU32X12BzGsXW+LR5YA136FYYeig19Pq\nRSRfqjFXBWKMBkzDmzhKjhgPbWnIL2rS8EjPqkDzxDyV7FdOl6gn9n9h0Ju5\nOPy3h82VS7wbde2JY1gMSI4eQhDa+8nyFTmvm/dUqXKuTN7qffVCjczxDcQY\nl7b0x1zmpYaWTbjU6EAVaTUsMvDEfeUzIQY36g8f+j/RqbkWdR1mvUMXaNu4\naQLiMplgN6AoqV3S/6AsfAhX6urGWuDpx6hq+7DyHIDMHl46fSMzskwHcx8H\now2ySJ9JqHVVCsUY48t3ljAftd/DqSqKBgbrZYh/Yuorg8QPsNZq9bZLp7GH\njTmMbK0Xxumh5IAIGFHxr2vVzxDHmKWGs6hVfPRpA5KVrdSQDJZ3l1q4URBF\nQxZ2UV5NXdQnJWLp90BKHjxhIUcRee/SVRGQE5Oz7XhvKGvgUqZ0ZG5xD3FL\nydLx\r\n=nidl\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`mdc-slider-color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`mdc-slider-highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`mdc-slider-rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`mdc-slider-rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`mdc-slider-thumb-color($color)` | Sets the color of the thumb (grab handle)\n`mdc-slider-focus-halo-color($color)` | Sets the color of the focus halo\n`mdc-slider-value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`mdc-slider-value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`mdc-slider-value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"9e2d33465e4a55862766486d77f187c0bd37883c","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.18.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.18.1","dependencies":{"tslib":"^1.9.3","@material/dom":"5.0.0-canary.ab5f49a2c.0","@material/rtl":"5.0.0-canary.ab5f49a2c.0","@material/base":"5.0.0-canary.ab5f49a2c.0","@material/theme":"5.0.0-canary.ab5f49a2c.0","@material/animation":"5.0.0-canary.ab5f49a2c.0","@material/typography":"5.0.0-canary.ab5f49a2c.0","@material/feature-targeting":"5.0.0-canary.ab5f49a2c.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_5.0.0-canary.ab5f49a2c.0_1580945587203_0.5147578416315837","host":"s3://npm-registry-packages"}},"5.0.0-canary.c541ebe15.0":{"name":"@material/slider","version":"5.0.0-canary.c541ebe15.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@5.0.0-canary.c541ebe15.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"4e59c44d14ffc9d6f2bdfb326dd8e61a23e85c7d","tarball":"https://registry.npmjs.org/@material/slider/-/slider-5.0.0-canary.c541ebe15.0.tgz","fileCount":37,"integrity":"sha512-z3GliMq8rTYMxeemX2xZnFJDiiATSOu4SM20vXmfaLlgDFujjyzvw8rqiprS4AkNzrSukqbqgZq+aOnVkjosGQ==","signatures":[{"sig":"MEYCIQDBrb3ze4dvYwMpQUDxlNJwzbLL3t5R6qzHfm1PMsd8FgIhAOyLga6aiAmvoW9ucYa0uTuSeei+baSUicyzSVxSZxhu","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":361071,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJePJNhCRA9TVsSAnZWagAAne0P/AwXjJ2PUMsitdm1mj2/\nZFbC4JZwJDCWi4CZI8Jvrrbnh6t8xNrIPLZt6/mnVBrBCyYWVOc8Kyzfawnv\naJoc8NTf6Iqz8C6WRNOJsaXJDQMtuwyB5ioEMNVMGQzXiT0MVSFQyus0LeTW\nVrllebEOjINKTluJjNOoDr9QYn2sOVdfd3lm4JXSpGZob1eBcAB/DtYibeEd\n8bh0NoeWfj5tawv0wqgGK92Gw27RBasMl0ivJsXJPN1KZUEAgmndqpAqlZnA\noYZVKPcD2I2NV6vwwbEprw6U27DxHBxpe0Qp+vp/EorVM20f76qesyDsc6zz\n3q9R/90waJQWbng2OH3dWNbaNf78CMsh534UevcNk01naCyyirv+X5x4jjZk\nu/TKD6nrGxvJyBpRkyxqVBrn0NPJj3mQpNHBsa1efxZnzFOytEjq5xROBC8R\nF451ssJ6pu3Qakwfq50GPma/NgV4QAqYsI7R3Axj/lH9XeHXmlqmv3WNRUnx\nvTSW1m/QmB68RwW5kyi4MJtP8zjc2CQ0d0KokJCYj2ON03k0yqVgbWSN3Kng\npYjfoSbsdY00aojelF0l1fqvRjjFzcvFXz+a/DSq7luHwNn6UGxkhEi343v0\novJ1MUg5W1yxCB/CdPDaLDuiSAqDsMTwTXH/I535oRw6kQoQhlA1Q/YEVYFx\nyM53\r\n=Lrlr\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`mdc-slider-color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`mdc-slider-highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`mdc-slider-rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`mdc-slider-rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`mdc-slider-thumb-color($color)` | Sets the color of the thumb (grab handle)\n`mdc-slider-focus-halo-color($color)` | Sets the color of the focus halo\n`mdc-slider-value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`mdc-slider-value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`mdc-slider-value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"87d5a39f72f6a882a8412df86762c91328c6d985","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.19.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.19.0","dependencies":{"tslib":"^1.9.3","@material/dom":"5.0.0-canary.c541ebe15.0","@material/rtl":"5.0.0-canary.c541ebe15.0","@material/base":"5.0.0-canary.c541ebe15.0","@material/theme":"5.0.0-canary.c541ebe15.0","@material/animation":"5.0.0-canary.c541ebe15.0","@material/typography":"5.0.0-canary.c541ebe15.0","@material/feature-targeting":"5.0.0-canary.c541ebe15.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_5.0.0-canary.c541ebe15.0_1581028193088_0.8981592876987203","host":"s3://npm-registry-packages"}},"5.0.0-canary.98f7faa05.0":{"name":"@material/slider","version":"5.0.0-canary.98f7faa05.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@5.0.0-canary.98f7faa05.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"54d3b2bd93bac55e7111ded038efd69607773ea1","tarball":"https://registry.npmjs.org/@material/slider/-/slider-5.0.0-canary.98f7faa05.0.tgz","fileCount":37,"integrity":"sha512-unzI9M4SpoMRSAwXlMVQyQSwoafAuUJGXnlCb0UzcaXX4c9Sg9F93HBQtJDrFCt5+qgM+iWXR7o/WhibWSMTjg==","signatures":[{"sig":"MEUCIDQADwPx3m2TMfHJhqE4KxhbLicRpwkVf+ame0k99DoZAiEA7yKu5iTz0etMlMm4EsTe2HjZutjzJSCjHuyarJcu/P0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":360972,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJePbipCRA9TVsSAnZWagAAhVYQAIOXoAsOBby13B5l8NWu\nx9OCHY4VI6FlhrOZoAbE8ZlVWJm4+ypBlTpDCeOP5gVn+FlMznWT3ciif6V1\nNvt9dmJqHQ4oYp3rq+ELU4TnkdAwp2n2SZ5TSpzlFC3zJ71Imi9vv9hLpUP9\nZlEytbXs18dMgTVdC4ema4Y3yRc/9M4wbKsRXmiY9C+8zoY4g6HQhyNnoxNx\nmSaH3C7wXjt0BL3W0+ozO2rItAGMnfO4YY95RwDMpiX1efKBgDdiIRCX+JnY\n5XWCKutpqZh/N1+f381hNNnvQkvt4sU1I0ScoBxkLaXPRyJasBxOBrJUmEjo\nQojBB0dpXoK7S5H1v4ZO2Q4eYH1ozQ11Q2X7I1j1wSQ60+kV6lABLA+C8mM1\nODop5S6d3zL+uFxG2maauf3ALlugSUOcn5YdBwsaDZebTHuoHXCJM9Tn8Mkc\nwLDuRG9wP+ahhqD3jkcF57377Sbe0wzUKRlsgnCKv3qjc0/zE4TvDnuqtxO7\nSMLGvgfyDFsHwNe9V53iZXjc0Meoov5nc2WAtkuPNtohwCRm3cuM5FTKhVgx\nSJTovbM1XfCGiZppB0rzxveQ9TsjvHFvN7jkaDC4YolZxYcFKZo8b6/1d7et\nDLqPiFuwewbCIzGrv9L1T9mBCafmBl792nAne6vEpsebT15Zqi95W0NkHb5o\nXQ4C\r\n=qH+T\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"698f18ec0e8c9dcdd38beb5ab6b4cfa6218fb288","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.19.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.19.0","dependencies":{"tslib":"^1.9.3","@material/dom":"5.0.0-canary.98f7faa05.0","@material/rtl":"5.0.0-canary.98f7faa05.0","@material/base":"5.0.0-canary.98f7faa05.0","@material/theme":"5.0.0-canary.98f7faa05.0","@material/animation":"5.0.0-canary.98f7faa05.0","@material/typography":"5.0.0-canary.98f7faa05.0","@material/feature-targeting":"5.0.0-canary.98f7faa05.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_5.0.0-canary.98f7faa05.0_1581103272541_0.6881283080872143","host":"s3://npm-registry-packages"}},"5.0.0-canary.b4727e43a.0":{"name":"@material/slider","version":"5.0.0-canary.b4727e43a.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@5.0.0-canary.b4727e43a.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"14fd0a26ea78884a342e9074f92d518f5f34fbdb","tarball":"https://registry.npmjs.org/@material/slider/-/slider-5.0.0-canary.b4727e43a.0.tgz","fileCount":37,"integrity":"sha512-a3VRdx0afbGLX+g1QHtHSvQK5Mz8PC7qduWbX4HOlVjBFBRTJWROMSvkmdO7lmHbCOeRpA3iZcDp79dhyRxhWg==","signatures":[{"sig":"MEYCIQC8moNwikn5TLtvi5FcqKYFJE5IEUdaQnb7TMQ/xMpXXQIhAItbG1AUyyHMOCQg2hlPNgeisv4JncCw+3yAcY4GMsdB","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":360972,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJePcCuCRA9TVsSAnZWagAA/J0QAJ88ct0aqViXgYqbIZpD\nQ40d8G0LUrPX8ZBbtRSHuqU9GWQ6qmjYy2/a+Zih1ojZa13HnbBc9jOzxrIw\n3H16GgzjPJTHfsGOtVza70NqCIQDA0jLyeDxkQGRf7X2sSDqv67nbXJ52I9T\nHlV9avw5MJwX3EZ0dlHlO1ViKY2hn63ZXsVa8S2mQ4T6DyyHVwdOUIoL5FK3\njuYousdxJ2+2fRjkr2NYyO7VrWtzkgHgc+hPgbOxqc6XyfEtJWLkr91YqPzv\nIUk7kEuL6I5qtDW9sOgg8DyMXm9sfZVqILjTYsDEzmvSanli6tKmpszAcnTf\nSXT3WH4JRs/Va1KEGmuEdj5x7HQBh17sgcwRRjig6nOtKkmsTrYZE8iJSdRJ\nLSk6UJ9XL/zZGFX29XMu3hktMwebqlyIr/jrdSvzyQt36mAP3ITpbrBvHMSK\nSKahlLnWK3Kw184uN9gsJrQExLkBHe4r3nTSJ8/3qGxHtuXM4yGhQr9YDCLT\n85jJVQH1auczC+lUex1Jc6yOwHM5fleoZpwQ0x7XhffSnRDnfOJa6FaGemCK\nvKV0QuAuO/Pk4Yf+M6yNVWa+GwWVKvNZRw0QgEGBEXsbuTw1qu90WeseBk7C\nePsV8NDBJDKeRBfbhLjptMDckgI3Z5KHiH9m941b2ie4TrXCx/DebRx5vCCa\ncyYc\r\n=huq1\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"140a0d7a10f30d8ce4b10dfbe40bc63136e206bc","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.19.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.19.0","dependencies":{"tslib":"^1.9.3","@material/dom":"5.0.0-canary.b4727e43a.0","@material/rtl":"5.0.0-canary.b4727e43a.0","@material/base":"5.0.0-canary.b4727e43a.0","@material/theme":"5.0.0-canary.b4727e43a.0","@material/animation":"5.0.0-canary.b4727e43a.0","@material/typography":"5.0.0-canary.b4727e43a.0","@material/feature-targeting":"5.0.0-canary.b4727e43a.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_5.0.0-canary.b4727e43a.0_1581105325818_0.6459508463539103","host":"s3://npm-registry-packages"}},"5.0.0-canary.91d9d5a65.0":{"name":"@material/slider","version":"5.0.0-canary.91d9d5a65.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@5.0.0-canary.91d9d5a65.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"8c69106c86bd5ec9e7e79261f189bb8c7cf7bc84","tarball":"https://registry.npmjs.org/@material/slider/-/slider-5.0.0-canary.91d9d5a65.0.tgz","fileCount":37,"integrity":"sha512-PnSQ75gdxWEoMe68L4nj/VWPQ0sQTgyRy0SsYjVrKDWBTfSeuGQ2FjLB0Hdtht3+jQdhdS/R/nzgTwcOXBhscg==","signatures":[{"sig":"MEYCIQDeKq74kkG9MKbU3vbIQqUcVM6kszu9pc/zXo/kBFROUAIhAPejEWVLou6t5hcNHnRNclLSFtD8d3zK+ejyPq8woE7v","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":360972,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJePevHCRA9TVsSAnZWagAAW+IQAIrId3wq+2qqvytY2q5k\nqVEopZKaRA7tV8zw4VINGbF8GVHV6IyFXcX0vosU8vNpQYxG7mi+wsvi0JWQ\nIV7ZZQrbUeJeoeOinut0ilGodPkCe5DzlcN/psZ0hjAfSMtb3L6IPnEH98F4\nQ0E1r9Bv+xVIQmXg5ozlhjRCCn6yh2XBc854/MSv+Rdl/YKrHK9Z3rSvps/5\nRkxZzKF7+7ztTxnD8gX6g1VQ8ZyeVFWA3Fu7d0JEBXj5q19NIBkW8TabQsE0\nfumyHDEHy4K6c9oEngqmHDhajDNWtiInJLrtkkXNdJsb+4hx9JbsJbUmxYhj\ngtKH4m1C4VMOxUaw8/8vLSfPBzEIDbiKPS/m/4LNPDWw73ggYRZO/B0+as4h\n66K+WeGYBndzI45MZeoeZGkZdl5mJqKhysUZRheGxR7Cm5murDvEoaWyqYJD\neXurA0FHjSN++fqI469Y9GAkniMqtbUWDgGe4UiFI5e/7sQs8JWDGPHZUL9x\n5Vwpqfcsj9Lx6JZHr99NVKMggmlIWVOXwEqpBlZniXrdIwllWTPtXSxyWSjM\nIj8FxPcAiFrP3x1tbp7Ee22vwfTY9+bijvdbaKaCEwiWCzA1BWmrcjt4vOfB\nSXyUGUc5D3x6yBi34lnkdmUsK8Fcia0Z8ngo3oD/JiuQELgr8qfY/ubGayjc\n8NZl\r\n=LBMB\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"f98276c6136d4bd38889e0b4d6354081a3ca941c","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.19.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.19.0","dependencies":{"tslib":"^1.9.3","@material/dom":"5.0.0-canary.91d9d5a65.0","@material/rtl":"5.0.0-canary.91d9d5a65.0","@material/base":"5.0.0-canary.91d9d5a65.0","@material/theme":"5.0.0-canary.91d9d5a65.0","@material/animation":"5.0.0-canary.91d9d5a65.0","@material/typography":"5.0.0-canary.91d9d5a65.0","@material/feature-targeting":"5.0.0-canary.91d9d5a65.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_5.0.0-canary.91d9d5a65.0_1581116358600_0.8160474034161189","host":"s3://npm-registry-packages"}},"5.0.0-canary.d5c006ed1.0":{"name":"@material/slider","version":"5.0.0-canary.d5c006ed1.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@5.0.0-canary.d5c006ed1.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"5ca1444dcf0045c21db6a88c705eb9c14f1964d5","tarball":"https://registry.npmjs.org/@material/slider/-/slider-5.0.0-canary.d5c006ed1.0.tgz","fileCount":37,"integrity":"sha512-7nBj6aADJbfYtYuABwolekFhx5HoaGo/VuqSbX+Iczp2lzbhAVMKo9LcZzBKarpA/Qlp8EZXfiQUydU6SfWmFA==","signatures":[{"sig":"MEYCIQDtXkytUo/hpbjwaRTkA4N9cpTnK6AcA0P2FskVv5mjJQIhAID0VZTNl9q3MdmYLeQXjvtHpas9rKksX5H5jvB0QHMB","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":360972,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeQYljCRA9TVsSAnZWagAAHPgP/2DZ6eVgSGGWPND6AF4X\n4Y9vVzaMIBy1LRr0LDu7h5PKqL93ZzF7GaXnhxE0vIRikp0Gse6d/gOgTby0\nL2K1VUEhyEBL/91JuBtLuqVLU4MqJt0cALRkQ0Z4rt6wxZrmpLTMgjChZY2n\nvu43MQnvWsRd1BFqUamM+bYO8hUE07gZRdPtFdhV05vZwltYPb6U3fh41OP8\nQdW4xQO/1auSZgNkdV9nnuBKxSXnEajfup8MpHPSYvN3d7E5cGH6N+x2NkWH\nVbiE1syQ1c+vWymf5RTYHEz4Ih6KSW4LPxeprMINtJ6vQO6PxGxsQDaVe54o\nK+9alwesNcoSZg/irGPxYZZVcolEHTrW5X96tM/C9lvV/MSWEPnVILTWBySV\nRa29wNUE4Kwr0lJ+2DwtX2UYseHRzFC1bklowO5R7CMXeqSmTkfP0uHfxusj\ngcI3LYha1ULuM/Qle5RXNpCntyTRTbPu/h0rxlapTg4H02RLLXqEhriZXipA\nYIh27WAWtWL1YLwQzaCwg30G/j2TXHPWMPj3TZefIcHm4odxkhjC9hqrIaNx\ny5mmGOzFPkr5j8FQaM2H+hUlLR0vdZ4O634rtaemsiQ9p9irDFOTjI9LB0VW\nl5YJrG5+eIOUEHQdf7gJmORWr5H0GDtZGvRLYNXRbS4FQTreKRmDS2EDdOvb\nnbka\r\n=2GdU\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"fe50932259fd2af2b34c60968682a0b94f7fed66","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.19.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.19.0","dependencies":{"tslib":"^1.9.3","@material/dom":"5.0.0-canary.d5c006ed1.0","@material/rtl":"5.0.0-canary.d5c006ed1.0","@material/base":"5.0.0-canary.d5c006ed1.0","@material/theme":"5.0.0-canary.d5c006ed1.0","@material/animation":"5.0.0-canary.d5c006ed1.0","@material/typography":"5.0.0-canary.d5c006ed1.0","@material/feature-targeting":"5.0.0-canary.d5c006ed1.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_5.0.0-canary.d5c006ed1.0_1581353314815_0.46488745970671075","host":"s3://npm-registry-packages"}},"5.0.0-canary.559f1a570.0":{"name":"@material/slider","version":"5.0.0-canary.559f1a570.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@5.0.0-canary.559f1a570.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"ef5d0755b8540b6b8d77e71ea94d3237f20ab364","tarball":"https://registry.npmjs.org/@material/slider/-/slider-5.0.0-canary.559f1a570.0.tgz","fileCount":37,"integrity":"sha512-Cze7a2JafH5M3+dS9u/gSZUScEK+IegHlABJuZu8he9Dvc0Cy2tCrvBcXmyd95F0nGOk9VxHh9Bw/9bocs1HpQ==","signatures":[{"sig":"MEQCIGEXbNJhf+SGdVHnJ1Vvn6i9uV0YPIXCQuLxhU1DIaUPAiAtkdKis+tpTBEzvxiHT7Q96gvevyPa6VlNMCtWxfpqsw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":360972,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeQZHgCRA9TVsSAnZWagAAl3UP/2gWdDlJcLoQ1QRP9mHY\nZgNglamDkXFFhgh5mTRoZ+h1OUrdvDtZKOG1J9weN9QwDYvMcPErK6uaC/rG\n6afbpkeC0sfbywTuxbg6rv/zCMgoWk8Wjsf+79l4ArnLVh7VPYS+b4i0hhL+\n+YW6ARB1l9kBOQuIzBY77I4HKqcThj5XbxeiyUofNrbmk66ffTD5f32hhfsa\np0WGolmyS3hGHjVqBPoyn43h2FZewNLj52M6NVP8IKiuWccusSHYBrXw5xCc\nAmWXFpFqsZhiHi0F26fN8oRCs4YqmATyN+BCfLq1l+NtcPJOCcQsEuP5Mqrj\nDO4weM6Rj734e5cqQVFHCbiGaH0s1nV1whRTlHAxvRNP6bFWFvq1rDXu8PWh\nMG2Bp9TJyBzoOZD+NVk7+tMmoe0EZlDny55LdgSngzvEGU+WtnFyC7lR5wDb\nPnZ1co0rXplKQp6WutUBjtNdcNQ428DvVdQmBEHECI1zCAgVad8eIayVt3x9\ngYvqwPwFMMsOpXCEjJ1uU+RZifmPOU0JQxOIGkpG1FUhtLcDvChcGx32jSlC\nqkcgXY0M0eJeOgp8bmrsGWCUgXBKSZphiTAk/JB3UvN2LIZ+FjwMHUr29fif\nL5tUYj5AUlsKBkELNBoxTQnF1loI8KraCkUbBI3PsJ6VW8HKtbgzSqLgS5/C\nj/xQ\r\n=IAed\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"a4adc0cb689de4e266e65d90d614fbe1177aa5f1","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.19.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.19.0","dependencies":{"tslib":"^1.9.3","@material/dom":"5.0.0-canary.559f1a570.0","@material/rtl":"5.0.0-canary.559f1a570.0","@material/base":"5.0.0-canary.559f1a570.0","@material/theme":"5.0.0-canary.559f1a570.0","@material/animation":"5.0.0-canary.559f1a570.0","@material/typography":"5.0.0-canary.559f1a570.0","@material/feature-targeting":"5.0.0-canary.559f1a570.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_5.0.0-canary.559f1a570.0_1581355488334_0.9290769113167114","host":"s3://npm-registry-packages"}},"5.0.0-canary.ad3bbf782.0":{"name":"@material/slider","version":"5.0.0-canary.ad3bbf782.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@5.0.0-canary.ad3bbf782.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"c40b31d9195fc2fc3294ad759741f37f340ca0e3","tarball":"https://registry.npmjs.org/@material/slider/-/slider-5.0.0-canary.ad3bbf782.0.tgz","fileCount":37,"integrity":"sha512-j+R7SF4RxQFXyAKnvuX0RNDyVqGI40lOsZRyWaLabhHodsDJ0LcjCTtwInEdcwndSHUFpo6AqDoTjpsuzzsCjw==","signatures":[{"sig":"MEUCIEt/cPd7ipN0TgG1DnMGPJMUwzjPGSzMqAyPw+ZhaiBwAiEAuUdK1ZmxHEgQnZrN6Jnkbi7wJRUqpsyn/gREvYnKYx4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":360972,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeQaraCRA9TVsSAnZWagAAZY4P/2CimOze7Kr4H6dGfrjz\n3VEBe1cYT7+Us6sOZ6MaSk0yl80LxYRBkU4So4lCW4iFCi8uREu9R1pgVKKW\nS1hRftOoatQ4CjEc30fKkAA03HZRJtmTx/LkkuyPLvJLND9IyTDKlV2tvWdA\nvMK9ilyG31qA2NPxJ8NyTH000DpHgYmhv23SzZl9FlXCwmoucojeU7g3RcGu\nAMW7VXyTMTDlHpQ8GhDH/wCTcWYKsbqKinI1L/lqI+0JpFShyl9qTr/YYdWI\nlFKlloaFsXjXF5kHU8uiKR8HKVp5xwXTIfJmPxpALGZObFtx9UVZs3lqoS4B\npneVkIYrWY6rHa+Dfslv8f+wSlKGSDokbmOh/nhD3xV3X06yNDTDJxqN/Bhm\nCC4zgs6e6JuYbO7so982VzEBC0CIHg1CCz37/AZj5kqeBGLarsw9PsGAxfYi\nFbNOzI9U+nh3+FR2XORGlRRf1YtDejISjhYEwJ7VgEJCELPhbhinfM14rGHc\nRYD5BtY6Wi+RwKPSak1USwnXE8H3xwIi5pmtvCNuso555A0Tks+La9FeJGg8\nzyPsA3DLdPMnVIUu16hIGTwb35bFvg+4vPlmvrr9xv3a2v3n1Av9kuEyR4Ju\nDOknicFVO7geAYTiv7qkkRK29TJlhHxUoj5X6iOUdllDa5Fuw+ltnwM/Ltrd\nlX/z\r\n=Uk+e\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"48e565307134ef2e860fdfd1a8ce59613a783ba7","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.19.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.19.0","dependencies":{"tslib":"^1.9.3","@material/dom":"5.0.0-canary.ad3bbf782.0","@material/rtl":"5.0.0-canary.ad3bbf782.0","@material/base":"5.0.0-canary.ad3bbf782.0","@material/theme":"5.0.0-canary.ad3bbf782.0","@material/animation":"5.0.0-canary.ad3bbf782.0","@material/typography":"5.0.0-canary.ad3bbf782.0","@material/feature-targeting":"5.0.0-canary.ad3bbf782.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_5.0.0-canary.ad3bbf782.0_1581361881441_0.4522624195245759","host":"s3://npm-registry-packages"}},"5.0.0-canary.570d8e49c.0":{"name":"@material/slider","version":"5.0.0-canary.570d8e49c.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@5.0.0-canary.570d8e49c.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"08e293c5bcb731349f7339eb130a2e0478660f18","tarball":"https://registry.npmjs.org/@material/slider/-/slider-5.0.0-canary.570d8e49c.0.tgz","fileCount":37,"integrity":"sha512-LJw6D4vlbwIcOz6HFiwtzvDzvytURSO4TFTV5OTKpGo9w3WacyQVbhG3nNp4Fb75HXg420ByTCYBx65uANf63A==","signatures":[{"sig":"MEYCIQCGFwknPESadGiPuqDO9cjo53ee8BHKAdIHWYRdcdOtKgIhAM9vLg32SurKCfY8jc635zuGzdBhWsfoNhWUFVYBbhC5","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":360972,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeQcBrCRA9TVsSAnZWagAAJgoP/2NDMRXldUNvdebLQmYN\nDnfGIYMQU65j6GTJ2L/FXYLYPPriNSH13dGsLOLDEO/7sElWt3XyMG7CDSaA\nWQVb7v9t/Kip19TqAVZoDr3SN/1sdNi8tzGDf1fmZlOLQGNxBdJyuLT/s5Ab\nsCdfPPIXGlyCr+HxttqgzZVACHiu3GFINimY/6YS+PDgzyyOovrrP9frA18K\nuYudijG9Dd4QOhjtycZWsJCmUdLRR3kcjCxOgNI5Sn9SBQgdO6QGUN3LXxnl\nKZQ697LseLkyPdHA+eLHzLWftSEIBs31Q4Jzp4Iwmw6N4JYxWunLU5x1ICwC\nmNMr/zAyQWjBoFYB+631aNW+qq+onbthlJWrW7Yc90IvFjd/BnzBND38/G1u\ndap/6l1RtjImeNhT+dBxFNux4yikheIwZEKOD4HdDiQnutpaCC7f13OaTV+U\n1TjfHWX3bRHvwRJVLxn+uXpV82UYfoW6Rp76/2bEv2px/9P9Tw+Iunl0HG+j\nRpkDa17LQuTnKVv2s881O37U6fYx5dXcAYKk24klI/O9QCwoyCjV97qUatN7\nktRAxbEyNQ5iAYhabe5zoEBHvDWxdP7QmpjoL+h+/ChkftVKKUQsN93YKeva\nk05NcneyBRYu1FQb9WMfF8Pd3WGb+ebs07TR1/9soQ7UxeO3s3mEwrnVhK1y\nTVKF\r\n=FwZ+\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"b6857e33db49c411cf5f55873a45f72841824fb7","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.19.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.19.0","dependencies":{"tslib":"^1.9.3","@material/dom":"5.0.0-canary.570d8e49c.0","@material/rtl":"5.0.0-canary.570d8e49c.0","@material/base":"5.0.0-canary.570d8e49c.0","@material/theme":"5.0.0-canary.570d8e49c.0","@material/animation":"5.0.0-canary.570d8e49c.0","@material/typography":"5.0.0-canary.570d8e49c.0","@material/feature-targeting":"5.0.0-canary.570d8e49c.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_5.0.0-canary.570d8e49c.0_1581367402799_0.035493516025642435","host":"s3://npm-registry-packages"}},"5.0.0-canary.48b06b89a.0":{"name":"@material/slider","version":"5.0.0-canary.48b06b89a.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@5.0.0-canary.48b06b89a.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"ea34bcca20992b46fe7ac7b78d9e576705b59dca","tarball":"https://registry.npmjs.org/@material/slider/-/slider-5.0.0-canary.48b06b89a.0.tgz","fileCount":37,"integrity":"sha512-7RNBMsEw7ZxHVFfWwY9sTo+IoAgdc8Ie2mOS9B5eL64tLZ1S0rQxqRxNsEsYizYfQQqAuytydGk7nw7guvDsPg==","signatures":[{"sig":"MEYCIQDzgC7+xHJb3PSchqwqcMI/sJxZ7T+lxmOV30aIAW76vwIhAINJ8qgZBt3u/zXJTZv7lbtDWP2V1ShV7MINyLNnQEI9","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":360972,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeQvW+CRA9TVsSAnZWagAAfcAP+wTxF2EBWZUZ1VORhQIx\n2tDnLA8LMcW06uIAArj+HzvDTv3qy22WTyRfWbpk50MShVNuvpBLfRdW7Y/7\nltLvY0gFWZ4N3gSvOPcncOam0sunSirIzHPkZcAOE1m8AvtRsLrlkGfjo6Ng\nznA7Rr7hkgdjNHIRWADK696fmEMZZJO03tjwZIkvb8sMneJ+noYzWP8TSTci\njx5zjoZHKb4BFzEFz12CZVzGjLtnfH44M1AVx8WBP84YV7fjQT8j1Wnqb1Q3\n/ASjgfotf7lXssgMdwSJbE8qIVjk8w3Xa33pqMqmdUf/VO0Rb1m6XsXnU/Hg\n3MRsJTyiIji175kJy6wH8FJA6/CIW4w5PLUb/VfnUV11NKlufo8KnliwaaOv\nnpDOrXXJnIq/zhVzHHzzmY1KxvYdKaFGNxe8Jci3aPeefyVqMUKGa0Q4s5jl\n7QjKYhzyGf0iP5uM2pAW/vt8bXx+L5mcL4zR+7oudX5T/jRasSPA8Lsu6RzC\nkt0inIjqDSHsjP52NnST99nHf88oEb4XnmgKYnbXQsU2V8bXmM9TmgLa8t/p\n9aF48jUvPOUEO+tlrZN6BYE2iqzXz7/cUIpC2+q/0psFp7WWLA2mze/IWfGK\nY6gvR1L75Id8gd3xAmXD2kqUgmlQYCkAQVakYHfcs0p6znSX1yQhuGxud7fg\njgIB\r\n=cGDJ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"540a576f2286061b02bebceda7cbf10554255781","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.19.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.19.0","dependencies":{"tslib":"^1.9.3","@material/dom":"5.0.0-canary.48b06b89a.0","@material/rtl":"5.0.0-canary.48b06b89a.0","@material/base":"5.0.0-canary.48b06b89a.0","@material/theme":"5.0.0-canary.48b06b89a.0","@material/animation":"5.0.0-canary.48b06b89a.0","@material/typography":"5.0.0-canary.48b06b89a.0","@material/feature-targeting":"5.0.0-canary.48b06b89a.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_5.0.0-canary.48b06b89a.0_1581446589904_0.8649176685168316","host":"s3://npm-registry-packages"}},"5.0.0-canary.612443dfb.0":{"name":"@material/slider","version":"5.0.0-canary.612443dfb.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@5.0.0-canary.612443dfb.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"e1fd9dd9b82f30c83d5253dc78cb9a2f59ec1419","tarball":"https://registry.npmjs.org/@material/slider/-/slider-5.0.0-canary.612443dfb.0.tgz","fileCount":37,"integrity":"sha512-leGHSfK/VGuDts/Lh54uv6hepLnqeo9mjiu9CdWAzBSp4FpOGkpTpZnNNnlJ9DXV1+LUCWxOY8ZhlBqERlU2oQ==","signatures":[{"sig":"MEQCIAwFC33t2DND2iN+PlQs2dUnHmIBP9zyRtSNvffR5tYTAiB9BUYWaOf3b8x1C0Zm2sSJgHKvhUrqwZnJnTQGHG03jQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":360972,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeQwUiCRA9TVsSAnZWagAAHWIP/1qCRfPb8ltiRLv8aYm7\n3T4GS2vdVfraLQhX6974J0nauUBT0BL9InEoeOuAb7Dktu2kQe+Dd+3PFHM5\nq+qxhPaBdSkK9Md3486LEpRYQ/l14dqqzGB8YygdL/LHf7adFnarMw0DhV2g\nPs+s14fI+7WLxCCnQ1XZvcpJWQ93JUTQlj2UUdrYvse0F4frfDp4o1zZgp6+\nFQnn3z9rnQrcH43QzdSKPbXNiEsG6B5XBGhrnpvJaOIN/zKNhc6tWCkWOK0H\nIlZITE5zyTVMPjipeSFkR9oirNkAf5OKmyMvvf5qU5QwfNIY42UqY5oZAG5h\nLE8IwSu3ZRxNJO6inAxDzGzRU83RdwtrPxzMAqHy61t/XlD0D39L3R++7Nmr\nObN3vJQBbT2dAb0pjLfswKmzFgiZ87uD59tCiUXGTmxaon7bqKa39083sQL4\nJvNmSIwzmDgXAVZfCPgeq82opTeIyAskLQoF10OGWlYbti+bYFgt389dikgo\njtnpWYl5JZEqtU4A8Ih5CRGsauexXbXIJJNfe2iMsO6yM86au1uqGKpDbMut\nEBv5mYfkkabkpffc+9Vjt3MJpGlzIXIvtJc0NlfJwoKg/9CIOl+Bgk7AiR9a\nc1Nrv/uk3NNOHloXgyfCHLnwY4Aql2qY9DiHQXXIDI4pMLG6brV2sM8JAwfy\nqv8A\r\n=EE4h\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"622585006b9702fc93bdf0ae416f6c58e398243a","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.19.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.19.0","dependencies":{"tslib":"^1.9.3","@material/dom":"5.0.0-canary.612443dfb.0","@material/rtl":"5.0.0-canary.612443dfb.0","@material/base":"5.0.0-canary.612443dfb.0","@material/theme":"5.0.0-canary.612443dfb.0","@material/animation":"5.0.0-canary.612443dfb.0","@material/typography":"5.0.0-canary.612443dfb.0","@material/feature-targeting":"5.0.0-canary.612443dfb.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_5.0.0-canary.612443dfb.0_1581450529619_0.43336048416307094","host":"s3://npm-registry-packages"}},"5.0.0-canary.8c11ea2a3.0":{"name":"@material/slider","version":"5.0.0-canary.8c11ea2a3.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@5.0.0-canary.8c11ea2a3.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"4c78e0e761fce7472a0844674596f8360cb5111e","tarball":"https://registry.npmjs.org/@material/slider/-/slider-5.0.0-canary.8c11ea2a3.0.tgz","fileCount":37,"integrity":"sha512-RybgH+hGpctPs2oXVHHWwv/ikfNCM2vF7Tv4S8PWAgjZySbQPOetd/771Ih5gaZ725ppZjF+0WOKDOBRTwLXHA==","signatures":[{"sig":"MEUCIE75Ru5EL0XB17mrsC1RWM5bNav6u+97Qzq3LJFpZ1m5AiEAlqp314lfr0dw8cShj1yD52actKAGQzMAlrhqCHrM3l0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":360972,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeQ7yNCRA9TVsSAnZWagAAjVcP/3Tp4pz4Lj3+PQlTeYiW\nl5TR3F3khppTjArgclojfGXJoBXo+cLLum9Qsz1xzh7MUaGFS+hxfBJQ43J8\nBvIuW09zxswWPvpziBO9UswS3goDebYez/+nilEeFCabmoJgHyflANOsjzQr\nLAIbI59fLk6Gtlsb+GFx3DD/VlFD9gjR1jDUi09t61xs2GUlEmmP9YGUSWEM\n/UhzA5VBaQtoKI1XaS49WV9PPnacm6Jyaun+pYkYL6y9GeQg9HLKCXMIvewO\nN9EVhvNBmyRXrYG+hv/aWn6MZ7hkxal4hzNeajjMu8/XlEkxkQ3xZWUvn4ne\n3OME/ghYSYuB7pci6Bzix9Qyiq/JbMET4gdIZZzgJCpmcW8K2KF2LGUSMJIc\nKo0NfIJoYH+cZeK5ehXMGy/Na46So9Xa3r5hDNyBHJq0cDmLQnvyuKf8zo3D\nRRDqzcybBKKzZ5blSq+fd/vIBi1esIl6767oa9m2XP6FD3C9MbmV8G/LYb4h\niIWUlAkTB/vro3eXysvIaBlQXIai4X89rijQiN5j4D0BEgRa35eK2A2xOEYE\nwe5doY6u0DMfJnSlp7Fr5GWCLIeYAPH73FssTENw2i/rTIIVuBSbbCcWgBXy\nnxWjaZIWP5+u2Qyv5P9NUKqxlM99zNzwiS/toE1NG6zeEKWueCujrOq5zUVQ\nGrvq\r\n=RGi6\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"47068a39cd18bd1e384c83a2ca5c3d53ef8bbbb6","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.19.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.19.0","dependencies":{"tslib":"^1.9.3","@material/dom":"5.0.0-canary.8c11ea2a3.0","@material/rtl":"5.0.0-canary.8c11ea2a3.0","@material/base":"5.0.0-canary.8c11ea2a3.0","@material/theme":"5.0.0-canary.8c11ea2a3.0","@material/animation":"5.0.0-canary.8c11ea2a3.0","@material/typography":"5.0.0-canary.8c11ea2a3.0","@material/feature-targeting":"5.0.0-canary.8c11ea2a3.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_5.0.0-canary.8c11ea2a3.0_1581497484964_0.7135067849131587","host":"s3://npm-registry-packages"}},"5.0.0-canary.b2f3d311e.0":{"name":"@material/slider","version":"5.0.0-canary.b2f3d311e.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@5.0.0-canary.b2f3d311e.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"a057b91ac4831a6b788a3e02473897959665f017","tarball":"https://registry.npmjs.org/@material/slider/-/slider-5.0.0-canary.b2f3d311e.0.tgz","fileCount":36,"integrity":"sha512-/RNjL/7Y/CM1dSnTiAscF+519lPYDXOx98+yo1Q9IHGFewlziUuLwn+cjLv6se0ni2jD2/faM6BsGRaI1mIeUw==","signatures":[{"sig":"MEYCIQDQnkBqjoHT+1NDlUkQApYEqns6tffkx3hzZ+8pPojZugIhALUFOM6uW3n6pDI7Ge2Avb/aLfHDk3amxEdhFEw4sP9B","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":360189,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeRcMTCRA9TVsSAnZWagAA7LEQAJ+zytAc/BtVkS0QPXPb\nm2yCpVw2mjHy0/sPozavJqLF5N/C4vrMNR9HIWQSDJvdkir1YlJk2usnDqRv\nrNFCS+5WJMfp4a0k8VbQBm7EKPWBF7fuZRGWQRz0YTrU+UxCA+lluZBM2TAI\n+sH4uCsXT/bqUA3Vgd+/9uwveyh/13+b9V94HojktQX7H3v6VuNeIC0+80Nh\nMqmfShCYghc0jPc7aB5nZeZy5AfXv42aSyTrWNk4ujV9ttqoH2s1ggBUO5vO\n7WVZeuwWjZl0DZgfTvowZpwOs2ba9tsiq+vPIhnx7n61YVNRHJ7UzNU7Kdei\nY7N8velpjaISfAfvYnz85pbxhU/SaLczdsefxDblsPn9CP+6P493a43Wqvmj\nydyuGC1yq6yp68/gIKAhTbriXLS1GGjeuOGUPwOLD6N+zGk/f48jSyXnRVnO\nAaIFZkHuLeoeOdas93fE3e9gq2A4VIpIKFOV1SVvdlqUaQI1rjjuRttOTxT6\nJk8LpqBEyWytUG7F/7Aj8mVzWsa7ghnxnS1WsC7OMHJYNl40wBISo6+a+/E/\ntvWOf6ydRuTrkDNINcCaonsoNogwKRyn/KMZk2f1PbQ/ftmVKQCkp/Ijc+uB\nhzZATogmZLSea7hszZB2c96k3lzEoPqtQ1sUQs/f7L5CS2H0Lj00KmHf11H2\n9GSq\r\n=OoFm\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"e8b88d39be927e40deb73ae78a049ece8c80b9cc","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.19.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.19.0","dependencies":{"tslib":"^1.9.3","@material/dom":"5.0.0-canary.b2f3d311e.0","@material/rtl":"5.0.0-canary.b2f3d311e.0","@material/base":"5.0.0-canary.b2f3d311e.0","@material/theme":"5.0.0-canary.b2f3d311e.0","@material/animation":"5.0.0-canary.b2f3d311e.0","@material/typography":"5.0.0-canary.b2f3d311e.0","@material/feature-targeting":"5.0.0-canary.b2f3d311e.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_5.0.0-canary.b2f3d311e.0_1581630227264_0.6679609552802832","host":"s3://npm-registry-packages"}},"5.0.0-canary.4f488d0ee.0":{"name":"@material/slider","version":"5.0.0-canary.4f488d0ee.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@5.0.0-canary.4f488d0ee.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"4c223a81207c2b464bf70851e417de9333498350","tarball":"https://registry.npmjs.org/@material/slider/-/slider-5.0.0-canary.4f488d0ee.0.tgz","fileCount":36,"integrity":"sha512-7I6xRxIfMKVr8JPCw6K7K8W9kRVI+990RoeU9Nv64hsdG/lvb5CLhDEBunTe5BJiLjY44Je3EycocJ7HEbDFfA==","signatures":[{"sig":"MEUCIEqWMr9srNbidGGE70ObEAyKmNWgTZIaaAXYMzTWD+xVAiEAw+YA4VC8r4hMN2LWkr1QVEuEtHzOE6fasgDWTodnc08=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":360189,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeRdZgCRA9TVsSAnZWagAAn1wP/0eNp5ZOIeZMItlyx7R3\nt79x/OFzILx6jUJs8f9p5qQhFEy6ERWjuWMRLGU70yoTzG+zyhsh6DQr+3BJ\nToRWfokYo4o/HR+muWwemyXcg/fD+luJ9LLNZnkfm7cXkUFnMTs1LjKlGv8f\nszmK/xY9e2ZrCSKvGMJCAb4nHH6RugyERhfXQoFlQVBxswzOcUOYTqeJDtA0\nrlHR+1ncrOCPYjY/uFGgWRCAPFnz24OT9NOMREFDqdBKl4tjwSodLQ5wMVtC\n9pH6A927u446njb337D9wK6+Ah7Len5i9G4EjnLvggSbxee5eh4YBxq3YTt0\nDn+zsxoh45h/c96VqzS1R53cM5nHcebDRZc8x36Qpm2Ai5qpJZzY6hs/2Gam\nj8lBVwcSgTkbHsOUEef5jCITS7SWxaxmboWU0RCVTDYGrRBou+S9FZwwDzZC\nYmGezTEJML0Gk/ytScAMXkJ6IFB8FbZfq7mw1BWhe/mQJs99UN2KTwq3sAMj\njPK7J8vpl3du4n1LDcYa+vvrWfY6xN6r904p5pNU+56WtUXwN4JJiETCKdtb\nYw9U4x6wmFWzeVg7DL98nzMoRGQqROnr7xShlT3+QP/kaj9+5Ok/H2+Y4i9Y\n8doxGZP8M5AH+pm2OLfTjIpl4rSJiCEpaivVs3x26ZXvnQXU17gsZIDCmjNU\nsagv\r\n=0D12\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"e3b2ff94a1a6e30260b88a9da6e55d6ed122c399","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.19.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.19.0","dependencies":{"tslib":"^1.9.3","@material/dom":"5.0.0-canary.4f488d0ee.0","@material/rtl":"5.0.0-canary.4f488d0ee.0","@material/base":"5.0.0-canary.4f488d0ee.0","@material/theme":"5.0.0-canary.4f488d0ee.0","@material/animation":"5.0.0-canary.4f488d0ee.0","@material/typography":"5.0.0-canary.4f488d0ee.0","@material/feature-targeting":"5.0.0-canary.4f488d0ee.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_5.0.0-canary.4f488d0ee.0_1581635167986_0.5001876949617059","host":"s3://npm-registry-packages"}},"6.0.0-canary.fe79de07d.0":{"name":"@material/slider","version":"6.0.0-canary.fe79de07d.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@6.0.0-canary.fe79de07d.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"f42626abedd776ad7a483ede70a5ade3a54d4862","tarball":"https://registry.npmjs.org/@material/slider/-/slider-6.0.0-canary.fe79de07d.0.tgz","fileCount":36,"integrity":"sha512-+Htag2D66f8V++gtpkiuwtGW9exW8PIXambRmQmybER7SnozM0QghPqqGmMr8yrDr/E+RP6hKt4G+84QB7RXFA==","signatures":[{"sig":"MEQCIFGPnygluHAnlRIqFQCvd+WZ8W9XwNnSInFmVCzfdV6wAiBfLHCvANLHX2KWVM2VaaMRlhFqz3Mx+lPFKbiJmxiFhw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":360189,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeRdp0CRA9TVsSAnZWagAAIjEP/31VdnVYJl6ZMszgNMdf\n2BSTyZzv38n15PkAH6IQCFRc8elsyuMD9Eo4YS67/az79ankrSAP2EX7EwJr\nwWQa+spjwR4MntFrNuU2vChCXdxHMGrkVHvFs/A/Ni2005f0UA/Dtn8MGgr+\n1df8s6E4chSGxme1Ma99wkyxVbiHclKWz9v7+0Ry97TMcyJHpVWOiK6dLGh1\nniN2RVkV7r2uQv6dkHhcbOsvRRJaVQPeuKfE5k21eZBryn3k8UaZHk5Oj+jx\nAeYAAJEC++xVirzXqwa/bUWxVVPyFNEEFNrDzkFq59S5nsU94LQgUmeTR9ks\nbb0Zx9l/V4M/3aXcoKbDmj42Xm8HjjRwglMp6/Zeizzi6mBprkf5NzHuSvpX\nsOOPXAzOXrSlEy9BdYgTJdVCIqLriS/tBABc5byrvL0AheuIXMWav9y21a40\nQvrCIDsHrKL3gvGKZFa3LzdXhNtq3wqb0E16QKVAMyyQVXo8uRJ01hVcn5i/\nIGw8f4xrvkpwtPfnuw4fWzKMAJ9ZNurqG+ah1qXpUrIT3xbZy0vBfbyTVsZh\nktq4CBZzwulnNgdwEpfBgljhsrX87OvBjZbNVx08VtWi9He18iBRdlEWRBjq\nZpV5tfIGx8O51dwbENZeQyqdEWabOsquG55SP4/ZfAkDj15sthY9NIAcRYyx\n0OeN\r\n=dWoW\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"e2b4b3810f62a16846d719ee7439bcbbac266d30","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.19.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.19.0","dependencies":{"tslib":"^1.9.3","@material/dom":"6.0.0-canary.fe79de07d.0","@material/rtl":"6.0.0-canary.fe79de07d.0","@material/base":"6.0.0-canary.fe79de07d.0","@material/theme":"6.0.0-canary.fe79de07d.0","@material/animation":"6.0.0-canary.fe79de07d.0","@material/typography":"6.0.0-canary.fe79de07d.0","@material/feature-targeting":"6.0.0-canary.fe79de07d.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_6.0.0-canary.fe79de07d.0_1581636211965_0.43631387989910264","host":"s3://npm-registry-packages"}},"5.0.0":{"name":"@material/slider","version":"5.0.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@5.0.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"adbe6e7f86f7ce7c7fe8c5fd76c5bbd0f4b3e24c","tarball":"https://registry.npmjs.org/@material/slider/-/slider-5.0.0.tgz","fileCount":35,"integrity":"sha512-K4lFe/faTJr268EgUdzUINl1LhkBgoGD2FW9IP2Yiu1iai5baQcg3j45Pb+zAMMJBkerMjt4ByHm2ojuL5t0Ig==","signatures":[{"sig":"MEYCIQCBt+PsXzX0nSmc/PA512jeZOCy81BIIwN8E1Gr8b6FTgIhALO9OszZZaefaqQoEPJ8vSnpB7sDKFZRJbIoZaiVCiu2","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":358388,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeReUSCRA9TVsSAnZWagAATXAP/0wPDmdgtL6xxfyUHJjg\n6OWxoIIQPrykxxiQPjOUZDdAGJcE1+/wsEAP4OkM3XFlkBGlNFryHbDDfgnt\nZA056nVzkRl9QcQwAV+pJOI0B28g3MHPPIb7/3EbIGStcSljMGBJ06wrtOCE\n/137dxtBaw1IIexxcZK0SA/hAVsm9c5DdyENOYcWWfoJHAluc2+ywyg2B7mB\n1nVrPOFpsSGBLWqFLShXVyAnr37wg6w7k4o+VIUBopxj0sCJDJqAUPlWKYTh\nfPju77UOnMaeV7sXgv6fTJmhwXRoTp4Xchkae+ALFF/QPX18tPE+IdJo3bt0\nUUKIzjIc6g4L93+w+yYDWqnxl2CX+hzsPwQYQ7yUepMNJp7Xf7LoJfsXl07e\nWQlmVkvZyUT+XsipJ87CNUcIXe2gc6cqfxI8+q9UKo4vzuTetasClyTgiREv\nwVUfWb6Oco7Ra6guZ7tL1ryVSja2KLlzvgmfX5uurUYjr0+/DvwRtOwkhfQC\ni8qkEW7CI98KsKKL0xrWZW4INIHEkbBSyz1XMhC1WOc97fcWpBiO6w0UMiW4\n5hZoaov5ASzd5HRrnAwqjprmVi6Ri0VkG95YIYia4qHtBbRfXRu6bxTXooUD\nvWx6AMEGZjBEACussf6nVxOq3OnughOuPKbFs98zcgyR+M5pbw4x5i9KyGUX\nFqpq\r\n=snxJ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","gitHead":"47845087df2f88107786b4577b1be4422b14404d","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.19.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.19.0","dependencies":{"tslib":"^1.9.3","@material/dom":"^5.0.0","@material/rtl":"^5.0.0","@material/base":"^5.0.0","@material/theme":"^5.0.0","@material/animation":"^5.0.0","@material/typography":"^5.0.0","@material/feature-targeting":"^5.0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/slider_5.0.0_1581638929857_0.8151508207919553","host":"s3://npm-registry-packages"}},"6.0.0-canary.5e313b1f2.0":{"name":"@material/slider","version":"6.0.0-canary.5e313b1f2.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@6.0.0-canary.5e313b1f2.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"233624da85b694201e9e0943a604839b131f5887","tarball":"https://registry.npmjs.org/@material/slider/-/slider-6.0.0-canary.5e313b1f2.0.tgz","fileCount":36,"integrity":"sha512-e1NPjix/QUqFKBvXlnvqihin4KDpx/IZSZke5hkMF0QnVwnVkt0NGRKim4wGJ5ZZbpxpL8vCIgth92OPW4O4Nw==","signatures":[{"sig":"MEUCIQCyZIG6EJRhHDVYVzbBA1EX1ZLQdcTVQfE03ExPvYAnnwIga61S6J5NCv0vxqWAxd7OnzYaAqSGd43uiHXTpOqdWJI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":358907,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeRzG6CRA9TVsSAnZWagAAjR8P/jQc8dRuNYDuqNzMHV5+\nv/fVz8faRzxtDPXQz2C1x+snwZuQ5eP3vDWc/QAdItMWkwxgFH0f9LgHAY2N\nCOLTAS3ToFtaUaJ5Opi+OaOxcB0EXuV8cN1bu1Ojh2p3ShuaMjfuudXLKtJB\np8RZX9NM5M6z2+FVwjFxdaATv/Hr7AFpJHN3mBjwYuZqwF0d/twGbHVZTgRe\nm7cyaMydEqwvFhSDGdAdLjDw2ZjuTAV1MPSI/NgW2sZmYVmgV8SUYcY6cBnu\nawI9H/vP5a77J+MYOrivtcF/MnUADqlwmkToMmu0UQUCh0aG2pS5QbsxZwcf\nJhKcS7JxG8wPAJpel2KHOsb84A+uTfkjhmBcjc0F7zr9Ds5pWy10B5uFn2Dd\npriCye/gePHynk5G+xMm/CtiQLWCnbsm8aK5BiGDofcjtFq3ogSLkoaGuE1n\n3/NgX4oU8BxENlxvly3Y6qvivGogfRoQjMZJRq2+NfO+nUJdFORgdzPbaL6H\n8PmydqIG9uJUVscPlSUVziUDGr23gORSzUYqdHhSJjq9JWwz29vEVR5I4nF/\nS4Vcs/UfU2Yl14nTQBycMFujckQg44aCSGd28Ku6mbwQWOTjIR798XoL7mey\nzPtLubK9guPauOxJRv+qNf73WDdDdydwEHoqaaqgCGdYTTys80ytGxzIt3+v\n8uDv\r\n=R5Dc\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"c7787e7880c79b0baaafb2af1123bbc383025b20","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.19.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.19.0","dependencies":{"tslib":"^1.9.3","@material/dom":"6.0.0-canary.5e313b1f2.0","@material/rtl":"6.0.0-canary.5e313b1f2.0","@material/base":"6.0.0-canary.5e313b1f2.0","@material/theme":"6.0.0-canary.5e313b1f2.0","@material/animation":"6.0.0-canary.5e313b1f2.0","@material/typography":"6.0.0-canary.5e313b1f2.0","@material/feature-targeting":"6.0.0-canary.5e313b1f2.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_6.0.0-canary.5e313b1f2.0_1581724090342_0.8703840803067562","host":"s3://npm-registry-packages"}},"6.0.0-canary.6a56f387c.0":{"name":"@material/slider","version":"6.0.0-canary.6a56f387c.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@6.0.0-canary.6a56f387c.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"89d1c315fb98a3375978842f164145a5180feac1","tarball":"https://registry.npmjs.org/@material/slider/-/slider-6.0.0-canary.6a56f387c.0.tgz","fileCount":36,"integrity":"sha512-BS9iS3vQn0HMFGxS7m0/HuaKwFVnsqQb8dCs6yAAQNVHz/T6Li+LfGL9F5RsnH6saop/eNgc+yVtZS5UyxoP+g==","signatures":[{"sig":"MEYCIQD+1yOORtDImyRKen18s7dAvLNfLtzZek41pr5vsE3TyAIhAINu8dxIAPoO94UwAeQ4jyl7SMOeAsBcF01jlAanbueA","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":362763,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeTD6JCRA9TVsSAnZWagAAdeMQAJORksg1IiZ9CWIwwTKC\naoEVv+Dh6R5OfhOOJ/SYjL7mZhhw/uOnt1wKYNmIAHQmxg7J+U0gMJOJtAgH\n0r+9fIv6PL+IArY1i0WREtXnrhnq3O43AtYHBcUf8BZalqCnvWEZA+QjJG6p\nSzVQhRllpd34YWpJ1AOAV/vd3KTeYY6+lyaUyOcQJqp4rwbt/WcEw8s1w6c9\nY5cGEVIhBGpux4bh8bINA+fCNnOMkQ4pGoXugpuLb3yPl8WOqsfvaBykYJCn\nXXjCPXZMeRe9sq+299z9nFvrpDTGH2ayNfZ0NuiTs/lFZX/dYNyuHvkaN9jx\nK1G92sak8rq+/P6opTke0g42ezCo7a/ufH+hhSeLCvsLNBkvOFZ8BuFtDurw\ntYceLn0MzsGjTUoXZ6gn/Vl039L4GJsbBOgOjlUAySVHxXUV47ySqIuh9eyC\nrop6bS+mOK/dOIsawTZ/FiwYE3wJAVF/w1E9ynQGcNOSKRn52VY2VYzPuDe4\nbOh23ZgJV05zPjonWk3MDIzwCYtRy3TTBlP4Bhy7iefjW0LIiLXrBGtqbfjX\nCOcatwvUWxeUkEs/iOSsxOVgxSFjKNEV1cMp353raVhK0jDMXXa0DQS94fPP\nGgiEXV8ONEyGCXb4XVH2hhP2Hfb3H+aXOE8Ab0v1SkUuEIh5ZPCpvvDPOGpP\nuu+7\r\n=Q1pd\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"1e3f916aaa994ac19a65c62b461edb01c08e95d6","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.19.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.19.0","dependencies":{"tslib":"^1.9.3","@material/dom":"6.0.0-canary.6a56f387c.0","@material/rtl":"6.0.0-canary.6a56f387c.0","@material/base":"6.0.0-canary.6a56f387c.0","@material/theme":"6.0.0-canary.6a56f387c.0","@material/animation":"6.0.0-canary.6a56f387c.0","@material/typography":"6.0.0-canary.6a56f387c.0","@material/feature-targeting":"6.0.0-canary.6a56f387c.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_6.0.0-canary.6a56f387c.0_1582055049611_0.760583550675282","host":"s3://npm-registry-packages"}},"6.0.0-canary.bdfd52632.0":{"name":"@material/slider","version":"6.0.0-canary.bdfd52632.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@6.0.0-canary.bdfd52632.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"3fe8fca3af6f18107d0c2278e8e4c45d4d3023db","tarball":"https://registry.npmjs.org/@material/slider/-/slider-6.0.0-canary.bdfd52632.0.tgz","fileCount":36,"integrity":"sha512-B57gNpz19ih5wL+OBs/06Q5YiQIbwMDld1GFKCkTVthtZtRtssItJQ9j8BYb6nrGQo8izxpgGjr4+Wltd8Oprw==","signatures":[{"sig":"MEUCIBVH/q/+18MA51aHQwO+QTP6Mb3EeyaiItbzwpHTmDWiAiEA75Ii2LhH5jWyODe85Osm3i7/EO1xxLe9IVMmV4/Ds2w=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":362763,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeTZkfCRA9TVsSAnZWagAAtI4P/RE1ggd7YibZxhXjqQML\ne2zQpRzgSCLnRUddb927YYpFtT8R1KVaSZz+zASV1S9hIu4ZsLydxjY0Rbr8\nq6Bs8X7+P6/HoTpNAcEuG45xe3lbJkcHhcFPVNPMsLiVatYJZ1hqoPBubURz\nowvBjOGAVMny10cWpjKtjETh2+Q6t9UI6Dzu8TPEnLf2rL888hjhXFxsKDuz\n0FQdhheHWFFeSVQsXiSg1sUpr2nAI3qwGLvF9+va9TApHoC12P97BfQ4Eilp\nds5gza9tifmwzq5OX2TzVPmU8Tp3br4GeNFCqyjWwn0uyyATaJwZ1V8fnpdI\n5bk9Sun0SFVvcm0kHmvYFrmcngtMpcSB92sWj994a5DVdkWRJANxouKM1SGD\niTK4KB+3igbp8QDzpHmN2NgkhQdI7qQOnIE/e+fyuweNyHKlYcd3Wgby2Goe\n05wwwYRtU8bQ+B7duR+Q0iCHO8ydlHNuLg4bRrJ1aF3qlkL0JBBNoZPNutWp\nDVcsFxDROdynNTn8AZt6gnoeXRcJmwBbnMqzOrkVmDK/2w9tOnRJxVjrnCXH\nVLsHvWpL8pp9UH9l8UsDhKTcMJLpWYcjpSkW3l35Hmx2DIeDg4qN6shMOhsg\nvXCaBzzho0TLMBpv4HbGr0n2JtXqWnZIfX90AGTC8wwUCq7kUl76+arPg3Kl\nTwkQ\r\n=Mk+H\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"533f28d31ceee3f93d9c7695d4f394323e37af4e","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.19.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.19.0","dependencies":{"tslib":"^1.9.3","@material/dom":"6.0.0-canary.bdfd52632.0","@material/rtl":"6.0.0-canary.bdfd52632.0","@material/base":"6.0.0-canary.bdfd52632.0","@material/theme":"6.0.0-canary.bdfd52632.0","@material/animation":"6.0.0-canary.bdfd52632.0","@material/typography":"6.0.0-canary.bdfd52632.0","@material/feature-targeting":"6.0.0-canary.bdfd52632.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_6.0.0-canary.bdfd52632.0_1582143774707_0.02004911450943947","host":"s3://npm-registry-packages"}},"6.0.0-canary.ad2e4376a.0":{"name":"@material/slider","version":"6.0.0-canary.ad2e4376a.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@6.0.0-canary.ad2e4376a.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"1791431dc576cabc72220e7c52211646e63b5c51","tarball":"https://registry.npmjs.org/@material/slider/-/slider-6.0.0-canary.ad2e4376a.0.tgz","fileCount":36,"integrity":"sha512-D9OKHvsCKoPflOK/kVF4RXtf6dqnPPu0uBUt2RhIEA34EVY1qdMKvouAA/hCZfq/d6bkCIz42rdF1NhlRMX8Aw==","signatures":[{"sig":"MEUCIQDiHHuitn5Nx9+KkFO3A6N1wdFPunitT5fWI/YvcoJlBAIgT71uBA3pAooUneggcH7ELNcK0CTN5Mj7HBcC9t4qzSk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":363397,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeTxNSCRA9TVsSAnZWagAAaSkP/2N3AOSUlKv0c8cSBqML\nP0AJRuaePDfkVYZyLlzLTEURZ0GcMqxFdOSm69kQUGjUP/Gbn13YVb0GXrtj\njLpzZ8Kctp4fEnno3IhRwyXJIbNJgeLNZye+VlG5ESzUvsBDSWtc/7AtXyvT\nk6PnfThOXpJOXm6ga4yTgmMc6eSZ62zBjKCxo51674QwliTk6Vs+UptdtxKa\nZrN9A1g/UEkSWTF0VNIya0mFACCXdJ+el96njcrnpCgX0O2iKp8UKzCuDr1N\n1kGO9EzpmH9roXYgBA6FuRkK+C1u2b+tMz8DIuHDq4eTtFMcdDffvTfl9DW5\nHkRj5h9yquFE6ZeVNXPtv1QUwQgwvAVB/LXDgq9PYxV33qu6+hWnT+KWfjrf\njXZM4dZ0xbuPjWc5Od56UiJABaSVoFAksxb2rMSgdDsAhFKn3W6ZBrxnK8hZ\n3rujjIItpFWW5QEgaLJ7KqvoQz5PMteL/MzNqY79l65OQkJFOfqIdr4Q++/I\nv1dww+qEW6Ga5t6imONGviNC+GS3aMw8QGcJnG930aQqTSjlFbY8qPoPvwY1\nZ3XzUTok+jkJnLyzVUHhHD9fvWZRQ/vwaY283vn+Xe5ZQE+fuwKuIYsVpFqF\nZhqJHMOkQiMbJWZntNYMP/mJmOgJlC9jbPLhPdR1FkU1SIeRSbGEeRL+Qdec\nn2fI\r\n=vtRq\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"a91629ff788e0ccd5049a85d588ddf65efe5899d","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.19.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.19.0","dependencies":{"tslib":"^1.9.3","@material/dom":"6.0.0-canary.ad2e4376a.0","@material/rtl":"6.0.0-canary.ad2e4376a.0","@material/base":"6.0.0-canary.ad2e4376a.0","@material/theme":"6.0.0-canary.ad2e4376a.0","@material/animation":"6.0.0-canary.ad2e4376a.0","@material/typography":"6.0.0-canary.ad2e4376a.0","@material/feature-targeting":"6.0.0-canary.ad2e4376a.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_6.0.0-canary.ad2e4376a.0_1582240594234_0.5592935110239066","host":"s3://npm-registry-packages"}},"6.0.0-canary.765caef18.0":{"name":"@material/slider","version":"6.0.0-canary.765caef18.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@6.0.0-canary.765caef18.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"3ec88e97414f0f1639ad5825d2ab18b2cd0fa82a","tarball":"https://registry.npmjs.org/@material/slider/-/slider-6.0.0-canary.765caef18.0.tgz","fileCount":36,"integrity":"sha512-Wx6U3+2quFKkr+pMRVa8D5MkR043kor8LM6yojUCoKxdIz12BEnc3nbStVFLXFEH7ymZnVLkAsqmN5ppaKxDvw==","signatures":[{"sig":"MEUCIGs6HWfrMDpeVot6gy70rWWPO96lgI8r9gVXfZqFI4NIAiEA3xs2UeB8PqpR2k9eLOUwWBXPur2j6Tcuq8SB0bstoe8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":363397,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeUBRVCRA9TVsSAnZWagAA/NQP/jNTRDGKe3Q+YcyaIf6j\nMQLgmLNuPh+lXeogiMWe+IzSoRWVYxV7y/Ho6l7IaElQzj3DthS6DQR34ZUg\nGH+3+faNNAcYF4inqlwq8xxljaD0lKmKMiabAvce/AmbBPta1yMt6gB9Jdfr\nFR8JGBihZRrHq0R4wAYZ7d3vnL/RFkdFRnG62H4yU1YRTqxUwPvbg/ezYa4n\nwkwx5JIlE8DbVnPtCK3RQ/xjOrwHEWBOlZVAcQi40wkPFdwmeMsnlBVlHrf4\nEXcXpUeW5AsiQOqbQrqJjCfs8LwBRl0o4dN9Z5thxOoMYhRdRWETFS7XDIDk\nAn1WpIQv7exJg54lyrZFkcVEwdKjvtYG4P7bq3Y/Nb0YgXEidADqk2YM4Ni7\netrYC1ZXRitLf9Za8Gy/ZCfE4Tdg43S23rMebaynBvlhzqcxiaP328Uxuer2\nwcYFT7V6huWZAYPKneXFyYMDhgkRKOlz0TCrEMjQHXHbr7a+ipsqvVcJctDy\ngEPYwfT+d0HqgrlWy/9Dgi450uVCjyhJfWHqUWfwUHNBWAgYf4R5LGMOs6VM\nPsDFl/woXCc/2z/UxDT4i+vwjVlQ+/nPQ48pAyEyHe39wYpzaZlV8FNOrDfM\nXjszZANiXYJaeo0RWx39DCBQt63fY+nJx5doDZh6mVwWTTZeFKz45iEXw8M8\nLW4o\r\n=6VL3\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"e18ae69dc972686bd9fa70c34bbdda38c5caaf0a","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.19.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.19.0","dependencies":{"tslib":"^1.9.3","@material/dom":"6.0.0-canary.765caef18.0","@material/rtl":"6.0.0-canary.765caef18.0","@material/base":"6.0.0-canary.765caef18.0","@material/theme":"6.0.0-canary.765caef18.0","@material/animation":"6.0.0-canary.765caef18.0","@material/typography":"6.0.0-canary.765caef18.0","@material/feature-targeting":"6.0.0-canary.765caef18.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_6.0.0-canary.765caef18.0_1582306389355_0.057517948413579933","host":"s3://npm-registry-packages"}},"6.0.0-canary.949562303.0":{"name":"@material/slider","version":"6.0.0-canary.949562303.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@6.0.0-canary.949562303.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"1ba757fcb2b6022d5d0493c034f3d924cbdeeb99","tarball":"https://registry.npmjs.org/@material/slider/-/slider-6.0.0-canary.949562303.0.tgz","fileCount":36,"integrity":"sha512-PzAbFVKvD7qT5RmAjxh72zXc0MB1MFczTFpnTOV4O1LxdUDLhOy7tu34dqosLrbsU5dsMRn9ZKS8ur3StIigYQ==","signatures":[{"sig":"MEQCIGgqap+4ZINtZpSpol3ItS5Ophmi5Ua2QogcRUdTwtGyAiAke+aoCHz+SBwhy0iKnExfP8+aU49dfE25aB/43VsJGg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":363397,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeUD+0CRA9TVsSAnZWagAA1ScP/i7o3si//1r85jnpDsCt\nmv6VcVfAOWuPJRAwOWs+q64SM3EzKKGCFEbkESm0YCBYhnriMkjkqYFyllFo\nyHw/3wM7Z1WwVK72Di7bEaBAVb95LAU37bxYQvLyRlugAb2p3e1D6VD4jFsG\n7LPIVoV0ejrsN2gMs3P/SJ4LKy/3GXX35ptBdUwMrDlKQVT2BynwYbPGsrI3\nZXDoGhKQSTEPBdcYfIg3TS5lKFPqTqKTYUooKpuusLMPUR8THEd8QB86vmgV\nV72YzDQlW/CgSf5+2BqF+T0ZBZUe7dNqAxxjUpfFMbqLOpiuL+mElJj3f7Zj\nIYtSlAc9eieoqeFUQQyPqTyFfUIRf1s0Q2PGrQpk6HONpk6jm4KsV0V8Jbyi\nb4FmItyb83kG4pZkZua0O2Wlz9EQyjtVP/3ZwwZfznlVD1MpMiRia5Ruxf/v\nywz0Gybxsaq5qi6zQUl1KWE7pNPg9JrjAZBp5ulmbM7RruT4888+gPDKKnkf\nrmD4YuZlYPOM2uwdYiFMyQn50efcTLoWiW5HN7LRue91ib2Z2zcHqOL4brc/\nuvY9GXlnb3+xi2Qw64zZJVDPkL6PaYWnwoMH6fiNcxrbYcyWvwQNesEtT635\nO0D2d/AhzZ2k0JPvMIS+dfCGyancAgpJj31yjugM4+4/X3LSLx6FXAwVyhQ8\nofby\r\n=rpHs\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"b23ce78ac58e49e4a566fa22d5a4001cffa160f9","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.19.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.19.0","dependencies":{"tslib":"^1.9.3","@material/dom":"6.0.0-canary.949562303.0","@material/rtl":"6.0.0-canary.949562303.0","@material/base":"6.0.0-canary.949562303.0","@material/theme":"6.0.0-canary.949562303.0","@material/animation":"6.0.0-canary.949562303.0","@material/typography":"6.0.0-canary.949562303.0","@material/feature-targeting":"6.0.0-canary.949562303.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_6.0.0-canary.949562303.0_1582317492443_0.6421017949436463","host":"s3://npm-registry-packages"}},"6.0.0-canary.7ec96974e.0":{"name":"@material/slider","version":"6.0.0-canary.7ec96974e.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@6.0.0-canary.7ec96974e.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"f15ce224a2eb8c5483a29f8fda0f679a8427016c","tarball":"https://registry.npmjs.org/@material/slider/-/slider-6.0.0-canary.7ec96974e.0.tgz","fileCount":36,"integrity":"sha512-mCVbYd1qW4j2q/7M6vlRlUJUbSskZcJkNjOBTPC6aaiC7ymCcSzZZBABnAHPVOptHmpMvzaw7U/k4hLtd4bT4A==","signatures":[{"sig":"MEYCIQDsDzegNImRgsZTvV/ob5uF83HhSjBR/fIrytI5WrHC6wIhALhdvPyvhOxZ0ZAvX3toeSYeQpNkwOnuL3JkIEQH0Y5L","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":363397,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeVBzTCRA9TVsSAnZWagAAGE8P/jQv6G0gjGDc4z6VYaYv\nc0EIAkBEoih8BGw9pHBYYCkW2+Qch83DMKBj2RDLeyHgJDRa3zsXOFw6dorq\nAu+SpWXHH5EyQsys9xkKOAyoYTtM2pP0iQ+SdjDGl6jQmP/LZ1RQGGByvEAl\nF/h/nQtipeVqjoK4szlD3FODWwry9eesDUV7+jJHGU2vM4r/aZ4dJMvr8Sjl\n762bDo81idyFIcgYM+nM3Y4lgguiDot5tpi3ALb3cQfUZqMlamCdkk16LqbU\nkpVYfNtyhDMsC5Ifg9J+vLh2dP7tOk7j6vWQII3Ooph6D6i8y5V3QVqnAfx3\nh51NOOnP6R+XBnU63lV4kV27yHJVFBa7RPsmrhwWIrnq37hI7C2/wi8p/1/9\nOBtixWybZwJgYlv9oCqB47p8M5C4LQRAf4tspuH6qDx8AWaH5RQtzf9OiJZX\nRlGwO5vlEh6c/MCzxqED7gkI+U1XBNrOgpr6Am2Ql+E262u+N/imVMGxBr5I\nlcwCP/pztXfCPz7G/Iy8vqFeVUaOdTiOofWjECH7BakC76VuxFPbakWSma1M\nqyZ9OMeEJidmGdnOsWdAp1qgOIh1EiagSf/U/gPTPuTP7zkJI9XOpqJhRzyL\nDzKlx6nbOHvnHR0TGO1S1XvWUM5B1UQjX9wuHgO3fD9G2WjJm2ALkx5P4bP0\n6duG\r\n=eIux\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"79d3bd54f6272eb54a09e4cbd6a0e62f64e30a98","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.19.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.19.0","dependencies":{"tslib":"^1.9.3","@material/dom":"6.0.0-canary.7ec96974e.0","@material/rtl":"6.0.0-canary.7ec96974e.0","@material/base":"6.0.0-canary.7ec96974e.0","@material/theme":"6.0.0-canary.7ec96974e.0","@material/animation":"6.0.0-canary.7ec96974e.0","@material/typography":"6.0.0-canary.7ec96974e.0","@material/feature-targeting":"6.0.0-canary.7ec96974e.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_6.0.0-canary.7ec96974e.0_1582570706427_0.34717941196823565","host":"s3://npm-registry-packages"}},"6.0.0-canary.265ecbad5.0":{"name":"@material/slider","version":"6.0.0-canary.265ecbad5.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@6.0.0-canary.265ecbad5.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"05f6e50e538119c229e75203058540696df8746e","tarball":"https://registry.npmjs.org/@material/slider/-/slider-6.0.0-canary.265ecbad5.0.tgz","fileCount":36,"integrity":"sha512-HhkHn2lR78MqUDZ4MPFvtNycKghK2q3YBuD3AJxXJD/7+wB9xTD9OxdPxaxaWNRrP/NnI2PGeTHeSAHhDCWsJA==","signatures":[{"sig":"MEQCIEhbswEXkoezRc1Xyw2GCocuYkA/XqcECii8q4KgL1+pAiA3NVTk3tTeE2D6FHcVff2U5hnIXdCXMX32Rvbw0KslOw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":363397,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeVYsUCRA9TVsSAnZWagAA718P/icLzvJY3wC6TOFn+hfK\n8NDO1O2P3S5f9ftJ3GzsaZ2wp6xiowRd6rwiNx/LU5usbTTBDcCJxAQFEzyJ\n5iXaLRjyjccvPljwPEI6MUNsFqS9ByhuIeXfeAtbu+i12NIONxRGLs7OSIYd\nqKC1fHao00QavH8I9YLQUb+Bs/iUUJnjWnv/sfY4fAxtRA7ndqcDq/VPzURB\ncCHG9HOzP5ZdZ60Arx1rkyHjkyWG9VNidJWKJtYv84dgl5KLDCoBJ9MX3ZNf\nbXBscU+LMe7SO9iwkCwZvkine4qukAo0ze2x90Mk7PDiK7HrbzC+2hHq4w9q\ncFL7bnQRQruM8N4vlI4QJP0dZpZZHLKPRgoONlzWEmDfHUiCbJ5oB3dxvXZA\nKNGRzspYus6ghSuZW2LNjltkgJ6Y2NJYNsK7hVZQYn4G1XV8gLgQ91y1MDhf\nILiTkdYVyRxB75oithjKtn2Dcfl3ID1b638SSqR32x4ZBKgDP36lIQTvRB/8\n9nFVXZgzILJo3bkV1d+ffFp/6lfT5xto+HCov5vZn6Mtny06muXLAOUWaFQz\nRzj3nZ96SuwVl2VCLHI7HmgaysICL9Zfz0Zl7fh4GrueFIlffyWYvFRjE7oe\nBUxk1ftWxsNjMbjZlUluJoxDhj9tjHS7Jf7uWyTfjqhAT1834ytGd8wsJrFn\nc74r\r\n=/RZ9\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"1600f4154da0a0943fa8aaa13dfa15c79b0ef89f","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.19.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.19.0","dependencies":{"tslib":"^1.9.3","@material/dom":"6.0.0-canary.265ecbad5.0","@material/rtl":"6.0.0-canary.265ecbad5.0","@material/base":"6.0.0-canary.265ecbad5.0","@material/theme":"6.0.0-canary.265ecbad5.0","@material/animation":"6.0.0-canary.265ecbad5.0","@material/typography":"6.0.0-canary.265ecbad5.0","@material/feature-targeting":"6.0.0-canary.265ecbad5.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_6.0.0-canary.265ecbad5.0_1582664467732_0.037790526882910846","host":"s3://npm-registry-packages"}},"5.1.0":{"name":"@material/slider","version":"5.1.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@5.1.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"93d2dee500752a0e85af497848260042219408e4","tarball":"https://registry.npmjs.org/@material/slider/-/slider-5.1.0.tgz","fileCount":35,"integrity":"sha512-3+0kIgqowmUK0AXOC0jvR+8fqFJobdWuthfbuYBV+PFGBa9+zUow6Txf/yrhtCeQ01FHXw2iNeEFXSws+MYP9w==","signatures":[{"sig":"MEUCIQDJpsNy1QfOBtuvgdZSv9ejSQ298mCl17GQtumHyycKegIgOQaR1aEkLmk6Ae1dLmUYEVm+ZFwFDNwxBY08DbgnmvI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":362878,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeVZPWCRA9TVsSAnZWagAAcdYQAJ711cO7iYkRdPYPwBhL\nl5AdJD+5+UsjzmOVxKpvRystvYsgqRqRueatEC7R0NH5AP5wgOmjkIdfT8Ef\ntwGsC0JCiGqTa90fdQ2hxnl6eISFdmfy84RXkIMqPfa8i2Gb0yjApbtpR17y\nn/Sm9AxEsX8C2mCMlfLmfczuFCIGO5XwyTBeVg4SpotPLy5B8gcprlAsh+kC\nCX6nQl5/nPaiFOwTdehHUZkklRHYGsX6PGwVD1PklqvGIO0Aq+8hWe14lg2A\nW+jQ/qmg9/Y461I9hqFOA18Sb0kT0h548sVuH3LWXXhtvFO30lpmwL3/o/NX\ncasdrf1YzoEm6UbxU4+xtdpqRTce0a/0uEBdWlKNne9rIfNXKJCA7Yt9xQW3\nFjZDWhLPt9Ie6Sk4jrCD5dP96cxKA9qvYd/6Hbje2kpi8U3jM9PB+f9yWhVI\n/+OiTKi8La4mZuHnTtvjQXeLd+yErRorySi/89huEQJuplHcguG7LZm85Dx3\n4jYjCHbDR+YROIi5ViniTyiH5QMj3Dr1APns+NwP/IKrq2JN1InwF2gfZS1h\nGIVWy+8SpQVoQBU8UhRka0iSTSWYegQvvsIO7XVoULvFf0c4Y/clgavizYty\nm73O7DnPHFQffqPUU7TwPxfuqjbWgQonh9mmhGNQVVWw9XTu/QG3JvrXXY6p\nsNd1\r\n=sBSY\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","gitHead":"2cf87456f7b6bb4803ed5f1b18a06320c301a1b6","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.19.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.19.0","dependencies":{"tslib":"^1.9.3","@material/dom":"^5.1.0","@material/rtl":"^5.1.0","@material/base":"^5.1.0","@material/theme":"^5.1.0","@material/animation":"^5.1.0","@material/typography":"^5.1.0","@material/feature-targeting":"^5.1.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/slider_5.1.0_1582666710402_0.9480864307365202","host":"s3://npm-registry-packages"}},"6.0.0-canary.2cf87456f.0":{"name":"@material/slider","version":"6.0.0-canary.2cf87456f.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@6.0.0-canary.2cf87456f.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"c97b003be4ba260c170268163fb3204d6621f1de","tarball":"https://registry.npmjs.org/@material/slider/-/slider-6.0.0-canary.2cf87456f.0.tgz","fileCount":36,"integrity":"sha512-EcHZ/TlF4G+aZrOSN25DerRFle7+dW/wqgqFQ9HafjOzk0C8dlmlcg+uahP1LrOvhR2plPrP6i7zDLKZuTvHuw==","signatures":[{"sig":"MEUCIQD2aaSaK35FDQqcBQJreKSXCCCAH1EoPoHc8TyUj6tA9wIgCJxHfsk1eqvBVtsW5PtUrSOJiUKd5z4zaIZN1ohcyWY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":363397,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeVZP+CRA9TVsSAnZWagAABJ8QAJVztfeU9r/Mi3nmeb20\nfpJoUahS6Yjb/2gB/tQ/9J2Yqf85JSKZAsI0Vke650alyBOBUbZ/6wiCJX0e\nF4LM232QelQRixIxcd53ymAne84uc5StY7oRuvqCj7pzuUg0Ioj/MWsY5JGO\nsN4NFnc2tGgTa2xiODBvKYjOy8UlU+onNDVadFyJV2juxupjHBTcDSyyeCdQ\ngV5079Pk/UEikfAto2yvqE43YO5ExV7RZOmOuMW1iiVzLqySn/kW5fJ2LU7/\n62Fg4BdbJiZbFvsZWYdXJf3PfFkTgLPglO/6PEPSstVxI5iu8Dp60rlzizkx\n84P14O9osMOZJjpvlW/SdyhfaEsrKhis8jFSCYRQ1FjVfkIqDg3PGOvM25xl\n+zwD55rBpVQsPKNMLboC0Rer+x3SdFwknSAp1WFvtVs3RiQ80rNasrXLEvUH\n3LE1O/gjzYMNaSkzBOnxLsausngMmsWv3uyHHnsEtoHhnyrRP0QLbeKDIcu7\n2ETOMysxTIUaRZ76MflJWqEMYjGDIOpzna8C0AZIoPIn08rUO3b3lIaJcsK8\nlkE/NFrqVNtLjxbQ4WTfh203NdDT7WcHDuOBpGPecUaku+g2Fdfn+QYWhHcm\nPi0l93Am3Jo68hhynxxlqogW4EGtgO88D0nsB+cwPQad4TseIdf/EMtjLo3G\n7JiT\r\n=Sddz\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"f8e328b58b1986d1b2e248ebeef472088137ffa9","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.19.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.19.0","dependencies":{"tslib":"^1.9.3","@material/dom":"6.0.0-canary.2cf87456f.0","@material/rtl":"6.0.0-canary.2cf87456f.0","@material/base":"6.0.0-canary.2cf87456f.0","@material/theme":"6.0.0-canary.2cf87456f.0","@material/animation":"6.0.0-canary.2cf87456f.0","@material/typography":"6.0.0-canary.2cf87456f.0","@material/feature-targeting":"6.0.0-canary.2cf87456f.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_6.0.0-canary.2cf87456f.0_1582666749957_0.6074639175911416","host":"s3://npm-registry-packages"}},"6.0.0-canary.781434a92.0":{"name":"@material/slider","version":"6.0.0-canary.781434a92.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@6.0.0-canary.781434a92.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"12ba031c562c4eb48c9188d60352cb5642321d78","tarball":"https://registry.npmjs.org/@material/slider/-/slider-6.0.0-canary.781434a92.0.tgz","fileCount":36,"integrity":"sha512-Q+J12kgToq1Eb+nZyHcszvycIlb0ssZGhCtG2+006hKfblESoP9h6i1oIcKa/K1RqcM4NBuAMTvY6h0iMcbz7w==","signatures":[{"sig":"MEYCIQDdAmQTmaX5F/LLs+w0XRO2ZrTjWVoClfjN2a4gsPZpvAIhAM4jpcffILG5M17VRy4I3NNq0tthN6Jg3RUYT6MCwIbf","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":363397,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeVa2ZCRA9TVsSAnZWagAAnVMP/AiSi2qeyXssC2IrHg2N\nXw7izrIzzInOmlM04DVJcdfTg4nCYe1wbqgFEA7+K5QOhgBv3j9V+3nTnWLg\njkH13Gjj47TaFCorr5ZUUkT++9SmhEy13WEL67/WWqGp38xwd7L7xnQK4MKx\nt7jU0BkcUTlWypmiPnpUKi1KTDpKaPFuA1oX06NsJhCww3vrCoDju9PWciq4\nfzy4Ml0dl+AEXHB0ANGoRSqVKyuOYp047D/QsylUUJ2yVcPS96nO4CsLe1m6\nNH2u2EZqowAc3CqkaxLazJql2OhTje6VgBc2hn0onuL/9LPLq8OkcsCZKJrl\nUPhBTKH60ZPTLlCYZoCSewHWpZvxZ2NZKF+KXNGYDaI4Kw0mj9Zf72ITTnwW\nfTb+wIyC4QMlg3UTi2YrTgsPxCPkT9UdBV4MTXz4D3nlhVHnIM1nWrWul/Wv\nm2eEwD/kzbKLpIz3EyUOm3+PKdVQvIuP6/mi4UIbazgW8TgF/WBlE+ZIkLT4\ngG0lRvh8ajjm0+qeimToks3KxyTiz5/WqjkLbTRvkwA3Ee2dghInR0Jh/1YF\nOsdYTGt6qSivGZ6/h5npStXiMyvmOL64vDINul3q3k73EC86+Bm5R1Pybuwo\nKaphbuvWy1997BhNuAgBScDPMu9gCN67B2JbzatZzbH+IueS3rVOBc0E4GRI\n33On\r\n=/XR0\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"550f1e0ff50e94ece83c72bc45536fa64683d7fc","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.19.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.19.0","dependencies":{"tslib":"^1.9.3","@material/dom":"6.0.0-canary.781434a92.0","@material/rtl":"6.0.0-canary.781434a92.0","@material/base":"6.0.0-canary.781434a92.0","@material/theme":"6.0.0-canary.781434a92.0","@material/animation":"6.0.0-canary.781434a92.0","@material/typography":"6.0.0-canary.781434a92.0","@material/feature-targeting":"6.0.0-canary.781434a92.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_6.0.0-canary.781434a92.0_1582673305491_0.6615933995436725","host":"s3://npm-registry-packages"}},"6.0.0-canary.d6f60c98b.0":{"name":"@material/slider","version":"6.0.0-canary.d6f60c98b.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@6.0.0-canary.d6f60c98b.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"7929d7da14bd101006ab8f1a93b8abfd7f3ea71b","tarball":"https://registry.npmjs.org/@material/slider/-/slider-6.0.0-canary.d6f60c98b.0.tgz","fileCount":36,"integrity":"sha512-wRUQoXHg+d3qUdayDcp24MYT2WdXqQsAQvIUOndmC9BzXgSl/D7QNCUeMH15m5Kf2+Xl8s4L+b6n0NnIrRSCZw==","signatures":[{"sig":"MEUCIDg/EL5K5BxmApcTJZnzi/9SHtU5RndJioqhdrK+hHs+AiEAxrbssFchCV+tZ/ZsgBWdsqbXBlm/f5jXrwVW30GsCRw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":363397,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeWY5OCRA9TVsSAnZWagAA5ogQAKGwge7W0DZzbnExt2Fx\nxQfZIZdWS36cfAw6N9OAyrT9S5FIw9CEellXQ+hzo1zPOP5epexyKtGdrkBz\nAR99E6eYfhIdbZ6miYGd4HyE9hz/caN48myICRQlIjpfei/C5iZmP0FKxAbR\nRxzthJqeC7Kd3M2pvFBV43RmHOht9c9wkSEb8o6GH7cOAZMLpUZDONbUxtf/\np4WvG1utKXiWPzAlmk4QfWshcnVV3IRtnnMIDcMs212NCQDuvVghGioC2/h1\nTPR9iJel+W+7Zqp9aNaL1Cyh7fBK6v5uiTqrmYb0Fqic3O0+59AjuffP9PAI\nJuRl0PQlzyaaN3dlGKulAt2qrs3bTniY7awyNlyUqGZMeB3ZnjnocKdEbRYc\nTuXd6MfZ17CMHWRMsTrSucwRPGIVWM3/452yCGSGa/HasVIP3um+F2WOGT86\nHfI7NJDkkiIBUoPlajFG0s6bWsPz9uaYldWChoX0AlRBZIA0VaKarHnvaeP9\nQHhaJw8bBvsCZ/xG+ZRPMzZJIahysQLadA8/nPKwhovbD+KBCX45E81UYupR\nhvjz0ABCsrYHfo4moFtfCdDnZdOsv+7zaQjao3gb6jS3wxol5P2sG/LHoVmB\nefwfg/07vessLjX4HDYWXumHxuo/pO6kPB5H6C4tq5CvuB8ifo8uptx9mp5Z\nqEBp\r\n=Y2sp\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"51319f628dc2d5447017b393bcdda8ea48a93896","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.19.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.19.0","dependencies":{"tslib":"^1.9.3","@material/dom":"6.0.0-canary.d6f60c98b.0","@material/rtl":"6.0.0-canary.d6f60c98b.0","@material/base":"6.0.0-canary.d6f60c98b.0","@material/theme":"6.0.0-canary.d6f60c98b.0","@material/animation":"6.0.0-canary.d6f60c98b.0","@material/typography":"6.0.0-canary.d6f60c98b.0","@material/feature-targeting":"6.0.0-canary.d6f60c98b.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_6.0.0-canary.d6f60c98b.0_1582927438041_0.3608677978048844","host":"s3://npm-registry-packages"}},"6.0.0-canary.69edc6e28.0":{"name":"@material/slider","version":"6.0.0-canary.69edc6e28.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@6.0.0-canary.69edc6e28.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"62f23a92b856ec006b22669e08484da69ade9cec","tarball":"https://registry.npmjs.org/@material/slider/-/slider-6.0.0-canary.69edc6e28.0.tgz","fileCount":36,"integrity":"sha512-M62LAAlvq7EaxUZLAsHvj0NoYb59OODO5Up7dxcxpPFG2SZUxLeTj+E71WKivkUgTM29fKmSw46OiYqwrXp8MQ==","signatures":[{"sig":"MEYCIQDxsiBCbYM4hNdarHC7NtdG8cjN0Esd1xT87h6NIQEmqwIhANFw+xvihQy2Hcr0kOEKQRx574GMGVs1ii6+C4OdWvcr","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":369715,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeWZBSCRA9TVsSAnZWagAAb5AQAIvbzlpSioaF8n7noUxR\nIgnV+Zcccsy2Gk5qjvZWyQtULA50yqeWCbVIlVURzM0aWK4H/78k/10t4dBa\n/wFmP2kxq8rBaaDj5zcx3Dhs4BjvlQtQx8He2KC4OME6uAnIgCUABHPmvDd8\n6OLXLdlfEctm9Zo8VWqm11+iPyWexygv1qDcv3/hmEsOPfcdDIEzMR80Zm7z\nBjtg0hsYZqEbWGawD53DfCUdtfl+k43v6vYb0QeV06GyOmeuj7NVdg0a8COw\nCeH6nItHuURyYFOenKJ4eHR4F5ToLpwykxIWiQg26B4byA4lE7t6XiYO1XUe\nUBRQM8F/hmXKoLSDFohr9d8u+dUJvm1SOX9TuHxoNe90dtMlirUnqg19oyxS\n6df3Ec6y8BKse/Jj5pFAWPqBaqGLVP+9slQD9sgOzmzHJ3fmjZcMFksD+ki8\nTu7XEqtP73WMvgQyc4TBipL4nBtAFw7MYbrwRNXn+HIzuBbbjQq+J06LkaRL\nUAllrN+TwuMfO4J6Om3QHtq3tGYb+sO6pS7QDSYFBQXnBBdyI6ZHt3keZtxI\n3zvarF/xi1mU0nmCv2/iEPciAu8tvcyTDPhX773XmBPBNCPAwKtSBMHQU0kl\nZXhqy74+Jugmd1oOP8cnI+dNZaGbSwU1jvuEjnMDwRhneiavDIXPq1dHM3bU\n832i\r\n=/mB4\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"7394312b46cecfacb3ac97cf147ed16fcc42e538","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.19.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.19.0","dependencies":{"tslib":"^1.9.3","@material/dom":"6.0.0-canary.69edc6e28.0","@material/rtl":"6.0.0-canary.69edc6e28.0","@material/base":"6.0.0-canary.69edc6e28.0","@material/theme":"6.0.0-canary.69edc6e28.0","@material/animation":"6.0.0-canary.69edc6e28.0","@material/typography":"6.0.0-canary.69edc6e28.0","@material/feature-targeting":"6.0.0-canary.69edc6e28.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_6.0.0-canary.69edc6e28.0_1582927954189_0.975347538742869","host":"s3://npm-registry-packages"}},"6.0.0-canary.9372e4939.0":{"name":"@material/slider","version":"6.0.0-canary.9372e4939.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@6.0.0-canary.9372e4939.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"60b3e59aed37dce3214c26d4c1389ebedd0ede84","tarball":"https://registry.npmjs.org/@material/slider/-/slider-6.0.0-canary.9372e4939.0.tgz","fileCount":36,"integrity":"sha512-3+CIQwvk6Fh3psgJqSfey68bCd1gNMiAgGn0D3iLr4LxTHJo3GPE27FL8mJzGdywOnBjAUtczdjnX5znR3ShkQ==","signatures":[{"sig":"MEUCIF9oLrq4dx3NAIi8IWZnWj6yrJbxFPKV8cQXX1rCxhfOAiEA9Zpgv6Ym5O0ASuJxaLhmtPzrm1F4of0DALhNPczV/q4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":369715,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeXqvCCRA9TVsSAnZWagAAa8gQAKFf+NIXheFDTbgD0c0x\nK8wEzMnr/z3CediViUbgR1QFeWCuQEJte/lJ8+HaYWA9ZA4lBx//fr4U6CIX\nECl20A0W0AStxlsd1aYX7GB8RBNDTa8i//VNgZ8i6VgDOofZR0D6//2VzVND\ndbTri2xrkNJ6uFwTF1aWwAI3ZHrAPd9du/Lv2atY9ZBvqC7YJHZFjze/Yi0d\n04I9CoBFd5qwyq4aZLqpbg+FECPmjqoO8X4PaYh5FZTnrbIo1CvgGmuQRJbO\nP39QrXpXI3Qg9ltvfsHVEII2Ht5+vPr/LpQVpiY8RHYZDRShDsKNFqlnXoce\nKq4C/ryD5hUnGHfqMEIdZ62q0ydVlHLT8AGOewQKeLBksm8sQm7tWhEq/7Cz\nJdCxiJzCrQqYVoApkD8c1jZANshb/LunhEDpe9nBD8feQXTkGw4L/VHklwtY\nV4gySTPl/128s2I0dg1tOKQ5xot7ovSKYTOUYEO2U7VVQE+mh1cz78WXcMsB\nP2ehGXNU3EzgcthicXLDJuGzfT9Rwy7GAXI+yFvjvOt3OvrVhfpAjfVMV2j1\n9gSv7xOubHIEnz4QUrT+83qwttll4DoHNXychCmzHRBKQ4aQaeZ2sctKmxoX\nFNRMqTk8auO/7/ggj7pooWv0Dk/MwD/olYVYu/rCqvIwdgHzPWnvRSM/EDQR\nwdr7\r\n=YynL\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"e54df7e88218f93cffe81e63d7e28371126d5611","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.19.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.19.0","dependencies":{"tslib":"^1.9.3","@material/dom":"6.0.0-canary.9372e4939.0","@material/rtl":"6.0.0-canary.9372e4939.0","@material/base":"6.0.0-canary.9372e4939.0","@material/theme":"6.0.0-canary.9372e4939.0","@material/animation":"6.0.0-canary.9372e4939.0","@material/typography":"6.0.0-canary.9372e4939.0","@material/feature-targeting":"6.0.0-canary.9372e4939.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_6.0.0-canary.9372e4939.0_1583262658418_0.5310740029757293","host":"s3://npm-registry-packages"}},"6.0.0-canary.9cf5e9842.0":{"name":"@material/slider","version":"6.0.0-canary.9cf5e9842.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@6.0.0-canary.9cf5e9842.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"f3cec91b7a2c9cb287e2433369979d65f18d1ffe","tarball":"https://registry.npmjs.org/@material/slider/-/slider-6.0.0-canary.9cf5e9842.0.tgz","fileCount":36,"integrity":"sha512-3CuoVfGzth8U2dqOZn3xRtTURDdeJjNnuxYlAtGJ0usRV5kb8IJzPbXGkpqF0wz3wE4E26Y+ntNVHV4uBqjzCg==","signatures":[{"sig":"MEUCIQCtS4Q49FwyJmrAuP3IXKo81FUQk5EypIa/XIGuw2HhJwIgICDBu8OYWu3CP1vZ6/Y81UytJRic45KtXaAnvXUMQkk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":369715,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeXuedCRA9TVsSAnZWagAAR3oP/20p0C1BlnQeyR340mWd\n7ilkJnD9fcCMU3TEbiCkJapscDLJclAt6ODFxk7K5wiamrFX0CdtEXk2Wxym\nieTJXrOIkSnIW9Rdx9NEgtL7awXCpE5pflQS3yKxEhAafVTwW9AoVHsybrN5\nMOQgfyhNqw5Ut/aT07D9sZJ6CGYLrb1TUtTbRbiqMmGiRXd44JeS5581v2aW\nZOb97KbEs0+aFjHOMIIlswdtxJ04rl5SOI/outPRt/6mJAgqwisALm8z8BcO\nUevjS0lSxXD+kgmiwoacX5yKtaQkm2Jdta9FELHaqmTukFlLxexZYvItLKs9\nZVnqJXy1Ap0G6vdNKFw+BR8ciMnK/4kxyCgrv8ukqyUF8jiSOu2x7FgkIZ9L\nU9uBst9IIJyoqOC36jDgBbEU2TcuxjJ74ARmG+scALk8cN+sJhjNyzqDiY5A\nLZLUqMfwXL+VK27Ct81QPU7L3sPvfHjdrsN1hU1n8EOjGimV5/zapubTpTM+\nijDBvBiPiICX6hyy1fX+rUGzT+3UMqcmm1EXihAQd3oXxrn0UoFVf12aX/+A\nAYF+0sXBWlfbDrMh/obVo0s3azrdY//BAUi9Be8bVW/iZ880qWEYlz2hs662\nqE2W7Qc+UKA84ep9elCF+661k4aw+2NLR/tZ+piqKiYslcismdWg3rspEFTz\n1avE\r\n=ydhr\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"9ae3d1faf8362261d4cadb5f9386265501b7f143","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.19.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.19.0","dependencies":{"tslib":"^1.9.3","@material/dom":"6.0.0-canary.9cf5e9842.0","@material/rtl":"6.0.0-canary.9cf5e9842.0","@material/base":"6.0.0-canary.9cf5e9842.0","@material/theme":"6.0.0-canary.9cf5e9842.0","@material/animation":"6.0.0-canary.9cf5e9842.0","@material/typography":"6.0.0-canary.9cf5e9842.0","@material/feature-targeting":"6.0.0-canary.9cf5e9842.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_6.0.0-canary.9cf5e9842.0_1583277980161_0.0725561149380658","host":"s3://npm-registry-packages"}},"6.0.0-canary.3657f8863.0":{"name":"@material/slider","version":"6.0.0-canary.3657f8863.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@6.0.0-canary.3657f8863.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"2df381ed2dc36b86be6c89efc4994fe8046d0bd4","tarball":"https://registry.npmjs.org/@material/slider/-/slider-6.0.0-canary.3657f8863.0.tgz","fileCount":36,"integrity":"sha512-HbGYhrD03P4VxLpbOEsgXKczY8KWadrxghFY8DNiY24pLjjA1eo8r8R7ja6mofkb1Ge16vTVAE8oHH6QgS8iMg==","signatures":[{"sig":"MEUCIQCdyjc0dwIPw3UvxLZ66xb2jbZ0n+kEDbh2kx0pjh3cBAIgVDSoVHvHS65xDAbyx+nfwUCmqS/baTt/Nmb71SsrxLk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":369715,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeX+kBCRA9TVsSAnZWagAAoFMP/31qzqNMzUJtuJudVq/L\nG+lk5xrWfUpE5VbrwS5p/gFPBZnAnqDwDnnsrnUjfPFX2ZVrkKzph6TTD0kR\nSncWddKRzxDf9nY6nr9RabKiv0liMDk26ny3rAI/IM/xmIfdb73WUTrD/kaH\ngiIob6TtuCkwHHSrcHrbAbCio2V4NrXDXXmlfEZjdfcbLZqWBNE2yCRjGPIj\nt40ZJQUAWGGWDbht5zlH1CZRrUDSu246oI6hf3oELY4ll1Uv0RTafN3xTpEI\nluPKvSkSAnUFF+StP66YbLXUtYn+S2kw9b+2ELHUwPz+OWff3MzT/ZHYy+h0\nuS3hgi/KahFb2oYkv7ru1Vin8SJ+hZ2+MvxpUjNslY2EM3WemowJm62KZT7Y\nYBcexpROQj5/5EqKtsm0JsLHkVlSAsPn9Wp2+0nYnBqiJ/Dk0vSCVErY6YlB\nDLBhaLsvEBaAX5p07pwrTo+9rGnDKAkYikyDpM2SgcaTy5KLzBLsI/TCFn1N\neZ0kGBEBiKp97n4Fdibe9Jj2ewaZIJYQNsjZB2bTgJdi6sjVrHb0SepiYwT7\n1pyPE7QuSWJoRoA1QuASDubhmwLjCbkHGdQ/eYaR9VGbgOoBPyI7Vrsv8WvY\naubFcwBJ7trvt+fj/LnuElYbWR1qyWZRPQggpvCJiKImmURdbuD3TdKhWvNJ\nT5ZQ\r\n=AwZo\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"4075a5619b546f352f6366e5e90c61777ee28f5d","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.19.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.19.0","dependencies":{"tslib":"^1.9.3","@material/dom":"6.0.0-canary.3657f8863.0","@material/rtl":"6.0.0-canary.3657f8863.0","@material/base":"6.0.0-canary.3657f8863.0","@material/theme":"6.0.0-canary.3657f8863.0","@material/animation":"6.0.0-canary.3657f8863.0","@material/typography":"6.0.0-canary.3657f8863.0","@material/feature-targeting":"6.0.0-canary.3657f8863.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_6.0.0-canary.3657f8863.0_1583343872831_0.5084985160978286","host":"s3://npm-registry-packages"}},"6.0.0-canary.98b843417.0":{"name":"@material/slider","version":"6.0.0-canary.98b843417.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@6.0.0-canary.98b843417.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"d18e0edcbefc9bd8be3e3d2a458b6f491daf9903","tarball":"https://registry.npmjs.org/@material/slider/-/slider-6.0.0-canary.98b843417.0.tgz","fileCount":36,"integrity":"sha512-j6cWLpDi5wD6jkX4N/pxPQWEnH5aVo+bLnuJxncVi1IDn/9g63mA26fIVXYl690WTmn480DJkQl9Trd7Bh2xug==","signatures":[{"sig":"MEUCIQCbjzP1BHoF8bq0DCH4ovkPG4c0RSuiQySM12ECTFl8MAIgVLxMxDPVEKohLCtcCNz2tUVJ3zs8CG+77DlC1SSKYyk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":369715,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeYUV6CRA9TVsSAnZWagAAeaIP/3XAQIZj0Yl4FiZTVfkT\nblv1v+tt5soaCOXMbdrJ8Ymn6/HoproqF3oeB+l4CWMg9XfvAlmcuhUiPMMN\ngiRC0PsYEBpuDxtOuBazTPJ4IzZAPI0GzcK4Pur/ruZYKfbKUJq14lvQEe4U\ni71kicG2NVth0KEkay2uDXcYdVPhtQDCrB5QfOnPJTr/7IaMokaceHy0J7ZM\nggfojuVN3+as9sMh+qUyKlIQ4W0mTj5G/ubdfZ9liejAsksQD9AKDHwiwI7t\n9D0pqd/BnNnbnkcP3Pq/MONTftS0W5YGXeTdShdbmJt2dv1oBgADEchrYEV/\nqlAw43OIwNv4zzN11R75huXjZXfEpKV9aaaGaO99PWenouNcnTioHCYoII/I\nBXPletGAaP+WEu13oWQnqFUsGC8DBVswtCulUEXzlcdw21ALpEKCcFuyAt4r\nrkPn6bV6KY7JYN9ml6+wbDTy8uLFIAIKmmDZwArS+UHEIVAH1knNzm58G4ZW\nb18B6OgaCl/BsYDhbbiYT4xwq7Yl6oQokv3s0IfDLxdiv2Y1NSfP9K5i3Eig\ny9hdMNyPNWBiI/S3ecGll1iBDN5wde2CtPX6rkReAzaq/9Z++yI6wPi50KD+\natSSMavF8uQgHqRz8a6KDH3DSk5s24WDcqkJanqCueMAES7k3Fk8OepBOTnv\nLm1X\r\n=Zz1d\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"68f2aa7dce5bfe926cedccaedf1c0c98166d0bc1","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.19.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.19.0","dependencies":{"tslib":"^1.9.3","@material/dom":"6.0.0-canary.98b843417.0","@material/rtl":"6.0.0-canary.98b843417.0","@material/base":"6.0.0-canary.98b843417.0","@material/theme":"6.0.0-canary.98b843417.0","@material/animation":"6.0.0-canary.98b843417.0","@material/typography":"6.0.0-canary.98b843417.0","@material/feature-targeting":"6.0.0-canary.98b843417.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_6.0.0-canary.98b843417.0_1583433081802_0.9432021204644372","host":"s3://npm-registry-packages"}},"6.0.0-canary.17b9699c4.0":{"name":"@material/slider","version":"6.0.0-canary.17b9699c4.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@6.0.0-canary.17b9699c4.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"cefa8172968229b786aed428d16b52308ee261e7","tarball":"https://registry.npmjs.org/@material/slider/-/slider-6.0.0-canary.17b9699c4.0.tgz","fileCount":36,"integrity":"sha512-PDOzeRwjW+G21BZcyHVz/9aBCOh5haTE6inyw2toiDDxLPxiKSU9W8bnVQjXIlJVJQSdrHDnzcBQooF/L+uXtQ==","signatures":[{"sig":"MEUCICsNGHX9eobCcTZnAZrJZLzqgXMFV2h4Ho7jk7XASiSvAiEAnnECHEudJpGZwxzv8m5v44ZtePl2VQEtv/aeQXR1wPY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":369715,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeYVGACRA9TVsSAnZWagAAneoQAJYOm2zhKXTN4Oz+Ij4w\nA87eEiAwiyyPZtUNTgI6GJwcOm5OKZ4ipamnnUgldCRJU8wR3lDpsG7gN3Ie\n0enOQLbEQWORRrXHqsBmsaFdzFdWtDr06VDvaJZ0M8JfueOP7X19gBogHvd4\n4WrA+os81ASmFfCpufqHJaDmMNHk1W0W9wtckUTxxE4uYk5md5l7gjoh3s+Q\nAmCGDCNGDrzBZI+Ylege6IpbJwKrBgvaODOxyUnU0eWiUVqxJ6hvj0AD56by\nUE75tEijDVWCRGbe3jfz36IkTIi01Sa5OJ3mKg4fgHmXdSFOYm+jfFjceNd4\ncK4RvGEI3DT6dVc2HVHHtyBGeKu/ORE9rH1PNRAJg4/26D1waYiboVicsqS3\no5ykj5zBBv6wMZskdu+iUd87LufP947xK1do/zGXEQpeF4DCik37OhRruvw9\n3ye3OV3ARpqGtc9x6wpOI/jIw0W/NPGB3yK8wof4f4xZPmmMn6ZZ2BGNo3Xt\n1V9F5xeHX5J3Zb5ym9tfmZePi/yL83/uQBtil9R6vFTFFbayUfP10Os38mHx\nBXG7zrlJ5UCyy9R0+7SeM2FeWfVqofEE8tRqn0Nl+BIi+rXtmLITnUrZpBv2\nDpN5WB6ipELBneZN9yvx3GPLYJMItWF64o0XXr4yJGh6dD2/aWGyn3JAWBl8\n0wzW\r\n=25rP\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"5cc71188279f7fb4c0eb3b0b6b98b59815539374","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.19.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.19.0","dependencies":{"tslib":"^1.9.3","@material/dom":"6.0.0-canary.17b9699c4.0","@material/rtl":"6.0.0-canary.17b9699c4.0","@material/base":"6.0.0-canary.17b9699c4.0","@material/theme":"6.0.0-canary.17b9699c4.0","@material/animation":"6.0.0-canary.17b9699c4.0","@material/typography":"6.0.0-canary.17b9699c4.0","@material/feature-targeting":"6.0.0-canary.17b9699c4.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_6.0.0-canary.17b9699c4.0_1583436160533_0.9336411400221862","host":"s3://npm-registry-packages"}},"6.0.0-canary.6ee035572.0":{"name":"@material/slider","version":"6.0.0-canary.6ee035572.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@6.0.0-canary.6ee035572.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"99708aea5c0c6b093c517ba663484e13d5b82806","tarball":"https://registry.npmjs.org/@material/slider/-/slider-6.0.0-canary.6ee035572.0.tgz","fileCount":36,"integrity":"sha512-IJeGrEFqkunLOvIY1IrvCC68SZa1j5ITwUzqo5Uo3OaZ0ENOOnq+nSHnQAvJjppNCa6H3QDLcF3GAQz08PFNWA==","signatures":[{"sig":"MEQCIB4Ls6yHcFwlH//uNWbcrTIzTGkyKjBa5MweLG26aTyHAiB6U7GniV+rvO8O5HPa75k0zCoTCrvUF197SYLqSe/vSQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":369715,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeZnMVCRA9TVsSAnZWagAABcAP/0EKL4uTHdFYAIhiRnJt\n/LJgNm4jT3uuvmgbWMRfiKXqIBXDgvdb6L8x/DI66/5F0VDg/S1yFar0bbY2\npCZUsG2wimjJhc5zk4HJBSrdSRmkiWTnhX8/eVRjndgZf2LwP+Gynx8g1WPB\nQjl4HtU9iXKfHquucYKJmSsB95NrJS0TzwnooAr2GX7TDubM3kpQr+P7t0r+\n0jpGwrijzxp1/wTmVXr0XbGxqx2mKO7cEFhE8gay4RNDpy+SplDdHsNVUplE\nl6NKCJn5JW4Hssw2h2QIEZyX2NIBV+QvMy/By+TR+kQsslDIGb5kuJNZeNhS\nsP3wFErufZXWLq6wiA4OR5OwuXdsNH4egZoH9RFypk1o/KqsVQpAHJwgLqtb\n4glfcfpIxS3i2KIuiCG/AVNn2qI5DPOgJ2ZcToXNs8ehjF2DwJV4ZQlJmUbk\nJ2c+9i+LhldptE99yIMoglQ5l8wbAWKU78THPAGm7z/Qhm1rqt2E+5Ror8ox\naJDhFStnoP9GK7tC3XIBRdRMP/GFjrX/TmqvWf+iUw/U6FXYs9Q8m+Bax32T\n2ETqh7sBmZ76/WAoNxSst+Q7duv0WNEnEoqNX1r1VRI77hMWA0BJPS0OQaOG\nZ5P6ZaVwAOUjF2ZzXywy+AsZWtvSelTgUOcxe+QCeqUGIu3pQ/QbFD6KHl2d\nVpfF\r\n=MiI9\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"f7d234455251ae34ac1d568b4654bba0bcadc57d","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.19.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.19.0","dependencies":{"tslib":"^1.9.3","@material/dom":"6.0.0-canary.6ee035572.0","@material/rtl":"6.0.0-canary.6ee035572.0","@material/base":"6.0.0-canary.6ee035572.0","@material/theme":"6.0.0-canary.6ee035572.0","@material/animation":"6.0.0-canary.6ee035572.0","@material/typography":"6.0.0-canary.6ee035572.0","@material/feature-targeting":"6.0.0-canary.6ee035572.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_6.0.0-canary.6ee035572.0_1583772437507_0.24163054938755324","host":"s3://npm-registry-packages"}},"6.0.0-canary.bd33cb56b.0":{"name":"@material/slider","version":"6.0.0-canary.bd33cb56b.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@6.0.0-canary.bd33cb56b.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"8b1614f0001d2bdbc34f4a45fcd0f8dbf83652ee","tarball":"https://registry.npmjs.org/@material/slider/-/slider-6.0.0-canary.bd33cb56b.0.tgz","fileCount":36,"integrity":"sha512-mKYFn4oEPB2duMCcw3iCtQbDYB+UaVLElyecgZF3qHDglX35se9eNYxOnOzvqe+hdZvwKHrwWHMPFVjXnzOCSA==","signatures":[{"sig":"MEQCIDrcLUrjJ2O/v3hZm65yUIkAKiUyGhSVLUWWQ3WVpKZmAiAPsguRFNQKGH0UwngLhcfTmhBMnVD4PEuVhIrB6RrTog==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":369715,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeZntcCRA9TVsSAnZWagAAoCEP/1T6FPJn8pn4NZ/I9E2z\nOL0eQrxja46i+jmr+c2DiHZD4bIqocE08VIz+fhmdum0CpOLfzW8jVeWoh6Y\nEmwo4JosJdTKL7htVqvjJGza4MMAwtSxiBzW14196UQcjj4nxQfaA/rLZdKE\nYhitzr4waC1ph+ojuuSd9wJmP6f2Iu1iIY8nXebeDMEOVbyMsGsXWDfhM7i1\n1PeggaHwyMm35RPL9T1vM9dcNrIr5+TlZ9xY527XUYJabCscD4OrAUWvwIG/\nT/r3XRYeiDw4hMzTXKtg5QmRiXsX8vxI1IGhVsZX/F+ZwGaQZVxqeOMkdy97\nkEuWAhPLpolT59N4q8MaraLKaNfV6LHfB82bC78deQN+eCG2U/LYoYzD/xMJ\nBYChW6vNgFlHq7UmVi7wxep9PdZktrFqRyaKD7p1ODkLHSNEhejpm97dcXRu\n4TfdRg+N4pVLqiGLSGwTvyzQLhe4/BBMuX8HAyAxl/PAR/ngNwIoJT7N8+p1\nNsiH9JjJ4+B19aQzctNuTlmpiiD53goPsxnQbMwa8Wtw7luZa36aZrunZYd8\nwREFFMTNXJTJX2aBZqP92UBU12w4R4XvkNHgtQcATDIvZ6V7yv5IFB9qp1d4\nm1Z4ULLFDmAmwrabcUOfvBe/amhdZM9MwQKe7T3j3/ypsJo8ixntVMzpPHfx\nHRUc\r\n=lhdS\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"8829857459a9b7c92653d2bed2a8ad63b58b672d","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.19.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.19.0","dependencies":{"tslib":"^1.9.3","@material/dom":"6.0.0-canary.bd33cb56b.0","@material/rtl":"6.0.0-canary.bd33cb56b.0","@material/base":"6.0.0-canary.bd33cb56b.0","@material/theme":"6.0.0-canary.bd33cb56b.0","@material/animation":"6.0.0-canary.bd33cb56b.0","@material/typography":"6.0.0-canary.bd33cb56b.0","@material/feature-targeting":"6.0.0-canary.bd33cb56b.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_6.0.0-canary.bd33cb56b.0_1583774556096_0.8322963192054398","host":"s3://npm-registry-packages"}},"6.0.0-canary.26c049afa.0":{"name":"@material/slider","version":"6.0.0-canary.26c049afa.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@6.0.0-canary.26c049afa.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"4302719f0837e9dcef9ff4461412aa5a51ef17be","tarball":"https://registry.npmjs.org/@material/slider/-/slider-6.0.0-canary.26c049afa.0.tgz","fileCount":36,"integrity":"sha512-lvM0o8Shb0wC5AAL8x4huoJ4vE90lhGUkd8lQqO1mEwpdn8+pDy0W7bd3AvhwC3iNPcTqyWbw5w82tHO4mrCmg==","signatures":[{"sig":"MEYCIQCIAd3ZXf2zigFOnNdqR4BTYbg+CTmBzQ1X7R55X4pW/QIhANO3217qoGsZEaecH5RA3pUid6BXssC2aDwUso97eD32","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":369715,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeZ8hDCRA9TVsSAnZWagAAKYAP+wUEB/13IkOol+u2OkuK\npGyj7FfOoY0J+qiG6BjUs7JBMcJqxUTGRqQrPLawC3aT4GABz9901mgp94WF\nh878G/N4wGBNuQ52mb1+clIX4MOgQ6MRd8KtHgiZq0W+SIj9m7N/xXWt41m7\ni/WghPogmAGv+sKKCm6QPR5sRTjTSDvhOTWb978Jz8+aCFzvXeeO7STf/UfQ\ntfZLqCy/neXk69O5PEUZYHyZQApPikMcvwCzkVGqK4Oglz163U1yvUOPYKCV\nZ39U7/RQRL1+DSPwlt6aNpjZixGaHfvVuX1k0/tdmVrWi+BNS1vwXdYCxlKH\nNtQAeSEX/WbhTQk74W78eJ43rD/b13E8IGbPm8cphfYaldOI61IOBdpsP5Lm\nWUy45izjF9Ab6d73+uIUx6phsrG63IWwQ+xZcjBwkhdclFM9mELKHhWF8Up1\nKvmV9N/3KcTc19FydblyEqpC9oNmj6ZhqfDB5edygTF8qV8XKoqXXNciqQ4e\nroyIwkBiuG+VoGRWUtsiBq3kSArm2kAsTAQfxYmFoWnj673hmCVA/YeiPH7m\nKtN5Y3lhapiMA35noaK8xFe5cGtK/Dz0Tp9dlbxjqV01O+Vz1G3M14lrgfP6\nt6EQodQb4h7g6BlStoqYPbYzH8aMoeNtMaDiuji+Sohq+zTIssQZhlkuco5I\ny/qI\r\n=V0Fc\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"042ad06994baa2c42398713e57185e4bafc82a3a","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.19.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.19.0","dependencies":{"tslib":"^1.9.3","@material/dom":"6.0.0-canary.26c049afa.0","@material/rtl":"6.0.0-canary.26c049afa.0","@material/base":"6.0.0-canary.26c049afa.0","@material/theme":"6.0.0-canary.26c049afa.0","@material/animation":"6.0.0-canary.26c049afa.0","@material/typography":"6.0.0-canary.26c049afa.0","@material/feature-targeting":"6.0.0-canary.26c049afa.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_6.0.0-canary.26c049afa.0_1583859778941_0.9276284680950351","host":"s3://npm-registry-packages"}},"6.0.0-canary.1db5c9fc8.0":{"name":"@material/slider","version":"6.0.0-canary.1db5c9fc8.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@6.0.0-canary.1db5c9fc8.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"6cff1723659dc57be302f88fbe4e3be377c333c2","tarball":"https://registry.npmjs.org/@material/slider/-/slider-6.0.0-canary.1db5c9fc8.0.tgz","fileCount":36,"integrity":"sha512-5Uh7nu6d4GZjC9mWTA08RYOvBLvaWZdO+0dAplYJkVRIuUwKmwG1WGWlcRHGiqHXrxKLg+UiZmowy74oCPsvMA==","signatures":[{"sig":"MEYCIQCge3VYBaA8DBZbgq9tDnXC26tMhz/b8t+r79MecZ/wuAIhALmsqZMNOWoHt01VXF+XDKj6CWUm3+Tq6xSSs8HfI3cC","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":369715,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeZ/qPCRA9TVsSAnZWagAAU0sP/i51t2iDs64JJC2/c0y0\nffC54KTLSk6LqSjXOcng9/KwCxXWO2EtKEY8NGaSsjj5qJ3D3mjO0lNexhb+\n1Q2fI6FxwQvFNMlrZeW3CRQ9wEQPwIcAGKE2o92/OmZwNPJezfu2FqqTXcBM\nWWewqswKj85GNmwepSBTA6jUtHUgB0y5A2BIRLWeg5nc74tRRHh3smYe1wH8\n2qrHMbllS1XLmDkvY24nlIn69OriPTFuSV0o0Z5wrYOnxKDm1dU1cidNssK6\ni3DJ5XSE/m+t9M6JhhFbPkQ4zSPwqh89COO084yDLn8A3aihQ5HIuwjTrN+1\nOzd6Y2UjAYZsP0nvkLhgLId7/QQ1ZFleSPyp9RBDXDu4DHxGMk3He8Idzv+2\nwJBDdg6BVgDvNesJb/nFsAbTvVhPHBI+CoS2/zv58Xtmk5wIBNo6mPqr1JBI\nmJi/DyNMrLSeSKFIqzZQoE/ZFMzLxJ9ShEYrb73Qr0JlTeqf3wGPHZwt3nOj\nJ2MH/wxkHc3vOmcyfEpJrbjCz4p5MLaFtMgIAKtQIXHOASvT1l7GPsie9TVI\nEukIUnbZ/ISoP8AShiaJTDGecXV21Ld2/e7dEbOrFaRvJ0ioXdHzSQI3Q/nY\nNKp9hcTmRnqbsiMltu/KYVyfH4TDBrAueKwqYpSAZexbP5MLhHpDWZY2f0jP\n7/+a\r\n=41Ux\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"cc90b13bf23ae60f937a981d548d55e3641c74ed","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.19.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.19.0","dependencies":{"tslib":"^1.9.3","@material/dom":"6.0.0-canary.1db5c9fc8.0","@material/rtl":"6.0.0-canary.1db5c9fc8.0","@material/base":"6.0.0-canary.1db5c9fc8.0","@material/theme":"6.0.0-canary.1db5c9fc8.0","@material/animation":"6.0.0-canary.1db5c9fc8.0","@material/typography":"6.0.0-canary.1db5c9fc8.0","@material/feature-targeting":"6.0.0-canary.1db5c9fc8.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_6.0.0-canary.1db5c9fc8.0_1583872655304_0.9966486116991495","host":"s3://npm-registry-packages"}},"6.0.0-canary.4971637f4.0":{"name":"@material/slider","version":"6.0.0-canary.4971637f4.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@6.0.0-canary.4971637f4.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"2a458d562069057cfdb7371f2044d312e1727f48","tarball":"https://registry.npmjs.org/@material/slider/-/slider-6.0.0-canary.4971637f4.0.tgz","fileCount":36,"integrity":"sha512-2sJ7iyoHtBsL5w+vJ2rZRxh4BNTlD2WxWGE89J4JnVqG9/8N4hYtgukrrshXeRmPaHZBfkPKL5XsdmJjr5Qluw==","signatures":[{"sig":"MEUCIDKKTA52Ql15R6sL5jvwMztOIH62IKti2sRQzdAZdcBzAiEAgGlc1mkiAGsrw55DCJ2rFKluwIUfp9cQQPy60CCilu0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":369715,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeaBuzCRA9TVsSAnZWagAA9ksP/jM0BKsOXWVX9eqIBVlf\nIR6AwZ4bsoZu+BDvByQOSHnmxG13tnWoy/ET24D+bcSAkwmRs3UtTAG7eDgv\n+xl5IwCWpQFbKtGzgRw02o6XXwukV5kZwlOEFchGbggEP9gmHBf37n5QHzaF\nNqHJg9BoT+gFE58py0er0peB/wBBQMF1EbfHzwJx8EqAAAC3+AFm8VrMnCzH\nRb+kbArCbakPhVvvMtTPjs8Z4TNBGWZf7R32iqHtfAsanaFen2lPHr00KRYM\n/S/t7H7KuL4G3nyy9lLEspba15EVHLulU1+EB9+r9YxI8DQF+48JQmd2fiZU\nzSKfxqz/bxZY0H0ZmiYfV2RmfUNLUG7gl1v8yBiDGnFGjEIpF9ivtxNq7F68\ngf3/eff9D0SCMG3pHLBzCoPxFUGaKkSGDnYLJwHtSaQZDaThT2JqLS42bfoZ\n97u2pmLCPPwm9SqMQTpFRqtKQos+sWzYghOtqhbQKa1F6dQt511Y5z7Qu5wy\nC0aF9L9qo250dJt/PQimEauABTj3zAEqxvmHFhokYxBEmHxYcQ/quOPsuhIH\nDk0gxRHfmYPTGi/AzJs4x+LT4WhD1J61fcgUiWTeQL39HFaV32q3TO0LUxrQ\noEXBHV4eopgOk/3HrO7s19w4ATK9JeiTVy/6HuEFHGtYyXJV/wq4zujcp+/O\nWn2T\r\n=Mqzb\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"4a67187585998b5863a9eb407a3ac0a7e550061d","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.19.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.19.0","dependencies":{"tslib":"^1.9.3","@material/dom":"6.0.0-canary.4971637f4.0","@material/rtl":"6.0.0-canary.4971637f4.0","@material/base":"6.0.0-canary.4971637f4.0","@material/theme":"6.0.0-canary.4971637f4.0","@material/animation":"6.0.0-canary.4971637f4.0","@material/typography":"6.0.0-canary.4971637f4.0","@material/feature-targeting":"6.0.0-canary.4971637f4.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_6.0.0-canary.4971637f4.0_1583881139498_0.9725819175609227","host":"s3://npm-registry-packages"}},"6.0.0-canary.1ae8130ce.0":{"name":"@material/slider","version":"6.0.0-canary.1ae8130ce.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@6.0.0-canary.1ae8130ce.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"1cb50bcc6a96d95353b7fbab6d169b76c225e955","tarball":"https://registry.npmjs.org/@material/slider/-/slider-6.0.0-canary.1ae8130ce.0.tgz","fileCount":36,"integrity":"sha512-o0R/vOqRzFbuOaWWUQR/m9DRHW/eNiP3r14VcJH8SRvqBXpuScDlcH0vUl9NBasacOkKmCPnDVLGgxln4TXskA==","signatures":[{"sig":"MEYCIQCXaAsW6KX9BE/yUQ5F4qoY4tPaKo0QL6xOC1qo0w1ivgIhANQZ6kqdhxU+wAh0TiOH6K2+LOK//Ep+mJw6KZ6+0m2M","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":369715,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeaB1LCRA9TVsSAnZWagAAoaQP/3blyszMvGVXSJu+mNtm\nP/tEtYDWE5J9V0S3g7GwF5bAQItbF6abusj6AljC0TjAWmLqNscGL9yuEOn5\n8lqscbYZIHU3vunV7xAHuCbhHeebo/RyP23AzXx+U/n/FDWWFPo0eVtTJQlU\n3REF06kkM5G9AFGegQr81NN2j0Ra8hpYdoQxEeeijZuU7BUxL/0OvsABs/iz\nQifU8cWH8zLpoxyykqBity3RV/3I//t9L4AXsN/oG7LqkV5a2zKpN+YcoxNo\nV9Lk9P6ukGJy/TGMhq8LeY/idbiZ4WaFO9fwQTyVbJZ8wY6XrHpUcn7ALlsX\nqrPtbEksHb7RNVi+X/d4Z/8zVt7tRCmgyCshHFAVcECUHuOpQc4ghpYPAfzH\nXU5CuwESERmqNZDommLxz78TT9oCdVzf27lT+5lENzsZcNcioEqtkUqtiTK5\nLyu7UHPWlhBeMXwOmAdm97wyVsrwKAvOeY7ZAq4FctfWPJcOD3uhRdnXp3pB\nTYFJqGZHCUQ9Nv7c5LZ3OH4gpckhyblRPgTI5XdjJ5ggceWiQr9jnfFamuSJ\nCfZr48JS9jcXEs9ZyahrWcIgvAPDZz6R32rq+IaPu7N196ptcMS6RCCuk7k4\nx/3hFs9VvVFHWf2CsEcsCeXwEFnrIOfGvtzKwbNWaskGeNB7He9qkAqzCSxF\nWjGW\r\n=Al9Y\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"e5b4831aec2400bcd99b87f3537adb62cf047dc2","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.19.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.19.0","dependencies":{"tslib":"^1.9.3","@material/dom":"6.0.0-canary.1ae8130ce.0","@material/rtl":"6.0.0-canary.1ae8130ce.0","@material/base":"6.0.0-canary.1ae8130ce.0","@material/theme":"6.0.0-canary.1ae8130ce.0","@material/animation":"6.0.0-canary.1ae8130ce.0","@material/typography":"6.0.0-canary.1ae8130ce.0","@material/feature-targeting":"6.0.0-canary.1ae8130ce.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_6.0.0-canary.1ae8130ce.0_1583881546903_0.1414180171698649","host":"s3://npm-registry-packages"}},"6.0.0-canary.8639c2690.0":{"name":"@material/slider","version":"6.0.0-canary.8639c2690.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@6.0.0-canary.8639c2690.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"745009c449abcee6a9fddbe552ae3015d19e6782","tarball":"https://registry.npmjs.org/@material/slider/-/slider-6.0.0-canary.8639c2690.0.tgz","fileCount":36,"integrity":"sha512-A6UXi/2PIWhsLo+aa5rbGx5bcZSSyM1nzj6jRROhpdKwU07EaqdQ6HdNdwW0BexxXZD1uANrtf8Yxe5PhUcvBw==","signatures":[{"sig":"MEUCIHP/hqCJsu1mRc05da+9pE0IEu+5qypWyMqSZ6hXPXZNAiEAt6o0HZcCGJWdz4IGRtXwDPCH7MZz0R+TWD8c5o018SE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":369715,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeaIZFCRA9TVsSAnZWagAA+o4P/ipRAzh+mkGgoTTPTY1u\ncgepHXfdoRtcI+CINjtPF+UBYhJcsjKL9a0EkIPxMsL/8EwSJCk+5h9c1V71\nTkWdS1FjKC/8e+NcbrgE4l6D/QuK2ovgT1FoxoD4As1CmZ8jdthyocOugieS\nQVJwVtOrfTbZz9TE+yaZczvPtvk7lftIph1F0sKb5pFfDscy/YHLH7PmjDLz\nh/3lmS0Pd9vrRGf4UMfnO6EPLDoLxxp/vmIIS5j5HtkHEEXOaJEtbjf3ivSW\nsfXnGEnpPEcx4Vv6TzOvaaoqhPtQ+RWGTSxJoXtSCdJ+yYl/NkWYE/kQaAJW\nmKa1nJ3vlp5kZXqeNmi1ag9JWvWWIp619imgBNM9SaRaTlLNduf5PEArqwCw\njHCVthrQSkj75/HpZnVMsDH+2KFqzRjmwMvWDyCTlUa+kn/gBLnxx9IBDfOr\nOCkWKsb013cW/+eiPUmXfEoQo8P5gZKL16+gECIjCYjrEX+xU1W+0WoEDUwN\nRpTXCiX2YbaWH+6U4cgb4P5q54CVHnhsvROWKVknP26tl7qGDBL362lMNkD3\nlV8S/d4xlZI4jPvSK916mClt6vFhA5J2F/VBABRqKOqcq5JPWsDDM5WsVH/q\nQcYgUK0l+Fm38LeXeI0VyM36m45AqSQvTN2GHS7rV1mtuM+yYimfms8sy4lT\nzBaP\r\n=Ugyz\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"3834dd0603f05e8710f74b00560d4aeb887e5b82","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.19.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.19.0","dependencies":{"tslib":"^1.9.3","@material/dom":"6.0.0-canary.8639c2690.0","@material/rtl":"6.0.0-canary.8639c2690.0","@material/base":"6.0.0-canary.8639c2690.0","@material/theme":"6.0.0-canary.8639c2690.0","@material/animation":"6.0.0-canary.8639c2690.0","@material/typography":"6.0.0-canary.8639c2690.0","@material/feature-targeting":"6.0.0-canary.8639c2690.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_6.0.0-canary.8639c2690.0_1583908421559_0.5432065114577875","host":"s3://npm-registry-packages"}},"6.0.0-canary.d5808057f.0":{"name":"@material/slider","version":"6.0.0-canary.d5808057f.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@6.0.0-canary.d5808057f.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"5f9af7f46c3657ebad13c457790e01c595f087d1","tarball":"https://registry.npmjs.org/@material/slider/-/slider-6.0.0-canary.d5808057f.0.tgz","fileCount":36,"integrity":"sha512-CBdW1ehSpX6Pt3i4VV73t8y7tbA3X4quZpWztISPpGxfOrva3fnOBxKUOgETVL15i8FKNLJTJxkhEcCA/p3RgA==","signatures":[{"sig":"MEQCIAYhG15/YVsO4R/HHhU/Uz3xNta0k++INyRiALZqJ/doAiB8p3CU1vYxowg7BXOCAQlnZTyav4YsAMFC7TzLJVQY6Q==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":369715,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeaREgCRA9TVsSAnZWagAAdwAP/jOT3IhJoyIWmjGXEeLR\nTqf77naa7M0S6o/4Be65aK1tdsth9JNcbUI/2fmd46N8iZ6q5gKZkVz+HZmb\nLsdcDOhBYUMZizHPb732JVV2dS2DwTJhiBGWtSbrpO6+ZzOz10Raa8ofT7S6\n910VK/h+Na6W+YIbPvTnOerlQo4Freofm9EGOAJ/rU/JUgpc0bN1lYXzETGq\nIWGtrSebiLQexsUbcG/y6wmiGy+wLaehBHCSjCzROQGGUOhTj0yD7rQsufbO\nRb0hoWOeepkrsjgQZoPF7az7UR86jNG20miI78SXPrvXWXIMebW2K6WBJEMe\nEcgOBixMuAs1EdmVjvAOwTd+wxrFzHJaDRn3Ygq9SoKQzru4dJhLg40w3WNv\nl5R1zh30/wt+c2t8idiaSF8SZdLerplFcWYcWkNVRh/S4PNn2sMjqgytNVwS\nIIlkLhGZ+9Mzjrh7F5A114eyYo+RA8euJOJaXx4YYjnI5DgRbeB0QVpKYJgy\ndl0tJdcaWPszmEccz+sl81F6qF70uxDbxLEBRO8Fzq3C9XuFCnnF5WerlvZe\n+Yz9CwAqLxjlB3y9CDzezZAfY7D1rRmZXpgce7+806pKWtF7i0JMHjK/J4Ru\npD+E+MM5PVbAoj7uLqd+LRHtOHt1NC/B+zlwECmVAi9UY76asvVsMXQPc8NW\neD5q\r\n=iZ2p\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"00a6ffbbceea71ed3f3126dbce724119ddc06379","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.19.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.19.0","dependencies":{"tslib":"^1.9.3","@material/dom":"6.0.0-canary.d5808057f.0","@material/rtl":"6.0.0-canary.d5808057f.0","@material/base":"6.0.0-canary.d5808057f.0","@material/theme":"6.0.0-canary.d5808057f.0","@material/animation":"6.0.0-canary.d5808057f.0","@material/typography":"6.0.0-canary.d5808057f.0","@material/feature-targeting":"6.0.0-canary.d5808057f.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_6.0.0-canary.d5808057f.0_1583943967733_0.19736108963876364","host":"s3://npm-registry-packages"}},"6.0.0-canary.b3f58203d.0":{"name":"@material/slider","version":"6.0.0-canary.b3f58203d.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@6.0.0-canary.b3f58203d.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"fba222b03738514b4b6b4b36b2f25aa1b4d1848e","tarball":"https://registry.npmjs.org/@material/slider/-/slider-6.0.0-canary.b3f58203d.0.tgz","fileCount":36,"integrity":"sha512-stmYsHKd4msaQZrZiHpOUKOgTC0sprDjpnMRNzWi5CeC3f28k11jUvU1NRQERVKIL6HSguCkibl4TwJvkQzmNQ==","signatures":[{"sig":"MEUCICixgTrY60EkavWMcMHulvuCEXbYzXWxNfBfQDR8In1gAiEA/Duddzh6mA+YR1YYQvNSjI5j6l8lJKQcPoUHnyzrOlY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":369715,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeaT4zCRA9TVsSAnZWagAASvAP/0L0h7tOa8eNiQ4O4raY\nIoYK4VGN9pfJ4iCd4qhOfEW9Y5H1MdjL7wNQzAjCT+4bj2qB6mryg3SXbB37\nT42cqO0jymlJEf6NGpbnz5vTfZCHf1rGNX92U7lbbOBYEdWCedtEkKGO+QhI\nDnhlpmjyZ5M6w8V5tW6QXnBz1UzWvkfOryz51Tk03QSt2bJCM9M1IWKZdxSH\nJG0dEB1Qx/3nT6AnnrelA1aTLtlaaevT9LD7FoLxx62zuDWIVhKbDV1wIc0f\nfCSmoWFn0MCzFUws43ftf7SidHGbbziQMVWfmO2kSuMciQJxlLuI9371KXbV\nwsI8y+avN5Jz5l5QpQmGYYn1RUhRTcpHE2lkKbEus1cxFowAxRvLuoJqtnqE\njYfx4Z5yU0gw3vevmNQAHzJ4K2OCfJ+o77lzhbGBcmpYFnZds2JIcDTWii03\n4/dpSUA/Ms2YrQ50FixpoA12R5Y4C5+FYyuXNo25XfAy5p/+pSDK8KPbB7rZ\nt98m1/j7HibnyXte/gJdPlUSKYs2Kd4PTwoSyKrPx3DLWWvGFAMPaLoYRLSh\nrrVQKvbdapFr10h5gociDcqMTi4hB7QVWHqjD8kjoKTOhRoHu1vSEga/2tAI\nHuz/8EiqWIdfRjYz3R8/BDsvBO12E9lLgkxq0a4uv8iwdJ6nQLdvyFdxQRaO\n+qSv\r\n=V45a\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"b9ad376b2ebba49982e9b605c903e752e4fb28cc","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.19.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.19.0","dependencies":{"tslib":"^1.9.3","@material/dom":"6.0.0-canary.b3f58203d.0","@material/rtl":"6.0.0-canary.b3f58203d.0","@material/base":"6.0.0-canary.b3f58203d.0","@material/theme":"6.0.0-canary.b3f58203d.0","@material/animation":"6.0.0-canary.b3f58203d.0","@material/typography":"6.0.0-canary.b3f58203d.0","@material/feature-targeting":"6.0.0-canary.b3f58203d.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_6.0.0-canary.b3f58203d.0_1583955506785_0.2497469634539029","host":"s3://npm-registry-packages"}},"6.0.0-canary.bec065920.0":{"name":"@material/slider","version":"6.0.0-canary.bec065920.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@6.0.0-canary.bec065920.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"b136f0e05333b9b854d5b29d54d2ed58d2699e19","tarball":"https://registry.npmjs.org/@material/slider/-/slider-6.0.0-canary.bec065920.0.tgz","fileCount":36,"integrity":"sha512-gRUOKl4+iVtZqyj7zOnYXeeOzoKLW9aXJsj/EW+PgAhyVOLbswrdQ/DlX1wRUJu5d3LjfHP1OSENVLlLCI1ILQ==","signatures":[{"sig":"MEUCIQClczwqE1psNY8F0YlSg+mpziW7iXB4VOk48DQZc29ikgIgTkVQ1MMdQe834Xos8jV+hpV4CTcdVtJh4PH4XZ3TaMc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":369715,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeapmOCRA9TVsSAnZWagAAduAP/2J5HuaaeWUjsPcYmLPj\n/VjcX7jidfZiwlyoERMttb4FpB45t4ELjdjhPZOzLYcE0n5+SSXQmuJhSQZ7\nisZN8wCjMGEIcuO6QVFmE3XLCk2c93aQaqgdDOh1eQ0klGPSAvCEfa8wqj0i\nCFOCM4FDf6py8xLkP/dvMDfT4FIRStM0MPwmK2tj4ZFFuy7EuPRTaxz871Ux\nYwBukr8eODDufsv9pvznciG8s2hA5dxERs1xd4Mgn1wy1n/afm4wSe4HJ047\n2fc+xb/qgIP786ykcT5MRyibd8hOBcrneIEWKG9ERyKXEEAEqe5KhDAOWPCN\na7xr55PEShKaRbxl0yOm2Wjpy1tWHIEgYK79Ki3JlPvus/WtN8TjsuPVMQEd\nfGhsikQE90F7GWVFba+ZH7mwIDJGjtZPuz7OpKHcqcZ/vUFGDPOOZ5ltbmeK\nnESGASUcM6CCBptGesY8gnJY/zk7C1AVjlnLyfjIvg50bdGt7YeRAl+5ayCv\n3freLfIyl1+2SMXsk6NLSvnJ8+2fYuN2Zl+4te4BHKA3JHkTuXynkIbFnsz9\nPcwRNmaa9aWyLnHiXy7N61SPLR5D8/M2z+eMY+I61pzGSg0fIK1gStG1YO2i\nQ7qkAuKMjAjh/m1ny5stMQwhiT02BXN0e1a4DQZgq7GdEOrb7pe6qufZU+y6\n0NAW\r\n=0OyE\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"ff203cc1a864067909d369c1408fa7ce64954660","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.19.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.19.0","dependencies":{"tslib":"^1.9.3","@material/dom":"6.0.0-canary.bec065920.0","@material/rtl":"6.0.0-canary.bec065920.0","@material/base":"6.0.0-canary.bec065920.0","@material/theme":"6.0.0-canary.bec065920.0","@material/animation":"6.0.0-canary.bec065920.0","@material/typography":"6.0.0-canary.bec065920.0","@material/feature-targeting":"6.0.0-canary.bec065920.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_6.0.0-canary.bec065920.0_1584044429880_0.7520952338160485","host":"s3://npm-registry-packages"}},"6.0.0-canary.776291ef0.0":{"name":"@material/slider","version":"6.0.0-canary.776291ef0.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@6.0.0-canary.776291ef0.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"f5520dc8b078374a4a5eaa103ea02c1c64d34862","tarball":"https://registry.npmjs.org/@material/slider/-/slider-6.0.0-canary.776291ef0.0.tgz","fileCount":36,"integrity":"sha512-1c75DM6fW5WcBu8sKa3b8ja7oER/zzSONK2/BBej91668khLjQXa/xSuaXC8UjcVIqzUWb+z8OxtzoW4zAT37w==","signatures":[{"sig":"MEUCIQDQpgvFeTMpc8ghQv57AWocju8yVYtI4bX0tm/JPJ/PlAIgMjifaBncL0ODuBf0oHKAvgzpdtzvGMfncT37gFsYZqc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":369715,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJecSMRCRA9TVsSAnZWagAAoYsP/1Urjt8ciSA4dyN7Vso3\nt0XcXjOHMYt3+QEP4zvX5klYDiJJWIChlQ8IcRNzxFVxCbiGrENOnOyiqAVZ\ntOHWyZn05djVY2X8dR7KmV3JbEyAthrIx3aiY8J3tSEYG+/sPe18vR5XM3J0\nRcsSiQb6nklNOP0KMq188ttSwIVkDNp5oNH10YAEjcWw8WLzI46kpDDSqwMM\n2rGkNCQgfAUWDYeT5j6sm5AVjV7eQiJSZpcDrwNinEyZBt0bSxZL7NjPcKcp\nEek04yQMV6ywufJPOvTM7m4KYrNKDTsQakk5Z2YrbGi+5wQu0BS2NxP7hy8Y\nogvu0lp05EKkGc34yIfKWhy2mq2608NGbBqCH61QRSGm6shIuHytOhkEs8ed\nN/To/VWhVsuxVK/p5kk8oe8/hs9SuE2k6zqUoUtKFRYemTS/kKxsFsVhQRXR\n2pAjXkfS+VaUz/nk+iJgZcY+eYEUK1qesd2vx24bzAGmmoFR1Z9KoKPEsFa9\nyjlTBYpQx17s3hc19JrwI6OSXyw/cv30YWdmSI+Ts0590pCz96Eta3+lHLFD\no9ehe7jwamZF7zSFZXiBZ/v0Ku/pASSHYPVWQSA9/dpuzLyjUaxNVNApg+gU\nAAuvFICMqr/PSbWVFixYvXWaLVSrJ+f9x9W5aFx+gigJVaFZTXVZIdo0F6u0\ndCF8\r\n=JlZr\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"32f95102d2dd047c662697060685989ec64bb05a","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.19.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.19.0","dependencies":{"tslib":"^1.9.3","@material/dom":"6.0.0-canary.776291ef0.0","@material/rtl":"6.0.0-canary.776291ef0.0","@material/base":"6.0.0-canary.776291ef0.0","@material/theme":"6.0.0-canary.776291ef0.0","@material/animation":"6.0.0-canary.776291ef0.0","@material/typography":"6.0.0-canary.776291ef0.0","@material/feature-targeting":"6.0.0-canary.776291ef0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_6.0.0-canary.776291ef0.0_1584472849376_0.08944294117069762","host":"s3://npm-registry-packages"}},"6.0.0-canary.ece19f3dd.0":{"name":"@material/slider","version":"6.0.0-canary.ece19f3dd.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@6.0.0-canary.ece19f3dd.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"14e8bb44e32eda309d35de788c076008a532785d","tarball":"https://registry.npmjs.org/@material/slider/-/slider-6.0.0-canary.ece19f3dd.0.tgz","fileCount":36,"integrity":"sha512-gKTSYwWnz7GAAe9P/5KFh3hcS6Pb0E5x39dg8tgu8XdmsFVOHETsESPsFYZfhf3cqDXlK48FNwqLwxltN+Ye8Q==","signatures":[{"sig":"MEUCIQDak6gYlk7MpdTX/ytbmVONQqYTZrbYJVhvDDHgHu+XigIgCrMIG34YEh3dDNzEv3VQ8ySjMIdj9hawQXozNYyh/3c=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":369715,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJecUi/CRA9TVsSAnZWagAAHkgP/1A45GEemdXJgrf6hPUq\n6N7ExoltEW/CjAgJDFc5bLMv66k+edbXucKWZTWGsPaDOguj9lTRMeqXaYgU\n1LxqX0XC1NM3A02jmK7RL6DB41eol0sQD/qPXlFawOSIgfekyHed6lcEB+Jq\nRPIfmDEi2GIq2xs1jED9s9XmAepat5NBfqtmhC+H7qXCANzAyzYSuJTeqVPj\nxywxSISW6/V2UyczMK2bremFgzaq0E9VDQ5spSAYhO2uUGIwLH2lgmZIWRBG\n8OtnydQbEMLfkLKL6X5cef1P8Q7uLnvDeZI4Saare25gvuI4ErqfyF3Zcu7l\nQZ1xzbk7NjsZACWgIdQV1zvsSY9mfsyO1ZkpMLXzLLp21m06oQhG2K6fYhvn\njcLQa+nhgSYSA2NkMUpJ5HGaDnfIbkrYOjKvbRrhiwZTYAuP3d+HnaOMiaL4\neOmmZTYvRJ6ABjeYOLQzACdNuS1f4H3yV7ljU3hWYuP2W/x068OKds6ZxtXC\nEdaWn1bHb+cMUXUJZYEiizBJv4XMPZWNys4pmkQ6sln8iooA4XDnJMGgNk+g\nNOVDnguxlht6o7erLfEL/ePBzVrgd54QY3clyY6oubK92Z5CvkhkYILAspwC\nR5f+dHvE7d15x4anof4kS438NhaHu3kKBVadI61d+E5fyRw9fWL6xIRltA5A\nisib\r\n=uN/M\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"41a07e9906ac09ddaefa5cbf8327260df4eacd59","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.19.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.19.0","dependencies":{"tslib":"^1.9.3","@material/dom":"6.0.0-canary.ece19f3dd.0","@material/rtl":"6.0.0-canary.ece19f3dd.0","@material/base":"6.0.0-canary.ece19f3dd.0","@material/theme":"6.0.0-canary.ece19f3dd.0","@material/animation":"6.0.0-canary.ece19f3dd.0","@material/typography":"6.0.0-canary.ece19f3dd.0","@material/feature-targeting":"6.0.0-canary.ece19f3dd.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_6.0.0-canary.ece19f3dd.0_1584482495098_0.16459742777067676","host":"s3://npm-registry-packages"}},"6.0.0-canary.4dc45af6c.0":{"name":"@material/slider","version":"6.0.0-canary.4dc45af6c.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@6.0.0-canary.4dc45af6c.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"2f1740f72c5c6778a4f19942cd8840e7d884aad3","tarball":"https://registry.npmjs.org/@material/slider/-/slider-6.0.0-canary.4dc45af6c.0.tgz","fileCount":36,"integrity":"sha512-7apiq6e6UMucMcfm7K9u/d1CTXfu2JwBjpTJBM3YfrsvQb8AYqKOJ9bcp2JeeabozDHVjzHopIrh7D6r6B3qAg==","signatures":[{"sig":"MEUCIQDKEg4CbfK/HL6m4GFgN4LzyJTbtxxCsjnnxK1jzmKyCAIgI4PGxaLEvm7vFSu/pqknW8JTjCV/qtDfLRZOwrAaKpU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":369715,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJecX3kCRA9TVsSAnZWagAAb+kP/1COozkuFR5aDEmgd5U+\n6s8lBA1NcsxAvl8QIs19FTRDW1ZvZoOaI5lbwVuDGowRT741FH0IpzXYBT7e\nNjtng2pd8J8juMksniKEkqn4PdvVO/kyAe23vR/vstKlB9SJa1UszU6iwwQ4\nE3/37uG8897NigPQ2WKfm7cSUg01PeN/oRAfN3n33+NdqxTqrkPW4c7GyBne\ngE4BKxwss7i0LBABpi4YxJ4sA/yOpoWWQsaeAaFcYOrda1jqJOyDt4b/JpjA\n2js9ei4qkJDwDjShvj+5gT5MaSPQU7NrajqhMMXb/Fkp9MhbeXLC3/TWwc8D\nCPq7xIDVGmVzKxA8fLgVBPWks3Z68ceKW7VDFqRsKQ0FXiWJcTf8kNtlA+F4\nOMmEz4Adb0cDXHWlvcAy33xPYjDgBH1ROMPuivVjCl0vs9CTE7cqXwsezEGK\neVhNwpZ//tGTHQF4mlwuFvs95JabfyMlAibvwZM35Sk/ojwK7y2FEFQyAbjz\nZzE2msMSxJiSJmo2qyK7rsrZbXYxaPYtYFG+1IyjsgiwI+EbSWeF/hTcep5t\n5gxZA/oKRquyeVsO9i5bsp7aV1pnDQdqYOdhSyXhhk6X7BfrjoVHf5ZBDwcW\nfx5I++VTGTnUsKBMj5/Tsefz78BvFcXgYmb/kPvnXFPMpvlwTMAZgBtzNgmI\nh5tA\r\n=IBrL\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"a2b97fbd4b046de86f7e8aac6b54c5a6d31583b0","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.19.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.19.0","dependencies":{"tslib":"^1.9.3","@material/dom":"6.0.0-canary.4dc45af6c.0","@material/rtl":"6.0.0-canary.4dc45af6c.0","@material/base":"6.0.0-canary.4dc45af6c.0","@material/theme":"6.0.0-canary.4dc45af6c.0","@material/animation":"6.0.0-canary.4dc45af6c.0","@material/typography":"6.0.0-canary.4dc45af6c.0","@material/feature-targeting":"6.0.0-canary.4dc45af6c.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_6.0.0-canary.4dc45af6c.0_1584496099389_0.5252066357704182","host":"s3://npm-registry-packages"}},"6.0.0-canary.6b48781bf.0":{"name":"@material/slider","version":"6.0.0-canary.6b48781bf.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@6.0.0-canary.6b48781bf.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"913394dbff5e1aa833fc63d2784b6f7e8bb4e773","tarball":"https://registry.npmjs.org/@material/slider/-/slider-6.0.0-canary.6b48781bf.0.tgz","fileCount":36,"integrity":"sha512-8zbUqGOwdqrKOC4FZzKyh6eKT3jJURkEP3N+6P46TFK0QbYszszcGtS2wROP8S4ZfSP109tZkyhHuxLbz7QiCA==","signatures":[{"sig":"MEQCIHRvoMa14bRaD5af97/tGvoc/M2WaM5ZIpFR8IDXZumEAiBjL9PKS6T2XLw29pUFdYRn3l3wter5zyAMvhuGXoF4LA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":369715,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJecj+wCRA9TVsSAnZWagAAtKIP/Rkg1A5B4V0ZukLxk1jr\n3GOD1L3xcOjII/dE+stDh6CZoYyzPTXhp1UveOjmPN+uXy3rONGxlaH0gVA4\naTbqDJS6xlZ4eG/xrCLki2g6hTxVJ5F+YF0cH5igr1U8IqkK28c5Y6ZOdwGG\nIvzG3kyuiwO8E+2+pcMHGOLZ/QfvhX+H0zAbrwQf6iF6teJHif+fapnfC7Vy\nxnedzxRiBzKsifxGTn60rYuCaUkj5dMwq5ytBPfJ0dEVtTpW7vdRH1oWTz2w\nsdqt1ZUKjD4t2vSaAvcTyVNmdh2y7sW5hIkNV6BLFWnEBtPjjTuJbvbfreRe\nmVJMWfnLBi5wA6wpA+NLJPw8rM5JBj3sNiRAGKJPjBypTziUYa/oBVLfvpBa\nxqA43eEP6HSGKz6Wj/zokM9bfTA4RFDZNfty2oXwadcZCVpwKSBGsiJs8GQs\nQtkLjXfCL++VmZ9jmOxgK5/xP/QCD5h2ckr2DCtEjaHG4gl18Y/Wq41/mk8o\nk32VkHktZV7um2Mzqp7gqUj1uMkYIpHCqcpFZi1gNRVnlOSJ0R9IGfbsKoT8\nD+4EvKjb97v0QRuRik+UDQYwkBy9PF3J0wV0JMnTZzwlATZVaJaD6vwEQhvj\n4SH5+OsgGeWfe3mwZ5Z/ZUILlEWlqjNc2TcYOuIbF4u4OLOFNjkPPG09QGQ8\nCTE2\r\n=AOkX\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"1da9fc619190678090689bcdcd73eb5885c8a35b","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.19.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.19.0","dependencies":{"tslib":"^1.9.3","@material/dom":"6.0.0-canary.6b48781bf.0","@material/rtl":"6.0.0-canary.6b48781bf.0","@material/base":"6.0.0-canary.6b48781bf.0","@material/theme":"6.0.0-canary.6b48781bf.0","@material/animation":"6.0.0-canary.6b48781bf.0","@material/typography":"6.0.0-canary.6b48781bf.0","@material/feature-targeting":"6.0.0-canary.6b48781bf.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_6.0.0-canary.6b48781bf.0_1584545711927_0.21735809274975093","host":"s3://npm-registry-packages"}},"6.0.0-canary.a88c8e4dc.0":{"name":"@material/slider","version":"6.0.0-canary.a88c8e4dc.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@6.0.0-canary.a88c8e4dc.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"b1eb163cb2c921ff7614a2f80d0a84d75dd85460","tarball":"https://registry.npmjs.org/@material/slider/-/slider-6.0.0-canary.a88c8e4dc.0.tgz","fileCount":36,"integrity":"sha512-fyAwf9xmGwSSKApCNUCqViRaPTXp648f0k9tq6r+X+zhgu36ed4DYXPt9Xem12/6OQ4FKkjDtxGLUMqTQFfZlw==","signatures":[{"sig":"MEQCIAfBfa+J8JdKC6Ho/l+dBLqiYtrzzkSQg5ncWtroLWoIAiA3yWNXTUeme7s+DBkJ4fFYZBHeLtPKztGzeMWy4+PkJA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":369715,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJec62QCRA9TVsSAnZWagAA2joP+gMujg8wGaiLkreFU9A9\nAv7gCHby+j0IysDq51I0bAHj4ZjNZFxo8e4hMVn6+sauyOfciPInaZRN50oH\n6MkC4ncyJGZemvwD6ehu4JzYUi2cX3njSqWpDc7psnH4E1ar2tWJBLb0vk7x\n+2pn/19t8oiXqMF+GQwN9v6/jn6nNaqi4YPbNfp1gn4P7X6eLKxDXb6KKTuX\nk3ZDuNyIn9t+IU0GECqmQKluzROInXSEnq9rm4+f0XkzX7+Sm+dhoZq29l0M\n0jLH9FRQDcejQDT+c+Gex3QZ3IEe7OcJfYoJ5SHyv9KWfrejJGWgL9CyvjIR\nnOvDDK0BgSJTJG5l4FD3MdlClh6U/zowGD+mrxpOvNGgd4ol5/6Ed2+1rk73\nJSm3nrLYCxmHKzqrw1HSgDsL4G+9e1M4nK9qtl8QuJL1QeTx0zuC5RIBtZqk\ntTKDWvPmz5IbYIgEwgB9pB5hoeGEC+mCGCkq3XjN/rv9W13sfsYTOzwo+ERT\nMAHa2pFaJ5JOpzJazaxq6xa6Jm9Nzm8d3lN2YGAlQoF65qMREJ421YuOtxOy\n5ePUk2JBENewGO79jj92kbvvK0XArRxzxzUKe05V5ic/xm44xHDdLQa94dC6\nvIFz8Vo7J2SXwKmhdGM6aa24tEy1ufbxyWFeRPJJ5+70alyOKrcrbsVfh5/v\nEw7x\r\n=NyM2\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"3d8bc73a5f46456d2ada622785f02cbd3b81c6a9","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.14.1/node@v10.19.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.19.0","dependencies":{"tslib":"^1.9.3","@material/dom":"6.0.0-canary.a88c8e4dc.0","@material/rtl":"6.0.0-canary.a88c8e4dc.0","@material/base":"6.0.0-canary.a88c8e4dc.0","@material/theme":"6.0.0-canary.a88c8e4dc.0","@material/animation":"6.0.0-canary.a88c8e4dc.0","@material/typography":"6.0.0-canary.a88c8e4dc.0","@material/feature-targeting":"6.0.0-canary.a88c8e4dc.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_6.0.0-canary.a88c8e4dc.0_1584639376251_0.2025854451178446","host":"s3://npm-registry-packages"}},"6.0.0-canary.cafe18860.0":{"name":"@material/slider","version":"6.0.0-canary.cafe18860.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@6.0.0-canary.cafe18860.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"8bee5208b32a271bd44a2631e7be418bdb5e6794","tarball":"https://registry.npmjs.org/@material/slider/-/slider-6.0.0-canary.cafe18860.0.tgz","fileCount":36,"integrity":"sha512-4p/gS+gDxHfrd8d1WFmdFgxsH/LSuDEEEewGpR9z0BnyaNTo2gM6J3IbjFW1P3nm0533datIr/r1fdKQ02arZw==","signatures":[{"sig":"MEYCIQD1lbOneCsFdKyIDm6UzL6vHGKoL4xFlojnAQZZ9cRtwQIhAPHsXlL63SGiRDmPKm6Sl1uLyLt5jmzrRmssbWKp6pJq","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":369715,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJedNkCCRA9TVsSAnZWagAAiRAP/jAE4v6nkg4dtUfj+hX6\ngnZh/DIzbQbVYBtvsB9AQRQrJFsFeie3vTjVU260/ZZMoViDxJ8kAkUkkAdV\n5mLBbAuO3LxERB/fXmqVI7mVAHoVsErx5hnGYXPbOpa+I7bHqV+QyblaQLdb\nYcG6Bd9+2yofDTO7vy1LtVWrCcRliRHIh6yhj8Wlgp2nf1Ej0Rj0qFMBCJw3\ngv4mge6qZpH0F2LMjkIV062r/Dz48vNin6sYk0JMaZtlTwLmr6V3rK/h+nh8\nfSUHD8XvcqKFOvH5Ym+dvVcVRybEqJBiYvKMeHdbHz0VIrm1+yzy8XqlvalH\n++u2aUs+Q7gGW9y2iah+qyzzWbMkWlq9bKhwPPdaJLaggdPx/bkX1jlfVn65\nbx7LsiO19z1xvsxTMiB/IWeO4ZUZkDL8IWMaHkmfbv4hYChfoAXAcHubPyUX\nTFYXdAGDfeGeu7fKnNJ1lSWrHjo8AA7uX3O6vASsd1i+hMPdj3yL7kH9AbYM\ndREh1AP+EM+sedi/NjZyRbWWGXq2/7G2H2I6bl0Bz2uCZLgffTGNygaOcgD4\nNiKcc0egrskwBSg23E5j3V6vdI1hhZpBQJzRFn3jyUhEmSG+Tz6E3+t1dWq6\nQ/XvipKznhHbNWnm62s1bMn2q6xlZ3l/ACXVyg5JUzMxuSVFXLUTBAVLX15d\nHFoG\r\n=OicH\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"51706b933143947baefab6db8cd069a22ed080ae","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.19.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.19.0","dependencies":{"tslib":"^1.9.3","@material/dom":"6.0.0-canary.cafe18860.0","@material/rtl":"6.0.0-canary.cafe18860.0","@material/base":"6.0.0-canary.cafe18860.0","@material/theme":"6.0.0-canary.cafe18860.0","@material/animation":"6.0.0-canary.cafe18860.0","@material/typography":"6.0.0-canary.cafe18860.0","@material/feature-targeting":"6.0.0-canary.cafe18860.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_6.0.0-canary.cafe18860.0_1584716033573_0.9815851316158082","host":"s3://npm-registry-packages"}},"6.0.0-canary.35a32aaea.0":{"name":"@material/slider","version":"6.0.0-canary.35a32aaea.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@6.0.0-canary.35a32aaea.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"139869de84add2928dbd877ce406f4eeac4b0560","tarball":"https://registry.npmjs.org/@material/slider/-/slider-6.0.0-canary.35a32aaea.0.tgz","fileCount":36,"integrity":"sha512-vGZ7pZdngFuFFdJVvKR4z/4YBmnJ3qbeGbiSwatT91CYQgJB3eAoCBTeAWvK5hCPUWgmiCW+wOvyZr7yBC7G1Q==","signatures":[{"sig":"MEUCIEM0B3iOng3s1dXYs91j+vQmFds4XHSG9wRwP3hv8upDAiEA7mE8k8/nH5k54PX2IlUUEbm65ESuGLdoGU34J9VzVIw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":369715,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJedSCoCRA9TVsSAnZWagAAxBcP+wec5AL2qWx+0wHsdx1F\nQ3Kce6gf1fkNO7W4JlDfxYQWvxSzScnj4acG3Bak1T6l6eq39ahScqOErCrc\nZmrCW1x8yQJyWl9KSEN9fLRLiyTN+V0Wj9OloGDKVxggGE63N7sJ5q3BpNVB\nmNRpDERujYRQBaXlZtvxjy2IhyWJi9mqjPrGdu5CLO92eoSdf5haCrC0pFrr\nW6xRkLH0c2UeXX1GisoVuKRtbIUdyFlFPI9ww7990APHNkE6XyvRBiP+PXud\n5W982T+uL+8RTOiICDoNOSKt7y0JuQMEGLQIe2nSK5Hg4IHzNK3EJ5Di9akR\nWW5hQPkj6h6CW/owx2zH5JJnF9kD365ATQUxx6gCZfHqzKHgVjQ3ZIArTls+\nxCCOIP0QFOe64SLEagybscgeee9u/BdqCbtha0cR2Vhi9EArcEjRuNhiLHko\n0zmrim6P7gc4v4r5G3qHYuQUV8qnswPaHdI/rhlLywXYKXZQdlHvkgC4jZKM\nqQ81trTRASvyW9qJMym44x/gr2IIwW1v6C1CvmeIFEWhqWlKH2LXNJ/Wevbi\nVpLgts00MnksjBzPWhoL7PZcR+HFI8IPsQ5+8pVwap9J98pKdvhJYGugU/Fp\n1PPDPiXHOhe5doWqlwyH+BvC23BIKDG5yf1NSchL4qt1ls+Rn9xIWG9Tv2nA\nGElp\r\n=H7as\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"09df3d66223ea8f4d4a6ee61b9e34bfe08387774","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.19.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.19.0","dependencies":{"tslib":"^1.9.3","@material/dom":"6.0.0-canary.35a32aaea.0","@material/rtl":"6.0.0-canary.35a32aaea.0","@material/base":"6.0.0-canary.35a32aaea.0","@material/theme":"6.0.0-canary.35a32aaea.0","@material/animation":"6.0.0-canary.35a32aaea.0","@material/typography":"6.0.0-canary.35a32aaea.0","@material/feature-targeting":"6.0.0-canary.35a32aaea.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_6.0.0-canary.35a32aaea.0_1584734376228_0.03047645772907015","host":"s3://npm-registry-packages"}},"6.0.0-canary.e75deb854.0":{"name":"@material/slider","version":"6.0.0-canary.e75deb854.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@6.0.0-canary.e75deb854.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"81c5c383c899421b47ee1e4b51054772c79c2619","tarball":"https://registry.npmjs.org/@material/slider/-/slider-6.0.0-canary.e75deb854.0.tgz","fileCount":36,"integrity":"sha512-cK/8nbEQ738WcPSleOmYh+YevhfYtmeYrnDHLGVQ4WgKXg+tKOqhNLfGGCXyK2A7aLlFarnIIJ04JNQ+UbOHqQ==","signatures":[{"sig":"MEUCIQCOpi8DNuaLf2VKeFp06K+WAXDISmNV0HXRHgKlTS/udwIgK3MkVSnLmyPiCfp/OSwJrQvFyi3uPQOWrvzEUJY6dq4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":369715,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJedUCMCRA9TVsSAnZWagAANEwP/31ARoH3s6pEtDtNN/Vl\ndF9P+dGuh+3Ai19HcgjffXAUS7wlh6FkjrdNTALzechdFtSFlyFdofarjY2M\nZflB09q83+YIlxmcixXa0fXrnoX9ptkkqC/PiB11DKTHRXFTbmooj+eS0ay8\n/B+JBVEKV3kFHC1kAO8kq4DSzuABsBaBGGV1pi5ANQvTNtcNfJzfvSKfxnzv\nNwwbC9BGugFX1d/ber2xFNqZuQ5ZihBfSunWFSCeBCNvEjVcLyxW3CrHI+Dl\n9z/kOZQTwQmgcme2aHqejlUMlI5ZI4fC4aTF5OT3PC5WPXSI1Ap1Hc8MSmCo\nynK7SQZQWcI9QPRqbKNtNfL8ngawRXcqpT7++h2uq8jkNzePHvBa2gtOngsp\n3Wil5vu6mglBz31cb7nam7JlYQc603Pxl/180JvCSx+1crHtCMDuh1D7pST2\ne6TTsfa57zUEz4pflHIWkpoDS0338rIS7pYMPMnYDfXnmGkvogcAtcr7xdnG\nXf1FR25lTWcOlcrdMgd3bmVmIdc8BHoWPVbfYdNiRs7eg4BjJWjHD1+5bmzm\npLqiVeOG3XAqjwaNM/2XpEzBLCJ5SYuJ0RCKeQZWGpzDY0nGw9bpmu/TcvZN\nvcR6+lnPkIp0Ueuei9NL89UGAf71eEgckuE99WryPr5zveCMsL1ZjtnCbHvp\np9F8\r\n=QIt/\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"a461f6b9120827a65ed980dcaae3ff77d0581d82","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.19.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.19.0","dependencies":{"tslib":"^1.9.3","@material/dom":"6.0.0-canary.e75deb854.0","@material/rtl":"6.0.0-canary.e75deb854.0","@material/base":"6.0.0-canary.e75deb854.0","@material/theme":"6.0.0-canary.e75deb854.0","@material/animation":"6.0.0-canary.e75deb854.0","@material/typography":"6.0.0-canary.e75deb854.0","@material/feature-targeting":"6.0.0-canary.e75deb854.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_6.0.0-canary.e75deb854.0_1584742539650_0.46100952542121076","host":"s3://npm-registry-packages"}},"6.0.0-canary.2cc6966f6.0":{"name":"@material/slider","version":"6.0.0-canary.2cc6966f6.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@6.0.0-canary.2cc6966f6.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"06b55abfc4e49ce725f8bb72bb29b9fc1baac4de","tarball":"https://registry.npmjs.org/@material/slider/-/slider-6.0.0-canary.2cc6966f6.0.tgz","fileCount":36,"integrity":"sha512-NE0HV4QHCWckejaDRbUrqXPr9/aSCit8GxGLKl12fcv5LpLUKQrZULYA63I45lvP+cnMIxB6NJSAHatRM4S1NA==","signatures":[{"sig":"MEYCIQDLR2iRtau/kIG/qNUYNrXfGUXnN9SYuXBulCY6n5xIdAIhAMc5dAl/Ewow9WmvOfhySEEM/tMhu8gdkkMez8HgB5yY","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":369715,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeelTzCRA9TVsSAnZWagAAASEQAJUqk2o8oCkoCDW2n1OR\nMt9qZ6vFU+0879Um99w1bNXSboALCVL/jVWy/pGdQWwIDN4ylCea0qTu81T8\n2UB38Gj6OnOYgPAVjbb1id3VuTqqiNjhsbY7gPq/xsZGqm+Yim6zQmviwSM5\nOzDKx39SEMbUy+QYIawBFPDbIx+udn2kpllwGEAfoJvriG9kx2O0S6PIVdNr\nP46wVwuMWTLxvWdoQl9zkOObXAsLwIy3Eig5xffBO7Dmz4KeortV8ua/HD/G\nUFlqZCeDPgqqlNpDXGzd145NKxMrQDSNfYPT5LBtxSuSIvyqcOgqs9DZ6+Nl\nt5Qz3j4NLiSo0YSdhf7mWxlsqniKVvBBHp7t8vAQ3WU8RxXK+63EZvfF61Sr\nDEMmGNnvRS1fNQUBkhnyCkMJujetFAQySBJDETVAtllYIGc2haYWOfuTMcve\nLxDOM7QIRtTOgLg8jtsiSgAO5RTQt5Zr0vWitxOzGojiOgNWhpeAzghTPijc\ng/tR8nkH70CCTLjgY9KgnENlPJmYdHRkX7Jh7vSTsYut5hyTkVd0uzr06h0W\nTvSx5p7d6Vpf803LNN9rPK8hALXjYRVkBmkNX3OvA1J1pIRuJ8eAGIn2N8sO\nFmpjf7iz5VqXpS+R3toSXRSgbjOx63e70A0inUbuf86pHQqBuwjuXdDazKAy\n/q4v\r\n=XYXS\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"4af7a6e31c561afa46ba7b74cb35de52099583ed","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.19.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.19.0","dependencies":{"tslib":"^1.9.3","@material/dom":"6.0.0-canary.2cc6966f6.0","@material/rtl":"6.0.0-canary.2cc6966f6.0","@material/base":"6.0.0-canary.2cc6966f6.0","@material/theme":"6.0.0-canary.2cc6966f6.0","@material/animation":"6.0.0-canary.2cc6966f6.0","@material/typography":"6.0.0-canary.2cc6966f6.0","@material/feature-targeting":"6.0.0-canary.2cc6966f6.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_6.0.0-canary.2cc6966f6.0_1585075442734_0.44726694222619257","host":"s3://npm-registry-packages"}},"6.0.0-canary.8707953b6.0":{"name":"@material/slider","version":"6.0.0-canary.8707953b6.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@6.0.0-canary.8707953b6.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"6a23d6f0268ac4b05d962c0881cc7a8ebfec09e1","tarball":"https://registry.npmjs.org/@material/slider/-/slider-6.0.0-canary.8707953b6.0.tgz","fileCount":36,"integrity":"sha512-GSRzsRuWEgwzSFxLUh3abuomqOIZvP7+fltuuujyo7zl/U6uKYAfoKwzjr2qrbC9M3odtF/1zdvNH0lchvZxyA==","signatures":[{"sig":"MEUCIQD2scZ1IJvfjY4fIIFnDwNn0fZh5l703AO0pPjxAodXSAIgOVHmWMOrv+zX3/94vYrR+d8I4pI9LBzUO5nHtYcLji0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":370076,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeelXGCRA9TVsSAnZWagAAShYP/2+3QvY3G2AzRzdYHvdI\nrNQTlsLPP8Gcom8l/EztNsfxIPr7QrifYEpqKlhDd1IPkiKoZrlYgMnYJGex\ndgGHz1Sfvz1YJPe53DA2BrGYX5odGBWU/PL/7iPqmDOHy4YywJ9SwjWISj4p\nKOhQmayEmvnTL+zVZqYe+VMQxBVNp+is/kEXvTzXRbwAAAPJRO5AD1I+UmYT\n2TQgT3tIN26+S/KEHKKfNc87lPnTbxIosm1crNysBuqYQhppB9Oi6aZCydnC\nmQRx6epdDmRQPmXIO7UkU3q6/M/T3rQfnLZi2K+EAljRsRVv2Sc04i7Vp+2y\n06YHcirjLrtxi6VuovZ9tNvqaNb8uP+/K8h0qkCra/nrRiiN7wrAV06+ggJv\nAMvu7uJT3UyyfGIk0lzBsfmcehTLXS8Bv/hGKGkH/Asdk212jCizxOvlhUNG\nOLqmDEqWsBD8+De9odKaJQRqx1NxYLdVFtpRKl3gGkNics8SLCr5O9ZpnrvS\nysF3ZJmXsH8UY9BlO07OqQ9nRG2Gn0qbmmX+5j/N122tAc7XK/hLZud8YY7g\nvuHYt3+Q+sAi7W1GJIdcUS9qq0S+BZvPLKu43qyruJQLVqyuo4X7h4IV4gQL\nRPEPEk9fYFFHsBkTNCwph3ISxexT7ZR+yxHfccpsZnCH9ymsh/IM9lPlsENF\n8yl4\r\n=XrbC\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"595709807214943e737834107d12d3318e69112f","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.19.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.19.0","dependencies":{"tslib":"^1.9.3","@material/dom":"6.0.0-canary.8707953b6.0","@material/rtl":"6.0.0-canary.8707953b6.0","@material/base":"6.0.0-canary.8707953b6.0","@material/theme":"6.0.0-canary.8707953b6.0","@material/animation":"6.0.0-canary.8707953b6.0","@material/typography":"6.0.0-canary.8707953b6.0","@material/feature-targeting":"6.0.0-canary.8707953b6.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_6.0.0-canary.8707953b6.0_1585075654210_0.783877359606183","host":"s3://npm-registry-packages"}},"6.0.0-canary.10af6cf39.0":{"name":"@material/slider","version":"6.0.0-canary.10af6cf39.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@6.0.0-canary.10af6cf39.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"165445627fc19c4260784113d72aecb492ebdcd9","tarball":"https://registry.npmjs.org/@material/slider/-/slider-6.0.0-canary.10af6cf39.0.tgz","fileCount":36,"integrity":"sha512-y+JhCU1T/fbXAIw6G50YNmBDHPF8/cpB2mY2Bk5ZdGqklgvgIFCDkdOx9u7wWyZ8aGajka+w0aWle7pQE4s7Dg==","signatures":[{"sig":"MEQCIBKVIM+YhyS5GbGAmm1d0kuMD23G6noidXMpeijZ0pDjAiARMdcKM+o5p9iBpM11TX6uwL99/FfPWXGg8uFK+oEF7w==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":370076,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJee6CICRA9TVsSAnZWagAArdIP/jAXQfHLFXu6EXOQzlwf\n2m+SLGtUBMTEwzkOTDkmbUX1/54d/Uym3VjByZMbpNECbjTfbT4mQtteidSa\njRZezFQyynAaKL8oPhGdJM22DZ7Hg3SNVD1q/MAEhpSLdnh3eGJrUY4FKyfS\n7ZIyqNhqjHAiBuNk2tLy8SMSHiKzcJT7a5btIv4t6QZ+JE/52O0UxZG4nySg\nzhwpeuK6B/GuJDzq+urA7MfGj2qiDJ8OPhuqCx2qcp606tBbbRJPubGxxoRJ\n6sCbG07Quc37uELEpmk401jxmy+xo6uj8BUptR6mB/7kbnGeddHJnuO1V6/+\nAeMfI59kjayUdP4SJwN7n0My8jM3oyrZkUdvG8K+l8J4O8Zrcyii34dDMu7G\nZk3FuB5KkuYyaBB/9Ty25ti/2ObFuc31nU3mDxacf84SiZNr1tCF2xlACt6y\nbHZwsNbDcoKv5SfsB0SdMY2NLi5bT1lOGSFMLt4P93Kd5xKSbBxFqjoJcNIn\naj45ouG5QX4em0Mhl2HS54RemOR7VpgehSa28VMt7Qx9S+PluMDYmNMkJaVB\nIBctcKWnliiKJmoIGga2MbL6zJprfWwFLC6wInegSqkD40pARK3TNJVpm69r\npX+0xqZmIpeHBANPzVlfZOxkZ3eVNwf/EWCVgO+C7En4CmZK4ZCcO3/UEz0H\nXdmk\r\n=bdGw\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"d618b0c9ce2ac312ce4b887450bb947ed367e100","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.19.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.19.0","dependencies":{"tslib":"^1.9.3","@material/dom":"6.0.0-canary.10af6cf39.0","@material/rtl":"6.0.0-canary.10af6cf39.0","@material/base":"6.0.0-canary.10af6cf39.0","@material/theme":"6.0.0-canary.10af6cf39.0","@material/animation":"6.0.0-canary.10af6cf39.0","@material/typography":"6.0.0-canary.10af6cf39.0","@material/feature-targeting":"6.0.0-canary.10af6cf39.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_6.0.0-canary.10af6cf39.0_1585160328047_0.025368079084871376","host":"s3://npm-registry-packages"}},"6.0.0-canary.7d8f9c8d7.0":{"name":"@material/slider","version":"6.0.0-canary.7d8f9c8d7.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@6.0.0-canary.7d8f9c8d7.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"d8e37ae98551212c024b0ee85a9e1a924cb76874","tarball":"https://registry.npmjs.org/@material/slider/-/slider-6.0.0-canary.7d8f9c8d7.0.tgz","fileCount":36,"integrity":"sha512-/Rnf2tdsyC5vn7pEJCEouria7ityaUUKvteyW8pCR/IBxbWrH6cqweN1ERXvsn/XYiyS7BW/5rDoV+Vr0gFLww==","signatures":[{"sig":"MEQCIBC/1dOtSjWhPQDj9dmTDuylbb0ZaFvGHr8hH2cPL+z9AiA/lx54/yMx7+DfFFhOV/SvGrFX3oiobVRrfoziVNjFhQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":370076,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJefkBiCRA9TVsSAnZWagAAKWcP/iT2lMfdjcvS0U7TIv3E\nRqgV6uRWjvNFHSEnWgQjgSlSUaYA2CzNq2kenPdnKH22ZYwr4n58l9xaYDKw\nbdzXQK8K2fV5YLqLLxIQ1Xb0sKMY6lsBQ0C5okopNI6AffwoamLFIr47i0iN\nv2fKOGZVRdVpyemKbZkj54Cfx68XKuiYjYw9o06Z/53AvfLkMT3xlzCNyCHA\niR3jnkjs1+asFFjojseFbimbGDRUaaDM+96UTT8TB5R0/JGzpPlxWcyfTDpB\nxV7deMtH/zoL11bgncsg2U9d3zJmsAzJTgzN9Hftw/af2/UmJaHuSRiO8SIo\nSlaoSpz1Os3dSB8sHV6lIz8ewuWhb63pSRwkLsO3b3ZxRpQdI8QfnTi3aYQ1\nTQDw8oCBG/HOG/mH0CbcctbgUK0TSV/04CsEV8Vz3y1uagpimzmf4FJvPX+o\nDI4enr7xsoNynaBuhqN5nSQP+2s2eNe5De67rJW3qDo8pz1ZS9na5WWH7JtX\njZIqYBElWj0RYVqcAhImJZyxn50WXfpliSLcjTAL2CHtaUXqbKIn4Ae20mh0\nk3DAbH0VO2i3LTKWxmPR7lUqAmhMIsVSbP6P+DdkKw3vqNQAleknt65A3yJD\nMpkCvudTg7gK8gpjoJzxCsGKvFu5pGghQJhLaly8qdI2jzTRqasjgwIYHjkf\nl+bW\r\n=CAjg\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"764519b823414bee993cab6845b42f5b60f03c1d","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.19.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.19.0","dependencies":{"tslib":"^1.9.3","@material/dom":"6.0.0-canary.7d8f9c8d7.0","@material/rtl":"6.0.0-canary.7d8f9c8d7.0","@material/base":"6.0.0-canary.7d8f9c8d7.0","@material/theme":"6.0.0-canary.7d8f9c8d7.0","@material/animation":"6.0.0-canary.7d8f9c8d7.0","@material/typography":"6.0.0-canary.7d8f9c8d7.0","@material/feature-targeting":"6.0.0-canary.7d8f9c8d7.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_6.0.0-canary.7d8f9c8d7.0_1585332321749_0.5134834810988398","host":"s3://npm-registry-packages"}},"6.0.0-canary.d6315efe2.0":{"name":"@material/slider","version":"6.0.0-canary.d6315efe2.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@6.0.0-canary.d6315efe2.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"b6ee51ffa606897428dc9a72008b6a500f056e1b","tarball":"https://registry.npmjs.org/@material/slider/-/slider-6.0.0-canary.d6315efe2.0.tgz","fileCount":36,"integrity":"sha512-FlT4QugFrdgMOlYJMmy4QYI/yRQtAOXMK/UhvvsGLCYMHWPSobAEw7/h/HgLjlSmb2JCnsAVEkpbIP/X5CPTjw==","signatures":[{"sig":"MEUCIA+DvvlqRs6gb0yFHjWCEhirABG06Ar5pws9hUHhysldAiEAgrAqDLfIX39ouWFNxNjtfy8eBC62CFJw+QXgytuuduw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":370076,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeflqDCRA9TVsSAnZWagAABEYP/jfbwHK4luAvt5MkCgYU\nGRUFDSC+p2oVxYQ1eeFQ1RVXT0mzYMIzJj7Ts/I24I+rRwiSN5NTKFhKm7jF\npLX42tVJPNJMKxW2IHjOzcoaR6IZ8yA3CJ/XgFalh0eXpSLWRq87ni7CI47P\nwUzgnQ01MjFCblhVcANEnW33gbEcTDI3aKil2Iy62btlV/nnMdOA3UrkfBw0\nSVuFe5EGpHCZagddBLRGMzpt4h0Ye+ODYFRp3v8smtALwMzBdEGEp4L4mpOJ\n3Hi1FlGYjIZr1MUQT0SF4uXArisKSzY/2t5OwwHeBMbiqqVIWUgcElGUku7b\nQ1OK0VTsoXnSD/f6/9Uispg1KhHHIOPuvEcg/ndoBsZ5rNh6hy0WzEO1Zl1y\n3VIVUSMP8V3YZvyxhG6F/1l4/VFu71iB9ikJBGDS/PzPwhVLvmwlJUgQFlV6\nh1NAF/XoSsTEFn+iqqL6CcAGTrRGP0I7QnBvFaAtOEHXhanouNJ+Bp3GXD91\nYO80bs6rHNSeRw0dE0eSnc/JcT8HFZcvvEFVM3FRKbQ/O+kvZ5RW0aiOdX17\nFtRKLY5duEnGq5n9ybvrLYuQVpeR2DKzUXX1r0AhIgoCy5N1skuCIFYHzJL0\nez7R/MMOKPM7uX0gM8SjgEMWjYgcMYGLZ8jt2iqntSpM6c35jWGYyiSHZiBJ\nOKDO\r\n=1sVm\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"87fcfa262498dee051bef9a0a8e8b8f39869e6a0","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.19.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.19.0","dependencies":{"tslib":"^1.9.3","@material/dom":"6.0.0-canary.d6315efe2.0","@material/rtl":"6.0.0-canary.d6315efe2.0","@material/base":"6.0.0-canary.d6315efe2.0","@material/theme":"6.0.0-canary.d6315efe2.0","@material/animation":"6.0.0-canary.d6315efe2.0","@material/typography":"6.0.0-canary.d6315efe2.0","@material/feature-targeting":"6.0.0-canary.d6315efe2.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_6.0.0-canary.d6315efe2.0_1585339011303_0.6390180832007293","host":"s3://npm-registry-packages"}},"6.0.0-canary.a3016368d.0":{"name":"@material/slider","version":"6.0.0-canary.a3016368d.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@6.0.0-canary.a3016368d.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"8d76baa5b413f2dd69425bd7daf1f71b0d3d0244","tarball":"https://registry.npmjs.org/@material/slider/-/slider-6.0.0-canary.a3016368d.0.tgz","fileCount":36,"integrity":"sha512-miJ7U3htsiPJ/F7p9P/5tB2bT53ycs4tnxiSsOsXmoQDrv6qIL1vXd61q6eB2BOwlmUakEJsN92F/1hQPF/V2Q==","signatures":[{"sig":"MEQCIH9OmhCtOL3k2+ePaBRvxJrZ2Ay/WOT9RCx2DreVi4W6AiBxTqlzbD+fzZna8/lMJScMnZJjDFo4EMzCqJicN1p4Sw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":370076,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJefm39CRA9TVsSAnZWagAAG/sP/2/wsyJfHkY+NROl2Ia9\n2MlkM1fPqETspoOV4CMIajbCWt2bfJLR3LrrZ7lVE80YYVUp1ezQTOeNu9JD\nBjwVeTOMSaDxSe4wVxwAZNtfbuN/UB8Vtcpq6nvOtxHzL4++cOPzOJ8dCMQ+\n/Y0jYvdvVjtXiLtrAZRvLDGMadjuw+Yf1zeZu1489Tw5WyobWbrLMe2jA+Vv\n+17eivp2ipPtsg2L/N0F+C8fi5RiRUVYYB3jfTISVtqxqEqINnVy023lnFlo\nkwu8LHMVLyZ9Hr4tVxSarLxyV9B+njzVFfPYfNK73cIX/w0zh8yNFkq9HuTG\nITNWLJJSpcAnmxyOnB9Gc4+6ztllxEG1r8E6Np7ylRlhKpPmgDAMSrnWlmGr\nhS2ZhkQ3PDLp+rsgEbzA7zsNafbjAfddv2gMO9ToqVC53G3UC/0Xq9c5tnW4\ntj7T8t+qMmxjQSgqhyoe/zJ0kJmO4iarLTIoJZFTcx1I3FXAAgYAbFn19MuG\nEECUTBsho2NsXnTplfkfdCesbClJbTm3S4KTA1qb0MnqC6pbr8jBlOEDsWG5\ne7QZ3+m8tzDosUjzyP5rL0Tp8F3eIVNYJ7/vL2Ea07v3bqKgpmt9AefpluM3\n7NLPhDHcBo4xJyOGz3uzr5HkR1J24GfBndDzgrEaAIqImnabvhDQ+4RC1npJ\nmNMI\r\n=BZx3\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"e41b28d8c25aa5e36e88910a1404e7a0730c5d2d","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.19.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.19.0","dependencies":{"tslib":"^1.9.3","@material/dom":"6.0.0-canary.a3016368d.0","@material/rtl":"6.0.0-canary.a3016368d.0","@material/base":"6.0.0-canary.a3016368d.0","@material/theme":"6.0.0-canary.a3016368d.0","@material/animation":"6.0.0-canary.a3016368d.0","@material/typography":"6.0.0-canary.a3016368d.0","@material/feature-targeting":"6.0.0-canary.a3016368d.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_6.0.0-canary.a3016368d.0_1585343997527_0.25251468009861733","host":"s3://npm-registry-packages"}},"6.0.0-canary.4b45b6620.0":{"name":"@material/slider","version":"6.0.0-canary.4b45b6620.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@6.0.0-canary.4b45b6620.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"7816a455ff577754b0bd7a12514397d388f428fe","tarball":"https://registry.npmjs.org/@material/slider/-/slider-6.0.0-canary.4b45b6620.0.tgz","fileCount":36,"integrity":"sha512-dq/ahz85PqOqqoNWPPspUkVhGmx7fhnddohOFnt2p7dGfNgTmUisoqZP6oJf43srLzoUNprKP+ahR+n9E4APjg==","signatures":[{"sig":"MEYCIQDLsA6oak6GTu6xqWMj/mOi2AxAw0VqnidnQebIz9J67QIhAMisEYrZRSuydP7uubAFMnJc1b4A4k5zEv6UFaLsdSrQ","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":370076,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeg2g/CRA9TVsSAnZWagAAtkwP/jnADHNlMv9iNpwDm6VX\ncnXUAxyK+iylxM2Qga0VSg7ed7M4ahygnNDbmevkNBjV/L0+Zw2bJj69NY12\n0WOh5M2wLcaSoHQL6IeJEsUSOUyFuQWQMLS+sfEfiot1noejwf8911WteJdK\nwtK0vHwDjsBRIYNhF00/LoSnsB2eK+e9B8fNB/WAvffVQipwnjeq92UKSgp/\nf4Zhv8Bl5UO7YvQGl65gCYn98ge7FgHpehrgAqTv+2IZkP5tOMQSfeBDcza6\niCEKGb31XkEjwGW0P50YIJ+ZS97wLlI3d581rv2UIhqr2JxdbhRec8vTVp9c\nwrMrjK3HgjwBqnmAXeyq7wU82aKq/OMX8zs1kLVjI82OD1l+5JMnXb6lHSRg\nr+64eFn+LGkTeQGl+hIkhEi0Hq9K1BQpwKd1FMdkWbKP74S33sdw3F0WwI/g\nvMTeViBmu8u51qtmNIW3TzsvEx5Lg5RXUS7SdWoqNoogAES/Q+oSJAACH4Xh\n5f6nWsmTh4DXoHuY2OsyLA1Lw3vohUKOdSS0Yx8KX+TnVTnbDB/sYqRVNPAF\n8iJ9LtPkVu++Tp3P/cQq4AfTiV34h3n5P5F24R9J29uRb78+CQhNAor/odbK\nYHnlBAVTJJvtvjVxjN8pZTTHyHXVvCytAZARoyjGYWWSRJbeAtbLL+bEh6FC\nD6P8\r\n=96/g\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"9d49d0fd4e563f312e9b2a25d111cf5753591eac","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.19.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.19.0","dependencies":{"tslib":"^1.9.3","@material/dom":"6.0.0-canary.4b45b6620.0","@material/rtl":"6.0.0-canary.4b45b6620.0","@material/base":"6.0.0-canary.4b45b6620.0","@material/theme":"6.0.0-canary.4b45b6620.0","@material/animation":"6.0.0-canary.4b45b6620.0","@material/typography":"6.0.0-canary.4b45b6620.0","@material/feature-targeting":"6.0.0-canary.4b45b6620.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_6.0.0-canary.4b45b6620.0_1585670206865_0.8672698322808832","host":"s3://npm-registry-packages"}},"6.0.0-canary.e84b9c8.0":{"name":"@material/slider","version":"6.0.0-canary.e84b9c8.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@6.0.0-canary.e84b9c8.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"47e61673f7008625b837552ce3d277f4d3b80f3f","tarball":"https://registry.npmjs.org/@material/slider/-/slider-6.0.0-canary.e84b9c8.0.tgz","fileCount":36,"integrity":"sha512-QyND/KKZyn8LKa0Qq1iRoR0VDGrNpkG2esLpfmcWLZYevcetZs/9DA+Pfqy7yTJ2FinLjscQ9DcGz2hji6mz7Q==","signatures":[{"sig":"MEQCICZ5k1bt66fAeqzsx6MXezOt2YgZS4APJzyIGwC1SCPRAiB3FMlpprLk9gLcuqyePN3CDHYn6+V+wxu7L2ee/VCyaA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":370171,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJehMe7CRA9TVsSAnZWagAAaK0P/jIRPcelkP3i7euyobTh\nR2Qrsdgooif0AClUN3FfL2JAv1akhgd7Zi9uJpguQ9t9sxxIrmq76+PRt0Xa\n9il2/QaOaPY/zV/0FoblIqOOw/JZw8InvKhGKvcGXiCYhiqgAeI8fAgEczbd\nNfZvbuXLVDWkPJzZuXvMHiJL/54hpaVNqyR0A+ZPRhfav0big3s9YQCpP9Q9\n4GtYCswtQKg/u6pXa0utZ/tSd1BqvlnVifx5N+wwWsV5zE1ZRUCqY8zYr3GS\n21cnumLiJiBMmbo6w23GrJwH9gxv1aNTgKx3cjmuyP/NxH2OmytjCdKUPL0M\nkp0ZUo8mHXZPlFs2K9lY4/9Pi9Aig+axKeNp+b9VcyTpAE8p6h6iX5LxtGGU\nK6Rd1h/zu5Roz0WycBNlNc6x2ykunP7DE4vUHyKPW1gprkeKkWjrWyli7DHP\nbvSZBzx1RbACgGOYQfS16cA8OTAT1OEc6ZWLgUD7H42a4g19vnurz9hbgJCK\nGEELHAHLwZM3c2woOcRkiPxukuIurGT2VxYsLAo2W5HrtAi2nWPN0DCcFW1b\nEZFYW6/7HPR4QNIBf0kDAg1hUDft5CJwPO1/Hr+UKYqYfrDGuuE/aLIm//9q\nBzMsM9hK4hqxeF9qYh1htPCffbQsZzxcZ4V/zvkYTcQjaItVoCEQeb+vSJDu\nLrWb\r\n=cLaq\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"8c119e9b02d2718e7b4df7fb72c1724650583b0c","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.19.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.19.0","dependencies":{"tslib":"^1.9.3","@material/dom":"6.0.0-canary.e84b9c8.0","@material/rtl":"6.0.0-canary.e84b9c8.0","@material/base":"6.0.0-canary.e84b9c8.0","@material/theme":"6.0.0-canary.e84b9c8.0","@material/animation":"6.0.0-canary.e84b9c8.0","@material/typography":"6.0.0-canary.e84b9c8.0","@material/feature-targeting":"6.0.0-canary.e84b9c8.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_6.0.0-canary.e84b9c8.0_1585760186706_0.8823299475916784","host":"s3://npm-registry-packages"}},"6.0.0-canary.e33c49e.0":{"name":"@material/slider","version":"6.0.0-canary.e33c49e.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@6.0.0-canary.e33c49e.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"71c2ae222807ad478552b0645d2245037e5f64fc","tarball":"https://registry.npmjs.org/@material/slider/-/slider-6.0.0-canary.e33c49e.0.tgz","fileCount":36,"integrity":"sha512-jMSFCPQIk5qYEUcBhzm9Ev+PjuAFLi48KwYMC8RjJho5wggSgMxsnWazyyyhLymmBxPy9r3laLVO4XLNV17yIQ==","signatures":[{"sig":"MEQCIEVsk03JS0g2xPzRG45eapmnMdJZ3KnsTQdMxxqr4PRGAiAGXuZ2AORR07yyCZmPocxOLBfFwBH1s1kxu/ozLvzlPw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":370110,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJehS1XCRA9TVsSAnZWagAAdU0P/0/5X61TSYveS+PkeIM2\ntcg54xq1mb/ebmrDYQFnLPFYj/Z3UVwyP1yiRLFz/iL6fBIaaIJBMpQpi05t\nCVoET0sbHVkkcR+/XufMLkQAVT+x22o/D7fGgIH3jd5jZLMk0eFsoK8qNyVD\nNeYDChSCOvKpB0whehfgheVcGck0/Q0ZFyl9y6SXGH4ZoPAg2FjrOM8GBICW\n0w44jIk/bivhuE7bE7iwWQLZZ/nJOn6p7KxxlooBvFkri5NuHC07B22fLDet\nUCpybT3hpkUXX08qqvluVApAMV/qK+1Cg7bzy1jiOAXCTm4AcgjKjH7sEQoJ\nVWuZqMd+Z/e2iT0eHQTdT1dulfgK5Ia2LfeYtLeTw0z+IE1DR4oRupvGKKIQ\nSk6MXjiMEZN5wh9vCC+RnYd/xaQATJWR1rJ1gt5Vt7ZENV07x8HSxqg886PY\nqX/GxzbnXcnNH4F4JWJGi3eq4xRGJUEmHM7TSez/F9iPl/d7WLYNAkhobRMI\nRs2CTkIgzDK8g/Hsm14rVAwAr66T/az57mtq6lTNgtPEyElHiIus506bJ31E\nI/knP086KqvYntaYnxQk+3QLx1eJQH8+t+nZLHp5U+Jhvk95P3Zqb69IFtmR\nE7MUtBfpGAq1kTNw2KNV5r4NZomjsM6AfLxiTNxzYA0q1GkDz1gyHaFWlcNc\nn3v7\r\n=rFFc\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"e369357845cadf1687509d31fac95d3131a90718","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.19.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.19.0","dependencies":{"tslib":"^1.9.3","@material/dom":"6.0.0-canary.e33c49e.0","@material/rtl":"6.0.0-canary.e33c49e.0","@material/base":"6.0.0-canary.e33c49e.0","@material/theme":"6.0.0-canary.e33c49e.0","@material/animation":"6.0.0-canary.e33c49e.0","@material/typography":"6.0.0-canary.e33c49e.0","@material/feature-targeting":"6.0.0-canary.e33c49e.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_6.0.0-canary.e33c49e.0_1585786198748_0.2273884373327033","host":"s3://npm-registry-packages"}},"6.0.0-canary.f1f8e60.0":{"name":"@material/slider","version":"6.0.0-canary.f1f8e60.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@6.0.0-canary.f1f8e60.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"c07418874b87ea0b5ba07f135b78b108029372d6","tarball":"https://registry.npmjs.org/@material/slider/-/slider-6.0.0-canary.f1f8e60.0.tgz","fileCount":36,"integrity":"sha512-msXrS19iOv2v4mYg+6UG+p9L9TnXzkgF2W4rDi13JfxekUcRBZb05Kqng4IJFLc392w2YqYelF7Ya9WlBNCdXw==","signatures":[{"sig":"MEYCIQD2R7U7q6932j3E27vWei/Q4oTb9SDXC3TrBBxMFoIExQIhAIVEMuh574jS+hfEja96bOjByz4mtlnMoURieqx+cHNL","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":369949,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJehjmUCRA9TVsSAnZWagAAVxcQAJZXtg/Bl6/WTMhFBSJY\nZP7//pYmnKKiU4U6f1nLbug5IoLhx6oRcgaENi0lkXKM8oBKrx3kcvBsfz97\nzSTfXngIW3BrGp0ao2gwwN9denipLKFuYgl7PqbMxPWzxYJtETbJ4LddfYwy\nEgH9s7m4hOPtuEnQhArdra5/JTknaGKYYBKR4brF0eNky6NEfgU6QpapVouv\nbhURZUfUej3ur/4w8gWGuKcbqbOEjy8R8hBMhmTjRJ/TLdpOhpRQRgOTffpg\nzkWi2d2myVkNsNqgyp5VQ3ec4YuHCLJzD2qgpqkNDTqaz7wyS3qPybJZJOJK\nS9anjIcG2KKL0OW6cNY9DyXzoMkjBFN/nN3L45JHo6XfjMWN+RsbhadLrBD9\n6n2uL//Ij79GRFCXEfWXC28EbCiZi+prekXz9eHirRNufhl4yXKoL01o0cgc\nStF2w9/2dUC2m/ROWmQKmLyEm54r8FBHwSgmvDu27ZPGMc4n/pG55yXjlHal\nW7rZOqvkgzfxbdctYVNqYwOek7PvOVaIbqbN2TcDPhsglSwTPjmt3k13pnw8\nVA2EKnew+jBRP9z3ZPQFU0akUG59hsjDz6xE8M0zVSYfJdV/rsLfNdm2bpP9\nq3KaVsanMAGn6BIWc7+Eob5O+YUg9yKSIgjQ7mM6wCMyhfBKAF1AigOLXHVz\n0+b+\r\n=zOim\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"aa365c532331b10b868579dbf1fa4335e9499185","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.19.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.19.0","dependencies":{"tslib":"^1.9.3","@material/dom":"6.0.0-canary.f1f8e60.0","@material/rtl":"6.0.0-canary.f1f8e60.0","@material/base":"6.0.0-canary.f1f8e60.0","@material/theme":"6.0.0-canary.f1f8e60.0","@material/animation":"6.0.0-canary.f1f8e60.0","@material/typography":"6.0.0-canary.f1f8e60.0","@material/feature-targeting":"6.0.0-canary.f1f8e60.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_6.0.0-canary.f1f8e60.0_1585854867775_0.4895357102272673","host":"s3://npm-registry-packages"}},"6.0.0-canary.1e17c49b3.0":{"name":"@material/slider","version":"6.0.0-canary.1e17c49b3.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@6.0.0-canary.1e17c49b3.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"18ecb12ec9c3838eb7bf007efcb4b945a5526709","tarball":"https://registry.npmjs.org/@material/slider/-/slider-6.0.0-canary.1e17c49b3.0.tgz","fileCount":36,"integrity":"sha512-lKtBLHA9bSwg2cITp3uS8GQuVEQovRG5w79qPeu4f3XTxYy0bBF4QDtCZjn0RRdnn9hcXZhMwrJvft7OrWC+og==","signatures":[{"sig":"MEQCIHrdeYdImuHNGXw+5dKZ+Wmir1ftJJuISg2pw8czJb9/AiBg7DgR4l+vLcOR12OZJLpoSfFwIDGfQa9yzDt8WO56pQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":370076,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeh3qvCRA9TVsSAnZWagAAbJ4P/1AUK3SXuFDH57TeFRiB\nIwp6fTXXAQK8J5MP41VzI3p6c0KA++lLw7kCaK5ktf5zFmmqvuqUL3soTBg+\nwBIkv3N10IfJGjPneDYxjqjIopPENb1v4UborFnJzluWpSYeEuyMTAxQ87fS\n3hQPs7rGl1ZvEHjT6EJ9o2aj+tJz1KXql5VAau7gvc0L2KA6W0UCO1WjCRtX\n/tCl5LA2w7CKl+WLLc8diHSVOIaWTFM1rcUmgz6j7z2pGQ0ZMRG1rOlqsoIL\nhk2TJ8V9Mbsx6gHp9BY+9j/YSyhOJtK18STqfu9TcTj9eBP2MXtmcnQYNA6+\nvOAje7Jlpx8OwyEZdt4iC5Hag0/vkM8nyF6KC86Yr++ZiR+TX0PgxKD6+6Ix\nDR2u8wfDVW3gQ1Jc8V0t0vpr3G/52d03MIS9dFpOlcGJxxrNQgwb9vz0jvIN\ncbk5yJQ1NO17rs2KgiI+jXJFNLQ2BSnKpr+P6cLpNrKwUIZMHaV2EZtVcLyq\n2ME/Mdc0D6K7bfuRyKZas4ckOZ9dYkgIgCdWgLrE3QIcXyMz014yf8k5uaWC\nnAba3iopcl3jqAJlGZQRGvCIH5YnzVjx83Y9sjcev9gw7VEDFX65gakRwpvn\n0MMFo3+2DUZ6JIlilwSRhDy/LQTkEIgcvtIH2wc8LBqvQRRSeOUn7vgR07vU\nId2s\r\n=62g6\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"08bf363eac26d705e8c4b0bcda91042b9c73f82e","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.19.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.19.0","dependencies":{"tslib":"^1.9.3","@material/dom":"6.0.0-canary.1e17c49b3.0","@material/rtl":"6.0.0-canary.1e17c49b3.0","@material/base":"6.0.0-canary.1e17c49b3.0","@material/theme":"6.0.0-canary.1e17c49b3.0","@material/animation":"6.0.0-canary.1e17c49b3.0","@material/typography":"6.0.0-canary.1e17c49b3.0","@material/feature-targeting":"6.0.0-canary.1e17c49b3.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_6.0.0-canary.1e17c49b3.0_1585937071203_0.2441264926415856","host":"s3://npm-registry-packages"}},"6.0.0-canary.6a40ef217.0":{"name":"@material/slider","version":"6.0.0-canary.6a40ef217.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@6.0.0-canary.6a40ef217.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"76a5b137757d3431e3ad6c0438131ae884d9728b","tarball":"https://registry.npmjs.org/@material/slider/-/slider-6.0.0-canary.6a40ef217.0.tgz","fileCount":36,"integrity":"sha512-A5BvhgBtj5qk3EQpAsf8lLS5z4f7H657WIFeqF5WFr9Gzu0vxBC/wKVBvU0H/e9FR3d4WwdPsDcZnidRJwAyvg==","signatures":[{"sig":"MEUCIQCiERL2DldVejr3hECz7fvJT8xy2A5CxSs/llVluj642wIgVfcZ39j9aV88KL1UD58bne90Jiy0oABWnb2GuiHlrj8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":370076,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeh42UCRA9TVsSAnZWagAAjScP/0C2ebJvv2VWVfnAnhWr\nju9FCI+HCbbL48bzDwlIDiHqDCWd4EeIXKO33DJIpmdcfYSRPKzA1ubw8VYS\nQFcJ2dvqWHiBI3+hAZy/d+akZ2QFEH4EuuCStiOdeOX1XtxFFYemJYKKTd/I\nf53ylV3OIkN+bUQQrYzvvWVWeCItsrKfZEI2ThjkczRL3GqaMMw56vcuc3li\nylhmuE1eStdfJeb+BRPkYphPjGmBK4GKzIhlIDcETEPqWI1bP9lsoklDY5KC\nY/soFPRBp5nalBmaLdQc8Zt2P0tx3lmir8ET9P11XaCHvKdm+zK8eWDDv0fx\nQv4gmZrlebapRxth+mSYqlThU5o/Q/3Xif2AueITojtJxLHiL72fstJib1/k\nNOi92KKrxzi6aK9Em9MdGu3g3SKmKOUC3v+4pd1v0FlxpZOFGsGBFrI2dfaS\nth1Gglv49VoNYA4mGu0EXSzrEeZfD+JOhMrfOpbLQ9yfU1GpiHFz+UwfuHDO\nF0n6B7kQthq8ouUO+g/lRE+HEY+WQ0rZWtVOyq7wsJs5jpbGYldxsM0txpoA\ncsC/SrGq9ixDa5cDpbqtYVTvUo1XVT7xhazjIVgG278Z+GN6wrYlAg4NZRxF\ntxkLItM7GJSwJ+seKh+MeXIrRRsPR2O1nqtpZ7k4b+GnSifDWBs1KS14awOL\nlKfb\r\n=/inr\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"94e553cfa7e3fa8977ae7bd2ff7df4021f815787","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.19.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.19.0","dependencies":{"tslib":"^1.9.3","@material/dom":"6.0.0-canary.6a40ef217.0","@material/rtl":"6.0.0-canary.6a40ef217.0","@material/base":"6.0.0-canary.6a40ef217.0","@material/theme":"6.0.0-canary.6a40ef217.0","@material/animation":"6.0.0-canary.6a40ef217.0","@material/typography":"6.0.0-canary.6a40ef217.0","@material/feature-targeting":"6.0.0-canary.6a40ef217.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_6.0.0-canary.6a40ef217.0_1585941907825_0.554183556115182","host":"s3://npm-registry-packages"}},"6.0.0-canary.5f24faacb.0":{"name":"@material/slider","version":"6.0.0-canary.5f24faacb.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@6.0.0-canary.5f24faacb.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"e7ad6c777c033d93e2b99f0789ad0fbdeca90247","tarball":"https://registry.npmjs.org/@material/slider/-/slider-6.0.0-canary.5f24faacb.0.tgz","fileCount":36,"integrity":"sha512-uYDi8wxQiJoktlYTAKU9sjEtrVuE6Mb9E9IoghhWvp2f/98fpIr2NC2mq2p/yP3ehZ7dJS2zCD0/JniolaueuQ==","signatures":[{"sig":"MEQCIAiI/mSEIpyUil+kRS6A4NQcxkGNRVIWMjFEiH3Wp+L1AiAnd0jkZoBONYzak+qJDYMk8GosKLrMQGQcRtVBl7VoYg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":370076,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeje+kCRA9TVsSAnZWagAAJY8P/26eHtjeDa1gRXBmueAc\n6nSNNHPkAI5h9grraidVOoivnYbsSKlbazXq8R/xWUzKg2USIJ4HTiaUVToy\nsUZuAtFwTwvETPnTgYVYpzv71D9aD3s9gOh2RWgzO2lNyiTZqHFn/tqLS4j0\nFy0ku0uRNB8va28mIWN58HvXVvQo82ADyaQF1fJ4T+d4NSTxH7sVM9m7E/MX\nztN9g75TtkT1RvWzsKc8nDsL7t2VgsSMCwMhmZUFzqDd7wJb8oqjwVye9f2G\noJtlg10wC92cVlrBytx1wt98LZvlrdlnDrf8c0R9l1ZjyjJ6E0/mSUapZCkv\nrQsFzqDoHbOFCfKoFbJkaj4irQj4VSbHKN3BPQHyON8+ivpVBSt/e1FKehLN\nLiGjH0/97KASa0SdZWWCEUc05w1QNP/+HK1IvBceEBV76HLjQTYuj/FX69bo\nLhvLQPViWQQfqDbGlktEbncQVEdcxHujtbAXXIIpzXILQ7Lk4NXh3hw5sneI\nfkvjaIQBepG9WnnSGiOvfICnN8+WM5IT/fg4nJQCvHU+TKGfwxHWqMNCrEpy\nG0jOglyOQD8uHPThoYyyk/44U64Yov/h0s4HW4dzi5/lc/1SOLBUam9N4L7Q\n5ubRqblxqrwsPuo5CHlBBNS96j5xFoe4cr2THWrMc37WutKP733Bu/2jAjEF\nVcpZ\r\n=XCoR\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"2c7c3d8feb6b7bb5281c1144c43a06f3ca963316","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.19.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.19.0","dependencies":{"tslib":"^1.9.3","@material/dom":"6.0.0-canary.5f24faacb.0","@material/rtl":"6.0.0-canary.5f24faacb.0","@material/base":"6.0.0-canary.5f24faacb.0","@material/theme":"6.0.0-canary.5f24faacb.0","@material/animation":"6.0.0-canary.5f24faacb.0","@material/typography":"6.0.0-canary.5f24faacb.0","@material/feature-targeting":"6.0.0-canary.5f24faacb.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_6.0.0-canary.5f24faacb.0_1586360227910_0.05628667340666027","host":"s3://npm-registry-packages"}},"6.0.0-canary.82fa986b9.0":{"name":"@material/slider","version":"6.0.0-canary.82fa986b9.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@6.0.0-canary.82fa986b9.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"585bac55e9856ab94410a3cfde5d4d046dd980b2","tarball":"https://registry.npmjs.org/@material/slider/-/slider-6.0.0-canary.82fa986b9.0.tgz","fileCount":36,"integrity":"sha512-qYgF5oskEM2ozBnh7vwWB64cJMF076KDoITf8sUsOtT6OyHP+e60MKREs2QJAQrkizK4VZDuL13puIcBeb6ErQ==","signatures":[{"sig":"MEUCIQDP/b/Y+KimUQcKm4e6HB9835WQNUo8sU44W2gFj+ZjxQIgKoG5vxT4BaimMVT/CiOsysOSdSCQRdSPoWAXVxKS2O8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":370076,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJejfDUCRA9TVsSAnZWagAAM5kP/jLBafXBK4RzjJGXq+3A\nmS4i7IMX1awlL7sX2ZGL8v2o0ArtlFV+XrDaVltGEmvg/BtES6hgtB+uO+QP\n7vG4tVorJEwcXXFQDok/lbEBsK5WHhr3Lt14BF5PuqiJwo5OWU2sP0WldMg6\npoPy0gzu0C8ImGjZDVTqkRL1bLnSPf+PTHOGFdqOFD9w8kfUfouKkPYMUqjN\nBCcMWEBSc2o0/67g08nBrMc4mcR682nD+KkantwcddXhuf5G5AU8TZgj8VwT\nuYm/WOuTBy5B9Pu98GdzQiM2nCNe4OkWqOyY6ZgnR4EEw/WzIVEawlm9+Tbd\n9nK04Li4dcGSlW4vqHsa5u/4SFPaHxYXC9LnCnQYg1tKTeQKFmwkokwCxsJi\naESBvmLvKTc5gOCQVfE0hcEMi/WUrrzdK5Rz58iGh1kiFTzHR58ygPra6r6w\nFOBA+0Mh+zSMrqkWfR5+eaEVvNzskcO5llZZUcJFHjmlHi30bLN2XIStDWFc\nYw5TYqFZKdsZ8g+pt7WdRKmHbBRKjRvQgjaRURgNFyD/idOIk/owQK8iEr1N\nrK0qe6+ik8YgJrbLjU6VfUMJQrpdLqCv9igHI0NAhPjGfYlWlkuzzswYiS0Y\ndrX4ZFw71xVh1t0BHP0mEhQI7ScoTC7uH3361H8VhXNLuLZ2t5DVK+txMZZk\nKBvq\r\n=g3o2\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"4fd9bd21072735eb447e594a5fade5eb1e846831","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.19.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.19.0","dependencies":{"tslib":"^1.9.3","@material/dom":"6.0.0-canary.82fa986b9.0","@material/rtl":"6.0.0-canary.82fa986b9.0","@material/base":"6.0.0-canary.82fa986b9.0","@material/theme":"6.0.0-canary.82fa986b9.0","@material/animation":"6.0.0-canary.82fa986b9.0","@material/typography":"6.0.0-canary.82fa986b9.0","@material/feature-targeting":"6.0.0-canary.82fa986b9.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_6.0.0-canary.82fa986b9.0_1586360531633_0.6877754094303976","host":"s3://npm-registry-packages"}},"6.0.0-canary.9930d9cc5.0":{"name":"@material/slider","version":"6.0.0-canary.9930d9cc5.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@6.0.0-canary.9930d9cc5.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"4fae97baa3f12888b7ea64bab97cd6df274fc19f","tarball":"https://registry.npmjs.org/@material/slider/-/slider-6.0.0-canary.9930d9cc5.0.tgz","fileCount":36,"integrity":"sha512-SmRA0MHorlOHeDgE64njxDYwIlajequdCANnyyLWg+LwVDkCtwMkN/VDAXP6TvzbN4clSezj5m8SuV1SCR4yXw==","signatures":[{"sig":"MEQCIDVsNL3f4P1xub8hsxN0uB2Xto+5bD/ZB/cj8zrnskVWAiBvuq7FVGq3MBqdf6Niz8GuvZYIzvPWeYKp7uPTQIMjSg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":370076,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJejibmCRA9TVsSAnZWagAAxVgP/0+bUTl3fFSPAs9I3/8P\nIPIFY/rDx9DBV4ddkrg4z5SaJfQEzaV8pE0aJiF55yFaM5huSsZcJcitv5wv\nc1spMPQ4RmibBN5b9oFJ3fnkzjUIeJdGG4FRqNCID01Z5aIV+uujl2VuU/QQ\nxQzVzbB6hTI6kJINLM5U1Qz31RyLIZQi4yJLcPKTfByv2G0Y0aGFZpFdu3jc\n0zHYizj1RrN/iwHNqp/ph+tAzpdyxO02Rxhg0YFIddr356LoXGfB/uBf2IMU\nTKX5bo2P0bhl5PeLk6C36Ej8NmvwGT+dRCfMH8hDskoeEO+G3IRlG42SihYL\nh+9IMPM0Yf/BElaglIjgAg3/agnlrmK1QUSO49jD4sUHR3kDgnxYu7JsMTBE\nhfxGvn/YkidPiD6ewT7kuUHQacjKvIeqKSjGD8dYCjDk0etqESFezF227pu1\nmm7vteJu1EIELs/dZX6/UAa62BPtHMnaVHUD9CjL/ZvuUzCF+qA9t8Sa6v/x\nhhi7FCa91xHCJiB2ztiD3XmBQOyQrkAwad2Sdv8J2oaj7W+TZ2RactPknlJH\nFQk3KT9BniFd/txutcN3GiTyitQap/fvYS6PNvhY8P5ieHoIbb3/5XRXy9yL\nnuRfUpzuABhAv+BRz4B7wTKEAZ3Kem5Q4w6mAmR1Y+uRKAzcNZ2l+1pgEMIT\nIv0k\r\n=LuOG\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"a0382987a27373aa348015a5e2529f301f638d57","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.20.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.20.0","dependencies":{"tslib":"^1.9.3","@material/dom":"6.0.0-canary.9930d9cc5.0","@material/rtl":"6.0.0-canary.9930d9cc5.0","@material/base":"6.0.0-canary.9930d9cc5.0","@material/theme":"6.0.0-canary.9930d9cc5.0","@material/animation":"6.0.0-canary.9930d9cc5.0","@material/typography":"6.0.0-canary.9930d9cc5.0","@material/feature-targeting":"6.0.0-canary.9930d9cc5.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_6.0.0-canary.9930d9cc5.0_1586374374450_0.11948587798952648","host":"s3://npm-registry-packages"}},"6.0.0-canary.6601d24af.0":{"name":"@material/slider","version":"6.0.0-canary.6601d24af.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@6.0.0-canary.6601d24af.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"5e6977670bbc7935db2b78fe0e99128a49aba8e5","tarball":"https://registry.npmjs.org/@material/slider/-/slider-6.0.0-canary.6601d24af.0.tgz","fileCount":36,"integrity":"sha512-7SKnin2nJa975lDxcx7+DAO0peiXaoFv8mPr2Ngwgh7VGDtnkNIzdKHzxhZ9pnu98KrMlEKuNvapT4Zl3ERtsw==","signatures":[{"sig":"MEUCIQDgZohMUBxvUEN8lnouFgm05nEmoPQ9klB81Kx4N3zAxQIgIncNVTtXGfn5nLZMWns5svombVOGdbb79reNcjuRLnQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":370076,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJejmydCRA9TVsSAnZWagAAhyAQAJX67Xjx4Z9dGQJqhVvT\n9fNUXEj10+dHLW5+RKeDvKk8aei/JvMLftWKhwmfVYjUniUMqBwFQCyOjAAZ\nPT2/lRIy2ScJR6hfHQfIC0MHEMagmdrFdCOvoNwdrzQ55rMAcraNEFLKoRyD\nS+/H8gzvHgJ5k2uzgrQb0yqp+Q2KpOy8zzRS66yTqfxN+kG/u6HsKJ+rxXXK\nJfpSK+20ZB1ftwVoTlBNzGNJdlET83KTP6YhlPzPBlZVJRj0K6Delr16GN8v\nfQ7HLmT51i04azohSpqysEjQdNhs/5dE3Wzg8JxWo/+wyXA60FXHk0zokdk9\nShZHbAAEpUqWVAGo6uyNInLZK/NSJ0bBcyyyyzcCrxdvQ+wDJsKc3Uo8kI5M\nwXYj6CWzbysF6OrpJZNWcFA/Sn9iWx6uARrJYjWFfbVp4yKkB36wJGfzsV0i\nNglGQyS0HCjuFO21emp5zQhAczb47nxC94EBgXPrgBKp71DO6k4SL2Y9WoBF\n+RNe6y01nk5Tl9gjDJyWAL3mL4CTk6PRSWo3PpWSXejN5JWObOt+RCB3cpXz\n+FCmgPBfhVacgO110OlcjqzFg6d9uEndthZKSgq7yDclxvQ/zOC5lKBJTWlx\n1LDpUicOePxst6kHn/U+siYoQbE8asFcTzh/G3oUlgbHV9RKzWNWd3nFJrVk\nAnL+\r\n=KPxP\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"f22a45db8a22981a17395184998a94e6a32944c9","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.20.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.20.0","dependencies":{"tslib":"^1.9.3","@material/dom":"6.0.0-canary.6601d24af.0","@material/rtl":"6.0.0-canary.6601d24af.0","@material/base":"6.0.0-canary.6601d24af.0","@material/theme":"6.0.0-canary.6601d24af.0","@material/animation":"6.0.0-canary.6601d24af.0","@material/typography":"6.0.0-canary.6601d24af.0","@material/feature-targeting":"6.0.0-canary.6601d24af.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_6.0.0-canary.6601d24af.0_1586392221039_0.43473084971853115","host":"s3://npm-registry-packages"}},"6.0.0-canary.05f5e1583.0":{"name":"@material/slider","version":"6.0.0-canary.05f5e1583.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@6.0.0-canary.05f5e1583.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"0468e4091a884481d49307d54a6c0e880d29c720","tarball":"https://registry.npmjs.org/@material/slider/-/slider-6.0.0-canary.05f5e1583.0.tgz","fileCount":36,"integrity":"sha512-IJ3qwjb7Cw5GKYebx5t3C3wOcb3wHlMmGMrcHCy8ad51fzMQrUyc17pJVdCdZqdbatC/jU2NXi6Tb4LyJTrKwA==","signatures":[{"sig":"MEUCIQDqnqz53Gc1I69EAtMu2QhBEZLe7O26VZetf3+sb9FPSwIgSovFEEvip3Fr0jR8FLL06uFt6Ae94f0AL1Jk5JXkp1A=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":370076,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJejnCyCRA9TVsSAnZWagAABewQAIiXxleGlCggrnNayzaq\nZMjqizAAswwkizK36Nz78mFX6wYw+qRARQOdpeaeRLksUp+w8ezw3BxYqNhO\nu0Xq8TIvKCff7LtNIHARoTCAp4rdgs2KRGOUxT+DdZIDKyVOosKVYF5AWYAJ\nAmRjSpyXGQI+GPsGKsr/96EkY5pteTZ0BMy7YwqARdJZJf0IVW1T0JR+gtxE\nCqegshOrajIPqqxDladK6Qsg2fMZBCdWGY8Vhc/yrJk0eQprUd1Fq8fZJl8/\nNnNafGm+zvjmh2PSVJjleU+8KdLe3kQkEJvdoH8R0IgbpJjgSepGs1ZvK+TH\n3OqWtjJ3MRIbkbzj1sZbqK8+dXZF+uvECCDQTpZ4MwaZsD1sSclz4gJamcwu\nsiK3tMlVvEcioaH6uw0cgxbm9YaLwRvEfve8E3fM7pWcpvvUaz2/DgUIbQnq\nd1x4lxVFutvCDt3yicNC7zwdLc+YNXuT4IT2RAWzf01bc9a3OGij3saPVcEn\n+x6Gak11e9JJwzZUnUEwI772p3k9FG/Ke9N8Xhc62bYpHu7gSVOHfgSkHn9w\n55zNwTa000lkBPk0iKgvBYTWlUWLUco+CHynt0ycj1ZYVYl6nJ7IhnteqrZG\nyvro+sdmTDv3XE9ApBwVYki6yCrN3AKRW0isVnIkdaQwe1HmtKGprm+tl6cm\nE1Cm\r\n=WFm2\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"413c1908165c032ac95dc5456e70978d3994b6d5","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.20.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.20.0","dependencies":{"tslib":"^1.9.3","@material/dom":"6.0.0-canary.05f5e1583.0","@material/rtl":"6.0.0-canary.05f5e1583.0","@material/base":"6.0.0-canary.05f5e1583.0","@material/theme":"6.0.0-canary.05f5e1583.0","@material/animation":"6.0.0-canary.05f5e1583.0","@material/typography":"6.0.0-canary.05f5e1583.0","@material/feature-targeting":"6.0.0-canary.05f5e1583.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_6.0.0-canary.05f5e1583.0_1586393265782_0.5829547698825928","host":"s3://npm-registry-packages"}},"6.0.0-canary.bce00e186.0":{"name":"@material/slider","version":"6.0.0-canary.bce00e186.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@6.0.0-canary.bce00e186.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"6e2d497c0a09b643611c991a8de7f8704424982e","tarball":"https://registry.npmjs.org/@material/slider/-/slider-6.0.0-canary.bce00e186.0.tgz","fileCount":36,"integrity":"sha512-8Ay9mU2DR+vo+RS/BpJPpUB0XANITvQGCB/FtihAWj3IZT3GlU7OvzUxs7fVxKjDirxZeZslcIZfUwLyeBSJug==","signatures":[{"sig":"MEUCIQCmaxm9pFRbgFH6Ob9gE7/ri5ByRocFj6lmDKAhPAWXxwIgdrRJby7Ztnyi7t9tTUgp9+8t5LTY/2j6CgPl5sqG50U=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":371069,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJejz34CRA9TVsSAnZWagAALSQP/2XN33EkoFGx+i7oSZeW\nnc01cp06jgTmRyGftTpMXlfyznBUX/VgEzJO43Hk4MpHnBuPPUbFD8CYie5T\n1WY6grdItbjsVSUCT24i2LCXEFSIaaaqYssBghHBHCTMDxYy0vnnQhHqTjhX\n5e6Hyrp7u+35EbAiJRVTm7e8ANWld/NbA+TbwQC50u/0XUaUAA94WKitKifr\nO9nfdaiTG43EcbL15GP7BjsbGlpOVCL+dG2Vjmm3IFvC+jWBAm40ag3Z3SBp\njTp4cV4Qqy9VowTqkj3Ebpi3q6ggB5iXnxN1xeF1N6YS2EkM/VAEQfqD/Q4C\nKKy+HUZf/LtRZN/kALUVmJZtGAZ01vyxn15rgxO4KHf87KwIE5Q7Jwr55FaL\ndBL6jwtbj1TtwZwr/GHv+3mPIJK3WaLbQILGyRd2WaiZAyD0gfNJ1aWX7G2N\nPNFE4hjBtC/MBfvN02pFBgbVFCzblHyYYaAe4bfab81PstXlto2KMmy9/73H\nIv0ozaQtjVekJOwiYjKk1e8dOotZyVJdP8UAXEcLFyIAMDVFDgcee6VFwv2T\nJvHuDgx1bbAaCOeedsQ+MEeOQ7faGZxITamxOAgjv68fxq8tG9amuiye/SaU\nnHNOzxgTSGErSF8LEMnSZ+P2Az4I+wthgs9hcmdf55+JAn5+bF0ODvtHm0Gh\ncaa9\r\n=TDD4\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"36e6ce5271637d131432d915870da208d16bef74","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.20.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.20.0","dependencies":{"tslib":"^1.9.3","@material/dom":"6.0.0-canary.bce00e186.0","@material/rtl":"6.0.0-canary.bce00e186.0","@material/base":"6.0.0-canary.bce00e186.0","@material/theme":"6.0.0-canary.bce00e186.0","@material/animation":"6.0.0-canary.bce00e186.0","@material/typography":"6.0.0-canary.bce00e186.0","@material/feature-targeting":"6.0.0-canary.bce00e186.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_6.0.0-canary.bce00e186.0_1586445816259_0.16149872470969884","host":"s3://npm-registry-packages"}},"6.0.0-canary.927fa902c.0":{"name":"@material/slider","version":"6.0.0-canary.927fa902c.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@6.0.0-canary.927fa902c.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"dcac13b73d6946e385450344eb345d8047398a03","tarball":"https://registry.npmjs.org/@material/slider/-/slider-6.0.0-canary.927fa902c.0.tgz","fileCount":36,"integrity":"sha512-RLfC2o6II6xfjzXC1iX9CukZRBBaslyKbbPhUJEFjxLHggolIiP+cqmqb/WkQjN4Itj1GSR0Y++69/FMjVoj7Q==","signatures":[{"sig":"MEUCICbv6fXahpBWVyisMWskUNFD1GH1ujSx5nRQcaZQEiqqAiEA2xmOxbTBTP42/RdrnIG9dcXp317kQh37eS3ux9uIXdw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":371069,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJej22hCRA9TVsSAnZWagAAPcUQAJ0lMnA8qH5T/EHuVw5R\nNU2GELI1szbnuEcpxDA8sGrM05ZEkpLciWq2bO6mF1jTShWABADv6v0tuv0o\nfVEY1e3Eyy2uKMGMNuAGLC6g3iZmcmoCgpVLUdcqDBjIqIOPjcuGZnQNGTrX\nsSxhCOr5eXvmSNoOun9wsy9azBCcbOc/AWFOwzSCdtXKDRMUW/U4G6g5zKd6\nqCDRisoB1qEKB1XDiKdZWq+6E4eF4r1eEmRtb8rhiV92qxk1+tkvKQUxJWl7\nUkOiCNvO67a/jzDeDf6CabUKbnnwaPewck7soYM3PIkFmqW+vmBMYwqN7J5i\ntUT/Tdi8v4x92rmu4h034zLxSoozo4dApIegQxfTaLKaQmwSG/FFs7V2w2oB\nuFz2bO94IR/sZoDoocuXuBEBRXf58FxCkzBz2bvIGIL9FgZEF/rWBILgySTG\nut4YA9gIiR1CaHbOOgdfdhKCT2B1WEkNlU1YTVZ+A5OMCKnddFukr8WGieN3\ng+fU7x385Upoq2nk5LUuPCuKjl2J73U7myi8+xGHWT2Oh6jdbCKF0g+0yKFB\ntavpDcDomAhsYS85QsYdErvVj9feCVDrWnYjmp/20HGE6XTfzTv7auKsEyAY\nSnb32Crr2WM5JZo4df3Gfx0tFQDM3mKrkzhXtDIRZc+havrJJSMUgSf5DndS\nvWa4\r\n=FBVZ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"6993aa2a4786dba507ed6b641b4c059925b7ddfc","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.20.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.20.0","dependencies":{"tslib":"^1.9.3","@material/dom":"6.0.0-canary.927fa902c.0","@material/rtl":"6.0.0-canary.927fa902c.0","@material/base":"6.0.0-canary.927fa902c.0","@material/theme":"6.0.0-canary.927fa902c.0","@material/animation":"6.0.0-canary.927fa902c.0","@material/typography":"6.0.0-canary.927fa902c.0","@material/feature-targeting":"6.0.0-canary.927fa902c.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_6.0.0-canary.927fa902c.0_1586458016659_0.11197517790402456","host":"s3://npm-registry-packages"}},"6.0.0-canary.eb28b6ecc.0":{"name":"@material/slider","version":"6.0.0-canary.eb28b6ecc.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@6.0.0-canary.eb28b6ecc.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"cca15d2719ae2f2c8acbf4d04cf7578b5fdfba3b","tarball":"https://registry.npmjs.org/@material/slider/-/slider-6.0.0-canary.eb28b6ecc.0.tgz","fileCount":36,"integrity":"sha512-fsJWR58dSXcBmP/RWBTZRtgVkL9Ls68PztRhvbve5cjYAbZRVAPJlq3lK9ohAlkb0cylF83LRaBchYBpgiOQKg==","signatures":[{"sig":"MEYCIQDS7B2inqaPXgdj3sFYuOqI/mGIxynkdIWV/02kIvb68gIhAK1LxU+qpZGmKlvDi4PXoVGcaeL6M7ay7ThfOashKsUx","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":371069,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJekMmVCRA9TVsSAnZWagAAXZ8QAKB0kJinQdKfznv3l8tC\nZr71GP5SuM5aHZCzcguvjL83ov16Z07d9eSixHXI2As/wgoXtPpWqQiDicLJ\nHUjICWZbXkFg/XlMdOyNdF1hdqwfKwO+lvm/YQNsvRuz/ec/27VSgzCMEstG\n/7yPcB0JsFLae6L3LJ0CSWU5CFGPkJbGEaJcVBgaWQMHMLgt5cFOFOb6MEPq\nseC0H7nXbRXCbakdxYB+2yeD/7iJNwfRAWwuuPZbgffFwGnOYyDXqJfr6gM6\nMLGSa8aJ+cjuYn1csZXjiAhIDGoSkik8YQzYsqfVQqaRqxYow+o7YcOh1jYM\nUCiFFx9TtnjGl1GYuh9118r/MfRGrfVsfvoIvGDqX9VSje9C1KSOPeftAEUH\nfJ9atjt2vi6AG5d6Vrx/SdZCZ3tcGSvJS8VafpuvHSINcatkoAkFTfectPBv\nMAUvxyWvyMlNV3u5e7L1r1Vx8eqqVF6msKmKHoYwYv8CoeHx0ujJw9S1gNXb\nP01yeKQwLv9K3mIpBOu6T0X/Z0BaFYEpoJ5hCEgHJo+qTuN9M1vG1fk2Y3qX\nAWDOyCutoi+sBapjdLr4o4/EIuaSc1y9v5w31mpzrOrCF43EqVQgKqN+yZLz\nBQq5hmDI/oKt8Vgur/9uvzx95LrVdnxBW9il4IK4rh42S5hiIp//Df3+u+bo\nihI2\r\n=GoB3\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"14b97cf99132f4a85a978c1799a668eae031d75e","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.20.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.20.0","dependencies":{"tslib":"^1.9.3","@material/dom":"6.0.0-canary.eb28b6ecc.0","@material/rtl":"6.0.0-canary.eb28b6ecc.0","@material/base":"6.0.0-canary.eb28b6ecc.0","@material/theme":"6.0.0-canary.eb28b6ecc.0","@material/animation":"6.0.0-canary.eb28b6ecc.0","@material/typography":"6.0.0-canary.eb28b6ecc.0","@material/feature-targeting":"6.0.0-canary.eb28b6ecc.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_6.0.0-canary.eb28b6ecc.0_1586547092896_0.614483147478067","host":"s3://npm-registry-packages"}},"6.0.0-canary.816a43b42.0":{"name":"@material/slider","version":"6.0.0-canary.816a43b42.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@6.0.0-canary.816a43b42.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"d29215b23e75dd7bfe5fbcfc2a52e8bf254e26b4","tarball":"https://registry.npmjs.org/@material/slider/-/slider-6.0.0-canary.816a43b42.0.tgz","fileCount":36,"integrity":"sha512-10GqNJT8BEwL2H+SvOsSUJFE3zx4VfktJcdiDuqAc2ulD2Hb3Veo01FXdOjG0rvj169mkBjL/ibMlaHyCMX5ww==","signatures":[{"sig":"MEYCIQCAtIXGP/ZAorHNqhojUwx5791JbPWQkfu2MeikUkzohwIhANONdpQVC0F9Fxi2tdYZK9gOgaoV1MvvOnx3YJEmVUvM","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":371069,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJekNy4CRA9TVsSAnZWagAA1YAP/2ks+CUka+uiRO/9pZrN\nYJsm4R0a1Dm2SdEdhuPlwwKH0pVKFX5pfe1+VAT38O123Sy/wx8iYqlvKaR0\nKlMfb5VaCooEf4NKevT+hrEU0EC0cA4YZKKzGpsoUHkIs55Q7R4O2dcXHNLp\nuQgArTdWj0F3nlNCDOX4iy/0VvGmu/i9ktnRkUf7oL+MGI6EbrP4ivQQ8sJW\nMRoWxzgjftwbFTiMwdDr8UW049DRzSdcsDmZ4/XfYoLLK+lv+CwwntohX1zO\n/7uDVbdJ5DHDXpxQbnmBDyBQUBoansDo4PLOPvV3r6v6zfQ6Txqrruc/rf3O\n6jXjpH6B9fcwWjgSIXRogPnPGNDmQCXARSQ+0xljNO8Q1AersKy8zNRgkAq8\nQ8VK6mbx7AuL9jDOtThfrKUnJMK51MLkMiUe9OxLun/oew/RnlTnDzcvu5kf\nZzefYhmEFR4k9XoK2FYBTOydDJz4/4PXMWxAk7xoyBiapiEq5s61+mhwcmdI\nW2qXkjKr/FiXYx24qBuXkkEaa/De/gKDjICcS6Pba9qA+NCsqe44gU/+MjcO\nQM8SJXbEfDjn6Zgw9fv+QeQzUGsLnyZjqqZ45+03nVKTzdGdZjHZBKs8mX1F\nsz9ilAuyOf0b0c2/hpTUXb9iZ1DRJQh518Yvh++ajdG2S64fq98jxFUiubLf\nUyX2\r\n=RXws\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"55d118d08a4432484dfc732189dae38773d1f437","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.20.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.20.0","dependencies":{"tslib":"^1.9.3","@material/dom":"6.0.0-canary.816a43b42.0","@material/rtl":"6.0.0-canary.816a43b42.0","@material/base":"6.0.0-canary.816a43b42.0","@material/theme":"6.0.0-canary.816a43b42.0","@material/animation":"6.0.0-canary.816a43b42.0","@material/typography":"6.0.0-canary.816a43b42.0","@material/feature-targeting":"6.0.0-canary.816a43b42.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_6.0.0-canary.816a43b42.0_1586551991595_0.2979451489973921","host":"s3://npm-registry-packages"}},"6.0.0-canary.008c4d319.0":{"name":"@material/slider","version":"6.0.0-canary.008c4d319.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@6.0.0-canary.008c4d319.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"e571c157297b4d38954fdcfefee5357cb6d48837","tarball":"https://registry.npmjs.org/@material/slider/-/slider-6.0.0-canary.008c4d319.0.tgz","fileCount":36,"integrity":"sha512-dWAfYq1i28ufwPztsn8kyhXqDhZmaZ9Fsu5nMy1dqNwu+EVmPjMnvb5twNr7PXu+7qS07F9rHOe4ibGEBmmvTw==","signatures":[{"sig":"MEUCICD3Ef40v4tm2CVt/xFG+F2gBMnG0+U96Zir6vOJq6ANAiEA7yfyKr9qwnJb80YZuHhnTEpoOFXoX+XoaugFMZw8q+s=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":371069,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJelJSYCRA9TVsSAnZWagAAh/cP/RfEYqUzRMRV8lWNlbZ3\n+3PI1o01ZUclfgWWm1iGKfTOBCHVYmeBP1RTZC1ra7mXse+n8Ij7ili47iTb\nL8edi3kdR44nDTcLZX0VHDqGNnyhXyomU9VUXL2RDWzlut/dUcE6xl6xJcqb\nABH3OTVawbxqeo16Peb9FPcsyBw+Rc6uQpMpu2t7V9f4RN5hDLC1ArCd3vfx\n1HvGOYAfalSTGZzXpS8wH3EDGud90l6vWDMKVVUHarcFqLXXLKYQ78DBRvAC\n9OUIkx31YrnfRoxmD7eE3LYXSvny0KUJmnhlGFr0gssu/LjjMAxK4mNsbbWY\nA2loFf42+v6R2eCUE3qrXhNAXezwgVIs0YRXQC118LPJXiCAS/tTTTLTvx+P\nPN4JS8evH2KuCjNrcOTnURWt7gTuNbhU21zYAKdC6hQSNzjS3PWixX4RC6Yi\nRu6XdyeHBKLjUYkdfAyvANTLnOtDutepXEyx88+9/VlQZfFVg/ZIGC6aGj89\n9QpgZRw/T9jz0mUuVuMGgLpGA6XQ8NoSu4cpoT+p6FfJBJHOhvWPdcmuQu2R\nte4jXDPE8tAAa/27MDUL9YYffgbMn0eH8UPIbAmbvpSLjC8duiNzlKSpgP+F\nW0Y46o1B+tOBajzATzRc3V45h3x9vXzvS6uHM8ZCdcSECHlm3X0ZAonRaQCa\nwg5m\r\n=7OXK\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"cf7ff62c921da3167d96b5f7cc7f07ac2af41a19","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.20.1","dependencies":{"tslib":"^1.9.3","@material/dom":"6.0.0-canary.008c4d319.0","@material/rtl":"6.0.0-canary.008c4d319.0","@material/base":"6.0.0-canary.008c4d319.0","@material/theme":"6.0.0-canary.008c4d319.0","@material/animation":"6.0.0-canary.008c4d319.0","@material/typography":"6.0.0-canary.008c4d319.0","@material/feature-targeting":"6.0.0-canary.008c4d319.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_6.0.0-canary.008c4d319.0_1586795671519_0.013516793864669419","host":"s3://npm-registry-packages"}},"6.0.0-canary.cbb3f28ca.0":{"name":"@material/slider","version":"6.0.0-canary.cbb3f28ca.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@6.0.0-canary.cbb3f28ca.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"ce072d51414deb4f363f3cf74aef2dd92f0ed339","tarball":"https://registry.npmjs.org/@material/slider/-/slider-6.0.0-canary.cbb3f28ca.0.tgz","fileCount":36,"integrity":"sha512-D65Op4/jx0REGDjAdKds0j6JYsa2WjJKifcxdeJRKrARmEA7AK6CYmitXllxkJiGEtJGsIOdyBymEttYSSEUWA==","signatures":[{"sig":"MEQCIBaQ9IW89eqei3x0E40bL9H6QLSMKShSeIDPypghYyhsAiBSyQbHLAkUx5pYDTJe40+k7jxy2F3m4VcSrOQt3DutqA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":371069,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJelUTSCRA9TVsSAnZWagAAAYwP/R8vxZ/J2DE+5gRT6dsL\nzsp9XmszRV19YBiFLA3GDoiQ8/SP3PEKATPTTzXZaKRfdPONBTGLK0LuaaKQ\nFQ9340pF0iMArB3ZQxvFVMa8yn8PIu6vErtyrMud11ICnhvddrqAnj49X6/l\n6VfPc01a4REgj1Vl00ZrcCfMdY8yt8uVyqwkf4HDZsiElnVZQZ/Ziqf0rPR0\nmUOHusMM67k7tlqTFtJZmDczGN/ikOYyOKik5qWL2nrmt3W819x+O0I+WYXB\nnxBOC9/7+FbWqpIXdWlRD9Y597eT45D+SLXtdH9+XaLwdTukusG9WAuDshDR\nPjX2OwI9Fa821dgOVmuPem9/9fOKWrJMUmsNFRWeBcyE6NzcbVqQDgPEzAr9\n1CcAMqZb6jsLT+aoGKmpyaHY+8HR7QtB9d3nbnhaeqqzu7P5dRq0x2tIpY6w\nYNI3QlteC8oH7QFe4mp3BirfmKpM2q7vFGZMByDAhFz1oKl8kYanv7TriTgt\nuRrf7XkBalCjpihJzSy74Ug/sgezDcLbmrHsrbyxFPnpyaeQSJrz2+qizJQM\npnUZtr6/uJuJaFW+Cfbv2xgoW6F7+9EEwW8Lf28iR4qWjkGa8FfoeQQlVRSx\niYryg6u14ixkQOlIZAshuuKdrVoysEPr7B4nKuOOatLRA3+/vSXb2oskjIJk\nrbLR\r\n=veuE\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"b6cb89b18de9f28799535d82c5ebc759433a5307","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.20.1","dependencies":{"tslib":"^1.9.3","@material/dom":"6.0.0-canary.cbb3f28ca.0","@material/rtl":"6.0.0-canary.cbb3f28ca.0","@material/base":"6.0.0-canary.cbb3f28ca.0","@material/theme":"6.0.0-canary.cbb3f28ca.0","@material/animation":"6.0.0-canary.cbb3f28ca.0","@material/typography":"6.0.0-canary.cbb3f28ca.0","@material/feature-targeting":"6.0.0-canary.cbb3f28ca.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_6.0.0-canary.cbb3f28ca.0_1586840786333_0.33499794460255283","host":"s3://npm-registry-packages"}},"6.0.0-canary.f172b0f90.0":{"name":"@material/slider","version":"6.0.0-canary.f172b0f90.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@6.0.0-canary.f172b0f90.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"c21bccde6b8e29d0e7f3eb4ed155c2983377b167","tarball":"https://registry.npmjs.org/@material/slider/-/slider-6.0.0-canary.f172b0f90.0.tgz","fileCount":36,"integrity":"sha512-4n5XIH19jPgvq6ABG2Wh5IPoDiTuZYoCptLPrcpmMjAvgjaq2pzXO9Y+hQ7bR77v48Crc/LDjJ1CHViSmFGJ3A==","signatures":[{"sig":"MEQCIDqLz26pfXJ6QQYI32s+YH9f5ZwXQ2BaRrw2apHhFst9AiAziJqZF365UlXVAfZ2QwOtoGNvrJHaul3v0/mpOj1X8A==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":371069,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJelkL7CRA9TVsSAnZWagAATpYQAIGKE6zQ1BmoRjxAas+Z\n2evUb/SNsH2oYRt7X1Hpa+rf4JWGUI2NdxSrZaKRrnpFCg8VnwQtESK0ODSk\nTd//7erlWWcPrkDQyBQ2XpPP74h74sUIdRCBUZUIJusv+VBlGxf/ZgnT0X2N\ngi7pvJ+vQANYmrhEZ94qyxG50d40CoK7SHWi+dw750fbmRRiQNoMoS1/SAC2\n57yLmFGddHrdAVyvhzfeBOO8PmswDmNlIovDgCGPy1t65ldVYykJ+LcQyIeT\npxLyvV1qebQ6uvf9V9+67y++BX9Z2mO5a2zd8rUV8uoBmGvtBm06IC1VUuEW\nvWGIN0sofoZuG5Uvjh6WhU1+uguou5dT7ToFczjtxag7t0ATDBA7FlZBIav6\nlC8fnDed/wD+S8KsCtObpo5qOUzSGti9eTKux8fI6kM+AnCnVGd+h56RYMnG\nLL18aBdmuBiMoVXri02xdWRVAZGeySTsxa9EaXMyOiLIzIfCMZQHV38pWyhj\nB+uNCyqPVY4cQiWDjrFR2xVX+Mh7R0qeFROmQIsjNYJdYYfB5wFPzTR1YlmO\ndWqcL8PfK61Je2txAydJ6b5ce8hiBpHkNUP3TwXAeC8DDR1MUWMEe/Db63LC\nE+xM2ZMqClzCcXqZBKVM4UctP6yTdyDREYTWmaZ6AM71RnCRADw0ti2P2BTo\n4PVY\r\n=UNF3\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"eaad6fe33949c536d515e1177cbadf504619cfda","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.20.1","dependencies":{"tslib":"^1.9.3","@material/dom":"6.0.0-canary.f172b0f90.0","@material/rtl":"6.0.0-canary.f172b0f90.0","@material/base":"6.0.0-canary.f172b0f90.0","@material/theme":"6.0.0-canary.f172b0f90.0","@material/animation":"6.0.0-canary.f172b0f90.0","@material/typography":"6.0.0-canary.f172b0f90.0","@material/feature-targeting":"6.0.0-canary.f172b0f90.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_6.0.0-canary.f172b0f90.0_1586905850599_0.7742097766813449","host":"s3://npm-registry-packages"}},"6.0.0-canary.c02642273.0":{"name":"@material/slider","version":"6.0.0-canary.c02642273.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@6.0.0-canary.c02642273.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"c64879dee36090c032ee074b1ef653201eac5344","tarball":"https://registry.npmjs.org/@material/slider/-/slider-6.0.0-canary.c02642273.0.tgz","fileCount":36,"integrity":"sha512-xmPtNjQJsoY9s/QWTwv30XY1lx5SsNEMjzkpsV6ZT4nL8TmwYisCDtcAmWKRKEfWjcmsL2IZPOCIIN85HPYBlw==","signatures":[{"sig":"MEYCIQD5tMKpRkLoGXN8Nk31e3tK3wQ96mOIhfnVL61iZDCpOwIhAMq0ElckQvyX/VCYP5nPqPOcUV3y4xeOx9ZEl2NG84Hl","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":371069,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJelzOyCRA9TVsSAnZWagAAvQ8P/1QgxQDH40T8zF/AuWwa\n9UwCmyi7j6upAEIDKu+ucICIiFCZvxQsn+K2V6pyLaCDPvOWScE1YyY5f7/X\nKI8pGQXIQOOS3IuXsXzbxQnpDu8wcDMfS1Vq6Gt1NAMDDrhG5q1Sv9Hk+O5e\njTIQ/QfE5iY/QTTkjeV0NOCG1ABHu+VToN8FFZXn1OWUXaLRyYHeVS9XN0na\nhCjfnMvRQh2M0ZTg7OkySnlnpY2Wgn8amxfDnLEItLlbMWD5q2GQ+Aq4yfvP\nKE8GYZH5iwjFgYfA6jlhDgy41BPDXrUw3aUtIfNw+xs/FHYYinPqznes9hWg\nQ8oErkWUo6TKfnP1zDR1kewtQ4NTF+9hmtU9k4ZuG9bQDg4dH1y7jeW3f6Ik\nK7st343Oq3cusY7UldemP62yP7yUQE/9eji27ox999+i+LSxa9f6IRafx2Iy\nWs1shMLt9EvVVaIkZVN60dov4GoR4lGqUUXYhOAQbNuUO6CWnmH6Sh8YBgAp\n2pMSD9QUMmjyR/wWHiqYp1WOkW/S2Ha/YNHLq5H55CbdoNqKKq64E3bACH3Y\nt3V7k7lh36TRsIrQe0LepAGMyAW4A50HCclTn3SUNNVjd0EZUuav/9sAyx8J\n15AlqShXXjAAV5zNapIpfBjMISy3cEPbNl28KJk+VxQCdVKjnH2SPEyB/syf\nrKQO\r\n=7m23\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"b648ba2f886a5d6cb78a9dbdb435d18b5f600bf5","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.20.1","dependencies":{"tslib":"^1.9.3","@material/dom":"6.0.0-canary.c02642273.0","@material/rtl":"6.0.0-canary.c02642273.0","@material/base":"6.0.0-canary.c02642273.0","@material/theme":"6.0.0-canary.c02642273.0","@material/animation":"6.0.0-canary.c02642273.0","@material/typography":"6.0.0-canary.c02642273.0","@material/feature-targeting":"6.0.0-canary.c02642273.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_6.0.0-canary.c02642273.0_1586967474243_0.9429376245669683","host":"s3://npm-registry-packages"}},"6.0.0-canary.8a299b568.0":{"name":"@material/slider","version":"6.0.0-canary.8a299b568.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@6.0.0-canary.8a299b568.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"37c8541c63e7d957ca478587af75f65e8a855c88","tarball":"https://registry.npmjs.org/@material/slider/-/slider-6.0.0-canary.8a299b568.0.tgz","fileCount":36,"integrity":"sha512-GxfLSEioKyiepYSDA2mAf7mDwsuDVb2LPzOkIIABBK8GTSZwpyANmKNtKr//Q3juy5jLngb4aB3cZagwjdYHAA==","signatures":[{"sig":"MEYCIQDPrUQTNUWxmZZ1kkdKCRiorkBvYsx0nRm8c6x10CyCMAIhANP2JI0d+7ud0SfXrmeEhznFV5D5GKLbkJiw7AIBHCCH","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":371069,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJel44hCRA9TVsSAnZWagAA+7IP+QA3R1J36V408Lh7bBft\nQEBnALNmjDQ0IFTnSmlVF8kHcoVIvOsUWjrzWBiwn4tcu1qM/p36G17EMlLD\nfApl4xVVmCoDUV4W/XSPMuD1KbHkW2tY38P7LjPpSi2OfAYk5lgRAv5tKqRo\ndEp0iEs+bpOHBG+nfAOe+it9SKAohWZfaF8NO1kuXk8TYeP/W0PZ4/HlyzYU\nL6IBq+N6VttsgzFfjNYFEuiSuViJeDbpV7yYaLmmxMk+aSKewIBRi8k/q/J1\nUykNceNC9IDXq0ViBQBQ1tGbhi2oBliGCRuoH9VlUncNfvT1DOz/3IYL0AQB\n0NY/a99n+idY3MDcHRSN4hRxHvsf/6sHMhiwA26rFAkoxE0NhHxuOCdIiNPB\n5qdo/PjqnKN/kKmp1O1oBUtPixcLfKJ6DdAgc1zqv7bWXiKn7ez+Nk8y+JeU\nJMze4QQ+25QC9CB3gAJWBVAVjQBamFP2PbdNlfxWiR5le2pTi+5dbj2mmdH/\n+iv0Z7hkRYGjTx9UdCJS5UZJFarFoCJ1+uJMg460B0l1Piaud6n3GeoXSlyn\naabUE+AYxFiOa7kztpGI7oCjwi4CdklJSgJWWyPYvw4r80He+i9nhBwxVCW1\nTcU+UYEFFf/frL96beakAn38IKVO8DRxYgcUdcdeMfnPVlpWzz93TQri4WHU\nZruO\r\n=FlxB\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"1cce57afe783f6d0ee960b6d55080fccc7424cb6","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.20.1","dependencies":{"tslib":"^1.9.3","@material/dom":"6.0.0-canary.8a299b568.0","@material/rtl":"6.0.0-canary.8a299b568.0","@material/base":"6.0.0-canary.8a299b568.0","@material/theme":"6.0.0-canary.8a299b568.0","@material/animation":"6.0.0-canary.8a299b568.0","@material/typography":"6.0.0-canary.8a299b568.0","@material/feature-targeting":"6.0.0-canary.8a299b568.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_6.0.0-canary.8a299b568.0_1586990624751_0.41087892254978886","host":"s3://npm-registry-packages"}},"6.0.0-canary.490fbdc09.0":{"name":"@material/slider","version":"6.0.0-canary.490fbdc09.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@6.0.0-canary.490fbdc09.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"2489969baae2f791fc977737622dc61b99b0b234","tarball":"https://registry.npmjs.org/@material/slider/-/slider-6.0.0-canary.490fbdc09.0.tgz","fileCount":36,"integrity":"sha512-hz2BabXDI8cjc3k36PzICMMWTa7L5iZCfnb/1Q/DocUDLmKd1JXQrMisb9CQrSwcWhkHirFe4hSerm7aSbm0sA==","signatures":[{"sig":"MEYCIQDYYs9+PsPSNvo8LxcHKtUOd3YwCW1AdGL/V6Vc0gSeUQIhAM1EvLa6bh/lSVGd7L/SvjBbRwkM5d/gK0ZFzrhiY+0B","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":371069,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJel/RrCRA9TVsSAnZWagAAAbEP/j1VXGpIj70HuC3GleRG\nmsDY+NosxdQvyXAr+dR5C8qSRK/FHu50zvpHlwQGm9UTVdkFmF1MwwMXtX+w\no2QzSew5szcx9oXBLnfejm0GYtpblkePJNBkTDRQMF+UmDDywxSndh3zgcip\nVxOaqUxdfPctHutZ90yxmjFSTR9+SFPrIpiM5LCgDDkGnI87v4cwLlgGpURF\ncvrdg6Vsj6WlPrVqHuss40buYNCL9zYgJ9vXMstw95e9Py6wmOAVTHHHD9IK\ndWcZxjCpQ0vdhQSu9T267Xl5iToJ4JvZAfPGAFn2XO+u8m7ats3lXtkZZ253\nQBXD+qopAlb/WHVWOT6FSDQMzlT/J3GTbCzm6m4BfV08DGBrJF447oXDjWR7\n/Vpdtz0mCeO4ec0AFQJfIRB+xGsCF7FlgDWwEDISLjTaOpTkzO6BCIYFAwLP\nJ6rdFvaDPSi8jEZ/SLld/ip80CwXdCsK5lDR1BmipH9BClk7/qX+YnCRwsYi\n46hBL/e6YfCZVF+2khTfIfOpIjOewLJZ/xnIsXuRLmV9d7XJ8pQtK3Yz/Oj9\nyOLSBTpolhrp5CVc1k8sm5rGfQBHNp9hfHWePjWy1ThGp3FrxqUkX8/9saSF\n9yX8RgRt7uLhUxb2omp25/GLxSvw9sh+sb35X8s/TjMYnIts8NWHgm7H8lQd\nX+/l\r\n=1rqp\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"20bba7dcc3290528bf225184ac976a3b486ccc00","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.20.1","dependencies":{"tslib":"^1.9.3","@material/dom":"6.0.0-canary.490fbdc09.0","@material/rtl":"6.0.0-canary.490fbdc09.0","@material/base":"6.0.0-canary.490fbdc09.0","@material/theme":"6.0.0-canary.490fbdc09.0","@material/animation":"6.0.0-canary.490fbdc09.0","@material/typography":"6.0.0-canary.490fbdc09.0","@material/feature-targeting":"6.0.0-canary.490fbdc09.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_6.0.0-canary.490fbdc09.0_1587016811260_0.5015860497218341","host":"s3://npm-registry-packages"}},"6.0.0-canary.f838c6e55.0":{"name":"@material/slider","version":"6.0.0-canary.f838c6e55.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@6.0.0-canary.f838c6e55.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"02bceda7020ba8aa8dbadb77ddcd3798b1d5f6e6","tarball":"https://registry.npmjs.org/@material/slider/-/slider-6.0.0-canary.f838c6e55.0.tgz","fileCount":36,"integrity":"sha512-fAhViWh+iknh6H/kJkQo4s0wQIuAdQybT7y0qdHypLuJbTxfWs2Ip9TDcBMaWxGVCirMRwbgh9dlpTFaxxgckw==","signatures":[{"sig":"MEUCID6DpGboOuoXedGBrWvZS5rGkuOJ+vNELN2p5PA1kN+tAiEAtIf4EE4gOlpRHtbPnXQ2uuPS+zfNV64bbSskR66tnXM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":371069,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJemGtDCRA9TVsSAnZWagAAyLwQAKKbmfk0KDJEm39razrN\nF5rzy5B+YuB6fbgvNo2vkAdux3dZIgf7FajvMNQ4N1/GHzhwaSouWK1pLDeM\nEnKfnRnhPhLhJJCEjFderNVxHiMxPM1Uqs4kui2rI7jBqvqFaCRg1WcGMuAe\nNjtbEoiSgh1DNCuGr7GGF5UQblpIKTPfSOeJeOkjWTjVrBPG5c2A4kftnbr5\n6Kj+Chbsd+YId9ZrSClQ3kscNBxhtOznLw81F+O6z7Vp8qkYFwU4oXu5WdTq\ng+nR22x8ia36GS9y+XTT4mpqn0KbN2ErJhCvxg57mf6cZzRxtlhuES4oyMjt\n+yRgDc3JZKDrkW1F1nG2xFAHbnEqITuvQBAlUq0v9HGDfBGmDaeu2VLL+qJb\nrIqPuS7VkdoMnpv1No/Zc9DlSRGWohWDNny4IrXE+m6aci3jU2deI1fHc+eR\n1+BFmWvN3iO//z4D1e346aF9Nf91ECjKav+MLpK7BSTrpHnbe722h/yMaLbx\nllGAp1Sq2oTntnSE0pabsMjUiFu7At4CWYNE/1neZP03bundzuKhIL/v0pQ6\nGpeuufjO529Nav3K2Q4p/a130AZBQErj22t/jFm3WuLorBnLPTmAPYqIPXfN\nNj5U/yqA1TB2WfL9BkHjw2xdOwgy7pUtrt4mNCXKhHXxgTbmc8uvwIVnzzsF\niZr1\r\n=lvGp\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"4088837a2a2d0b4af544090557a8266202e13a8c","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.20.1","dependencies":{"tslib":"^1.9.3","@material/dom":"6.0.0-canary.f838c6e55.0","@material/rtl":"6.0.0-canary.f838c6e55.0","@material/base":"6.0.0-canary.f838c6e55.0","@material/theme":"6.0.0-canary.f838c6e55.0","@material/animation":"6.0.0-canary.f838c6e55.0","@material/typography":"6.0.0-canary.f838c6e55.0","@material/feature-targeting":"6.0.0-canary.f838c6e55.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_6.0.0-canary.f838c6e55.0_1587047235359_0.5278570473324158","host":"s3://npm-registry-packages"}},"6.0.0-canary.ce6cb7024.0":{"name":"@material/slider","version":"6.0.0-canary.ce6cb7024.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@6.0.0-canary.ce6cb7024.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"cf12035bf92093bb52d97d3c5eb16980f38cc9b2","tarball":"https://registry.npmjs.org/@material/slider/-/slider-6.0.0-canary.ce6cb7024.0.tgz","fileCount":36,"integrity":"sha512-b5EzblHGMVp5rmYprATz3NC7RTUmIFQqBpHSvP8heUXrTVP4diQTPP28c883Nsmjt0bXRG40coJTbIcYk00Aaw==","signatures":[{"sig":"MEQCIFBMiWAYnqx0RAdT3ruoYzMM+zh7cxolZxT8dzNIByluAiB6xo2lxGT3uvAY/JZ2SGaTARn9Gp4GHXNPdJn3ndVoxA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":371069,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJemJOrCRA9TVsSAnZWagAAN+MP/ianB4Kw2Jpt5+ce1xai\ncnY1K/+uCuvfSmtdZmDFFFsg4ooQs5WTqYjtE8/CiwQ0ZU5Gj1rHRhO0fTkS\nH39CTlgSy9rLsRpwACLAErYXwUWJ8SynN/4EZjbf04fBw+HU9T3XB9pStp3K\n8RGFHL7+8938wLG6KNNONNcipN5ZUVt03pzytKsu0vf+fkoaCuWjn/uBRCy8\nAaSzWY57nJFfZ1iuMvs+Sshe/cWZKwi5mKTy1g3FVmksGkJUPclq5YcBWpyT\n0UB5Ea7KsUq5KwpS0YOEAQ22NozsZF60zLTUFpmfRviWL4LcPBxhp+s//TyL\nqBFKcxY19CawjDaW/vXnFYZNqNupdNnN8NHrz9RxEDbM2OoXVrHVD5Pteojg\npipDP8p9n9GXuRFDOkD5WH1jyBXejti/zPKgcwr7zYiuBS+dyX0B4uCeuJUy\ns6mIHJyhFmlm+UqqjPaAoxOhGbHLNxXp1ITbrrTOkC51Nj5uxA7HDc7ABwyS\n+a06mCSDRAA6bwoM+Iwm8nooC4wk0EjGjzZJemBBcusG2skRkqx3w2Ve0vbU\nJ/wAIrQKoWNCbEhQTM78SiIrRQ5bCzIogcFs78C/fDOLnzmGrBof+hi40X7r\nVJCv39xEdXDI8vxWIhy4Nra9ss679PszJ5d+PKeKxfR70MbZGOxi+CIYLXKr\nTAbH\r\n=XtnY\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"50c11d42dccdf93592bf97e9211f34d95983996a","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.20.1","dependencies":{"tslib":"^1.9.3","@material/dom":"6.0.0-canary.ce6cb7024.0","@material/rtl":"6.0.0-canary.ce6cb7024.0","@material/base":"6.0.0-canary.ce6cb7024.0","@material/theme":"6.0.0-canary.ce6cb7024.0","@material/animation":"6.0.0-canary.ce6cb7024.0","@material/typography":"6.0.0-canary.ce6cb7024.0","@material/feature-targeting":"6.0.0-canary.ce6cb7024.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_6.0.0-canary.ce6cb7024.0_1587057579153_0.28082798271609466","host":"s3://npm-registry-packages"}},"6.0.0-canary.0ab62a65b.0":{"name":"@material/slider","version":"6.0.0-canary.0ab62a65b.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@6.0.0-canary.0ab62a65b.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"015f0537688bf9ab448549e35dde02a5316d46b4","tarball":"https://registry.npmjs.org/@material/slider/-/slider-6.0.0-canary.0ab62a65b.0.tgz","fileCount":36,"integrity":"sha512-0uw/uXdFu5fUBD6lqxZoloOmIvpKGKdhqGbdmFj2wPI5wY7Mi/bXjl9zAO1CFQ2wTImVEwDoAb5KLz1LuPE4ug==","signatures":[{"sig":"MEUCIQCVDeHi6MqivB0EuTFba/W0B7PqC+O6H9pB8thsldzM1QIgQ38LXTJ60ziRX6INZ+3BHva7Q1xQQLgLydDh/CpfG6g=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":371069,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJemKoECRA9TVsSAnZWagAATzwQAILB02hS2s1cPsYy6P6F\n4vVoi8ZdAIvj4pWOpADFusbvYZdQKrv+5eHWBrLcT3sNxae8VHrejV9DO6nt\nr/Zh98lzuHDnfj262hhTihTBPxLST0i56z8DiuYBYzPLg8n4FDKbDjfYlTh3\ne+xa0xDxhAZxEUiwKuzzzipW3Kq3ufgXgabJhJzGqzAemicxHJotLI3dQIya\nqj1lJtop5NqgkwrnR0qlVih2DiIPPLDWEnzBvJfzqAwdpLW0peqHoZa5lJE+\ndABzM3kVZQWXNV9DBPcC999ax/CGJAEHLe0vVilwvnk94Q711uKvHyIausX4\nS0f3rmGUTsjR1WYGn8OUk7unKk+u004yxfd7AVDIrgXIChHkkC5AGWQRcjqh\n408pYDz+L76L/CMtPi6ECB2buw0uZxFNml5OtkO12HQlu8xBlR1AN1IYn9Ib\nNea73kKqAHzC4oLTYss6AkFlcDZQNDju46iEX0k60MGxKNTC4PxoR6+ht3Sn\njbdSX3GQRqsDMLXlvRAhHhGj0VB6KDA+TTfjrJ8jVV2J0KPL657ynIrBwV3N\niTWXJcrO4ZJ5+9yxPrSJf/MI+RX3ObVk/9PHXpK0HcGsF/hlEZ0qrrRWNbzU\nxhYl/iLuTkZCV7j7nCFiN5ELjHxTx7Ql/6zOOcbLwNgsh3Pdk87S9UuPeMCg\nVIzq\r\n=+HGC\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"f8890ca1119e1fc3b197f172b8273c05b5fba35d","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.20.1","dependencies":{"tslib":"^1.9.3","@material/dom":"6.0.0-canary.0ab62a65b.0","@material/rtl":"6.0.0-canary.0ab62a65b.0","@material/base":"6.0.0-canary.0ab62a65b.0","@material/theme":"6.0.0-canary.0ab62a65b.0","@material/animation":"6.0.0-canary.0ab62a65b.0","@material/typography":"6.0.0-canary.0ab62a65b.0","@material/feature-targeting":"6.0.0-canary.0ab62a65b.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_6.0.0-canary.0ab62a65b.0_1587063299645_0.9876095547596473","host":"s3://npm-registry-packages"}},"6.0.0-canary.ca61b656f.0":{"name":"@material/slider","version":"6.0.0-canary.ca61b656f.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@6.0.0-canary.ca61b656f.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"604fd2b6556354ac310da157bd0cadefeadfdda1","tarball":"https://registry.npmjs.org/@material/slider/-/slider-6.0.0-canary.ca61b656f.0.tgz","fileCount":36,"integrity":"sha512-4e3rOplRyQTxhka+vSgTOGbHJMCup9snIOcddbut/E1U5mQdEEvEn3CJaGLIQ9Jr8GzIwqCfnknM4vMtzVIyug==","signatures":[{"sig":"MEUCIQDHyy3iMDBYFaD2dVZrdHmgtWq/WnAUGdmnnjyqweuURAIgTTeiEZOmYiBulj9uLTpGHWurLyAYeEzrTmlVoUawZSc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":371069,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJemLliCRA9TVsSAnZWagAA6+YP/2QW044QCf3d2t3l2/YY\n53CqO5sB8/0MBqVQbGHzLpLwY7TVA3EusR6Tzj93Rn/CopjdOrv2DukQZv5F\nLF72gjfXzl5jEd9s1rdhAq7eWQqSiNac62h2wcCPIiWXUnr1eQo3SGoXLFL/\nwc5lLV+FPCshmrstUTOsvGVDZ2jvuVVNjK0Zm2MDB4x25gKlhudo9D9vAo8X\nyRQohnS4eK4udhHxnRKWyOi84rNxl3y/F2Xww0pdb2TyMTnFt8uB8PK/wGbh\nwyWq5ByaOSAY8d3OZ2uO/aEjQ9sqQdDd+ceEFBw/4idigvmfFHcI3g+WaeJu\nhxM3mVB9IePIBqTdKeU/jqseRDns8ai/4AZRxAHFs5Nj0zdQuWtVmZFFEzR+\nbTraFYrnWsWfwxeuJ5D4J7rU1KAzHFc60PVCAUCNyy6dtnF44E9JkvJafw1b\nqu+OLo67WDhfOD9UE4BhC5GysSmj704C1xqfBckMbQxmTLtzUyRn9b3MmrK8\nZeuTwC0bqOCj5qG41jSeU3Gw99f3zoVlZa2+3/W1XCOFTw2fwNn/weFHzez/\nhqKFuZ5gttQZ+mSubKmzp4a7wAByu3dwVeOpGm54Gll5Ht67lReysuO+cFoE\nPqlQtWavDw53hBmPs0nGzjjxYx2dWizcNIRpOOr5JIu8l2w7oodz8PYCYURh\nraAQ\r\n=EhaG\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"967c93bd4843f43b3821bebc6113ab9c73533ac0","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.20.1","dependencies":{"tslib":"^1.9.3","@material/dom":"6.0.0-canary.ca61b656f.0","@material/rtl":"6.0.0-canary.ca61b656f.0","@material/base":"6.0.0-canary.ca61b656f.0","@material/theme":"6.0.0-canary.ca61b656f.0","@material/animation":"6.0.0-canary.ca61b656f.0","@material/typography":"6.0.0-canary.ca61b656f.0","@material/feature-targeting":"6.0.0-canary.ca61b656f.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_6.0.0-canary.ca61b656f.0_1587067234206_0.5143017641079002","host":"s3://npm-registry-packages"}},"6.0.0-canary.45a6615e3.0":{"name":"@material/slider","version":"6.0.0-canary.45a6615e3.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@6.0.0-canary.45a6615e3.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"7922cf16afcc273610bce18f3c66ccc230e5a0e8","tarball":"https://registry.npmjs.org/@material/slider/-/slider-6.0.0-canary.45a6615e3.0.tgz","fileCount":36,"integrity":"sha512-8vOCp8FnemeEAI6BQDzM+AtRyZK4lMzWpV6pwOAIMKjlfWGOWBmtQr6RPaiT9ff7p6aajYRMxBalJQvOCvHVrw==","signatures":[{"sig":"MEYCIQCRqLNOOE8lfN3UfeQSDW1Mi8uq3gll5H3GDHqxn8PQVQIhAKLfNsFLoAxq6XwIfgYWjSuhb0vDoxKLAX9KE7Jb4Y7i","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":371069,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJemMESCRA9TVsSAnZWagAAyEMP/itrtYnEZIqDVoqQIVq5\n7klzRh1pzAjOYbq+JiDa8My+3pw67+EGmtUXoIuB6rH0qE6PoXwncPEDKGpH\nRjayOSxs7E7bA0Reup1wOQ0q17QQaFh/V2h1xbjndnEIdMhe3ESkKrLCzdRh\na16+CJlnHrGyilMPR7/jsM+MYpdDC6F5r5j1lY6BquZm+qNEtKp10paaWZFD\nskZpQLvbP5XNyZKmt7fxhqWg3eJmaBxKzOgIXfyETQ7YaW2e3+bPzRzDHMfH\npkRMLelOGyd2lknUq28j35qkEiOsrZIRwdR4ZjUAJwtJ4GiicoHfyetq5ipH\nHG0bbPGPFWG7L9ux+u2aqeyoTQJVZE/YOnxteKF6FFoDmrV9U/zeD9SK3dho\nOZbueGiOiy9oCV8FKOSIxX5SCB1inJARo0ypYZlgwxmxg7o8MfzLkboUXSES\nsUv7uY+sbekG4Znu1ofwuy+odqNb/CfpRqK3pXGyoJBt50sFtntTuzCrsd+o\n8B6Z8D6+Kg8T+8vjn3jtj5FJqAtOJg2taRiVx/7qPGZz/O+8MmH6VXEGlkzD\ncXI1agcPjaQSoBHqw9yY1rbgyD0GKdZmJIZLVCZw38b/Pbl6M0KBHA3BEgIO\nqH7WDShvWRRf1bMT6YLYvuzpe10Z3HhBuADLt1WL4IsMOSBaxa1fZ9Hp5vfI\nLCP1\r\n=2OpQ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"0ad3ae693731b43b2c055b2fd649a42e03abd2a5","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.20.1","dependencies":{"tslib":"^1.9.3","@material/dom":"6.0.0-canary.45a6615e3.0","@material/rtl":"6.0.0-canary.45a6615e3.0","@material/base":"6.0.0-canary.45a6615e3.0","@material/theme":"6.0.0-canary.45a6615e3.0","@material/animation":"6.0.0-canary.45a6615e3.0","@material/typography":"6.0.0-canary.45a6615e3.0","@material/feature-targeting":"6.0.0-canary.45a6615e3.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_6.0.0-canary.45a6615e3.0_1587069201602_0.958970094232297","host":"s3://npm-registry-packages"}},"6.0.0-canary.4b04cdb0f.0":{"name":"@material/slider","version":"6.0.0-canary.4b04cdb0f.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@6.0.0-canary.4b04cdb0f.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"17afda52ba65bf0258fd4bdc5760fb4fb0268c2b","tarball":"https://registry.npmjs.org/@material/slider/-/slider-6.0.0-canary.4b04cdb0f.0.tgz","fileCount":36,"integrity":"sha512-BpKZ8zzkyjCEpPpeh23oUupROnEqGU4xxTjpxfO0sEKKpz2RmSDSUHu2aYGqBFOvJZCurKr8JrPZlpBVaFL30g==","signatures":[{"sig":"MEUCIFjUj5VvfBhKSv5Dc6kGDcDNzrHSdZANcrhA+LuEp/pfAiEAln1WpliwZ9ztmo3/OmNWkDA/1/QKQ9KzpZuKkZIoVe4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":371069,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJemepZCRA9TVsSAnZWagAAkU4P/iogRJV0oXNakfemPrn6\nAJ3l64yS0QrBUvXy3IvX/f835lDQZocZHl3b/BVDoN39VnL3uXX7gEnaDHgp\n4ma+1qkE1pi2rIMO/nyjWeK8gSVQjoHB9e15YDSfjztJH9XvVXdN6G9MJ+Yn\nGt//he9VcgZenjJImqRyyiCSayYgTXlZ5EIgAOFwLxa8mSp/QyQfpId2o9YB\nm5jLpkmv9HWbhie7udns70061ynrxx8RjQ8Zk2oqI9ycBHMVf3PWZKkLsXhp\nl0kCZeMLcUaG5MyREf2/7TsGLs3I+pNrobBH+N7Q4faBzynR1sDpqF8SjJqA\nChRKuDR+PRVYET34ocyg9ZfNp3PGjxQXqQuGaLYWq6v7gljDeFdFUghYBNp6\nZI2hH6LrDUgSMv8yTbKO4exk/V4p9lT3FPRhyiQySYabdV6H/sd1yyw2i4uZ\npCHZPtOje6ULUAr4EGeE0ljhzQOp4WN3xcmDXh8JtNpL3vsHxajK8Kw5LToL\n2nhcjpMksWUH47/vSKmBl/W95RZ5OijnAaySFBaWSHQiB+DuYc/h3tZYpe3t\ngCQQHcx0X6zM9vTy8iQXAxE8Uq74xLjCXYu0n5cf23yy3yjF8S/ixOm3V+9k\nB7e0UQGf5cuUEisP/HmY71h7QE5SSpuefjV+v39mQ67apd0Hy1QpwtkKCLXS\n5yiX\r\n=TKiA\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"bedcd48d2eb94c37211fc93847852f5261655559","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.20.1","dependencies":{"tslib":"^1.9.3","@material/dom":"6.0.0-canary.4b04cdb0f.0","@material/rtl":"6.0.0-canary.4b04cdb0f.0","@material/base":"6.0.0-canary.4b04cdb0f.0","@material/theme":"6.0.0-canary.4b04cdb0f.0","@material/animation":"6.0.0-canary.4b04cdb0f.0","@material/typography":"6.0.0-canary.4b04cdb0f.0","@material/feature-targeting":"6.0.0-canary.4b04cdb0f.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_6.0.0-canary.4b04cdb0f.0_1587145305162_0.2437942076201769","host":"s3://npm-registry-packages"}},"6.0.0-canary.b273afa93.0":{"name":"@material/slider","version":"6.0.0-canary.b273afa93.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@6.0.0-canary.b273afa93.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"59904a2583b207adb23388a3bc103e0759e6d9af","tarball":"https://registry.npmjs.org/@material/slider/-/slider-6.0.0-canary.b273afa93.0.tgz","fileCount":36,"integrity":"sha512-lIuhSpNIq2l5Qi6Q1ck53MIZt1H+7dZvdAyijvXqvXB00mxki8yhtS0PgzTLbqhBkMfcz/R2KynQ1wbiAOXU5Q==","signatures":[{"sig":"MEUCICf3QJ0vyBmIXs/dxixLilC9F6bC+qsyBtW7dbxFrfbFAiEAmFY7aQcCKOcc/eQE4t+K/5a1j525sFxqd3JYpfZYawM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":371069,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJemjW7CRA9TVsSAnZWagAA3pgQAJiEuVyQl7uVN8CbfUFq\nM4BzjC6I6gPyHwdllr4SiqLIWCMJwuK7feBcIkw+4tBDTnh6Ad2NQaZyPRK+\n8HBUDkjFYbohBJRT1M6FzwNNdVMkNLELz9cW5xKcoT/Mxs6Q5OfK/4BM2v4I\nosgKqPqI4nll57HGscPqLU8g0FLl/J/Byp2zNiYjt9KoSOqwbgZ0UaLKwkxV\nNII58YO0bEKVHD7kJroR1NWRi5U13uXVnvYAfMJNQfy662vfm4VAYBiZbZ5R\nrYGZLmbLt0jYhbE4EnBV25olwgWFLbn/kZcVpRlTmBr4ZlASbLq9B0TIuP1Y\nVxqQs0jRITa40wczE725tbFw42A5zgm4xehzNsB4bfSQI7/AMKcytAWoVNcs\ntiSZEwTP2oVnc3fF5ksxV7VIgostGIa9VKcCIOL+JhTXL3ao+PNyKqIxbR0D\n16QPAeqmcuvq7iyDtJLUmJMh4k36t1Mv13JYm82JM051ZEB20mted5Hbp3Xp\nc7Xx9Naewd90GgvDGCaK0ZvDl/0oJH/LyZj06ukHpROE6sVj8dc+7gf9ET40\njYKmdyogUjOlR7WAj3GlCjyJCynl7JQs9aV+iym6s8RDtpsQk4Jdu7o9PNS2\nvZuNP6yIhH+YlZHOZpvtlMDCapXz5dheKLlT/xhsfNSravz+b/zbqlXRVCMa\n0ij5\r\n=23+V\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"446d7bb0e65fdc3259b7b9025c6c058731ff02c6","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.20.1","dependencies":{"tslib":"^1.9.3","@material/dom":"6.0.0-canary.b273afa93.0","@material/rtl":"6.0.0-canary.b273afa93.0","@material/base":"6.0.0-canary.b273afa93.0","@material/theme":"6.0.0-canary.b273afa93.0","@material/animation":"6.0.0-canary.b273afa93.0","@material/typography":"6.0.0-canary.b273afa93.0","@material/feature-targeting":"6.0.0-canary.b273afa93.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_6.0.0-canary.b273afa93.0_1587164603253_0.2153329635694825","host":"s3://npm-registry-packages"}},"6.0.0-canary.b70bc601e.0":{"name":"@material/slider","version":"6.0.0-canary.b70bc601e.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@6.0.0-canary.b70bc601e.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"a0abc5ade7ef045ac208f6468f5827c1963a1fd5","tarball":"https://registry.npmjs.org/@material/slider/-/slider-6.0.0-canary.b70bc601e.0.tgz","fileCount":36,"integrity":"sha512-tZQsOdXb0kxb9xWcJ4sk8fF3nCc0G554oLTyU/iDqTmvMVZUOZeS36AYIfuJ1/vcBrNeb2DEskptBfr2redYLQ==","signatures":[{"sig":"MEUCIQCADOp299pWrDCJ82/RU1/6zKuovOniy1suaaJ/FRDcUwIgRsU3ytd9HA7m0x8m18ZKOp9tlz5SKYtEzqcVksZv3OE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":372037,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJemjoWCRA9TVsSAnZWagAAPA4P/iLzWtnrsD88VxHQMRzV\nxQ0OUezdka4ievizsBZjzRqjHsG6O17kDVuHxF0AYkuIMvYo9/QgOR7dyRtE\nZLAuPVQDlcM9BXrug6BQsDtVwtF0Fq0AyMaiz6QN6e6yBphk3w513X3WGphe\n5uOla4B1EhHZ9npQ+jcdObLxbRnAXBciG8RZDieGkLBnAB6nGujXkXTlZdu2\ndNPBCrAB9UGsAOn4tU2gqzx55quv5paGQIgKNOHwy6fWqOVlBYNXd5FlvOoC\nRiulh5Qbx2eGh0fYkY4yMUxmjT2DjLeIUOUWi9JG01+gn7OyIwYSskeNhwy6\nui05nFKc2rSnEPg9TkhkYskZ/uqdBj87zfgG64dVwZmSCGkgcZm9hIdmist3\nOuiTNSKSjqtmNrHCDcEXCBQfo4+CXW/helbeLAO2OdMgTEquUsaP1OxzLRIH\nJcmE68Y2Auzq6s4kgI9mN63iA8lsHn3umLtnn8n6ZeS75+BQodf+lXXaNVja\n4uqYuMYMCZUkMQ3bGwskFPtT/K3getUwaC7m8KCwT9Lg8rDE6zCWzytDrzcD\nVsGMbtE1szJvy8Kp6asmeJgRQQ29Fak9JHEA8srdFNRklioYTw1NbZG83VUW\nQv8cuNBEMhV//fBar3naYs6PbyI9lD2DM2t/Mc/R6WuJdJ3Qym4Phcg8agmX\nFTOT\r\n=tg/N\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"90c3468e59a65aab424bb59d4e91a4d522fca3d3","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.20.1","dependencies":{"tslib":"^1.9.3","@material/dom":"6.0.0-canary.b70bc601e.0","@material/rtl":"6.0.0-canary.b70bc601e.0","@material/base":"6.0.0-canary.b70bc601e.0","@material/theme":"6.0.0-canary.b70bc601e.0","@material/animation":"6.0.0-canary.b70bc601e.0","@material/typography":"6.0.0-canary.b70bc601e.0","@material/feature-targeting":"6.0.0-canary.b70bc601e.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_6.0.0-canary.b70bc601e.0_1587165718080_0.12097434919711447","host":"s3://npm-registry-packages"}},"6.0.0-canary.c4b4bba96.0":{"name":"@material/slider","version":"6.0.0-canary.c4b4bba96.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@6.0.0-canary.c4b4bba96.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"8496c83ef650bc6883de9fd1264f25d0d59cca90","tarball":"https://registry.npmjs.org/@material/slider/-/slider-6.0.0-canary.c4b4bba96.0.tgz","fileCount":36,"integrity":"sha512-gwD1GTFbMKTLj/TxZbaiYl2CO+u3MtODEyTJDDFt5F7Dse1Lx0j9+dI7t4nOYIs+gqPQcBeQp3C3DuNT0X2odw==","signatures":[{"sig":"MEQCIAwVy4j8YlIr5IE4SDu0+k1nLNa0HA0QijK7EcRx5e13AiBXeAMl3zNg1LQHJbc+BTvDnqRk6gEHUoHmv4jGsm6s9Q==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":372037,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJemkdRCRA9TVsSAnZWagAARAwQAIH0Nd6bdVtkaCRzwISE\nnPQUW2QPxyW0g0CpXwoHsL+p3jKp5fXvTQVnKBMhX24qb5JX+S9aN34O1zSB\nnOUXLwN4r2Z64d1meK6yTO0WCTt8o0VmoMCLxS4DuRAXy+uNmIKqOxVkx8U9\naziO0FoUXbQDv1nk2JBPrV2c9uoxesLHdKCAA26pCVnBrxdj5CuXr2P5uedP\nhUQw2kQIqbqWZ9No0A7CzPnsvfoqD8WsZfvxVt56570hdgIajoZA8pb/sPxx\n8qhXu+4lKW5JgTlHTLC4b2ifn6Gjw6YLyiWGbp1kVTXSK0gO34PORySZ26TE\n1pVaSAUBZA3PI+YhISoGvwqiGHjPnvpVedHxSprawfz321rfiBQ2EZEMi6ep\nUoICk+zEDJ8JPeEiGOINQ6X1tqFkLVKE9T4fO8Gjes2Bvsz0SnsUQgH2KAnq\nEStTCXgSSW9EMDX+I345tSH+qOTHBXgyAF/XUXlRcK5IkG1mU4vtTTvPp4VD\n5QKzPr6DyaQ06afORk7R3ABkT5jxlV+Q+ySprQTOefUVx+2MzlqggvVcoLa3\n5nAXyAxXfMFtA/rO8R09XEYy10+Pp2u6C8IGqJfFQJgzLlI0H2avmY+c6qky\nANiQmBr75+yVh8x+TiAKnjkrRbKfxccH2x66mgcG13V3JZ8rT/Shujw8GZCD\nPZwi\r\n=VhDR\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"ee02a718dbd2e86f9ea056b6199c1664c5abe70c","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.20.1","dependencies":{"tslib":"^1.9.3","@material/dom":"6.0.0-canary.c4b4bba96.0","@material/rtl":"6.0.0-canary.c4b4bba96.0","@material/base":"6.0.0-canary.c4b4bba96.0","@material/theme":"6.0.0-canary.c4b4bba96.0","@material/animation":"6.0.0-canary.c4b4bba96.0","@material/typography":"6.0.0-canary.c4b4bba96.0","@material/feature-targeting":"6.0.0-canary.c4b4bba96.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_6.0.0-canary.c4b4bba96.0_1587169105144_0.30748039521196135","host":"s3://npm-registry-packages"}},"6.0.0-canary.6c1ebc721.0":{"name":"@material/slider","version":"6.0.0-canary.6c1ebc721.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@6.0.0-canary.6c1ebc721.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"b067cb164ea7d626a08d10a293f7fb83b2317f7c","tarball":"https://registry.npmjs.org/@material/slider/-/slider-6.0.0-canary.6c1ebc721.0.tgz","fileCount":36,"integrity":"sha512-kPihvKFJOO0z2DrvLL/q77l7He5B6i07sRF5k9onpTefnjqEipLsw3omP4uMYAnwkYhFIaHPghvoP+5dnFwlKw==","signatures":[{"sig":"MEQCIG+FYwj/xeOkb6bgmX9NsIWRAkyrFN2ooXKOzbHeqQacAiAHvzn+mj/stjtGukGLxT1zgDsiSgthIaDEAQvrROTiPA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":372037,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJenf7+CRA9TVsSAnZWagAAiv8P/Rmk6XdAAkupIjiuYRiy\npXzOE00h8p2kdixfbom4/aFF0eZi01W2xqwH/RMRoKo5LSJOsVIFXuSVBXCS\n7gHWE+GbFu1IwL2uD4+PkSjBfNG9hHZLyGXXZYNw4eZ2gZMcL8HUus4QCuSC\npAhklN5u2NQdZzpuxbogvXVIczI/HLViwtHGW5yEjwPpqPJ0XJTmiIEWfInv\n2fKJwVr+sQewLAqjAFEX3honWPIGnuUt0SZSoLwkSyiJDDpWceb3lJDYnI9P\n+2ehwtU/72ncl6d0zV05soDM9W+QiSEfN/nlC+cvOvmsDx7yzsZbZ/KBxnOp\nGXYrCXYpZ64GmXaRSzy9acK0jm4MlJoD8KQBXC3+n1q3Wuk8vsDvcw8b4VkR\nLvGp2j1KVaPcL5nSZxpXr5NYgMEeeSC9sNoyYUzx5LOqZ9mjvj5Wf7RjPqNM\nM1SKKU3ML/QjpoP5a6yr0WvB0oU3Oulr9EJdlnJKDJdcSMLuUp7zggSPQKj2\ns+1mgJlp3h8YZwZT0Lm3xn2NgbmRZFVzevDFz3QG4D3ntxA+M5Lk12PtquX7\nXEWQLH+gd67KNqH7l9+mhweuWSCxvCEukkPjzrDYbTSIOzBYnJlh+QdPEhcA\nsRYTBJiALyoZd+7ZZZGTNaDv5J0TTLBrqfO7Vy/OFrUA7IBaKmQ2/8b9Q5MB\nSKqy\r\n=TpUY\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"b1a71b1e525edb460d6fa48e392b09267db9d2a5","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.20.1","dependencies":{"tslib":"^1.9.3","@material/dom":"6.0.0-canary.6c1ebc721.0","@material/rtl":"6.0.0-canary.6c1ebc721.0","@material/base":"6.0.0-canary.6c1ebc721.0","@material/theme":"6.0.0-canary.6c1ebc721.0","@material/animation":"6.0.0-canary.6c1ebc721.0","@material/typography":"6.0.0-canary.6c1ebc721.0","@material/feature-targeting":"6.0.0-canary.6c1ebc721.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_6.0.0-canary.6c1ebc721.0_1587412733502_0.6994493599759819","host":"s3://npm-registry-packages"}},"6.0.0-canary.9cff4318f.0":{"name":"@material/slider","version":"6.0.0-canary.9cff4318f.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@6.0.0-canary.9cff4318f.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"a5d825efb4eb62392b7f1d9459c9a5c9a1cb49e5","tarball":"https://registry.npmjs.org/@material/slider/-/slider-6.0.0-canary.9cff4318f.0.tgz","fileCount":36,"integrity":"sha512-LByE32Lxf72B7xWM9YNbQyXMz9tyMqzvwgQWVjSuYLDrlqQw7DIJd/p6Y3oZY1pLlZCuIoJCxQoqhpYS3+KLoQ==","signatures":[{"sig":"MEUCIEOO6z8loz573+vNogZm6kaxpCNmz45C4NgbWYvrAUmgAiEA3B4wRHLoF1p7yhEMs3Qf3UQ93zYCkX3cahrDt54icCk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":372037,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJengyBCRA9TVsSAnZWagAAXfMQAJyaOm3ADOzd99dAYam/\n+IA2uuh1tMjN/GtwAcq2A2gu1sXWeaugedaf2OVzblMgB4ayQ1TtQxLxU1Lg\nUYI+LOku0OC28X3G3CbIyTADdtx5kWdRKNegq8OUh2AGXel24DCEqYh5q57u\nUVV3OpQz1DHHrAqCQkiWFNJWZw+Zn87473CDUPzi3eapKk659r9dPoQ75VkO\nTmsQExvEgfXZXR5E1oSmgGZDmAJrFOclQ0it8NnRqvFVIcqFsPEVoTN8ygn3\nyJlBY0z6dsBkq8PemjGNZQz7iofxbf/Ka9Zzgfk2cj24dWzzDfmmndrpkS/D\nxAxQO2ft4xJqpHpF1sB4JdFUcTjCvbR8tr4tS7iERlJDRBZQY5mjiPI2bm4q\nydbhqBWTDQJ4bKoyfIV9KqXNLm7C28NmSpie1/RUohnyV6cxakTvckH2COaO\nx1AKCzYeExBpZ2AEKM4rlEj+80DjGIUtXC7J01Ljq3GGZ/szcPX/gRtkBvG4\neWXDo3Sqp/Eyc0i+fwmtJRH0Gzqrx5rrQoINgABPhDBj6mdJUvwI5cJARVw7\nrbS5MjsVKEXA7IgDE3c2LygIigEeafUuiixnjp5NPv9z5V0D4L8f2tBxg67I\njHzDISIFaS4lwdk8iXDe58TQKHEz5PwRGxvsplZfpxQ46EYkxKhwYm1uo0Yb\nzHCT\r\n=9lTt\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"0ff1f177754c259b5b0021494616e96f7b6e0d8d","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.20.1","dependencies":{"tslib":"^1.9.3","@material/dom":"6.0.0-canary.9cff4318f.0","@material/rtl":"6.0.0-canary.9cff4318f.0","@material/base":"6.0.0-canary.9cff4318f.0","@material/theme":"6.0.0-canary.9cff4318f.0","@material/animation":"6.0.0-canary.9cff4318f.0","@material/typography":"6.0.0-canary.9cff4318f.0","@material/feature-targeting":"6.0.0-canary.9cff4318f.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_6.0.0-canary.9cff4318f.0_1587416193436_0.5263028032235109","host":"s3://npm-registry-packages"}},"6.0.0-canary.7b4482402.0":{"name":"@material/slider","version":"6.0.0-canary.7b4482402.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@6.0.0-canary.7b4482402.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"e83ad1c43255d36072bb65f37fd4c6f056d1fec9","tarball":"https://registry.npmjs.org/@material/slider/-/slider-6.0.0-canary.7b4482402.0.tgz","fileCount":36,"integrity":"sha512-5ccEEn4kilmMMjgfwYPz+o7AHw/91p6DGp67mg2aABBdhDwQr0vice9Ld61r+wTdDjjdJjHQvvIfcNuE2aSIAw==","signatures":[{"sig":"MEYCIQCABcEuZ3VaXnPTEqa63YUCfGouiWNmS+6se1y7JT1HuAIhANCXq/3d2ptKxj2QPQi82BFxQvigcu26u/9FK38YFvTN","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":372037,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeniBACRA9TVsSAnZWagAACvoQAKL91l8XkQ/ALHeB7BJ/\nuxKS+RzW84rDapW4klo868g2bKxPy9lnJVCx/Zd0engkaT4kHtbUZlfSa2yL\nOv6ndYgNRwevHbV7X2GRTULubFPq1yFzu0NlCdqKpyZyM3k1/2WxD7thWryd\nXmTcBYaKIj9ZAfnyCBbM5C3BBEuBdCaFWHlGyqXPsVwjHX6A1WC0QmEwbRZY\nzkmR+4MxbZpaZTdYfNNGeJhyKhxwrZRcP+G41xGsH9XYvQlWelXuqRfO1geM\n20RmvmIiefrnm7UuVvQiNz96So5OoDUkFzoI1QPtARqfYFsTpWS6NGjhynJl\nj+39O9UP/kwzXUHhhox+vEeptrKXZR3bLNyhRSyvqpPIZPymCfub00r1rB2H\ndYpiE/76kdMb49lSsF7O52zqWOOCJYnCP2S30GDeiDAhLj8Krpo84BryVhid\nV+vAShqzCp0rhXHsSrIqVxlS4gcOzz4TEtulgGCUKffeIljGkSxtYcKJvDYI\nc9QwgQ9tkLnAk6XDd7Hk1SgP1gykxM/Y7kKZ8L11KuQykjNe4P0sf/MOkZFy\n6Ai1YcdNgC9RqpCCl3sf4oFzrlz2xhGTW0nxrEiCLEMLy6ha56khQ+yB83yp\nu6dbYi2q++gPBgONjqOlsYu39Bp38LKr1r6/lDtsqWpCiVrmnbQSnRBc9Zhy\nrTlH\r\n=X6ML\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"c25f7586d29e2c5a6d3c289197d47b826d499cdf","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.20.1","dependencies":{"tslib":"^1.9.3","@material/dom":"6.0.0-canary.7b4482402.0","@material/rtl":"6.0.0-canary.7b4482402.0","@material/base":"6.0.0-canary.7b4482402.0","@material/theme":"6.0.0-canary.7b4482402.0","@material/animation":"6.0.0-canary.7b4482402.0","@material/typography":"6.0.0-canary.7b4482402.0","@material/feature-targeting":"6.0.0-canary.7b4482402.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_6.0.0-canary.7b4482402.0_1587421247904_0.986538582811447","host":"s3://npm-registry-packages"}},"6.0.0-canary.deda86d8c.0":{"name":"@material/slider","version":"6.0.0-canary.deda86d8c.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@6.0.0-canary.deda86d8c.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"6c58eb837be1d8103b536677f8880bfe03c38e62","tarball":"https://registry.npmjs.org/@material/slider/-/slider-6.0.0-canary.deda86d8c.0.tgz","fileCount":36,"integrity":"sha512-RjWbLESxU+9u4CRUZD7J3DvKtho6Tn4OvD8Aibgvf5/pIkH9GRnbdHgSQFK9tu2vW3TjCfIXlB6hbN1MYypgrQ==","signatures":[{"sig":"MEQCIGQWwnpISLkqu/CfP4OKC+hvxnWw8RoYIRjf58y3kn85AiBL1QS2hbB1MLnf2YFzgKMk6vT4UibnKasqtv/lmdwYxw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":372037,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJenkktCRA9TVsSAnZWagAA9A4QAJ7+Vd9K/t7GACGg3FCr\nyirTU8GYOEgTPa4RpXl3tmPnhtiZZlO8XQxfj8I5CnmYC0/6fCRMcYVNLB9y\nI7SXcEF92nzxOd7HSASzsoOoJ5h8HbP22r/VBeaPILaaGG+hk8efDgcsjZIu\nEiRSLJYWpCbS9IFmci5Fod47rD3wi/3/70o3Pf/xFifDA7G3YhpYF15KwmwI\n65cG58W70K8ZFhsLXlSeuBOte2pGDBxJGban+jtzIUfTSR/oG8qyBFvrQoeM\njW1Ra1flHPzbXSFGGGg6qxRzfrSFtmr6Poaj2IMMLaUzMqGOhFnEflumMXY2\n06gbsrYN54+HCfE47Lqbees4Lbj+tCL1XhLtk0K01EXr3qnLs7IeLn1+BPxx\nd8RtcNZsl9PTVJpmfIGMWFaqlOwkzsx4cn9pb2FnP2MKP19gy7UcwpIvS0gf\ntbOK3qLfR/K5ImWn2fvrq6VN3M9gPBcT18y6PN4VffGnk7OJToPICpQsU8yv\nWwDhLJnqfe/0IJbMsFWGF1enkN97QZ6xwIctYu6jxahfcUMdZQ1J941vBimC\nXufMyev5OWdDiZUv1b8PbNn/QibqLZf578smMmeAGnb9gKHBn0/US6BxBk+6\nlP3VX4FEw0ppBsZoMaQ4BdZ8uzyMvHrF2Y/pT4QJwif5d0oprsgqE9ciBf6w\nrlea\r\n=tov5\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"7bea6ac56136246274e77c281cf8c66e2ef3e6ca","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.20.1","dependencies":{"tslib":"^1.9.3","@material/dom":"6.0.0-canary.deda86d8c.0","@material/rtl":"6.0.0-canary.deda86d8c.0","@material/base":"6.0.0-canary.deda86d8c.0","@material/theme":"6.0.0-canary.deda86d8c.0","@material/animation":"6.0.0-canary.deda86d8c.0","@material/typography":"6.0.0-canary.deda86d8c.0","@material/feature-targeting":"6.0.0-canary.deda86d8c.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_6.0.0-canary.deda86d8c.0_1587431724797_0.008709083577816301","host":"s3://npm-registry-packages"}},"6.0.0-canary.d10412cb2.0":{"name":"@material/slider","version":"6.0.0-canary.d10412cb2.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@6.0.0-canary.d10412cb2.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"bc85e98726df2f06a72e1c93acee8962ee45fa1f","tarball":"https://registry.npmjs.org/@material/slider/-/slider-6.0.0-canary.d10412cb2.0.tgz","fileCount":36,"integrity":"sha512-NDF5jJ+F/su5tzkuSARAP4ulW9fKcKVn9Yy/qeVs015imPf7VDM/N9+bJOj89f0kbLzlwv9+tvI5ofAznP76xA==","signatures":[{"sig":"MEQCIANmrB4RWjldfaZnL86Jc9FUEaqrVchoh1lc175NdjTNAiB+O3UZJU9wcAA0ntSX8SefMgJxIGH94G00EfBCbchy0w==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":372652,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJenzkVCRA9TVsSAnZWagAABT4P/AjdzlZT9wEXhvCjiSS8\n9yZPh7eyTP4lSU1ro3lOPhVIgjACkEXqtibNcLxYCnMfmfnLTyougI1bRESp\nf4sqCO4QEQxGZHHh37BzcXLR0QZsjOU1/a+5E01u3nK2uRfmWVuIWfk6hpG0\nZ+9PFJB3RzRO8CI4QTvOQ6ezDF3kvygMznGg0eZzH6Bu7kRu80bmysXBk0nJ\nTFHo/M8SerjK3IGKd36yfwa4CLpd/OMCbe8QCRw4PlhCT1IvbG+j25RRoAF1\nN/KlgTwL2Ex+BB6f9esySWHsmW7CpdUWO9t9chifhElzQlVh2r/57NUasAPG\nqlkXXwGM/zg9oCERzEKJ9sCg+sU9Vs7FV86B8lJse07Hj8Ue9TkDwBxeghS2\n8oTag2ks2J/O3ztcnGKbnQksoVeHECgFlP8pvmxegj41zatzRkvZ9WXLJ14S\nUNCXRcq5OQhGS9i6vqcsX10IelWLIyoD/tCUgLLLQy9sHEmrGBv12iHDh7BW\nBUlz3OKq7TvhX8Nlcor63O1cESx6yICfyog6UWFFlppVvQ3/t6lkzd60VwVV\n2ZHiLRblQZD//bEaa2vRag5WmgdGbkqkmw8DAYRp+PitjBDJwWZgKaQMYZO4\nWQbNs7iYr0lhLcVs3V99nCwpFzPGe/Optx0e3sWuLXd96wyWgpe2IynABfDD\ngceS\r\n=AbDG\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"a2946b5762e597bce2d8e4e72f321bf4934e4543","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.20.1","dependencies":{"tslib":"^1.9.3","@material/dom":"6.0.0-canary.d10412cb2.0","@material/rtl":"6.0.0-canary.d10412cb2.0","@material/base":"6.0.0-canary.d10412cb2.0","@material/theme":"6.0.0-canary.d10412cb2.0","@material/animation":"6.0.0-canary.d10412cb2.0","@material/typography":"6.0.0-canary.d10412cb2.0","@material/feature-targeting":"6.0.0-canary.d10412cb2.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_6.0.0-canary.d10412cb2.0_1587493140836_0.30680690594133186","host":"s3://npm-registry-packages"}},"6.0.0-canary.c141801d5.0":{"name":"@material/slider","version":"6.0.0-canary.c141801d5.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@6.0.0-canary.c141801d5.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"920f66d9907369e7082e29f9eeec489e5780a593","tarball":"https://registry.npmjs.org/@material/slider/-/slider-6.0.0-canary.c141801d5.0.tgz","fileCount":36,"integrity":"sha512-Gsr7FQfpiMef/+HDYMQiq2a2xVS63OiDLKhJiZhrSEx0gaPNwZHB1YorGe4KRxr4PHFd8fivqi/xBKTPkMkXLw==","signatures":[{"sig":"MEMCIEsnYB5D5ScEwTw03mwR0O5P9qsfIa1LMuw0BcwjLL3tAh8mmbCLBpw7hlNoNzlK5S3KfyAHHNp+55MoyvK6syal","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":372652,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJen0yqCRA9TVsSAnZWagAAOqAP/iqP7uzDJJHcuOYsWDoh\nyJ6n7gCGj/whxehPbrOiWzXsaUULrxrod/ncBR3QEoSSbDGtxpK3mzHdmIB0\nnnDXopir67t3Fn4+YvBXIsLBAk+fWoE8wYQWG2Eg5hhQjODAFfNKcxRMgxSF\n5AH9UVogI3vItouQv3xfJM3lzksTgbk2ygQhGJShsHRD6lkfTHThzSmlFA7j\n9vc9tlIkPAzQENMPU5w9txARkqiSjiknRjL0JzUyj9Ud0+gwk2kkQmQ80uaX\nPpOTXppcy4/It7iSxZJildyTd8tXI0Y9Tqwc3/q9mOUJLC7VugYz0sZ4alPW\naSMb9w3q9OXN0PSqaP16Hbvsx4ITa/HY+4uZ9aD70u3F7kjF9Gu/7hncl0SC\n4gILLFclhQHFxon6OB56pJE1Hb1CmHczuKOlRhBfX0Qb5dZRvcyEOgB/WcOt\nyo1kFys4UTmZN+EL4oXlId8ZNycXzWwoJ7XyB1RnowetaqWna9j/SmOtADA7\ncSWnAZKogNIUjs+LHkFjM10y4h6XuK2PzBjcWYjDc0Evmodfh+G+j8niYMnO\nuGpaVq6oLS4wBJRq5M83JXtRXE/QNpNKkyqz1wB/mvN7XGeelHBGsTo0l2xo\nXspfyQvJl+HfYnrfwvJfgoXs2lI3DspKTFT7EokDtCraUXmyq7fynjHK4+7Z\nDnpB\r\n=sduv\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"d026173e9bf7440b69f1e3e7e4c1bd60dc5ce6b5","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.20.1","dependencies":{"tslib":"^1.9.3","@material/dom":"6.0.0-canary.c141801d5.0","@material/rtl":"6.0.0-canary.c141801d5.0","@material/base":"6.0.0-canary.c141801d5.0","@material/theme":"6.0.0-canary.c141801d5.0","@material/animation":"6.0.0-canary.c141801d5.0","@material/typography":"6.0.0-canary.c141801d5.0","@material/feature-targeting":"6.0.0-canary.c141801d5.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_6.0.0-canary.c141801d5.0_1587498154472_0.27481851117243483","host":"s3://npm-registry-packages"}},"6.0.0-canary.28d10a96e.0":{"name":"@material/slider","version":"6.0.0-canary.28d10a96e.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@6.0.0-canary.28d10a96e.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"095fb1cde275a1b107eac7054f46fc5c8ca43ad5","tarball":"https://registry.npmjs.org/@material/slider/-/slider-6.0.0-canary.28d10a96e.0.tgz","fileCount":36,"integrity":"sha512-Clx/XLWTHX+meJqylqV8jzU68pqZKa2Pk8D6nahgX4SL0+caH41aOF/neKNIqZ7uM6be9UaEvVh5+phwMF1u3g==","signatures":[{"sig":"MEUCIQC5dWO0U9zEIvgJjOI4akRRFI+Ql3z9sgIyY+XkjH0g1QIgYqsOUgXxetpDSRrRhTgXqJNexII9vYMBWI1MzdrdoFY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":372652,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeoMA1CRA9TVsSAnZWagAAINgP/RxHc+7XjXkAzX7wkkZr\n/+HXsQkoR02nCZDvf8FJwNAGTeXHxgslyG+LL38zBKIliD/cM8A0tMecdGLL\nDjhaUwCdp2HmNtos1ophE0JuAD18Frmt3om3kc5LyK3uCkPD20vm1IEFzvwX\n3YXGZirWqHaVLLlwk/S7SlLAIRN5iB3InznxSU4ZpVCQBqbEayVN1WwceLPg\nQ2HUXk9m5zLNT779uiMUskEpsRL6K/4VLlPypEio3r9+yG8RS5APTx1p11pv\nDRe8RDVdhhNfQt3jyididaty+TGLxVZjpap1hkYSKL0LV5RzTGmCSrqq6jHK\n9cI7nh9Blr4ZD8gs8TkTRWm4xscds5/0spRaYiZwMhpuKt8Hp7rQf6qD8Z0a\nEt3wq6hM+a9dIrixvT7fE3efzl/YGlFLOsTpt+DnAgfLnB+ZYtNqYa8mZAa9\nYZvb5Jjjo/Z+18z5icuYYU8EEY+WqloVQ26lMwkNpvdEv2x/QoKQrY4HaSJL\nlhOQUJlsALspT1l5XgyWH7knuZNHFxevKqLOCbP878jdgaWsVKPCf5BhnQG9\nsC8e32+96YzT46JqGwHd2WoEu3+sZWztkPDWOmsQwtC2ql1Sw4CfG9pgsc08\nwuwkAxmEobgio5f0nLS/bbi8Cf5UQAwRhjxnlIBwWcE8MhDkBDdVAawupesf\n2Avr\r\n=J+Z8\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"20feb77e4dc8d7c73f3549e0dfea4b381106b061","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.20.1","dependencies":{"tslib":"^1.9.3","@material/dom":"6.0.0-canary.28d10a96e.0","@material/rtl":"6.0.0-canary.28d10a96e.0","@material/base":"6.0.0-canary.28d10a96e.0","@material/theme":"6.0.0-canary.28d10a96e.0","@material/animation":"6.0.0-canary.28d10a96e.0","@material/typography":"6.0.0-canary.28d10a96e.0","@material/feature-targeting":"6.0.0-canary.28d10a96e.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_6.0.0-canary.28d10a96e.0_1587593268837_0.32307517813481224","host":"s3://npm-registry-packages"}},"7.0.0-canary.8540808be.0":{"name":"@material/slider","version":"7.0.0-canary.8540808be.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@7.0.0-canary.8540808be.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"38cdb714bf7194d575c5104151e9c778971d067f","tarball":"https://registry.npmjs.org/@material/slider/-/slider-7.0.0-canary.8540808be.0.tgz","fileCount":36,"integrity":"sha512-PfQobGwrWM8oc75Xb211IR+kJupwYsKC0hMJNkcjs5dxZgC+050jpXoN1c0qRQpK/yNaK4R7AFyiEGOzxGkHoQ==","signatures":[{"sig":"MEQCIH+BcRKL1qjGF3r72K3psxWSw2uRZqM00MoCU0jDueIuAiB98A8TnAK+9HTYZljhj73fPEar9iThvxO9coHH5ImogA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":372652,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeoc/MCRA9TVsSAnZWagAADHQP/2s2HA26nunhbAbNz4IV\nVbiFi0N8zeu2qD6+MlUUjVEly9KR6YlYvzGVLDlmcD/POJpQyOQe4QVFGfoz\nxZjVDjnub30Dian6ygIOdE1jP54NiufpE4/gUQzZeiKFY5BzJZCy8DrplSJN\ni01nVbjt+ewMm0WzX/ctNJ41khdwpzpltREcTr1DcQAwTnIuRSyEV6KMKGwc\nS+CCBkg4Vc9PHOo6SEDQlWlvQMt+YFNK+BodOM2lmC/XDyvZqLGMm1q3PqZQ\n4Bytou5NQU/OIiX6uydUceNdnshA6IPBDSH8Mep58XJAIVXKa2JCmh9YhlsD\n96J29HxE+/gqW2MFkYxY5ukptaqaN+nNM79yK3iCiT12HaUFc0hHyNz7yuzT\nIyY4+1Nkp5RIMbrtrQHoAm90Ez1c+aUrVyiJSCi9ztOGwMvuDNt6zY3yAAZQ\ni2TiqrE297s+2tDiFUD5LDfuKZzKSsE0Uh2zAyJhmj+bZ98kN6WnABeFVP+/\nXTSg1FS0MW2rFdpEmyFdPN2NJxbAoESpmx+qY575sknDvLkAVb8AH+KOcKZz\nmuLT3122dflkRyA7G3VSNjl/y1sEV3x4XTu1aXGW+YrZjkmGZjGV5QhMTVdg\n5QtR3Qlwe/+B5jCxJSk7b73LGSC7SVXErgghZQQZW+a8kjBzmvYERLhqNGRK\nUjzF\r\n=ncZb\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"a99320a8e5b4b718dbbcaeee1ec4fc8feb72b592","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.20.1","dependencies":{"tslib":"^1.9.3","@material/dom":"7.0.0-canary.8540808be.0","@material/rtl":"7.0.0-canary.8540808be.0","@material/base":"7.0.0-canary.8540808be.0","@material/theme":"7.0.0-canary.8540808be.0","@material/animation":"7.0.0-canary.8540808be.0","@material/typography":"7.0.0-canary.8540808be.0","@material/feature-targeting":"7.0.0-canary.8540808be.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_7.0.0-canary.8540808be.0_1587662795604_0.06074440663474534","host":"s3://npm-registry-packages"}},"6.0.0":{"name":"@material/slider","version":"6.0.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@6.0.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"7d2f86a0d506d126ea77ec467e4fa8c133db6512","tarball":"https://registry.npmjs.org/@material/slider/-/slider-6.0.0.tgz","fileCount":35,"integrity":"sha512-un47bQr/LTEff/aW1Wiu1RBbGMVxM5SbC8O71E4tc7BTK6qG1hjDInlms4GYeeWhvK3NCfKfmoaO651DjyAo1g==","signatures":[{"sig":"MEQCIG+FEl9VltHB6GF8gzzSc2ijebZBT+UEqf5zmi6Kxk5cAiBHKjj3rK+KHsL9aXxX8LURUxTMOpMQObKGqZ/wt0yDiA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":371816,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeoc/uCRA9TVsSAnZWagAAwYIP/1xPTFlGC9plIzAouOPf\nA3wh3hmf0+kcMf1tQR7GTiOfzo9reXMZJXjQwVxDaKTEig9TqZrqGNfYw6L9\nBz0e4dcvyFRRUs/Ou26cWaDaQtxlry7IPCF1n+kl5pYvAZ1vPHAZcJsPNKWy\n6uM+AgY2lpGe1tsXJYFa/mkXlTZZoJYKzLJhclIYbOkQjtEqfvC3xePddUND\nYsTtrA9MOLhnbUK5Vqn/e5jXE/Hde1w1TcX9GHIeh47tHj8f3RVyY+VMZwPG\n+pkL98VkHMIy+PEe2SH6TK+y5S6U8cjwhIRtLqnHsO6vtZ9EXcoUvZMus6mc\nE4yo1p/FLGRNE/3b/zUBdSbjanz7iQc+4Ia4XOowamk34mCaeBVkuNso8Kzx\nRdieOozDmI1lO4W89MYp1TuMktx9vekMlfxHg9H5vwkTZvYDQHCNIdkNAFJM\n1vE9sWVuTfr17wLb+b0KNgN8WoMvau2x7ocNnkaVhcS9qtRNj6RZ5WD4a6hq\nDJ6BaXHnKYU4Fvy/CMWoFGUAjwev2N1NP6gA3ByIHze+8iqZTASREHR3a0wg\nr2WuIpyr7OrK+E9gVpkBOn/xKPUECIMzqWtqeCMYFOthOmmDTVq0zXlG5a1e\n+ObvEEoNKop+rzSAw731m0WysidbTjjlhvEU6dKfgfDPXvJnBPj2gg/C941f\nQA/E\r\n=LVlk\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","gitHead":"8540808be4296e60f1c1d3a637413e433ca7efaa","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.20.1","dependencies":{"tslib":"^1.9.3","@material/dom":"^6.0.0","@material/rtl":"^6.0.0","@material/base":"^6.0.0","@material/theme":"^6.0.0","@material/animation":"^6.0.0","@material/typography":"^6.0.0","@material/feature-targeting":"^6.0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/slider_6.0.0_1587662829643_0.8776767111197823","host":"s3://npm-registry-packages"}},"7.0.0-canary.2673adb74.0":{"name":"@material/slider","version":"7.0.0-canary.2673adb74.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@7.0.0-canary.2673adb74.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"4497e1ba83dcbf8740bba920c18dcbd6d3827829","tarball":"https://registry.npmjs.org/@material/slider/-/slider-7.0.0-canary.2673adb74.0.tgz","fileCount":36,"integrity":"sha512-rOe3VU+cE0Q+SAE7WhMrWWlfv+LFO+NjmNrnmLdTN6mLeddqXgGyPvMqyWH9fjcp37p6UCygzX59jMRtQdE8iw==","signatures":[{"sig":"MEQCIFLiSMGXEp1AM1uDORn/HHSwEVfyhovwDXiXCP0kIeY0AiB5N7rK9oXnxm2IpBbpmEJuOa4vccRjtxZsgaQnpso+/A==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":372335,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeohq1CRA9TVsSAnZWagAArNQP/2FYiPsSByAbJHAjmtty\nDu+n0qYLlHCeal+B2j31KUIS+78Y7VieHdiJ2Ki7wOaBho79B+QnTvO/9JGu\nfeemnPk9ic1D6lqxNiruM0K99IDA1yD6UyrMmMl8HGFYLJGRPR1gSdxhl6gp\nYLTcdgDK9uxPP6E5hluSgEwseCcgQAvcPhP/3ScDYFA9XyOKcKjs0eQNT24P\nFSjpH8F6TF17RfpSOta9N7/2Vb2LFgz/ovF4SwVk5boz/4byt9+fqjjWEq/B\nVQNQ051IVC6ENulqbsTkJCIevn8XOOTk2GFu4VWwmdqNGeZ7GHqPMJtxgd9i\nsbZhgr+TL94wwdQXqcFKDAGHfXzDeJOZKhczqLSrP/UNo6Jbw82aICktCDdY\nTTthVffFNxrqKKIi7tHbFOGlKr4MSh5tatqMCBcBP3rBUL1LoVGIBwvKk0XF\ny0N0MrVmb99U1e1jlwLTUHVLgDqmgjaqfzudc7srcukw9HjV/Clp/aMtTNjn\n1uTfm/gvh/zN1K6thg9SqWIRahP9FiYmFczK5J40Svfl+D2Dlml3j2KSgPrn\naEyv+1/prpjzxI3x0llJhd9uOnarL3qYBM+srm1vkh7x4ZQjxalQuUJt2PX9\nsSgL+JEsI29p+4KQlUbQ9A4lJMC95RlJ48XYhCtTW80oJzkJUmu+WjxichR3\nwEmQ\r\n=WrU5\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"9cedd1d83d1c7d125a3ed38281072b6e50b57e9a","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.20.1","dependencies":{"tslib":"^1.9.3","@material/dom":"7.0.0-canary.2673adb74.0","@material/rtl":"7.0.0-canary.2673adb74.0","@material/base":"7.0.0-canary.2673adb74.0","@material/theme":"7.0.0-canary.2673adb74.0","@material/animation":"7.0.0-canary.2673adb74.0","@material/typography":"7.0.0-canary.2673adb74.0","@material/feature-targeting":"7.0.0-canary.2673adb74.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_7.0.0-canary.2673adb74.0_1587681972710_0.5226240243567977","host":"s3://npm-registry-packages"}},"7.0.0-canary.b10d0d7f1.0":{"name":"@material/slider","version":"7.0.0-canary.b10d0d7f1.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@7.0.0-canary.b10d0d7f1.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"f92c95b3279b55b7d5fcbb5f8350dd7ead34902b","tarball":"https://registry.npmjs.org/@material/slider/-/slider-7.0.0-canary.b10d0d7f1.0.tgz","fileCount":36,"integrity":"sha512-IzZsK2ryXKqinTaxUtN3QLq/QCK1CN6lh33rDZg0EiBPX5kOe6vyuD5w0K0Ys01WM6Q9dKdkdHFHsUqh286+OQ==","signatures":[{"sig":"MEUCIEXhLJHdSCG2F91jmmydJGKtgkscAc6KCzG2eyMbgT5WAiEAod2hSIrRdF3uDqVVIgqGFnDjrnQRWe9+zjtcIb81hfI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":372335,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeojESCRA9TVsSAnZWagAAuTsP/2kgtzvvagBT3oOAPSpg\n/Q6ttEsojaqMDgsksyskk11EmgaeAEZ9O3y+YwlEC1BxFxEix/SnHNphwFih\nP2GE4OHuRPjEPjBLojW7m+fuDwhVZ0qybGrBOyKn6nFQSuF6P9Vts+PRZbEe\n3eamrrEkZnKJKXDbBNp3B1POf0N8HllnWLp5g5W3aJde1OJ3HVgzC+xgV9wp\nZIEI0p+JuBhwoU+NO44c8XouUnzWxDtfbbtitWN+QLN0p8lvi249J9ifS8wu\n7qG4eYrMGpt1NOKoJIklfSmP8IybE+mJADXgXUDy+QXjAzo/uItC/7K9VztF\nNgGVcUGcFuj9IqsWtwRQS0EIoTiy/j2TTIzSF09U7Y5rR8jPQOaYo2G50JsZ\nNobWPrUZGA0xiYUMwFwms93oAcpZ/x/NDy3h3jPpI/mzNkQhOS6OQ/+tYUJb\ntv9p2gfsvbIVmir+b08nGP3BGwE9ABQC+mEyxGBnRaXFwDL9+K4FQ55ogI4Z\nM2W9oM633hypLq2tzrpKnivk5ThSbNFgyHqKG+auzzMRMSBA7vAQLI7Sehwa\nVvwnU3AxnsQd/PU00yzeMPW2uGQTHRA5n3FzOLPiR4JUIMlhMcqHTrsDhDCc\n2fSZhQItX3ydafzQ+H1T482RUB9L5s6OIcrHC/DxpgN21a2lJPyx3ecNCXkK\n0Uwe\r\n=/0ME\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"83fc566b3c065e01bf601ac65cd6d17b634b7872","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.20.1","dependencies":{"tslib":"^1.9.3","@material/dom":"7.0.0-canary.b10d0d7f1.0","@material/rtl":"7.0.0-canary.b10d0d7f1.0","@material/base":"7.0.0-canary.b10d0d7f1.0","@material/theme":"7.0.0-canary.b10d0d7f1.0","@material/animation":"7.0.0-canary.b10d0d7f1.0","@material/typography":"7.0.0-canary.b10d0d7f1.0","@material/feature-targeting":"7.0.0-canary.b10d0d7f1.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_7.0.0-canary.b10d0d7f1.0_1587687697742_0.5854919718117864","host":"s3://npm-registry-packages"}},"7.0.0-canary.3bd8c1bac.0":{"name":"@material/slider","version":"7.0.0-canary.3bd8c1bac.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@7.0.0-canary.3bd8c1bac.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"a49a86ce06f46676d2faff879a71ebd2d37f29f8","tarball":"https://registry.npmjs.org/@material/slider/-/slider-7.0.0-canary.3bd8c1bac.0.tgz","fileCount":36,"integrity":"sha512-LH+9WRjKJ/ZT3HeQ54yT0FcRghhnJDSF3wFLfvBhEbO6xQcWYLsZKaU1UcwHNnAIBgPcfotsESbQ1T4eNRnzTg==","signatures":[{"sig":"MEQCIG0R8X/bDfQER2/rKgyVUvbJt/biJD1vgaqG1HRAJe7hAiBaQeujMlAuTz36735IVtZrLfLgB5vRf9B+oWBz0+MzRQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":372335,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeo1TYCRA9TVsSAnZWagAAHRYP/0KlLrMnOkOuLkVXGIjB\nzwxuBx14bf7NVm6NeU4PPjrkLSOCHaB/uEqJofpCAzirRXbsWARNyCm75JFg\nB+BCGUzlPUqgPl9JI+vis8HK6lsbfIm7cXKPMb2tPWbL/2F7fM6AoHDlTFxe\nTKdzwhK94vZmrjUp4fRI3j790bjfvKsCha2Retw9sGMYyPNiTnlAXl8fvUrm\nR5bgELzUlYoHJp7mVZbvxyVchobzdtFnJjfWnqXS8VdVHu4JXPOxNj8m4xV4\nVparlEMZWWoJbr3c42GpifL++vf71euKN1EQxrLON2La+YQe6Hx+IuGomZUv\nMlH8FrSmFzUBZlMRwh85jS4vI/KwSHY9scg1FuaTU0tWaW5vDcadjBrPF2sO\nWkk+gshPoqf8uT7h/a8nrYFHrcw9j1F9D9yzU33PABXiU+O54lcHqrlf6bj/\nLxthK4qaT9/g3sa1e8AWDZfh/nhHLQk6E1mucJQZaT5YUgRncv2z2NLvbLM3\njfM/HHk8ZRP+ggbAcriGksTvUTOwtEXmf1UBQHeg3Tscz86SaX1LL1bNUzds\nt5USFwvpnh+sO/4rexhhXEt4wa+DWR4Bi/jgQH3JpPlFKOL6Bs6pNBj7CP80\n+kVVkNuKbLRBxl+1yiVuO8pEOrro/zuFKdq3IwiKggZ2ocafuw79VVTqdae0\nKfrv\r\n=sBXF\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"c6f324d1b107431694d9112a3e94b90e82718ccb","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.20.1","dependencies":{"tslib":"^1.9.3","@material/dom":"7.0.0-canary.3bd8c1bac.0","@material/rtl":"7.0.0-canary.3bd8c1bac.0","@material/base":"7.0.0-canary.3bd8c1bac.0","@material/theme":"7.0.0-canary.3bd8c1bac.0","@material/animation":"7.0.0-canary.3bd8c1bac.0","@material/typography":"7.0.0-canary.3bd8c1bac.0","@material/feature-targeting":"7.0.0-canary.3bd8c1bac.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_7.0.0-canary.3bd8c1bac.0_1587762391810_0.6168111112352779","host":"s3://npm-registry-packages"}},"7.0.0-canary.b83c8dc22.0":{"name":"@material/slider","version":"7.0.0-canary.b83c8dc22.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@7.0.0-canary.b83c8dc22.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"ea171efb7c10590199bd604322c717c984af9990","tarball":"https://registry.npmjs.org/@material/slider/-/slider-7.0.0-canary.b83c8dc22.0.tgz","fileCount":36,"integrity":"sha512-UKk4wyrhCIwApJcPe80FmG/Wys97zdJoeg7S4Lw7kFyWepK+2RMgSnhZqSu1LmxluTd8I26WE/VnyYDKgSB+9w==","signatures":[{"sig":"MEUCIGWSGPljSz9I+K8QwZ6FIE2fTmRJ0Oyo2u4casYWJ8K5AiEA81yRBW1WZRBsQ67ctil2h/++3H6h9X3sxXCVkMS62lQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":372335,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeo1fYCRA9TVsSAnZWagAAwNgQAJKbC7RT+yzgl+wr53fD\nuYXztHKoehAGg9eAQd/x+qFGSCxaZM8AkSyUnB1Iriv7dpsovE4RfRGfx3u4\nVJ/getpcYTENuQyv7j761gUdONkHWFf1xlB3aLVmBIIEXT4to1P6vqO59Eu4\nlMd4HlgJZ7hotnKANnqQ7TAIG04cEvROqnz7NVk1Ojn29++9FORDQQWceaPL\nql+lH4Tul9We0SzuiK3XkLzxbLZs04ynNLR0E2f6om9tTDPGYL1Zi4B1EATi\nd/4vZKyGanU+Viu8MzfNaCkwZtLRwre+CKIrc5qRAA2tKz4XDn7oDDFHzdkT\nIMlCzioR2dtaglGkMRxtfSeDTv3ElMaOMLIonuFrdVRvAJWkRbMBwKNpzdl+\nCOtJ9tSJp1hBgQRR9QX96ZQWQIgk0X1v0EhsDUa6vW4bk9L0b0QnOonmxAJ/\nYRiJTEKNE/THVkMYlsRoocEtEBvZM36zwrBX/f4FldJW+cfhpA7/CHsoR3oj\nE45f4a0D5jfa8XC1kfOvfaW4CYttsZVGz5peYyw67ZR6AYJPobewJ099TiSF\n4KR/AlXPiLf7JqooQiTvpOzemm3GKvw69NpO0+y+GYSHfaoNYDu7D49l/8FY\n62oG+CXfnWcb/QKYUsjFscdK7BoSRJFMa1aPV4qB5IMnqDG1sxU9lb23bcLS\n0q2y\r\n=yCWI\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"92cfe3e927d76c82fa2d8a864bb852b8d19f30e3","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.20.1","dependencies":{"tslib":"^1.9.3","@material/dom":"7.0.0-canary.b83c8dc22.0","@material/rtl":"7.0.0-canary.b83c8dc22.0","@material/base":"7.0.0-canary.b83c8dc22.0","@material/theme":"7.0.0-canary.b83c8dc22.0","@material/animation":"7.0.0-canary.b83c8dc22.0","@material/typography":"7.0.0-canary.b83c8dc22.0","@material/feature-targeting":"7.0.0-canary.b83c8dc22.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_7.0.0-canary.b83c8dc22.0_1587763159238_0.3577702006857275","host":"s3://npm-registry-packages"}},"7.0.0-canary.1b3dd846d.0":{"name":"@material/slider","version":"7.0.0-canary.1b3dd846d.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@7.0.0-canary.1b3dd846d.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"bea6bfb5522f12b1105db2c85d8bb01524be70ef","tarball":"https://registry.npmjs.org/@material/slider/-/slider-7.0.0-canary.1b3dd846d.0.tgz","fileCount":36,"integrity":"sha512-q98s/YP18K9g5PyzycOjefO0K6BFx7l8zCAOK8UjIUCyU9lBO02nSo/2pQFxZxpWknb8vLgKiRXP9j4uZ0YOMA==","signatures":[{"sig":"MEUCIQCUVSVZOVd1r9TpBFxP2Xy95FOWTX2DNsxVSipXb0HZBQIgXTaBo4U68RDuljBuHonVo5RSdeFhKrgX7okbW7T2sM4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":372335,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeo4fnCRA9TVsSAnZWagAA4UkQAJNXQC8fJyZqWst1uQTP\nsXAy9FS3vI9Qg4GWd8IWhpWD/7OElsqk9HaRAc1496YwxZr57sBn3cjqyPw4\nO5TSFaKMr0XgJoAT+d3n8qW7aRCYTFhn4TGNEhu8M8aPjFecZtIJZH2dtlZF\nkwWpXS92HYLZhuIFjsXRo4R7RpbCesBNvHTfV1H/yXGuUhehR3vf6EILPRS7\nJ0GC3R54YrtKS+JLqzBkALFrPh82Us7kQ0Cyo+bhHAjikgmr9Oz/322RXRO2\nYW+tols9YIAzv9W+w28HWqM6vIQDJbFBnhCdiX2FrnNBRLH6beS86FehrKiZ\nbBkC7trucUzegcHgZMmTP79E/fPxgLWX2YxPhuiMBGg4lbMBeT2XoIiUEfKj\n0ih7DvamnzyvgUlw+Cr09pl7fxe2EUYmxZFZ5PgKdAAfn6nXrLpoJFGZGjAt\neifAl8QNZLyYlyn6hazaYUX6QpGzTT10y5w7ObGg3zqi5uijW429tZ7OYoAL\n/x8fU8jv+obxlDOK8Qe5lI8n0HvWdTtisrm7wGpNFAYXI01cWKKmf/RjZJ4T\nSdrgMC1Fr9cKirYX+wz1dG5vUnoGDj3oeW0lVKrcZC/guWNkFvYgkaM4v2xN\nhDVp6Y4TSo0sIW3h3HMZWMDPK4C8UK1V/uMs+YKO8kChTRKpKmWqklT5Aq7Z\nMTp/\r\n=FAeK\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"370fec5aeb98791d923dc357e46611e61cf6eb0e","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.20.1","dependencies":{"tslib":"^1.9.3","@material/dom":"7.0.0-canary.1b3dd846d.0","@material/rtl":"7.0.0-canary.1b3dd846d.0","@material/base":"7.0.0-canary.1b3dd846d.0","@material/theme":"7.0.0-canary.1b3dd846d.0","@material/animation":"7.0.0-canary.1b3dd846d.0","@material/typography":"7.0.0-canary.1b3dd846d.0","@material/feature-targeting":"7.0.0-canary.1b3dd846d.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_7.0.0-canary.1b3dd846d.0_1587775463437_0.018737655634999184","host":"s3://npm-registry-packages"}},"7.0.0-canary.29debfea7.0":{"name":"@material/slider","version":"7.0.0-canary.29debfea7.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@7.0.0-canary.29debfea7.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"885c21d5ea70b26f784e83b5a7ce1d41595dc3a1","tarball":"https://registry.npmjs.org/@material/slider/-/slider-7.0.0-canary.29debfea7.0.tgz","fileCount":36,"integrity":"sha512-MIsbQsQbntbEf+BAeuQ4MbJo2npI9lUq2/B+zCBa6fwbw1o9Wr1qw2VPRS0UYFSz8N00XZMGvOsuBkoOKD7C/g==","signatures":[{"sig":"MEUCIQDzOJfmE5YF47xvCTrQ6+XmZLpQlHvhf1O4DSUZ78V6egIgUDD40dwMmRaIUIBvx7ZV5VQGLfNl3heQzXiYEZJs8z4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":372335,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeptDwCRA9TVsSAnZWagAATaoP/1rxO35yqsCqpHt/EQtz\nPHcNZUDGiOQcXCYnHaIdI85mD0efCayQbTUUhMUe/8eVB0sBBEo4807x0mBt\nzTD5nVvaoOoqj2kWLs/sGSp39neq04BMW0UWPz2JHg4Ck72RKdX/mWiSofxh\noDXWsnllnbqLkfavAftTcdn7VLvGkFP2kiD1kpMQXwDkbMHEFatwPMfEJwrO\nHMZktGjaN07eYxHxH8I2oV+hMjSIINomkhBrMcun2cIncbT700ENrT9kE1RD\nZvDxEFLMaNtrikJhhr3llhMIxxJwQuCUW59zreKf0saOylY8YYLA/oAAQFKJ\nTEI2apBrjP5X5+5Caeeidm+fgogQ3O5jkoqLHLTUIu+ahdfSdZmDvKy6lNMR\n/ogbNK5l/04cP34aBLugZLNJsrU71u8hb3AwYBgpdLIHalZ9vRAE+XNdScUY\ngrflC3owVG32CubZKzmZuNiETiqfXKxFU2Y3/nqVR4WmqdA/6Xf0RxKedl51\nL+KWC8pVJVud8AOGDGwmHyiiIC5hjmXWtYLit4d5UIrKymame18osRE0zKe4\n1uu5RTQ13Inpx8jTT6uWP/hd4LOqX61PU5YzwjfEMAm8oxT8Vyoo070rWyIh\ntAoZQtwm4q6Xn7v90SJtJYR51qyRPndci+Y/EE4YeXGEr4e0UlsC/MzPDslu\nh2cO\r\n=sfRR\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"f121c350e2a52fc59191d5e843358aa3e3926ca2","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.20.1","dependencies":{"tslib":"^1.9.3","@material/dom":"7.0.0-canary.29debfea7.0","@material/rtl":"7.0.0-canary.29debfea7.0","@material/base":"7.0.0-canary.29debfea7.0","@material/theme":"7.0.0-canary.29debfea7.0","@material/animation":"7.0.0-canary.29debfea7.0","@material/typography":"7.0.0-canary.29debfea7.0","@material/feature-targeting":"7.0.0-canary.29debfea7.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_7.0.0-canary.29debfea7.0_1587990767984_0.11182736708615293","host":"s3://npm-registry-packages"}},"7.0.0-canary.28d32f8e0.0":{"name":"@material/slider","version":"7.0.0-canary.28d32f8e0.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@7.0.0-canary.28d32f8e0.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"298825d6a37a1c0c0dbc311ff077e3426d19ee26","tarball":"https://registry.npmjs.org/@material/slider/-/slider-7.0.0-canary.28d32f8e0.0.tgz","fileCount":36,"integrity":"sha512-6DaK5JxGCdg022T3Au5E/z4x+cmDINMwD4qHJWpbgonB0qlT/kMYftguHPKJyg4LKNDpJfwUqH2TM27zNUESYg==","signatures":[{"sig":"MEUCIBfond1RMVoMWcFkjkfISPk/D7ui0AzG7JSQQSsUcA0sAiEAgW4QkM8pJCLbDpXy5j4dA7N9c8taEWbE/YJHFiEwiH8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":372335,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJepuctCRA9TVsSAnZWagAAf94QAJW+Gm3bM+16hi+83gXn\np0hvxC1cmRZNfo0EkU5SxFj/BX+UJGlEr44HSuJ6XD4wF3ogWtqGaKYkYIFo\nZGHoMe89Q6edn9tastiiMcdTu5SEgmYffE/W4opzcTDRI6tQZ6S0bm2mjrFH\nrsU4KzcUw63VWaczjcByfLZbx3x8QDPUTEapZS/mFiIn4vo6MXnhu7v8oNyA\neSvSM6UtwhKr23O2Th+vVjdGlGx3LLHskHuad5RD7ALwnYmJw8oVtO9ld/hE\nX9t9aJnLojZ2LKhNNRcgsNcpZ6qO9W0OiqVYHRQeJt+4nwoBzC88fnj2fQM/\n3BHz66XkVExAhR0GMCMsXfCrdbuZclqlivKOIJ6IT9ji/xkZ0LGDVq06CMC3\nFvoUqKO7xQhWa1l3hwoI3CXOHwQdnBeha/vhRt4QVlvoC2llqVGsACswEcWs\n+CZuAB76MOZXAf5NKL+eIgcolulbCSfQ9M/a22wckgPLueGtbWxT9FOfgO8g\nHg8jRiW4ToGa3u2WqL99xHCJzmt2I4FHzLpRIS1QGCuuzxOhBWU8XNpU0DeI\n8H7gcSGZeRWrvDedrEJZC41EMYwnx7XphWUcxXv6czNJUUkgc8iDIqfga1Pm\n2/YmbsyUzlDCXSRfFOY9GyivTyfAn7XjeMADRBxm5EIFFQBfO148vMVkAIRz\ngVBQ\r\n=SKcD\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"5e2a5c88bb5127200d9f70d65964a419ffe2b123","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.20.1","dependencies":{"tslib":"^1.9.3","@material/dom":"7.0.0-canary.28d32f8e0.0","@material/rtl":"7.0.0-canary.28d32f8e0.0","@material/base":"7.0.0-canary.28d32f8e0.0","@material/theme":"7.0.0-canary.28d32f8e0.0","@material/animation":"7.0.0-canary.28d32f8e0.0","@material/typography":"7.0.0-canary.28d32f8e0.0","@material/feature-targeting":"7.0.0-canary.28d32f8e0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_7.0.0-canary.28d32f8e0.0_1587996460907_0.8251260424020979","host":"s3://npm-registry-packages"}},"7.0.0-canary.af71cfdd6.0":{"name":"@material/slider","version":"7.0.0-canary.af71cfdd6.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@7.0.0-canary.af71cfdd6.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"632ce7083fca45a6bc7eb67313cf07298893c7ac","tarball":"https://registry.npmjs.org/@material/slider/-/slider-7.0.0-canary.af71cfdd6.0.tgz","fileCount":36,"integrity":"sha512-4ktCMQRxnahr1x9VYnlXRg1HWWqUegYsrIUYwERfIe19TassiE6AioR2nEz6KhpIYdEG3JNCXCGp/8lVT04gSQ==","signatures":[{"sig":"MEQCIB4lEzDZ020fQX4gMxiQuvCva1R/U+bV2UDMHYHRuPfIAiBa0l5PPgq470zL9ebtLa5hwl62jREhPeLfmMpp48TuBA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":373077,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeqLmkCRA9TVsSAnZWagAAwsAP/A7typbkW2R9WCbMSdSN\n5cyKpGDaa9qUecSVvmbevEG6+lMMlNKyBp3mOGQ2Shx0LxoMubK4N2aROGiN\nN1L5JCbLk3TmqOKB1Lfld8zsG51FTC5Fb1eaRo/hC5CQUCuK2fn+RBxqjlQK\npjEmGCWKj1G72U94cFXOJmEllUMviWK7vSlbrMycCmvwI7lkjSkwGgYAhYV3\nFbC+PEY54laeMGt7HXgYbC1RjePw6dYWtpvddSqUZjBnMZ6gVj9tzGzGTjYu\n5GBUzWkxwCAiybcjyoTPVEND/FUaizKbzTFMIxYK+/K4+bcHdvvKLrQTAcpn\nT4Zeq4Xw00fA2HMQan5GSVRQSZ3std9yjz3T3wPnbSErmHZVFX5LBZY0dEZT\nIDRHszEuTfckWhBDjjU28+4RUQLKxIYFhc+0lC1K30ObsTBsI7VlyFb26mW9\n0MYS2X3VWwNtTZMLl3m9FhlkOq0FGnuz9HZIuDy/HySdSLniU1q2gD+ZH/F8\neC0F5u5UJWdvXmLVXHYP+qU7YJtwVhbfpavcIqi/vUFR3KG4IWsmlesXTagE\nRWwtkk78oAyDiN+Y9Bny5yi94qY31f8d7E/bSZzG4BO7jbaInSxqtTw2FE0F\nZKYOFxqp852ew2n7XrS0e0RKV2PEL6qNYtd+0Py+0rG70E0WMGm1Oi4w7WtN\nuzg4\r\n=lV9c\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"8ab654dfd65440046211cfc73468f20a57d7fb4c","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.20.1","dependencies":{"tslib":"^1.9.3","@material/dom":"7.0.0-canary.af71cfdd6.0","@material/rtl":"7.0.0-canary.af71cfdd6.0","@material/base":"7.0.0-canary.af71cfdd6.0","@material/theme":"7.0.0-canary.af71cfdd6.0","@material/animation":"7.0.0-canary.af71cfdd6.0","@material/typography":"7.0.0-canary.af71cfdd6.0","@material/feature-targeting":"7.0.0-canary.af71cfdd6.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_7.0.0-canary.af71cfdd6.0_1588115875865_0.46268303311107206","host":"s3://npm-registry-packages"}},"7.0.0-canary.99d2fc961.0":{"name":"@material/slider","version":"7.0.0-canary.99d2fc961.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@7.0.0-canary.99d2fc961.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"fa38f9a0371547859b63a08c5fe4368b932eff6e","tarball":"https://registry.npmjs.org/@material/slider/-/slider-7.0.0-canary.99d2fc961.0.tgz","fileCount":36,"integrity":"sha512-Knt/wnl0IqUFukeQEGP+NGeU7C9Z6ZkWBgHxYWD/DfeL4AFF8yKhc9dUAPooX8gQ0VFWuGvMQb5ZHz0rSJ0riQ==","signatures":[{"sig":"MEUCIAfvUoVej3jR5Et3KpW/bBVAYa8qz5P2T1zwgrWQspZqAiEAwIa5cIlmKGivA6ZX8b7xccoqfrhKk/B3eqIv8++Dv7o=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":373077,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeqVqPCRA9TVsSAnZWagAAFhkQAJoOzndOhjSyfX7ZBtBH\nLHbvUR2B5LSigaNoGWQM7EbRnmNzOeN5ucydj0KuAXRghwner+3qcmpaRoeH\nzvbhqyHRFFv188aH2+ps87R9Sca/GVwnvm/VSoR2lYZABw/fWE9iXdmmQOmU\nr/ri1dtpNnKSjjtLauqXmIqgPrkFJ6j3IyyG9R2fCT+qx0M/VvYpgXtFn/z7\nCqburjW1YOZtYjNaZogFuQegDMZGNitqV4U/u4Bb+if+vShj8So42bnKjA/e\ne/BrbO4pspgmJeMpilA3Ta/rPZMrL0vxIGz49zcUYE/LT3wWP90WeAiN8ukc\nf/0XvGv0G1FAEyM4nF4Hdawn5uWWQNnufx9Qh0BrXfxTlrrBuGiwB2MDmsHr\nQKktmpgKXIGzrKaWEspJl48fwm5FcI3DXYjcWhcuozK0lqlbfFCkIDXyuUOi\n6UpLGaP68xxnafM93HyC8G7Z7LXQodlLSnVAUeuInkPXtyYEfRFWXGkpI7z+\nm/w7UbbuFLGePyS5b8S+27V+lMFYd0upxcyT3ovow5E5Yfy+EraY1wnQbpYX\nxMJb6Y+rXqCIXDhFLHrQZflbFBW489/Kkhn9eHW6YveKICzhn3NiZa6AEwJu\nXOrqTjfBlr2r1AECmU2Aj9mPjljFohVuUO2JDCJqNaDuBv7Ob0gQN7KtC9/7\nhnDl\r\n=/bBm\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"9b1ef36f20c436f96aa47dc90c983832edc5985c","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.20.1","dependencies":{"tslib":"^1.9.3","@material/dom":"7.0.0-canary.99d2fc961.0","@material/rtl":"7.0.0-canary.99d2fc961.0","@material/base":"7.0.0-canary.99d2fc961.0","@material/theme":"7.0.0-canary.99d2fc961.0","@material/animation":"7.0.0-canary.99d2fc961.0","@material/typography":"7.0.0-canary.99d2fc961.0","@material/feature-targeting":"7.0.0-canary.99d2fc961.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_7.0.0-canary.99d2fc961.0_1588157071344_0.9451589570330077","host":"s3://npm-registry-packages"}},"7.0.0-canary.0e052b24f.0":{"name":"@material/slider","version":"7.0.0-canary.0e052b24f.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@7.0.0-canary.0e052b24f.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"7acc7cd2b24bafdddfac77a364fba4e65294c21c","tarball":"https://registry.npmjs.org/@material/slider/-/slider-7.0.0-canary.0e052b24f.0.tgz","fileCount":36,"integrity":"sha512-9MTQDRFti64UWsQTFFobdsg2Rmj7cWiGo2HQCcO7vG6jyK+0KRFNRJ2Yoh4/aHbZLG+qjo50YPFFYRskBuIx7A==","signatures":[{"sig":"MEUCIHy5CNMRHiDuSYPLSn+h/LouYo9DOSY3etD0NNJQG+Z5AiEAspmVVxu5x8ru0vqX8wqo9EP9VB+xtHRehFQN3DHd8lo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":373077,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeqioiCRA9TVsSAnZWagAAz9MP/R+T46vOX52ibYZaHmd5\nqhpFKkmTHyBZMPqCGW4gHNrx2ix7elbGHrmUQHw+F6rcaNA2MdrEB4q03gRn\nXnxBj7B2KzcMsPHRalRQU+fSdlpTQUd1dLOJc/fus6pGVNPG/I999yIv6obZ\n6miOf0jUv1L0nVp8+T6swQT4wv75Vs/JJ9DBT/d9nkWzU/1stnUxOPLRJwdv\nJ54stL9AFmIklfewDVBcjB0ZKKG3FgfnlLKkFZSiBhh7WLknpxPSL4oner20\n3HG4Qs6Zguv33LidqGfbLBUMYrbXpDMefIuy0n+DuWO1WG/DKgrp/jGwezUL\najXutauo/rUzmkTMXS2H8yZrrmMWAMLkHLbpAxk61NzQ/n+keN5cBeSAoA3z\nDp5vwOEhpfiGywXtuLotJmCz2Z1Kh1Cj8H7oWIWZ224JmCUvyW7Ga6xrClFI\nveGcQbREj6UL8+zVx5UpNNIYLbfJfM1aRqR8qcF0w2gIZfSPUPYuWNZtbmZZ\nu6SmriEIXSjgwJFPIY2GIIryxPeHeKG6g6k7Y196+/3xQAm7z3RUEz2Fjn3D\nfnzE07t4z6sdNnpT0qD5fjT+CBeGSkiTdWq6ECXIoo3tzm6oo94LVAWVxCDF\nLdnfQ3o/s2CjvOeqO3+Lfexv5W11z/69U26MZ8A2Wym995Rgy+YsLhSkAdt0\nPsbM\r\n=27AS\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"69929564b970323734d16e9588636ff8a645f2ad","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.20.1","dependencies":{"tslib":"^1.9.3","@material/dom":"7.0.0-canary.0e052b24f.0","@material/rtl":"7.0.0-canary.0e052b24f.0","@material/base":"7.0.0-canary.0e052b24f.0","@material/theme":"7.0.0-canary.0e052b24f.0","@material/animation":"7.0.0-canary.0e052b24f.0","@material/typography":"7.0.0-canary.0e052b24f.0","@material/feature-targeting":"7.0.0-canary.0e052b24f.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_7.0.0-canary.0e052b24f.0_1588210209892_0.6278874101536538","host":"s3://npm-registry-packages"}},"7.0.0-canary.ff4bc632a.0":{"name":"@material/slider","version":"7.0.0-canary.ff4bc632a.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@7.0.0-canary.ff4bc632a.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"47e2cb213dcaaadeda0fbf0641a7a0a4bbfc6790","tarball":"https://registry.npmjs.org/@material/slider/-/slider-7.0.0-canary.ff4bc632a.0.tgz","fileCount":36,"integrity":"sha512-35IIvsLd5NXGdHyIXw7vMCNb3/gkdmtMefkQcqjbV+b+Aw/uWMlWJO36AOroFbnDNG4hFQRsQbcKPDxG1YDFug==","signatures":[{"sig":"MEUCIGHD0BaIOk2G/Hz8+UbpiqA9FBBJIFnKb+042t3ft/ZyAiEAuu5xqpn2/q4CVJvXD8brFPCpx9kZ03hdUYYzbJZMN5k=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":373077,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeqowkCRA9TVsSAnZWagAAp2cP+wdSjAic1IkQX7wiIjew\n9LTmCs0/aSg/KHQNmS3SIHc56wI+xf9Bx0swmcNpkPut9A3AdjTGi4pjVH7q\nbqQgWE5fsmepML3fjWAT9vHnbQ9F0UI+nndnqo8l+Moxfh8OjC3yncU82cO8\nmHpzmIHsb39G+g2XadQ0DmD/75dKAXpdNLy7ZMekeH70ebdrPWie4k11rUtR\nci7UsM/qAUGqkT+7RJYtaKPCxdARiQEBeraGOC9aZByUdhJQmdRTDnWs8Ywp\nrfdqI5nCIMsCNh82xHyJQr/HpaMqx5vB7tFWac3AVKEaCJrcRHjVXhoe6/+B\nQsLjeMn/aVgGMfBV5Uvzk2Q0mplUxoaZtb0nKNhxSSVPZwFSOl+WGvkRtT0J\nBL2RllOj/AAVtpEAS59xZrULGPepN+opr0zcczsXgKnAMmerlqSBCe3bjgJ7\nEVrQWN8YnGx4/GfHbR1pwWFw2VI7Gt78FvkAgu45/EsQ417pYJpGqD61Q6RA\n/qArzjBnodq7sldQdrWYnAuO0YkLNjjYBYxb+CcoA1Fy5ezC9A9eyb/SOL4w\n4ZaynbRur524PWOC/YtC+82rt4OE+eswND4nW0wPkKCWdAantrfbUzEnpB3L\nN4fzoMORygBHpJqcREcH9FZMvak+fIi5TXPXjcbLwOAVYST8r8obipuJLJWa\neYWF\r\n=ZT1H\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"bf4456b9aa6b24c3dd166ee7bbf96a700054183e","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.20.1","dependencies":{"tslib":"^1.9.3","@material/dom":"7.0.0-canary.ff4bc632a.0","@material/rtl":"7.0.0-canary.ff4bc632a.0","@material/base":"7.0.0-canary.ff4bc632a.0","@material/theme":"7.0.0-canary.ff4bc632a.0","@material/animation":"7.0.0-canary.ff4bc632a.0","@material/typography":"7.0.0-canary.ff4bc632a.0","@material/feature-targeting":"7.0.0-canary.ff4bc632a.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_7.0.0-canary.ff4bc632a.0_1588235299788_0.19498676825608996","host":"s3://npm-registry-packages"}},"7.0.0-canary.b0f83d2fd.0":{"name":"@material/slider","version":"7.0.0-canary.b0f83d2fd.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@7.0.0-canary.b0f83d2fd.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"de75ff9381566b28c366c44651f310b96187480d","tarball":"https://registry.npmjs.org/@material/slider/-/slider-7.0.0-canary.b0f83d2fd.0.tgz","fileCount":36,"integrity":"sha512-MkArKvZvb6gaoLVUAB9o2SFisOf0m1mD/ZRYhVbDQDKodkNQXi3R9GXOlu/0GpsPlE38OzbeB8DG7JsohTf/Tw==","signatures":[{"sig":"MEQCIFocdyBGB6M/UpoMr+mWXVKisEeHGNcyKnzP1vsmwVfIAiBVgBtZEX28sFedxG6LvnMVcg1+BCfgNSo2gPWgKLs9nQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":373077,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJequG0CRA9TVsSAnZWagAAsNcQAKRffP5tK+3f/lnGYTU6\nvGNjAMAZNqsN9YXjo1g8AZXivVim+/PkEG39/cUWomPBzP/J83o33C17pcpb\ncZHn4uIu1OXrrMLPMZJ7fGntXnFvTfeNjW5RebSykpk5RZjxZ1Ul2gPrb8Mq\nM8UDCftufIFFquJ7GfQl6qomBV3OYC8xOmtBqU8R6XIqK2dXu6W8Mc40KrfE\njQQJYnXCLUWQndvngHdtubZ+ayhZ2V5EeNdn9WUxlFvUedO7mCcI1/lMPOVj\na7QTQZZz5N3Wevs3qRrR5gaI2RXLvEvXuXDVUjwXA6+651Nysnb/5jzQskOH\nSoUG4tmsbm4Cn7RqXn9HpeLGRhbOSc8El2PsdHdJi5TrkOnPMmhUp4lq1n4P\n2lWPsPOgBjxePTZOR1gbYjKCLjLW9fvwD+Hh/vNfBfdsmKZhXiPg6w6ImSd6\nhC9WXw3FyMJmxTP7EvxBsaVHnIg6pnWnzrs7aN/6dOKrbjmwzcRCCe2uLBMp\nAZIHWsuwEmlAT2WeGaOvjg7QkCyMMiZcVPg3CQ2cqvmG7iKdwwBVLJS4Yohf\nGA3Zk8rMWuKpNBmQhKivy4MEaMBdMaw+CDawEfXIVWwp0J0Ud/TVPFbwNPv6\neVhL7hxKetrQkh9QORSrdiKHHtTMaTt8pdrQB6Xtk0KK0X9mBbG0eZAI5QxN\nV86/\r\n=3MaH\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"a1500073e25d06ecb6fe752169f836de2cc6ba13","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.20.1","dependencies":{"tslib":"^1.9.3","@material/dom":"7.0.0-canary.b0f83d2fd.0","@material/rtl":"7.0.0-canary.b0f83d2fd.0","@material/base":"7.0.0-canary.b0f83d2fd.0","@material/theme":"7.0.0-canary.b0f83d2fd.0","@material/animation":"7.0.0-canary.b0f83d2fd.0","@material/typography":"7.0.0-canary.b0f83d2fd.0","@material/feature-targeting":"7.0.0-canary.b0f83d2fd.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_7.0.0-canary.b0f83d2fd.0_1588257203885_0.4704869005103334","host":"s3://npm-registry-packages"}},"7.0.0-canary.e59906a57.0":{"name":"@material/slider","version":"7.0.0-canary.e59906a57.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@7.0.0-canary.e59906a57.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"0016eb2c865d0f61ed6c7bf0d5b11c06744f3b91","tarball":"https://registry.npmjs.org/@material/slider/-/slider-7.0.0-canary.e59906a57.0.tgz","fileCount":36,"integrity":"sha512-p+X1FU/MNBEz7dtk6hbw9nB06SNRAfpTA12jTvjwBpEwnoxiOlLIUs2lwHvAYuSFF92Ut42Gqa+jShipLPV5HA==","signatures":[{"sig":"MEQCIGW3va+QHOxDtnt7A7HY6tTU/DoyB/4QRLTTl/bpYXiDAiAqDaK2gjkrJlitJXGzU2NR5ELxnA/HmSRF47vXV7fIMg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":373077,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJerENmCRA9TVsSAnZWagAAG64P/1VkmQlbhaAZKbSLJDKG\nBzy/PTFND1xWwazS9jbZ9CAGZGk1iXiPGaa93uXuMM6wrJkPqzmoctE0udpC\nUalSiInIHD8nBukKxFUTL0W587jGorp4vKo18tUgPQzQwbzZlr+Y/SoVuF05\na1ThcqrWA92B7aTeFlpoP8S9WzdJG1kZrel7QE8bKEsQHjL42azRpCeLlg4b\nbyZdCiDoNSW3HkSAub3PLJORL+ric/aHL963rEfPRFtOcF3aNVcYCp/qp5XN\nJ9Wc2Y0BRpZNXB8L10YlbifrTUXOnOLGKMhzA1ENvUNuxUQOiUEwqcl/8iT6\n+6mHxeazEjSQmv+B9wQ+JZi6pMfKSn2zigdUyUFuBVLHPB7dd/kbCSN5YtkI\n2F1N+j4yhS6DjF3cED3kcQnAJIvEqpAT28MhoAIkAS0j7N6K8IKxMT299ROE\nULm/73LcO0AtttdxdPT8FsiONDkVd+7fMziOiv+pdOM0/TLiZSBpoL92F6cW\nW2On83H4uQC7ZsCLTG8WtFIFjVU6fP37xVYu8P/Odxy8VlD51adLRTaA620E\nAP6SArYEXJtTC4P5o4ZVErUYUCTFkHt0UBzy4DsLumTJH2WfevDqerX35s3i\ndLiQ5pvcWOGPv4WcEWHOR0vOaWob3REDmqzk4YcLk+y3FkvwZbTYq1bGPyjS\naLoO\r\n=mn1X\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"fc7a5c94d345c5fcd76d4957427c551ed759a1f2","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.20.1","dependencies":{"tslib":"^1.9.3","@material/dom":"7.0.0-canary.e59906a57.0","@material/rtl":"7.0.0-canary.e59906a57.0","@material/base":"7.0.0-canary.e59906a57.0","@material/theme":"7.0.0-canary.e59906a57.0","@material/animation":"7.0.0-canary.e59906a57.0","@material/typography":"7.0.0-canary.e59906a57.0","@material/feature-targeting":"7.0.0-canary.e59906a57.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_7.0.0-canary.e59906a57.0_1588347749703_0.06100378435503284","host":"s3://npm-registry-packages"}},"7.0.0-canary.c02712b59.0":{"name":"@material/slider","version":"7.0.0-canary.c02712b59.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@7.0.0-canary.c02712b59.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"b201e3df210b260b4c42b696a498a9609c44cc84","tarball":"https://registry.npmjs.org/@material/slider/-/slider-7.0.0-canary.c02712b59.0.tgz","fileCount":36,"integrity":"sha512-GvZhgvsWyUnMp3zP+wOomBD4hzeOwFRaB/RyxSFqKKi0ALx92xcR8k1Z1uf3tySQcHN5LnhSJ9JTuumXOt+pcQ==","signatures":[{"sig":"MEYCIQDoa2bZR+nF4gFXjoSBDVpBLgrgyFbwPbQd376K+Y2sowIhAL+Vz6FnuoIk9tn7oGO/Oo5WpUS+WocIOMu2cQHp786z","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":373077,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJerGnKCRA9TVsSAnZWagAAXL8P/0xHxtKduCHwlHFwI8Vd\nCUsHgQnjk7kCL3KnAn1uLnTUdE85Cj+yIWtC4y5+B6Lm/+MnmIS9skOUrcs9\ndzJAVBiz4mlfFynWKMOhjuYZxl49t1gOg/ZH4/R6AsbsY4FS9Tortv2v4WG3\nVTdzcelGPr/VTLvB7hnk8KJnYjYN1tP6Yt8du1+XoDESr/ky1MkfJmgGeWMy\n6I/jYh3G2EW+wDYJHGGA4PlkcxjKU+xQkjQt5c0y6Th65Api+YN1v2MoVX7f\n7soCmkHPIfHs7GE6UbxI8LCwo5cDm/gNt12HZvY7x3ru16Hm8Ifxd+EAez9K\n+feeYss6yMvL1BZJP+qs8Vm4sn9ZTdy6dV3MoTC2mURPFWVW46LK9rBPFbkF\nvqyIbOkoCZAQf6KW8uTrDvK3cIvEZVBYjPeVXtCtoORswyPKFtXLdJwGRgZG\nuLkMMvGtSf4QUn9XmCHkNo+2Yqvnp7Pxxy2VCThkP6EKPnUMf5LNBj64m8x1\nqPWcJJ80mMq+sQFJQmy+z+gQad4saek0Xash9xtietWLcx34E30tBjz5Jqj6\nKLUJNWF/3okjKWHXh1e2/8j+utK+qmWz1+pr0Ot2+q+eLcIw+5OEOJt6/pYz\n+QV4tFbeL5DUzQBveK8DUQKgu7CgpJwqXvWR8nderoMxR/PxM8HKIB8L7QgE\nGeco\r\n=E6Hs\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"ed5da0cff8ae5197cbaf84af0bc924c207d3998f","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.20.1","dependencies":{"tslib":"^1.9.3","@material/dom":"7.0.0-canary.c02712b59.0","@material/rtl":"7.0.0-canary.c02712b59.0","@material/base":"7.0.0-canary.c02712b59.0","@material/theme":"7.0.0-canary.c02712b59.0","@material/animation":"7.0.0-canary.c02712b59.0","@material/typography":"7.0.0-canary.c02712b59.0","@material/feature-targeting":"7.0.0-canary.c02712b59.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_7.0.0-canary.c02712b59.0_1588357577842_0.8357713395263842","host":"s3://npm-registry-packages"}},"7.0.0-canary.15d65448e.0":{"name":"@material/slider","version":"7.0.0-canary.15d65448e.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@7.0.0-canary.15d65448e.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"25ae37ec892375f6a59b148ade01696bfdaf0cd1","tarball":"https://registry.npmjs.org/@material/slider/-/slider-7.0.0-canary.15d65448e.0.tgz","fileCount":36,"integrity":"sha512-etOZWaiIw5xn5Kj6ncwVoGfyUhVaFrsnq7gv+jcd5npDXYohFCJx1ldbpiLMYW0C5VoXldUbS3+OkB45pBLeIQ==","signatures":[{"sig":"MEUCIQClRXx93v8St8IZdvUbkpT7u0paw+MnH8yvft4zL0KgZQIgaT7R1DnV7XJE6r26VV3X7gQz4qp6miuQtEFgK9UpGvs=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":373077,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJerHcdCRA9TVsSAnZWagAApUwQAJsRoP0P7CZ5yzcGRGwg\nwrOdBfG+VT4CqtzJTqlnYqcd9O/ZPQ+W/y/FKCf64Ifw6fBGdJ648Y3o4w+w\n1+TvKYpKR1g2HbI2yUXETkcfNmED0bt+zgVpnrVT2Zyghx2ANLWUpLwMDMZZ\ng+1WaNlB0GcBaVqELZEpOPXm9fps2eWekbLbiy3hjDfhm/8oq1tz3KpZjQ/n\nmROkwrCAv8ygAlvYtuS+G2nkpapj0L4WvCHC1Sd2EnARmwl+4MR3Z25LCCur\nOAxH3+A4nxQ/Lm0VsDIlUeYYGcCxgfGM8khSC1ubgCDXIAhtz8NHU59RD4Cm\nNr20HJtBonEu1Ov4hr105qznNwCmSP1kL32fgw+t8PhPa1cTsCCnb0JCdOi0\n/oRkIHlZWt2Bezq+/fVGiUDCrPdBN2cIwBxnFnElojlGXTn/NHc+4BWX+wOQ\nUh/C4YZLYAg/drCVEUrbt33EVJQHCK1lnajWaV/6vgLfVSlE8gdX5aWw0Oxs\ntXNU92GzwfICgi/0Cyq7n2Rw98T+oaA8opToEivyn7B+E2vcPG3lQVMhuogX\nr5Xo6BCWxPwOZG0COPQF2ey4ARaT/ByHj8I93OJsqfGp7q29LSAE7rarv+gg\n1l4yC196N6McaC/fKCIaTeP8B+kEcTXAmD3PfwVSUYRI07vy+DQehmXM7jYX\nYIlK\r\n=AH6G\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"b2e16d6a45e857fdec3838c3c09ee0a1c61d1858","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.20.1","dependencies":{"tslib":"^1.9.3","@material/dom":"7.0.0-canary.15d65448e.0","@material/rtl":"7.0.0-canary.15d65448e.0","@material/base":"7.0.0-canary.15d65448e.0","@material/theme":"7.0.0-canary.15d65448e.0","@material/animation":"7.0.0-canary.15d65448e.0","@material/typography":"7.0.0-canary.15d65448e.0","@material/feature-targeting":"7.0.0-canary.15d65448e.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_7.0.0-canary.15d65448e.0_1588360989184_0.8208716946761354","host":"s3://npm-registry-packages"}},"7.0.0-canary.142b1549e.0":{"name":"@material/slider","version":"7.0.0-canary.142b1549e.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@7.0.0-canary.142b1549e.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"fda7018a89dbc38cef641fa8ea041304a881a948","tarball":"https://registry.npmjs.org/@material/slider/-/slider-7.0.0-canary.142b1549e.0.tgz","fileCount":36,"integrity":"sha512-M4eFnJ5XXNoSCJSXEX+zLIwHWfC8o9tJ6x+eOuGN4cbvPAbOj+P/Sx+AxCT6HfuJ1muTBbbXH8ujfH5dja69XQ==","signatures":[{"sig":"MEUCIQDc59ade5S/meNIY0nOnjkDeWxx4z1g69/bL2Th/qK3OQIgTKXj5WTSfRWE9REWTEDnwfUerr7SiZ1CSd4fvUSqd/U=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":373077,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJerKRjCRA9TVsSAnZWagAAq4UP/27eSB7L/uxM9S/PY53p\n+kL3U+nofGeihi+mWR3zZlva8dDpbMeb1PPeM96G0ux5yPnpJ8B8bfj8LjLV\nQtkybLHPx3zspq65YtW1TtJ5PEG1R9k4EhiRe/Vj7mgMNtESu8et1zM5aU4/\npF/QYP08XgEmE2mYXHlmTnIjLh7VezcjA0CMF8YsB66FhWwF1Ofk5GLenO6P\nSX9xK0m6+v5lZtXEtpqF5+D3KCfu1LoaJba3MvTLsxJO5Rtvl1BwEVWBEfay\nQjYf1jv6e/0dmtFx0goW9az6hLipiJiD/A+FDO3XWIm037NQerXTe4j9EIuu\nLOpCZUdVbuJYh4eVTZyx136yFmEaA22VST75fo7VM6GOcMRXhC3XBlNxuhSK\nN0DiN1+EN43Mn9g9ZJuTrXO764+ox8739rq/0CLoj5oJTGuv6OFYPfma7vD6\nVgYE3z3mVdVXOoLByQXRG3I1WBPQ/lnkYRMMSMpxHVnVvANRtQzwn3dGhTRC\nv9Dap7tIOH7DJTGka4V2h1Ce4R0fGfWQkkXQHlIVgoxizsA3yb7pr8sqxfzy\nbDDm0mXwdhqVoXpsfO+GDMU5DvbjFsHGb1DeFDDiEt03GO1n9Z9E9ElXeeTM\nrn3SI6pJ2Go/u9f2zqHSqaDFqWLXvdSVU5MHL4gZsfadMI2Z3HddgH6Fox4N\nCTyb\r\n=JD8s\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"c43c6e2e74a4352aad7225952aeb9e7154d35751","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.20.1","dependencies":{"tslib":"^1.9.3","@material/dom":"7.0.0-canary.142b1549e.0","@material/rtl":"7.0.0-canary.142b1549e.0","@material/base":"7.0.0-canary.142b1549e.0","@material/theme":"7.0.0-canary.142b1549e.0","@material/animation":"7.0.0-canary.142b1549e.0","@material/typography":"7.0.0-canary.142b1549e.0","@material/feature-targeting":"7.0.0-canary.142b1549e.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_7.0.0-canary.142b1549e.0_1588372579369_0.3317174945347052","host":"s3://npm-registry-packages"}},"7.0.0-canary.524b7b812.0":{"name":"@material/slider","version":"7.0.0-canary.524b7b812.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@7.0.0-canary.524b7b812.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"b9b2ae2df65ec2a1827e30c9b6c2ef987907e416","tarball":"https://registry.npmjs.org/@material/slider/-/slider-7.0.0-canary.524b7b812.0.tgz","fileCount":36,"integrity":"sha512-EMNeIhJCMqQ3uikhebNl9fBN3t8PPJBN1ubwrS0cMQFqyhJ4FfrsAJabGUXG2lSmCtOi5VR3XRa1r1O8KylhsA==","signatures":[{"sig":"MEUCIQD/+i+hG7EjR+AMcJ41oRtpjzhSDyBUFZpkdV1rolLvfwIgW22ER4nSRFTeYHlidWw+1K15UYei+NjoyP2v3/0Ples=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":373077,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJery4BCRA9TVsSAnZWagAAgBwQAIf5lC4AZ1GbvXFInQQu\n538MWMD5L5oYDE+XWyKf4UgPd4O/vm+DdDVETj8N8sz6RspaxKa+T/EHeqcr\nfaLsij282ZtsG3QT/1E1wgzSmBkAU6lbUdse0o9Tk8vi7VDkUeC5PjFT8F3Q\nvL0W9M2cOq1PCeSIEfB62OlQLGr7Z5w6jbm4Uk6BZN7jWsDKusStwoc6YTQx\nILPYhc1Q+W5eAGzcaNWCECqxCWaiUVB9nJLDzjk/3ScNFnyR4AJMbghN4InE\n87u6tBp186hkdTjAg3os6UO/AKfWkaxUlbvo3emlKeybbYENEzLK9PjTjFkP\n8DDVGCc0BxUkVI9bPVI7IlLeLy1uDzfKSBXOD38jCS2wQY7Od9tAdCw1Yomt\nfOUOf/LUN7JDUKyzkug0+GE3FKlXAk2ca1sbReOAE8IU5b5cfAc4SK7J5eu/\ni/NBo69lYL3GX35LsOyAd5sH4QLZ00VVR2jdxhFrjjGlB2FaHfqxx4ug0PzE\nhuNVulR6tYIUsxaLgFUrtP8fqR5ET5Bb+cOby1LqdzDbDhcHTFiyr5QAzE6Z\nFko2KIIIvnkbnr7Hvo8XQ6AMLM3PdaqS60FIfDOo6BEIL8xn24+w4yPaRK18\nY4YA4Pl6QajRLvW0Vxu6bMfaTpD496KWpj72Ncqz6zO9151JmTpCa9Z8dmPb\nSvpq\r\n=s4wy\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"82ab8bbdd2373b285c315177e7054a727b38f4a4","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.20.1","dependencies":{"tslib":"^1.9.3","@material/dom":"7.0.0-canary.524b7b812.0","@material/rtl":"7.0.0-canary.524b7b812.0","@material/base":"7.0.0-canary.524b7b812.0","@material/theme":"7.0.0-canary.524b7b812.0","@material/animation":"7.0.0-canary.524b7b812.0","@material/typography":"7.0.0-canary.524b7b812.0","@material/feature-targeting":"7.0.0-canary.524b7b812.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_7.0.0-canary.524b7b812.0_1588538881324_0.4327189177850763","host":"s3://npm-registry-packages"}},"7.0.0-canary.bd8ca9678.0":{"name":"@material/slider","version":"7.0.0-canary.bd8ca9678.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@7.0.0-canary.bd8ca9678.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"72f4d4b38afaca287cfd8aad19a14f08932d3a4f","tarball":"https://registry.npmjs.org/@material/slider/-/slider-7.0.0-canary.bd8ca9678.0.tgz","fileCount":36,"integrity":"sha512-aMnqw4Frozpc/3h7gLa9+fEozNQgI80Mf9cYb8AvH58UOOklmSqnNHihQa1B/ONPbfgq266zu86BpeG64DFPUA==","signatures":[{"sig":"MEUCIQDUeXcLdNUME/6biCXvvqiyQq8J68yeaxgJ0uGEf0z97wIgYBREPqAPCyg9aUhzvI26MXcEE+XZoNe6Y+5FxwIVSwI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":373077,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJesE6mCRA9TVsSAnZWagAAvuIQAIbtuZX3IDSrQGu8E7w6\n6jiIbnBumKQHc8SG5BHhooQbTDWpMGOTEcM7XtfW1NYwbUpOMT59omj1DmZ8\n4+1I32M222fZt2bdjqR6vXDMrjqIMKDsLjfFA3EiOiIL2yZjjdJJJQmv15Fs\nbbaqQaYAsZDnjXogxmE3X3xlk7kAq/pb0PBEuOFAGiR4LJ4ihS8HNe/R6Sb8\nRye+gzsCQLG+VlCS4EoGswP4jMjuattTxyn7Tm5SClWbEao7m1jNIcY4KAfr\njNC3Xji1T4cieygdZniG0PcPdyLp+P5EM+hAU7rU2JPnABgPN+3O2A7WOkYv\n4C33mFqaVCAxggNJtwZlBq49+vd5T6KcOGX7GQdK/TfrY9OxgcfK+3loXJLw\nbTJW09BVFwkDfXL3PWZbGJ6jpkGt3mblhe/JftBkbLfBzFlArk3ousIooay1\n/pObtSjcS6I/r6BiWvimRXyFOlawjLG4iRVIngxBI+gprvIXW4+VlUFnD3da\nOy+UuQeHBTJTt3bQ33gePkjr6I/zpPG3VGhLQDw0ZBM6gmBgxm1Zw+1A/9Si\n/DtFTROHezsvV/zAxYMGYr7b0g64QIyeX2TOI4U/ESIVJ5fa+KRdRB4AUmrK\nlcVCx16qFGxeadliO5jpY439okwVAFcc7locAPV/7YoiJK4qwzamz4AokJrk\nDgE7\r\n=Bd27\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"d21e98ae16f9c893bf27272d187617574615c417","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.20.1","dependencies":{"tslib":"^1.9.3","@material/dom":"7.0.0-canary.bd8ca9678.0","@material/rtl":"7.0.0-canary.bd8ca9678.0","@material/base":"7.0.0-canary.bd8ca9678.0","@material/theme":"7.0.0-canary.bd8ca9678.0","@material/animation":"7.0.0-canary.bd8ca9678.0","@material/typography":"7.0.0-canary.bd8ca9678.0","@material/feature-targeting":"7.0.0-canary.bd8ca9678.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_7.0.0-canary.bd8ca9678.0_1588612774256_0.11857765142347798","host":"s3://npm-registry-packages"}},"7.0.0-canary.2553e86fe.0":{"name":"@material/slider","version":"7.0.0-canary.2553e86fe.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@7.0.0-canary.2553e86fe.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"c913a0fc05173074b1d723334a030585a651e5a3","tarball":"https://registry.npmjs.org/@material/slider/-/slider-7.0.0-canary.2553e86fe.0.tgz","fileCount":36,"integrity":"sha512-aYzPKCKtkbx2VS+mW39TUN/gGUaI/uLqyDubO/DO43JsMvrc2JFk0wCF9lQ6HCiHTflNmpsuCXDzKCea35+SUg==","signatures":[{"sig":"MEQCIH4XKhxmwfxGuHQVlSa2bC4kBIuum2S0u4/8WIobtHoHAiAFNT+3NVDlAZJ+o8nMQhmESP18SD52IOcnPkk1uoqS6A==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":373077,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJesFFoCRA9TVsSAnZWagAAQ6gP/jyNGaS2OUpwCf0hfaiP\nKD0Xe3ti3mSdltlrbzYiI4kxBpb/wMj/KvXp3BPaaEtGg0jBc+6RbTOTtGcm\nNc5MUtEsTDwZSCrg+jhjJh402wIgyn23grbMnI3T/71KkSEQZGJQNnBWx1tu\nxR550f3+ZS1V68QXSvmwTgO1xingO1vc3gFXN5316C4Yl1bCTAjWwl2KinTH\nQpA9oo76QTHG/p9lXgZQXhfdjd5wfZgxRKUFuzf5pD12R4iWYScT3WHX/Wbi\nPo9OBRzFRXae5LoSLGsmAUdpgsDOjJcmiUgObTTPZS/P/CvlocZvhRljLtOV\n8COJpJu397oLUQOviGF1JuwVY8cmkAcL7brStzgKcnJZ4/eDoHgJn091IHOc\nnL2+5U9IJnc/o5iAEoEKvtXRviFjjQfjH3Pm6O9dPBlewWnrBtAEyaNLkoUV\na1/ObsitTPdZe9jun7BwPywPxFR+wLsJVKwTiHdit6Xkawzf9sXUJkNoPJu0\ntfa48cy+hxbkbJnMyWrvoV64+0P4iWwfrcz4SVoo+9DP9p2bfy70AWBe9Si5\nJe0ZH8mpmDME+ZA2Z4lLMs+eRXvbmcnHdrpRzQz9u0esSP+Z+Kakp1YQh2Qw\naGWefco0/MqDghuF1m0Tfnq2sNnqzxVGp+ki3c0LVzHdcXB+gL02wJOrj6PC\naVHe\r\n=nW8F\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"9fa3a214bf3d70eb6522a1f75e622d936e7c0273","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.20.1","dependencies":{"tslib":"^1.9.3","@material/dom":"7.0.0-canary.2553e86fe.0","@material/rtl":"7.0.0-canary.2553e86fe.0","@material/base":"7.0.0-canary.2553e86fe.0","@material/theme":"7.0.0-canary.2553e86fe.0","@material/animation":"7.0.0-canary.2553e86fe.0","@material/typography":"7.0.0-canary.2553e86fe.0","@material/feature-targeting":"7.0.0-canary.2553e86fe.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_7.0.0-canary.2553e86fe.0_1588613479548_0.6074956325352736","host":"s3://npm-registry-packages"}},"7.0.0-canary.03dec929e.0":{"name":"@material/slider","version":"7.0.0-canary.03dec929e.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@7.0.0-canary.03dec929e.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"e4680a75b052f9b6dc3046ab65c405fcb11e5cf9","tarball":"https://registry.npmjs.org/@material/slider/-/slider-7.0.0-canary.03dec929e.0.tgz","fileCount":36,"integrity":"sha512-MQF2vQU3FZl9gH/R6o2XNxaaf58nVHVelr48QiFksbQMftpczmQGMZG6U+DFC7w66sXT1h0uRSeoJezm0PE5Mg==","signatures":[{"sig":"MEYCIQDO8vrSIdUxlnydUgKSRVx/OmNWQOfFe7NzK/lEo2MkTQIhAOKuB+0jIcs9/tlF2RvcOHhPCcaMWyWXMTIEP6IMJjk+","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":374191,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJesKaMCRA9TVsSAnZWagAAZeAP/jQg8CYZMEG+eMkWvzh2\naulW18OG9En13hB7HZ/zp3RXvuNGfiBkkCRKfncmqcsPXHmCigvg232DAg5S\nEdkUDONWeszo10mEkYdinjrVB38+XKdn80LObdbZ/lGl3rK4oe8GjMOutfwr\n12L56kjfI36//OkxjeqQQp2FKbwFSnvjNw4Xz2cphv3CEUspra1C3wtVmhCu\n+tskfIi2bkc+nVcs7ci2XAs1D8V7lXKCpbHztIXgDOsX341dw9K/RbAAGrZq\nXbwWKnVqq5tdCpqueAeHcgDoxf7/Qv7cKmUc8BLx/Hbk3/PVSHzAGG/gpDTt\n+DIlab3wH2QnfK2dcbe+yUJTjVWWrULmZ5YgPeq+uAwoVb//+ZkxG6DO6DPM\nNHtZZCI+VDQT9x1xjQbqDzJHyD0MneRTQY40Dag41lRah5TWtlxl/oMMH9zD\ncq0tpf+EfSgYI3eRAMin3LkDI0ArgLheBEos3+dH3liBb4fnjr4RRzWiZwtM\nQ8sdCa/1AmxmkGdCO2/9TvEDbKBjEWYIdtzxUEDoVPTm2O/Aa+M2grrqyYUp\n/6VNcNNETaUfgufcHER4dn8+6kldNSLbPbp0wnuSpSOdOfd7cjRtcLkBSM4T\nnqof+0iVY3PSxejJ3MuVP/jif2z43b5hwnnyZf2sARw8B0HQuEsXdZblzmdw\n1pk9\r\n=uuvj\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"976244ee82fa3e080e074d9aa9a254e6428c90f4","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.20.1","dependencies":{"tslib":"^1.9.3","@material/dom":"7.0.0-canary.03dec929e.0","@material/rtl":"7.0.0-canary.03dec929e.0","@material/base":"7.0.0-canary.03dec929e.0","@material/theme":"7.0.0-canary.03dec929e.0","@material/animation":"7.0.0-canary.03dec929e.0","@material/typography":"7.0.0-canary.03dec929e.0","@material/feature-targeting":"7.0.0-canary.03dec929e.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_7.0.0-canary.03dec929e.0_1588635275807_0.16223681874120222","host":"s3://npm-registry-packages"}},"7.0.0-canary.d92d8c93e.0":{"name":"@material/slider","version":"7.0.0-canary.d92d8c93e.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@7.0.0-canary.d92d8c93e.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"d01370dd022895233ca8f9232c2d8e44ac422476","tarball":"https://registry.npmjs.org/@material/slider/-/slider-7.0.0-canary.d92d8c93e.0.tgz","fileCount":36,"integrity":"sha512-oj+OcoGr1M4TQUNzAwBv56yKD0cHUvd/cxtGxjIuMCXby6fH1VrbY0FZu+t901Rtx6puEM9Tm2hkwvGRtmzs7w==","signatures":[{"sig":"MEYCIQDJVlbTO4vu7UMs4SZt34zBrybIAA0yv7naWntJ/cctHwIhAJ7jd9cuvclQmle6Ee7gJ6H5glMFzN5KECM9GYo0RMhG","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":374191,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJesZuECRA9TVsSAnZWagAAUncP/jqszHyYZTM9JbPzWjUh\n5aQZ4oWN03eji6blxTRj2QMJ6edIOyAhKt+SrgEF5juej5LD5VP34jpkSCXt\nbksp9DykBl12lr5XjXDL0GX9Cz6m7tTaas8nq7voIcRModwsLJKyHQGJ6nOZ\nWb0ZGsgYmJLhW1jmCs1rk2pLbvzrw7iSUbeKceR76oNvoe7jUlgI3ojRciCi\ndyUTdufWeCFoxQkx8xbmsWfTMYZRzYxawchsF8ePNhBXNtSCIjaAouO4ufL3\n2jcJ4paYJagFc6e/nmcBWU47wfB9Whfr2n597DxMBl4kPjVyhw0eEEiirpuS\nJpT4pct0EcnwfScei9fCJ+wpIGCmRvwiB2tgu6XWdhe8mTFzSmzI65Ih8aIm\nGinXnpYUSpKEBoPQkTdU5PHQ5kyaLcK6fJswiLOSZJrIT4CuJ1fwcoMojd1X\nq4wM5vecyN0J26f2FZ5CTqn06MmpDH/nNsV07+diuyn/ugXlfcW23d8ipuzP\nyJEfSScoqU4UQYecfo7quWrNSt9K81hieupLN3kgEcLkaAhVEz2IA0llQ/lM\nEWgayySouZa9WkEV0Iiykaql1L6Cp7AWbk/X84O76G8QU09mZtEua/r+PvBg\nmZjnYE1GtabUQBSUMfz+cuZSPu1mSUiLdk31rmupNl1RrL+6IO0rdnCng4gi\nIvks\r\n=8OiA\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"0781b5a0f14ce17201271abfff044630d170700d","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.20.1","dependencies":{"tslib":"^1.9.3","@material/dom":"7.0.0-canary.d92d8c93e.0","@material/rtl":"7.0.0-canary.d92d8c93e.0","@material/base":"7.0.0-canary.d92d8c93e.0","@material/theme":"7.0.0-canary.d92d8c93e.0","@material/animation":"7.0.0-canary.d92d8c93e.0","@material/typography":"7.0.0-canary.d92d8c93e.0","@material/feature-targeting":"7.0.0-canary.d92d8c93e.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_7.0.0-canary.d92d8c93e.0_1588697988216_0.6781381186135962","host":"s3://npm-registry-packages"}},"7.0.0-canary.09f591967.0":{"name":"@material/slider","version":"7.0.0-canary.09f591967.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@7.0.0-canary.09f591967.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"104dedfa147340ae28a30aff301a0874eb53b2c0","tarball":"https://registry.npmjs.org/@material/slider/-/slider-7.0.0-canary.09f591967.0.tgz","fileCount":36,"integrity":"sha512-J4VkrHk/eLfoD+xnkz2SH3BCJmnV6aZ+O5VfGu++ZDhGafzvW2TIGK7J1n1JteNBxOuN4yp9i4/f/9rq8NOTEQ==","signatures":[{"sig":"MEYCIQCOYZXN0GqGDXGDzZ+I67+qy5zDHvFuvchXMIA7xW+lLAIhAParqa6AIsKAJkiy5yOuc+NImyS7i+Vn2DsQfKYBsQdH","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":374191,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJesdT5CRA9TVsSAnZWagAAwwEP/1EticgmsDeiilisRiPk\nIEKhQRlc311HTg/XSQXFGP/rQA3HfR6/vv//7pGxh0g6m9Pf8SAgr9vJhl1l\nWQNNmmQ4iHs2HMyJu2mHn+6hqL7EQ+3SeSkhw03QDegqw82733qGrOQRe0D8\nh9Bsmi2GUek024QvzOVbcZVwAqVR0pFV6pbasrGRgDhQGrh2KRd+MbEo25h7\nqXdU+7wNG6Kz4VXcBOM5mjJarAqiIsUAsJ/pKjh9RypXhPI0CHdjU0aG1P02\nJhKC0ksol+6wQprS8QZjoBSxA+/juYKmjg58PzoSy0PYFEtv8RRnthg1tLtn\neabr9g4JM3s1WbPyDS4XdSk3ZqBACouWj3LBo2xluQtpM9qmzneYG3UkNUjC\n+MLIMbhFIoGG6C3YmySkCw00T/Y90SrELwa9VxSvXWgRSa1wHv2ifMLGVP6h\nduNs1u+eLjcBuT/OSDqaDrd192F3gVf46hT5I4nPfp9x8PYdgXpj6EFTpqNh\ndEAqMjPXmj00l5rZOL5Xm/bnN/8JrBgnLDBX9n3Mm+O74LN9MCCEZojSelEn\n/CiG+r1A0NJpF8X8/anwed3VQRXniPR+IuCueJ0d8zy67zna90jwCGYAubk1\nOxpNCrGN01tPyLvn1Xsm+Vs8cJ6WZzhHvzNgY5Cun6eWOR7P/9NX/uf7bgog\ncbOb\r\n=d6Pu\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"b1c5f494b8c0fe5f6f9710e50d51e2736a01b227","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.20.1","dependencies":{"tslib":"^1.9.3","@material/dom":"7.0.0-canary.09f591967.0","@material/rtl":"7.0.0-canary.09f591967.0","@material/base":"7.0.0-canary.09f591967.0","@material/theme":"7.0.0-canary.09f591967.0","@material/animation":"7.0.0-canary.09f591967.0","@material/typography":"7.0.0-canary.09f591967.0","@material/feature-targeting":"7.0.0-canary.09f591967.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_7.0.0-canary.09f591967.0_1588712696759_0.9602902763235752","host":"s3://npm-registry-packages"}},"7.0.0-canary.3846ce311.0":{"name":"@material/slider","version":"7.0.0-canary.3846ce311.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@7.0.0-canary.3846ce311.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"ccdd302d31efe1f51c44871cdcb854970230025b","tarball":"https://registry.npmjs.org/@material/slider/-/slider-7.0.0-canary.3846ce311.0.tgz","fileCount":36,"integrity":"sha512-cJsthKAu6ONkzrOJvGNnpYsNCLS8H+6n1zoYJhecCtEgy0CAJ29BF/O3ginLi3GOJpwDWSmBTOvhcqyqEJVRcg==","signatures":[{"sig":"MEUCICoLIN6MwpiTMipXDWHemiW/F/P5Gh45OowlacWxWahNAiEAgiMipKh6VdNC/km6ShfHAjoGTcqHm1B4zBA4dDikv+Y=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":374191,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJessU5CRA9TVsSAnZWagAA/E4P/R5Bo0hClv85ht6bHAP4\n+oqmvhyEW7iSFt1qCldRop4ncxAiyEIOGh8YvXlIgMDh7+vJP1oNH9gvLr7a\nEbzdSc70mC3kms3GCjtZf1RG46+lviRKnXawfwk+WxH78BNhavPjdNRXzPPd\nQk1/U3PGS9fRnD7nJ5GssMaSi795+MbE00ifT0kiBAEoVzZ3GXn20q9PqEjD\nUzSXCi8cYIZDZaIyzZmpkH7G65l9urrY4hT3z7WNoQUEFyNh/M7JG+mM5L4M\n7Ev9myqlx1Vu3h5SjnU2yZOrEAEDQKQP6GlYeojlitITmxN946MjYVatp+wt\nWgKUy0hOfMo54GV4CgFjC4EKLDT1krFa2vwxTq2K7fy++OYSzRXe7i8EAZ3C\nZ91V+LpASEo6zq+DkPyiE53xYZ2B/rx7adSCGkbgFVjoJse49FwlwDT7VNez\nu3ojB26xMFs8guVEPRjfB/UA82DLXKyyDgB1WvR8yraZBmMuZvtcVcsyzkK+\ndWiprYU89h2EYO7bu99rk5Hn930J//lLlc/6u9+/LpSDQpWNDPJf+1u0EUVl\nO61e1oz3pcjaQf+eEOtpkObGZgucWhgQSztu+105Qw9jUP68L8zF/almXOiA\nZfoI3n5x3Yhj1am7SbtKO+89cpn6vLdyWp+SBlk0lfvkOWpO//Jb7lnRcoj8\nU6QB\r\n=BG5x\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"80b3806d13f75bd5b77443c9e504fd6468a5820b","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.20.1","dependencies":{"tslib":"^1.9.3","@material/dom":"7.0.0-canary.3846ce311.0","@material/rtl":"7.0.0-canary.3846ce311.0","@material/base":"7.0.0-canary.3846ce311.0","@material/theme":"7.0.0-canary.3846ce311.0","@material/animation":"7.0.0-canary.3846ce311.0","@material/typography":"7.0.0-canary.3846ce311.0","@material/feature-targeting":"7.0.0-canary.3846ce311.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_7.0.0-canary.3846ce311.0_1588774200656_0.9157698713338756","host":"s3://npm-registry-packages"}},"7.0.0-canary.ed7f32463.0":{"name":"@material/slider","version":"7.0.0-canary.ed7f32463.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@7.0.0-canary.ed7f32463.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"03aa7d8f68f0e7c3bd86849df2fe6a65b6739a06","tarball":"https://registry.npmjs.org/@material/slider/-/slider-7.0.0-canary.ed7f32463.0.tgz","fileCount":36,"integrity":"sha512-CXluNrK929OIBUaqW8tbXz6n2ELL+sebSsA8NgcSPIDGT45K9cb/ZehFiwdTD5oaAhoLFAhclZu2OE4U3KetYg==","signatures":[{"sig":"MEUCIC3icK6uiHSarjSNVlgBiXKf+WLrt5RRNjLBs9qFJkt0AiEAhYzqE8z4Pzqo44tZUOpbumUekguAgMziW1IOoAE3zzI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":374191,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJesuD5CRA9TVsSAnZWagAAZx4P/A3tr3zbeKjLteWUZfBa\n2aWNygr7QsJ8++bCJkruAOhAHfdDJaSGKoXqZNZVqFSRa7j3WBdfE+Uz9lNK\nMB8oEPw5BvXq7fQJPlFUHmf5cgByZwdTA32WOlDu3P9ijYvwdV1sHfnxW7EC\np+ha8fPwuRN03FdkG9boJJKqs9kMHtlXJcedv1dSpzKFnOFbZc3f4vfK30D5\na8eoZv1d91juQAikLnic6llO1/BWxyP/k2pWuUa+NtNzxuO7kUV0zPwyNtPK\n8pb4IjllIXDLISvq0pmNwH+MwA+PPxo0pYAcX5aIVdPikJlvEFrghaDduwYx\n/rR3IcUjc8NTFQL1aU1yj3kdYpPP72QRNvcbYUCUs1z6+firo2NIe80Y5YW5\nsdvwtsyXH2m9cyNFdYZuEij+zEotwlwaKF88COqk+feEXj9pCuPdRmnZKv/8\nENTMTVAQZh/RdPkzsm+SdUG53/eVaDG3ThhFpBPcztJ6YH9PkqnjYqSvOnC+\najYdaFUk8YstZFn27U/OjzH7wAO2HgKvcTykSuTkz3+oVo48/LdWkUDnJaO+\nu4z1xyggaesLM6wCvOxyjjVfrQtoVy9LcVvMMqmk/LBQ2mx21hsl2x8mwWOq\n3Y8bQPvj1e3ZYLHjGCGKIOA7pKAzg8CJH43+W545ZyUJQY/mASCL9Vuhi7o1\nOWsQ\r\n=9GlI\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"84dc461d7b4d6f61ef286fa2ade4f3d05018af62","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.20.1","dependencies":{"tslib":"^1.9.3","@material/dom":"7.0.0-canary.ed7f32463.0","@material/rtl":"7.0.0-canary.ed7f32463.0","@material/base":"7.0.0-canary.ed7f32463.0","@material/theme":"7.0.0-canary.ed7f32463.0","@material/animation":"7.0.0-canary.ed7f32463.0","@material/typography":"7.0.0-canary.ed7f32463.0","@material/feature-targeting":"7.0.0-canary.ed7f32463.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_7.0.0-canary.ed7f32463.0_1588781304636_0.8763194814817841","host":"s3://npm-registry-packages"}},"7.0.0-canary.8135cc085.0":{"name":"@material/slider","version":"7.0.0-canary.8135cc085.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@7.0.0-canary.8135cc085.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"8d9a5d2f814600b9eda98eb9e803ec0fc963c771","tarball":"https://registry.npmjs.org/@material/slider/-/slider-7.0.0-canary.8135cc085.0.tgz","fileCount":36,"integrity":"sha512-cijUzuQ5nzp9bFHpWp36WsbRkdHhcal22gxFZMCxveSiEsBsxYVlvUP5/UOcEMCleQwUwvFWS8lsukdbsMcrPA==","signatures":[{"sig":"MEQCIC2X6WTMzdAoR/45k5HrzU5Wd3rNRvKn/bDZH+L/7ytSAiB3zNWRPcdSuBddXeHuQr9hFRVOzAyE0xtlih1z8srD1A==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":374191,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJesxY3CRA9TVsSAnZWagAAfTsP/3dVLQuc2lgguHwpKTwA\nbFsn8RBiBcJcRt+xrVsNSNMjjJ8kkeX6FdKreuXV+ISXY7Ph+4Pqkc15nNJ/\nvrTmNou1CoUIX02eOleN+zKlUAXr4kpJqc+Jw1F3t209ZUiTGCx2CCvrMVvV\nSk37btrZIuYfxdzLDP6DTGv1TSG55fJPNtvkeXyZtmdVKQz8k0aA9q+Awjxx\nxuRkPkUs6HbHzh5h0SVBzui4a6XJ6m+jDARiJRY74/is+tPeSdYsvgLmw1Xt\nV2QOn6b4u4XoMFteYNzBWxCy/OxBTAoz9u2MbCDV0jJ1RqSSD1+klBLpNEfA\nCZuc7I86Nhf4ZfEdewUS/hIf/n8FzldEecW6BjsDtrjc7gg+zSfvT8l9WVz+\ntiKUX3HM8Tkjc3Io3o5DU/G8SKU92/0Q8fjLZxHodUpLW1xwhmbAY1vjagnn\nGm2eBfgqs/jYsGYCcbuwZ/P0RJDdIwVlkNiUfewgP0LsfNqDKAJkRhei0b2K\n5FlRPp7ReiJvgRKgtwtn8Et92UJOzJAd41Uek9IRMQ3gJAZecUTuIWpBrn4m\nmoC1MZTvxSPPqj2tkpSW2muKBUfzIr9gj2T401yYWWJ6gOJinllIngTT40wj\n08zWXuF4T2Jtkwm8jci+2yMKUFYBbo6YK2h3kjogom3tuPka4J0o8c93tR94\n/hDj\r\n=mtpJ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"56422959574aba25d1461d4e7ebd168437ebf9a5","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.20.1","dependencies":{"tslib":"^1.9.3","@material/dom":"7.0.0-canary.8135cc085.0","@material/rtl":"7.0.0-canary.8135cc085.0","@material/base":"7.0.0-canary.8135cc085.0","@material/theme":"7.0.0-canary.8135cc085.0","@material/animation":"7.0.0-canary.8135cc085.0","@material/typography":"7.0.0-canary.8135cc085.0","@material/feature-targeting":"7.0.0-canary.8135cc085.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_7.0.0-canary.8135cc085.0_1588794935083_0.10160599661410186","host":"s3://npm-registry-packages"}},"7.0.0-canary.deb212de4.0":{"name":"@material/slider","version":"7.0.0-canary.deb212de4.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@7.0.0-canary.deb212de4.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"c29f6d1c8dcd499291328500638a88114285d78f","tarball":"https://registry.npmjs.org/@material/slider/-/slider-7.0.0-canary.deb212de4.0.tgz","fileCount":36,"integrity":"sha512-GgjICmd4djjufqKMXfAWSBHOPVuQcyZ+574Bp2ZIW4eta1I2hORpPsxZ5NKZyU2GLHCi7Qzdr/i/F5rjTG0LqQ==","signatures":[{"sig":"MEUCIQDPIjERv4eypM8yBpCSgJrMdcGczRNurbNnEcxwfH9Z7AIgQMxk2jVsmFpuAYYrbOMVz/9bMb9p/TpLMKQQLQt6uAw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":374191,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeszfgCRA9TVsSAnZWagAAClcQAJeMwYcMGXtO5BkV58Oi\n0N7I8CC8heB3oTxLbkV50XQ31h/GEe2InfAl8hPH1miHcM5/rPzU9Tpd5nMv\nYDZu6DaPkhg1PflhOWuoXusxQ/pGZSYjobaNv0LicupU4PxMNpVufL9o5nE4\nabD6LaUyrZWrR4PiL4YAU3QyTTuGBjdmZ+ZRQBNZbx7Z1LqztHgW5mojdfSN\nuH7Zeln0UQnGtWPx9uIMR8QjPqz4IDGSAF2mQ4IUjKTXnFXbTkrGN6gUrKYt\n/moB2oeTt0BJk3fJi7/p+4POduQPU+iTS2dAdNIjCNT61x/dT8zuvuBJB4Ii\nWVhmNdZ2Q++/EpG6K39F8yT2CqB650DP4Ezik3QOgZv/A+/ti+YCopeiB4iH\nm+YG14erzQbQGmhHunFRrs0lD+cElgtQL93JGbcD2Bk7ArhyLCRQ+ZuXYEYR\n7/poZS/tV6UyGYSNA/n1T0QFwmjgysVedfEtRLJoonMiSpH8SkyNOwodmhwx\n7Nn5z5DDovJAgH5oVx4UQLeB14pVQMh2uFzxF5riQQwGANdis2H1DrBfmI06\nDGjBAImv15orOUJB/rLxfOKdWqQ7O9HSXqGYAhf2rcPdF6R+63X70vVIdw1f\n0FkzRAzruT/HX1IYNg0/+ysajqFB6e5YbU282Vb+QFRio3LO68oZiwVHDoxF\n+q12\r\n=LumC\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"fe9c146f82589e5f1c471dbb4986ed6b3a7caf54","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.20.1","dependencies":{"tslib":"^1.9.3","@material/dom":"7.0.0-canary.deb212de4.0","@material/rtl":"7.0.0-canary.deb212de4.0","@material/base":"7.0.0-canary.deb212de4.0","@material/theme":"7.0.0-canary.deb212de4.0","@material/animation":"7.0.0-canary.deb212de4.0","@material/typography":"7.0.0-canary.deb212de4.0","@material/feature-targeting":"7.0.0-canary.deb212de4.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_7.0.0-canary.deb212de4.0_1588803552063_0.5074302921706249","host":"s3://npm-registry-packages"}},"7.0.0-canary.f83e00898.0":{"name":"@material/slider","version":"7.0.0-canary.f83e00898.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@7.0.0-canary.f83e00898.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"09f18bdc5ffde444b8b4930b19db7cdec95151f0","tarball":"https://registry.npmjs.org/@material/slider/-/slider-7.0.0-canary.f83e00898.0.tgz","fileCount":36,"integrity":"sha512-s8aBS31qUr0YkQgf1x4RNNUs2MXkDf54OxmRJkVRu2ziVE2tAMd8GCT0Ddvq5F24WSgZxdRbp39Kz3MhI65UVA==","signatures":[{"sig":"MEUCIQD8RaVc843Onk/ywrfZ2z5aG6xIcptgdhblly3/597wlwIgXeMgY5SyrSvIch3AtjvnctYB+v9tKihpuhVWC28BCEY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":374191,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJetDw0CRA9TVsSAnZWagAAsC0P+wYILm9eoX+5/ZDzkHpG\ndYSICIMWx7DMmaDgAWC6tLqofTiu64lk/arHEY5peHx051kZNSq7qGl37ED3\nEzWtX2SIVQW7flEfU0/DhTmHuR9CMQDDZaNyR2AK6OegSKN47OgjZPoP2t+Q\nD9dgk7YFY+Uq7tr8XeQReDcw/K8kRGm8KeVlFUjAnbuIYu1UMJTTewmHUqv0\n0kL5CF2FFVuHo3Mh2a70zDiTUjCj1B6tth+cimmzg4BlR1IItkc/kLqv9kl0\nbf56TF1g70vSpKJwdf1dUxLZdvIXFQrJNcqJo6JvmG9REJ4D/dISD4seazDc\nLQuy3GGODLwt/ngIURSZFOdxKcHmW2jtaDP6LlHdlKQeRmtrZDmAeMZH7a1b\nezRbxW1B0fFX+GLJnHa63onFvYFX2JeUJ2eHoQemlOZztSPDiNeFvPYELank\nbM3OUZoKsxRncG3V0V3RohQ4o6+pguZ8OIkNFew7mb2r/Bn7p6lmRIFLhBC7\nr0bOMrsJzxyhnihZJZDUHcHqHZxI6uvxxNIofek38gJCczMf23dzu1W2IIKA\nC9zChxQCbcV157LcQ9sz3SOixQK8mtmSXfEjzkNGRoPPqcdnbQ0TfaNqLEvX\n4pa6CaqSHt8FsaLIjyN5mZ/+5Evchdr/brGae81rMjKZ9VuaKorovihhH6sq\nBUog\r\n=PbGp\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"02060afc2f5dcb762e9083970f865f1c714a38f3","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.20.1","dependencies":{"tslib":"^1.9.3","@material/dom":"7.0.0-canary.f83e00898.0","@material/rtl":"7.0.0-canary.f83e00898.0","@material/base":"7.0.0-canary.f83e00898.0","@material/theme":"7.0.0-canary.f83e00898.0","@material/animation":"7.0.0-canary.f83e00898.0","@material/typography":"7.0.0-canary.f83e00898.0","@material/feature-targeting":"7.0.0-canary.f83e00898.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_7.0.0-canary.f83e00898.0_1588870196096_0.22743138541206798","host":"s3://npm-registry-packages"}},"7.0.0-canary.047e6b337.0":{"name":"@material/slider","version":"7.0.0-canary.047e6b337.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@7.0.0-canary.047e6b337.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"ae86adffc03361b9ee951b97d1592b1114d41a68","tarball":"https://registry.npmjs.org/@material/slider/-/slider-7.0.0-canary.047e6b337.0.tgz","fileCount":36,"integrity":"sha512-CpcfNbjnQTUZqgVdgnOgh0BaPX9sjgi2SHcbBzjLHPIIDuKB+6r3YlD3e8aG0GUIduR5QhNTYSIkb5hulgxHvA==","signatures":[{"sig":"MEQCIGO3nO9qguMBDu7LsQC9WIyKta7d5s+fuOD7H4aGkh2NAiAmsghlxe7c/Lsy1PzGxvQvzwONpTIZAuvZjn1AmnLOxw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":374191,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJetac/CRA9TVsSAnZWagAAtiYP/i1HbFGKa2TuuKKCE0EC\n5e4NZRjVPs8RAEFrgChV1ndRfMe97WElIk1V/aFG+Pqc5F0ATm0ZV+TKrHch\nOscwbJnFzmpXuo/U9fQMTHOItQ1OA7ce8zkGpYBXp3pCxCIpqDyrANY32+qJ\n7risN7ABWpP9BtDGKV6bhE+RcJRD9XjRbzAHFhUU0K5qsyfzuHM1SPriAId+\n6skUN7KdIIFAqZkbarpK9iFq7b1mXeV4djDWqyIY9rWCTYKWQd27Re/Kxu7H\nMo/aiW93gdMsETqm4HOk4kx/Izb6bmQNWD/yCaKjY6QoeMAx2Qu71QEZuWHy\nXPfZAXoI1GrLR+HNUCU31c2Adww2j4TqARGBhhUT+ve/Pjx/WFmvca9RDGli\n6z1wHD8iGRBp51eP5SoNSirHExRO+kMj6FQ+Yrl0cBcBb0U4aWEQj5khHk8j\n+gxJ2RdkxYGdxwsxD/gmCmUwpbsuIHeKR47SFqEtVqIiAGre40FC/1JFzgD3\n8GDhPkKSQ+59f5B6xE4iaKIKcO4y761KoF+7ac2xtNk8zfEq2iW/li/A20Hb\nxRVUTVAI2o2lNA1gxnby4M1bnaHBHv/bUd6m3GT0TUc524qzQbRa4y6hi813\nrSY3fiO2K7+Q8m3DhfsQDXyFxLgycFErqeCduNzuKXSUG7axSyqEGbBgEfFT\nD9fx\r\n=pPBs\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"2be3b5993e14d0bddf55fdb157837e5593ca217a","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.20.1","dependencies":{"tslib":"^1.9.3","@material/dom":"7.0.0-canary.047e6b337.0","@material/rtl":"7.0.0-canary.047e6b337.0","@material/base":"7.0.0-canary.047e6b337.0","@material/theme":"7.0.0-canary.047e6b337.0","@material/animation":"7.0.0-canary.047e6b337.0","@material/typography":"7.0.0-canary.047e6b337.0","@material/feature-targeting":"7.0.0-canary.047e6b337.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_7.0.0-canary.047e6b337.0_1588963135295_0.5055258351886946","host":"s3://npm-registry-packages"}},"7.0.0-canary.119e21426.0":{"name":"@material/slider","version":"7.0.0-canary.119e21426.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@7.0.0-canary.119e21426.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"d0e20f054988c707c76730f4a2fd7cd30df91238","tarball":"https://registry.npmjs.org/@material/slider/-/slider-7.0.0-canary.119e21426.0.tgz","fileCount":36,"integrity":"sha512-xIrg3MQWU5Fx0rYL+k8duDkZ+a0rBXpC1tHEz2z/Mu6Izk0HiGmlXcbb0hYHVoPGxDvoPZuXGI1N8QCPP1lCPQ==","signatures":[{"sig":"MEUCIQCed7iVCQTYKbi5/7nSPwxd9aHoPIDVQszQXnRZL+czFwIga/NPAgu/HqSd4FVffEkmmDJilTuh4TOevYs8jGMMRuQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":374191,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJetb+JCRA9TVsSAnZWagAA6ZQP/3uU2EL1VByU0YDFeVUJ\nSlUuuX0oRwZKkK6kiE/ltZVpDgni6MXc83J4QStw2Uc8ErJg1c6D8AcZbrV1\nEYHJWNPMzybpoPGMknb+hMm213wII+rnYpWoDI3L5vRWZSLi9LaAZAGkCqso\nNwkL7RNDijX7eWIgxXBOIjlXd6Sw2QYKSJXycja1e5uui6fADUSyr8HHOrDi\nExw8zdIVp8u7fzZCYcE7Gs3d5ah1LUPPjOia34hHXCLxHctgyBR6DDrK2UZ4\nlwkrF+ju3BPxCwgHq4Za4sV/ISU5aXgtqKHKvHHg/Q5xOoS31VDQm1P7NepJ\nV8ZEyt7Ea6YAfTK031OUNaxlyQlEYs8EgNjJOCEn6Nmok8h7P3cO5AZX1ccQ\n/OFx+dengiG8bhPIF0ISvZnfUMQ4EK8ElKxgfDuOyj1MBBRoC5zJEPaOpYYG\nFX7Uo2t5Q3Taqjjg5XkhAC1b4uoHvDv7++tV4pvE6EZ6Hzien1zIR8H6L8Rw\n3h54O1sAOGlUjZQmT/wl003cApHTLoeLLMQmeOVlJDKxUOUxcYPS0KgOjAlM\nj1mSeh9jJalxzoQoRKYiojW05aeU0FhVcLfirNBiKJRtQdbX5fZHKELQlQpf\nNLrk2djyXsvQM+wShpfn48m80UKphkR0j3Ms7yVvQbwyXGCjiNIWSQKBtYEs\n74fU\r\n=ZmZ6\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"693ba4159b1a25af6955ffb1ce0555d7a989aba9","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.20.1","dependencies":{"tslib":"^1.9.3","@material/dom":"7.0.0-canary.119e21426.0","@material/rtl":"7.0.0-canary.119e21426.0","@material/base":"7.0.0-canary.119e21426.0","@material/theme":"7.0.0-canary.119e21426.0","@material/animation":"7.0.0-canary.119e21426.0","@material/typography":"7.0.0-canary.119e21426.0","@material/feature-targeting":"7.0.0-canary.119e21426.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_7.0.0-canary.119e21426.0_1588969352794_0.723234753600769","host":"s3://npm-registry-packages"}},"7.0.0-canary.2f052d824.0":{"name":"@material/slider","version":"7.0.0-canary.2f052d824.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@7.0.0-canary.2f052d824.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"c28853b5164d4366bbf3610b3bc2ba55ca027568","tarball":"https://registry.npmjs.org/@material/slider/-/slider-7.0.0-canary.2f052d824.0.tgz","fileCount":36,"integrity":"sha512-o7xc8v29S4uJ19JKQiQ+FO25/xJQxTZaaTnIjfF+1FNJ50dqzzadNNnjP9nPTUklgu2p5sJpEfJL1BzFyQeweQ==","signatures":[{"sig":"MEUCIQDC6wZgr5c6I71R0bV5QTE1ypDrMtogs0Y4VbTUPhmMHwIgB6dlzUzp2Djew0X1sX3MuxyioG20xlEX9P9c6nwv6dw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":374191,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJetcosCRA9TVsSAnZWagAACk8P/0MmWYMVNHKdlOaNqFqg\nsxZGEXHahaYzVFK352SUhdMNIwpQzFbrH08d8Sifpriotz+vSYLMUGjV82nV\n9lPa6nmCPCMb8xdnyxNLSTtLWLHjz8wr/E0ZnwOCajfQxL5fdVDvRpBfOnb3\nJ+bWLQaxQKu5u0tWh6ycxT4uCdOWb3ImQx9v+NQ1leifVuWBKz+Ztzxty7LC\nF0yjU1rBqWm/IFaDsBLJza0mAvynRcOzgkRsa/DWKbFInvEEiwhuySds6AUE\n9+W5G6K3Jj2VCxiph4WAjQ6zZPvdGzMvt2ah/3R4EqEyaU/TVp8twaL7aX4T\nD4dC4uQjF9najEWCmkahgAvZotuv/vUxh7UslXJdWi2yF2RjohdC8YHVRUdK\nqTh//sW/TCa/YO5XR8+000b89+ioRs/H6NFuXHLqWDne3A+tO4eXBu/mGE2/\nv15GD5ra259o8N7Tt3N4v3Vs46dSARvquF9N3f+tJA/adkyT6VynahqNuPvS\nlVOuwjqz2abkCID72+4jqYb3tMOnzETdMFGxI+L5KVsKNfs4SIXitjauhguM\ncPOlnUKea0dPQhVMmdyiU0HrfArh8yog93NfvU+gguHup1Fpho0NrPqyPnxA\nVmRk6f0fvOFDbFR7W6TkETOot/2cSpN2Dx6wVb6hYnSgdeOruZ5M+TDsHqfm\nVsQT\r\n=tEx2\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"e3bfb78e98db35607ba75f333490d9693f14e844","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.20.1","dependencies":{"tslib":"^1.9.3","@material/dom":"7.0.0-canary.2f052d824.0","@material/rtl":"7.0.0-canary.2f052d824.0","@material/base":"7.0.0-canary.2f052d824.0","@material/theme":"7.0.0-canary.2f052d824.0","@material/animation":"7.0.0-canary.2f052d824.0","@material/typography":"7.0.0-canary.2f052d824.0","@material/feature-targeting":"7.0.0-canary.2f052d824.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_7.0.0-canary.2f052d824.0_1588972076331_0.3727278889605119","host":"s3://npm-registry-packages"}},"7.0.0-canary.e84444387.0":{"name":"@material/slider","version":"7.0.0-canary.e84444387.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@7.0.0-canary.e84444387.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"1fdeabd52bdb993b26dccd72c1e6f6caf856eadf","tarball":"https://registry.npmjs.org/@material/slider/-/slider-7.0.0-canary.e84444387.0.tgz","fileCount":36,"integrity":"sha512-Bdgcmc9r+qWB5J2DLaVqFp7oIYFa9Y1CA0Jzm/ltMOw8L1r3C/cYWJURvXEeJdF2qYDy7feCddHDhfPKsk5Wlg==","signatures":[{"sig":"MEQCIGH2TI/kPGsXMDeq8+OXj5aoYmvNcnju9okL1p88TzbgAiBDVTIWMh+qAhRhiGQZXO99UeCGBdvOeAqurRCxHfKsyA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":376955,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJetc/TCRA9TVsSAnZWagAAy1wP/jB4dcGKKwvqOg7mMoEJ\nXQ+pu+i4zMw/w1OzC9mi0CEczMl8v+NjZXxh4wGyCH6UKWT9sk9aUo39bmKY\nDxFd6xSYrwg7SR0keNMdH/NYV62hKWUnLXQrUkNUM8aS6CoKJbgrkwDEANAu\nqNmHPKcwwrJEwy6GcoV0H4DlHoVCRUYbgwoTYfH3v1nzLW4nBai18xfJq95u\nN1Yx/GR3SQXyzo8WyyYp5sBNt1FRQenK4qKvtV6ANzxf4kUpAX6ChcdB04gV\nMkJnQFoYIvFGoaCjipLTJ/oKou3QuCMxNFnuw5bvTE0YJSi6V5hIsiJcy6GP\nfNtAQ2lFos1HgKnasPtslhFDVIyX14X7YK6W8rLJY1rMUEcn+GGKyB7/xFEC\nuwZM1qkmO1erKqUnXKG5qEW8sRHUdiLqAlRo79KvCEize3pYgGFHuiK599in\nAgRwqlx92jZyETCZtejHM8WxUn9JpIm4+XfcmZfxyQlvLvNtzg0E6Tp1n/V8\nfLOYhPb8vos2ZgG45xaEyKn6f0Py5fMRv9rI53a8iGWQiNscQhxLcAiQ5Kl2\nEa89As/lpImCaUkV0rdXi3I2dfVABc6kya1yPtIIuWwqyGwImIbq/kOEdE9G\nOtUPDvrZXqMJQyAktcC2eMNPWryCTytiSqFWGHEKaflxwkOtB6wbFK70zKhH\nJ6D9\r\n=4/bZ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"35f59683bcff8d7b2e79ea4f582488d0d86b0b97","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.20.1","dependencies":{"tslib":"^1.9.3","@material/dom":"7.0.0-canary.e84444387.0","@material/rtl":"7.0.0-canary.e84444387.0","@material/base":"7.0.0-canary.e84444387.0","@material/theme":"7.0.0-canary.e84444387.0","@material/animation":"7.0.0-canary.e84444387.0","@material/typography":"7.0.0-canary.e84444387.0","@material/feature-targeting":"7.0.0-canary.e84444387.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_7.0.0-canary.e84444387.0_1588973522956_0.6285209651854429","host":"s3://npm-registry-packages"}},"7.0.0-canary.893eb1876.0":{"name":"@material/slider","version":"7.0.0-canary.893eb1876.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@7.0.0-canary.893eb1876.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"f78bf3118aa49d57a0c9b0fec3878aad12a95e46","tarball":"https://registry.npmjs.org/@material/slider/-/slider-7.0.0-canary.893eb1876.0.tgz","fileCount":36,"integrity":"sha512-WM+zPtz6X3C6rNZG4lA74Z0hTOLQbkSJdrI7E3P2wbExoggHpXDQi3hq+WEz7Yk8R+pAc3Hv508vGBbWDnRQ2w==","signatures":[{"sig":"MEUCIQC+/j1O0C2lSiYHECuDe4B4iGVX4/QQNKdzptKs7f8DDwIgFbvKcDF57V9sKLdz0S83Xfp7+MMMKvgcD89JKVEStkM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":376955,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeuV2XCRA9TVsSAnZWagAA3pAQAKFVrIgzY/gxFyUJy8+9\nGrJTQKdaYIKjaE5qW1GbEIOtEiIeQx8S4+cyPmkj3pDwb70AejDNWw6g7G0v\nkiTXICY5x24F0wQpq79AxX4dHVHgi0eASn+20oXwM9gxIcPJ9Y6TbOY3P3lk\njA+Z16RK4WBUJKsiQ9TCzqQ5TVG9Yz75jBgKwmzU9ad7k5HCt7G6Y/GiBRFJ\nN9OTR0F0LsNI6q1hqOZbcdnpQtd2uC8GUyd0s+yediILfsY6d3D+ngPET1pT\nK/Sy4xwgCrXkgx0BBmq67ThFZMOEs0W25cAV9MUzP8gdkResH5+G8XLdE+0m\nXhQSYHdJWp63YnHrYmzWNxCPdfKXYUyA/ATSlz49fpPqgpU/VTv+uRgNf2P2\nbZL/EXaTTLd52rHj1CKAG6lov+lWBL53FU3MfWOJWdnbq3OC8umn/0hcLQuE\nvEoJ53tWoLtG89YxL52lhTNsRn5iKcE3pmJo2T6PqLGo7+ADhOXWWQQsnltn\nn5Xz4p9LyUbZ5Kz2hJLcwIP5J7qKoRmRyy0liYX7tOb7XEsR14a44fIsIi5z\n8YkH2cV+gdsxSZQo2uSYP5eA+lHQaaf8zky0qUPsaGnD07Hk5RWDYJ6LeOGp\n2BMNHh11LKusphGvZPk0FBxdLtZQSA29X08bdm7n8LV2U+SQCp4Tl47qzLgq\nz/ap\r\n=oeEQ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"4bf9fb733753ef4cba5683a95a2f2a71a743a68e","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.20.1","dependencies":{"tslib":"^1.9.3","@material/dom":"7.0.0-canary.893eb1876.0","@material/rtl":"7.0.0-canary.893eb1876.0","@material/base":"7.0.0-canary.893eb1876.0","@material/theme":"7.0.0-canary.893eb1876.0","@material/animation":"7.0.0-canary.893eb1876.0","@material/typography":"7.0.0-canary.893eb1876.0","@material/feature-targeting":"7.0.0-canary.893eb1876.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_7.0.0-canary.893eb1876.0_1589206423561_0.49684809605355973","host":"s3://npm-registry-packages"}},"7.0.0-canary.a5aeb3001.0":{"name":"@material/slider","version":"7.0.0-canary.a5aeb3001.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@7.0.0-canary.a5aeb3001.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"d06cda741d05d82d9ebe55331a113f2e6623d2dd","tarball":"https://registry.npmjs.org/@material/slider/-/slider-7.0.0-canary.a5aeb3001.0.tgz","fileCount":36,"integrity":"sha512-Hx1IqwZ2lSzFsWeg6ULOYGHy2WJoxqfVCSp3k4tvHff1XTtELJoHTybL9xpuHVXTcb8Flw4cDG1cEmXa+e/ZWg==","signatures":[{"sig":"MEYCIQCMv5DdkMkY7doZa89Wc3D0kQpKltu38FyMHRCSloyeAgIhAOfGd5jJFkZ/TaaTlX2QNLxfzRXDOXCJs/ELjv7Al5Kv","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":376955,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeuWFcCRA9TVsSAnZWagAAf88P/0tC7dFRLv7WY7sclQIx\n9sjFfHxrrFFhcRB9YEsxFJb5zABdmhfpdiJvAod0Vexmc8uiUNLbo7Y+bOaB\njfvuX5+WgBk6Uwf7xG8OTPSGTOGwEJDQBfX4pxQOVQdH5ng+D0K5Lr6F3I2P\nFeelrvGbBuM8wH5N0mlT4jCFyOVFeBlqauqpKoC+DyRRg736padzOSxqkIw6\nhhamRJS77Q/a/nv1tUDspzAyESLi/19ykOQ3eukPqOmkapOMVcXCHmy00VQC\n2IDtFacrzkz9VL4tMkCoLDf4X8+kfPbD+DuFohrRwcXc5NnJ99fZvAj7N3qA\newUFDOaAgpQDWznNh3S4DNFTvQ3fx8F2p5rexB5Ny2hjxBYZL7hxKi5xrtQJ\n5tgLFkUiFr4yh1iVZXrgQ1p1shfEEvNh/hZbvZ6dkWGAySgWfujS7o155k91\nuj/cHwluVBsPNgEGoid61GQ3cdtILTyRlxHn+D9MfSDiVW3QpTUz2deEeyiQ\nsf1SgCqw7nPIMFMa5ka1TFg5EX7MIAckOygJFDDZK3MdTHL6/H1KcAS9t4Wt\n8KUNj1/EkIEcP2aEg46t0D8UtieIdiB/5jvJpw+FUVWs/RKN0RmxqQNXPus3\n/uyQESeWJXAg6W2/T3NvrXez1TXiES7Z30V16XVd4+rkVXaU2zx2QgJ0Bl21\n+qUj\r\n=M/Zy\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"01ce640dffe32b7838dec108ffb4d0c40d3e7bc1","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.20.1","dependencies":{"tslib":"^1.9.3","@material/dom":"7.0.0-canary.a5aeb3001.0","@material/rtl":"7.0.0-canary.a5aeb3001.0","@material/base":"7.0.0-canary.a5aeb3001.0","@material/theme":"7.0.0-canary.a5aeb3001.0","@material/animation":"7.0.0-canary.a5aeb3001.0","@material/typography":"7.0.0-canary.a5aeb3001.0","@material/feature-targeting":"7.0.0-canary.a5aeb3001.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_7.0.0-canary.a5aeb3001.0_1589207387656_0.11600910504273765","host":"s3://npm-registry-packages"}},"7.0.0-canary.610c68d97.0":{"name":"@material/slider","version":"7.0.0-canary.610c68d97.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@7.0.0-canary.610c68d97.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"fa29bc4d9c4b50857080dce77198c36e00fcbeff","tarball":"https://registry.npmjs.org/@material/slider/-/slider-7.0.0-canary.610c68d97.0.tgz","fileCount":36,"integrity":"sha512-HuPXwO5wRCV5IupkT/Qq5wnWUi7G4HdkImBAIq5L9aL6RyASV3BnXc9g7w5H/CCsE7ulGI2bXxu3QrkjOEsfhQ==","signatures":[{"sig":"MEUCIFkeu+x6GlqAiYM8//3Sl0zP1fMPEUW2eKsxoOzfDhE8AiEA0z50gxfsAMph0vUcmi6WZ/l/LgLLD0NXosQ4Ipdr5c0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":376955,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeuahxCRA9TVsSAnZWagAAnVMP/1YdslplUihiYMJWazBS\nXK2pKr9lYLUB/C33VxzMyoeQ8Rz0TV4sDWUAA3nobbZoViLXLDJWyNlr3pqj\n+7xYGtuDnTQzbFLvFlFyZFrm1WgQbjkZ/dagyyFORXSJLdev5T3OJYl98ftK\naZPyjAFK6r9oHTXNQ4OYLBZqls9wVvgmizuLp4ry3dzEwjJYU7uzFRBdlIxc\nSRVYdQo2pmYRmC3VsOzJdu9NrESMfbvBhdlRGRWDslyodRc56j0RqHbmJ8Ad\nacnephSu20pZwt2Q9p6raeqWjH66yVLU6jpae9IM9fho8+2JszQRKrfQqJso\n2pWjIi9xSkGa7E4UPcpCee+8jIv88G3b46oKmLWZfaPVQ3M9h4gDGpWkaV/0\n4qtVsU8X0gmkq0Oba/pts2+Fvi+vv1Hr9jSso1dD/nlzMtrbX+FBFsgX4nJE\njKTVRIXn78YE7zlL9K1jeUO9VQ4q6mUClLU7+2RBOUSo6pa9Qr/gR3Yl87sA\neuDYLD8fTAHCL8AlVEKhIbQN6XEtEUlWt0kH8Bjf4nzHPUuGqoYu1+HE/X8D\n6tI6fovlvW6SGv7dn94nTJjQ7DzsZ7Dcxpz1zUkHfYR9ISPjjuIqcjgWJii9\nkZj5BVevVFWruqX0vOa4kE9ICzxageAlH0DZiNd1yWDa2T1K5n4sRfJx/DR4\nNl+P\r\n=JREM\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"ac4b0339093446110cc551732ef34ba30b4f4a49","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.20.1","dependencies":{"tslib":"^1.9.3","@material/dom":"7.0.0-canary.610c68d97.0","@material/rtl":"7.0.0-canary.610c68d97.0","@material/base":"7.0.0-canary.610c68d97.0","@material/theme":"7.0.0-canary.610c68d97.0","@material/animation":"7.0.0-canary.610c68d97.0","@material/typography":"7.0.0-canary.610c68d97.0","@material/feature-targeting":"7.0.0-canary.610c68d97.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_7.0.0-canary.610c68d97.0_1589225584396_0.20146261814630972","host":"s3://npm-registry-packages"}},"7.0.0-canary.ed52af767.0":{"name":"@material/slider","version":"7.0.0-canary.ed52af767.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@7.0.0-canary.ed52af767.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"557b1ff783fad95f9b713d46dbaa2cc62d8f422b","tarball":"https://registry.npmjs.org/@material/slider/-/slider-7.0.0-canary.ed52af767.0.tgz","fileCount":36,"integrity":"sha512-MeWlgTYl7N6G97TvPlPC9EfP+htbcq54Byk37RrHMMbF5gDAGw7qwigeReusr5mtEKJEU8rSGr94K+PEHd2KuA==","signatures":[{"sig":"MEYCIQCvX+N7CSRE6oqtdYofBtKduWExZqzmxq5Kn6H+rk7NNQIhAJwkicdDmkUu8oEz0tnaMRRxNnT2bZTKtxj5QS9tSEHB","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":376955,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeubVCCRA9TVsSAnZWagAAjQ8P/0Uezuq1vk+Sys0qSobx\n9Tz26WGfcBkBexfpEznLCzVdJzDc4Vioic2vGp/gkpzu/gDWiuHNtCnZS2h/\negN4Q4TMkINWP/ewPuaZi7KlkbpHe9gB/F5dowu2Y8Ko0wGWYPbYddqWLZKd\np8RYaG0bXECFq8GwErzlilhq9UwJR0/4+GaR0nyLJcfKTzoBwrv1a+mQjXhD\nOyUrkmijQqwDWsMhT9bbJ8arawFq4cJ4946yA7ZTwJaujpI+7uM3bk+hBQPW\noyi7W3fgwmN+YeR1u70MuRm2slqrPyLINdk2g0UZMTlNZTqO8c8/ILdjuY1J\nqigZ0TNYdzvQJev+ZjWIXVWKnAAG7R0F4l8jSFCUfTjkpWTSH8gGUq5HxCnm\nBke3gTaelxPV9Jf3/iYmHAcdIEwGGX3wLVI2lnITuhleXEf2P2VC9UAyPrdE\nqO8t9QSh8iRLq+P/nt8XwOgufANkDSbrw3hVJN3DVaia4Zx+b0IzLF9KTX7V\nA5v90q6vtCOGvdEJXA+8MaNJtl/BEZnis4Pcm/4n/IR20qdzwKObizWY9aXW\nmZeWCn+IpJfnJ2e+6fcKn2aWuXpSsR7owas6hDi+or3qVMjkT+W5t6S5dq5t\nlU1QdKcbRtTlt5+kcpZocxogSAUSjivyN+83p//Jc26aPOMMBskbnYNnJQgP\njVaT\r\n=0BUB\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"06b24ff740d1a29e8764ec98f735b6fef77dc5dc","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.20.1","dependencies":{"tslib":"^1.9.3","@material/dom":"7.0.0-canary.ed52af767.0","@material/rtl":"7.0.0-canary.ed52af767.0","@material/base":"7.0.0-canary.ed52af767.0","@material/theme":"7.0.0-canary.ed52af767.0","@material/animation":"7.0.0-canary.ed52af767.0","@material/typography":"7.0.0-canary.ed52af767.0","@material/feature-targeting":"7.0.0-canary.ed52af767.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_7.0.0-canary.ed52af767.0_1589228865707_0.19852354999808686","host":"s3://npm-registry-packages"}},"7.0.0-canary.058cfd23c.0":{"name":"@material/slider","version":"7.0.0-canary.058cfd23c.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@7.0.0-canary.058cfd23c.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"e0db8d086a6c5d12c37a5212157edc9a315fb4a3","tarball":"https://registry.npmjs.org/@material/slider/-/slider-7.0.0-canary.058cfd23c.0.tgz","fileCount":36,"integrity":"sha512-bvSmznOWzO87xiruUsLTu+LhjY7q3GlKZOLiotav7oFGq0lyChyngo+jmrOz20l/3IO2SZTacpfFO6ay2NRINg==","signatures":[{"sig":"MEUCIQDjljNn13zCrES8XXYxeLvHLtCD4j8X24y+k9zmdFOKRAIgERCc2Y7QJjjcDiLRVdRmtZ2vsLPscGylxJB32smZFYA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":376955,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeucLQCRA9TVsSAnZWagAAMh8P/1DmB/ZmnKwrzsH5jyYL\n1FCpmMRyDKAjZauoPdoPe5V+fIGz2JfwxKoMRv2FZMqidbXjmTED58FxuF8z\nLGzoOjpU7qEJVCvF27DdzJBAmrkRuFLNyl9DONeutJNfw5BJGJMQmGJi/giY\nkZJbU7rLOjJWOTn/s+WvCvDobmdWzpTD/NJ7CRZhNtzIefmY9Zfn94tuAbI1\n5AiGyFONu2C0IeXW0PoE2VtZYAXZp8vfrLvX9/QkqKsjYKbX5eLi0ZfbkpxC\nW+GQZvVCS/Xo/6DC5ieoLsat4iqsYFd8ajVvuvn/M+P8OJDSpv+p6VS/S4yB\nJw6Z0QuYa9sZqUXNhLkr8fi8StFSiwoT/G/J6ANrYqEmSQ1gXYZ4+8tI2NBU\nVwWinI+6skFjdBIO4hdWMXnviUKdwR55WRo3Cew/ji4zOxQefffswxodfB+Z\nnzmma836ve6XZ4EToNvk5WsiGNLmbOpWajrl0CopjAdMqINxA2Eb3aeMvmaD\np5+r+PVs70LpQ0Pb89juSNGuk+UkEUratfu/b88vZnmq2ZSCWUsdydB70VB5\ngEXBYy2SUrGaCg8wvUn7lukifB/xSug0oC+VDMjo1aRr8EN6kc5N43i+1uVe\nKF6aUoIe3TFUHv8h0vifkUVs3OXT+kEfAhsJiqHB7zAZttDu/YGJNtfK8WaE\nwVbN\r\n=Q3Hy\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"e012af26b00c720a751210639bef8379d1085234","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.20.1","dependencies":{"tslib":"^1.9.3","@material/dom":"7.0.0-canary.058cfd23c.0","@material/rtl":"7.0.0-canary.058cfd23c.0","@material/base":"7.0.0-canary.058cfd23c.0","@material/theme":"7.0.0-canary.058cfd23c.0","@material/animation":"7.0.0-canary.058cfd23c.0","@material/typography":"7.0.0-canary.058cfd23c.0","@material/feature-targeting":"7.0.0-canary.058cfd23c.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_7.0.0-canary.058cfd23c.0_1589232336091_0.061729855944265166","host":"s3://npm-registry-packages"}},"7.0.0-canary.0a371b4fe.0":{"name":"@material/slider","version":"7.0.0-canary.0a371b4fe.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@7.0.0-canary.0a371b4fe.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"f3c83ba8a5cd4429cfb03d5b67336bfd64926abb","tarball":"https://registry.npmjs.org/@material/slider/-/slider-7.0.0-canary.0a371b4fe.0.tgz","fileCount":36,"integrity":"sha512-MbEDaZa0ecaDOKjkgxzcodiOQQCsJXIKrGTeCAVD1pgBx2JWTr3hsnW4xbCUjzhvYR2tnipu7D0LXPQ0HEdVyA==","signatures":[{"sig":"MEYCIQCeql8NxkkNS7xieQ3CZzmHFGK+WnBTxzw6CIF0HPChQgIhAL3mYC5TDHhOBLlBFQCzGlIW6u9JDqdoyILUBce/r2Cu","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":376955,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeuy7VCRA9TVsSAnZWagAA1o8P/0w8Pt5D3WWWDerbXY22\nmQfay/hVBtGIkgmQAXCdhzAsoLdJh9LnDAjbDuX3IkA++HuCBQjXOwcb/tgH\nCW6knvJKqCNO/O6i3zfsnDOnawOfW+G83GeCWVtWGwEj/qSuff2P50wkb/+6\neOWwBRpSZDLxPKT9bDyHUiRoyRRjWoU3oduCiIVlrb4pztXZB4/w4M3bUuiG\n35Zdwk+SDMhaEDbhsJfdNYs9t6BpHFlj5szg+GYOkYImnx10gVybsjKv2gLD\nJcIgInlua+pCu9c5CoUSZO+7FrDHtNVKk+l0LQyRLtZLqOx4cDOnMz6qTSOP\n7LFscxTCaOwiKXzk5pQq+ywzd5gw5I+mMpSBvljQzO1ibQZSFXmfiFhJHdxL\nI90DHFwfD3Nli2XX2EDtdtxoNWMSDRxE+1J0It6HfmkqlGfzDLZhbmgpT0kq\nqBEV4Tl1Msj5BvGSoaSOhVJoSUOvsK4bB7LWOXhO8TMHo3YwHrq2YKNxOd6f\nPFrxREX2OHDNRmdPM9iLK502P6+X6qT5iPjiqxPFKLnyr4X7cqnBQn4BAAOQ\nHUKGFZExZE///7t9qLASMSfQHSK/PcQh/SedaHZUnZOk9IcCWGziwUmwlQKi\nx16tEyZmXNqefLC7ZpZHmB9kS6cHuoWHzsXRAxIJafFucmWK/uUR4Zn6dDsJ\nOPGW\r\n=IPSU\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"c3c5efa159a3a5dd1da72a8e4e94015fb7984f7b","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.20.1","dependencies":{"tslib":"^1.9.3","@material/dom":"7.0.0-canary.0a371b4fe.0","@material/rtl":"7.0.0-canary.0a371b4fe.0","@material/base":"7.0.0-canary.0a371b4fe.0","@material/theme":"7.0.0-canary.0a371b4fe.0","@material/animation":"7.0.0-canary.0a371b4fe.0","@material/typography":"7.0.0-canary.0a371b4fe.0","@material/feature-targeting":"7.0.0-canary.0a371b4fe.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_7.0.0-canary.0a371b4fe.0_1589325524853_0.08362137952129922","host":"s3://npm-registry-packages"}},"7.0.0-canary.2139200b3.0":{"name":"@material/slider","version":"7.0.0-canary.2139200b3.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@7.0.0-canary.2139200b3.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"38d6552138df0c65a9c4a3298ba9c53391e134b7","tarball":"https://registry.npmjs.org/@material/slider/-/slider-7.0.0-canary.2139200b3.0.tgz","fileCount":36,"integrity":"sha512-bk62dv2aWg9t5Q/pArV+L3sZalEUgVr2k5PNBz9oqRrvl9VvZvq7t8ZlIZDCYXUic1EqRQhAL74mn3IYOkd/Qg==","signatures":[{"sig":"MEUCIB9qeNhc0fLwdbelRmNCRZfGtK24elqU6PlnEoo1Tii/AiEAxOptdK+4bxMxdUxdjrkLvkboHrPBvxmsbYOyjdxJ+iM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":376955,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJevAiZCRA9TVsSAnZWagAAyX4QAJWAT4UtMgkvAHj0fFYI\npd5ON7lAOAkysDUIMjvqvk0ayYn1u72SfMaHqfouMkf4VV2IwKFPXSJFV4cG\nmmfru8GAQk1zbGU9WUtArZ1zfcfK0hazyPEZMOKLDPbTlMRH0oysOpfGk16M\nN8P8Y10kDTSNmADmtn54K5XArIVwC8lqZjCZOsvg82gUAbm86d/eOewGlNJs\naJPqu3B7zfhRelpTzyGJsQMJv/yPny4qkK+K4ummuCDJuwW+PTLDvKkK34iP\npziGXDimq/r1+sCoQtzFBq3Pgi1HGfkwwCIqr86eFJ3J/ccmipwih4bnFWBV\np8dgQ2wfxFKRrw9SLnjaHUjChvwV3bRt7eUMGLalZgtv+ydv+muMNY97H5kS\nzFsfLY6w0NSuHQIg7zgHuJK5ijXgoqxvw3kn9XWNS/UdHAHOPbe+sCA/bTaG\nVqWgzyGDfLo7DK5C3d3Riaf8SYa/XiLexqCEpS0CpyJcYTt7ImzVLqvIp/Cf\ngNyk6ld7m3M62QMIEO/p7izWSOsWI56rMevFpyiGzCiQyqMAls8xTGxcy//h\nmVn0eA3dbSjQRI7R8MGoXJHXY8AenGTq7ggKXsGAd6dB8RDqb3IjcVNJZKfp\nEKO12s5fz573EBWiMcBuIFv277egvwiYHr1ljrKxqC19IFHFEIpa5PCbvSTf\nxW56\r\n=j07T\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"42c214d2b2b544f76002d71be276eb747a69d9d6","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.20.1","dependencies":{"tslib":"^1.9.3","@material/dom":"7.0.0-canary.2139200b3.0","@material/rtl":"7.0.0-canary.2139200b3.0","@material/base":"7.0.0-canary.2139200b3.0","@material/theme":"7.0.0-canary.2139200b3.0","@material/animation":"7.0.0-canary.2139200b3.0","@material/typography":"7.0.0-canary.2139200b3.0","@material/feature-targeting":"7.0.0-canary.2139200b3.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_7.0.0-canary.2139200b3.0_1589381273530_0.8774067983618667","host":"s3://npm-registry-packages"}},"7.0.0-canary.744d751a0.0":{"name":"@material/slider","version":"7.0.0-canary.744d751a0.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@7.0.0-canary.744d751a0.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"1b6fab1f1914b6f773ff2091791240b2203f6132","tarball":"https://registry.npmjs.org/@material/slider/-/slider-7.0.0-canary.744d751a0.0.tgz","fileCount":36,"integrity":"sha512-5u7+Iza4Jic96OQR8DdSjjWyP/XJgpwzqCSQBmxPDUfKWWitHDWUkOUmueeBw5m8uvjJBvq9/okaFkx4cM49XQ==","signatures":[{"sig":"MEYCIQCX5/nseBSpxelAkKJYk7h2CDRedi5okFmUJGvMQk3uXQIhALDG/bb+VwmhkpkZac/VtIGxSpPeE0v0fKqQV44hIetZ","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":376955,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJevMxnCRA9TVsSAnZWagAA+MMQAJg1LWTPtolYck8nASHB\nWPsO7MCghVSjtPG+lI2X+0Ky1cDHRPsvB3eV1z6KjmpVMSKnWOIetHXOdRh2\nyw5zg7fnc4r2KST5Ws1M2tchoJclLMsw65dDt2XpD6842MPzeEtDTroErpsE\nMFYJIVC87El24BGUMbXJVMdO9RUz939VJD/m4nXWF01dHhu5Kwu7vzw1t6IS\ncOnB4K3WBO+KbxPbT0VsEWFEpLqElSLyB7GGWdgoaa4bgbRvkj+ZREL2WvF7\nWFwVmu4AjuiQKLK1v0m9sbQ1h62/eA9NadwC/MAPz+97Zwff+kf+tN/+uBUO\nI+VhomEI+/pWqTUvSH79QgNYmS31YgrRP5nszCZHRRvCs15okMBdgijMtlu9\nr6LQ2++sRqXiinwex8KCWu8KBaYUlhpgKdlIQnaNwgFEJrMZsiN0g/rT7eNX\nvQo+Dni8LG6lT8NuB0po2ioRkUVvU0L3lkbWoU/R+p5FimuQcPPrtWzXmNDs\nIXqNkvQMHo6o2hkP6rBM6+OHd/5wkLA6pXJsITiGGwlO7nAqZjRocEsSNS8L\nKvDNrsJUNKxYa7ReFXBL6PuZdp4Hx/Tla5jSM38FxTeXhPi1zLu/3HF1tzW2\n2oenU5dhLXj28+6D+9/CTj8Gyu7xGeeZhNCBe+Ew0rruUp2eaY4dH99iM2fW\n7/ji\r\n=tlx9\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"afc5bacf5330bcdbe874e652a8d6df5e4a35e7c8","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.20.1","dependencies":{"tslib":"^1.9.3","@material/dom":"7.0.0-canary.744d751a0.0","@material/rtl":"7.0.0-canary.744d751a0.0","@material/base":"7.0.0-canary.744d751a0.0","@material/theme":"7.0.0-canary.744d751a0.0","@material/animation":"7.0.0-canary.744d751a0.0","@material/typography":"7.0.0-canary.744d751a0.0","@material/feature-targeting":"7.0.0-canary.744d751a0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_7.0.0-canary.744d751a0.0_1589431398636_0.13618035609564827","host":"s3://npm-registry-packages"}},"7.0.0-canary.ad0c0c103.0":{"name":"@material/slider","version":"7.0.0-canary.ad0c0c103.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@7.0.0-canary.ad0c0c103.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"219b7820104ca74679ff675cee18dd24c13417a6","tarball":"https://registry.npmjs.org/@material/slider/-/slider-7.0.0-canary.ad0c0c103.0.tgz","fileCount":36,"integrity":"sha512-GiaojXsAHmBlAXv8H+dQqd7TaA/aPR9YbsgF4F5pLnNZSRw4aBEvnQXZg+tJX+BjyNz1l16uLHZrs9ECJz5l2g==","signatures":[{"sig":"MEQCIAVYvMmq7HlgWHoC08v+uxy0wLrni4mtCZmW6/E//x47AiADl9J6luf8n4H+SDfIhQQ8SwqgNEBd4Wdx+2RXkBX8oQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":376955,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJevVsPCRA9TVsSAnZWagAATyYQAIjNdzvV/bw7L2QR7U/R\ncT48+rVm2alirxl83NbbTiq7kzBex2g322Wq7kOw99DnfsnChUpPQP1Lenfi\nO3njxf9hqQX5Xi47A2P+Oo4m3WQWj2GVpfeNwjx1QRO2g3vJA1+NVMh43BTu\nZ4S3+ljsaYJuTVcGKJRQX+HmInID8RcFsIV4yvmEUHmhoqtNTawuFs301jCS\nPJOuQllVWtvrQa1HqzhPwuNBCh/L+NbFxP4ZH/Gzj49p41mmOqlYqnUwljED\nzQtAi7oNJv89vYaLfhzBB35h0Z5YfEmIP6KdEfrv0Cj5eF4yVuqbf0Sui9Eu\nCJAfSL4BZDHomiffm4ek0GWHl0TGERUv+fTOeeTdmITh8TIvfaHkkj2TTr6a\n6QFa4hU1tr4ITZPCdlwOk+SBtX/ZhbmvoKExgoJOUUlZiJYv1S1UN6JQJeMV\n7TMhYKsbDIQNqgzZmOyQvgS832inV0Kc5FEGPTSiyoMcLs+FisT7zAPIZUK/\nuwyC8XamwFfBRmIaZX7rrLhZQU/BNulW5cIuGTcPS8sarTogWVckDoxEOxsi\nqEAPAxJXGiGQTxV1qUsUTuvC+dpBfu5eZ22d7bLzd0rZ6p6dJs5KntlxSjeQ\n7bUEjzsBzFsTnv+JikmzZYbV2IDfq406jNBtg4xf+0KEf1ptwBNAe3Z6XdNH\nJU4/\r\n=g3Ni\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"76a0fe161f579d30f0d739918fe09f5f4eef04c0","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.20.1","dependencies":{"tslib":"^1.9.3","@material/dom":"7.0.0-canary.ad0c0c103.0","@material/rtl":"7.0.0-canary.ad0c0c103.0","@material/base":"7.0.0-canary.ad0c0c103.0","@material/theme":"7.0.0-canary.ad0c0c103.0","@material/animation":"7.0.0-canary.ad0c0c103.0","@material/typography":"7.0.0-canary.ad0c0c103.0","@material/feature-targeting":"7.0.0-canary.ad0c0c103.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_7.0.0-canary.ad0c0c103.0_1589467918581_0.010855370713354295","host":"s3://npm-registry-packages"}},"7.0.0-canary.fd8f8f2b7.0":{"name":"@material/slider","version":"7.0.0-canary.fd8f8f2b7.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@7.0.0-canary.fd8f8f2b7.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"c3d3ab0ebc61a259bf2d9d6e8a8585dc7de9a4b9","tarball":"https://registry.npmjs.org/@material/slider/-/slider-7.0.0-canary.fd8f8f2b7.0.tgz","fileCount":36,"integrity":"sha512-UGDjlI2t830v+pawGR8/84BXzqVhdVVc5TxZsWWZ221iKtSvH0gDvHBh8riRWSgeBv6yg96/es5B5rqiVa85KQ==","signatures":[{"sig":"MEUCIAXMiusQvo5Nfx8yoYyLgQQX1EUJwcvB0g5r6aAcWFKJAiEA0rN2YsIC3zZHUAGNLhsakfeiAZaTI+jMDpDJonfyUTA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":376955,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJewsu8CRA9TVsSAnZWagAAe00QAJ5VWK8BsxyGbtzThqqO\nP/f5xPs/UPBFy2qudWY1373D8fjcigsOzKmk7ktBGFxL4h/XIj7+V+h1wnCL\nAV+e4yoT6PVP1m073gMBXfWadF/2gRuzqC4rfUnfeYHTj5ozAJTejJo255Oj\nFij3vZy1zbeUm14fxomNOjGkvQc3Hq/JgubB/u2S5SiqdgqNEmgVx8QKfGh2\n++WmHCJAPTG6DSIcPEXNQpkLwcFiEhN3a3Qel5DCCbB9PH7qAH0dAAKkesOl\nkxH0ao9xUEV7C+dovaF7CNuclJ8QaX1uXMMt/HVYc8wS1j4yGoUiD32WO98I\npLwbf1l623WVdFz1N+dNyBvZku9h6f5zn54Wc9g7HBMxnjB27TKrwjo/Lqe1\nLv4wUeUeLITLOtB9tMnwW6WqutnTTwi9FbGQkX+U7ex1Nrgnl5Lnj6lOuH24\nkTwozug5DgAM7DdPSnVhPkzkIa3jZaCHbPXWPEhWa8FW8RqCAWIYQRqWR7dB\nRfIMv05Mwc09J6ctyPMRPmhFi9N2Om1De++Z0sPlgFHdd1IK7T8WOq5QaG96\nrZdDjdSMdd9vb7LxjCXLoKZaus+uI7E14gPo/s31l1WgbyP8ZPlZqHAxaeVx\nMj49gZZnW3vhWamty3eqfxyqAI6/gI6Pryk7Sa6mdsCxV2QEdG7mI31/1o0o\nt/3e\r\n=L1lu\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"30fbf3d1582cc530b978714ab043f92bea7c4b83","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.20.1","dependencies":{"tslib":"^1.9.3","@material/dom":"7.0.0-canary.fd8f8f2b7.0","@material/rtl":"7.0.0-canary.fd8f8f2b7.0","@material/base":"7.0.0-canary.fd8f8f2b7.0","@material/theme":"7.0.0-canary.fd8f8f2b7.0","@material/animation":"7.0.0-canary.fd8f8f2b7.0","@material/typography":"7.0.0-canary.fd8f8f2b7.0","@material/feature-targeting":"7.0.0-canary.fd8f8f2b7.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_7.0.0-canary.fd8f8f2b7.0_1589824444259_0.3240652395349388","host":"s3://npm-registry-packages"}},"7.0.0-canary.730920fbb.0":{"name":"@material/slider","version":"7.0.0-canary.730920fbb.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@7.0.0-canary.730920fbb.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"2e5fc4635d0b7252ed8cb68dda464823eb0759bf","tarball":"https://registry.npmjs.org/@material/slider/-/slider-7.0.0-canary.730920fbb.0.tgz","fileCount":36,"integrity":"sha512-bvjRUrU88cytyYfScoo7bkWitGKyyAzqZwJj7rAQjsLmPDaNh2bYjHhWOc/oIqCmb4iS7bNra8OKdTTDk7IDnQ==","signatures":[{"sig":"MEUCICY6WKQZYzN96rvY9EjUojAhky/gTXoWmWy84eGTXe2LAiEAxRPCHvSfu4AclIfQO0Szi4MmD4ykamfZ50j4jDLJbxk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":376955,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJewuWmCRA9TVsSAnZWagAApFkQAIGG6k9++YUn6gfYmkRA\n5N4fjzkoFNyuchUn3CxcVxldzXd/vRGUohjDXCcrIXJJ/eOdwSd4+ThqiCkC\nrjIa5fFoxOiIVRmiQjU4JCvKyA47EUpzDkutRAp8w8tgNCDDu1tWUeghh0bb\nPexfoCI57xUuVvjHa9wfjbpbDSwp1J037ceHfadoXip8KiK07BNsrMt7v6pw\n7XXBLLzkBTUzY1WSFq+36ZiDQbrYE1dqnCLN/FoR6t0o425/0oNYsJoKsIy9\nPyvMVPSEt85zipF/+zcWEHdvpKTygehSRI+lFDoRN825cDwMOT0gMXfokhJy\nJcJ4011uDgFbDLuF8j0nIvJJxY7sGijyIYeqrYBeYH1T+jVUrvKwjzIg24ti\nxkfygV4FnxodIzaevF/2WxQJdt5x1Po4cu7+Cw+ThSrVPB/Px6vyn7J35PUl\nISiC9hvrWo1He2v3EQrRpf+ov+dEY+nfX7XN4yfImBD/yiSfwUSwaaClLzmV\nqFHuybzVjX1NGUbQ1vycw0CX3KZZvs2oIEadGMyL6sRiKIaYUsvpnw3ZKLq5\nLvTHdwS2TSB9EN1eXHsdpq21b+QDKIMbJv3ZzgOVYFuTROYBCHHmP0aggH7x\n1ncCuwM/sbjermMDm066BcBEQSZdFVUJIxVJ8nn+N9Q6psVrC8MhgD4YnW1X\nbceq\r\n=6XaL\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"1acee01a3bcc1944050bcc6a38a1846c507db43b","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.20.1","dependencies":{"tslib":"^1.9.3","@material/dom":"7.0.0-canary.730920fbb.0","@material/rtl":"7.0.0-canary.730920fbb.0","@material/base":"7.0.0-canary.730920fbb.0","@material/theme":"7.0.0-canary.730920fbb.0","@material/animation":"7.0.0-canary.730920fbb.0","@material/typography":"7.0.0-canary.730920fbb.0","@material/feature-targeting":"7.0.0-canary.730920fbb.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_7.0.0-canary.730920fbb.0_1589831077815_0.6210086049536723","host":"s3://npm-registry-packages"}},"7.0.0-canary.bcdad99bb.0":{"name":"@material/slider","version":"7.0.0-canary.bcdad99bb.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@7.0.0-canary.bcdad99bb.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"3118341109eca21f4e5e21a15ab120d204d4ea93","tarball":"https://registry.npmjs.org/@material/slider/-/slider-7.0.0-canary.bcdad99bb.0.tgz","fileCount":36,"integrity":"sha512-d9kA/Bi+SlMMHLs44+KfxqnIKarUpnlvRFGjqlQ6Mhk9ECX+cGZSjJcLEU6oAC7hEf2A9Cl29fXp3Gp59FEEwA==","signatures":[{"sig":"MEQCIEirO4QlVd2yqGVQphkPBA2xhmHfe2x1t3gkPaVEMX2cAiBIOf3StGeu4RnDSFXoEHdQd8V+JM7N6pCPyD8TgH0Iug==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":376955,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJew1AICRA9TVsSAnZWagAAenkP+wV9LgL7rVTWBYNmM/0K\nepJ33zgqC0OpjNlxhg6KuNbB1JC77ap39fvaDeZUSA0scZipfeljJ27LtCHZ\no0jy9cjWAwH6Y6RNH643ymvnnggRNNRbfKnbdxeIChJS2UBvitzCDZgYuClh\nf5tBOzML58xfBc0KNPDJ4KdNCYbnn/bIKwU53MI5TfGZVbF8pSzfnzdW+JxO\nxjgrm2ZFZRL8KiUurYplcdJSSjpkY2iygMuxSoFt9IIgxYBwk5aJ2dBf6nyT\nZc7o/YKHupqpnRR5OmEzB4/dWYrURwsY2mt0QwhuNZmUqtPCb5yxVlwMAZ/b\nlxmMrkwXNWYsMr+OYLsAvS7nbAPSEhyL//v27PPgrbJpagI7pFNQ5EJSzPfC\nOiSOU48+ZnwyNEhFiXmMvlPPAOYD5vInazvPQF6ffLv0oKfsgF/dgMpZewZQ\nv5LeBLmfEt/3Jo4t1pfshJdIutsa4hnKm+Vdjhm35xQzSySFDl6PmoNE/ZZ/\nbPu5KFXebqWN57qs3CCkDTc/u2hBCabpKm44t0oxdUIPF0sm5aGCt9ds3PX9\ntY0fNeEqEHF8vhILNudg3R2BHHxXkD82N7nCZUzrkDm3isN0fxohVqIMhBx4\nRi5A1+C4hO86i/KpbvCaVP3kHvFGE7TK39VUS5R9yvhfaz0Z/ubHjaoMEMzn\nHSWG\r\n=ZYrX\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"33c3545075b4fec07083bb484fdd7245d0b243a2","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.20.1","dependencies":{"tslib":"^1.9.3","@material/dom":"7.0.0-canary.bcdad99bb.0","@material/rtl":"7.0.0-canary.bcdad99bb.0","@material/base":"7.0.0-canary.bcdad99bb.0","@material/theme":"7.0.0-canary.bcdad99bb.0","@material/animation":"7.0.0-canary.bcdad99bb.0","@material/typography":"7.0.0-canary.bcdad99bb.0","@material/feature-targeting":"7.0.0-canary.bcdad99bb.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_7.0.0-canary.bcdad99bb.0_1589858311575_0.8083912719044248","host":"s3://npm-registry-packages"}},"7.0.0-canary.4497b86ed.0":{"name":"@material/slider","version":"7.0.0-canary.4497b86ed.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@7.0.0-canary.4497b86ed.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"96f879451d0741f9e84d8eaa2921129adec03763","tarball":"https://registry.npmjs.org/@material/slider/-/slider-7.0.0-canary.4497b86ed.0.tgz","fileCount":36,"integrity":"sha512-hWQqGwwOSGxGYFuBObALphR9vxSuYhxYxQcaPAiJNNGrq/zknos1rmD/wjd0G2NyKxJBlEPR9ye1M0Bi87MgxA==","signatures":[{"sig":"MEYCIQCOqh0b2BdkV6Tu50LVi5RJP8gf2ZbOeYYI/Qu92k/dtQIhAOJZV7Qt1ckMH85CAZk0tC9scbs4Vj/jQOCnYKmTY+cH","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":376955,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJew1eyCRA9TVsSAnZWagAAv2kP/jMaW9Aq7BxoTPNNWNsN\n/6WVt1Kol8ESsLppkm4ikPI5DOK+sbJqw6eUgMFOx/WCcKc/o/7aqtCdzGiD\n6Bd7Y0b/5FaTVy9Za4YjKlObjiQH5+lWM+ZraL/1iT9jAzdbPMvooVHE3oTE\nxkLVE4M5UUArLZ4V2QHvJq5ZNmIebpvAx7bwCz3LA7Cclesjtz60VoNfymvH\nkBtzrf8Z6sIhtvDPBvAJ6tAQmPtUxv+GOGC4CrYk22XSSec+T03Yz49K6SLV\nt8AiYVqhQnH//Ya8KH/e936QIDjgVWqiU8vEHfJLlkzVI1K7Tt6NyQj0qRRx\nMIrJxXsI8Nd5rV7bBCRjdQfcK4ZXQ5YxzKRCtqKc4Ki+CSUanQuShal/tvlE\nbHeJUx7TldqDVI+nMOGW3uPDS4Yn9zgJJesyUUNHCWuGaksmziVJlAsrKpnd\nUnYOxxWY9MvGU9FGut7h7vdp1DgBy9CMoThqwInWJ0zYWnomPrkqlQ9SMWP9\njMtZhgPf8msChAlfE6YLzpr77Au9LfYbJzHrycfpZ4KrRzcJ9qG7QJw9tsTx\nSzchvJZ/aOGH/mgDLPd4Nt0qRp1eNbGQVLtembT0hEoJCb21fMm2E05mN3qz\netzE4CkhUqYPVeuSZ0lTKYC8T6Dc9ZKzhwy7mRjCA5X7O8rPCTX7lVPKyyKq\nLrEd\r\n=iyKF\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"7ffe8b9fd24f52b80e2fa6a7007881da7c29f885","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.20.1","dependencies":{"tslib":"^1.9.3","@material/dom":"7.0.0-canary.4497b86ed.0","@material/rtl":"7.0.0-canary.4497b86ed.0","@material/base":"7.0.0-canary.4497b86ed.0","@material/theme":"7.0.0-canary.4497b86ed.0","@material/animation":"7.0.0-canary.4497b86ed.0","@material/typography":"7.0.0-canary.4497b86ed.0","@material/feature-targeting":"7.0.0-canary.4497b86ed.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_7.0.0-canary.4497b86ed.0_1589860274302_0.09899789461462416","host":"s3://npm-registry-packages"}},"7.0.0-canary.2e60575da.0":{"name":"@material/slider","version":"7.0.0-canary.2e60575da.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@7.0.0-canary.2e60575da.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"db38f263601868ee9f8875b2e8b28f3ebd8a67a0","tarball":"https://registry.npmjs.org/@material/slider/-/slider-7.0.0-canary.2e60575da.0.tgz","fileCount":36,"integrity":"sha512-ZXcpknPuBckv8Nnvk/G4RRsbLjpaPvA7I22rLK8/ngyb6rB85E97GMq8SosGHOVJPjDy8pRZGOYdZSnY9n9Zow==","signatures":[{"sig":"MEUCIQDW0A+3JYJ5ayDwG/1uMmJiFcc5IsOefk8qkjfCo92RBwIgXdzDvtLP//5C+TqtFgOiV6Re6pQ8kweSdaE6TUQBG7s=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":377151,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJexATQCRA9TVsSAnZWagAA0X0P/3LKobsn0Vg70W4p7wud\nMvKE9wNngc5HX/FYxiTZUQEtrgkXh5wdgwEB7ZoYPiACCw40veDJMjndcJia\n39S5wFtpB0CyKG0307lHOX/7LOU6A3si9GjXZoJfP4YkzDYJ0EdcN7l7god4\nnjK8CuhskrnKjD2Zgtce+/H0THfvJuUbEzDZlnFjsO4qq1liu2QgoZHkdZ2d\nugt1oWCByyWvqRuIzObwvz13NFO9eOhawbaWTyQhj+Ve1qh/bn+vehaAuu33\nBJ41OZQp1Cjhsind4czvDmKbtQFxkTZNrb/4ZElYqDfL8tx1V9T3M1F+7JWb\nEps2WejD85SGNyQt0YP6qhfdm5lf2J+MkW6kkr6ppSmU/XTnISNR07V1gmAk\nvN/yjvzcXyxHf7M7YQ3ePhddn2g/x1Yy+6SK9E+Rqk8uN5XcfUkNbnaityKh\n5W5GAYWwsPlTWaVeItTAQ0DXr6zr5hTdE7f6qP7u0v1MuEeJv5UMxQqNVuQL\n2aqE7VbmEOhFF8Kyd2kIEQq7QfyB2YOWpUiGL4pAViHlw4pShs6MD5s4w0Cw\nOLK8gnhWi8YtssG2Nf56Ahu9MG5D935HRAHZavVxOHNhw9+3YNV3VSyuM/9Y\nWyOfEbGqqcFBPXIeQNYP/THoAtCdRKLafu9NGNFEPXVM397OTzENACgd2qWa\naFWh\r\n=btfR\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"a4b6f1d5a01445ae9c14845614630907beaad190","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.20.1","dependencies":{"tslib":"^1.9.3","@material/dom":"7.0.0-canary.2e60575da.0","@material/rtl":"7.0.0-canary.2e60575da.0","@material/base":"7.0.0-canary.2e60575da.0","@material/theme":"7.0.0-canary.2e60575da.0","@material/animation":"7.0.0-canary.2e60575da.0","@material/typography":"7.0.0-canary.2e60575da.0","@material/feature-targeting":"7.0.0-canary.2e60575da.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_7.0.0-canary.2e60575da.0_1589904592146_0.3081975394756906","host":"s3://npm-registry-packages"}},"7.0.0-canary.e3eacefcc.0":{"name":"@material/slider","version":"7.0.0-canary.e3eacefcc.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@7.0.0-canary.e3eacefcc.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"67fe5104dd2fe55c7a818c0edf88e08144957bcb","tarball":"https://registry.npmjs.org/@material/slider/-/slider-7.0.0-canary.e3eacefcc.0.tgz","fileCount":36,"integrity":"sha512-M/iaJh7+5Pfpx4WrquMRkOzKaDsqpQAMJGqXQuznzzyAHsNsg1NLeCdGdPj9TirT+eq/dZEZRTGBnM/8ON+HiA==","signatures":[{"sig":"MEUCIEIP4nGt4k3VJp8yJRuXaEDh1wQwcI7fV89t6LHtnrU8AiEA8z1P5cf4ztlwtrG2LVlm60jcwqqXLDfaQ+urDKHyf+8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":377151,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJexBmfCRA9TVsSAnZWagAAzU8QAKItmge1cn1Wh8q6lY0C\nQTYQ8QU/Es6jtDA7N1TnWbe9EtD4US2KLemC1J312/py5HxmIOZMCt+DdiH+\n+2WETbHW0p2orKGr+IhnUz0RH3G3GH4hxax3KqEPChBvO46A9aJym2YY4wUJ\n6Xpk1dgZFcEqaSOm46eGjlSs4acsWYLHrLFVSRoEzLalgfyOoxaZzygs/ooM\nj9e+B9xaYXXjrvq+7hUVrm7FfnB70bL5qrEQ/vgLVytq/YaJ1XjVfJLp822Q\nWeR+c2LRX+V40xRqEFoR1dSJHQ4CN/noPYkcP4BLeH/60dWUPn3GxsFD15P8\n7rvEJ6M3dDno74QvHuK8AFzOB5rnPURFuvXkfwu+TGaFVpk4yPpRSMPm9yGh\nhCtmZvJxWcqTHs/aX4W2NryqJFfQhfRNNGZ5p2MiW7+7jcRrf6mAPkDSju2n\nlaPUFLWzrg5LSdrhiUeFkSB32IiFRwaXa6mehJFLcvHGRXUlRicpCnk62Ooh\n4jV5UYRjoB6pIJfXQONE9WR3PJlNLdzdxnEI//VebAXe6QTUPgrM720nBp93\nt4J2B6LPK3LybINMWic0ndDa1BSA1K0S2NVjZCS9e8ojtAuqle5AlP7DV+mL\npSBd56jyacCDaGjQr5EBgl+1ADe0U85u58fCgtz2dT5nsFGYknVNWUQ4YSTv\n1JWj\r\n=xBUF\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"a80846c07f1b98212ba692bf027c2003093d0180","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.20.1","dependencies":{"tslib":"^1.9.3","@material/dom":"7.0.0-canary.e3eacefcc.0","@material/rtl":"7.0.0-canary.e3eacefcc.0","@material/base":"7.0.0-canary.e3eacefcc.0","@material/theme":"7.0.0-canary.e3eacefcc.0","@material/animation":"7.0.0-canary.e3eacefcc.0","@material/typography":"7.0.0-canary.e3eacefcc.0","@material/feature-targeting":"7.0.0-canary.e3eacefcc.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_7.0.0-canary.e3eacefcc.0_1589909918500_0.7347026990134462","host":"s3://npm-registry-packages"}},"7.0.0-canary.b065a4d2b.0":{"name":"@material/slider","version":"7.0.0-canary.b065a4d2b.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@7.0.0-canary.b065a4d2b.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"1014532f46634a8376d9bcbf5f81ddf613fd02d2","tarball":"https://registry.npmjs.org/@material/slider/-/slider-7.0.0-canary.b065a4d2b.0.tgz","fileCount":36,"integrity":"sha512-IQeTaXKdDb5P0AJO6YDiOlB7N2uwcz5LWPwSNrUgKId7zxudlxCUaLihpbkZzp03t4JnUsTGZq1gULZHM+ghLQ==","signatures":[{"sig":"MEQCIEAkYgcg9b4YtxoYU1ST3mcWbhvZmhh+zbP18jr7g3EeAiBZCI0c66jfI+JCPvm2ehOCnIM4lsRtFAgsHZs9GrFpyg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":377151,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJexUCoCRA9TVsSAnZWagAAnAYP/1WbYxcVcSCuMoZ3zuqV\nCWhNxIoErhziqVq96g23xtI6zNvoHxEH46mTnf3bia9dEKQNUpDz96jQXK3m\nDqMPEmEo0fIcciFHK7GMJdOVJfwlz24Fo0wX+lAYwCnx4Oe/93Kw7vR2hsO4\n4hrMnRm2kVB9ITkb6YeP03bx4FTkMOAwxGxCYPAb3AlApXZTyDa+baTiqP4Z\nCPosgL/jPPz0Bu4dxj/Iwo+AIg+X8pYlEjKyb3ggAnXOSgLPRJqoP8YB5hZ0\n2UsM5dyTO/BX9FqZQy4HADIxRpGcnYCUOZS3fKmJmbYP/dKJBxisyxb305XP\nfQOeZCHJFrnyTvgixznm0DrwhBeTcXRAMNEbcXpJlYBU+4dD1avqWcnsGo6Z\ntSFNynLdcxhsNhiVDPQraYEOleik2jTkjW4Uaev1K/dLB5DKW6LeuowpjdVd\npZdooFodJojgZoWFDUA/S6A2dH02Nij4hNhRcjW7iy82RI+DYfpKeNybfqb/\noakajkUTU8IYzFOJQYYeP/2Acl8JllyP/3qp4D+6QFKEPQDpOu4a7y8SuwVF\nvGJqXn834Pc5W/q75CaBrdP98I7Nm03zKv+iOdb16lhE1hfBvnLDamq1slZE\nCfa31wpYy+zy/CAEe/+P3W/V7xhwHtbykh7+hna2nC6ZlRVl2DJeoMOZG2x4\naIUj\r\n=tBqo\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"7de80cb2ccfd67196d7be3fd614cebb9cd73499f","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.20.1","dependencies":{"tslib":"^1.9.3","@material/dom":"7.0.0-canary.b065a4d2b.0","@material/rtl":"7.0.0-canary.b065a4d2b.0","@material/base":"7.0.0-canary.b065a4d2b.0","@material/theme":"7.0.0-canary.b065a4d2b.0","@material/animation":"7.0.0-canary.b065a4d2b.0","@material/typography":"7.0.0-canary.b065a4d2b.0","@material/feature-targeting":"7.0.0-canary.b065a4d2b.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_7.0.0-canary.b065a4d2b.0_1589985447579_0.7831989740119227","host":"s3://npm-registry-packages"}},"7.0.0-canary.4ebce8d78.0":{"name":"@material/slider","version":"7.0.0-canary.4ebce8d78.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@7.0.0-canary.4ebce8d78.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"dcb772ec72aff7fa2a5c45be197adf1ce49a84c9","tarball":"https://registry.npmjs.org/@material/slider/-/slider-7.0.0-canary.4ebce8d78.0.tgz","fileCount":36,"integrity":"sha512-pruLKzLn+7hM7qI5opOwEJ3EDXPVPjmkq5cR9iX7c8KgORn9uYFLr1uwP0Hp39ilLMaofU0E/KMtitFhPskOjQ==","signatures":[{"sig":"MEUCIQDiaiPskhEqvDoLFt/YTSDaJzSofpmBBiWrxuYbgon4ogIgJ7SetAAs2HdhG/UG0kGT98Hlfx45MaNRA3+fWgyoKbc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":377151,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJexZg2CRA9TVsSAnZWagAAS+UP/1qFfsZLNzM12DSJrVO6\nQ5NYJCOHRRDhwT/2Lzh3str/3McNHrF1aHFsYWE/VnX12Un2TSYSWJDcG0xn\n/gJZQFqxu8PoxN1aLrLHE2X/oFJTT5hTpiVvliZSO65ewAyJnxSK6ldOHtg3\nZ9I7cBLs359xA+poG87MvA5tX2KAp/KTsMdKF9yDuAQxNFyGfLdj2PYZbGom\nEt7M30Kd5YWbKrdKRF541libhQWyDKU+XEFC+amWGy/hTCG5zgCgMIasZSuD\nR8nM3sqJ1W3G2hjiF4P7wlh83giqKxUH1XAty2NRyEXCWUdrJkXm33LUfNkh\nVboSZGqaQKHjh2Ecn5eo/p1wL59QHi2yoDWuNuKn46Cc3sDN2m1ZV+0twAaO\nCXPZ8l4sLsGVgKMVdmj2rbosD49WbZBu+iO87+pdzCJ/cjDfw6uLhXlDprM1\n4Dpq/BHc38LRZZjOIhRGfkAwc82N9Ty6+4fD8ku8aJbIQW/6TgBeDxc8XD0+\n8UJST+p4V2F30++FOirFQc8xdgquaI4UzRajEk+lUrAZIOtEg87fyIzGu8WZ\ngwP9BzHjHmoicP+6N1VHFvUS+sSVABMpM8jfiYxcYy4ZK3gb9vN5wzHPRzfA\nYPciL1Dtirxy36d9xbJ7KPA698RPAJJeHxcrRJO3tWY0RTqg6OcxWZxeKC/M\ncV1H\r\n=AGVx\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"d7cc6c4aec24377070d4417765fa102dcd7c7e0b","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.20.1","dependencies":{"tslib":"^1.9.3","@material/dom":"7.0.0-canary.4ebce8d78.0","@material/rtl":"7.0.0-canary.4ebce8d78.0","@material/base":"7.0.0-canary.4ebce8d78.0","@material/theme":"7.0.0-canary.4ebce8d78.0","@material/animation":"7.0.0-canary.4ebce8d78.0","@material/typography":"7.0.0-canary.4ebce8d78.0","@material/feature-targeting":"7.0.0-canary.4ebce8d78.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_7.0.0-canary.4ebce8d78.0_1590007861528_0.07146969924805346","host":"s3://npm-registry-packages"}},"7.0.0-canary.b0fdca492.0":{"name":"@material/slider","version":"7.0.0-canary.b0fdca492.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@7.0.0-canary.b0fdca492.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"acf9a2083f7de1d0eb9d00f8ec67a482dcb9300c","tarball":"https://registry.npmjs.org/@material/slider/-/slider-7.0.0-canary.b0fdca492.0.tgz","fileCount":36,"integrity":"sha512-BcIF6s5yI2cjVBdzb+LeJ2n0boyau9lTm55cgDAyy/PXCCxpw6xvMZpemK4RFXZ/Hn0SDPqz5FB9jXNIhH7LJQ==","signatures":[{"sig":"MEUCID0IxfRXK8ChLGH0QsGUq4cXNdvjKd4bRb9VAPy7H4zEAiEAqj5urGwL/Z4EZMAtVcxnEQHDJgZQ4gHkk2ngYKJpS1U=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":377151,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJexbc1CRA9TVsSAnZWagAAMvEQAI/y82x0p4KLSsS5eqeY\nliXxfC24A5xpWGKcGwg2CALSLJfKTZcvTSH6jyK08scezpGedw80rEHkpFbL\nrjv60qRjZMibbvs7rSyWnEyjJH8hPqrk0uFkM7KcsslI5DTMca1I8qGzyKP1\n0+m2+ubWT8J53CQAfhbmUTuEu0RNz8GXdT1gr1z64jtGI8NFpe1i5/qfq+ip\ncWV69E/CX1Eo7WqbvFK+/s1E/propU2gZ5MdtHIqnYoc3UqLe93Br/uioeAX\nR+I4ub9OJ+PNesEdmB4k9z52xjFNtwRHXnxiUMGFWqrc8IFdwE6M4n1KdZ00\nri67HLIPmkUWM+biziVtBvLfA31JfnMur4tbPuOxq9bDUs0cqz5h6vd4KnZ8\n+wRt8cMMCHzrusC88oViq8CBu8oMmblJ7Sk2Mpgcg+kzgpw2KKMWolMYg94L\njX/n9BhCEYMYUQgyP4F+SVfW3ECFnNSHBxv+BK2DL8BRnsRcavIrtEm2BQXQ\ny9S7tSN8tD3sOOqtnmsGnGZTnL59sXRANCiDWoCoyKBIQXHCkzP5Bg2FULru\nKZEgnz8xFRSKbMFcN8i0ev5LtHHdo4vo+tm+D3lBHNTxo/zNydvdQMiqjnZ/\nsUJQ7URRrPs0ZFuLJbqEv59mKgUSnYclOFL7a2DUbHkqZwNwDMAnmrKtQYlE\nFZST\r\n=Yzjn\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"590e5f052548986555dab713a1bcd253b6dcd01a","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.20.1","dependencies":{"tslib":"^1.9.3","@material/dom":"7.0.0-canary.b0fdca492.0","@material/rtl":"7.0.0-canary.b0fdca492.0","@material/base":"7.0.0-canary.b0fdca492.0","@material/theme":"7.0.0-canary.b0fdca492.0","@material/animation":"7.0.0-canary.b0fdca492.0","@material/typography":"7.0.0-canary.b0fdca492.0","@material/feature-targeting":"7.0.0-canary.b0fdca492.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_7.0.0-canary.b0fdca492.0_1590015796778_0.40262987510862014","host":"s3://npm-registry-packages"}},"7.0.0-canary.c67667e8e.0":{"name":"@material/slider","version":"7.0.0-canary.c67667e8e.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@7.0.0-canary.c67667e8e.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"2b39ab4e822dc5993404d4a2479efc9741fc1215","tarball":"https://registry.npmjs.org/@material/slider/-/slider-7.0.0-canary.c67667e8e.0.tgz","fileCount":36,"integrity":"sha512-0SyKMnfxfSBnAhiVCw1UIRvHlZKo6LMRt1IFzSU/1indQvkMMzinufXBqOeV0DIbNXdT+DdglYnKgIJi/qLCEQ==","signatures":[{"sig":"MEQCIErcNj9uNmZlvzVE24VO8FLRh+hyFlsPncOis3yoxKL7AiBiEzKvL0I5FZKuN8KVYkkm0pYlOXxPTt5L6NNGJwDx2g==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":377151,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJexox9CRA9TVsSAnZWagAA69oP/2ZG6liXO/C2xq7V45qa\nXV55t3Z/Xbq5dRr6+Hq2hlCy5E2C/yl+hLxN+2SaweRKtioQYl2z0nUwIGZb\nKvcI6j1s7us24eVHWqiT1U89ZVqbcF3KOvjWAj6uwwJhAZpO4U6PYqppmNz9\nt1d0g03PTqxYoBR3xIKxsaTnt1PqFeo0e8o8ZheqYH+rbelXSxSOqYBy1BIl\ns0sNvjCZcpOGnMaoJzH4soacH8JyyPprFN6rHHvDmDk/QzUGW3wk1VkeoJdY\nHDTvZBKGkyEGQbjC/yMUCMGX5UwlFmyuQDvwGOVNbg4iB/JT8K6bQ8537+Dj\njiYjNH7CXsAjKjL8gnQk9UNzB4PPT0j+o5WvnA4LJqrSKtLYTqQjv6SdCyHA\npn9K8KblflRTg7++iNKcDbTj2wHCzMBBjKQRl94MH5LFX5H4HWZ2fG2j5KhN\nmve4bYk8ONFve/5WOpE+VNDlztwzUTgCyq5JaFHpkmLRF2I7qXEpw/YWfLF2\nXmCV0Gs5X4bwKduc2Ax0bhRkJxEaAwqsCY8lErw5aiQv+gdMGHzE+wqlb+rW\nj55zSZ5mSnGlPoaytrrnN1twsIA3yRab0O77LUgtE8OWdIG8JgcqUGnIKD6e\n/GjQ2htxWS1DeJJbaJdylsH0G1+fKsg4dafXIbWmR1OjCTH4KGNIwg3aa7i1\nEIjm\r\n=VqhY\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"405f1e85ef85a7cfb12bdcba9816d716433463d5","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.20.1","dependencies":{"tslib":"^1.9.3","@material/dom":"7.0.0-canary.c67667e8e.0","@material/rtl":"7.0.0-canary.c67667e8e.0","@material/base":"7.0.0-canary.c67667e8e.0","@material/theme":"7.0.0-canary.c67667e8e.0","@material/animation":"7.0.0-canary.c67667e8e.0","@material/typography":"7.0.0-canary.c67667e8e.0","@material/feature-targeting":"7.0.0-canary.c67667e8e.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_7.0.0-canary.c67667e8e.0_1590070397342_0.9822212040617402","host":"s3://npm-registry-packages"}},"7.0.0-canary.62b5f37db.0":{"name":"@material/slider","version":"7.0.0-canary.62b5f37db.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@7.0.0-canary.62b5f37db.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"afa710cd5919ee1e4b87ff2ed99ddb7275a0ce26","tarball":"https://registry.npmjs.org/@material/slider/-/slider-7.0.0-canary.62b5f37db.0.tgz","fileCount":36,"integrity":"sha512-2xamZ0MpjCQ9SrkVVV50vqNzlc5k5MB6xiQ1ejacOxUeipxBtAMAeyTc5cRaTNZXojAiwxfRPXZkQz8ZrGSTXQ==","signatures":[{"sig":"MEQCIFxGKHVqF5lF3Q7iekG8pdwlUnt8w7YZWuz4PLnLTvDHAiAXznRzWkhGzenzQqY+VlDQB/jH3SiSpCdrcoyzPJVOSg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":378885,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJexq9DCRA9TVsSAnZWagAAP5YP/2Fu3ypfRZ3ivL24BkmV\nIyMWAxl6Ll2MBo/52CfTFl2kweE+oRW3RXEbmpOtHTd4QT17VUgcmzdNuiY5\nZ1qbCGNqty3TEceQudDiB/DEVwnAkTnjpeZiQAAf3NNofmjoA2okEQQ0qSSx\n/CxflMsV5W9p/KM2iztvc1Uz5KCDmkpuvUJMLXG2W5olgKN0WXMGbXTtbo82\nMPAVjVY/EuUC1V7JHSdPOLOw2y2Upsh4UZY3+s0IJoIIWESRt2nZaWMIkS/l\nL1AOngN9P7cm8k0nGIKQA3EVIrRATORZzBg8DXLO3i/T1Sm62EBmMZ0eQw7h\n2M6d/Gy11HKd2hZgW5OAPbXmCkWdjCBmAzMX0hTHSSH2XY4+Fw5Uf82bOCxm\ncOzBse9gC8HuMuxDXiKEfVaf0GkVv6RaFzX/mbAzm2taS4ALh7jIogHZ2h1n\nihsYe3VnQbkAIUijNKX9TPVaRPeY0W2Zr/Qj9AZ5wgT72quC/KX7Aegb6Ey8\n8kmK08c1jmUv5P5t9vro61YbG8KeAhcC9cbPjnQPW/ANNs1cG7RqFjT7pArN\nE/o1g+OcA1hQ6tsv3em66g261TTK8vgBQ6pSvdkAlwXf1uHVfaEbCp2LjifD\nd3ju2itp54XNeBhHqkkhxOSj7faCtr7yMemDeHrRZ0mypWW4BYTx4BxiPkyJ\nynPM\r\n=4thM\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"62c869c9d490fcd3f25cd87f251a83b273e32736","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.20.1","dependencies":{"tslib":"^1.9.3","@material/dom":"7.0.0-canary.62b5f37db.0","@material/rtl":"7.0.0-canary.62b5f37db.0","@material/base":"7.0.0-canary.62b5f37db.0","@material/theme":"7.0.0-canary.62b5f37db.0","@material/animation":"7.0.0-canary.62b5f37db.0","@material/typography":"7.0.0-canary.62b5f37db.0","@material/feature-targeting":"7.0.0-canary.62b5f37db.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_7.0.0-canary.62b5f37db.0_1590079298624_0.9033134420370592","host":"s3://npm-registry-packages"}},"7.0.0-canary.2e218dbf8.0":{"name":"@material/slider","version":"7.0.0-canary.2e218dbf8.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@7.0.0-canary.2e218dbf8.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"a003df627f0fc3d654d66ddadfaf3ba978c189b4","tarball":"https://registry.npmjs.org/@material/slider/-/slider-7.0.0-canary.2e218dbf8.0.tgz","fileCount":36,"integrity":"sha512-4Y1sQixSuzaDmOTxC/0yrx0JeF4oAb2bDIvuK1nmBawi4Z2312ea1hc2Hg6xHvIXgubmHFc+BgUEexUUj+DWYg==","signatures":[{"sig":"MEUCIHQiGk0nBx7m4NcMte9Z05Gvw3G8tkCePc+g5ZrnujxBAiEAqUmeipH+l0k7uyUXFMgP0rOUtAb+vdOHe3bZAA+MGDw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":378885,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJexrQpCRA9TVsSAnZWagAAeNUP/0dsxJg3oz+32zk/hjot\nxIf2pl+2JJd0+gtt5wtaCGvK9I6M0xtFKFDcStSa8OX2RMVUheDP+IJfADy8\n5Gbsn7HSTCVtc/PNzkLS0hyYe58xNucq8gJ0hKGZO8cyHmCxevk3ThLBBxn0\nAmEBh7bwYOv6EMVDZGVtg/m7k8tvmNKw5wPNGpvMWUp3Xzz3sZJAOCgXY9n4\n1uuhsclupJvDkxi44QQ0yKq3RQySXGwcTt/oQ1c8gZlMZUuvUNz9cPPyXtK2\nwwTId53c4wgCbRm94yNYl8Qixpb9gQvszfUfxhtRp5U+F0CcXarBOj6xY1Ui\nOSnIwVzsM4a7F8A17/0+Z3xKbSszk0I3fkSBZcyNu9PxA7/R8x++XLSbMlTO\nH8LUnp9JUEW+p7FQLL+MIIpRWYpNokm126C2WrFP4ZEY/vmhjV/1/Mmd2qkw\nZK71olTjByALHvwTAH7XniHTsUKVuNiWU4mgIJGqi9fOI3+RgR16vP1lB+tc\noLt1M33KZcj0izaK/c8PXLjtTdgj9aa/VSF8uIUFCslyFaycurJjYZBF8/2Z\nRlh9eXluVldbDtVDeZp8OF5eYBqtPjkRxEMm2WZ+aYzobQbXVsJ8ie22sl8T\nlLFl97NAeUkYqmuYf+vsahVnKGShezf4o4bxV1dnRipwH3UMVS+lnCJ9LfY0\njjyF\r\n=ddAb\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"f9b76f9144a233e7569877ab8f0dbbb1be555055","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.20.1","dependencies":{"tslib":"^1.9.3","@material/dom":"7.0.0-canary.2e218dbf8.0","@material/rtl":"7.0.0-canary.2e218dbf8.0","@material/base":"7.0.0-canary.2e218dbf8.0","@material/theme":"7.0.0-canary.2e218dbf8.0","@material/animation":"7.0.0-canary.2e218dbf8.0","@material/typography":"7.0.0-canary.2e218dbf8.0","@material/feature-targeting":"7.0.0-canary.2e218dbf8.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_7.0.0-canary.2e218dbf8.0_1590080552548_0.1285554554959445","host":"s3://npm-registry-packages"}},"7.0.0-canary.7fd792bb9.0":{"name":"@material/slider","version":"7.0.0-canary.7fd792bb9.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@7.0.0-canary.7fd792bb9.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"22f05e500ab57c72a18f6ac98c757da5a8dcf2fc","tarball":"https://registry.npmjs.org/@material/slider/-/slider-7.0.0-canary.7fd792bb9.0.tgz","fileCount":36,"integrity":"sha512-p8mVunQ8O3AH19VqJdT60hyviL+LZ65umjbUtDI8SY8M5q4i9JCNCo/OB4QFIayEaHYNZ6vswjLZLeYPrlDyog==","signatures":[{"sig":"MEUCIDLSGhYGoSLAFD9NZ2jUhcrtjJMKCIxj9Y8GAIBpSWDvAiEA96QFRG1owgj6cxybUzLLxwXjiCJplDDZ5lrClqpsaps=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":378885,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJexrcDCRA9TVsSAnZWagAAbaMP/jUNKFEWKXDg2bBOu6h4\ntjLvldrveObBpakhbY4mKZNH0i9ttnupUuWTz2PSsOemCmZCGx77X9mC6jVo\nspCSSUCXCEnJrm7NsQM7KY+WgCVLKfMKEMH06PDoRT2A5KRJE0TB4KlGXknF\n6yTYfyRNXwEc8WKkWYk3pSHaPsQQfvKQshKW/zaVLnOeYWxTqegiH+yC8PQp\nl/9Btps3eSv0dVOcORJtXxqCTtJQCaSasooJZw/hpWvCbOEDyZYWGZNAqEFy\nP6Qx0TaaGh54AdQ2qh1+2DWSBEvx9mPtKrBFO4JRZM7dTfJzqfd7HiKVc4gC\nz3WrPKssfwtDNvq7iQEGGP6LMDsvGDA8Jlw8GkYeuB3MZLRoRe2e7z66Xy3B\nT4MGTz2HMfSHx780EeC9vThedzxeyhVnmCZSSTvNnQKfgHk4vDsP/JQ0RFIK\ndsj0W8tjNTRam/LG9HZkDjf6x7bOVJDzgtD3yZrBVN8MLgqSKJtcwy5PILkt\nBhDNZBWsrATEIjvv47PpeqRLsFxcdXllgZn3bbERTWdOAg5MmD3Q5JGURks1\nBjvKlvcw7MmgbN1aL4cW15SdORxDEeUXKX8VX4mNUGjV0P+fTXshkqg/Bsb2\nrYhuyRdjap9jCAXVxI2ZA54610YxEjmQ0Mcvib+fqpywQ7R/b8/ZUC40xjy3\ngMcc\r\n=Z1y8\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"d5ce4b5e7914675090d101b10f10374783326ede","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.20.1","dependencies":{"tslib":"^1.9.3","@material/dom":"7.0.0-canary.7fd792bb9.0","@material/rtl":"7.0.0-canary.7fd792bb9.0","@material/base":"7.0.0-canary.7fd792bb9.0","@material/theme":"7.0.0-canary.7fd792bb9.0","@material/animation":"7.0.0-canary.7fd792bb9.0","@material/typography":"7.0.0-canary.7fd792bb9.0","@material/feature-targeting":"7.0.0-canary.7fd792bb9.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_7.0.0-canary.7fd792bb9.0_1590081282778_0.5202723518757986","host":"s3://npm-registry-packages"}},"7.0.0-canary.a66493cd8.0":{"name":"@material/slider","version":"7.0.0-canary.a66493cd8.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@7.0.0-canary.a66493cd8.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"eb723853a2dc2b85da409659cefe38c410a86d19","tarball":"https://registry.npmjs.org/@material/slider/-/slider-7.0.0-canary.a66493cd8.0.tgz","fileCount":36,"integrity":"sha512-Pdu1SvLmpm1EyK+1SYuBZleR5YjJZO4wN4eZ27sUTessaOWEMgn7B5/oGqfYsjtGYqSL8QR8jC+/YG/EX/YXvA==","signatures":[{"sig":"MEUCIHvy21bQBGFF02sZi9UwgqpjjLehtoslgR8e7mIavhxBAiEAob3rgHIsCe/TgNciSpaPPABkXfbjEmqqSGRgZ2tsafA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":378885,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJexrftCRA9TVsSAnZWagAAKlMP/Ry2T2qyHsvk/Qon2uO1\npApuVrPolk1S4RTdZpXbPD8pNx8AxkKf1o1AR3cqoePlFrGW2yyHwR7Ej4zy\nQ/CsW4QEdzVGR30OWgHLp8Ga/iUs8BmaH3Sq6wxi2hKuNmQkF5q3NlItl+Gg\nK44DRMC6XWOAOE+v+H2MHk5bqtxSbaLOMz54GJHvDFV+cDAYq/fV3hiLYMpb\n+0AoetZwQ29hRtvB5XB8maDsH+/qtwv9FLwWyGSQbUVlTiCiyJYlv1oTQFwv\n9dw1BHoRF2L42Is/YyPtLUA3nSi8f1Rh4tqlzMcTJFMIFqi1lNbH7PThYbLy\n/pLW2IDRAodSdhg1UGMrIZmTxT77HLIn+3YCK0qUcAenoHYvyybagLc692nS\nofw0k2D3ppxJ4Tgr1f4Vid7kTfsK14h4rBdkQNtt11jPmvTaIn/ylppiYpv+\n15Iab+MVlyooR/hEMGWZOCeoLSbp8GRO1DR3lhbjhO1oTGZvsp0Bizn8VVsT\ntA3TgXHG/oBESfHB9On9vUXfs0RGxbccoaEdTlqqsKeVm3roxQ3Rfl65Tngj\nPZWVu8mCYiDFWdrUngGHlk5fWQOAvCPGnR637gMMShd6qmPyT+/uuPjTSf54\nzMkHhO+ARGJzcfrddgf0d3sUg/JfDyLmNWDjAMyGSLNbfrwRTWdH7Pxh41o4\n7qjq\r\n=d9BC\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"a14e3cae1fdb42680777a9a6b5706060924d68b5","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.20.1","dependencies":{"tslib":"^1.9.3","@material/dom":"7.0.0-canary.a66493cd8.0","@material/rtl":"7.0.0-canary.a66493cd8.0","@material/base":"7.0.0-canary.a66493cd8.0","@material/theme":"7.0.0-canary.a66493cd8.0","@material/animation":"7.0.0-canary.a66493cd8.0","@material/typography":"7.0.0-canary.a66493cd8.0","@material/feature-targeting":"7.0.0-canary.a66493cd8.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_7.0.0-canary.a66493cd8.0_1590081517383_0.21795859347464264","host":"s3://npm-registry-packages"}},"7.0.0-canary.da05f66e1.0":{"name":"@material/slider","version":"7.0.0-canary.da05f66e1.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@7.0.0-canary.da05f66e1.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"dad3f9a0e03306742491e49f0f6ffafcfe00381e","tarball":"https://registry.npmjs.org/@material/slider/-/slider-7.0.0-canary.da05f66e1.0.tgz","fileCount":36,"integrity":"sha512-VmpkUr77q8vThy15FSgryF7wppOoy4nnbDgycxbG1nKcHpNHfh0JglfhPLD+P2wZwLzKb9Ijgqx5PqDx0mxzNw==","signatures":[{"sig":"MEUCIQCsl+G7Ykpwia6m+2KSj6X+T0XfGq/sedMC1Xu0qkz67QIgAa7lCmObjNGl2K3VxT5bpaJ5NFrxz8M0vddbrv12swA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":378885,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJexrhJCRA9TVsSAnZWagAApcMP/1mfRJH16r7gveS24nCF\nfcCe5E2ZKtbz1wYGFjPt6iOLdQlzJyjAAEgdBRTwYfiqP/H3buagmEIetxND\nOI64OYRd/gCEosrQkOqv4JYO2hdvRjnLUl4NO+mclh3S/Bbs4ftlk0GBwfYB\n3fy5xelJqJmz29J3AvRydKcNXuZ2j4iku+AJK5qs8htq8ny5VTcLYc4fwyJ9\nOXZk1Jqc0D2VoWzVJvGf6kQse3WkubMawiJ2OTrvnCTPJ0WdVXLpyHqKKLMX\nuauyPHn1pnJJn0uhJShL9odviYjA75+s3hUsD8IXZEktf1wSFrl+xwptq3HO\nQUwCdsAvqCqMBwso/Cri0vy12U9zxF76qrg68zYM/aHWxMEhd9g0Iu9ixSar\nw9UiJbo7+zNLFTY5IXlrrC0mNqAIUqz+BgZZphsaqexYgx+TWCIlPQ2Ivd8P\nHP69lQZroY+hx+Ci93/1BQSF9paidVNjtiVJjZA6AMUGgLHwp4w4WO/5O+v5\nL90SuUqhNQ6H4r6XGnEGp9as5S0IBiFd6s2WsJB5g5u6DNgaeDnFUXDsg8R7\nursoKk0gNpcaLAASRDD6mXeHRC0GaIqW8U/IAJz2dUBYIF/wfJgaDLvCuiO8\nJyCyn9lGlqLMzre3n5Z0guIMil+LUlIkEEO9iZ3Yl/3f8LBE8StRLMtazEDG\nnQ2o\r\n=w6Ji\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"97f495e74f33645d8f066a4be88eaba95700a4e3","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.20.1","dependencies":{"tslib":"^1.9.3","@material/dom":"7.0.0-canary.da05f66e1.0","@material/rtl":"7.0.0-canary.da05f66e1.0","@material/base":"7.0.0-canary.da05f66e1.0","@material/theme":"7.0.0-canary.da05f66e1.0","@material/animation":"7.0.0-canary.da05f66e1.0","@material/typography":"7.0.0-canary.da05f66e1.0","@material/feature-targeting":"7.0.0-canary.da05f66e1.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_7.0.0-canary.da05f66e1.0_1590081609113_0.44845123374321894","host":"s3://npm-registry-packages"}},"7.0.0-canary.740860e78.0":{"name":"@material/slider","version":"7.0.0-canary.740860e78.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@7.0.0-canary.740860e78.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"fbc95608ee5f755f96d8b4d75c45a16f51624677","tarball":"https://registry.npmjs.org/@material/slider/-/slider-7.0.0-canary.740860e78.0.tgz","fileCount":36,"integrity":"sha512-aEV2YuzRz1TRUY2Co8Kk2FHFSr9q+/+F2+73b/7qvF3RN44zM7wt/tIdZsYklyGyByS1IfRjVTxm2Cuf3pyNBw==","signatures":[{"sig":"MEUCIF1SqvOKNnceh/TZrpwCmtBCx3RkPk2gJx/YqZ7ZDzqjAiEA/w7STABtzGCSHCjaNgzfM/sXNE0POO9miiXvdNcB+QY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":378885,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJexrnrCRA9TVsSAnZWagAADUAP/ju//80u4k67L/0UwtUG\neVgCorJIUcsMIitSCv+Gb5SfL72HMw6Ru2r/DjA1bClOXb8G6cz3b7bdf66e\nmPIq1v/Hbqg1dR83RgZ8y5GzntJmmkMs1bxXFerg2wfGeCf9PpZCPL9VKsl7\nGBAH+G9NAD95bRecqOgW9pSLhLq3TASqspqv+s3ssfAzXy+k6xXlANpvetVk\nVj1+Bm6xb5XEkWg2QG7lFLwjIaQTPozjDANAPxDW2ZzovlO5P40EkS5AF7y0\nLKYjaIqJb4gZ5Mjvy2/oYOa73uHN7ykYD+3lZsOI988A9RzCfB00yXnGgKaz\n9JOc5LewVjQ2hmdFZyMhFERff2vMw3wC1bOBz4ylEi8mpU+coDhRrY3zLeb6\nwpc/oI7j68bli2LbpXywBL/zJnEbxw00Dout4xquzKPaZwQlyLI7DsXx0G5r\nxKbqbrpIHqyYHlo2BN8fWb1EEFReynB/I0vL1jpIjXwelhYFOGjQVuxSpbgQ\nHFhBbq6eK2++3SPy9TC5GMgdVbW8Yjbt4WN9tTUcLULdCj+cW22dF2Byp33X\npS6lhB97Ny9q0v+pvRMxMrDSuVPWPON8sdwItOzd9G9GVRJonPm3s2hJ3A88\nRNKojEAlhmPka/EFK5FivSP+1P7XhaSUyIBwVEpagWBGvwlhEeWd+GICmxhl\nW448\r\n=+MAe\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"2319c23e86ed8e7ed27865b711bb6ea6970b98dc","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.20.1","dependencies":{"tslib":"^1.9.3","@material/dom":"7.0.0-canary.740860e78.0","@material/rtl":"7.0.0-canary.740860e78.0","@material/base":"7.0.0-canary.740860e78.0","@material/theme":"7.0.0-canary.740860e78.0","@material/animation":"7.0.0-canary.740860e78.0","@material/typography":"7.0.0-canary.740860e78.0","@material/feature-targeting":"7.0.0-canary.740860e78.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_7.0.0-canary.740860e78.0_1590082027345_0.49783431731106864","host":"s3://npm-registry-packages"}},"7.0.0-canary.5cea2610f.0":{"name":"@material/slider","version":"7.0.0-canary.5cea2610f.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@7.0.0-canary.5cea2610f.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"633b81efe4dac39b38701279cecfea0a8f53a3b4","tarball":"https://registry.npmjs.org/@material/slider/-/slider-7.0.0-canary.5cea2610f.0.tgz","fileCount":36,"integrity":"sha512-WEB8XySPoMqBAEvzJTjn1icQ5TI0Z/L74amIlofcPe2BFJEL5GFjU3mesK7R2G1lvM3R7xllwILeb96MlID8aQ==","signatures":[{"sig":"MEQCIDUxIWG/C/uNdlULh8DTSxR4THVI6Anf27oJ1/G2s+oEAiALBjI4k7utkQKA088Pkk/wEGQHNcA2QGwCf/lwqxZKKw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":378885,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJexrpqCRA9TVsSAnZWagAAsVkP+wWCodbTcmTvmj2YxnD7\nz2AEL01lpRsRFTknRX/FH1TXEPks0tkDiAa5xxEi0Z6iTNA91sr+/Lfs47jj\nqZiv983lwElBwhF+epA8bETQtQscqIrIxPTmGny1BDnjXpV0bd7Bq435lTKW\n8UVMq4C936dEIRK+ygG/88iHeYduWZJVe2Ef/yROh3dgrTnYoaz4+dCCO6w7\nikBtOyLiZMsuiNqlikE3+L0Cq95jNBRBxVqyexcycFse7eTexmMlmneKnSVj\nXdA+hsIcbT/cA6gu1GUmsooJjPJAzPKrCCxGSIyLmgMtpTgy/zuk22ISAO5I\n0KFBpZ+8ZoU8uKCyLjWPVDgOp0neJmJI1BtJ1p8u0rSR4I8ig03OE8WJL0mh\nFY9YJ9HoJvRb3Ifcng5iX0TUoD2i+zGRP6KDY59NOgh/Et+BuozqfuZ7r/q+\nLG9nAKt5g3OZDlg8zg0eR1N/FuiJjE3eSoVqX9vbLGsyS/r0tWAMZGH0Ck1v\n+GIE+wh1hxgSdHsJm/e1VNfKPYoXL5ZcGUpuqsTc+s+l7rXhx2IKwQd8T97E\njR7tITobNHqQmtZuZuVQ4aA3VW0C5CdWvh+Dd3KPCMiKfdd8seSEaRhLqz32\nXSITNa61uX8a45mmkdUL5La/TYcKpH+WFH4n0mt08gjga2GRLqn1uSQxgm/J\nsDcA\r\n=U1bX\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"647d4356b68bdae8879ed7384b0ed1ba4e1954dd","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.20.1","dependencies":{"tslib":"^1.9.3","@material/dom":"7.0.0-canary.5cea2610f.0","@material/rtl":"7.0.0-canary.5cea2610f.0","@material/base":"7.0.0-canary.5cea2610f.0","@material/theme":"7.0.0-canary.5cea2610f.0","@material/animation":"7.0.0-canary.5cea2610f.0","@material/typography":"7.0.0-canary.5cea2610f.0","@material/feature-targeting":"7.0.0-canary.5cea2610f.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_7.0.0-canary.5cea2610f.0_1590082153430_0.8773777799007318","host":"s3://npm-registry-packages"}},"7.0.0-canary.cf7747ef7.0":{"name":"@material/slider","version":"7.0.0-canary.cf7747ef7.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@7.0.0-canary.cf7747ef7.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"86dde18245b01ad754cf8ca09ca35b1bb3585ac4","tarball":"https://registry.npmjs.org/@material/slider/-/slider-7.0.0-canary.cf7747ef7.0.tgz","fileCount":36,"integrity":"sha512-2YGDTUcEzLn3tAbnnFpuiHgkzgwyxpzhYTln9su9DPa4navcAcwHMaTEYVNNj3x+JTb8knVlnYgbQd8e2cSQ1A==","signatures":[{"sig":"MEUCIEvofQIRGkOWmK6D72smJxtmx6gmlVIgccQCRwkbzqXvAiEApeiVYh1/lwdJNB7aIsW8Dm8CemXkRiKeORbOIOdicGE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":378885,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJexrqBCRA9TVsSAnZWagAA4b8P+wVR+GEXQxyaZ8CbU2uz\nxfeSnPqzcNQ8aHaN0o1p67KgJIPr1PcGTSSW94ZS9TmKtIwWFUh374IfKXxl\nkmZCoEz5RZQLk78xDtpvJmpPJ2LPxxn1QTVtCFzlcZaC3QgYUhtiqs13Jj8e\ne0nLewqHZI1pv6LdDbd/A3TJ5R+bzFzW4gHYkrjsaZxp/BLY2wQladH087xw\nLg3WI7hvbRXJm2OeSZ1chNBW0rfTAKjLyMsLTsRvbU/g0B7OeZUNt+jWjNeq\nwIgJ/DEd9stHNsHn/qZ7130eOiqY/RnmQaE9hsyIctKUVP/PXgbg5kdw+SRU\nHssZsr+OqeX369tEK1H7OakByBlc5vLuZuQFwxwgjQG1Wv2mkH6v4qLp82iz\nqZ9D6CMBYSmj/HgPTg5hJy5wyBPYXF7NFtO9UIxR1KnlU+ePK7R4VjEAM+2R\nCOlJcPOTm5xo8CIoL7wM1egMdVw3ijz15i+UOwIuA7I9JPr1FFTRv6DPNUCo\nyoLHac2Td8yR1OhqyQzSvITTfPkrwTOkDiMlcZJOkQK7qzUFL7k8puMYu7Vs\nzuj8eBU0Y5nR0OZKJvB1TVS/gEx3IeuPxxQoUKIFF3Ldwv2gLU++N7OyP8Z4\nG+KQxfJMI9HGlm14oaxXEbz8ZxZ+ZkI1570oEMd8UydalaUKsPPCbZ5W6emg\nLdlG\r\n=jfI5\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"12d3ae46d64646ae020ede8b9ce88abc7efd384f","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.20.1","dependencies":{"tslib":"^1.9.3","@material/dom":"7.0.0-canary.cf7747ef7.0","@material/rtl":"7.0.0-canary.cf7747ef7.0","@material/base":"7.0.0-canary.cf7747ef7.0","@material/theme":"7.0.0-canary.cf7747ef7.0","@material/animation":"7.0.0-canary.cf7747ef7.0","@material/typography":"7.0.0-canary.cf7747ef7.0","@material/feature-targeting":"7.0.0-canary.cf7747ef7.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_7.0.0-canary.cf7747ef7.0_1590082176992_0.14152066594281143","host":"s3://npm-registry-packages"}},"7.0.0-canary.862d0d7bc.0":{"name":"@material/slider","version":"7.0.0-canary.862d0d7bc.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@7.0.0-canary.862d0d7bc.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"5f2cc226cf579de5d82cd85d6b34296ecd4fa38f","tarball":"https://registry.npmjs.org/@material/slider/-/slider-7.0.0-canary.862d0d7bc.0.tgz","fileCount":36,"integrity":"sha512-nixEPrlXaxpBLC+braRvJhqWuxHMixk+XSiPgdjFHKTwTjwseTUOfJLjd2IxqPqYVbTW4N2UzXPTzkFaWNGJiA==","signatures":[{"sig":"MEUCIA3kOnz1iGdBg7or135CVvWBlzDMRzqJrtLcuwSJa5+ZAiEA2+T6CIY3arFwEkqrDb8T+B+MUvjb0ijpqr7bAOgGzW4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":378885,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJexrsiCRA9TVsSAnZWagAA4SIQAItUD2jZzms6wDSCZspc\nV79zolr5Iqzfl+3vYkUcOTXUozhhYo383wHAafYmmtMq4XtCw+2vQsOk/VTc\nk1SdTiOesPv9X0j1eDEdvja3vxnPP/H21o8q57fCpIlsYqwvmky5t9Cw5dsi\nRodY7LIxNHynrUuqgEPxz05uHLLG80WtYH9B5Xq4Ly2haEQfvqZA79mX/K27\n3dcVDSW+4aGQiGrjUhwwmAT43Fxmtkdbs0mh5CLv7C8t29hBAmeGJWKqU1DO\nJqnvYozGcp8PJYEziRNhavKUKyU75BdAqstceZOIRkZcSj5s12vqCAW7lwxb\n7EnMdGOssqT7Ngn58XNwzXyMT6/a/rWvnOqHNDhMWGQtDYu1FqaDXauH6XCj\ntdDM3yXM7PpRsjQTFzHr8TctK+e0WrJLqtD9uzGGbVWanEczfQ+WQ9juwSY1\nnV6IPsrfH6k9N3YzC/PwZLMbFRlKf6+dL0d92Kn4dA8RJEZA/ugRm7kWK76Z\njSBLRR3cNB7ZquTNpqmO643GbsX26lyGxSbTw5PwbgtRuRO0cjKg5NXjQPxC\n+HQvnthHypQJ9wFdAEncHV0UYHwfRtd1CYk1nZ2O2h8MXv+1Bm2Hr6+rshFs\n5LC6M/JoKDs3Uyuygx6sY9KUndqhv7Ax9GfQCBpehekQJ69a6b46e/rLgoNO\nroIg\r\n=VSQs\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"534ebaefbbb3a8abf3be3e2e13c05f86a5461127","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.20.1","dependencies":{"tslib":"^1.9.3","@material/dom":"7.0.0-canary.862d0d7bc.0","@material/rtl":"7.0.0-canary.862d0d7bc.0","@material/base":"7.0.0-canary.862d0d7bc.0","@material/theme":"7.0.0-canary.862d0d7bc.0","@material/animation":"7.0.0-canary.862d0d7bc.0","@material/typography":"7.0.0-canary.862d0d7bc.0","@material/feature-targeting":"7.0.0-canary.862d0d7bc.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_7.0.0-canary.862d0d7bc.0_1590082337517_0.27947765752493514","host":"s3://npm-registry-packages"}},"7.0.0-canary.0008c8a91.0":{"name":"@material/slider","version":"7.0.0-canary.0008c8a91.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@7.0.0-canary.0008c8a91.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"392fa288624c677fa09ad80be21a52f3e6b56f23","tarball":"https://registry.npmjs.org/@material/slider/-/slider-7.0.0-canary.0008c8a91.0.tgz","fileCount":36,"integrity":"sha512-FuXWcVmnmPu52Xd6kg0r8goLW6ZHyroAH2Ooo0oyxzPLSgm8m04mp3XPl4JB/D5h8ipbMWDsXzOMDqm2xdBpwA==","signatures":[{"sig":"MEYCIQC31xiG9U3iMYT+w1FRBbh+syjCNr4EbM8NMhgINyRNPwIhAIXfdnsc74szHhPisqAn+9fSI/v61UV2hfuMFG9aZjbt","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":378885,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJexteQCRA9TVsSAnZWagAA5xkP/09tfVcbcoBqfI6k6i7f\n5SYZm62d6twT4ZL/yWjLB7cUDIlfqdwl/EecuOCqrdqQDvUCXzVx0M25EPXf\nTRw28QpXfXE8D2AaCj7EuRP9tQmwXE5WUS+BSLBHPIkma0+2n0lK0fhcmNrq\nt8nSDjIaY4GcVHj7Slo5y3vQfaPJzjuUbUzoKJxy5Qoyz6nSjgzpx84zAOz6\nrZ0YNTtoKgS/3NkD029aeDVY4OzlHpFT+0XMwUz98gtx2TG47IxPUg797ZXh\nzAe+HfRKhGkerO2NIXZqcPtB9Gcc7Y/1BXtj3jHKkjcGquVo0HbdbF4lOhlB\nMUAYo5PL3ogLa5avRRTzqJrkDXn1JMlbjLcDvLEFnXSp5+UUEfnLjPuLuj4C\ndrBJHz4vdHmRhx+GCNhc62tPGLkkSk89M7OWGIgLAs4AT6u+u4qeo55hE0E/\nCvaTrEhHAwoSvEJlCe6UDUs0IyFp1oFctX626r3yFPdBlpTJqG6s1NKkx7Oj\nX/qmPku28ZvunBwyKBuX1Mx7BsVXrV+bzmnyYh9vs0LjyWKybjfa7Yc5Ktzq\nWHuXWx9WF8o2bhXkByK5RP+NNPWswv/wfhjZRt98iEJp1Wr8pXUOLx1hRsnR\nJU0wRT6Jehvm9ZR3qiVYt0XY6OL1eUeVK8HybxkUjTJiV7ye1/NsRravoWiZ\nJ4bv\r\n=DPlZ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"5bafcd3cd9f6f60ca813af30e2b0a8974de09ec8","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.20.1","dependencies":{"tslib":"^1.9.3","@material/dom":"7.0.0-canary.0008c8a91.0","@material/rtl":"7.0.0-canary.0008c8a91.0","@material/base":"7.0.0-canary.0008c8a91.0","@material/theme":"7.0.0-canary.0008c8a91.0","@material/animation":"7.0.0-canary.0008c8a91.0","@material/typography":"7.0.0-canary.0008c8a91.0","@material/feature-targeting":"7.0.0-canary.0008c8a91.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_7.0.0-canary.0008c8a91.0_1590089616242_0.21822027276451794","host":"s3://npm-registry-packages"}},"7.0.0-canary.541638fa2.0":{"name":"@material/slider","version":"7.0.0-canary.541638fa2.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@7.0.0-canary.541638fa2.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"f7674e6e43cbcc5c7fb9482655f1852f51f65a9a","tarball":"https://registry.npmjs.org/@material/slider/-/slider-7.0.0-canary.541638fa2.0.tgz","fileCount":36,"integrity":"sha512-8m904jTcPRgKGUj9sJ4/1oVY1x7oSeTaflDgqn0mqdQ+OOwTq/FflnjKqGKirunvSaNujEzOAZc20DruXXwZwQ==","signatures":[{"sig":"MEUCIQDLjTmnSrn73MGEjcH3BMTYCBG4cp6IRAa7cbDiXAAmoQIgRAMF6DiA68wHPmWYIxMeb8NeRRoL1G1ypAdKdQvASUw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":378885,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJextsSCRA9TVsSAnZWagAAXtkP/jhfsmyQZLj2J4IP/eNF\nD+BpYIrKkpjp4RbDFb3jrvRBeRCV+uh8OLSbigzwQ5AEueDBEB1W+dPG4scR\niXcSPYJzrxW6zZg/ixUuOwxCxS0C56unHDI0GbP4BHEM2R45T2jOdJ+1MTqy\n6TRJ+uGv4dEsE1mluBPWStKIvjRbZ4oY/Y7QEpTSAj5At6YGXEC4saK6ju4Z\nZWFwKhz93UPUhGguU0scUUtkQ30TnFbeHrZ0GKKNQs7b90HTfwL6f9/SI5Mz\nHqi/ss9uo9rndNt6lRTXZDDww5ltpZSUjEpA1hBDZVvYvmT8iMaQo8Hvq0Kc\nvuUF8p4dEGVJsToV6cPIV9qCN8M2JYuMY/j6yYzXVwC/HZY7rSaVfS7/bS/g\nm6SqFStiNPlIy0ZUtCrzg6gsqvvzSgboX7zFRWP+IeBEMsIaQLo1NAu53Wrc\nRGO3vHgT9jG7o8kSyVXqA1hB29Bzu5syoUaf8bu00rLBqi2R2IOLPWcvDJwe\nbHm16Yn/Kg+RrViDxBmWc58KP1Y75Qd3YTh+xQnsWzALkn+FmfY2EII71qgx\nQjnp/GkNMPVDqi32vMvMdyXZv9uc10kkum8n+vFZB7qf4koZgV/U2IrXMqk9\nA1L9q6mHXdFaFHxpzXOr3PjtuBVi38J6lA26OKDI9QVpUS6jowtVstvQON5k\nDtNx\r\n=7kbO\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"e9634a8258477402629947671e06d007833e14f2","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.20.1","dependencies":{"tslib":"^1.9.3","@material/dom":"7.0.0-canary.541638fa2.0","@material/rtl":"7.0.0-canary.541638fa2.0","@material/base":"7.0.0-canary.541638fa2.0","@material/theme":"7.0.0-canary.541638fa2.0","@material/animation":"7.0.0-canary.541638fa2.0","@material/typography":"7.0.0-canary.541638fa2.0","@material/feature-targeting":"7.0.0-canary.541638fa2.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_7.0.0-canary.541638fa2.0_1590090514361_0.3484084684311046","host":"s3://npm-registry-packages"}},"7.0.0-canary.6167cd075.0":{"name":"@material/slider","version":"7.0.0-canary.6167cd075.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@7.0.0-canary.6167cd075.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"dfcf7f7a997121b9b6fc62153cbc29dd00cc4d78","tarball":"https://registry.npmjs.org/@material/slider/-/slider-7.0.0-canary.6167cd075.0.tgz","fileCount":36,"integrity":"sha512-IhYd9p36lAhleJYcEOajpHcEGZ6NLSOd0NBvoz/WoLdCQ6Bnfn/x6VslFye8zCaus4pPDSzjMqqzACvmOKU7sg==","signatures":[{"sig":"MEUCIQDxHKNjvwHrReYR9nmEMh30IJfSzNeJSPTkPxLGhX2eegIgFunJz6+R9yb7GhbIDHryRgANjWtsUmUatdXP6T5pyyQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":378885,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJexuLOCRA9TVsSAnZWagAAE6AP/1ZhUqHqfxPJLjN9euMe\np+qcy5SQTNpyuNqGiB11SZrRLC4Lbciuk8MlnkVQ/d45WFA8U+KuNsxbODmc\nfx8NvE18vbrYRVUpAPMJnauqRcKKg+vqPSlpC2ZqwAMn0lUjCLh6qadwBai1\nEpKdVZvnnqnOwFP6jLA3rKHPTS+NSEW7XFKSawjXoU4m/6slM25meaGL4qpJ\nb/Ev9eVFfxzf+AnbSANUbskZ+Bs+9cx4mVZJkDumtDJyOJNnwh5NgpdoIhK4\nbTz1OGbwgc2dwWzd/ZVFTx3iEAu1pL8R9UsWds92YzRA4cVyybozkqG490y7\nj6S0c/Cf8m/gxX3M1vLYngVPJ51VSJc/Ojg/nYjOg/lHuhzNawRWuhK1ie6V\n6qnmTlVYiIqEjMutSPLtNW1rlVmpTYe17zeiHQvJIF1ZtsPkqv+DpkTfe+Pf\n7A4fwkWOD2hHfhrcmA51JEPNy2Kf38YSQHMOFZs4mnp1jLDMQlMFzDApkujt\nkVyHmoP9ff8FgID1HS3Rv+5PKvsnBWVAvW/GWtmnVDbohNaB4mqgjmUVw46f\n9O6r+jvTvaXQ4tgJaINC3x+ym0SIXcM1CUvs+JdgiteZKP+1dIivZgSbx1OB\nwqoPz6RwvI2dbTiDO9u6RwZSzVqEmP6TPYQTkHhSKoAMVqHxPkEVTeJOkkYL\noLHq\r\n=f05L\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"c86a924ab304fc32e4e6840c7c8962330b6b0fcd","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.20.1","dependencies":{"tslib":"^1.9.3","@material/dom":"7.0.0-canary.6167cd075.0","@material/rtl":"7.0.0-canary.6167cd075.0","@material/base":"7.0.0-canary.6167cd075.0","@material/theme":"7.0.0-canary.6167cd075.0","@material/animation":"7.0.0-canary.6167cd075.0","@material/typography":"7.0.0-canary.6167cd075.0","@material/feature-targeting":"7.0.0-canary.6167cd075.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_7.0.0-canary.6167cd075.0_1590092493884_0.20458909648029544","host":"s3://npm-registry-packages"}},"7.0.0-canary.863ac1b0f.0":{"name":"@material/slider","version":"7.0.0-canary.863ac1b0f.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@7.0.0-canary.863ac1b0f.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"853a58473391f6d4802fdb0b1f94bd01e159368b","tarball":"https://registry.npmjs.org/@material/slider/-/slider-7.0.0-canary.863ac1b0f.0.tgz","fileCount":36,"integrity":"sha512-EZFQDI6YYJBaHISMxiteg8G1mGtvD4evQAS5/skW0qvCXS7SnD4EQaa3gSjWcuqYiROpPFzNl9LT24/POgIq/Q==","signatures":[{"sig":"MEUCIQC1rg0GGkPayyPRMLGtBrAPOkUfU01bsRpE1i8fk+ASuAIgbBRe55ST5pZX846TAZvwBPfSlgmuuGtUQQpWTKQjOD4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":378885,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJexuvNCRA9TVsSAnZWagAAGYsP/iUIX+ydg1shp8H9pNvd\nLnwnzU/RHUfIfa3CF9PLNJi/cT0ZZN83XqDCoOtndjRjtlWbzY0kCecB9qqy\nC+z9Yp9qyIgbyCueNOQ8WMYevEoIDYejcN2XnanKIQXsvv9ADa1sM4BfPqAb\nYboff+0frFEVXvakzqEyhgGJ6mpUusNpXgN5et0anO/hQ1gy4JKOYyf6mXDn\nRWWr239cNo8+A9SoxSoopKwu91AELAdhUw9K5JjOkExXq9R09zobl8uakCy4\nsn99tNw8BXxYEUE/gisCD8geqmClD4HUzCD0im5KVj6kBMmgyA8qbsnZ+zGs\nV/A++hBlNA9T//0/If4Yf/UyVVj1R4vO+eEuke2zDBK+APgLlH+0fArJ0Odq\nLKjVvGoqKGrKL9G11bbutH1AOrKQ9c6hjZ32Svp1hh5WQcriXnJIuwCadsIG\nA1spcnXbmW/Lg4kQCQot11M3WxfrmYUP7/+hdG2U+0WAkVBDsCAYR9kdiwdL\nep2o+5C9/+o1rZsWbJ7ZTpYMpNp7+x9zSNOg9MeymFtu3bQcm4KJoYk4qtfd\neT2lrvROGvkF/k6rbGyUEhPzISxzwwF5SdfszzN5vN/jdj18KW6qLBSDD5ki\nyy07gqxuLgr0NT/foFlP7YPdZY7FQgGx6kZ31AJ3bosVUfh1YaMG2tNArigY\nju7c\r\n=D+nr\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"c1e7026720dc12f1bd465dc892c8718b429563b6","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.20.1","dependencies":{"tslib":"^1.9.3","@material/dom":"7.0.0-canary.863ac1b0f.0","@material/rtl":"7.0.0-canary.863ac1b0f.0","@material/base":"7.0.0-canary.863ac1b0f.0","@material/theme":"7.0.0-canary.863ac1b0f.0","@material/animation":"7.0.0-canary.863ac1b0f.0","@material/typography":"7.0.0-canary.863ac1b0f.0","@material/feature-targeting":"7.0.0-canary.863ac1b0f.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_7.0.0-canary.863ac1b0f.0_1590094796573_0.8735697074918845","host":"s3://npm-registry-packages"}},"7.0.0-canary.d30a214ac.0":{"name":"@material/slider","version":"7.0.0-canary.d30a214ac.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@7.0.0-canary.d30a214ac.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"da3a271fc7ce77df7a4dc53ccd426635bef91c81","tarball":"https://registry.npmjs.org/@material/slider/-/slider-7.0.0-canary.d30a214ac.0.tgz","fileCount":36,"integrity":"sha512-28kf2vFOYHUm7bp0mkEuOFndeuo3lSBy/CmKfYvn12FHLk1JwGVRrxM5gBcMJg66L3/UW3Yk+t3HtgWC9jGfoA==","signatures":[{"sig":"MEQCIBiRHQC9I2dN1wpqLjQ6PW6TM1nsZATvuJkUquZLVVRZAiBVLpGg5908YiTMzsdAOT6cqkb0XY/XZ1RRtuNcL+9W6Q==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":378885,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJexuzeCRA9TVsSAnZWagAAzckP/2GAEPH686p4AhN39Key\nQ2SshKiLF73d27lQV2RxAjpQO3dR6yQuv3gTwpha1BiUngk7TXIT7/L8yxng\niijKEcjcADDlu91X+1la3NZBVeT8okEarVEwSxAkNj9ZHQ3USpo9k4Bo8SLo\n64JmxS9+A4NPRTv4LJuS1RS3+8UpaUrFWCkkDdUyPhdJej+5Pa1WmCpZcaTS\nk2GnI6Kbs0fI9ew3QZk5fPi3XtiDVfBKsFMvgvFXvHpRrH2NbqkmoyZv/Clx\n3IA4mbY1qL0RxSRtt/vnFkx58xTa2IjnQaG3jff1+Iovmavn4GCKw5jJTg8q\n2MuQXmWOobrdvkAnHAewnXjyWy0wduVj1q+NRKGUR26Io93THrOaPybL9OkE\n2uXsGtrLFVucRJrwLRMd+b0h0HPlOwP/suCsYJXqTvXW3Z8A8O30UhQfkXDi\nrf/W07YpmulBRK9rVtQhsW+C5pwvRv4Miooc9jY6N+A2qTvI9wefx3BNFQlI\nV+KVY3qC5aKsnMa3QXsICUuslxbbUWhjhM2IQCaROlwo6pqIvjV9pMysYNcz\nvuSNFYUc76HZ4i6LZoxS0hYrCPKINDvtYV8+EJj8+ZNvIUgZPbWBd/G1fisg\nO72N8OBxOrQ3xssPMHipuJ2UBL3GasiOjqyhlkEpX20LbsOdQUQdaXkpO35B\nyoj/\r\n=m61J\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"635c0e7c484f851d2ecb4be825abc36357ffc685","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.20.1","dependencies":{"tslib":"^1.9.3","@material/dom":"7.0.0-canary.d30a214ac.0","@material/rtl":"7.0.0-canary.d30a214ac.0","@material/base":"7.0.0-canary.d30a214ac.0","@material/theme":"7.0.0-canary.d30a214ac.0","@material/animation":"7.0.0-canary.d30a214ac.0","@material/typography":"7.0.0-canary.d30a214ac.0","@material/feature-targeting":"7.0.0-canary.d30a214ac.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_7.0.0-canary.d30a214ac.0_1590095070541_0.44352333064227856","host":"s3://npm-registry-packages"}},"7.0.0-canary.62abbc8d7.0":{"name":"@material/slider","version":"7.0.0-canary.62abbc8d7.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@7.0.0-canary.62abbc8d7.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"f3666b747026a040bb170e3bf4d75a1d7fff63f0","tarball":"https://registry.npmjs.org/@material/slider/-/slider-7.0.0-canary.62abbc8d7.0.tgz","fileCount":36,"integrity":"sha512-phRhW0jT7Qnkh+LgMKpHxF8mK3rXWwv15X81RVGY+/Ub0igqocKsKFhEm+aLygV7WDRA7GyvnPgoCR2FpIb4cw==","signatures":[{"sig":"MEUCIB8fJLQCYoHw6cq+CWxb6M1UEysG/98noqT5cqgSa7NIAiEAwydbDX8EABNTGEI06y5SslYili8iebtI69X9/Axgrj0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":378885,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJexvKmCRA9TVsSAnZWagAAyrcP/2U7Uq6abeUr9KE8+DZY\nGv00mReNcjKys1KgQYvW/WQqdTxHFco6ddUKa8zzzr5g8Ny85MQhWu39WsSE\nzjVe/5Bej0JxhY/zXIdPJbsPTQVTHkLBm6tr2oZnc1yDMC/RYSjQZ1AKzDOT\nrm4sv71JHl326LPXZgb1lNuC+QITKR/adRkImMG7c4iV55FmzqnbW/+NXEIy\nFgTVveiHthotZ+g/dqLqM75MmFVL38zrSDQ1jWP/GMIvBneK5irRPa8gw9Xo\njn5RjOVwsxtAM7RxUou+2JevmMu1EnCL5AL+cNYeHmIMeBxTltgM50n95rXr\n1NZp/Fup+PSpmVpghKDckFwsNyDbNoHZkPLsRTLDRILUcT08HXL9W4pdUGwm\nBulrJzLV3RZXwYTpupKRykFQwVyfEjASiZ/iaGAbPwl1EMyyCNdXoARte6Cu\ntD1PnStgIG8XVNQETXSzr5YR7k0QdcDUtC/5FwkQVBvERjGA3oCqPAZaKZPZ\nGh/ycKnM/iHm4kWFkrIp2dWEOkDbgax4EX0BUxmf8HAa8W7YDtJvkRBx05Af\nyhTE/ZecxYUBCvF0oSS5frcd3E5RtMkv17cXUifgNFU8fhRLXSAmyxZdk5BF\nb0ZVHy4iX5upWe9I5WdPKvJ4Fsmi7/0qmXvNmUjWpj+zrxyhqOwfpE1c4KOP\nTYeK\r\n=eaZM\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"6758c29e4b065e2aa9cf633b0838c4ebefb9f54c","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.20.1","dependencies":{"tslib":"^1.9.3","@material/dom":"7.0.0-canary.62abbc8d7.0","@material/rtl":"7.0.0-canary.62abbc8d7.0","@material/base":"7.0.0-canary.62abbc8d7.0","@material/theme":"7.0.0-canary.62abbc8d7.0","@material/animation":"7.0.0-canary.62abbc8d7.0","@material/typography":"7.0.0-canary.62abbc8d7.0","@material/feature-targeting":"7.0.0-canary.62abbc8d7.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_7.0.0-canary.62abbc8d7.0_1590096550452_0.40947906155133906","host":"s3://npm-registry-packages"}},"7.0.0-canary.49bf31d5c.0":{"name":"@material/slider","version":"7.0.0-canary.49bf31d5c.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@7.0.0-canary.49bf31d5c.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"49d0234608521ff6d6d4dcef53f1cf9993c07e14","tarball":"https://registry.npmjs.org/@material/slider/-/slider-7.0.0-canary.49bf31d5c.0.tgz","fileCount":36,"integrity":"sha512-gkTSsQQPLrZGFX3iF+V4k2XdzWGzuforwz7PqnBckT0IkLQ87qy00i1lWU6Wzox9+aVnVTDO02v3IrIep6eJ7g==","signatures":[{"sig":"MEQCICo0DKa0DsEUjF/ussfzEFyf7vQNPLQ14J2IOu7Jh/1FAiA1nWGvJn2qH5bZZGEgmS57OFf3YkuMY74bER3UvHtAPg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":378885,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJexvNuCRA9TVsSAnZWagAAlUoQAI05AIpKH9D4wqCUye/r\nBV/lhB2EjAATN12W/iUWmJ/L6nQ5j0OpUMhPBvQFxNL858qxPnIGhhpOMLJf\nVtFXT8Bj4YtNFlqIeby8pcsvaDQ9FK0HdHRqoH/Gy9D84zprC3osvRPDZUzU\n4pEWMw+Xw1ZFZQm5fKb6PeTurS03Svpot3hvOyXdDLbU/HbaThIkPAPEWrb9\nScsdW5XuX5+TDbsWXdWGvufbUfAyd+9VkfOZBKsXP2HQ0DF6cxxLhmze53jz\nMlE2fIpy92VQ325uxFwH6f8ONq2wIXq2//VKtgxuyDZT71YeLgxSoiQi4zCP\nxXAzhlb9goRc1mpZaAi0R3Yl5oNGv/7tov61trwMaDfOxYtPGNi2mY/8tdqm\nDFNEO+8wg2lNL7z9Gxm0R7NF7lCog0hEqeHWNxRqeuz6ISw8L6dUERPBuIgI\nnjLqwJNp61koaXQMngd+xNpf5Fcc1TORBaOV9I9Eoa8rYl+j7xW3prsS8S/Y\nguuApfxh85SePMpALbYEXOGQOCpK+nI27f2IABuX8WrGm0pQHNFK7RfrA1sX\njCAyYmhvdYTMskU+6/h6NAYBhCXhShCfyZbCTV0W1Tgt9YYKBaK1lvvjbcnM\nby9zNedkpu12hKFs2izTZY5mwZfejh5aYK9b8xcpTtWAirPaiLkYwQfngW8h\nmumF\r\n=MSuB\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"01cd7b0082a754dfb042df35ec48efcd4aa4c52c","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.20.1","dependencies":{"tslib":"^1.9.3","@material/dom":"7.0.0-canary.49bf31d5c.0","@material/rtl":"7.0.0-canary.49bf31d5c.0","@material/base":"7.0.0-canary.49bf31d5c.0","@material/theme":"7.0.0-canary.49bf31d5c.0","@material/animation":"7.0.0-canary.49bf31d5c.0","@material/typography":"7.0.0-canary.49bf31d5c.0","@material/feature-targeting":"7.0.0-canary.49bf31d5c.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_7.0.0-canary.49bf31d5c.0_1590096750313_0.43450844281591894","host":"s3://npm-registry-packages"}},"7.0.0-canary.8e17857d0.0":{"name":"@material/slider","version":"7.0.0-canary.8e17857d0.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@7.0.0-canary.8e17857d0.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"65a73e4274397a45fbd02612c56c27300bfc9a4b","tarball":"https://registry.npmjs.org/@material/slider/-/slider-7.0.0-canary.8e17857d0.0.tgz","fileCount":36,"integrity":"sha512-eiFVKEhl9u3ieC5wUcO8zujlmpIPKRON42jBqQsUUJrUFTWzcN77RIM9QaFNvubDSBHNL9a29/pYwO+oMRUU8g==","signatures":[{"sig":"MEUCICFU2O3HrpwDV3Q2mUkAUfUVlEn5xbLDAPD+wxI4xkbYAiEA3kXqfmzc4sSpBU9IVCgR6aG44GM+HDRtYfG96bvGTXk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":378885,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJexvOmCRA9TVsSAnZWagAAC8gQAI3GcbdNNaqJIxhJ0GR3\n/9DQ4O3Kciz64oEUlfkBzHUIy6/k7bnzj9nL0mu+o/CZG569psxy4wTj4LLz\nTKPKMK0q2+IW3uWAFQl9014N1UAK9oxRrof7H5lf40vypq0kw0fksizirYrc\n1pMtuQxKKxCowlkNQbdbglyc7YKe3vDnNY9MyD2q+Hidcpych8zfvJh+s09k\nFO6cZx09Vr300jRRorjt3EcMVMwaxA9ASz983a8CHYNhwjtCCht67SE/1YNv\nrrK32gN4DclRtPMuQo2Y5thCgP6uRhnC7flxy194BWhD4BuVX/waGbr/axGK\neOKAP6qrYcS02T61+57IB5olEVcOJNaj096+chNSnVsU/gym7YctBRohcPNJ\nbLuKIdR88PJoIj/EL7FF6dEkubiDbJEr2jPsDlFXHGLlvM7WsvUo7QA//chd\nS3tkyS4sfXPogqMfueyW7CMcBUGX0NHKqbq09MTgsFFHsoxvkPMrsM+5Tave\ndJbPofrsslxVaOnhIyuNxs/qNUgEpoSBUBxmRBgRuzpZ2wck2nXEv06/G5RQ\nv1PlJQo6JNGQIWYKWC6b3/KYz3wtjdrpV/RCG1fiOy0YsFZ/NctZp85Hr3Ho\no9EVKgxRMVRf3pV0iw6pl6tSzUR/IYfmY3qltyaNpfzcCM8W4VHuGDHVze+Y\nsDg2\r\n=UcmR\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"9b03d700366fd287f2ec053c5ef4ccf802ac600f","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.20.1","dependencies":{"tslib":"^1.9.3","@material/dom":"7.0.0-canary.8e17857d0.0","@material/rtl":"7.0.0-canary.8e17857d0.0","@material/base":"7.0.0-canary.8e17857d0.0","@material/theme":"7.0.0-canary.8e17857d0.0","@material/animation":"7.0.0-canary.8e17857d0.0","@material/typography":"7.0.0-canary.8e17857d0.0","@material/feature-targeting":"7.0.0-canary.8e17857d0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_7.0.0-canary.8e17857d0.0_1590096805962_0.5802861342266235","host":"s3://npm-registry-packages"}},"7.0.0-canary.c113fc942.0":{"name":"@material/slider","version":"7.0.0-canary.c113fc942.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@7.0.0-canary.c113fc942.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"b4b80412c6c31be0ae5a498f0ba74c0211db5e29","tarball":"https://registry.npmjs.org/@material/slider/-/slider-7.0.0-canary.c113fc942.0.tgz","fileCount":36,"integrity":"sha512-XhLWDvZnkqPsADeb2qRsNu4MN4+hs+6gLjevJiKGeFu9HIVlQY8cMZR6igmHiZeBlyRjvXGG2YbmaSjMxmW6rQ==","signatures":[{"sig":"MEUCIBPRZjBBMukqJuDz9BIAFKloxjeN7fo1GOKMdVoR9ldcAiEA9YPPRTwJ+x2gi57DikzHGyPhBAGorA0vQn56atUMp3k=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":378885,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJexwTYCRA9TVsSAnZWagAArGoQAJgLW6WMWJjgGZ0Sb0co\n3zy5PfF8X32IXK7XfrFBGm4jwIWKGY8EChBn9fBGemKvVSaO/+OZT3PyBMXm\nPjlP75sPnLw4XP9vxIv7u3N00n63eBYL7tMg/FlYeHAtGhekF6HucDWDuh9h\niB+9pw7OF93dI5RUB7sU0RibJs2CwkXeKhyXjYYPSSk2WUTT6HD9puMnGZUY\nDjPyvA/0kRbt9Y5nDwUIV7mf9r1wGi/QKgiMqcA5dYfLvQAkn7BmR8TvtHNw\nnWLvk4I5JJSvlKJ0nV3lNiraXmrkg7+x45lHAJLk2gSkxUEa58KfNgHOXnpy\nPghxiGA0JDzyiyc81HxPGtpuLsCZWbJrVN21QdQMmK1r4GwndCeBv+TND3hC\nR+ayJ+K5TdLMFROWLa2OxgXorVwTSm/z8+w//sdTDixv9kyr6bqugFcQFzqn\n3T0uw68lFEokCh83gePPY+glI7XfFKRFlTxW5P3Ljt/pxSY0MD8EzZeJvm1v\nFnInl1NyAs6fBE7vRxmKBpNvN1++IJVJG9ouA2zxkhxfv42IBmIXSxZkXxe4\nkMUJWxPAGxhV1FRS5N0zGnLTAJcykI0AtNmBKWUNrKx/UIbdO/+DsJSQnpWc\nW5CqHn0AvEkci8yP2ZQQp/bOuYKhERQDdP2AW+QaNLMxWJTq9/rIxfTDnKG0\nHjS9\r\n=DKKL\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"49605d78c19f78dc1b28a35457efd8dd808621e4","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.20.1","dependencies":{"tslib":"^1.9.3","@material/dom":"7.0.0-canary.c113fc942.0","@material/rtl":"7.0.0-canary.c113fc942.0","@material/base":"7.0.0-canary.c113fc942.0","@material/theme":"7.0.0-canary.c113fc942.0","@material/animation":"7.0.0-canary.c113fc942.0","@material/typography":"7.0.0-canary.c113fc942.0","@material/feature-targeting":"7.0.0-canary.c113fc942.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_7.0.0-canary.c113fc942.0_1590101207951_0.6971253417930845","host":"s3://npm-registry-packages"}},"7.0.0-canary.912d9021d.0":{"name":"@material/slider","version":"7.0.0-canary.912d9021d.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@7.0.0-canary.912d9021d.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"9c92b1b4271ac8c485f3e1a55ae5ef3a41e9288a","tarball":"https://registry.npmjs.org/@material/slider/-/slider-7.0.0-canary.912d9021d.0.tgz","fileCount":36,"integrity":"sha512-i9CFwBflkz3rx+A4+W8DmzudZ/BBXCqma6aoRT/QnjLMTNwl5jQqURSrvw6ysWF89kT3DcsinDxTKUUWVWklzg==","signatures":[{"sig":"MEQCIA3PYkycR7JpswksYAvo/NCzalkNhDXOO49+HbrYodl6AiA98WvI8o0Tcksj1ng5okArI2S1YvbNsUjsgPdlxAJcog==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":378885,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJezWPgCRA9TVsSAnZWagAAu0UP/iFwLr084cYDF6DWZ7hN\nWDvRRh9/Zqydy/qGluH63WZrOvWAe8ygvZdMfLpXNP3j4tzFnvOYdorcQqzR\nVPYu9rKWd5qL7ltyB7r9h8cS390q7tQoOLxsnhNhRwyplJ2uotVfiMGAG1mT\n27yK4sjhccC3wsLu+TEY/Hq2P3PdGdtaPHt9uiqCo7BoYNf+9YGJYhkiRMJB\nuMMopCXWh9VzduCmFC9VQTrEeFjpMZk4x6ReuG7IDXAlvcpW1KSNPUcZYX9K\nTsOCKG4dJJhAOf44ubFO5nAgAfDa+aPUyO3Oyb2hnRMDQaQfIxxmnfLs7m1x\ndzHRmPZAs3e1nz+xN+V54x8MWvMXQ4zdAjeMpKabDeDypiPiQOL50cjflURk\ntGD6AzRHWGrQzH/p2WpwhPUN8ARm792WbvR4p3loAh90WW0wzU9aBFx2/bTp\nUyN+fjehocFWHg/6YjQq9CFhR6W6fT6OI2Tpr8FqAJ6+179ZiV5SraKNJ6xE\n3RFzZtq+xtsskCM3DtR/jCTefFkjWLBIvuXco3/py6Otj1YTyaxK/9r+ZtpT\ndr1UB4NILA9o5gsvsgnew8hNiqNE9V6kso5u/RK2FEFkchM1itG2Mv9yceWL\nlEeRARd2LvWt5lAE4Qv3aKNusMYXPVvtjPMaD+px7gVp8dyv+pire/Gsb7tk\nwdrU\r\n=BSOw\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"b7080ce5675d8ab69b7f361d040e079511499175","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.20.1","dependencies":{"tslib":"^1.9.3","@material/dom":"7.0.0-canary.912d9021d.0","@material/rtl":"7.0.0-canary.912d9021d.0","@material/base":"7.0.0-canary.912d9021d.0","@material/theme":"7.0.0-canary.912d9021d.0","@material/animation":"7.0.0-canary.912d9021d.0","@material/typography":"7.0.0-canary.912d9021d.0","@material/feature-targeting":"7.0.0-canary.912d9021d.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_7.0.0-canary.912d9021d.0_1590518752143_0.3167906227753623","host":"s3://npm-registry-packages"}},"7.0.0-canary.68a2af131.0":{"name":"@material/slider","version":"7.0.0-canary.68a2af131.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@7.0.0-canary.68a2af131.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"8455b8421bea11ed89ff2709cdafe3f8c6cf9977","tarball":"https://registry.npmjs.org/@material/slider/-/slider-7.0.0-canary.68a2af131.0.tgz","fileCount":36,"integrity":"sha512-2T2EZQzpGEw+PZ2QsMgeDHA04fyRdegq19bES4oYPIC8dGX3knt+KDk+pNejasnvpIsjX1ekOykFyk6Y4OJxGw==","signatures":[{"sig":"MEQCIH6qI1WW6QLzDjSRoQl39uTInKVxQ8SjcnNJOHQ7t/j/AiAV2UoFkHBRn7nnGiREhgHsDa7pX9hY8FgmF/bH5coRBg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":378885,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJezWkTCRA9TVsSAnZWagAA4oYQAICEbjj0+NipJK+iWJ7R\nEkma0jgf16oc2yOPIlJULWpP6Y1katnxwNtLQUOJpgwyOq9e1yCqx0i/I5/I\n1Yh/Khy5HrLcrVRnZgTzE/0VkFrLbECxn+OPmqok3x9Q6YXThCjnYQ5PGfMj\nF9jKfOYpC/ZavqAzxCrN6uYSVC/0BXGR/zN7d2U42xnzMnnigcC9ZsRTO2s6\nVLg8wJl6jbqkKSf0oFZmeNq2EpjhzyaJMKMwgO4wmPieK48CWf7qikpoSzXx\nyFymPm5/pd3O3f7twN7yyCMUH7G2g0bYTN4AYbld0kVkOVOtQ8I6mVziO+vp\nLaNV19nzp29gGVJOXZynuxs87P2W5tZYE5wYf5hVa/jfV1fxr1KKKt0MTeNY\nUu+bQSzCj8BridRCmjy1sUgMWhZwwRSLHGv3xNUI+hKMe0vWue4MobkeKC63\nY8ULUwOcNTgnybOW53KKZgSrf9/1igbEZqXJmMtRoC7Gl/zqMcCzUhqJjx4Y\nqoC8d3eEnL38tGzQH48ZCzoCy5XSqYoDv/oODDD8Ss41KsfMVtQeG1XIL/8H\nAVZtZoEZOCGEPBo3gglBsfT0AOIkmmm/NyjhHm0d7L62CQnXm8fXiVjD2V5a\n/nub7/dxPxo30mLy1HwnDbzqLYiBovXKHbisLTMxUPyuujB0qzitBigYmpAu\neIHY\r\n=44/U\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"9fa697d39bb8f18500434764b1fd608819d2e194","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.20.1","dependencies":{"tslib":"^1.9.3","@material/dom":"7.0.0-canary.68a2af131.0","@material/rtl":"7.0.0-canary.68a2af131.0","@material/base":"7.0.0-canary.68a2af131.0","@material/theme":"7.0.0-canary.68a2af131.0","@material/animation":"7.0.0-canary.68a2af131.0","@material/typography":"7.0.0-canary.68a2af131.0","@material/feature-targeting":"7.0.0-canary.68a2af131.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_7.0.0-canary.68a2af131.0_1590520082492_0.5716283892403464","host":"s3://npm-registry-packages"}},"7.0.0-canary.01de07011.0":{"name":"@material/slider","version":"7.0.0-canary.01de07011.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@7.0.0-canary.01de07011.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"eed28c3c07fa9d20257ae0b7706f6f54275e889a","tarball":"https://registry.npmjs.org/@material/slider/-/slider-7.0.0-canary.01de07011.0.tgz","fileCount":36,"integrity":"sha512-1pb2ha/FDQ2sSofpbbQcePj9Un13b7DQOyDcAyiUfmlDxBnX9CTndpbzRkVJilH7Fwpywpyif3VKdq9MXlDgpg==","signatures":[{"sig":"MEQCICnQMbGv9Vq1FoFhJCfNu/AEHA5Uv9gYPJTeLBBradAHAiAnXXWy+Tl+AtsZTZPeEoCX1lAH8JwTTdHRJOSBpudkow==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":378885,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJezXOdCRA9TVsSAnZWagAATcIP/iMsFdhACIcOtREbFwgb\n0fpbyGeZN9jdJ1HTj278uUT8s/QCM6C5Udu3ToSyEiQtEU6aCEEtNFT4nGRa\nrKMj+SKzErzjOwGcm6v+XOvzqNj57MIb7ZxI4AQdf/Qmo+QLM1D8N8c7lHNn\n3mZjR+0dSr2bxpHyqZiHhqMzyYGya5k2ZJMUp8oXV0mWk63OPdSHWK9V+UAS\nhCk/CBoMGq+7/OTkEICNXP4nsXerVGQr1r6PKDAIGhee0YLrLe6zo2FcPZPc\n/4TcNystWJHy2sG6y6t1G7FNCllBj4la029QqTUh43grvD3zMyHBSiZAVIGp\nEOOCsa6ptRDVRLc/LRYzLhfvkQ+BfT2npRfmesQjfMM0NzTvbVph5NRkAp4M\nFXDEIao/j97RvWFQ4Zyk3Tn/6vMVXvkSp7jWrVoStc0kvF8l2P0jrYdxlAI1\nZ7Rw4ELLTodDhmk7+mSzKXPlN+rUnH2B/GUCnKjZ+08H/SdcmM5mAZCdHe7+\nDxY6yfBh64Jfo6NxkHYeKfy+0Dy4WOWtWUdu+Z/LDREteD4f4BdeQSzlt4RF\n/+TBHYSE0IeBHJ74r7r5qiOeuZ4a6KWk3Aej4CTldXRu4uHEnyJ4tiEeIPOW\nhYmXlTUEfrAaiyVplLrhDA780ylFk/RM0Zu/Vqyc46Pp+qjto5ij7WTDBj6o\npeIC\r\n=VLg1\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"58ff4055affa7a1d66e79813fbb147990e5360e1","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.20.1","dependencies":{"tslib":"^1.9.3","@material/dom":"7.0.0-canary.01de07011.0","@material/rtl":"7.0.0-canary.01de07011.0","@material/base":"7.0.0-canary.01de07011.0","@material/theme":"7.0.0-canary.01de07011.0","@material/animation":"7.0.0-canary.01de07011.0","@material/typography":"7.0.0-canary.01de07011.0","@material/feature-targeting":"7.0.0-canary.01de07011.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_7.0.0-canary.01de07011.0_1590522780860_0.40996959022823476","host":"s3://npm-registry-packages"}},"7.0.0-canary.51d4535fe.0":{"name":"@material/slider","version":"7.0.0-canary.51d4535fe.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@7.0.0-canary.51d4535fe.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"61ee04c35e0453b1923a9853ddb0d6bf25939b10","tarball":"https://registry.npmjs.org/@material/slider/-/slider-7.0.0-canary.51d4535fe.0.tgz","fileCount":36,"integrity":"sha512-YYdiyu97VyikYQbRODjjBTLbTIrPMudOGxYzfy8EMesvy/nmqEW2EHFR04gs8k/BEGo6oMMd/x9yUHQHT6j9QA==","signatures":[{"sig":"MEQCIALrzzoM93Bpnk8HhS7dsER6Y2xBJmJeyNI3tESfkApGAiBnju9Q+uaZ5hmmYum659NabHJq0J8NpaKIXuRUjVl+BQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":378447,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJezYuuCRA9TVsSAnZWagAAOCgP/iTasqIBFT32FE6lbLCM\nLpbL0wlkXi96B66AubuhoaYNfT3LLuKjUrxx0WaQ42W72ays1cpTpR9AD5Qe\nVxXBWYZOKMqpO0Pe0p7PmZtNo/b47/6KDz3o7rPun5qjBbc8LPf6CW03ro0z\nVmedQ4V0NcpRh7TcbzoynJUWaoF99SqYZkkYeYqvfU/+7OqCctaLfUJq8EGN\n7AY32O/551NfTnUgWW1cIzK6Xpx5feF0vFwKPmJhRYKci9P+mTCKeye0Zsw9\ncZ6FawZEpEMwUAfdsX1ggzBXP6ypcYl2rKlTlgC8HOFKyXvhvs9Kxw/tTtHi\nYxt+09rKfHyGIESZikr04nQjXBL53MR/b/H8YO1mEDN8K9hU0QWQa8dvDHWv\noV7ODodZtoRaX/5ZPVAs8D8AXnbV56QXHOMXYjTzyMQzb8dfDW6vfm1DEFTA\nJWYlEbc/kMkHgCOpXYW3hRiH54wfwD6GIx7GU6qji4dMEONgC1RVSEfF0HB0\nsu6RLf7two5UMs6WfWFDhCiX1FV0DvORMSthVtE15ZbC8X9kA28jWA42/MKh\nvVN1aigwV2oY9hbbmqAUsHKmXImEus1UV4Pa3AUDpxRZFt5XA+qivulivsG+\ngSbGlnG4NMxeHiNupJLK3bVs1d6ail2EDQFwFBmGt/2viC9xOcXXsGrZFwll\njuHW\r\n=k2mY\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"2ea346ccbcf8fe2cc90f893a510a194ad4f67356","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.20.1","dependencies":{"tslib":"^1.9.3","@material/dom":"7.0.0-canary.51d4535fe.0","@material/rtl":"7.0.0-canary.51d4535fe.0","@material/base":"7.0.0-canary.51d4535fe.0","@material/theme":"7.0.0-canary.51d4535fe.0","@material/animation":"7.0.0-canary.51d4535fe.0","@material/typography":"7.0.0-canary.51d4535fe.0","@material/feature-targeting":"7.0.0-canary.51d4535fe.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_7.0.0-canary.51d4535fe.0_1590528942114_0.4724240983168404","host":"s3://npm-registry-packages"}},"7.0.0-canary.b86d826b7.0":{"name":"@material/slider","version":"7.0.0-canary.b86d826b7.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@7.0.0-canary.b86d826b7.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"cd23cf8867b6994a5e4b25bce07f85dd85f6ed92","tarball":"https://registry.npmjs.org/@material/slider/-/slider-7.0.0-canary.b86d826b7.0.tgz","fileCount":36,"integrity":"sha512-FvObPSmr4fZvFdYldh6eOIvuWMg2dj0QCNbn3p1EzlQncx0362EQRJGi8uO5Cr/zjncGDm8y12mtmnBPHfzGBg==","signatures":[{"sig":"MEUCIFXZ4XXnZBlA7xtdLRaCZ54hqP2Bnd1Dxsbwc1+4FUQRAiEA291eo1Kf7evep8X0b4XdKFzAwk01Qap6lzgp4VvZMI0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":378399,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJezZSwCRA9TVsSAnZWagAAPL0P/iEJHyl45OKMmhhBBSOB\nWI2mLg2uyQQd63N+VYy9diuZbMLsDIziAroAPdwgaz+/njqI2q7pYgj9kf+o\nOu1M35d8yGfmlVNL/jKiuPBKYTKmliNAIB87vKzu+xJwB1NS35rqtBeY1VgY\nop4jLZORpv/n952pIZSNyJO+hjQxuY9VkXXvdPiGI+7VIwuIyVGaIELDvr5r\n0jcxYclPTYZAnh+ngVRy1FsfsNG/swyTAcD2pC2eUkuDGhMaOp5MbnX05K+i\n8lxsFh3CsQ7ZjEQb8EHZ6Uz4WMF9IAtE5NgdvBrCoUK3eFhNtTW9DX++QxhH\n0MVXAr1LMrcNOdESPtYT4Yw2Gj8kb7VzCtHLDHg1vCQrI1UTm3okEkYxDzN+\nqd9/hX6ATborzQmXsDqmHuC+/Ec6roq3CGbllc+34aJRz2uDI6i/8kqxpeff\n//jq9fkh9fVXh7+cwpKVgm6BkShpag1kuvUnr30JpEdEQx16xZSL3Pvq0vr0\n9RAqfZzXAc/1QArbEEc/wUkEVv70iT2ShTiVo7QdUtJn6aze7uqvjJ02d0NA\nYfjIXyww245/8zPDhy54HM+vPQEWo5cZ94gv62QD3CAT4KZpQ5O1QNJH7erN\nvGwapjbnGpcFyy2jc5elm5KT+SV+vsi92o00TR9wkFj3FhcIl0WBq557wFBj\njdiE\r\n=cdZb\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"2b22865938bbce871e6d1ce8ce0129227142073c","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.20.1","dependencies":{"tslib":"^1.9.3","@material/dom":"7.0.0-canary.b86d826b7.0","@material/rtl":"7.0.0-canary.b86d826b7.0","@material/base":"7.0.0-canary.b86d826b7.0","@material/theme":"7.0.0-canary.b86d826b7.0","@material/animation":"7.0.0-canary.b86d826b7.0","@material/typography":"7.0.0-canary.b86d826b7.0","@material/feature-targeting":"7.0.0-canary.b86d826b7.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_7.0.0-canary.b86d826b7.0_1590531248482_0.3630288137251656","host":"s3://npm-registry-packages"}},"7.0.0-canary.d91794c7e.0":{"name":"@material/slider","version":"7.0.0-canary.d91794c7e.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@7.0.0-canary.d91794c7e.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"262efa42e62d83d015c0cae35b5601ab82eb93a7","tarball":"https://registry.npmjs.org/@material/slider/-/slider-7.0.0-canary.d91794c7e.0.tgz","fileCount":36,"integrity":"sha512-WvH8R/OkYTYqjNfL8lUhTQHMGy9pGbJ7X9egiu068KkmuKWWKeZfqgdBNQeJoNOonP0wv8Xc8hCeLm1mn7HFpQ==","signatures":[{"sig":"MEUCIFN4ujvw5GAaqTkBSgEAjHiNC9qC9f/Dm0VHk4RHO5HJAiEAhd0W6LrNFcT6KOpzE5Q0/8bR+X0R5HNHrcfRmb+opgA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":378399,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJezaxoCRA9TVsSAnZWagAA+x0P/idRKb13cVmW/IY6IuY5\nTickMm15M/pTPvGdgnUgGpeAK2Vgm3Ao1VtWXhCVDjVStUUFb6cFxvqw1Sl+\nD7C4odMWptaLz8VWkOCjk9KunHYHA0WVsVxNBe2jXDGqslNnJMu72OhESjQv\nQ1ypcDU/MvN+3U1DB/46mbhJjEBohhhJE6dQ+Tc5Gtwb3IhrzZUalKJi5227\ncVUUyr2WgC73kOFls3EG76NGCTQdtiMkLj0jjdiNMII+YZB1LTFR7rafXIO/\n9auMNupnHH5rzeL9Hz166mwJKu9CV/6mbonGbSwK2kdBvascZOW+11P5giHP\nKGKDDEvIPw/n5TJcAvSfXqNPsKRlm7OJkMI8ZB94wamsBbJsggdjRLJ8JviI\n9u00OvSz+GvEZunO5Yqk0I5WpVyXb1ffxyjunPERXTa+6mklV82QTQ6vy0mu\nx/Xq/JCJ7lLyKq/Cup8YZGFSz5JQy6WjcFPGbryqyUY2oFi9f96ZSog1EL+o\nmASZm/xd0rcSyZmM9m8m/S3Vu9ey/+A0wcL8n7HHNioUrtxUp1FQFCrS6ezC\nwUKCQ2QD2lpByh/BdxqrZmZidsbHxILlioz6PIswFGmQD5ZNYkkvtMMetPzP\n0zjo4+DwAbq8RgV3KHP9hXQFqPXvSKQKhWU6/KEz/6C+4LLAewntSJFAqSCj\novFL\r\n=YfV7\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"f931cc9789364ca07cac4a17cef0a225bf43c168","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.20.1","dependencies":{"tslib":"^1.9.3","@material/dom":"7.0.0-canary.d91794c7e.0","@material/rtl":"7.0.0-canary.d91794c7e.0","@material/base":"7.0.0-canary.d91794c7e.0","@material/theme":"7.0.0-canary.d91794c7e.0","@material/animation":"7.0.0-canary.d91794c7e.0","@material/typography":"7.0.0-canary.d91794c7e.0","@material/feature-targeting":"7.0.0-canary.d91794c7e.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_7.0.0-canary.d91794c7e.0_1590537320157_0.9469098761193484","host":"s3://npm-registry-packages"}},"7.0.0-canary.8c6d7e076.0":{"name":"@material/slider","version":"7.0.0-canary.8c6d7e076.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@7.0.0-canary.8c6d7e076.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"ce8d5d5d09158c279e903b8d68f3fd56db8f2760","tarball":"https://registry.npmjs.org/@material/slider/-/slider-7.0.0-canary.8c6d7e076.0.tgz","fileCount":36,"integrity":"sha512-elJKDnr8wCRWNWC0EyDPXNxgd/hRy80sYfNeZky0P9Hqfm47JcISQT530CIXruE82zqff93V05cC+9U+0Z/xkQ==","signatures":[{"sig":"MEUCIQC7ekygcU6v0r+Je8iYbk5I9CmNucC84ePbw6B3VMxvVwIgCgoF9M1geYWDI+9J+4JDwu3kEYRNiW3tU81mmOLnaws=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":377501,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJezriqCRA9TVsSAnZWagAAgcwP/3FC5f3SCwX0yX9ZGnqJ\nlyMW6qJUS2JB5IoUmjgtWLWX6zL1/6HyPzbWAysPObpES9jhIqPpPw48WQBu\n06ytM4h04xn7k+D3ell42Ei373g21tSXROxCajNfEBYkyEpfvKm9IhUxRhC8\nJULc93iH3Y74V5aXSGsBJjqrqg2F7bOrmovMrcx3GiE0B+3BLkENlVxLf4bd\nslMTE8P3htToCE3sd1eu6Etr1GbwUT+PhQE9++Wvu9DvZ3xm8zK35vf/9pQr\nZlMxZx/GsA51xeY7vR/Kk+jUfbMhK+7K21REncVnMfVuOEpgX9IpmOZRaIuY\n2V1UQsqMLu1Mk6sz71Pm0YlZB9DL0+HpFPfc8G/GUQRQmoyx/GVJsDL2R33p\nK2I5lHuJI9lCQkeEYJSeF/hkWFWq7PEOuUCkINf8f/skqc/sbAouwvddWo18\nxOGhH3UNhAHZfRO8ZeNLu3qsrzt3PrIP2y5MiSmlfErl1W3yU3304ekUi4xG\n+YJIgC0pDMGlSutY2eNQrxjuaDcWJLqUQdm3j6kodDt24A0TPHNIyLs9D9wL\nfyQJPf0K+I6DdTL0Ji9B5jY2isXxbfH96Z+azkgXsh+E4R4AM+Rrhg6JVunU\nunZMrRb9XIGUoc/Lj/kRhmRS0unU6rJFgDX8v33ZvBpHLHgD6LW+PJJtdNNw\nFFd+\r\n=Hhps\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"ca2efa9bf20bd3fd24c7f6ff263721fea798614d","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.20.1","dependencies":{"tslib":"^1.9.3","@material/dom":"7.0.0-canary.8c6d7e076.0","@material/rtl":"7.0.0-canary.8c6d7e076.0","@material/base":"7.0.0-canary.8c6d7e076.0","@material/theme":"7.0.0-canary.8c6d7e076.0","@material/animation":"7.0.0-canary.8c6d7e076.0","@material/typography":"7.0.0-canary.8c6d7e076.0","@material/feature-targeting":"7.0.0-canary.8c6d7e076.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_7.0.0-canary.8c6d7e076.0_1590605993644_0.3841691778255938","host":"s3://npm-registry-packages"}},"7.0.0-canary.5b5f62f93.0":{"name":"@material/slider","version":"7.0.0-canary.5b5f62f93.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@7.0.0-canary.5b5f62f93.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"a4e1d3a59ffed65c1c20060ed4bc6bd0d2c7d9fe","tarball":"https://registry.npmjs.org/@material/slider/-/slider-7.0.0-canary.5b5f62f93.0.tgz","fileCount":36,"integrity":"sha512-HEu1cJofk+pPoxYM70fie+at5hxzRFTZCVf/FxGskvNxzKuoWA892Wd0sLtOQW63bbMN+wImOBuFsLFVBBQB5A==","signatures":[{"sig":"MEUCIQDKizG+TYQ+n2/cPhGdmzE3QOiPSxFDxpgn81AnrXA/owIgLQ+5n4oBhZQRaZXEUI+LQ1wZsfFqD5PgDDAeUgpN+0s=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":377053,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJezryOCRA9TVsSAnZWagAAy4wQAJ3Qj3ZCKG8tRM5DW3PS\n67SXtIGI433reQTOhk3XQXT3q76Ola62fTNNRi0RRIKN84oL5I6GJM7ZBgyD\nynKrsc6+z0ET0KDTyYWx7fYcEKSJQ57g2CEqxlK3JkbuH8sDxj0J5T4XqzGF\n4E9vK6S1iVFJDUAc9OiGnt9NU685bvklwhdwoFhLBYj1hyKQqJ3ot1j2z2Kd\nWeRKwHCaSZS9JLN7i8Q4f/WgIFpxYlUaEUa7coiVbJrLpKxeehZzmUqIJlKj\nwufTz1SVi6NE3fBAuMTMTf9Ybe9oRs8RMLJBv0QMr0jqSektUHy5jqL8rIsZ\npMPXLen7YAEXXjYw1UHqsBycxjC6fGBAZjPSv00BTpa2u4plco/nBZ9tKKWa\n1P8OjCWOKagM8Sxp2tzEvAkcugDIliwRYQocgmMAhnySBh4Qm8ACshIp2uyj\nf8+xKZfkAPqgGx8Aek/qnmUtK5yn7vNb3trB/E1LBX4hRdFlbyYEvWbdTghc\n9lCD1LvzIDUtCgfzbXoJlndTRM3vVqW2WFtFBbO2b0rUq4DM8RpscJY6ogHt\n75cC6NOKSWK5QadPnIjfeyfb4ZqYgmKj4PHHARwWTNgMRK2Cip7gV1N47F8z\nPXIAL0vfP0OEisao/uNgmUZ6L+GGYGSg6F/pxBqe+9wh6nyRvyN1TNWfrsKn\nxz06\r\n=ol5w\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"bdb576423b0f8020c453a5473bae420ee287c240","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.20.1","dependencies":{"tslib":"^1.9.3","@material/dom":"7.0.0-canary.5b5f62f93.0","@material/rtl":"7.0.0-canary.5b5f62f93.0","@material/base":"7.0.0-canary.5b5f62f93.0","@material/theme":"7.0.0-canary.5b5f62f93.0","@material/animation":"7.0.0-canary.5b5f62f93.0","@material/typography":"7.0.0-canary.5b5f62f93.0","@material/feature-targeting":"7.0.0-canary.5b5f62f93.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_7.0.0-canary.5b5f62f93.0_1590606990229_0.8937082215998449","host":"s3://npm-registry-packages"}},"7.0.0-canary.d9972abb1.0":{"name":"@material/slider","version":"7.0.0-canary.d9972abb1.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@7.0.0-canary.d9972abb1.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"30438803e7fa3e4e493300e44e9b6415fd549b80","tarball":"https://registry.npmjs.org/@material/slider/-/slider-7.0.0-canary.d9972abb1.0.tgz","fileCount":36,"integrity":"sha512-EQ+0roEeh78goU666SPdhqkMj3q2GKgmVgS6M4CYotcS1xxLQFRXBL1GInylh5xRzd5nfjOU3ZsC1wn/0bUHFg==","signatures":[{"sig":"MEUCIQD9kaayP1nn0TG+mtwt2hrr0qXQiwerSUW3t/cyRWfhUAIgKJPdkg9cvmtFPXFtpvZMVwu6enVz7GLomNUS+kFEsbc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":377053,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJezsu9CRA9TVsSAnZWagAAzQ0P/33sY+oxiLNij3qLLV6S\n+ixwJDvk+rrGX1VsoCnVFl4xWgkaUl8kDZiaJmimGgJ5MLPRm8/rGhBhOdGz\niv0dmd1kkYZly5wRpEROK11RTFNv7ryWzg2U8LVw+h9ozgirvfL/pv2/CK+u\n3lTamsfE8xZJuKQbz1rYvWxI/r9WNVQaI/FZ7paFIFWlN3MSk2LGllk1Gxz+\nVrJyyl3yaerZqHifSb2732ZMQucI9Ol524DSs9gVHJ+25xA3TaB129IeaoVC\nIjR8UH/7WBKczBBlua0ClsAjcLUN6g7u1jSXHvtfl1aJxXzVM1dQJyZ/ySl2\nvU8hds6+Ni7pChswXY9lFFsPA7bDI3C18aTDoLxuvhhC/+QjlDFQTNEuW9Lf\n2F5nd6t+tBMAf0NCNszvj0/XxOevtYS3PrV1KcP7abr5v85mnlOdd76WYsbW\nlPYWSVFlYzUazjQHafD93504Eb8fnBHvUTyEQsX50ld77EHRC5Cy7Cm9255N\nCyXvwdiTG9BvwjniYNFykWncYWcJX9iQ2EyVkyRrGUXB0/yO+J5xiWgdZ7Zd\nFRc1gfC5qYZjv3dWVa0ndFS5fa9GlDYcgZjV5YAmq5L6iKlU2egQl8EN/lQz\n8kUxIos8BYxlDS7yd3X2WKecP6JEQ73A+6/Cr9NEqf/YDMnVEpudu1wO1WCi\nt7BO\r\n=bMlk\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"3db449915645c45b366327c8152342a34f1e10e2","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.20.1","dependencies":{"tslib":"^1.9.3","@material/dom":"7.0.0-canary.d9972abb1.0","@material/rtl":"7.0.0-canary.d9972abb1.0","@material/base":"7.0.0-canary.d9972abb1.0","@material/theme":"7.0.0-canary.d9972abb1.0","@material/animation":"7.0.0-canary.d9972abb1.0","@material/typography":"7.0.0-canary.d9972abb1.0","@material/feature-targeting":"7.0.0-canary.d9972abb1.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_7.0.0-canary.d9972abb1.0_1590610876108_0.87168563656683","host":"s3://npm-registry-packages"}},"7.0.0-canary.6556eda2b.0":{"name":"@material/slider","version":"7.0.0-canary.6556eda2b.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@7.0.0-canary.6556eda2b.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"6ae7dfe2a94b91cf3320bb365f2907a7dcac8659","tarball":"https://registry.npmjs.org/@material/slider/-/slider-7.0.0-canary.6556eda2b.0.tgz","fileCount":36,"integrity":"sha512-1ES1I65ulBkrb7+/9DSdBWkL4AOH75XgU5UPLh0q8ZV6lodL2S8ahAopUh8aLNUiKLPgLNsZhA39hy/bRuWfng==","signatures":[{"sig":"MEQCIBrI3xFtddM1V1CEREx0ez0+xVl2Be8L8ysit13bwNRbAiAJvbE9MRf1iTWum9kDSmUamhG/LZUPS62loRhKdNcr0g==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":376904,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJezs3nCRA9TVsSAnZWagAAZqEP/1o2XNjA5KvrF8l9AYRS\nXuD9SQRKxCi/tHOnifLvbsdRtLoEJb+w02mwpuxrqFEfxJ3zAiutmlYD8u+z\nphVi5had96M3ohkqaJK+Oe7juz8z019B8R7qHsbyGJxGY/4OJgLA0XpXTTHn\npoDyB/pICcs3Ls78w0q7MBY8AZZ+SsLbKHHV7AgvFSiQMGFdUylKbGsLfxRw\nBCLxbcs85LhuAw8FjdiRUsQy8lo5mh3EFYZpQ1DrMfgK+bk1I5aJJYfgu7Al\nYC9Y6kfIt1CanV2rqcmTO2BjUHPLjJuokWVvGgII5BLeWVNn/xu7TmWjzGyy\nx6bNvvCQ7l1x3amGNZtz9Qbg/5emk78v/Ck/xpgNwWYLcYX76Nu2W+As/SK6\nMRH/LH5bUZwRBhQ2Oqv7SaiSVwInjSwwaJB2cgeiS2am+9Lk/inZjIL7flbX\nDBbLnT7dsDCKl/tivrWmW28I0zr3R42p+kcrVjMLximxyJgT1NAFGo+U5LXH\nU9bmrekSTszBERfQqiCEQ2YsteLPEXqrhhyZIWGrsD7yEtswgG8xGOrAJPfE\nfkffeLqO0Q8oD3fLUqp19zrNu1Ic5Rk1yJWFjU3e1ZH4LuhMuQPJOjRnKgo1\n1/mPfM4KDyBpwe5xXEhNCqP9ZaTDCCDf2d1W+I8m+UMTeao1FkRzUkpbqsC4\nvJJa\r\n=x3QE\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"504ec59b4b401d057e70ba4bd1bbef2f87218204","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.20.1","dependencies":{"tslib":"^1.9.3","@material/dom":"7.0.0-canary.6556eda2b.0","@material/rtl":"7.0.0-canary.6556eda2b.0","@material/base":"7.0.0-canary.6556eda2b.0","@material/theme":"7.0.0-canary.6556eda2b.0","@material/animation":"7.0.0-canary.6556eda2b.0","@material/typography":"7.0.0-canary.6556eda2b.0","@material/feature-targeting":"7.0.0-canary.6556eda2b.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_7.0.0-canary.6556eda2b.0_1590611430589_0.8487035401659442","host":"s3://npm-registry-packages"}},"7.0.0-canary.32aa23641.0":{"name":"@material/slider","version":"7.0.0-canary.32aa23641.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@7.0.0-canary.32aa23641.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"c4a2a6674638271798ff5dd16ca4281bb8f51a28","tarball":"https://registry.npmjs.org/@material/slider/-/slider-7.0.0-canary.32aa23641.0.tgz","fileCount":36,"integrity":"sha512-uRfaJf+Tqk0w2SFlkD/V3g9yAsuPrJ6t6OSXvXUFxJgJIKOqpZSBoYjfHTJ7SvW5IyCoueHvqEDl+O9QktQKRg==","signatures":[{"sig":"MEQCIEmLMOARPxBYf3c9VP+0HgfI3RNTfTv/Rxw9GBk5/5wCAiBVlG2ySIHb0t4bq7kAiUTDlUTdVDCxmo9+igjPob5N2w==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":376904,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJezt3iCRA9TVsSAnZWagAA+jsQAIBamf5NGIgeIvX+00qY\ncBo41NHiUoTcKvnM16VUrAybdfDi1x57ozxgegQODOT0KaXYzuzhXSjySk55\nPG+jeUnQBY/ebruyINwK+JUfvc7u2d5zsC8AONq15XwRAQV+O4m2HX66EPPn\ny8XZmX7yOxSTbAPg1wGieAQwFU7slKBWyqzuNMS+sJ+sERr1YJnpAz7JTLen\nhfESLlX8AYtPQi99ABBfo7A21Bea0clAgqQmEvtUjALXMpxPp3VBIxSuWVUM\nzUEdU0DAflAiQPoZbisF1eBwoON5af00r2h3yt8PXUAu1Yp8XoM9zMNJAOUg\n74Lat2fHZIfcAYnwFdVLuf5d8fCtbsu+wYg58KaJCZg6vA9QNaUoZWQxXLyW\nLOa5kkbMLvMluNiajZctelImqO60Ui4aMU46O5JLEcA0fgaqNIIhN7YKlAtK\njG9Pm7oeU3IAMohHTkqeqSELu//sOZSnZRVRf0IBqVfzDj2FYF+Wzx0MxymO\ndAOzv4/dU+eribJsI6r81hZstiQfnpYiJOMF8t8j1duxPGMv1d64LsR53LSb\nxCeN/SlTzVpZLCfeF21+rdisLh0A0zC8f/FdxsuMcNmLy/jAXtk1YHvoR3N9\nGseyXxL75JPFBGmWKoLFC3+jJzBp/vrx1X35zFRENslGEFdLSGvuhvsQImkM\nMnJW\r\n=B+Em\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"4cc39075dabda7fb76257a3403f0bde13084b87b","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.20.1","dependencies":{"tslib":"^1.9.3","@material/dom":"7.0.0-canary.32aa23641.0","@material/rtl":"7.0.0-canary.32aa23641.0","@material/base":"7.0.0-canary.32aa23641.0","@material/theme":"7.0.0-canary.32aa23641.0","@material/animation":"7.0.0-canary.32aa23641.0","@material/typography":"7.0.0-canary.32aa23641.0","@material/feature-targeting":"7.0.0-canary.32aa23641.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_7.0.0-canary.32aa23641.0_1590615521749_0.2319148938647011","host":"s3://npm-registry-packages"}},"7.0.0-canary.654934dfa.0":{"name":"@material/slider","version":"7.0.0-canary.654934dfa.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@7.0.0-canary.654934dfa.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"8c40353cbccbf6f8af0089d7882415a47a735c1a","tarball":"https://registry.npmjs.org/@material/slider/-/slider-7.0.0-canary.654934dfa.0.tgz","fileCount":36,"integrity":"sha512-HEzBkQXTcDm5WSNCH5UgPTLT23XBbisw6R8uKHaiu21EwUxz6C08NGHIFJ87GGmX3okjugcvJWdvy4siBZ3jqQ==","signatures":[{"sig":"MEUCIEqdr91MzWv4zAIo2qLulAftOx83obC+Ouhh059k3VaPAiEAyIKP2/n6BG9xTseWnifP5c26viSez8KQ9LYUXYJSHsM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":376904,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJezwfOCRA9TVsSAnZWagAABJUP/1htiz2QHeR0YJ3WSQDD\ng/yOkCNNxS3Vu8bK7AkJBiQZ6O4kUQL5e/ZuTapQzVULwgTK9JaaTwfh6Alz\no2/RaMO3TiRfxOads91ashqAhoBYmp0lucWxb9yr/6TvTyj5+1jvl7bVzf0a\nl34fEwoj7O6cyLITdTFaj94N5Shb6rCxihSTfqOY1zJO04I2n4x58wzh1Oy1\nl3DOjlrx8JsrGag285mQu2DVSA/Hrm22TMjyHS+QHs0++wXothosizTGlOqp\n8d7U8LMd4kdV3tdpUZiUOjcigJFpmzOqJJoxv8otlITJxm0P/sK6CobhAscy\naIu+5yzCbYQSs/TUbRMpbGLrXaUymW6v/tds0RYDo+MGkt8dQrRnw9lJgHEp\nEfXPhcl5LX+w70xB4l6ytkloLEZMYZZGVAIOtVsSqyDQ3ncccOgwcx40Jm0r\nhdum1rFpHMqXHx0twZOBlMQ/hf7kXZCu6o1wgf4OqksKqmO3IzBU67OcWcBh\nVR1qMHKO5pGiamlb/lq3VBLRfWeQK379wf2DnxP1OaDLVaXamAnmBfFJyAoH\nXnFCeiXMtXeTKCu2xOari5BtP/xasDMxxFCvZJRFKgQN+pZ27r6alnfXPEad\nlJAKq2dE5tZV0bc+jXBK4pv6FBVhIo8PBkmVPNsFkOEYT4KsIXMjv5G13ydA\nUEY8\r\n=K7r2\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"99e56121d157a5a30949b826c0d521a365a1ae59","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.20.1","dependencies":{"tslib":"^1.9.3","@material/dom":"7.0.0-canary.654934dfa.0","@material/rtl":"7.0.0-canary.654934dfa.0","@material/base":"7.0.0-canary.654934dfa.0","@material/theme":"7.0.0-canary.654934dfa.0","@material/animation":"7.0.0-canary.654934dfa.0","@material/typography":"7.0.0-canary.654934dfa.0","@material/feature-targeting":"7.0.0-canary.654934dfa.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_7.0.0-canary.654934dfa.0_1590626254081_0.7896934496652652","host":"s3://npm-registry-packages"}},"7.0.0-canary.41910b8b8.0":{"name":"@material/slider","version":"7.0.0-canary.41910b8b8.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@7.0.0-canary.41910b8b8.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"0024b9646cdc0d25c310d3a85ef9633dfad4f912","tarball":"https://registry.npmjs.org/@material/slider/-/slider-7.0.0-canary.41910b8b8.0.tgz","fileCount":36,"integrity":"sha512-sLq07dvyUzdAJ0Ph6qP7OU6FYKS7UFWW5p7y+6mHzESdtE6/xCiwwKzgZ8/MiNIPlshscRVLQFDPqKyXkJwozA==","signatures":[{"sig":"MEUCIFJQl/rff9IbyzyVEb583AhgqiMweNrPWuJvjq5J2ejtAiEAyI5nlRbLl39SHqLqqHtmPvUtkTomDE94yZ4Grh1pEZA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":376904,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJezwsgCRA9TVsSAnZWagAA78oP/A9AbuD2JbVhiMd5iymS\nlURULAGa9eUXTLI3KcSpmpu0/kQDrrN3sf6O7Ow7/A2aSS/6d7OhVhFhEmIz\nRBamky0hzCG+I+k4Sgu6T96KwOsEVGe1HKhyQGcEXVhOxkDev/kPbsZ4Vwoc\nLVxlZEpRrH2XZ3htWpLJMF2OXlYRRaJxcz5zdCBRsH3E7krzIYgem1Ibk5Mq\n0tJnn4NaVxFCtODsRWr7D56f0esMVN2HYEePyjOej2PZH04ujOXOqg4GgH1/\nJttCrooiWvJTJffPonZCbJU4BVQqm75C/8OoLZqyNSVlvXXa3ogV1U2ihag0\nn8Gl+lodwBPo7pSuZagwQX52Fom7UMrtaG3OGC6xhe7ATGc5kG3FoaP69dr6\n4g1C09cp3FUnQsT6OJKIMR2WcICGNU7Yr4W7e5swSDfce3KsTUJkdYLhIWEJ\n++86GqyPwSkPt7ImD3sJwYfh+Hua1STJyKaWcwG1udatkiMuK8GX1NjQUgdv\nB2XsVOU0KIAD24vXidzzKmX6Tza2e6LomlQofbZ9kpekXFBzq7gXCO5wz5kr\nIuVejKvsR0iH7ET6cDpXWEi5aTgaH3Ha3XZKxcftP+RTKpc+Ys/Ajd/T6B7/\n1Sgfr5GAO8/XKaregEaz4/4SBgkdbL6CywKgLHU/LYehru8E5qjxLhy1sipc\n4SH0\r\n=1j1g\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"14656d5f31e9a410c15eaf9b47530d57a5901add","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.20.1","dependencies":{"tslib":"^1.9.3","@material/dom":"7.0.0-canary.41910b8b8.0","@material/rtl":"7.0.0-canary.41910b8b8.0","@material/base":"7.0.0-canary.41910b8b8.0","@material/theme":"7.0.0-canary.41910b8b8.0","@material/animation":"7.0.0-canary.41910b8b8.0","@material/typography":"7.0.0-canary.41910b8b8.0","@material/feature-targeting":"7.0.0-canary.41910b8b8.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_7.0.0-canary.41910b8b8.0_1590627104125_0.15580254057611453","host":"s3://npm-registry-packages"}},"7.0.0-canary.d66d22bf9.0":{"name":"@material/slider","version":"7.0.0-canary.d66d22bf9.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@7.0.0-canary.d66d22bf9.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"f2ab413f602d437445b2736b66ffe25fe7e8cce6","tarball":"https://registry.npmjs.org/@material/slider/-/slider-7.0.0-canary.d66d22bf9.0.tgz","fileCount":36,"integrity":"sha512-q/BaWKt5x8g49I8isLu0HsYgo9uzJsGaqoDJe7uTfC/3CbpqEnT0SIV0N/vxXOA0AVguBRPzUxYD5s1bJ8yH6A==","signatures":[{"sig":"MEQCIGWrPAcLiLKvHdLz83khfWCWaq0w2GHO/PcSCLOZtJU2AiBgMZrNUn4SdF6Jj37Q4xG2aSp1G5ByaqcNqevoI9bLwg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":376904,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe0BdGCRA9TVsSAnZWagAAq84P/A786+xd3vK0HIGJpDpK\ngPDrAJm3+zKyqYIQs9tE+cPMHjH+ia7XcAAQrQfABXh6bC++6nUbLcASf8LP\ntAWgtyFhTi0YSut21cqbxifNv469R8p3LpqIGPLlDKdedIcr7XkW69u2w/jj\nJw7v3vjoDSo6hzjfQmpenZMjONMI7J4bVd99tlUlkiUa6CIXdboNk04X0PzL\nSD7KL47991sw0QbDooW2hJtqcl8GI9Y2TsJdaT12FZKZaCceRor038MQBrlP\nUovQs4nIldQcL+GrNocZW4ZA23FkWVntRagoGnZ9aSaVtJcHK54fBOdI7HGU\nx9rdCJOYaLobAHyr8YzrvGqq5lnI42wBxSIx7DGcQ1Ef0IHsyXJtocTsdA5Q\nSW8oqTjrxDMu7NAEkHtC1R+LrV2fCKDqYGzN/4XrM87i4o1HhpAtLaTq0IOZ\nHfLidYsvCHjYYTxV3aDf1cgoOIwvi4bUj1GJmvED0ERau4zMRHl25l7GzWII\nkUcG8NpxWBDRKR2CTuuvYPggBCIKBvmoQIV2WeDXTKCm7+df84HUQ4CYAtvx\n+f0/z/WXwlnCbtSevuYm9ModX3kot3MSbMseMGl8V2LvfLqqRtZMk5a3YhAs\nKX7fJ+4jrwfGxyX+OBoNvqECh2EKXPFTqkLOQvpO0ZbRFWoIP3ikN85amZAP\nnxPs\r\n=FOaA\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"cc182def4daea4d871df41985e6d893429174b3f","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.20.1","dependencies":{"tslib":"^1.9.3","@material/dom":"7.0.0-canary.d66d22bf9.0","@material/rtl":"7.0.0-canary.d66d22bf9.0","@material/base":"7.0.0-canary.d66d22bf9.0","@material/theme":"7.0.0-canary.d66d22bf9.0","@material/animation":"7.0.0-canary.d66d22bf9.0","@material/typography":"7.0.0-canary.d66d22bf9.0","@material/feature-targeting":"7.0.0-canary.d66d22bf9.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_7.0.0-canary.d66d22bf9.0_1590695750162_0.8012929684837724","host":"s3://npm-registry-packages"}},"7.0.0-canary.8904f3cbe.0":{"name":"@material/slider","version":"7.0.0-canary.8904f3cbe.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@7.0.0-canary.8904f3cbe.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"ebbf21778cb501c2606629e080a338cbfc0ce40f","tarball":"https://registry.npmjs.org/@material/slider/-/slider-7.0.0-canary.8904f3cbe.0.tgz","fileCount":36,"integrity":"sha512-Mo4UW1nBPYSefsiMKa8Hj6sMtwRecIov/BXh3M9oYGVCwd10Or2ZOUW5goTsKUX7VZt2u9BLUjrK/PPZ7DihqQ==","signatures":[{"sig":"MEUCIQDPYvt0VqMZcY15I74wUdkOZPGuIatUjU4OcOX6yM5YMAIgQnFORxF1yyVGgpGVE2BIfSZxBZw2wClwgyFP/P5HXHE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":376904,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe0T1pCRA9TVsSAnZWagAA/WoQAIYtjnhUoIEPC5Yezs+9\nQ7vEsenZera8UWY77XtLPQjeiacTTroIYslWUWaxYlOnASOSQuTmEllUy05M\nEnPMHx5yYc6V/Pn7/I1F/pi8FOplHBwrMYjJYy/umCF87H+FIvkJ7Pqcz8FG\nwVDDe8nl/G9TqyXQEQa2cBRDQZ/WBK23beTZFY04gRcrqx/ENYqnAUHYPdUI\n7dfZVOki0d4O7/x6DrPmPclfk3s06JqPPDtEZq1/WeVkYJgmaYre35Msbe5f\nQSTOk2FJisv/jAmhPDbq+uAIyK0LYULEDibHZX96tRKY0bGYAABl9Dv5c/YL\nppRUVYyHr27uexD76IOk4rs9xUESRR0N+pDHj0AqlKWgxMJ8crJnU9a4TAV5\nOIS7IvGOjeNj4O1mdRE55x5hYVh+CSvLHpU9ROTYZ2BE/NttylmewEZaFn7n\nm5Iyt56ka3CCdRi0gyCgOo2vlcy9CgkMvGZ53piUFBZwhnmqWpXFp89f/kR7\nD+OphN/YIfAJXQBhdVu2kxbx4ENRe3MytgUB3sFpBgneS6tPIPv2SujI7Dyi\nqlIAS55aLaZsUN+xAWlgR25CmxXWwc2qw+PMyDj8qAINimJRLKUK/tabszju\nmpwdk8amkJl3RROqqClEwZ/UjFlhJkVlS5aTP2mbisDxA2O+SNEA0ikozu0k\nCFXu\r\n=sQvR\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"f78dc612af1ed0ba397842886fe5bc41e32f181e","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.20.1","dependencies":{"tslib":"^1.9.3","@material/dom":"7.0.0-canary.8904f3cbe.0","@material/rtl":"7.0.0-canary.8904f3cbe.0","@material/base":"7.0.0-canary.8904f3cbe.0","@material/theme":"7.0.0-canary.8904f3cbe.0","@material/animation":"7.0.0-canary.8904f3cbe.0","@material/typography":"7.0.0-canary.8904f3cbe.0","@material/feature-targeting":"7.0.0-canary.8904f3cbe.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_7.0.0-canary.8904f3cbe.0_1590771049019_0.27258755670451174","host":"s3://npm-registry-packages"}},"7.0.0-canary.51512a4ac.0":{"name":"@material/slider","version":"7.0.0-canary.51512a4ac.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@7.0.0-canary.51512a4ac.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"9239ef43bf82141befca6efaf4209f1918623f35","tarball":"https://registry.npmjs.org/@material/slider/-/slider-7.0.0-canary.51512a4ac.0.tgz","fileCount":36,"integrity":"sha512-LXw4TJpPcNXp7e/ZdTCrAvqCumqQxPUItZNt8HzmUR4Adbp/UBpiJcm2JJZ8k7ttXrV1C99CWNBVolJWbIZHkQ==","signatures":[{"sig":"MEQCIDMhXobOC+RKleABUBKNmMYn88wskv+XHQVeRFnTCBshAiA+VxTBUT81pxz4cGphVueZvYlron0NQ5+tbhbmTcpzqA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":394452,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe0V9aCRA9TVsSAnZWagAA/LsP/Aw6XCpRNMy7vCRHu03E\n8axLhibFtgrnKpF14R5InWqcM/ONSXWtewXqflMIfeehts3gggvAcWEaEHd7\nmQjcQKVHVrtGhTZVwi7DG2n/Y030qef4XzVHvj2lXJCQPj/cNq1oui90uHGH\nrG7ANcxefVAlryJYfbfPBeV15ByevUKA8mhbgqJRMlUntOWgcVoQ+sb2D5Ms\nXjaaGT5pYOeq+f1Vdal1FKgd0vFLoi+PlAySaZvO8TMUCvtlb1CVt7R7cpNQ\n489/AtJ4HcoOIsa0cOYEQTza952/ECTHJeBAuRpoJc2NChUALcclIxktG8kn\nlVk44eOG7TIn6zKo+1GLSafvuCiOtCPMdgbleM4RUOmxSxhP7HdUPW8tRSKJ\nDr8ntj2QHinbVcUVzU/F+MAG2pDcYjuHZIVEaPYkKQTUlXllS7Fw+s577kaJ\ny0PUI7L2UnMTRR627c8UDEQz2/vLF2efJme6Ssxe7Eo1tV6z9nMiruPtFAbN\n5aKmMZW9BWaUN3f6HmuOiLu3ldgdwge1QeCBtFozu0ZQfIapyQ08hAzArTXs\nhS3DiTkAppJfSaO+AjrVRP0sb5tHdP4kgT2eALOEBk+yoaFT4hHClV96TceT\nQbQe3tMqvZbpilEnVtBMlg642pJ3mYyrGwccBuEZxz3tusYa9DUytz1TywOk\n0YGo\r\n=GM6n\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"d5115fe8118e1e2bc71fc7a491f672b079f281ab","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.20.1","dependencies":{"tslib":"^1.9.3","@material/dom":"7.0.0-canary.51512a4ac.0","@material/rtl":"7.0.0-canary.51512a4ac.0","@material/base":"7.0.0-canary.51512a4ac.0","@material/theme":"7.0.0-canary.51512a4ac.0","@material/animation":"7.0.0-canary.51512a4ac.0","@material/typography":"7.0.0-canary.51512a4ac.0","@material/feature-targeting":"7.0.0-canary.51512a4ac.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_7.0.0-canary.51512a4ac.0_1590779737773_0.005853324585517683","host":"s3://npm-registry-packages"}},"7.0.0-canary.0743288fb.0":{"name":"@material/slider","version":"7.0.0-canary.0743288fb.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@7.0.0-canary.0743288fb.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"8ac09acd6245aa54c43bee5355dc8e19e695ad0b","tarball":"https://registry.npmjs.org/@material/slider/-/slider-7.0.0-canary.0743288fb.0.tgz","fileCount":36,"integrity":"sha512-Um8KBoBUzGxHOkwahJXRd0XMigaW8D7AQt1PoSjG6QtbQ/mx3/ioccw2lHD9U8bXGQigqk5XKR7q3mN2ItPVaA==","signatures":[{"sig":"MEQCIE+WNTMbiwwiUMigrTlsxQNc4Drea9n/zsu1115lU8z6AiBRAYWyiB6vddzQ3Da1eEdj44dkKbm9A/xpEELpYAbEeg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":394452,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe0WsLCRA9TVsSAnZWagAA9nwP/iV9ek3Lu6WAUp7aQ351\nKJbiBvMJF8UtTsjP0kT1K8F87pvOLkm11FgixFsBvoSO10V9tXi78vhBXpsq\nJvydR/UNiRblgW45uBJJSdKDaMmgBiAKlAGnyV2y5FafKPB3GP8T0b7cTVJc\n4FLq/48JWToDpODx9H44z8xNYOrSb30w/v3MOzySQBeLFnT8K4bbJaiS2m2f\nNuZZNuPT2+Lzt1Eg3u+v3jlJcfQsMpQtWrjKlqxOikUPDjXnkMKimm2dSTXS\ntaBaO0cy4bMUholC2kBjxFPHj1HfgNnpzstZRLpG6YoksIKVyzQI2cyHCRaM\nsWRz+q98OsqlUguS5ovqwA1sxXh8RRPw2i+J+nJ4Rdl/agATpYHCRxwZ4QUX\nWXQNbP9usE2MtJzD2ihmLjQAxIqQXdQF5k7kjr6K2OER0UUs+irwMJe6Mggq\n7pDcVp6NSzgGirPbpXuGyF8wrorKB4fBXFD7XmBWSvx4FPd0rtDwgDDRaFJX\nH4+6oej7671rT0Tvwkbrmvw7num/wW4qxUlX0JaXjaNmo+JIUoAFyWR1N5NM\n2FkYBX0yntSQpyqHiaDt2E8Dtle18tr7nhz1qrbT6hZCKrPZCRGsN5DQNoYk\nUIozbDnuGZbEqJSPnZsRTYSHq4Ipv/VgdE7ghiZqtEuDQKHKcv1Iop8dHxha\nSnpI\r\n=oxXA\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"e0c92eea0cf28bf0f2367fb0666eb8592ef2f8c8","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.20.1","dependencies":{"tslib":"^1.9.3","@material/dom":"7.0.0-canary.0743288fb.0","@material/rtl":"7.0.0-canary.0743288fb.0","@material/base":"7.0.0-canary.0743288fb.0","@material/theme":"7.0.0-canary.0743288fb.0","@material/animation":"7.0.0-canary.0743288fb.0","@material/typography":"7.0.0-canary.0743288fb.0","@material/feature-targeting":"7.0.0-canary.0743288fb.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_7.0.0-canary.0743288fb.0_1590782730782_0.09098180343945383","host":"s3://npm-registry-packages"}},"7.0.0-canary.06ef147b5.0":{"name":"@material/slider","version":"7.0.0-canary.06ef147b5.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@7.0.0-canary.06ef147b5.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"25dbe4852de940ad851cf1b363656cb8c85a9022","tarball":"https://registry.npmjs.org/@material/slider/-/slider-7.0.0-canary.06ef147b5.0.tgz","fileCount":36,"integrity":"sha512-xFP3hbDzL0HqHZGX2Y8EWIG1u6EjHk3nUywpR4PjAiPJNvWEOl1Pfbo+vY3ctfVpQARbjckyWNs9EPgggDdeQw==","signatures":[{"sig":"MEQCIH6DjaTUiX9Hy50A+6rhfTEvJueSa3XB/8tdkpDt+u8XAiAYWg5K4BlG8XhdGJUJEQGTPtB6TSuJJ1zutWic99qb8A==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":394452,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe0XNoCRA9TVsSAnZWagAAicEP/2IoUtHgaHU4PqDEB6vm\naCXWy8w1mWzyHJVjk9Ghrr1kPFPN443FWCsToBQRYsAezdKbTzpkWnoBk0pc\nhKKnRtyby2FZkhnW5R4LDtSUW/xxiWHWAU4v3+H9Q+tkW7InKwrbtHW36j38\nBRgkdKbylO/ye2dDhUr40pIsYMkr111+Zhu8uBlru7WXPXBzxhC5Zs8r54xf\nQsZ3wzzSi7bHfnaHDerbaWKhpZIL/Ng8+tJCqRZ+KiRj6RjSyUrFJF9n1w0u\n3uTL7Wt0zxv8JnfNXFgh52XrFrZF4iIC1qI6SAmp4FVxdPd2IOhfvzyNbors\n1gVIoOq2f0Us1RvWQdTq7bOwZRim+LTHVje75D8G910u7hClhUQ2vh80z3u5\ncE+v0nig5l6sKximKzUaUbjI7WA+ScLDTsm8gWD22lzVo758O7N+lWOD9OiG\n19DVrCcf30pCQ+3t9BvXXWDYa/Q6KqAJ0MXrGUtQ8lGInyL6oiG5kBgZYa4i\nQT6A6OAUjK1npmyP3rbj/yIPGltR2wdwGvGBy8RHlUSkBHOaEVB+2akqi5l2\nkT99VGdgFIb6rwl07QFiAWWU0J9kZPLY8Knwv8UdaJywyOMQlNipV+NtuUEq\nYORC3BOOG1uMHsVedeEHwTBfAcsrz8EoDv1gNhrLIg3v8y8x5mkaAMhfgG9h\nHTg4\r\n=Mhau\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"43f043010a4682138cfe1d453ea0460f912fc2ea","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.20.1","dependencies":{"tslib":"^1.9.3","@material/dom":"7.0.0-canary.06ef147b5.0","@material/rtl":"7.0.0-canary.06ef147b5.0","@material/base":"7.0.0-canary.06ef147b5.0","@material/theme":"7.0.0-canary.06ef147b5.0","@material/animation":"7.0.0-canary.06ef147b5.0","@material/typography":"7.0.0-canary.06ef147b5.0","@material/feature-targeting":"7.0.0-canary.06ef147b5.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_7.0.0-canary.06ef147b5.0_1590784871648_0.7559562221759566","host":"s3://npm-registry-packages"}},"7.0.0-canary.8073a20a9.0":{"name":"@material/slider","version":"7.0.0-canary.8073a20a9.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@7.0.0-canary.8073a20a9.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"ee8c1eac6812b78ba5ac74ea3a68143831f3e783","tarball":"https://registry.npmjs.org/@material/slider/-/slider-7.0.0-canary.8073a20a9.0.tgz","fileCount":36,"integrity":"sha512-uTBi8+Xcb4X2OWNyvr0Pr9TxW04XW7kneTEgzxMn0swPtudYCp50x7uJfsqmk23c1sM2nDncBSv1S3eU3jUSuA==","signatures":[{"sig":"MEUCIQDxbrUYh3GmEU0eqf5y+nN1laxXf4Dbhv/IQzlcfDvnWAIgXH1h2CfbqUVikNS/GMyFWL7tWknYdgzG9M7945t2eno=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":394452,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe0ZoLCRA9TVsSAnZWagAAJVkQAItZ4P6aTL5JUcULcWeq\n/Bbkvl5rZlDlEC2dq4CuIPfnzVrVfUI3QlaL67vnTdw6lE+AVGAwYZTf5IcM\nvHkaNqEbbX8kTax2+rIAkASi56NUMf/5TkbjbD6I+l72jRjpj0SWIffC2WkQ\nDLqCPKSVXHKhdn3fcM7vq0hWzgdYbe4jKNVSqCqR9smXZiB3XhWZJHPeGtv/\npm7PN4238yWT9JS1lH3j/0/rYAzBNcLlpBSHjaBIqwc8i3RaoA7Gw+qEXnqu\nST2hrsoVXJmgeQ94u4rSP6Zizj33jw4LtNGHqqXwJM/a9N1m/S7xoAoy5WEr\n7hIOWAqXOMHsZUIPpujBctHM1bZCx9JUkpAWMo9TDmc3gV/lJtJrk2hin7p2\nkROVgI4IYyrq2UJZ2T1D/CIs+2HAM68zk6r00oMljYvS7m03aNIMf8E97E/t\n/VqGgnY1uqMmzks++/vIuatATQtCpK+TLt6UU3MqSuqNx+IWlCTZGYUadMhk\nfqtOjCh/o553mKkEkU58baT4OnYaysC6xktwLU2uIsOfwNgRvehV8cR6PwiT\n5zelvTTOY2hJQTDqs5nuPnYhe3m7YojTDTVuiDKiQBawkzuAB4wg5/hoZI03\n/LxQxSa/+HIlzrzZ7zPv4V/hby7Nws5EBNRXV43DEfxMf80F9/SWFm4ZyO9+\n/LQE\r\n=/qB1\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"576fa22ec00234b59b1dc4215b8dd1ae982c7c8b","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.20.1","dependencies":{"tslib":"^1.9.3","@material/dom":"7.0.0-canary.8073a20a9.0","@material/rtl":"7.0.0-canary.8073a20a9.0","@material/base":"7.0.0-canary.8073a20a9.0","@material/theme":"7.0.0-canary.8073a20a9.0","@material/animation":"7.0.0-canary.8073a20a9.0","@material/typography":"7.0.0-canary.8073a20a9.0","@material/feature-targeting":"7.0.0-canary.8073a20a9.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_7.0.0-canary.8073a20a9.0_1590794762678_0.741167597066279","host":"s3://npm-registry-packages"}},"7.0.0-canary.72ff42330.0":{"name":"@material/slider","version":"7.0.0-canary.72ff42330.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@7.0.0-canary.72ff42330.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"3e1e17d65f48e76a0b0792eecb8fca04c6b038f7","tarball":"https://registry.npmjs.org/@material/slider/-/slider-7.0.0-canary.72ff42330.0.tgz","fileCount":36,"integrity":"sha512-f7zDvSaMbqc2JoYgxU+Xm8gZamJTQmUHyDZ6GkMKQ+XAN2Ib7nh0hOuxoWtdgzLmWLTL7u7C7J1rWHLmZu47gA==","signatures":[{"sig":"MEQCIErxUEoNZUUPAJ3odnxGTQsD3VzHaLPCTxFgisCSGWHeAiAWlEzDB6aIIndoCH5eRgPzcbWop5efwdhW6H/OJnDlAw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":394452,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe1TB/CRA9TVsSAnZWagAAFrYP/iVSfST36GTa+4Ko7CBz\n43IcfUeULFp+KOA4fnankl2RQmmY6HeGHIUCOl9GekdVVUeSjizyVw0qFoMG\ni1ugKozq/9OH38iKgyENNEOPJ7HJJLRF4/ZSJ2w+budoO+VnrCnF8E/4oJjb\nUmgghsRTi82KQQ9MwrjMquj+zVvKKJh5LlcOpq1QlhfayVlJhraIP/u3WO1u\n2V+vI+YbrCj2qzOWP78MOgbk9TrjDPuSkSd1+jYHX4f6d6kOcok+R0lW0HVQ\nK2T6dnIpmmkn/Y/vusuY5bxg5AqX+/3pNOJ6n7e6teNueqAfJ5nUElKi9y6C\nUSAFxr83/E4XZOzw+6+Yf3YPpwQ++oTEqwqdF6ef+r2si4ngfhUwpARrNrZs\n/z9U49tOV21gpzkWHGyV9LY+N+jUt7eNhQeUVSV0oPRrAB7ZZNFAsHhJGdIL\nBibQi1ovuBvk0+vDjkuwZO8WR4E6pwBSgy1v5LeZVhXFwK83sI7rFPNoEAnr\n18c7j2mY8x3v6v87B+OUMBWtL2i2ue+WnqGVPOvYjRNA8yb070A3WfMrU1U4\nYzfzusQtwBUf23i9JNdBNHsy2RagvAMdcfWDyWiNfQQvqqxLrpwyDChI/2NZ\nZJeIpUZEigcZiZKSuAppc7J10RlQbu4gTN9IxShywK9K55+JBIfem0kqJUdz\nQjwc\r\n=xUyJ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"4c820e9d38fc1bae9a502ae78e336f0e8381f432","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.20.1","dependencies":{"tslib":"^1.9.3","@material/dom":"7.0.0-canary.72ff42330.0","@material/rtl":"7.0.0-canary.72ff42330.0","@material/base":"7.0.0-canary.72ff42330.0","@material/theme":"7.0.0-canary.72ff42330.0","@material/animation":"7.0.0-canary.72ff42330.0","@material/typography":"7.0.0-canary.72ff42330.0","@material/feature-targeting":"7.0.0-canary.72ff42330.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_7.0.0-canary.72ff42330.0_1591029887158_0.8834887680267602","host":"s3://npm-registry-packages"}},"7.0.0-canary.9ea52070f.0":{"name":"@material/slider","version":"7.0.0-canary.9ea52070f.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@7.0.0-canary.9ea52070f.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"6605de560b4d2b544371290968a345cec537df0e","tarball":"https://registry.npmjs.org/@material/slider/-/slider-7.0.0-canary.9ea52070f.0.tgz","fileCount":36,"integrity":"sha512-gEVD5u4jyNgM0UXTOyGSjTKEEONLTyVYXNLLnZnVWEiwnwL/NNcxE/mMGyHy/OoKl4+dv2ObnUOMHMI9x0AbnA==","signatures":[{"sig":"MEQCIHjsMS7QDayNn+hr4manRYOSWoAtj+3ZkaicTb7MnRy8AiB1WApcWiQ7bp5syVivHIc5d9Ei2N1D0jeGfez3OtLlqg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":394452,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe1TGbCRA9TVsSAnZWagAAEvsP/jHRgwiBoF/DXf8bKmGh\n8jkYixh8TOwHJtqAViMRFVwC5gK4rKy+YN/tV57ZtBursyphYptMC4u+Tx0F\n4cg5NVaKEBjqs4PDN3fLWmA84T2IyS8C/G1YTEzWF+m5/c/IKFSvIeUOibkM\nQuu5J3sLHnJVvTDzYstx8wItfsS7MOqLteS2d98+aI6bXV5GrQ0P3RNhoMzu\nwrBTuzIqjxewXfIHbBhxgb+Ay4gmB90vYPDY7WB+c6qEgEePoiefJmPZJBct\nrQtgj60cwjXXF6CYxCXECpbCniEl+wIh+UysfCoD5j3zODP75Am4Easwfahc\nJHlQ8Yj5bT9hy9y2bniXqAHbmuoCRI6b9pWQIB1WaJ93OKDlka7Tm29MVtNs\nRORzF5KrCQm+Ww0EAd+VhKFLs+yT4O/huoqaPR2PHqeFf1frt96okje3xRzh\nx+z1bdRaMNyCcsg9wtCrs9uDFNiSQk+FmQOzbgSuZNZg5NmnT3bdZXnETLtX\n+etuCMs33KlEVS44yKEx0NESg5rPgk3kQ9d2FHb9gkEfo+lkGIc8DgQ6hhUJ\nD1xInDjtybxUWhCprRyTzdqJwEVKh8P9QvOm0IcJxE/dLe4C51eVnAL97GMM\ne+LDMa0kGMOkqnKi3n5fgWSpLCK2kOgLtDpiny8IgQiZ7W1lsvKKE54gwLF0\nnasA\r\n=geEV\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"1c7aa3231ba2d87e7abffc33fbc156ee0889131a","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.20.1","dependencies":{"tslib":"^1.9.3","@material/dom":"7.0.0-canary.9ea52070f.0","@material/rtl":"7.0.0-canary.9ea52070f.0","@material/base":"7.0.0-canary.9ea52070f.0","@material/theme":"7.0.0-canary.9ea52070f.0","@material/animation":"7.0.0-canary.9ea52070f.0","@material/typography":"7.0.0-canary.9ea52070f.0","@material/feature-targeting":"7.0.0-canary.9ea52070f.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_7.0.0-canary.9ea52070f.0_1591030171147_0.1394148438382865","host":"s3://npm-registry-packages"}},"7.0.0-canary.d86ad3b60.0":{"name":"@material/slider","version":"7.0.0-canary.d86ad3b60.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@7.0.0-canary.d86ad3b60.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"362fc927fe462cad5ae205e31b50ceae7eb34589","tarball":"https://registry.npmjs.org/@material/slider/-/slider-7.0.0-canary.d86ad3b60.0.tgz","fileCount":36,"integrity":"sha512-JXaGedpvR+tE+8F0SkMcjrtVSliR/y6iw0vxPm/4IRXA8E4/4kvd9O0Emhv3+/v4OI7aDKOOqtRVVz9+E6V6+A==","signatures":[{"sig":"MEUCIQCAgb+xwiqSMpvBqryD1y6Xh+B+2LUJBMY1GNXxtfyx3wIgEBkWFooDAaM8xVNH9ejByTMTxGroJv0L1Hw4Z8eFln4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":394452,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe1T+dCRA9TVsSAnZWagAAjYQP/1ElHPQN5wmkwKP+txn9\nw3taMSrMZ9R+xOxzrLQa0z8bcIobDnrSuBYDXX1Z1w8mfDLKj8arnbesTRFP\n+qYO5dtVeprc8+83wM6Jfy57jTjVn1GsRKrmvM4l+6XSd7YfyiTuYGZDysrx\nTm0l9CAv+Bze247qOZfxbBXJCFrH5/soiVuu0vLqxHJGNcnIIIH0oUYe5aKJ\n1R24y125A0W9pcn6V6f1C+rR/odXcHuH3UJlM1Q/B60AnJm7KCO09Nx+32SB\nejWgnb61B90eWi/2Xjr3vDJxxd3B4fxOK8gm3MRvcN9nwFg5ehNFCf97zttu\nYeO6cGNUWgCEVwoEN0eQMz4nlW5T/GvSmOqxfR6PUN/S43aeBLZytyhQ2Lxg\ngK8tt1sJyd6Uv6zwDtQSfJH3DZGkLdFNzKuVD1B+qrfnBMnvi0Fh6+Pv1IoS\nE+4lzoXtUSgiAEiFTsE8SfBQF21OdyGMzHqTLgjDu5FIFVAVO29Se3lLhJY+\n9dycuYFOk9odholN3Bf8LK7zLYDtpYE46GtN3hFETRG2jDzT8zvDqKdsy0T7\nhxRaWntBoj9RzVLwI66xh9D8PM8+/EiqUpkW2gdhjU+XjKS2wJCi2vwzizpJ\niIu3bYNkQpzHTPbkICuiJJMV9XbR8VGmo9GHtUNJYddfW+/WEXgHWSaL8s3G\n4Hnq\r\n=v3iK\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"ff64ee77c98ab8a932f9397689714c078eb9fd02","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.20.1","dependencies":{"tslib":"^1.9.3","@material/dom":"7.0.0-canary.d86ad3b60.0","@material/rtl":"7.0.0-canary.d86ad3b60.0","@material/base":"7.0.0-canary.d86ad3b60.0","@material/theme":"7.0.0-canary.d86ad3b60.0","@material/animation":"7.0.0-canary.d86ad3b60.0","@material/typography":"7.0.0-canary.d86ad3b60.0","@material/feature-targeting":"7.0.0-canary.d86ad3b60.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_7.0.0-canary.d86ad3b60.0_1591033757034_0.6722150756023619","host":"s3://npm-registry-packages"}},"7.0.0-canary.b9776b1d0.0":{"name":"@material/slider","version":"7.0.0-canary.b9776b1d0.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@7.0.0-canary.b9776b1d0.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"efa43994398d05a731dd27a3dcf5dcee20820791","tarball":"https://registry.npmjs.org/@material/slider/-/slider-7.0.0-canary.b9776b1d0.0.tgz","fileCount":36,"integrity":"sha512-kS1BIbJo/7wI7+MErbZ9jWFPQ0F8Jkm5cdJI3iDqRc5TTee5ZSaSdSzjDOWF8FswTyCLA/brTSecVZmIXDdHSQ==","signatures":[{"sig":"MEYCIQDyELQ6xgPpnO+XPl4QQ7oogFkNdZ9POkzAq5TA9UpiegIhAJ1wiCsEC/ik5jAYiAlx2FyQntyjdkTFRdhpO3DxcLks","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":394452,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe1UhcCRA9TVsSAnZWagAAOfwQAI/i5DXsM2NdIfUC4YCn\nw48sF7S5cF5BkMNSiEpKGL+tJADarHHSieUXcRtDyJUrE0PNBbb5Grv17EaG\nkSzOATHo/LT/l+ISwSUn9GX6Nr3vmb/vJYSwp97BhP/RqlacIP6Shqt85tM/\nBFPud/IDQUca+UcXwXzJ812iYgIDtR/oEeSXv+w1ixyXVGDdllP6XOvSED+f\n1nPYEW66tZU1vbvfNth5tUGAEL2ddxU5LWU/64Aej6ymUUfNz9+nesTJVJ4s\nslYnPUgNtd9ht9kZrCDQkzx99gwJe6vYZOfwUQFBqgcNgdCIsp6FcXeUe/Ar\ne4uXtdjO6j+syDbK/xhDCl5eoEAEvL6bkrbQINdqCMwlkqr/W/0QWvWwpkH2\nB+/KtcEpqke+PJ8ROjbhbn1Zuo8hZxilhZuCj8NFKJOW7Fr1NNhILa8rCCQk\nshctZ07OGgTZ1V624pLgBZ0VVEBDOHJzwZtlMC4IyqLDuGLR6gpdeMLeOep7\nts0v8JUizX4tmZYhuVYQ29ulNIANZl44BBtS1CAu+dY7FjkLOzQ3ziqm5hAt\nGKH2yX/s4Hfvf11Auvuuky1bacxvVuNeWpK5a14Lbncks9WIZZMXYAF1EReU\nlS63+CZDzPZMCHRtXNrkC9aFlxFpSu9P3Qm4yk8vKzGdtYMwnB2pGxLldEaV\nZyI7\r\n=rHyt\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"d43f6785558859ab233dac12d042ada9fb8c1b84","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.20.1","dependencies":{"tslib":"^1.9.3","@material/dom":"7.0.0-canary.b9776b1d0.0","@material/rtl":"7.0.0-canary.b9776b1d0.0","@material/base":"7.0.0-canary.b9776b1d0.0","@material/theme":"7.0.0-canary.b9776b1d0.0","@material/animation":"7.0.0-canary.b9776b1d0.0","@material/typography":"7.0.0-canary.b9776b1d0.0","@material/feature-targeting":"7.0.0-canary.b9776b1d0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_7.0.0-canary.b9776b1d0.0_1591035995847_0.7275352032899514","host":"s3://npm-registry-packages"}},"7.0.0-canary.ba6f7c294.0":{"name":"@material/slider","version":"7.0.0-canary.ba6f7c294.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@7.0.0-canary.ba6f7c294.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"62ac983c4e8d9b06f105b176fb77589b89247f13","tarball":"https://registry.npmjs.org/@material/slider/-/slider-7.0.0-canary.ba6f7c294.0.tgz","fileCount":36,"integrity":"sha512-Iq6Wjg5USq79EsTr1lBZ1ypcw/sEGOz7f4L0Ov83xplYlB2y/XuM6+78TNw+rqzJ4Yy3lwPZDWiByxSSU77+VA==","signatures":[{"sig":"MEUCIHT0PWy0ltGV+UYus+sfeHcnhqJ5jkoLfzOmewtgyaPRAiEAt/xXiDViLcBVmtUVdK4sHV1RGZre/Tb9gR4j4iCQFkA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":394452,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe1oZRCRA9TVsSAnZWagAAq9AP/3cJoTO/CasU0jpnUMJw\nXzhd0BT1cy40UeGvoOeH4BGJ2jypQJjzCwObwi8+Lk1CO2xOSDZSPPtZp/xZ\nVphc/hOZSGMcUwLaM6Y5J4yZNcZ4DOoTkDJ4UnCd4zDqQXZJG6rlp7wG1rgB\nUwpp3AZ6u9GC23quN0qR/Y2orUa7XC2UoRocrLGi+dEE79tHnrb2JEjI4+fr\nQFEiu67CTTCxee3gbkhMF9+Cvls2qsELfJmXLEho2RmHO9T2vRlsGLzHoINi\n2HcAZ4XTCOpX7kjV03FO+pLzZaIp5gSEgcsGqMSkDlJCCtB/wx1eWjmoC5ZW\nv1WTzU6RWf5ZOWaSip2FBFG+Tkd7VPqptYbt3W7wtAl6D2W221g90JCNMzFB\nl7DagqFhMJjhKWV1b3JJN1x+eTPWnY91tGVMNh6VDmBSzuq0OfXZZaPz/kDV\n+p/oFBmCxk+eS9H7IAeKf04b/tTvvWEgZFv20vUI+JvZE/M4T1n+GZsJyAw1\nkQsIFkcNK0vyx4P74M2nEyObOhfYgmGuxHT25aKDNcUm69oMri2msrSx+23M\nrxEuXahLnn0V/5n3krhMsdeKtmvVU+oerTNEMsOHuEdwS6yN885FJsmzPjCc\nKfGcajbAEF0h8AOHkQlo9RHbZ5JWyMw+CH8R1HhuWwRHc6MJmW31Mk9cQ59E\nwoBl\r\n=XY3v\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"f181fece0cab022dd478b7c2f4b768aa14f7ebf7","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.20.1","dependencies":{"tslib":"^1.9.3","@material/dom":"7.0.0-canary.ba6f7c294.0","@material/rtl":"7.0.0-canary.ba6f7c294.0","@material/base":"7.0.0-canary.ba6f7c294.0","@material/theme":"7.0.0-canary.ba6f7c294.0","@material/animation":"7.0.0-canary.ba6f7c294.0","@material/typography":"7.0.0-canary.ba6f7c294.0","@material/feature-targeting":"7.0.0-canary.ba6f7c294.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_7.0.0-canary.ba6f7c294.0_1591117393060_0.1706686904144945","host":"s3://npm-registry-packages"}},"7.0.0-canary.cf3b664ab.0":{"name":"@material/slider","version":"7.0.0-canary.cf3b664ab.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@7.0.0-canary.cf3b664ab.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"f9bc6de44557d2aad2905a9f02a3d53e8e677bd2","tarball":"https://registry.npmjs.org/@material/slider/-/slider-7.0.0-canary.cf3b664ab.0.tgz","fileCount":36,"integrity":"sha512-aYcAUUwoNtNtyjkOkXm+8IJ/cz6+INW2C2OZ74eUUCRaBsk+7yAt+AcW5/rezsujejLQG1ky2kUczc/1nF1CbQ==","signatures":[{"sig":"MEQCIHKX8oetorsLpz9eoEyTlv5UsOTh9SVTI/fJJ3QVG0bVAiAUXIxo7HXU69chDbYrZOoFe0JSAuiJh9j+zQWxeHo8Qg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":394452,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe1plECRA9TVsSAnZWagAAxh0P/1skYnL8Te0UHYcqDQAk\nkVs5mQ9Le4/ubYlSfrCKcYRTVCgd2yfuDxH4uTIG4C4ydhi43jSpZHQmuJGe\nliwMD50YfmAwxn7yJWMrQyUcOqv0JjxTqFez73/lesZb2eO33FongkY4Stlh\nlBBiaA3oThL6FdkQDD3vi+l4W1OA2MgqBdyI9+f349N5ubc0M5CERtjrGN5x\nPgL0RjNaOOJIejby2txgEbt7zAF/Oyhq10tZ/iH4UUx5gb4pnEE2lrNNT+bl\ncFgGerkcS6rjbJsoat+mpn7AeQlZZCLzBx6Lk3kM6zeARiG2LJkvnKdzzTQ9\n++pQVogiZU78vP2lgfklcy7RxicneFk2yQr7TtXDuyJUgfh6Ekvc/2DrPdQP\nAqs9Wn9FA4EoUk6vUIGskfvJ81yd86TSd1Gq9bPkbZv7qLeJ3I/yYA3zmiHy\ntHAOg4UvhLq2S6WYxWnwt0CkhXWP8kc3J7dqskMroLAaCyQ844UQQyGE8dXr\nAAX2Ja5zSbLUYbKoQSno5wOyDJ4djsbZe/me0Cg0q0WB2G59CvG2nDO7xcXV\nL2StI8MDYX2hTk96mmubmuvJYUp8F645f3lZEJOmtEbOilUwsIBdI7ETxrRI\nQTAT8HEOz1jVpmMF8iJvybwkNRgeyFJUZhpoNeHuM1qeduZNoDn8++f+byRc\n2hWs\r\n=B26o\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"708ed8576095ca5e673311fcd970680f855a7b59","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.20.1","dependencies":{"tslib":"^1.9.3","@material/dom":"7.0.0-canary.cf3b664ab.0","@material/rtl":"7.0.0-canary.cf3b664ab.0","@material/base":"7.0.0-canary.cf3b664ab.0","@material/theme":"7.0.0-canary.cf3b664ab.0","@material/animation":"7.0.0-canary.cf3b664ab.0","@material/typography":"7.0.0-canary.cf3b664ab.0","@material/feature-targeting":"7.0.0-canary.cf3b664ab.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_7.0.0-canary.cf3b664ab.0_1591122244435_0.9823396506441295","host":"s3://npm-registry-packages"}},"7.0.0-canary.4ba3c9a31.0":{"name":"@material/slider","version":"7.0.0-canary.4ba3c9a31.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@7.0.0-canary.4ba3c9a31.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"bbfb618af3a80a28c1d5ff9cd7ed52d27c483b3c","tarball":"https://registry.npmjs.org/@material/slider/-/slider-7.0.0-canary.4ba3c9a31.0.tgz","fileCount":36,"integrity":"sha512-T5wigKlE9neR5uNcaRyHLFAQmgu/vkd+PRdTfJcvZUy4GLfYYWj4BZcv0+OU1qCqikf+ndIV9tFPGiCqO7Q0Ig==","signatures":[{"sig":"MEUCIHeLeSeu9Ve9Sk7WSVtaLg78D6BrHamtTSTBT/VItL1YAiEAmj+GjVH0Sz2TAkxDFWvmCgLqk/L8HzhtndW8zWGkwgc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":394452,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe1uZQCRA9TVsSAnZWagAASjoP/0Jc7Ch4Cec2XJjSLr+G\nUzz6fhMYMg4y5MS75B2C1zEqc7Q6/Sdx9RQLz/cGQh0V+Pkub/Kvb6SNMTRr\n7amPUF/VaND9hv+X2J0bXr40b1UGomIc+ETr7EDgzd/yNm/R8mIeEZerIk6g\nyRBKJLlspd8sGCaX8VLyAqTx7GkpZVZtrEejHz8VTD+Il9ZVR47qa6uWLuXm\ndY6LqT2UyPisI5CR2cnzkGNFs6Gehq02wyiJlWb8Mff6NRjRSU+vvxgU/pPU\nLkGkS3qkBPQ+9abcyzsFps5mYEWsqz89CmdXkDw2NYkUYrKS8bRGruWFEedg\nI31a/31L/nXv1cz9+iSoFrcEWIAiYecWHgKMsKjs7LfJADwiU7HS+lLLgLlI\n2d8MSVw2FUzElGJhKoRV637bRsOClFLy/PikQDyY/8794D6eU7mlSrFihQSJ\n14dULEews7Cx9SxUvG4yZSCOFk4erXm7nopltUSQ1ImSxODGFH9OxaUA6Spj\nZyULyECts+/FVBaa//R0n1CgkB5t9hWH7U1cXBUjrYzrI8w6SQSI1iAKx2mi\n8/IAWKihfDyAIq+EfFx/0GRx6LVU8htJavomfQ6Q2IGzszyMQDQN4Z2ZoKUg\n9GXKjrIEGMj5ceF4Z/Zv6lNle83POpl2LgiIWzT+0D234Pz7dMboJs/LgA8k\njP7o\r\n=Y31z\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"cf7f823aac5f803db06863c865c07f432ec4fd09","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.20.1","dependencies":{"tslib":"^1.9.3","@material/dom":"7.0.0-canary.4ba3c9a31.0","@material/rtl":"7.0.0-canary.4ba3c9a31.0","@material/base":"7.0.0-canary.4ba3c9a31.0","@material/theme":"7.0.0-canary.4ba3c9a31.0","@material/animation":"7.0.0-canary.4ba3c9a31.0","@material/typography":"7.0.0-canary.4ba3c9a31.0","@material/feature-targeting":"7.0.0-canary.4ba3c9a31.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_7.0.0-canary.4ba3c9a31.0_1591141968290_0.5233975064874248","host":"s3://npm-registry-packages"}},"7.0.0-canary.388b042c7.0":{"name":"@material/slider","version":"7.0.0-canary.388b042c7.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@7.0.0-canary.388b042c7.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"83a1b491a6cbe11d722ec8ac679a5c08185406d5","tarball":"https://registry.npmjs.org/@material/slider/-/slider-7.0.0-canary.388b042c7.0.tgz","fileCount":36,"integrity":"sha512-d8vsF9oFQ0QoqxE0+ecIJz4nK93Q6H+vc1q1hwrQyM5uxOtKQ18GghcpFsyktdrAIW+5cxUBWUCI6nNaDx6NBw==","signatures":[{"sig":"MEYCIQDNjIGVacp81Wz/28IrCuXrXd1XeOSVRd4mW/JhIyB7AgIhAKNYQoWqyAXTfGzrVn5y94P+SQzZWsVgwIaqY+2HysiJ","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":394452,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe16ngCRA9TVsSAnZWagAAVYwP+wWeCT4s8bPX2M9g7aY0\nhYQogOqr9nlqwFKC3SLND5btC9Jv71yvbjlsKvIHJ/VPLD1vidG55igyrkkM\nptl+GA6NTUgsfAD2t8jaUfa9r3LBcsrbD/4lmSTiKB2uMhGLzzKH4dVcay/2\n1GFLmwa+jKheRhCEjugYVtYpERBzOlxCfkWN2wJxHUaCDdUBVblymkm3bLQi\nKE9yAnk8ST8DYtG+kkj5Wmb/X+SRqSNLTP8BHoMe4mnqCmuhzrdX3T993n62\nX+X+Aee62HzBGS1Cxd3QcxjsJou7/Adn+VFVCtQMUeHyuSwNOKc3xm/yAZ/b\nhyN+HWU5Xzz8kYNDrc7cZ0KIZXeZ4rcHHQwfUmnoLoX6JJD6Z5SIh96/n+Cg\nJ05iShj72QG6oghgUQGdCbdTipkHXX5bIvntmU7RolsCxKtBEcKS/rkYhNNh\nuAV3LaQO6CEKVhG/1cKBUd/5MomudJ8uv6nFCjdpfVuOu/ObkY+4tH6tMXF+\nf3ka4+k20Q71GNxIbzqU+tExw9aklhJ9EnCbsj4lyUQ085+NRVb2fnK8oIHd\niIrR8rJwJc7FV2faBLsBSYYETd+jr/hVLg5ZE2Wj/7fuOECHVOciCb55FMtS\nkV08YyedeAUOyLslJiLXwurpkAL5kkWfAYerSrXHo4pr0H9YHjebBnoFDTxi\nz47h\r\n=Ar39\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"7c9ddf94f1ba2ee332d7acea141e5022b58f79ff","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.20.1","dependencies":{"tslib":"^1.9.3","@material/dom":"7.0.0-canary.388b042c7.0","@material/rtl":"7.0.0-canary.388b042c7.0","@material/base":"7.0.0-canary.388b042c7.0","@material/theme":"7.0.0-canary.388b042c7.0","@material/animation":"7.0.0-canary.388b042c7.0","@material/typography":"7.0.0-canary.388b042c7.0","@material/feature-targeting":"7.0.0-canary.388b042c7.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_7.0.0-canary.388b042c7.0_1591192031597_0.5344784872036941","host":"s3://npm-registry-packages"}},"7.0.0-canary.cca1ca84d.0":{"name":"@material/slider","version":"7.0.0-canary.cca1ca84d.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@7.0.0-canary.cca1ca84d.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"6dd56bf3814e06683bbd334ad739e7c951150775","tarball":"https://registry.npmjs.org/@material/slider/-/slider-7.0.0-canary.cca1ca84d.0.tgz","fileCount":36,"integrity":"sha512-t17tAXuTUP14zdH0IexiBHaATWB8+uargIw2eh6bPi4il8HKvg+Ki17/RMl9PgRGPACu5eDPIc39yQQe0qJIeQ==","signatures":[{"sig":"MEYCIQC04M/yBonOz32yhhSX0opNGBfFhlK5YOtsJZXwhgKzlAIhAKv6xogTB8MiLA6uJl8fBdUTcUtbzKCZ3D8DUZ351KU2","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":394452,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe18nPCRA9TVsSAnZWagAAHXwQAJHZdZzv7nshZC1YJa/n\nKl/4bFTJ7H/iABRfi+tNBPxd5fQTK+yG1YJLWj1P36HAogNGZQBA0+BkdDSF\nOTllOECrV/qDJplQATx0O9vHPQu3PYG25SSI7xLTbat9Tj8SYrHWdEiRGeLW\nijYMKB6M1P4Q0E9WLc2EokivqKQYjH7Dc4PmeRuOC3kPBV9nN0FVZsbEopMp\nydYT4Q8HgO5SCR5vkAcsDswGtgTa74Ji3pcl3XeAY1CpAiVs6oaKYPt4u/zJ\nER1NKwhPhhjvjHsff2+TMVIKukr7bNVtPucpYHWW58QYGfvfDnsxSN0CPZD3\nLxJaXwZrJYTVRP2dIuGce3INrUxuRRfZ+CdWU+cLXIc30DuuTi2UDKVOut3P\nmbVzPXOJ6ehTHwwKDD15FlFNYf35H+KrXT52P53hb+wYzpkH/qliCHVycroT\n7ll4+Ph9YaYYvbpRivqy6E83Bh3T68RSyXY506cjgSDm+Vjl+jB7CDAMuGFq\nLO48z1YDoCOJ8CBR6Xh6hiLCt3tGz9dmlQmB+FAUyWLMpZE4WuVoEnKislyt\n/DJv5zfCOonMMa5SizkGf2Bw1Ks1LLvst1h7AJiOkC3Vwd92r/RgDDsnSISc\nYAY5ufeAwt4izk32zooF8j9evZs7xasxX13sYnQOtoY4qieDZw1BS1+vdUdb\njNZ8\r\n=EHuz\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"f154bcb37f9df5f07d3c6dd0c397a436794ed609","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.20.1","dependencies":{"tslib":"^1.9.3","@material/dom":"7.0.0-canary.cca1ca84d.0","@material/rtl":"7.0.0-canary.cca1ca84d.0","@material/base":"7.0.0-canary.cca1ca84d.0","@material/theme":"7.0.0-canary.cca1ca84d.0","@material/animation":"7.0.0-canary.cca1ca84d.0","@material/typography":"7.0.0-canary.cca1ca84d.0","@material/feature-targeting":"7.0.0-canary.cca1ca84d.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_7.0.0-canary.cca1ca84d.0_1591200206437_0.9041286494940333","host":"s3://npm-registry-packages"}},"7.0.0-canary.9b0b5f2e0.0":{"name":"@material/slider","version":"7.0.0-canary.9b0b5f2e0.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@7.0.0-canary.9b0b5f2e0.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"6a7d21abcd64011fefd81bab26686ae2872e6ef9","tarball":"https://registry.npmjs.org/@material/slider/-/slider-7.0.0-canary.9b0b5f2e0.0.tgz","fileCount":36,"integrity":"sha512-+ikDTzxucbD3SYRSund4HRdFZ4CwSO+sSApZVZu1u0c/6Uo+Vev8u/RAecZXmdtYXQkT2uWOTuVYmq+dsQS8pw==","signatures":[{"sig":"MEQCIBknxrGBeUZmxN8Dc6i/4tah0PFfZIhuufpSzN67ZEN8AiBvU2y3lq3JYUk+HLEs8vtD/6qpy3SLy1Xv7YRMUl1Lig==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":394452,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe1/LACRA9TVsSAnZWagAAgswP/RNyIMpR4RVZe164I56W\nySF0Mbywtx2poRcgw9kHt20vVA/aZh1CTYdevQqLJuNygbUn1Th4FyTM6p/6\n/6Bj8O/rwR7soM/kWj/ZvgOoSZ1IBvsu0IAirdtUP6CAAhjY1+gkv8PqsRDT\no0yA3eKIfLN25gp1792LP7hQuXrwTyRm9SUzPdH63xAEusCD+EuC++kCC7nQ\njL/f768935LmdielV7EwP5WLLTV56X4gqjN59IZ9YRdykI+xJdjxxUzyZ4+a\n/hRrK6ND9GVHrlxnCsihrphEHXuia5IYb5NyV5YN/uLQL6vIRjpoWuAEVmPm\nBegASVu6F1ZET0AzeRa7dqdTGaFmMFHyu1mIv5/ESxgBjGNTCdOS4IQzbtsO\n6LstK74g0OUjFsPLWmX8aLrerQ0csSMZMVxNHLhA05bIApyUI/Cj7bQWNnVJ\nuQuzKXrC2XYRLkWBEQ8rJ//ayDwuAW53/NMfjpHlzno2iOzsn3IDkTRp/0GN\nmDohMri3st6pY7LhYWdxVBEySHs0oLEt7IdX9ObqhNm6NCwR0yEwEOY2ilww\nmOvgvtSyGdgFYfM259OfgL8lqGZ2GI6ejQ+IFPyWjGgiJLbkHQQGGpoSvWcS\niaDoHY+rXtH1TRnRY+EHMBidRMdfd1nFH6LfPsYnRz/TArT0uWMhZKl/8Nos\ntjLZ\r\n=twrM\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"35348e60387f88e73ce8e1376b7f352877821cb5","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.20.1","dependencies":{"tslib":"^1.9.3","@material/dom":"7.0.0-canary.9b0b5f2e0.0","@material/rtl":"7.0.0-canary.9b0b5f2e0.0","@material/base":"7.0.0-canary.9b0b5f2e0.0","@material/theme":"7.0.0-canary.9b0b5f2e0.0","@material/animation":"7.0.0-canary.9b0b5f2e0.0","@material/typography":"7.0.0-canary.9b0b5f2e0.0","@material/feature-targeting":"7.0.0-canary.9b0b5f2e0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_7.0.0-canary.9b0b5f2e0.0_1591210688065_0.5187857108414025","host":"s3://npm-registry-packages"}},"7.0.0-canary.0a7895f4d.0":{"name":"@material/slider","version":"7.0.0-canary.0a7895f4d.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@7.0.0-canary.0a7895f4d.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"f60c454c1590dea8aa639556ff91ba6f00d83ff9","tarball":"https://registry.npmjs.org/@material/slider/-/slider-7.0.0-canary.0a7895f4d.0.tgz","fileCount":36,"integrity":"sha512-/7Br7t3biEZoLAWjPKCeEkZKujKmjF/xZfpRpYCBGNUrP4ZrGSmq5EcenS3McVUphtdrcP8e6OwocOJgp3Tpdg==","signatures":[{"sig":"MEQCIAL7eDVieK9GUDzGUK3o/wQI0TNzTFvLZc3FnbTMPXB5AiA/VvNGaHoixTcz28GA2nqQiUOvHUJEPZtfVwBxGs4UGg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":394452,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe2BGPCRA9TVsSAnZWagAAZycQAINU1A1CwwjE+S4+rrTG\nS2lPhGPo02fxkGWcW+hpkuWvbIHiMeprBXeoYdMny4ow8/jkJxf/JXl2Q5pO\ncloOZo8BPnwDg+RWIdEvGt5sqFI3ZMQfgs2eUK3HBM3NJxLF+XNaEas8go16\n7PpKAZ7bji6G6kyAUd2MDzsTo/VT+YPELFgiyUB0657Bu3lJp0AFEIzULW8Y\n9ZcYJZL4TwBVqez8Yk12GyIKDcGyZPCn5efMEkvPBx3kbWCwJ/7W8xv5s7BN\nTNJQwzrHQKoaUY4u/mMGND+ebFIm8hEz+W898a68bRLkff1wEDMKNJ1Sob+O\n5rt7mwnUcKKrln2j3090HMqEQdIG6sQ5TWSIJn8vinQJjfmHpCVbcPc4lnoq\nee0wEoRz2UVyTWmOtwBaunSlFkmyQXo9OPKqd6VNc1CrJw9ySKal6WVp65hm\nfthoYW8BnZwxh2sdeBRBJbNNGRCPw39tsgjKpgHnlzqqy6hG9geLy6o9S1jg\nGnUrDoxOYu+HlDUS23CYlV2mF4oGZz3Ki5IYM1oOFRaI6nhzxPdE69YtjxAC\nvBg1pU1jqeP4QrtFejJaC8kZa9uIA4KX95C0dTL2hJsGkAiGySN//FKW0quR\nswtGzUtowDlh9R7XW/vyg3mZATWAAaWVB+CuYVvUACkc4eWJ9ppT55GWsbtE\nP4dy\r\n=jmdv\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"929c9bffd0636490958fcf34e0b40578b44a9cd1","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.20.1","dependencies":{"tslib":"^1.9.3","@material/dom":"7.0.0-canary.0a7895f4d.0","@material/rtl":"7.0.0-canary.0a7895f4d.0","@material/base":"7.0.0-canary.0a7895f4d.0","@material/theme":"7.0.0-canary.0a7895f4d.0","@material/animation":"7.0.0-canary.0a7895f4d.0","@material/typography":"7.0.0-canary.0a7895f4d.0","@material/feature-targeting":"7.0.0-canary.0a7895f4d.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_7.0.0-canary.0a7895f4d.0_1591218574329_0.1253680120664067","host":"s3://npm-registry-packages"}},"7.0.0-canary.7461aad68.0":{"name":"@material/slider","version":"7.0.0-canary.7461aad68.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@7.0.0-canary.7461aad68.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"098f3d38bdf277878b8ade5c252c61011024b8b3","tarball":"https://registry.npmjs.org/@material/slider/-/slider-7.0.0-canary.7461aad68.0.tgz","fileCount":36,"integrity":"sha512-9jN3lRa4AHO5kkeudvzCIFqQc5wMcdf8O5lB1WwCSGLpAGzTNkeF8u2JvBHtffDhjbC8NrZP4LiN9iIfyE8YxA==","signatures":[{"sig":"MEUCIB17V1jLH1Eb1mVvFiWfcQ08yXThINjB/38WxSZ5Pa/uAiEApN4KAH4OLXQixPnDOgZBPzOjF9ATDBYAUIr+kISVt5w=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":394452,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe2CByCRA9TVsSAnZWagAAX/MP/1ZrRSGBD6ay5rmButYR\nBoL67smU3VjSdbrf6o+vyk/+1+Z15v/EM4Q4o+fES9cDG1iSihUXsYTZ4I9s\nAfJoJQdnSaCSPxEzOv/oee4xzojy2IJr44QT5Lp9QsA0eAhGIre/cR4TICao\nO/x6Y8UKA73DFuU0HbcsPNMu41IDhahaiFU4wWAMwle0UPBK059bgdeDADud\n7COpTG142Ja+0PBg/Wyv+gCvQ5yU601+7mWQebSTKId0u59tNztgxX3nzP1G\nTnTc45FqjD6OQ3/CuZpWb9cNfBxS6JVC9tLliKXVH8Ndv2eLNxLRz1/GqoUy\nRyeiA+lWAsoeeXXw9YuGhfwPlLboa7Zj0BAMFLxq8Wzo3TAjJkOnT7MRoC8b\nuzRBJ7B6rBOF2kPSOugtJPMq2VHfAkAWmc8doRXFC8BWiiG5CWvHEQhzUON9\n9M+E8C+pvyUbKrjtATGBqdF7AJt8yVyrg/oMX0+PkDzC2bJhnpIn5/clIxIo\n9mewSqxHREhpNM4LFk/Z/lptBtMW+hhdlhHADRid6zinC1FCcpOWIZGudLJ5\ndwEnnbvFrKon18Ou0hBa/x8GeWCFz6BzFnfRYGyE1UP/ayfHza2wYjb6Y8YM\naG9knTo6GWgMGDxQVV+TUTn6C2bjFhckShPyy45F1xtNb3HsSMu72zZthC43\ntcgH\r\n=VsKo\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"f9166e39b20f57c6b5cdad1ce684529ca891bd81","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.20.1","dependencies":{"tslib":"^1.9.3","@material/dom":"7.0.0-canary.7461aad68.0","@material/rtl":"7.0.0-canary.7461aad68.0","@material/base":"7.0.0-canary.7461aad68.0","@material/theme":"7.0.0-canary.7461aad68.0","@material/animation":"7.0.0-canary.7461aad68.0","@material/typography":"7.0.0-canary.7461aad68.0","@material/feature-targeting":"7.0.0-canary.7461aad68.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_7.0.0-canary.7461aad68.0_1591222385556_0.3634076963238049","host":"s3://npm-registry-packages"}},"7.0.0-canary.a0dc2b5c4.0":{"name":"@material/slider","version":"7.0.0-canary.a0dc2b5c4.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@7.0.0-canary.a0dc2b5c4.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"88406f5e389b9569389809ba93901262a4f3dda5","tarball":"https://registry.npmjs.org/@material/slider/-/slider-7.0.0-canary.a0dc2b5c4.0.tgz","fileCount":36,"integrity":"sha512-WpjtqjIp3MkOL1d8uTo4grfm+5RsOZckOSWD2V/jnFw2OVxo5vbyub1NpEoBr0TJtB1ZmFIoS5ENNWbi1IQw9Q==","signatures":[{"sig":"MEQCIE8vRhSJ0S2IeZydRCQObOAuAXN1gbjiz20xeEUjSas9AiBs7EUOqnPmNzgfQgphFnwsku7JfZw/Rpc/2SsljXKPKg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":394452,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe2WRRCRA9TVsSAnZWagAAMbIP+gI8g34OvGlD2q8GmmYU\nbn6tXwFwd6DpatOP0YqEJRPGVtiZN114xtKBSDBLtpHIZKt3HoL9uqmesXaa\nfjhKphD6DD9CDpzS8XS8gRXOtKpaG92nmJ7rhFtxyy2stDsRN8Ge3xGIY6K6\nEuMBwTUFRxMHiRGug1SfsA5WUOkX1INH1KY5BFaryR4ilR5PX1Hz+7hwMbbk\nzQ0Fwg3v8quzf8x3b/x4i5uNBJ+c43gNf0EuhE4mEYMtc82rIfR3y0vDOaAP\npnHbduya0iz0fKRgimd+n/NE59S2mcYPxfMnYUMnaXZCSh+Y+TEA+EOdDbx/\n1b5W5GqH/zZg7M+SoIqqmAWjhy0yMILZX/TS8CpRpvxxzUq3X38tAVBJ6FQ7\n8CMooNwhcyK+UK94V9heKHakwwH4VH5H6SDadPe1pKRjWQQ6dKF/Np5yvtx5\nuJq4Ce6HpdUoevLK6f1Gsd4BFGGMnur0VCph++oJr7wMk98y4WQYLTF/o9at\nlaxFAbrxPpvwZOZwUAYB+9RZzgfe7UTtVhPBxXQ/jzBHN5vRN9HJ7o+ejNDU\nnDZFPWVQEe7bE2ER/C1wUzySFolqEbbwOQJ13DT1Fh3qZm+znCLwyQ/Sy8uH\n66cyZS1Tsm+G4i9Q27zPi0w4dGKskvqtrHj+feFX2RJstHAVM/BWGu/3Wc+0\n/2nC\r\n=PVFp\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"5970f3857673cb8c032d0d4532a6cf1209f94c47","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.20.1","dependencies":{"tslib":"^1.9.3","@material/dom":"7.0.0-canary.a0dc2b5c4.0","@material/rtl":"7.0.0-canary.a0dc2b5c4.0","@material/base":"7.0.0-canary.a0dc2b5c4.0","@material/theme":"7.0.0-canary.a0dc2b5c4.0","@material/animation":"7.0.0-canary.a0dc2b5c4.0","@material/typography":"7.0.0-canary.a0dc2b5c4.0","@material/feature-targeting":"7.0.0-canary.a0dc2b5c4.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_7.0.0-canary.a0dc2b5c4.0_1591305294108_0.3251013498951605","host":"s3://npm-registry-packages"}},"7.0.0-canary.2b420c5b3.0":{"name":"@material/slider","version":"7.0.0-canary.2b420c5b3.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@7.0.0-canary.2b420c5b3.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"95a12ef11333bbc614bc274a221c93c50be13346","tarball":"https://registry.npmjs.org/@material/slider/-/slider-7.0.0-canary.2b420c5b3.0.tgz","fileCount":36,"integrity":"sha512-6w2zUbX6VtswWs9j9hiuXIF3qYPXhQj6yxUC5hzL6UjkPMLQF8/aWrVz5fnYnnuTn4rACWr0SlE6s4oXFbwy8w==","signatures":[{"sig":"MEUCIFmajPq5DWDEcRaLFwLTY1qpmfslAvSa/Yn3vnhRitqDAiEAwznu2/9ZIAw7Gtn+FZUWwP/PzI0AnSA/g7QU5CdsszI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":394452,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe3mQHCRA9TVsSAnZWagAAbGQQAKC6Haf6ea0jbmKJ0shP\nVeMMaFx6FpeJ7xFetJA5Fh0BRX0j5sxgUSpzaf1vyp+1HYePe+4znPMNECbP\ng/q9WYtV2P/3R7aLjDhScb4oI+X2qH2xWbfboBpi2Mm3iY7NAdt35BOdfbIk\nr6i1de0re8OzseswlkVQYiowEY4+JJuxkTIcIxA+DsMRFUonE3xLd5aRUNYw\nIAHTriQZrzDwzqjXrvp+Ku1/bZZG6tKvsEgZw+xo1RWDSxrQEY4RfGLPzybX\nELW2h0QwQQHanefqayhVjXG78W2XWqslejRLae7tGMpCWFJZLerYSYpzFbmM\ntA2X/PtKU4lv2n2/qMNQsQpHLM1mG9IUYHJKHp5hcVyAT+SFPDHoGg7tDAGl\n88ZieeO9ygVL9AQ0lNzWAexDIq3KUBS+pbDtEw3N1EIu3IeOB1FR/F5KDaDB\nSSeLcnkEx+oOT5L4kbsFSi4TmI5SQZZMWcHjkFsYW9GwDmnGfOwr/ck3/xjl\nJGRjKovdLgcoKKlV6RpAg5SKZI+GnTQ5ZIbHu7OJlmIXBM/xgC0L7fh4YxGo\n4173ezyASSWjGY9PHWW/Al5gu0lVp3toxN2u7lTJiI0Jra4n0PI97rVKB0HV\n+W3pjtgIqFktMRe6qDPZZQL4AuDYrvvAIvRQvJsnQA2hN+dZ8++4CyYZ2oQR\nYuRB\r\n=gBas\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"80cc16a27982fc781b2a68accf38760a98fdbe2c","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.20.1","dependencies":{"tslib":"^1.9.3","@material/dom":"7.0.0-canary.2b420c5b3.0","@material/rtl":"7.0.0-canary.2b420c5b3.0","@material/base":"7.0.0-canary.2b420c5b3.0","@material/theme":"7.0.0-canary.2b420c5b3.0","@material/animation":"7.0.0-canary.2b420c5b3.0","@material/typography":"7.0.0-canary.2b420c5b3.0","@material/feature-targeting":"7.0.0-canary.2b420c5b3.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_7.0.0-canary.2b420c5b3.0_1591632902546_0.18992986001294088","host":"s3://npm-registry-packages"}},"7.0.0-canary.8fa22aacc.0":{"name":"@material/slider","version":"7.0.0-canary.8fa22aacc.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@7.0.0-canary.8fa22aacc.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"d1249d8b4d7e69fc1480c471093a2d80e700f947","tarball":"https://registry.npmjs.org/@material/slider/-/slider-7.0.0-canary.8fa22aacc.0.tgz","fileCount":36,"integrity":"sha512-OgvNHsQaKb6DILqM8OzsdaSzovi8/DSxOfuYS4iO5sd88bGDcOCq72g6nm/hZoTmmBFZsiQR4t8centy1oNqaw==","signatures":[{"sig":"MEUCIHVcsUUGU5E8KmHW4D4rALT9N7D9KU9nuIbIGo7g7Ir1AiEAo8qxR93eyUswo3RpYLHk7j0PLCwHIgaPE+Jo1fKwhGk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":394452,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe3n3QCRA9TVsSAnZWagAA+EQP/0xkGW6OfHxRT4feqxew\n45KbR8WxIytQ3O+lG7fuRDXnphP683WU5TTEa3VfFTISedgr2n4LWnkhdzQv\nA5IgEOPEHDUSRvRuD9/6JmPbG00d0yVRj6s5aL8Tgl7LdYagZxboheizcdo8\nUCly+PFW8bfghxISvZ1AYSiYQX04JMo5pdXrYH/6j7g7c+3DLVMC9bC6J1bE\nj6SZMKtl1kltU1Cl2zJHCoz6ZWZ5OfCx968cul8FGmMrR6OqEN6JdOUGMCCV\n36KADzKOrCXMDfRHz9HISEhIyUW7wOLxhWbIAUuFFkaKhye++kaZBR0U6+lY\n3gngZuJklpv5b7rxuTm2e3G2cdpAwZYXYR3DA+9OYIqIqMhIcOyiHbDtRp+V\nmAFUChIFK56pZFiwBBzC0rPtzjWAbCHpHaWWUvbWA81z5eM615x+zP8n8dGa\n2BoNqJ3LJ4cMlzmHkTZkme0VrjVT7Vk35GcxJdSRsaezqSlV5MbJSoiUE+Qv\np/ZblvE/QPx3SVYcM/dpcxFYBGciLfvhmi/BxdUIjdEihwry1n7/bjyz5IiX\nDZ/dlqT6D5GZivVsU5FApeS/s8bMK6hBNGNoooPSZbnVKynxO/wxF6xyXWF7\nsm2h/gE63iwoaseSr5AGstQ0E2yPsRlLciOSiZvsIrtCmXiyTWmHCM0IMSLl\ngGmx\r\n=uVSl\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"7c66b081ba582f4d58dde82c8b83ab1dfbed6063","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.20.1","dependencies":{"tslib":"^1.9.3","@material/dom":"7.0.0-canary.8fa22aacc.0","@material/rtl":"7.0.0-canary.8fa22aacc.0","@material/base":"7.0.0-canary.8fa22aacc.0","@material/theme":"7.0.0-canary.8fa22aacc.0","@material/animation":"7.0.0-canary.8fa22aacc.0","@material/typography":"7.0.0-canary.8fa22aacc.0","@material/feature-targeting":"7.0.0-canary.8fa22aacc.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_7.0.0-canary.8fa22aacc.0_1591639504083_0.6707260352780573","host":"s3://npm-registry-packages"}},"7.0.0-canary.21c4e4ed8.0":{"name":"@material/slider","version":"7.0.0-canary.21c4e4ed8.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@7.0.0-canary.21c4e4ed8.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"ce2c09377c438db5f77c11a28753dab510f0c309","tarball":"https://registry.npmjs.org/@material/slider/-/slider-7.0.0-canary.21c4e4ed8.0.tgz","fileCount":36,"integrity":"sha512-YpZuGHlWmpmv/vfCf9gZjywfD+cTaR5tx5j1ug5RoMW62j8sloobh6Id+AqgXEfYaaw2DfgWD7qbkCPjn9f0LQ==","signatures":[{"sig":"MEYCIQDoGI1XqUKervnQKF55yhAakTaTnvyW7tVyxxo1Nxo+1AIhAJ2ANYFfWPzw/49KLGDQN2NKg8mv7EKWNH+qaPGtj0Sk","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":394452,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe3ociCRA9TVsSAnZWagAAfckP/1GujQev8gpY6TUAkDff\nPl8zyTsP+2yfdImBV1CZt9lyYFGCOw4DUCBBoVVBdEvnpdtxBnnS3yltiXX/\nwQQwlkp1ra3AeupWJFJUbMtjlk2udO/I9lRd95c41mXawTc5yFE9sih3vUkg\nrzsIOd5aPnjt2DE40Z/PQad2fd05ajwGRvtSvF++oyzDspUsZtDihCTbNIw4\nnq7yyfDr1DN5Hemm6Ho+CHpQjPcX3Om4+8dOh8CQbH55muuGB8UZxtkmntOh\nu3582/llC/YQxsUQzASJvsvQTW5rGVaeGCdijyqorQ+jSvWDjRF5t0MojHMW\nNAcQWFndFLVCsP6sKwu+nDzRqGM8fcZQ1VFQLKu7wXZpydEdS/K71atudcZr\nk1PRedN3dtWk+ZYNvE212CJKESRJqPYVYtA4AE/aicx2rldTklHBYL70Gs3O\nGm20u54dE6tRpIti3RW3uAT5WsFXqFlZK6X+xwNl+FN51v/diNaj/Cxenuki\n1zUVZiAcbyLPYHoeTnjldv1t1KFmEP781DTqAcGi8QB0aQEQ2MU9rgzuhXoJ\n75/5CBsS8ixObl6wyVAgHv5AG9dnAFd6IPHFzMokDyVYR8NL9wf3Ms8D8n7I\nE0uItcC/+JlgXuoZqft9Z23yxG/Q6UDdU4lOSJU+MCM/iBbp26EMSvpwmWRv\nyWxn\r\n=/b8B\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"4028e059428ff6b13f79ad3f9076ddd853ec1904","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.20.1","dependencies":{"tslib":"^1.9.3","@material/dom":"7.0.0-canary.21c4e4ed8.0","@material/rtl":"7.0.0-canary.21c4e4ed8.0","@material/base":"7.0.0-canary.21c4e4ed8.0","@material/theme":"7.0.0-canary.21c4e4ed8.0","@material/animation":"7.0.0-canary.21c4e4ed8.0","@material/typography":"7.0.0-canary.21c4e4ed8.0","@material/feature-targeting":"7.0.0-canary.21c4e4ed8.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_7.0.0-canary.21c4e4ed8.0_1591641890027_0.03793246578835996","host":"s3://npm-registry-packages"}},"7.0.0-canary.dfde46516.0":{"name":"@material/slider","version":"7.0.0-canary.dfde46516.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@7.0.0-canary.dfde46516.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"8a75e3ebb2b932768910b6607137730bb6fe46f2","tarball":"https://registry.npmjs.org/@material/slider/-/slider-7.0.0-canary.dfde46516.0.tgz","fileCount":36,"integrity":"sha512-NtS6J9COzsSQGH0kUbFDMOZfrW+fyxy9dDD+TDsZ4vZK8CX1ppgdMJildFDcRP/sr2udBNNif4RDhziLNaaR/Q==","signatures":[{"sig":"MEYCIQDwENnycxwP64AywnnDI9qjiNcW970L2xaUZTQqdi+7XwIhAIvYSPcJhYZEs6rb5RvCD7NW1ycliI1ifA+T1TssVqBN","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":394452,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe3pSqCRA9TVsSAnZWagAAf+0QAIjahED7xQqve5Yd/Wgn\nzeAlQKm9XoH/4U3AFPCMNwPpCa5qXeVUToTMKB2j5IT5Y6P4snviJpH/73e5\nZ1OhVvZe0W3KN8u//W6xQZNhAIi4R1gqk5qIVZd9IxzYb/5+tUrhE/w121se\n6STpk6VjxEoiZ0RXaUPNsw7rJOPMbTi2ys4dQH1iYu4DIEM6jIXh9oVIM1Vi\nE6jtW3K87bmuUMvqcQ1wLZ9+elRR3mEMJB5HEQnTANfQywhGZYCmLCb5a/St\niCvab81btckeKCP/2EE+wrZIKYz5ZupiKujdUQOKT8/shuoEAQfN0yY3onuZ\nLEIaAlKqSJokOigm6A7BkYRCc+SPY4dXdKQyiq2D2aeWD4rA6q1IsX3XLE1B\nyHk+IKnxQwSizWT5bak5Gn9LzGvakQuGtizzgzyLp6TsxMijCXcHmTi9XV/t\nP65x+vlTZ0uMSY8ILqJ6GCKLC3MmdBkSE+tYqnmLBcTrEatLLSVXyxiY3mZp\nCI4dnw9IY3xjts6h5EF9rLoLHF9aiEvGwFSYeVbKNVNR3c+UlBkweHwBat6T\nA2ksrJ7HcEoFCfDk1OuApHfoMrkTxBBMaXa5RmxmIIlvHTLfuldtWhLkD80e\ndrY8Qt1aOkc1LisnTT9cXIxL2QN5Y3EktCvT//dwhFuSG8eskiQkQa48sHgp\npKTQ\r\n=tOIi\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"c25d474d22b404bd6774ea12567f0916bd7fd165","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.20.1","dependencies":{"tslib":"^1.9.3","@material/dom":"7.0.0-canary.dfde46516.0","@material/rtl":"7.0.0-canary.dfde46516.0","@material/base":"7.0.0-canary.dfde46516.0","@material/theme":"7.0.0-canary.dfde46516.0","@material/animation":"7.0.0-canary.dfde46516.0","@material/typography":"7.0.0-canary.dfde46516.0","@material/feature-targeting":"7.0.0-canary.dfde46516.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_7.0.0-canary.dfde46516.0_1591645353656_0.9779982606145134","host":"s3://npm-registry-packages"}},"7.0.0-canary.05cc5c206.0":{"name":"@material/slider","version":"7.0.0-canary.05cc5c206.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@7.0.0-canary.05cc5c206.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"279df0eb72332666cdbdb74d0e97c63144e8ab3f","tarball":"https://registry.npmjs.org/@material/slider/-/slider-7.0.0-canary.05cc5c206.0.tgz","fileCount":36,"integrity":"sha512-8WdH59s5j/UXImBv0dsOAO8ByEPpeZEQmh45urZb/t0Ej7W8G8CJbBlqMUsI937OvCqxoK+dW6fph9s1mUwjPQ==","signatures":[{"sig":"MEQCIBkG5xzX0Se/NOFWKa9GymAaXw0CpauM9WEvcQexNZzSAiBLAElegUVexrBUq4QUaDMHitAZd3OgRbrAZW2MIQhC+Q==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":394452,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe3qZLCRA9TVsSAnZWagAA/3sQAIukz78F0nlFFUKD4QPH\nEDbAIaXDEeoiis38EhqnUD1UkLtekSPS+Mv0ChmmGzpVCQtHmLaWQ6EeUlHs\nsXfeeQVl9TRyfTfyswNW26DZf9CQVdXlOxM/2pwzDEQf4IIsvVB0qHeFxyU4\nrPvN3IZ/1J72CPhzZ74SWZk2QfvYTuyVUEnXM1i+CFD6tREviHq4ccQ4jibq\nvgh5L03GxvRO/xHN+YbPEl+uLw6cLMNJdz1UfJGUcC3MWHjIpAwBqageLdFc\nBS+L1RG1ena7s3xmBKxwMu0EQhe84SsIcbFs0l5e+LRBemsZ6LNPyFwwhgTJ\nqAjKWrPkqAljg8WfSIUpRqwjQZWlCXsq+xqhf1bds6issymPL2OlZL24MeOa\nZs48xskOveA5C74DUF0MBrTtdYrzQ7GXwrLfV20dcLhDw4dC1qG6917b6LGJ\nBE4cfEXnAkw1hTS6BY4lb6DRnlUx9cM5IlzXqdR/IzraIPf4UYv9ucR7bljx\n1oyir2WHGXzPTaaTjCNdJPc6rPdkqvNQZoT4uLPOXOIrJH0bStJi8K2S1GA5\njrJeZV1FqYn83FXtMecxsFrin6IfID9OG1ikFNz/Ky/vXfltG3IioUnKwp48\n/9S5ByFna4/uz6/ZiW8YlVMrFOd2JQD8iFff+81lhdIi4+so1yei5FWYDDJW\nE7IQ\r\n=XDFB\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"933ae32b3f02920ab3f6f1660cefdd6302297532","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.20.1","dependencies":{"tslib":"^1.9.3","@material/dom":"7.0.0-canary.05cc5c206.0","@material/rtl":"7.0.0-canary.05cc5c206.0","@material/base":"7.0.0-canary.05cc5c206.0","@material/theme":"7.0.0-canary.05cc5c206.0","@material/animation":"7.0.0-canary.05cc5c206.0","@material/typography":"7.0.0-canary.05cc5c206.0","@material/feature-targeting":"7.0.0-canary.05cc5c206.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_7.0.0-canary.05cc5c206.0_1591649863988_0.3436530923711407","host":"s3://npm-registry-packages"}},"7.0.0-canary.3ee488f1c.0":{"name":"@material/slider","version":"7.0.0-canary.3ee488f1c.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@7.0.0-canary.3ee488f1c.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"5d6a9bece82e86f44a3cabae9cb0864409902099","tarball":"https://registry.npmjs.org/@material/slider/-/slider-7.0.0-canary.3ee488f1c.0.tgz","fileCount":36,"integrity":"sha512-UfUvq5LXpFiGf7EPd1JtwZt/5/nPAsqx4kH3vt6TQR+nCFracXM9Pae8YWCEe+JGeaYQyxtjFDkX4X9bb2TVSw==","signatures":[{"sig":"MEUCIAni6uaZgdE+Cb7vJQ8Og2r9iQrciMcdvvClrdR0H1n7AiEA5+x9zats9917XXeAj7aOHSIst+PL3CmO/SDvFpySYXs=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":394452,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe36KnCRA9TVsSAnZWagAAc7cP/AldKB214W0jxTkqPkjR\nfCFcpm/w3Pclcogkxw5KkLtoCZfpsBqEFBMmVWKN51QpJShtBXW/YaDtPv3/\noOdZjkXqYBaBrTW5vX6gpf4SENVMzJZq+uIm4FXvz6BJVyUR8UUOLsyzuQw+\nmYJ87OZochU3Lcf6LdnxDzGQCh6rVyyW289pxJO288puth6r2up19z8I/2bX\nBwigfSEeotE/Qdw8UgsmA7fn5xivYZ0KDZa3Hw3XGloYnC+tDMRGpIhkO0Xr\nqKIU9wC/+xS0kXooeZ+GPVWUFVBik/GlcyrfvtG6/RhXMHr/WoO9JpXvEqAj\n7gg1cJN6P9K31+wsHeA6C5beRDbodFYmGm8Yv24m321zW92P2b7MZPyzCqs9\nq37onLbC3/VgiaJtdvZlUpGehu3bsPgmd0OGpEuMXOwCAZT+2rMtt/rsnq8L\n+benQP4oOTFsKbHVEOJkO5oaaFPFo86wZkaG42W0u1WelM7joZ0TBQxrPIcw\nUGSo4DGOkN/MJCxK96p/s4SFe6dz/xYHNkSAEmp2Q+BKfVfkrRhvN1hyit6x\nx0Q+Rrbrjv/tkZsuo6onzdPNu+TCTsfMKXgQpoQ7u5N3T1en6zUnBTAPTO0v\nTA6PkMaL5k891jNIplNtU8fkGT+aUES4Ylz1svsPOzKZMw1ZF+36NuPBC29B\nvA8J\r\n=PDwk\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"ceaac97d295d5d50e71137ff6d4b390630570b8c","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.20.1","dependencies":{"tslib":"^1.9.3","@material/dom":"7.0.0-canary.3ee488f1c.0","@material/rtl":"7.0.0-canary.3ee488f1c.0","@material/base":"7.0.0-canary.3ee488f1c.0","@material/theme":"7.0.0-canary.3ee488f1c.0","@material/animation":"7.0.0-canary.3ee488f1c.0","@material/typography":"7.0.0-canary.3ee488f1c.0","@material/feature-targeting":"7.0.0-canary.3ee488f1c.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_7.0.0-canary.3ee488f1c.0_1591714470553_0.5464339776692995","host":"s3://npm-registry-packages"}},"7.0.0-canary.b83d720ee.0":{"name":"@material/slider","version":"7.0.0-canary.b83d720ee.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@7.0.0-canary.b83d720ee.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"73d07fc383bbb8c337bb8fd634229effd5cb0c6f","tarball":"https://registry.npmjs.org/@material/slider/-/slider-7.0.0-canary.b83d720ee.0.tgz","fileCount":36,"integrity":"sha512-lE5hD/DBLE32JABKCDS485KVOrz53xc6K0DNWchFmE/0bQ2LtknUcTJ3zb1RetPpX+aAnewQ1+PiR6sZTpMD1A==","signatures":[{"sig":"MEQCIF2+WuoRO/3Ddpsc89/n8reKDU/0yGhz0lX4YrkCI18bAiBuWr06DWacpV0rPhLkWcO+yux39rcInMavplPYV9VgbQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":394452,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe38ZWCRA9TVsSAnZWagAAEf4QAJb6nqmV6ZxFLRr6Eeg/\nghWwbtAndzDVlZlkxMdAuO0oS+tuUECVQCi4syR1Bzu1eW7V7WoBd7owopUP\nEqxyQBS9NEHc3QmFexl4sSsmFXqUDmdkxsCDCSlxTCoCHpaqBkWuFnLqEiO3\nbsmwdo7roQxV+LAbx0j18u/bJcu5Iypr2RqSBzwSFDJ/3VMR09VV+ARdka7W\nTpygaB3sbjQOIaw2bTIruBtARsY0LTfheHAUMfHyjo1hzyDjPV14x4MnZZlr\n0Y2Oc0CNXm4x5U+plY1Ju9hYXoLKOTV2l7cQ10G53GxzKRyabh7EdE5s6Zj5\nuITJWnBMeqEsU6L6Wqji/ekIN1cKpR00RqE/i7G3KCf544PM0+W8gWC4CvgK\nL4gMiYwKDGCn1saZBFgkkSDikwJBPdAzncl3+mprkEpwmGZhcfW881g9yrJk\nw6CbCz73ZOyvJR+St+SMXSEE+xXFIU52nrPIXDjPUDrqIw5/QTHW3sHyPRdW\nPlvesRwWH3eOBUPyqfoUZi6aC9hLM1GUqpQU968qAEiVm1VXlr6ZrQ8jkAyW\ndLRpws+bBjjpToYshdvpYSB0aOzGNoaGNGpWBuw+v9nT0c/IWITk/mfbCX83\n1bn4w0FRTF/8upsuWwKsd+2ituw8jD+E11p304g+qA/pnUeUtV70U9q0F7Ba\nDps8\r\n=zhkJ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"3e998e476c86bc89c3bb626240ddd068529062aa","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.20.1","dependencies":{"tslib":"^1.9.3","@material/dom":"7.0.0-canary.b83d720ee.0","@material/rtl":"7.0.0-canary.b83d720ee.0","@material/base":"7.0.0-canary.b83d720ee.0","@material/theme":"7.0.0-canary.b83d720ee.0","@material/animation":"7.0.0-canary.b83d720ee.0","@material/typography":"7.0.0-canary.b83d720ee.0","@material/feature-targeting":"7.0.0-canary.b83d720ee.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_7.0.0-canary.b83d720ee.0_1591723605997_0.2702705715625451","host":"s3://npm-registry-packages"}},"7.0.0-canary.afb1c11a9.0":{"name":"@material/slider","version":"7.0.0-canary.afb1c11a9.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@7.0.0-canary.afb1c11a9.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"1a446cae4c6d4ff3a268c6b585c3fdbfb12e5ce0","tarball":"https://registry.npmjs.org/@material/slider/-/slider-7.0.0-canary.afb1c11a9.0.tgz","fileCount":36,"integrity":"sha512-zMNGj2BLuDuFDxrwZTHhUi3o5eB+zyE1jTrX0SECDfdweZak3tP2WqKJI4Agvb5mscNgmAC9opv/034dpUfm1Q==","signatures":[{"sig":"MEUCIDiPGRhYkE+xN4aAyIfTxNS4ibmyXB5V6is0f4pouMlZAiEA7plZ1kbBplgdusZ1KZd/LSl1dEXyqE7fpcgA/VSLXrA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":394734,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe3+4rCRA9TVsSAnZWagAAlLIQAIJcNpqMqUhLbVqJznmB\nd8c40Ite9K6i1qQmx5eKEQ1ogpdK3g82OFlp8xiRkX1a7dqPhI009elBmvAY\nAOrOWsKpM4MPX7+1Tt6/UqtwoUrJvv8PKvJgmb8AAADfQ5Zo0aL60Fthezhe\nUrBrbY4rS2kDK7nY7FESIyq44mCaBy6OIXcJbD2C8nhXJdMP87gvLvuiT6oa\nUUkf7HrhNI1AXvmVBlD3Eoe6HoCpTQ1fREpEOrDAkA/9wP6ZdRd8srWOTIA1\nyEqpdMDPQTDBgFjUlSnUwvVRDXet27SzGSSPFIuwbWZiNmVSD2+2BmIOb3AY\nCRo5BkNq10gByw9dA7Cj8+tu6hEOPXIUJO9j0TneK0FmYVNnMF0Me43LQZ+x\nYmH8Mz9kYt5x42MDols5H8u2ok1Y/oWa9p1h9t+WPRNRAcuMhqbXVCeG9g2j\nT++cD+W0EX931Dd0721yR/2ewW1BGEj9/CIbVr3mnyO3rEczSBTT34gIoDRz\ngtz6w8bt0h/nadqQo0T10gYWcIkqqYrDdYlBiSq819QKytHgxZqfv9LCBniO\nD+bnmJXwWWN4M8Jk+T1NJ15U/ZzOb19MupZbd9SGZ0KGATOovUzRTW52nQBm\nd9zOnJqdlbMLprfm/VGyY6JRPB53rn5DWppXUtycH4tzXBUBQm+476k4My+4\nF1DC\r\n=OhVv\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"893f09ebba8aeae1b012971b66ce3c77c410b823","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.20.1","dependencies":{"tslib":"^1.9.3","@material/dom":"7.0.0-canary.afb1c11a9.0","@material/rtl":"7.0.0-canary.afb1c11a9.0","@material/base":"7.0.0-canary.afb1c11a9.0","@material/theme":"7.0.0-canary.afb1c11a9.0","@material/animation":"7.0.0-canary.afb1c11a9.0","@material/typography":"7.0.0-canary.afb1c11a9.0","@material/feature-targeting":"7.0.0-canary.afb1c11a9.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_7.0.0-canary.afb1c11a9.0_1591733802717_0.9590958069793614","host":"s3://npm-registry-packages"}},"7.0.0-canary.39e6f71e2.0":{"name":"@material/slider","version":"7.0.0-canary.39e6f71e2.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@7.0.0-canary.39e6f71e2.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"b2aa12bfa0f2c43a9c22e5cec4149ede2e1d7333","tarball":"https://registry.npmjs.org/@material/slider/-/slider-7.0.0-canary.39e6f71e2.0.tgz","fileCount":36,"integrity":"sha512-swGz/cC61HHolswEzHSIlD5owfQrFnC1Kv+vneTKeof4BSY3KsDaJvx0DemCxEshuHz1+nqCzHK93pCYrcqv5A==","signatures":[{"sig":"MEYCIQDYvui0lmDX0ffFUEtBL6jq37qGk+z3RUCoMPgJ0ZoRYQIhAPqZTAIzld81qFDiBZgI/ObCKGx++rRW234QT2cfc5UO","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":394734,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe4B3JCRA9TVsSAnZWagAAspcQAJyNAntaDfnF+JtfQzeT\na/nsHo8z6aXP/TXTjp1+ZOmkEJldkqYCphDPygZwmcPF2QcaT+yTbPItJ7aT\nD021JrhjMMqy+YAeSzWXN/qpMsSSQ14fVKx6+QdreEQVV1bDm0WANjWg1nCJ\nsV4YFI9F5jR5rEGj3ymCCMjaeye5V1oh+yI/wZndc/xT25ICEwLoYHKPm0cP\nwAdH7YJMY29HrP/87nrH4lYrg8TiKddJfXKHKOhpfZtkDDrvcPjrQRKcFgMO\noXZp02RLReLRtUWHRtmZjD+ax53L5R6qO2vsxWC3u/kLW1B8LgWWZtHro81r\nJyHjbFCXCCzBGCFWJFLGUjL8ceKNl1tpVUTG4GY+ozqfplVyWDkrBJwsAMh4\nNEZh4bNj3XptaqSdR5WMjANg/TRpaO6obLW1t6R9VQGNRYbftZqtgAJC1U9n\nqahtjEdL01nzA3mlZUt1Du2CXIGnWuDWKcUAM2lY16d+hiwjf+5H4iGnxVog\ne7JemQi1qv2SFf6uPRREMxI1IaeY7zYNpHKMis5V61tYZn4b0UHF83mHITGG\nS2+hcn2JB0cpd8cNinGO5SdA5UMz0ARe4wzy96wufbSpYOCrVP6UR9kP3Kma\neBBsvh2M5o2pp+iTugO0JP6Dbn2I/wW2UHPfzbVOAM4+r4If1pLm6OLLnAKL\nM/jP\r\n=R1Bz\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"2f7273891cbcb7da6646bdca0ac4c5dc2ceed9b6","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.20.1","dependencies":{"tslib":"^1.9.3","@material/dom":"7.0.0-canary.39e6f71e2.0","@material/rtl":"7.0.0-canary.39e6f71e2.0","@material/base":"7.0.0-canary.39e6f71e2.0","@material/theme":"7.0.0-canary.39e6f71e2.0","@material/animation":"7.0.0-canary.39e6f71e2.0","@material/typography":"7.0.0-canary.39e6f71e2.0","@material/feature-targeting":"7.0.0-canary.39e6f71e2.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_7.0.0-canary.39e6f71e2.0_1591745992579_0.41474741618806954","host":"s3://npm-registry-packages"}},"7.0.0-canary.d4c66dc7d.0":{"name":"@material/slider","version":"7.0.0-canary.d4c66dc7d.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@7.0.0-canary.d4c66dc7d.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"bdd3932e94251c6263d2363d3486ec2eb7bc7851","tarball":"https://registry.npmjs.org/@material/slider/-/slider-7.0.0-canary.d4c66dc7d.0.tgz","fileCount":36,"integrity":"sha512-VcCtzfzzP0R/BxrXjQY0ljNqYsS6J8zYGrQawugVKtJ/Z7QNkW/g9uPWp3K2/2VE/fYM7PEL9D1Hf1aWa4HEIg==","signatures":[{"sig":"MEQCIC5KvP43YYDOdY8tk7490pH1PJzrfsQ3vRG3OVvRZnR8AiBXAIWNMN5JY1uleUhOBq59WjvjmVCUX3B+l+2E92KoJA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":394734,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe4m4NCRA9TVsSAnZWagAADqUQAJB9j6BMUHamjGvtD11f\nPZkRQr6GJSexbgBSMbfcDE/BQrhO1KDAuVy24rUOLlH9Ne0G4aq8qg3z4elr\n2xoyRPzFlAcnjXGcRTZpFhfPQdcAFa65iw9Rybi7re3bpiTRQWstXFxfY52v\n0LOYfX81VELqHW7seEp0MIvTVemk4eZFZxnC9gGM60TvyxkSjcIT18gedUDI\nzgHW0ItCBA1DxhO3XheI4DS/eFPSPTeFmKZ2yu9bYMXOkSQHg7C1O1THVbaO\nIrP6PiY1lvpdfXXS47tJr7L5If14Tcd05BVUzuvJAQac4ZLQmmqFAU/Bzu47\np1Pg+8Yjv5o9UEPR4TOFmkCPRc538tMeE8jLSFVKAsduaAsnFoQxaujwjp3M\nHn/HVC8e6fXQosZ31rOVOOaibNE1msQjuZROkjvdJEMf6Ck4YX+lU0jn8ZG5\nKeAATaZlwxe2ERJgKtOd8SFBfaYiBZDo2KHp+n7Q5XDJ1Yui/NWxvi2n7rbZ\n6E8R4U0CVZNsuP1eswjyvrEJIxY90X7rtfFqXhM9eSdu+RHMuvMqE9wESaue\neLYOnGIHR+lsDjjCDSoYGJOGiK4qj2nQkcOTIk8cE2Bp5i8eCzfNXAghj+IA\nLYlNhfntkN2xs6mnQxBnLa2HQ8unfa36tjwVcd3Vv2aM3TKEQ5Ub8WXFUPZg\nYcIx\r\n=48Ll\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"5964d9e6836962528334c54ef81ac4cf4898392a","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.21.0","dependencies":{"tslib":"^1.9.3","@material/dom":"7.0.0-canary.d4c66dc7d.0","@material/rtl":"7.0.0-canary.d4c66dc7d.0","@material/base":"7.0.0-canary.d4c66dc7d.0","@material/theme":"7.0.0-canary.d4c66dc7d.0","@material/animation":"7.0.0-canary.d4c66dc7d.0","@material/typography":"7.0.0-canary.d4c66dc7d.0","@material/feature-targeting":"7.0.0-canary.d4c66dc7d.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_7.0.0-canary.d4c66dc7d.0_1591897612812_0.19347548924313562","host":"s3://npm-registry-packages"}},"7.0.0-canary.be4a19f9f.0":{"name":"@material/slider","version":"7.0.0-canary.be4a19f9f.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@7.0.0-canary.be4a19f9f.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"0ec164612db8849eab197d2a732bbaa969fc72c9","tarball":"https://registry.npmjs.org/@material/slider/-/slider-7.0.0-canary.be4a19f9f.0.tgz","fileCount":36,"integrity":"sha512-KTADZEJT+bugyjWNsq8PPVRjZLFWqyrocRl3D/bwP5ghihpId64qsrPJQ5t3r++lyIKR4jZKqdsr0E6Rs29v3w==","signatures":[{"sig":"MEUCIQDM9bnGitVa3RysK1e8LJ2S5p6YthJwo68mN0YfYMXMngIgRgUu6uKkUy2ilI9YmOKYx0yJetyupF77CWfvVjsP674=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":394734,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe4xvoCRA9TVsSAnZWagAANiQP/2Z4X3JAyLnLKd0J7zsU\nEhj5S0NC/wOwM0DEe12nSGuDV/R5qm4Z7+1t5Rn9liXRkMueFjywEXgoiOQk\nHIb7tRh3g96jZbZUl9xjZKVpZORwMJiVN643sTjdhOt4xiQIX6rnHIWl07g+\nUCbfhs0fwmiXU/bfjTkInyNkoTKUkvollpOf7JXIgOc7ZjgoQopg9Ro3/shh\n+9202kxhQlhW/2OsmcdFyWxjbhL1N3CXdTWS8TpG6KpNOavTHt5GkMrkV4/J\npO6DQnUcIll2jcEaoItpTwGAHNcIA9RBbgG/kO/QHfmk5wnXK0KmnK9EzhrR\nABa20UWRLlRE9C4Xhrutvw7W21T12n03tinIr054bB4/P3E1Px6gB3kUzyw3\n0JXkO+WWyhs/JFpKARdc+UPGwV91lIuP2MLPLfd2VSJUkWSUV6355rDi4S+k\ns9Pxq5yckyZTPc8oZ0A0EU1ljezUdxoVuyWnEpbDvvOrJVa1Dhm96KHbSkHn\nJT1NKJ422KmkOnYDQX9TllNRk2M8/JCPf+cY6mzqW3bL971DWbbGeRHnBref\nbdht765mIi2MgFDwhNRTJzhh/A1mzsM399rwsnbmGQJ5qelhfvMMOzlQsebq\ndl60fQjcwDqHBhqRvjEcPEAC8s+ncsJ2AWEeA2xrtHexPdXvPT+kQiLe3edN\nQ25d\r\n=XwQf\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"d7a0b89cd18efc7fec60e96de627e59883e3657c","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.21.0","dependencies":{"tslib":"^1.9.3","@material/dom":"7.0.0-canary.be4a19f9f.0","@material/rtl":"7.0.0-canary.be4a19f9f.0","@material/base":"7.0.0-canary.be4a19f9f.0","@material/theme":"7.0.0-canary.be4a19f9f.0","@material/animation":"7.0.0-canary.be4a19f9f.0","@material/typography":"7.0.0-canary.be4a19f9f.0","@material/feature-targeting":"7.0.0-canary.be4a19f9f.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_7.0.0-canary.be4a19f9f.0_1591942119689_0.6406328989317553","host":"s3://npm-registry-packages"}},"7.0.0-canary.a6ac8f629.0":{"name":"@material/slider","version":"7.0.0-canary.a6ac8f629.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@7.0.0-canary.a6ac8f629.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"8c523cb25bd6507746046071cd0dd84fd31695a7","tarball":"https://registry.npmjs.org/@material/slider/-/slider-7.0.0-canary.a6ac8f629.0.tgz","fileCount":36,"integrity":"sha512-I7/X1GtBPKIpY8dcZMIKotWdgg4luFi4IrL7LBVmYBnWx4Bh5puLgH/oWvOTv7lJZ30mfNH5pjfXlm2nulHXfg==","signatures":[{"sig":"MEYCIQDo4trTWSMAYyTXTLs97TtKHx6Rr1wUyujVmJl8bekg3QIhAM/vD5/FWvK0/tUjChoJov/bxSUFD5+fUIom7D+8Xxij","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":394734,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe5+iQCRA9TVsSAnZWagAAuNUP+gP+1pQpsveoTPvXaYD0\n4WIXBmLntZ+/ZwWzZoh8rID8hdpFJEQ3+0BIZ/rNjf6WqbAetJ+aJQcEgY6s\nYgfbCsE/LD6Ulp93bY8E+s/MwH+mcL8VywnU7KD4wfdjMEP/kYrcHhkrC2SG\no6xKyXiCreihd5WJRavXPeMZSHEpS9dSXSyhxO5pm9jKm1jvtRNeaymArVYP\nqi+3fZAtWJxP7iPGj0fXP3iLRLJQB69lWKlmhwA8izNyjWZtQb8fS++hrl2x\nsf6svEkxXktNEaLlnmEfE1Qp6o+MCY8CIy6CuEhOGDTgeSc6/sFKhJSYz+8k\nOp3SNePNAUyMi3VH2wr2JaE9Q63c3sTw7CQyjj5y0VfE+6H4LDZ5HMUucB0/\nQzl4vuA3h0Ai69BnAvBTKYWylvsTBU86OywT6MVu6ockc4mmApF/TBC5P9pu\nnnbka5wkFtrzbhLy7iAVMqdXpylXrFyBVRsFbGs5UtW0vSkMfTIpkgbZK2ok\nvXirq5QDjm3Le0MDoCR/0OsmsQhBQZV03EGYT/Aqhl2zb1dZwUAA1i6ZqL7K\naXwlSOwdgDI4Do2C/TXrWO42nBAGdEzOJzSVbzi3wKawDRmjUjTHH4dT8LiX\nwbTnfUQvrH1+78AC7+YVCsKO7qATpk1BdEyIl3yaTu3DnWiIMoc9aYpLCEvl\nyLeD\r\n=TSsl\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"30d2dc59ec3530f0f21233e5b8e93c990a4a2776","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.21.0","dependencies":{"tslib":"^1.9.3","@material/dom":"7.0.0-canary.a6ac8f629.0","@material/rtl":"7.0.0-canary.a6ac8f629.0","@material/base":"7.0.0-canary.a6ac8f629.0","@material/theme":"7.0.0-canary.a6ac8f629.0","@material/animation":"7.0.0-canary.a6ac8f629.0","@material/typography":"7.0.0-canary.a6ac8f629.0","@material/feature-targeting":"7.0.0-canary.a6ac8f629.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_7.0.0-canary.a6ac8f629.0_1592256656228_0.23266406151337637","host":"s3://npm-registry-packages"}},"7.0.0-canary.9833dc287.0":{"name":"@material/slider","version":"7.0.0-canary.9833dc287.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@7.0.0-canary.9833dc287.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"a2567f99ce5c2fc0ab8c7abf7ac57d851a2f02a1","tarball":"https://registry.npmjs.org/@material/slider/-/slider-7.0.0-canary.9833dc287.0.tgz","fileCount":36,"integrity":"sha512-/lQ+zbsEsFPgIaNuGqhfwGJX5TbnqO+lN28G0//rKT4DFby0d3bYHjJtp0HjuOHr4zrxsL2/G46Gv2NF7B+KCQ==","signatures":[{"sig":"MEYCIQCTPsCedkpSexdPy5RnE1ENo/PMmQY9zzYQqVxICGaFtQIhAPkNemiX6SAMNsW6rXevQRb3BqiPylf3y1/738rhC+Qe","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":394734,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe6SJRCRA9TVsSAnZWagAAHakP/1BZsvAbgg9Wt20Xq5km\nVsHGmlc4Ac9nT/DvHHDjJzwCQXXmzr2I/bya7JNg9FzSut+qhoUYnwWgDLLP\nDbfHXrxEfGbEhOhdQbOBv45t3esuKjDawjmrnXpcBXiwFhRJm/apQz6ZkIo5\nOutRQxC7I/s/giwJrvIR3sYhKEMTvrjHn+Kqac2XvqFdoXXipazE4Vqx02hx\n7rtojcDylHDotGmHLSLSE8O4f9pjWvNkCaCyjYToMDHLeMlHr6mL/PDrg80D\nXiu4bkU5WtLpzagTIZagWVH2pwRz3M/T25vUUHpohGEeHwz48emo325AqBI/\n9+rP5wDphO3lE8N1jzYwl69UyGgpD0eV6Ahy2fJ95vpvxv4bPF7m8YfW2Y1L\nq3A7zwnrfad5HIVgQAYFV1+VGQqZVFB1L5wfbmWez87pjHBJLbZPnbJnxM/8\nQKWPpTCNpLs/pFDpaSpL2ts6QmH5rzOde+hdfQUoNAo3iG8joE3Tdf4e4nY6\nwFuHyp8JDRIw7La9o3BJlyCr4Ac7awX78G8SOile0gV3v6slWMEpDPxx46zW\nfW1eZeG2tSguVBfJO0+750T/SwbMhtjPlEzqq+kAOgWjUEnPHE6Yk7rgMsj7\nKmM9OQ5p4p5GMxsSsGetav1NgsoztCei8Yh/Q/SX8EQ/6joShBkhwWuXl0Kf\nikvB\r\n=rupo\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"6852334e45da838c4140c1aadc974a39d80a83b3","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.21.0","dependencies":{"tslib":"^1.9.3","@material/dom":"7.0.0-canary.9833dc287.0","@material/rtl":"7.0.0-canary.9833dc287.0","@material/base":"7.0.0-canary.9833dc287.0","@material/theme":"7.0.0-canary.9833dc287.0","@material/animation":"7.0.0-canary.9833dc287.0","@material/typography":"7.0.0-canary.9833dc287.0","@material/feature-targeting":"7.0.0-canary.9833dc287.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_7.0.0-canary.9833dc287.0_1592336977344_0.11100555611684504","host":"s3://npm-registry-packages"}},"7.0.0-canary.3aa33998e.0":{"name":"@material/slider","version":"7.0.0-canary.3aa33998e.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@7.0.0-canary.3aa33998e.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"c9296779048bb5fdf499e0e82beb6d8634e03651","tarball":"https://registry.npmjs.org/@material/slider/-/slider-7.0.0-canary.3aa33998e.0.tgz","fileCount":36,"integrity":"sha512-ATotjl6oAc9i3PhwoJZYylqOvmPVw1pKx56fcqzuihZl0eY5v/1aCY4a2xWP4jkV8kCYccKVx09QtRneuMui5w==","signatures":[{"sig":"MEUCIQD6OCxeMoW7iM64mAQjvKmtm4w7ldog1ClyqY15UAWQXAIgUIFnxHdhMaqnxJsss1yijZrJ4MQbzxF20uXHJQuH3Dc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":394734,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe6SnLCRA9TVsSAnZWagAA8qAP/RrnxonpG84lYR/8iEZb\n2o4xDroLYT2XvYi2XCDlTw0rmWYVcE05W/SJ2pY2G4atLmsuKiJ0Z1uLFz5c\nJxR5RXalGY8SFew1I8cWNpd/+SdwydD1QJhq4UCPrPQJu/OBRIG/Z0rqFlWt\n3icg3pt7vlcvzXWMmYWevssE32BzzAL63x/j2bHpt0eFTY1kzjk5UeLhIfB2\nUrvnrnlPG2UmKq1m2cpcMrELUypeUUGUiFJ61NnJfTX7ZMrT1d4ePcqUJBA8\nQ/OkLHhJKv0hxQSAtfYgxhUgIBbzX+UqQFPLdZVlr/ftW1BZpKv1dwPUALSQ\ne5I8XVEUgRTKuI0WmCEo6BgN2u1irOsdw9O9nAcUYkbOsGtUqnujK29riq7h\nR/dnAwtMZE3wO+3vX4E9vWIr/BLpfzyeegv7B6BTmupzz60cnxVtPTJqriwx\nbeToCm8WUEILJSET2Bq9SNyC7uZs2WATR1R0+vELi+8GeAfZTAK5W+FTOa9d\nqdE6g4kADWCPUaabocNi9fq8rVnI2qjgQk13mon2gxCyzcz6YTDQTDjuiNyX\n5Euj/i1NQZ8Lg+kbMi4VaHTrCx+/V6TsJmbs6DFNXaG0Rie/0U8hreZNyJDo\nDeAP5701UlNo65K52RctByxG3dOjDP/ho2cErLwf8lv+VPgnlfofYgddIdSC\nAaFJ\r\n=wMtu\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"20873613db8172781d25b42fda84ee1fecd88558","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.21.0","dependencies":{"tslib":"^1.9.3","@material/dom":"7.0.0-canary.3aa33998e.0","@material/rtl":"7.0.0-canary.3aa33998e.0","@material/base":"7.0.0-canary.3aa33998e.0","@material/theme":"7.0.0-canary.3aa33998e.0","@material/animation":"7.0.0-canary.3aa33998e.0","@material/typography":"7.0.0-canary.3aa33998e.0","@material/feature-targeting":"7.0.0-canary.3aa33998e.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_7.0.0-canary.3aa33998e.0_1592338891318_0.9380560414640629","host":"s3://npm-registry-packages"}},"7.0.0-canary.d2b54d183.0":{"name":"@material/slider","version":"7.0.0-canary.d2b54d183.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@7.0.0-canary.d2b54d183.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"b27db1ca3161e27d38b8e8f5297e5091fe5e05db","tarball":"https://registry.npmjs.org/@material/slider/-/slider-7.0.0-canary.d2b54d183.0.tgz","fileCount":36,"integrity":"sha512-Fjnq7yGPTzmjGz76hQxsY+BPqNNLEMWJtgTKTbESUePrDK7PDtd/KtfrYR3DfMeI4W2MMqYZds9UPX4K/R2oTw==","signatures":[{"sig":"MEYCIQC0h8DyTUm0NEsWlpZVTeg4nEslnDpqqlQ944lw0yg3GQIhAKDJThtKR6MKdqm0WTyvJ3fy4dnrNujzlAQ1keDnVPZE","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":394734,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe6sBNCRA9TVsSAnZWagAAANUP/3T1uk1njD852gSINqrT\n6t0CL85t4UlXWk0IW7ugJh8aCCzPB3RmTiKY/DptjtLEAE1USlGc9+K7qPjH\nfvA8ldpMIxu7tNR4nKYc9S04boyI11ATeBLcaWR+mj4xvt+8GsJeyUWbMweT\nw1xlV07AaWe8miNmkmUrThI7o6baL3jX3bsmDYZyu304JTjJ8ScC7c6JHb3q\nE5uOuhpxMUEV1qSZPlfEuJxzWrZzDoVf25f0O7UCq4j2M4kaMVVoltWT0owd\ncQOYw39Y3wh93WOyDKt6Io5Us/SGz9w2Lxh3oqcCqlKNcsoZrl1Rc8mdsyZ/\nwKbfXEu6EdY+CnLRX7SMxPogd9XGNTs84rlIuKFg88lP3KiUTouTCB5m14i8\nf48ZchahffNTrWGD9IzNy9eGMShN4YeMlcIPKDmX2INq0hVClC9a1vPnka20\nQjVRLGvDw9pLrGbHLT5vMZQLesah/pfkrRh2iCADybnpg3A5Ds1rAC/QKP/M\nLJ+tw/y/MafZ28S0MYDYiPa7hAx3iyVv2ZdkewNYrw07fREEKwasLQMibBz1\nwK1svOG3VcdhliixCmsl6m3N0qyAgV7WvVNakdSCYmdo+RlAkjlx2yeXOKNZ\nRhayG5dGItVUgrphOgFvAF9Pf3P5FR5kAxc+QSvSCePnuVz6nsZQ4FZWpXs2\nzJiE\r\n=WTlG\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"2941697c8abef0c194a923cf548ee231dc67a2c9","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.21.0","dependencies":{"tslib":"^1.9.3","@material/dom":"7.0.0-canary.d2b54d183.0","@material/rtl":"7.0.0-canary.d2b54d183.0","@material/base":"7.0.0-canary.d2b54d183.0","@material/theme":"7.0.0-canary.d2b54d183.0","@material/animation":"7.0.0-canary.d2b54d183.0","@material/typography":"7.0.0-canary.d2b54d183.0","@material/feature-targeting":"7.0.0-canary.d2b54d183.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_7.0.0-canary.d2b54d183.0_1592442957395_0.9537397611635003","host":"s3://npm-registry-packages"}},"7.0.0-canary.f2a488e95.0":{"name":"@material/slider","version":"7.0.0-canary.f2a488e95.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@7.0.0-canary.f2a488e95.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"cddc9583ed0cdd1ea5b85cd529d49dc9bb2f9098","tarball":"https://registry.npmjs.org/@material/slider/-/slider-7.0.0-canary.f2a488e95.0.tgz","fileCount":36,"integrity":"sha512-o1++pTnhqVAGhvdYdV09v3poncDLCFjBOEewCzGh5ZS+KrF7Fc6QNduFyRAnx+rIv0E3UTCip38mp34Tt79LJg==","signatures":[{"sig":"MEUCIFELvvSGF4goRzxlkgTbojQG7jXBEhGdi2M8axUtE/cfAiEA4ReV4FXB0a61wbAiQhONcPSb8D4im7OKuWe3FO7GFTU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":394734,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe64KCCRA9TVsSAnZWagAA064P/1ts04lB+Y2sT65VH+1Q\nzLMCG1Thh6w9Jl73qF1HpNZiqY41JyvqMZWnuQvU04bxtasigyplfGGUa6aJ\nfTJGSI98I7rRQNKS+gRjxAwq+JAXp3zvVE0Kt3Vjg1odb647upZsOlR2nBny\nePFpz5h3o4tmGGCzK5tyuQfe4egOzLkPBU9/FtY9xYOn/uAcJwMaPYGnk469\n+1hD5ukUDfHHUobRPlj7gTZlqy2B6gfcdAqghYQhxWYbsOEMf+CSu0HUnh5R\nBwnVCi+Jv+3/w+e30f5lLEnuzug3HOitH+8uQ5xx1Ttwk7WATiHlJNVz3fTQ\nv49uCwsZH6rMMUYDQpwPDXgSXOC3oq0MhF/YbJ3PSGRUbKPwjrLKoqWgvOig\nGd9PJZcAisJlnGn40JhC+OG+Gz57L9fJPSqNOzdsGHuYhHmHW6nRRVUDy9cb\nGEfn4dh0xdBDuQXCppqqsUQkG+Zv5crfFDtYlgMsEfJLE/dvGlVJYMkfubBt\n8nLVcQPEL0Q8j3geyHmudVOeyCpenpJOnFQ2OEbrwROuzM+J1lfQQyZb70Hp\noRLO4AkWyRuqEw0NG7DM6kX3ttvgwGKED8Vnf4jszDWFgJSuHIbwl4vw+LeB\nC2KKIxDNNKntH5YtLlx0ucYKxOVAsHIkzmeiQ4DvjtdcDqN7N2IUoYT/L6Ab\n6sgi\r\n=cVtz\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"bd7f6aafa23ab94aa2f862ece45e1775f1895b88","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.21.0","dependencies":{"tslib":"^1.9.3","@material/dom":"7.0.0-canary.f2a488e95.0","@material/rtl":"7.0.0-canary.f2a488e95.0","@material/base":"7.0.0-canary.f2a488e95.0","@material/theme":"7.0.0-canary.f2a488e95.0","@material/animation":"7.0.0-canary.f2a488e95.0","@material/typography":"7.0.0-canary.f2a488e95.0","@material/feature-targeting":"7.0.0-canary.f2a488e95.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_7.0.0-canary.f2a488e95.0_1592492673963_0.12890406808035038","host":"s3://npm-registry-packages"}},"7.0.0-canary.bd8d1aafa.0":{"name":"@material/slider","version":"7.0.0-canary.bd8d1aafa.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@7.0.0-canary.bd8d1aafa.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"f0e1445ddb67bbedbe5ebec1c94124367bc59f67","tarball":"https://registry.npmjs.org/@material/slider/-/slider-7.0.0-canary.bd8d1aafa.0.tgz","fileCount":36,"integrity":"sha512-IqSYriD0xXc4bfFgIpNYRgr+ZD/IGBw3LrvLGr9KZhKkQvggVou7P2bwU1KpAglRZSoiOIBq7F4bPXAOgWl59w==","signatures":[{"sig":"MEUCIQCh083EHEIODqb0nKazjX0ABkg5XYiTkMabWU6zvKF8zAIgbI06R2fYuDXkpnFLu62vtyc4c8HA89cd58/2D0I63Ag=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":394734,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe64VWCRA9TVsSAnZWagAANBwQAJdPMB/kTjyXAW1zjk9X\nVqJGpYX8DXKdm76Q/zsecXUtcAo94+mmlIn65HClJkcBV1F1/jZYGsn6JokV\ncYth7GUi9ByvBXpN+lqTI1G8jCJ6tVdO/FVqy6HgA1fLKi6qWqwYNAmAbP+Y\nJTxWKsCcrDrrTgCUQIL3GXKQLxcOg7nwYzma3UtMZd3ly0ViV8kfFtsj4fYc\nb07XRw2d8uHS2KrL6QvIDZqZ8XaXu2zBbY2P29VLVy9rmqMvHbFGK8nhjGvm\nPQ9H+EeIU2gkW96WZZ+TxJJmAaj57Exu0CK/SYYnqD3Luu4K46YenmKmPShp\naZ0z72lxdeBcX+jAqA+dkjkvDvvTs1Vpl4hXAkSDV6USyQWiGeD4uSWkheJ4\nv9KsNiVPW3JrElgz83fRaKubr/RtLawE6I/QRRFLpdLfre+uaq/+/2RnInMM\nW/jvCy/1zPxcCgcAhwe10KK4M7dZR5y4bNBV13BSoP6/KGD4b5bgjJzAI5mh\nO3+u563pfOLDBuGhtzX4JWXWWCBJdfX//8poJSmQZnCQDJWhUrceNKNY0l7r\nkXFOZwCOQxZhb5C9G3PwrhPwoYoS5v1jum5XGV61WntqWHSGBC0qQ32kzwLb\nCEtbLh00j5+7xiU0lSkqwMAxCIGpatWQAbClwptQEvxFyS7P7RQhwb7LfpRu\nTqL8\r\n=TB35\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"05dd265c139c96ecaacbac16c7128e4a851b00f4","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.21.0","dependencies":{"tslib":"^1.9.3","@material/dom":"7.0.0-canary.bd8d1aafa.0","@material/rtl":"7.0.0-canary.bd8d1aafa.0","@material/base":"7.0.0-canary.bd8d1aafa.0","@material/theme":"7.0.0-canary.bd8d1aafa.0","@material/animation":"7.0.0-canary.bd8d1aafa.0","@material/typography":"7.0.0-canary.bd8d1aafa.0","@material/feature-targeting":"7.0.0-canary.bd8d1aafa.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_7.0.0-canary.bd8d1aafa.0_1592493397949_0.7697271564524328","host":"s3://npm-registry-packages"}},"7.0.0-canary.1321eb968.0":{"name":"@material/slider","version":"7.0.0-canary.1321eb968.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@7.0.0-canary.1321eb968.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"ff4ce2da02f011b382c3e5cb31f96ba9db883779","tarball":"https://registry.npmjs.org/@material/slider/-/slider-7.0.0-canary.1321eb968.0.tgz","fileCount":36,"integrity":"sha512-ajYUZlzirqdnkmOizp2Nbk3fKVy7XCX0KDgbQcaTmJWX9TTTSSvE3xYMjk1rufFpEx3IW4OffNK6ly6yAZdi6g==","signatures":[{"sig":"MEUCIQCpgD+q8Lg7Q785XZj9QMGAh1nOoexcYexMbalHQ1t4IQIgE9pPEpTK2Nodk3up754tUUm5nkGFgttLUeMyFLBP3ic=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":394734,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe7RBBCRA9TVsSAnZWagAA4rYP/RUE16IGOR3GwpRGnLKn\nwpm47c0D2xLh2prLRn5p/tI9aZNEtzShHA8Zw+qTfqi7rvg5SPrXMZ3uwnRS\nKk3zwBrYtM/6Fkv2axzaP1g66Aa2G6fmVFZtXWf+b7d0ziY/17doA2EyVSjc\nkoT4rW08BS1wrGOXUdybgkAdzKEBUxlURo2j/Fj4i6IoW+gk2PyXZxcKoPUg\n9jQTmzSsp0pG8YnRn2DGz1ynKB7+YoGveAa141LDxTaBqUMKxhEkNeTepioU\ntizKcONRKcvyKfXxHSaWbd3KLkfzwSYEXJcMwVugAhgXKyX9yGCs2zNGKxzR\nCNPnyl7a1tlnceAcY5un1vgG2fvGZL/pA9lBoHudEu5N9Kn1ZOgNtEyQvpWE\nIffM2bucnU6LNsGds2j0sWmhQcOzzGCngmgbDak7CPPnA04uUj/bFSUQPa0v\nYxc2Hh44qVClmCtRKDGaPBg33ZBr68G5IhNDE0jK1Cw8LILYaARYLlDvz94M\ncCk9Zyn2bLvpdIyRBIeuYIOv1+Lii0Esx13D+V2k3vt+YpjIjd0+ASrpEoLP\nkCqzm9mleQnGhe/9/3AceynNfBwobDfCEG3V8i9+RR3h72gUrlVjy4DJRuQy\nCIq2QgnzQSEqxiY4DlMBzIi5Oqw7r5pwCeRN7TvMRV+0zn0FcdiTvg019nF4\n3bje\r\n=63+e\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"41c074a3370c2ff9b4dd6af27f2403d15cbf2832","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.21.0","dependencies":{"tslib":"^1.9.3","@material/dom":"7.0.0-canary.1321eb968.0","@material/rtl":"7.0.0-canary.1321eb968.0","@material/base":"7.0.0-canary.1321eb968.0","@material/theme":"7.0.0-canary.1321eb968.0","@material/animation":"7.0.0-canary.1321eb968.0","@material/typography":"7.0.0-canary.1321eb968.0","@material/feature-targeting":"7.0.0-canary.1321eb968.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_7.0.0-canary.1321eb968.0_1592594497191_0.9871662820901357","host":"s3://npm-registry-packages"}},"7.0.0-canary.db5cc0382.0":{"name":"@material/slider","version":"7.0.0-canary.db5cc0382.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@7.0.0-canary.db5cc0382.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"55e211316905785c695683e7ac58a22961896fd1","tarball":"https://registry.npmjs.org/@material/slider/-/slider-7.0.0-canary.db5cc0382.0.tgz","fileCount":36,"integrity":"sha512-e4lmuSzW/UwvjtD+LmRFHSd4MOp28v758u+Brs64U4tZP50WCLa47rQh4/zBvLlOA6yvibQ/D7c78fMiigWKiA==","signatures":[{"sig":"MEYCIQD7wvpQAAL0QjEgsXdkOnkvLiJ6z12ofUHdY52a2raYdwIhAMSEFRfi6N7f7dF/I+OZzhTceWFlMlfSS5zSyjwvreOH","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":394734,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe7RHDCRA9TVsSAnZWagAAfFEQAIR5dm72X5iaGRSWK3tV\nv2HEZj+J2Na+EdLexG9b+Cv6HeYYu1kXdOXoopOUMuRtXPCyeGFaMsN8YFvk\nHf1IKo8ZLBNA2Wcnov/JR9jHiw8ip55oXOWz0CYabZ9xC7aeTPwN/S728H/d\nQM/O6dmWXXqo6NNFSj63TAf1C65iIgSdK1Hd3dyRDjQAwhsAzL3Cn5y+cZpm\nhcFyREmpK/r0XcNQdqLhcNZNXmc4GuVbEu9vFC4wDfBQR4jIqVo6vcPCEs5P\nYFR15oZYMzIwghAxIrPY9Njh1zTI8e+2cwQE3ljq8RQjbiZuA1WQgq8HbyHE\nbjbrw/dRk2VisLT4Lt90kgyrRVLVp2e4UlktNdmxTeS2NEIe2glzmXOcz6MX\ndZRLqhvHhU/+BU+1vl9ux2dGO14mNZ7xNHipgGrA6WrH6JHup/xVGZDKWv0V\nqE+VpJTxP+nZDUYb6oPHG2hKgwoPi4CFP4qmPktzZwe5uNF5JierksP+M3i1\nifXSVaZR2VqgR9FDRWAZiHAEvTD5oOmie3uc6Qusf/VvVcDXxLuPhDc5X+I0\nBNr84laZx4jXvRs9y/GqYX2YKtx56nyiMthyzVGVBnCnnDnFTAxb5U1HIvUX\n/IXewUXDqSEGmjvpWZsumgrxRgbh3sx6aGT6Zujupkjzy0MZiCDz/3SzF2qK\nuEK4\r\n=LTEq\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"698cb6184d0d6e6823147f7d050c39efe9b8e3b2","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.21.0","dependencies":{"tslib":"^1.9.3","@material/dom":"7.0.0-canary.db5cc0382.0","@material/rtl":"7.0.0-canary.db5cc0382.0","@material/base":"7.0.0-canary.db5cc0382.0","@material/theme":"7.0.0-canary.db5cc0382.0","@material/animation":"7.0.0-canary.db5cc0382.0","@material/typography":"7.0.0-canary.db5cc0382.0","@material/feature-targeting":"7.0.0-canary.db5cc0382.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_7.0.0-canary.db5cc0382.0_1592594883376_0.25177568309358","host":"s3://npm-registry-packages"}},"7.0.0-canary.6ac9bf031.0":{"name":"@material/slider","version":"7.0.0-canary.6ac9bf031.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@7.0.0-canary.6ac9bf031.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"f541c2b15d869350ac6e13f37908adda3e68b40f","tarball":"https://registry.npmjs.org/@material/slider/-/slider-7.0.0-canary.6ac9bf031.0.tgz","fileCount":36,"integrity":"sha512-z9E1YnFn9ejd161FHJVRd9Qu4X4Ms/MB5pxO+LhbaNlJt2gNFN2BqO+qnE7TpM34P0/dnscIKbH4vQi4dke/ng==","signatures":[{"sig":"MEUCIQCQV0+9M31UmQE7D81uENWe0jHusg13svzUvi3AFVI7+QIge5jkQcAr41+vVZUkQComAoKrf0bHTk4dHnmJeCqIO/0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":394734,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe7RaPCRA9TVsSAnZWagAAkfoP/imcmpYjb+VtJThc01Wh\n41m2udNCYk+l9zZLPuke3JCdE0JZbw5ne1ne5ZTNfIoUM/fZTFBitP8AWw6j\nuaGX6Vx2TzrIIpIt2+9PI0NdI/4QOwKn2rBk+s2UiN+KO2QF5gxaZwY+4MgS\nBZ+bKkHJhA1X3ZMLEjyFd/TpYCMkXmeWjB/cKdIgBE0bkPUoFp9s8w6tQATX\nV0Ov1CXjgHUgRdu5tfaitlnA/Ll5Kt9G+DMnS3UMLwPZ6lr2cW5HJfqnnGNa\nH1m0kfdAi7baC4GHx0cEaRDh5kORls5bTGvlXXaaXey7bMWf/vtgVTpWk7Ic\nhZKo9n8GLx3CvQFpl50XL2HJokDnr7sCcf2zaLiAcTHhVFeTcQDpyrQkllvZ\nDe0btM5ASnw0339ENcNJcDqSXTus7u1CcxmaCv2tZt9yCHnUJDzx8pHMNHIs\nk0Y1d8g91GCpWAWU6CZWBCvAptyBsUxOqyXWBgQZKzJaL17FcdlYa/Nf08aH\nCbYWq+LaMSwUec2eoEN9Pgd2tyBkBVMutElbRVu2vNjJGkD1mZhZky/Wpwbu\nDgDjnD8ym8M/HRYmJjdp0uCWDlNy88vWvmWo2Ym85J4HkFoeQW9kOAktvhyJ\nMEuETocIwcKsbM5hygtjGVCcuzught3FvhD81ZgfqJ9kA1yvuS7EXotza/bD\nOq3D\r\n=Hyon\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"e80b52100d3a9ae7653579d78250cf18752ea92f","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.21.0","dependencies":{"tslib":"^1.9.3","@material/dom":"7.0.0-canary.6ac9bf031.0","@material/rtl":"7.0.0-canary.6ac9bf031.0","@material/base":"7.0.0-canary.6ac9bf031.0","@material/theme":"7.0.0-canary.6ac9bf031.0","@material/animation":"7.0.0-canary.6ac9bf031.0","@material/typography":"7.0.0-canary.6ac9bf031.0","@material/feature-targeting":"7.0.0-canary.6ac9bf031.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_7.0.0-canary.6ac9bf031.0_1592596111519_0.7455310611734756","host":"s3://npm-registry-packages"}},"7.0.0-canary.c21b5c367.0":{"name":"@material/slider","version":"7.0.0-canary.c21b5c367.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@7.0.0-canary.c21b5c367.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"8a3f40392b6ed600c61811ce3c2014869ec2876c","tarball":"https://registry.npmjs.org/@material/slider/-/slider-7.0.0-canary.c21b5c367.0.tgz","fileCount":36,"integrity":"sha512-s33rcL7uRyHe0SGIYFDoQZUs4xrweDEZFcCcpjQmzYqpNek1II4JWjzGT/RCFObrYXxQ2C/3F3Zc7oHCx/wyxw==","signatures":[{"sig":"MEYCIQDYq0xjkywyZRKT+yfvSc0+GuW14qfcts7uSGEZbHwiFgIhAKP9g7XbxCRPi8DFtV8KcL82rLUuxtfuJ8RVqDCLmCcB","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":394734,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe7RvKCRA9TVsSAnZWagAABlQP/iPOISjl/H11/wyQPxGH\n4AuEy6FeVldwMTvjM7Xah4xWmoYMUovZS8RSyCWogB0tmSUaWU0tYbXFFjJL\nuxrHueZiDJRD3PwM/F3rrTpztdKhrE1BBwWIArJ2WefZ7rUq3r8iwIlO/iUh\nuKJrhfS4l7GClcHujGXHecEI+vWMU/wfPw/Uf4EHIRURvWVh8TnOdi2C1VRl\n4LQfR0f03zbkCCRDYZojAzj/yh0C3XY+cEa2F+Y2y+e22KH5CkUxgSJxGKec\nbUsZJEmTwcSL+N0vHB7GVZjZZR9AarZ+P3aM1rfRuuThVWynOklCSxafZCUE\nVhOrO5TowCT4KBZenZAjlXrTAnZnkJWmZ/B3ypp6YltY1N+napjjkG9OlsH/\nP0cDbDDsMJ1yQ0yoqCbpBKqvCumB6dndbd44ZwzboP1uJ3fM0MsAO0vEVSHc\nWGtgkeO/a/lTl1cEVFCTAidQ/R6KJgeCHfo9PukmyCcsNLk2b9ZKANPjb5yF\nnuPM1eBqt7e01sXzWkRVwZQRSJsU7xvsx0K3tjwzyT74drhUIc7FlCfJ376Q\nDOErbICMbBnFZsXMNJ1Z7HUAp+8ift+XoYG+vy2IQa/MB8CeKs4r2O4LRLVZ\nJ9QXbi6l+JbSYSGyK6zaR6aZHpEXReA9YIMmKFZr5IXaAoAIMWT7Y84lvFUV\nE4yL\r\n=qpux\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"08c734c10ebecdcec22cb27e38dd9d3941fbe847","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.21.0","dependencies":{"tslib":"^1.9.3","@material/dom":"7.0.0-canary.c21b5c367.0","@material/rtl":"7.0.0-canary.c21b5c367.0","@material/base":"7.0.0-canary.c21b5c367.0","@material/theme":"7.0.0-canary.c21b5c367.0","@material/animation":"7.0.0-canary.c21b5c367.0","@material/typography":"7.0.0-canary.c21b5c367.0","@material/feature-targeting":"7.0.0-canary.c21b5c367.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_7.0.0-canary.c21b5c367.0_1592597450036_0.8082835113984435","host":"s3://npm-registry-packages"}},"7.0.0-canary.bfdd7fd39.0":{"name":"@material/slider","version":"7.0.0-canary.bfdd7fd39.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@7.0.0-canary.bfdd7fd39.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"6106813dfaf10afc706f91aabeb2b9cfbfa668fe","tarball":"https://registry.npmjs.org/@material/slider/-/slider-7.0.0-canary.bfdd7fd39.0.tgz","fileCount":36,"integrity":"sha512-fV+TOlnz0lONmbFVI7gP3Y/ACmOfLAbMp9MrXvK8HD++CrB+XOeo6rfcftY8QeJgyc47i3/hO7YR0i0Q6HFolg==","signatures":[{"sig":"MEQCIAjS9kG78IrNUjkbfLo/ehtkifuS0AKzL6HQZ5L3Sb1sAiA5tAUTfBbwO2leIBQM8t7yfaYnbPpEU5rdFXV265tp/g==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":394734,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe7R37CRA9TVsSAnZWagAAUEoP/A1urxXflY6ga0noHXjK\nMElkG9yyqzPDUSoj/JYBOwkh7aRYiD+fL4JbBDoEQ9cHEIkKSXY17jQcZ4uZ\n50yG4DKZNJ4eGDfNQhGlP3sJ4ntT60Tn0Uk0ZHLanqL9Wq/6yUprRfGAIa0b\n1Z7G+rnoz7JKJysEJByr94Y2UhFVmeRyHIyo8U0OGCEoI0k4M4uidpYqV270\nrDLEmXo8xw8qJWRF7tft/ltRaynag/TlgiY8vrodbXxDLI0VwwSfOk5tTA5w\n3Y5pPArovnTvOXitqMnVilnfPH0YwP9C12cm3cavCV3/PgSO+DT+Xog7zZ3k\nnA6VXIvaB4SJLNEkv1j6KledTghrvi2iylDv7/5aiyj0Y3i++2LjjzAAEug4\nvGqy9PCxyPvHinwnY4rZXKfvqzf2U9BYFG8d3AOiYOCVatQc1pTajYrVkioE\n0jEvjHZ3ydrEG7ckosHGgR50e9EwQWp6++TmYLXfGvTqmG2XTPTZfKIBJ+hD\nDULx73CyuKcR3+CEJzrWCiCNTbljgW99zgzBFa3nf+pJoFLlLwAA2HfTqyd0\nd/LvEkuyPxqMfuSDXE5KBjCMaE5f89+Pnn/O4dhzqsQSxKf3YOgbtZ6eUePH\n3ejOkGwU3EE8xlYNcPUDrGSt1PceTHKY3gCacRydJJcSbjYM7U9/ipSvq2q3\nTMKJ\r\n=x3JK\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"b9b865bcb7a8ad91c21f4b1cc433f6a49dc627a2","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.21.0","dependencies":{"tslib":"^1.9.3","@material/dom":"7.0.0-canary.bfdd7fd39.0","@material/rtl":"7.0.0-canary.bfdd7fd39.0","@material/base":"7.0.0-canary.bfdd7fd39.0","@material/theme":"7.0.0-canary.bfdd7fd39.0","@material/animation":"7.0.0-canary.bfdd7fd39.0","@material/typography":"7.0.0-canary.bfdd7fd39.0","@material/feature-targeting":"7.0.0-canary.bfdd7fd39.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_7.0.0-canary.bfdd7fd39.0_1592598011450_0.6334616809916638","host":"s3://npm-registry-packages"}},"7.0.0-canary.10b505785.0":{"name":"@material/slider","version":"7.0.0-canary.10b505785.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@7.0.0-canary.10b505785.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"95e83f73f0d42c139e2748e2c6e9412c5bbaefb3","tarball":"https://registry.npmjs.org/@material/slider/-/slider-7.0.0-canary.10b505785.0.tgz","fileCount":36,"integrity":"sha512-KIWXNw9+o9EvkoUI7MrWAD2dmNozMBhCy30Isumf8QUJs5r8HsEObCg6ctufcezidhoUsmqBSVRkywdM6N/NBA==","signatures":[{"sig":"MEQCICTR2iqG37n823ug70RrBXL++8LBbZpRE2gFL5jwU2VZAiBl3twwUq1T1Isq5ty+D5cagoqNbudqUdURk0apgRtiMA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":394734,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe7R5TCRA9TVsSAnZWagAAvusP/1OqlIQ2HTlMeb/Mw0de\noXn1prqDdc8DS1PTkpSJnkoAEr8Qo9iij/79sSTav+n7IqjSP/1GEQrHSAwD\nwVMHig2cbZiJvXLmbzgrueMUTUKFZmo51pN3xlcdho/tG6Mr207QnNooJPSs\n4SHAfxGCN+IQjb2H4MMhgPXE6kwwcI0igc2Hpkm55Av6rHkLlUN0+x934bh+\nEgRWy9tOk8aFV7x7Cms50axSxkxC2tNIK/EE0/YxB8J54C3vHKwdAqDLfrN0\nI96fBHopsEVZd82GCjc/vSlWTtOrdggKsazEnnFDYvN24VS6cNx1IAJhRUeL\nIxs44TTYV89qh7O5X8DKc2svHfZTIue3lSJM/CTZyUtsE2TfPR8xfh6bPLpB\ne/aQGPDeYNJHTc/7FYrf8qx9mUDuHjj60778lcfXDVm0yxRM81nLP+WY9C1w\nK7ou6OpKKQPBonaUc5ug6lDvyL9L/kPYfMi0Z1/uESOgYv57jFbPGO06+NQ1\n4hXcx+NACRLCgcfS/fmZnMm9jFqSeC+ssg8DfG7H9m+IvnHVocs2NJeh1FI7\npSdhU5ozfp0tBBsMYhEbaQ7OojK/TNABe6w42ltLPoHP6MViRskK0M7qO/mM\nW8IX6Z934tJNOklsr+D7OSCi7tpvJKmmDakzr57Efo1SelsfhvNuzDZzroTL\nR0mB\r\n=nGST\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"ed5923edcb43bfccd9d40cf56cd605eeaab00d1c","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.21.0","dependencies":{"tslib":"^1.9.3","@material/dom":"7.0.0-canary.10b505785.0","@material/rtl":"7.0.0-canary.10b505785.0","@material/base":"7.0.0-canary.10b505785.0","@material/theme":"7.0.0-canary.10b505785.0","@material/animation":"7.0.0-canary.10b505785.0","@material/typography":"7.0.0-canary.10b505785.0","@material/feature-targeting":"7.0.0-canary.10b505785.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_7.0.0-canary.10b505785.0_1592598099319_0.02118745879281847","host":"s3://npm-registry-packages"}},"7.0.0-canary.6483d3f44.0":{"name":"@material/slider","version":"7.0.0-canary.6483d3f44.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@7.0.0-canary.6483d3f44.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"078a67162b51be0a27b8ef58b0b60dee6fe80a15","tarball":"https://registry.npmjs.org/@material/slider/-/slider-7.0.0-canary.6483d3f44.0.tgz","fileCount":36,"integrity":"sha512-p/o9PmA3j7QkU0p61RrSXX/K/UWhtnhEP4STFd9dVQw1VKGDRqO9VvaDgHGVBBxkcHGj6Gq3HJlMZu4HPvIGOQ==","signatures":[{"sig":"MEYCIQDelhG99b37bCybsqx+JZU3Vhcs/CUnB3BRDUT3kNR7BgIhANxIinZBYaCkTmSAa8qVQl0arG57XYp6pCK7vAcg7IdK","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":394734,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe7SIhCRA9TVsSAnZWagAAUA0QAJ/C8o566A1p6bDvgZZt\n1kO7kdMaLLWIzwxyjj3gTQLjOZGhuZU07Fqb5woEKgqPM+i9ppv8x2rJVTuv\nGJPsMNPWcM1OZmglcYxHXUkfQfdOmtg0xOkFGVpAIrAsvvz28i7VUkkqmQp6\nlrhYAa84kljyDsDRCEd+QHoiJ7UqNpQ6C6O7cO3A1XehXkwXA3xzs1ircjrl\nBPNR8e3muEm22lZrRNXuQrJFMu1NQ6nyPV5FaDhoPQjHDmyza0WtOTmNUCdK\nbMA4YC29zI6GGOdALr2+eiLYj/U91yVavfZBuGgoM3j31WjxFRjLLnlEdZdX\nRsZkU7HC0Jcev1fea9eb5J3ob65hAlKYCRQqT9++Yf5IN9BhwHgavZ2o8orm\nofhukxkhTEwLKArCR76/mH4kqmCxsbJIKgwcjLpeBFOhMxei5ckRzhOLqve5\nYnfuHl7EizklEa+tqOgrDnbcQaAQb32xFryq7IFBy8MqZKAruKqKIGuVR571\n9mX94h5/uqCVLX0jq4J5p3bcsNrxrBmHDFks9FkuIAg/HMvMOF+Pemm0dFxa\nzChrE7VSBIVWAlTEvsiucstU3s6XhG0veE0JMvRSm8jwbnrsqCTdJsNbNX0/\nG7XQk/l0r77A/ZAyr1sUKx2NSvboq3uK4g8jqMrNdZTwFjBDfvHV1WBEWzmh\nlp5X\r\n=pUk5\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"5c831da018408423d31c9c4813c507ca591a010f","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.21.0","dependencies":{"tslib":"^1.9.3","@material/dom":"7.0.0-canary.6483d3f44.0","@material/rtl":"7.0.0-canary.6483d3f44.0","@material/base":"7.0.0-canary.6483d3f44.0","@material/theme":"7.0.0-canary.6483d3f44.0","@material/animation":"7.0.0-canary.6483d3f44.0","@material/typography":"7.0.0-canary.6483d3f44.0","@material/feature-targeting":"7.0.0-canary.6483d3f44.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_7.0.0-canary.6483d3f44.0_1592599072477_0.6295513352136171","host":"s3://npm-registry-packages"}},"7.0.0-canary.30a74e921.0":{"name":"@material/slider","version":"7.0.0-canary.30a74e921.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@7.0.0-canary.30a74e921.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"ea4b1efe3901b5e788135e22c237f0e99bf6a3f4","tarball":"https://registry.npmjs.org/@material/slider/-/slider-7.0.0-canary.30a74e921.0.tgz","fileCount":36,"integrity":"sha512-ZOY2udGQPo44TzeGEq6Ye7K/h5vpnSKnsVcK1zjuAoDiX04pN8un/XHrpa6FThyyRx19FZYlb2gYuYlV0FK2XA==","signatures":[{"sig":"MEUCIQC3I9++1OTt+1ZmwKjNqsApcWHYN0C/DIcjw3p3Nmu1FgIgf7bCV1BzCiNpAMgKCojQ1MExTAhmR0vM8oD5O0duCik=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":394734,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe7SKmCRA9TVsSAnZWagAABOcP/30DiJuD78bgEW3KnKYt\nyu7VifINjocYCWg4TIZk2XfmOUQ9jBYfO3eGL+yR9vKpRaPKFRsSqWrBfUih\nDy4/EFJR6m1dsHUWyRj6WHq786gyOauSCAjqvdajE6PQ4epwewmlmag7/P+2\neE1T9QLk7A39jNPrxnrcvtgSbHWQpoA8XXKBGzK0L9Hii3kinVD+GDkJ4Yl6\nfRuEUCnk4H9oWdo4YXhYGbnUVTxRQcNSrrtPajq30ubLSXNimLuYPEpgziOI\nHBWBC/3lLBdoQJGya+Q9/9FQm5DXyIdPX09aDpkiTT445qp6rxUaSEr6WwRx\n/9QN0nVp0TgCyx/b/xcEAKzgeQ2PF1087nCq/d7gzsZ06sz1V+Ne4PiaFIN2\nPeLXIEMGlH8lW8WCNk1DBvnXLTc8jOLTlGhKFvnv3BRnBLC8E/nAIgBZmojT\nt+PYUIRCJ3qjgI41e1H82WgvvH5D+chCmNzvcg8w9hp9f4n4iUr5K2S3tUDB\nzlFl48Cir+DcezhY71adqAoNFrzixFCLXNjJTyG5V7eNsKg3uPzedrS64/66\nEKwH2Srq9MYXGw1vYSlxRuzK/vQkwiI6kpgwt1WK4pJM0NnjO7MUFVTYRpKy\nmklUE0vaVy0Ro/eJVkgiYzrVBHxcyKH7SEUwqwNdB8IQ+n8f3lj4/C14dJZv\n38b2\r\n=Fb4x\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"5f983e004147b05efcae5aac51dc16aea4a18a8b","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.21.0","dependencies":{"tslib":"^1.9.3","@material/dom":"7.0.0-canary.30a74e921.0","@material/rtl":"7.0.0-canary.30a74e921.0","@material/base":"7.0.0-canary.30a74e921.0","@material/theme":"7.0.0-canary.30a74e921.0","@material/animation":"7.0.0-canary.30a74e921.0","@material/typography":"7.0.0-canary.30a74e921.0","@material/feature-targeting":"7.0.0-canary.30a74e921.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_7.0.0-canary.30a74e921.0_1592599206374_0.019382215682790305","host":"s3://npm-registry-packages"}},"7.0.0-canary.c20727498.0":{"name":"@material/slider","version":"7.0.0-canary.c20727498.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@7.0.0-canary.c20727498.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"229052f70b51697b14a13a04b149bc2ec3cec1df","tarball":"https://registry.npmjs.org/@material/slider/-/slider-7.0.0-canary.c20727498.0.tgz","fileCount":36,"integrity":"sha512-hbQBnKKQqd2zQydkhQEZJ2RisIy0AUbb2CUH3mZ4OsxJ6akt6VUBCHDj9xF1KD1CQCrm7Xx+bOolIQhsyQiIBA==","signatures":[{"sig":"MEUCIApjMyqZ3sksZnKSXP6adk7pxeek14mXI9W1j8tZvDjhAiEA4uTzVjKsYRfb54ez1GJdDIStF+eiynrphU40L1qtBo4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":394734,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe7SNSCRA9TVsSAnZWagAA4cQQAIrVBmBFGznjIMx/aYPR\nIsQdjzqdHin20NkZXy00mFe4LAm7MzZJYeap2qLc3cecFqcOLMfOhKPh/Dig\nD2z7iQhPJ7Mf9zGqWsYbI2uEY9phRL3PMa0m4iKo7dvZge9GcHPphkNuCXxl\n6vkr6ihoQRPSApAtrrEeZg4x6Vs/qZvhxTdXkJWtYD5sOY0IudWh/pZNM8o/\nt7mR60dio/cvsnsB1PBeIegMzpXtkAZKPrTkYM8DO9Ek2bX0yM1Ae4iAe9lP\nkCYwvGmencEJHRV5Njt+FOQ+9Q6glU6H+lqU5KxTj4WPnCLuUaiacPQsjsMU\nj8byJAPeSI6T+Q+/TD/uLf2Q4u/7b9fPxvY+m9jKx/kr4pyYi92JAoJxl+V1\nK2kFAq9szp8qOgfbpdUbiCAn2lAukJY/9JnqBYLzKf19MXwmMDPR3fLjIjqk\nqsx3jdVfbBpR3hDKaUPV4Zku1Dv+LdhwXKTCxQi6w5Oj8l3VjS/Dn68WbYJ0\nlEarTteK+kT+xEcElrcPXW/rQ95xbpV7XvJB198ZbuHDh4IT3otS77IJBzfK\nbjRSvpn/P2VLrHOvP/QDV3bk0I9GaROKuzFARkhaAu4A7YPzDzARxEk6EE8J\nDobmknW6YsdmHcCY5Uxe0eD3zn+R8VwVu+nNRdhUTJGElAaoLNAdRT4zirY4\nzt8q\r\n=Q8t6\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"f9ac75746f7899d34903c19ff758bcadb9ce2d30","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.21.0","dependencies":{"tslib":"^1.9.3","@material/dom":"7.0.0-canary.c20727498.0","@material/rtl":"7.0.0-canary.c20727498.0","@material/base":"7.0.0-canary.c20727498.0","@material/theme":"7.0.0-canary.c20727498.0","@material/animation":"7.0.0-canary.c20727498.0","@material/typography":"7.0.0-canary.c20727498.0","@material/feature-targeting":"7.0.0-canary.c20727498.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_7.0.0-canary.c20727498.0_1592599377498_0.03847529743709144","host":"s3://npm-registry-packages"}},"7.0.0-canary.4e360ae94.0":{"name":"@material/slider","version":"7.0.0-canary.4e360ae94.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@7.0.0-canary.4e360ae94.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"be5f629ed5be3b46e44714354b1a0c0cbbc91146","tarball":"https://registry.npmjs.org/@material/slider/-/slider-7.0.0-canary.4e360ae94.0.tgz","fileCount":36,"integrity":"sha512-OJdve4s7lIgVytFnK9KsVH+LyN+BtG0JjSnGDAvAzYARafGp9Ii1eipCX8jG+vYxaoKcsAguSqQGEhuPtnNKcg==","signatures":[{"sig":"MEUCIDd7MKghFny+zgglReLMCBirXZsxdnTf9hJBjxn5RchWAiEAry+XCbGXQCn3j7G7yoywIGP3wmX7n0In0CbCiZx42Vk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":394734,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe7Sc+CRA9TVsSAnZWagAApV0P/AwhtgeNaXFcreE9fUVP\nKo2lW2Rph78sQG8T2W775gZO0sUPLkEAi2EMMsNotgdw5FgAeSDGC/GcAUmx\n6IY+Y4ip8dr++2vPaKcgyJTZf4rQQ25FmO6F0JJCmbFUg85z4PgaCN+q9vB/\nVNzNor9ZVO4YN2/px9d5n7AXPxenGckTcGgwWDslFPzTofHPjFk19BHTDaoU\nZc9lYVriS5l/DBrue6+iI++SdDAPjlhH1WRQsG2Hhn4Rt/pwC71XE+ldEQHx\nkjdjLAuBpTmlS9szCgokYuKgOMId5TH4hzEazFfbgGtM16ssHlmbQb7zO0JT\ni9ooXT8IaAskzyjncyeyPi78YQMmEf6/zP74GwX+ZHVroZQHaR6mm4MbhiYk\n/d5cLfNA3k1iAW0K69rgW1IBsnuzx49FOyWq+g1+/p8ISX+mRINbFmxDtmKs\nxtL+csnGFAq1DfhFSvbcxDWQpa65/6bQ7yP7xuQTxstPklzgepWR5Rz+oz4e\nIgVwcpqiAUzMU7Ztvwn0SevrVVZARak1n5owtR/X+LRzRJrGBhPyjkinjriS\nhsblet72PPFkOuYhT1lbiY2OHHDNYcsltSB/M2XOP6CUC0vPHpz7lwqkEpAb\nzlLlggHXUoiU+adkZf4O1ZLGyLxYAk5AEP1kz9LydcSmBsIKMJx+il+m4e+h\nKviB\r\n=ahYT\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"7bbb3adc3aa84c4095304613145fa53862e147a7","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.21.0","dependencies":{"tslib":"^1.9.3","@material/dom":"7.0.0-canary.4e360ae94.0","@material/rtl":"7.0.0-canary.4e360ae94.0","@material/base":"7.0.0-canary.4e360ae94.0","@material/theme":"7.0.0-canary.4e360ae94.0","@material/animation":"7.0.0-canary.4e360ae94.0","@material/typography":"7.0.0-canary.4e360ae94.0","@material/feature-targeting":"7.0.0-canary.4e360ae94.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_7.0.0-canary.4e360ae94.0_1592600382230_0.008654811196714851","host":"s3://npm-registry-packages"}},"7.0.0-canary.8550fa53b.0":{"name":"@material/slider","version":"7.0.0-canary.8550fa53b.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@7.0.0-canary.8550fa53b.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"4925a629e4139a315e9491b2797d90f9c74e8081","tarball":"https://registry.npmjs.org/@material/slider/-/slider-7.0.0-canary.8550fa53b.0.tgz","fileCount":36,"integrity":"sha512-ARdleBFYKWz8tiIpabjSrfjJf1niLUNf3d8vNFkOktSYOavf7rvWbw7WKkFoEBVRRAMurWkP/P6Vie8O34pIEA==","signatures":[{"sig":"MEQCIBoyDUD1/NGadilp7HB1kS8c07jKcVaKDfrJsRFyoVvXAiBYvbB5+e7OniFkHuBNffdd6RRoLw8UjSqBNHURTzioMA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":394734,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe7SfHCRA9TVsSAnZWagAADeAQAIhn6zeiurOKmoR9nekj\n2ESM1MGeutgyyctuvwDw8Ob3ei3hXuO44B96a50NkN4qRanOAUF0B9SZZI3E\n4oEeHfTZp2iGJq+Q9VAGQNnLDND8fm1Yz9pwZtadLFengT1WgLzpGIo5XA/o\nIk++jMt69aJcLZgK3s4l63AVd16D0QCS7v38/NFFZao4bR/VheLTeBIyiI0u\nL4Vk7AC8ECQDS56whL0+5O5pJHyGnVLcCkOrqjsNro2fhTIOwi6kblerq1KL\nNpWxWh+kolXLy+HXPlrXeQBQRWNear0+QFSkcKkgEKO7N216WmRBZjgfQZie\n4oMyqo+NHMPK4JR2QnNt7wUDMSaaoipGcilvFY4jqWVCEMUgwfuBkDlVDTJM\nPyV4Yq4Fc2iAE6BuDvFsrFgagJpgij9gNNGJcBG0WRVAr+sXH4bk5sMZWRfS\nMkH51NBg7dQzsRCeNlFhPgntUinz6Wyik+PS3GmYsNti4dWPeXzoKR0QG64b\nJbZBxCugv7mSov18Zn6cs+s81cGO5wAvdcmUEOAsob6re2hTme5hmASu+744\nGj7CMOSYU9gAlF81bnb/iZbZvTq22oBd7QSy1uZM+v6Rj1OPMaj7UzK4Ckx8\ndR/VpA5dNkl+uZQhbo/tPAybJqe1gpvdRySJQSotep0FwE/mM8RqJ8oq8LOp\nyJ6F\r\n=qyt3\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"9d8529cbd579dccb2470a1f19fac57883cb2a5ef","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.21.0","dependencies":{"tslib":"^1.9.3","@material/dom":"7.0.0-canary.8550fa53b.0","@material/rtl":"7.0.0-canary.8550fa53b.0","@material/base":"7.0.0-canary.8550fa53b.0","@material/theme":"7.0.0-canary.8550fa53b.0","@material/animation":"7.0.0-canary.8550fa53b.0","@material/typography":"7.0.0-canary.8550fa53b.0","@material/feature-targeting":"7.0.0-canary.8550fa53b.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_7.0.0-canary.8550fa53b.0_1592600519534_0.33324230412898537","host":"s3://npm-registry-packages"}},"7.0.0-canary.93ade142e.0":{"name":"@material/slider","version":"7.0.0-canary.93ade142e.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@7.0.0-canary.93ade142e.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"7838afa0667b0f91a3d5584bf151563fd0347010","tarball":"https://registry.npmjs.org/@material/slider/-/slider-7.0.0-canary.93ade142e.0.tgz","fileCount":36,"integrity":"sha512-7J9kSJVSDIpaXykpRyMENPyv02sIviZEXKc1xDkEsmhOSfnxcPTtyzU62wc+8BkTZIlkHuV4IigPuuj9wwPN4A==","signatures":[{"sig":"MEUCIBTRDS1Jb87r8ZNtynHt0ZOYIZAHAfL3EhLW87c3M0VjAiEAnIxem814Tm+kttZ2KpPv8GFy8lsm/JbwM6SdUxKCqbs=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":394734,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe7SgRCRA9TVsSAnZWagAAWDcP/1ikwpHlxeNOhgq6/ljQ\nhglBKtTy82gn7rqdh6UJG6hEGceQ/Dmz24HlJniWI6GejvYKA1EH+m2gAK3H\npEQ0Xrni1z+Ja5z/QWcbL8zmqO9u8rs5Qwjc9GPdnrP0XfsWc66wd38X91Fq\nvNGfEMKBciR5KwPkzBJ207ARaepXHGRQmyzHHlFmB40qlPqNonmXTix8yMQk\nqNvvlNvsreAYB7m+BtNrf2IyfygRanuYYXcxKJCaI52uNyJ7H302g4I/PyHY\nZuQc36QJktZqIPOctyGaFzWl49zENg5XKbVhkXn3cC0DybAYCrnwJXJRNpJm\n9biTs/gm5OTDXLwiaTvFSb16fQ5on1/hq7o+8Ne1ZI60jrnJ56UHq9Rw5Aen\nGGgknoupm2xlf5X4LWWcYq2oYECSbmamSEwmFJLuVcXx4Xbh7uGcDC7r+b6W\nhga6hUZhNrbebOWPuWAKeAnXRFINAMrtyLxZ8ICnp0q9bjioc3zRCgGKBH1Y\nUgVlpm32qtQMp1Lgkaj1YierrpIyoQdBYBoa50djOTt7ayMHXpurz4d6RlN5\nXgWrxs2XM/B/oedYwmJQ8Jqxg4ARE0TwSLTFgN8tR54evaaOS/BbBXgvU/Vj\nXO2PZ50g53VHDwZydDLw8wJbbx4AE0aouvYmZ6YIQVOXg94pIREkCu2E/Tl7\ncz5/\r\n=sDZw\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"fe392b7ba8c7033e5614eb91a20bdf2e6d7d7936","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.21.0","dependencies":{"tslib":"^1.9.3","@material/dom":"7.0.0-canary.93ade142e.0","@material/rtl":"7.0.0-canary.93ade142e.0","@material/base":"7.0.0-canary.93ade142e.0","@material/theme":"7.0.0-canary.93ade142e.0","@material/animation":"7.0.0-canary.93ade142e.0","@material/typography":"7.0.0-canary.93ade142e.0","@material/feature-targeting":"7.0.0-canary.93ade142e.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_7.0.0-canary.93ade142e.0_1592600593028_0.6765338534172085","host":"s3://npm-registry-packages"}},"7.0.0-canary.a0032f5bb.0":{"name":"@material/slider","version":"7.0.0-canary.a0032f5bb.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@7.0.0-canary.a0032f5bb.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"944223f6cbdb7a077ebbeffd42a528ccdd8f2d75","tarball":"https://registry.npmjs.org/@material/slider/-/slider-7.0.0-canary.a0032f5bb.0.tgz","fileCount":36,"integrity":"sha512-ldXBaJ8qgtc7j7yqexQGDVXCLIORR46t80561fB5ZlVxlkCGvBdh9CuFSGdf1pceScy7uIKqvqxM9woWTX+9mQ==","signatures":[{"sig":"MEYCIQCo70S+tO4cF1opKoH3H8HUwx3uXVVZrAIz9yhNWxROYQIhAPNOh3MMIZAYMJRc58aqna1qhBRP3pr7NAUBXXdTah9N","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":394734,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe7S32CRA9TVsSAnZWagAAoLUQAINxVqpwVuHk2ZRd1cxz\nR7rVAkQszdU6Q0bIp2faKBIlj95ao46XZe5sx+F8dGqTyijC0Q6eoCLejwDl\nvR3jgEnruWsbMTqubwk0m7ZZuQJp6rIA7Ma3pXKNJTPvZhuaUZRhUiq7tW++\naYqdHvT6S1Ed6HKlWaahkcy5SBirkR7xCpCNQQLAQNZnf4DUCxWd6I+2Sc6L\n3JvxdkB4sbyomExZEBHgKJ7uXdm7KF87q7odzNKMbQ4A7JVdkwe3Jdnxc9vm\n5Tzb6EQpeBPr99HUm4ha8qETxS80/zys3qLYfHoO0XFHO/Qb8pmDvQIo+k0W\nerdrrgPgENomXg3EAHzIXpivRxl7ABpyPKZhR96tXseIv8ssrD5Ka8sr+IQv\nZ4L0H4SwvhuSZ5RmugL0g8so3L7iHfs8D5EFt491yq32HiiZa8GjWwTMwxOh\n3HrZPpRgQXbKJdGOcObBmYox36Ex6RjZCvcRkfq94AMnu9YpKNRqj73Qg0tG\nzbHDSuBNIxgigFAg86ECEPjrxmQmltmkNps1bJYX/wuol0Mt3N//2ly/+1Cq\nou74tCODIH+wgehiqDhxMcGMsugoTLgChpxPT0o2FWxg2KUpHMzYs9UOd5eH\n5MYv0WzqlvrbEULs0UzaDXWYKqOhZAdRt2iQB02UF2/2NX0PO5vGp17MwVLm\niYhC\r\n=ORo6\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"8c0789d8c409d91f7f4e13675ac80e0f355bac02","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.21.0","dependencies":{"tslib":"^1.9.3","@material/dom":"7.0.0-canary.a0032f5bb.0","@material/rtl":"7.0.0-canary.a0032f5bb.0","@material/base":"7.0.0-canary.a0032f5bb.0","@material/theme":"7.0.0-canary.a0032f5bb.0","@material/animation":"7.0.0-canary.a0032f5bb.0","@material/typography":"7.0.0-canary.a0032f5bb.0","@material/feature-targeting":"7.0.0-canary.a0032f5bb.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_7.0.0-canary.a0032f5bb.0_1592602102107_0.37724925747841676","host":"s3://npm-registry-packages"}},"7.0.0-canary.3f342e721.0":{"name":"@material/slider","version":"7.0.0-canary.3f342e721.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@7.0.0-canary.3f342e721.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"78f25ab518636e9da9ae3f36e1c119da28f42c53","tarball":"https://registry.npmjs.org/@material/slider/-/slider-7.0.0-canary.3f342e721.0.tgz","fileCount":36,"integrity":"sha512-cX6l9hTklSMv+q9oZp6gbdkI4WvCD981QG4P5ZOz+7C0hNiINUct0xoZC5fuv2HgnMtUsfkuZcYI8r3kXzhgZA==","signatures":[{"sig":"MEUCIQDCVJEfVQXbfOFhsZNNQUvYwbQfPQ32OWY7ZY6KdVWvmQIgH2w8nTEGU3VCJfql8DOeWyOdTLF53vbwDi9wtwV1rKM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":394734,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe7S5uCRA9TVsSAnZWagAAUTsP/RiqQEpGJmlR2BzxP84H\nE3Xg9XCHlSgwBcGjxQPqoFR1upN7L3HiQPAvcziHt44TvyE7RHDNUwhC9mgh\nhqeVSSjpwfqMki2wLtlr7lkuBiiaQs5k1PkJ5a1runkH1gBJds2w4mshxNCK\n832ez8zEry+o2lFb8mGxog01FWWtfP/vOjf2msJisUqg23+Bvm2WzKZ7BIK4\nF8/LnAY4aQOrEAyujYAIhLQ40dkl0Xd2uiRx2XBWooiZT/V8eje2mzN3AIT7\n3csU/8fq+1OwaASL0ovGzdoC7do5espQ3zLHIqpg3xUuJYiOECVnTetRs14e\ncSXvtkdeL829b3Olc885XoijuwHJEqYvx9cgIJcZsflaoMdX0sPem27N81ar\n7rf0zWRh6GXYo++RNp/9qWDL6irN6BvqK+T7UzD0uK3ys5ECUIZqPde9mNuM\nqeeSTwy2lfbo2J9GOmbtBv4YdxxAtMpRVOHVRAiqmsKHgYdaV8LehBbcIjzO\nIEOW56GW3F1FF795eATZTxei+4x3RvuihIR+YA5Yf4p50PLrdBVS5CsQYgQR\nkko5CiuzPqXeQEKaEV/dzDy9ljaUq+npFqyVSpiH/Uy8Q1JYNQZpBRgsKAXT\nj9GFpg+0zOTc5iKBCErfvpe6rg4p/uvvrMFIxyJXH7yTsosFIFZaB75QWmcn\n9a85\r\n=gBqH\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"e972042c8ae08ecc8469492707d55d647e3495e6","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.21.0","dependencies":{"tslib":"^1.9.3","@material/dom":"7.0.0-canary.3f342e721.0","@material/rtl":"7.0.0-canary.3f342e721.0","@material/base":"7.0.0-canary.3f342e721.0","@material/theme":"7.0.0-canary.3f342e721.0","@material/animation":"7.0.0-canary.3f342e721.0","@material/typography":"7.0.0-canary.3f342e721.0","@material/feature-targeting":"7.0.0-canary.3f342e721.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_7.0.0-canary.3f342e721.0_1592602222116_0.19921724018310805","host":"s3://npm-registry-packages"}},"7.0.0-canary.ff89457cc.0":{"name":"@material/slider","version":"7.0.0-canary.ff89457cc.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@7.0.0-canary.ff89457cc.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"cb5023d3a51a49268bd4ae12dbfac32e37ab3d80","tarball":"https://registry.npmjs.org/@material/slider/-/slider-7.0.0-canary.ff89457cc.0.tgz","fileCount":36,"integrity":"sha512-H9w3MG5lJ+4uUsQIV2MT+DxyVKrCFDRxm1Tl3LMQweHuFpuAO8k7uBWWN25/sZBnGhAESs5OHR/wcpkq74NIiQ==","signatures":[{"sig":"MEYCIQC/xfD6WPcKZgQR/s+K+TqZNgiYUCsCT8fDiEwcLxVU4AIhAOhWckuGmfwf8yeAlw9GGYBD97ONoVyEhQ3S83flW2ju","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":394734,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe7S63CRA9TVsSAnZWagAAUuEQAJKnKgNkkzEoBX2nL2xG\nQjdHLMpdcnN4qeHpij01zjkSjW2/utse6vkJqCljOa1Kr7gF7fa2POfpVTVS\nfEDxaa5V9xBiiVf+dwZmvtqsRwMv4Dw719DkCQUhU1rhYEAb7Wg0/+/crNmd\ntIFCuQpfsOOC+CVCj4k4iHMbfxDhEigKZr/SLBUUa67iGKOJ93NQWj4ayUt+\nzJSmMzsQCGyjTsSDQGyTXtbZGKC91VcBGq4ZdPollFldU3qIVXIKRA5/zGhY\nLkxTyoKMkw1rPP/jBB9SQqJry6zJ2gzvsiMiiBzN/Aq5amfFgHUGHYYEq9C+\np9wC6A584ltlCZjXwFMqLqSN6gv/u9CjgyvrK2z3uRectb+uzH9m+TTgNBBp\naqehRUSarR6/pB5PmTnCxgXNTh43Bt9NPpmIz0DID1HPoSxy7k4fjv0NF6Br\n2ncuI8/wCx+GOOOUClnqiq7yqV7Zj1MEIkzNNl5Em7XDt2BTcB+ZHtBp9S2Y\nGEG3jhUqNGwoiB2Ik45Tsjo2tW/K14SnZ4NBc7PKOLitSt5TYleEddM7Dd7N\nOLb1ns6HYnkmTn3mrMTL021cJw5NVUlLGusiCULiZLS68vZEu3/SqqrXiLUS\noLMX6EXoqTwixW931KsGxccjU2+i+idFMKrKAdyzzbzW61v5nFak2qp8k3nR\n/tKH\r\n=Z64y\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"1a3ec64383e8afdd818b5edfb74f32f6acebd044","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.21.0","dependencies":{"tslib":"^1.9.3","@material/dom":"7.0.0-canary.ff89457cc.0","@material/rtl":"7.0.0-canary.ff89457cc.0","@material/base":"7.0.0-canary.ff89457cc.0","@material/theme":"7.0.0-canary.ff89457cc.0","@material/animation":"7.0.0-canary.ff89457cc.0","@material/typography":"7.0.0-canary.ff89457cc.0","@material/feature-targeting":"7.0.0-canary.ff89457cc.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_7.0.0-canary.ff89457cc.0_1592602295037_0.6058632949586957","host":"s3://npm-registry-packages"}},"7.0.0-canary.4a1855cf8.0":{"name":"@material/slider","version":"7.0.0-canary.4a1855cf8.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@7.0.0-canary.4a1855cf8.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"cd3e22b7dbdacd60dda8009b142180d5cad76ba2","tarball":"https://registry.npmjs.org/@material/slider/-/slider-7.0.0-canary.4a1855cf8.0.tgz","fileCount":36,"integrity":"sha512-JwiBosC7HEeG38UYnyt10JK52bbWhw3pGAZTNvmmYRTV9rcHQ7STbp+CH+T1Vm5gZ321IY3uBPmMF46O40gRsA==","signatures":[{"sig":"MEUCIBktAtUJnsUaTvtVCL1UuCct3eBHF3H8z25ulM14sAEBAiEAjGcpvSEI1p+gyWe7LZUmGI1eB+iYlsQnQqUbLg4pgy4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":394734,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe7S9aCRA9TVsSAnZWagAAPUsP/ijQGoxAi6wZncviyqk/\n1CIVaRJJe6PtfJLZ3cJnHh67c0bcA29L/fXyFzrbTzDQoyaB5wMpm2Oo9zrx\neVzA3vA1U+npcF8ZxL92ZSOCLB2MS0E6icX0tz86+pTj++nWVVxPICbrlg4+\nFCV5ukEtyfZJyBkmmLA7us1cznQ1PMURoZJHuvIyBIf1bhXBqF2KylgfqvTE\nWzII+u/7mDXIjQ/4lqSfGqxtOGaX3S+ugOMbtI65dfYtMFtm5Ogk1PvNSqUf\nawpaRy+wniZLR5kCtvvlhOIDXYaeOhj2a87MA0/Ew9ie8yP2ympNLxxgV+7m\noTwkTXPYx9jcbcsbGVRlUjOriEYn3r/e+zxh87tmJnfEDSGcRlLLhr5QdRor\nkuGZrjBCSuv4NSjX7OohUHrZv9O8dTJcJcPm8U/vfDEF84VYcHRlK4+sErre\nyi5kRFgapzpqKzB1X/aDvfRXLzbCxb0/R5UpSp9qJN6yld7ntfJts8Pioedk\nDC+E/VETBvW6TqWEMCAYVOdpPzzUZyL0PYqLTvlQ/B+VvZQ8zAzP+D+UQ4zW\nBUV+pzdujPMAyQnG16IA2+jgyA3babO2B742gkpesflqicQaIuTbmcHvi0O3\nCJMY4IUOaaIcZsMvK+RkZxQxEqujgdVKbIS0+dL3JblbwrY1TIa69YuFwOjv\nJoAV\r\n=vCDs\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"eaeac5e820cdb30fcedba281da8c2c4a846f0e73","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.21.0","dependencies":{"tslib":"^1.9.3","@material/dom":"7.0.0-canary.4a1855cf8.0","@material/rtl":"7.0.0-canary.4a1855cf8.0","@material/base":"7.0.0-canary.4a1855cf8.0","@material/theme":"7.0.0-canary.4a1855cf8.0","@material/animation":"7.0.0-canary.4a1855cf8.0","@material/typography":"7.0.0-canary.4a1855cf8.0","@material/feature-targeting":"7.0.0-canary.4a1855cf8.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_7.0.0-canary.4a1855cf8.0_1592602457981_0.35926233306379407","host":"s3://npm-registry-packages"}},"7.0.0-canary.8602f1b4d.0":{"name":"@material/slider","version":"7.0.0-canary.8602f1b4d.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@7.0.0-canary.8602f1b4d.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"b5f8dfa2fe52e8219464d44226e6c1dc40b5f142","tarball":"https://registry.npmjs.org/@material/slider/-/slider-7.0.0-canary.8602f1b4d.0.tgz","fileCount":36,"integrity":"sha512-PfytHkj9jPre+qFLi1aldEUeNdtnd9yHgcbmZXaTk7qgdpmUFd4dY4U92cH5RKJb/K1F+OtDksR0+mfOvvYrXg==","signatures":[{"sig":"MEUCIQDLJ392L3kfG5lAx4zVswiaC8eDMaubYTFtsJtr8cMe/gIgN1IuQDElB0Xx7EtLc+6ZjF3SAid8EBPWQdtU5okGTzg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":394734,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe8OkuCRA9TVsSAnZWagAAu/UQAJlWiYf6NTpvKnCiYf0X\nY6oxvKlkLOboQ2g/H/H9JwkoNtkJEkZ3FTeYybKauCxSfWnpVvStmGo3mSft\nNHUBjTxjQGauuY/ZvyWNGpjwEPAZb3y8OcR2OtXvDWaQhdFrd7HdZgJ87Z+e\nP7t+BI74UlKjQm1jriDK5JkKjJgEFH4OlRi3DUNf33s7EzJg13DknbH0bM9x\n5wT43PH3p/vQMVNV7ENkFgI1Z1f8u7V0t8vxKW1SoMVqkhfTMWadt22pLdTk\nlBRZXb2cHwr0+ikj6bddIshSkdJlEe+w++H11SjS/OTxLhNxxGLu73yuwhDH\npznXzkmcX/OdzmI8xUZxFfzLswbevxooKHUibeN2ExO71LJMcRNWqqk0r9DF\nlR4Mf3ydZOaH4JGBs0Zlc7x4X4GUFvVnMSmd+20qbZ+8mRamK0FitGbaRj8X\nZ2HMyxAr82P5k3Q+SDDurYQjjsVCnGFMp+YsU+/mWYsgQyGGdh56TueoFINh\nUnhttEiWXVjCha6TOsQMqn+QcmnVucHJ18ebTzpjl1rAivBr3Er1LnpuYkhU\nAB/C8JT24zmXylYeSejwRc39to3tvGAqEBqLKrd17e9b0tKlB9AG+ySfKRVS\nPpXo0U4uKfeugc1fTWGQ69iqRML9VX1OfwPb9UrzLP54PpILKC15RydNC+Hg\n1JUb\r\n=Jbfs\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"07f6372c5a2f6f8add971db62aba74793d912f70","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.21.0","dependencies":{"tslib":"^1.9.3","@material/dom":"7.0.0-canary.8602f1b4d.0","@material/rtl":"7.0.0-canary.8602f1b4d.0","@material/base":"7.0.0-canary.8602f1b4d.0","@material/theme":"7.0.0-canary.8602f1b4d.0","@material/animation":"7.0.0-canary.8602f1b4d.0","@material/typography":"7.0.0-canary.8602f1b4d.0","@material/feature-targeting":"7.0.0-canary.8602f1b4d.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_7.0.0-canary.8602f1b4d.0_1592846638193_0.8951485698035777","host":"s3://npm-registry-packages"}},"7.0.0-canary.69f9f0982.0":{"name":"@material/slider","version":"7.0.0-canary.69f9f0982.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@7.0.0-canary.69f9f0982.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"b8c5ee16a18ca07a2f9013dd7d6f850a0d8ab58c","tarball":"https://registry.npmjs.org/@material/slider/-/slider-7.0.0-canary.69f9f0982.0.tgz","fileCount":36,"integrity":"sha512-9nUssLfkw7Tv59UoOEbYDL7f7Mat3rch3XxiawFpuW1nBWkJdxEyE8YKLJaV8qZ/xsrZXnIBNBxTN122MOBWoQ==","signatures":[{"sig":"MEYCIQDxM1tIyISFri6nDBR7YYHn6n3Vq1taTzNhDAEVI4P3AAIhAJReV3NPcSA238q1PTR4OJirSqyBCHzBLax6FMFCAb09","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":394734,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe8R9LCRA9TVsSAnZWagAAnfEP/10IZZxo0XTfIYXBr37u\nLhu9xPRNJuggf6MH9U0NjucFwVJof44GjBbfkJvvw1+tkoinZgbsa6miAkzL\nEaRxoRjrSScujAtuoM4qMiHFLbdII4lrrNJthTYU8AK+FDCG7mN22goOY+eL\nZSu/lVbUTCE3A7yCzPtUIeWG+VDpRnPHC6SLNd5q1dHh9s5polJq1Ssy4pnh\nQPvydyVKlCZe390wTqaoLMJbN+oXL6Xjkq8s5HIuYMof+BmxjR3WU9CRM4ps\n6J1r3RU/5sJwgYI3BsYhmaNWt1lW0D73uqyR6S1Q5OBAQC+0I86PhvgtrhxW\nI4FAFkUsA+el3EBdSI0wJQR+y78NBZ1kYVnqF9tHPdHjKBlo6nd37TjPkB8h\n3BkBSIpocVoa1ZwERTJY0clyY2/XfdFTiuNFGU9dfMenpqVEKuEHHnnEG4oJ\nXsGKp7mv25yA5s2BbLmfbuiI5S1cL3jTE2KawTYVI4UpJNvpch7uXIVDmBau\nBLOKfEVQQohojfe7JhIg8zdyL4RaR7zbp3eP502tgPecJVccaKAEorT4dPSN\ntfmPK4wTIAS0n8TfmsfYapYaZZ2c0wcNWwvliEOZ9HbhrEdOa6hYNIwoj7Ic\nHEJ1707HdmZp7qWiEpRQ2eu6B+9ASWVv7AkezvCiHaXq+ZAk9QtHCO9TbSiO\nIsxC\r\n=pPwj\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"3aa0430a8c5f21a2aa9f3d54afe07b1c1b1cac09","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.21.0","dependencies":{"tslib":"^1.9.3","@material/dom":"7.0.0-canary.69f9f0982.0","@material/rtl":"7.0.0-canary.69f9f0982.0","@material/base":"7.0.0-canary.69f9f0982.0","@material/theme":"7.0.0-canary.69f9f0982.0","@material/animation":"7.0.0-canary.69f9f0982.0","@material/typography":"7.0.0-canary.69f9f0982.0","@material/feature-targeting":"7.0.0-canary.69f9f0982.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_7.0.0-canary.69f9f0982.0_1592860490865_0.5236188170248253","host":"s3://npm-registry-packages"}},"7.0.0-canary.369a293f0.0":{"name":"@material/slider","version":"7.0.0-canary.369a293f0.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@7.0.0-canary.369a293f0.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"63881b1033eee798f5e7088eb905a8fe63fd8d4f","tarball":"https://registry.npmjs.org/@material/slider/-/slider-7.0.0-canary.369a293f0.0.tgz","fileCount":36,"integrity":"sha512-KzdDqokkUm+W4sRMXtwRMf63bD26FwN/+mbeJPCHCbP7+HbHK3Oqnes/Hoh9rMJwaMbtSp7RKZY3jORQdOzeCQ==","signatures":[{"sig":"MEYCIQDf6srD31895b73v+/O7Dz1XZqssG9P5c3kv1KuLSsqoAIhAIgIOlMqgPRnkt4qJcC944k79qEb4WDR/tJ6nsXxY1hM","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":394734,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe8R/jCRA9TVsSAnZWagAAipoP/1TLM/OP3jhioJBfUIXB\nr+J+QVJM/+3L4sgJXpoGJdJ5+IIxlawLRIVq6d/6fU42TUOG4x4/aUAGGfQK\nHs0GfUXX0UhgzESEPA98Ur48jLyxz8qTB9ZJL7VM5d2sgyS9V8knhDiFb/fh\ntKA3UdDO5kGUfF452B0M0Ri0Ccm2jbH8aUfWrWwePkteA2fsZm5BMVdXORaJ\nPUeo9pJcX3QT9paPUUYsRWN5OI28cdsrGpmo4RS7TLupQu9n1SbZX3MtnBXD\n+u9Zy7q+Ru9FJKdv9SUPW9imPEybU+bXhwu58gnNVaFw2A0Bpcd/mBOapI6B\nBHGuXz0+HKSp6YNFFmB+FvVnC3iPId5Mc25sHyE42YyoX8KI1ALlQC9w6/pu\nxU+UPQYIC/s2MNzAA7y0vlSl8ERPTHrJ6CySeRzarteEVXQot8oghx3ddjMq\n1RiZxFCexz5nDHEqmMElLRpUyls1CAXWgAH43hmNOxm60cu9/0tDUHaVmWij\nqViOiChX/cQ4H5l9kFLftZsoSMAAFgL8ucLSZsb904GNNof3Qtk/4e+snznc\n7gwMGBCzHQbT+9X9IfMos2wuxLiKxlevdqu4Yiacn8ObbQUBp13yv6WRwanO\niJeLE1yko9KABApIXM3jOmDjY0K6dp3d4RFUXXHRdlJmNwwUvudJhbC3Ey10\nTWHT\r\n=IQaN\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"4b9943a16a4fab61aaa8f5dad0d4f7aecee862f4","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.21.0","dependencies":{"tslib":"^1.9.3","@material/dom":"7.0.0-canary.369a293f0.0","@material/rtl":"7.0.0-canary.369a293f0.0","@material/base":"7.0.0-canary.369a293f0.0","@material/theme":"7.0.0-canary.369a293f0.0","@material/animation":"7.0.0-canary.369a293f0.0","@material/typography":"7.0.0-canary.369a293f0.0","@material/feature-targeting":"7.0.0-canary.369a293f0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_7.0.0-canary.369a293f0.0_1592860643560_0.3291071837789774","host":"s3://npm-registry-packages"}},"7.0.0-canary.f1432b5c6.0":{"name":"@material/slider","version":"7.0.0-canary.f1432b5c6.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@7.0.0-canary.f1432b5c6.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"77100f38990c02c6231b7c112ec1cd476548984c","tarball":"https://registry.npmjs.org/@material/slider/-/slider-7.0.0-canary.f1432b5c6.0.tgz","fileCount":36,"integrity":"sha512-QR1oD8Y3PAhNAaHyIb66/g8pXBCWxywDI7nCD3eltz3U963FItbwRfU1TyhCewTrPrGeNIeWWNEIM5DIzpHNRw==","signatures":[{"sig":"MEYCIQCPDO5zrfcyqP1ArZ9OAXrMIB/GZg/llBftgONwLn+44wIhALfXBEX/JWb7fa+BN7940qJjoouctXbKqHrrHkQnSkcB","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":394734,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe8SHJCRA9TVsSAnZWagAAYXwP/i6uHftUiB2LlsPyCbul\nni5278Nh4Rixrz6FqbTMu+N0H50yI85G1KpaoNT5UG0It4rBezuL8cqiInqL\n6FT4Z4B/BRFHnMy01TTpXLwpAvPoMFhwLHOBayyRaNl8bYBePFSKu4tgQUOX\nPvkyLGGEO55iYymwSmlPjouvw0J9j7ltPz+xdO9BCF8gziZFVMFwDM0ul0bV\nTFi0YlPgFvewB78Go206LXoU9rqXhZN32sGjcC2rZJqA/Z3WyXFJOqVOHl5X\ntogZq5sCRJqV2WbwOibHOro1sOZDWFeyQczLc6VSlXBLbfMe9FQYjGQo5Ai7\n9wbDk0x+INiZuC5GNb6GF3NSGlZtiQlnSi4jILkbO44uTn9GFxsAq2KCFfQM\nIRXystKDlVcG0nAFmotiSfC/MVDV2+kZVvOal9lAiQNAnccwV4cA2Y12drX8\n6WTT8bWAvgznlgj4asPe6qD9oNSN4VIvdMV6uFRA6P1atApnI92LsMg84rYT\nR8SAtpQxz4W+vlUZimLjJn0VIETwZF3UUMbwS95A2b3w4/H/Lc1p3XvpzU49\nrU9vPXyQS8yzTvPe79mj/wnG287ail2lrgHwEgmoShVq11C76LIuXqeTN//5\n8IdL0SvNhATIbz7T+ZDT2hYxXG9dH5+OGc9DFC7uB91ew2hGavGSbOzadfHZ\nHtv6\r\n=z2kR\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"9987341fcee9f9c549490bf6cf1a6ce57b5a83e4","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.21.0","dependencies":{"tslib":"^1.9.3","@material/dom":"7.0.0-canary.f1432b5c6.0","@material/rtl":"7.0.0-canary.f1432b5c6.0","@material/base":"7.0.0-canary.f1432b5c6.0","@material/theme":"7.0.0-canary.f1432b5c6.0","@material/animation":"7.0.0-canary.f1432b5c6.0","@material/typography":"7.0.0-canary.f1432b5c6.0","@material/feature-targeting":"7.0.0-canary.f1432b5c6.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_7.0.0-canary.f1432b5c6.0_1592861128622_0.5260963160104453","host":"s3://npm-registry-packages"}},"7.0.0-canary.4757a16b4.0":{"name":"@material/slider","version":"7.0.0-canary.4757a16b4.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@7.0.0-canary.4757a16b4.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"c4963e9cce71c7abd15b2e86d9d00edbe2bddd0f","tarball":"https://registry.npmjs.org/@material/slider/-/slider-7.0.0-canary.4757a16b4.0.tgz","fileCount":36,"integrity":"sha512-ft98LfIXgCeVGLrOzUv8OYpH7SqOJC7kwpcfrjcB1KHWb3hOznc/dENNdvQDNJoCyRlI4SaNr8lQezsQN0f3cg==","signatures":[{"sig":"MEUCIQDtt8i58gXJkBFXwdaVikjeD9QWgN7TybxrL+8cQysvIAIgPjRxkrQ7P2IUhGXCUc1bgtmkn46cU0gMd1fk4Z1O3JA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":394734,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe8ShhCRA9TVsSAnZWagAApUQP/0NbSrLVZgTU6OJlX2Mg\n+NpkpeCzngafQ0o/ImBJ5XLkhticJSvHiN4V2cCLxHyUQALTABUh/svYj8W+\nqaTiUyK7isB6xYB6Ff74HJMcyubMCrhNEN1bUjHzaHa0soz6FO4tZ5nGQCyR\nZsHis9zUkIlLg/zfq5V4gm7zAbp17d/hB7B7IMgt2PDgpD3kQRitD+I7yTQ2\nldp9e8uNHUdv1uGKK1ZDKyMF+8e/AQzrpVO2piBIEdYHsyNMPa0Oi39bAtVd\nEC6JYpn0JPtFGXEBj/MT0mMnr/jDXqWonElTvSDzSpG8b0ozVc/RBuD8Qdr+\nQMdLIQBZq43C82HWaBn2FaaPuy3pCwoUw5A0Kx0rFkJq4Y5KRauXlh2aTiVQ\nqB56tP8yqYXJz08gIgfzW9esiuioSdeOhaXsSHHu5gZPRRdMnlaGJN89+UOT\nE68us0JsJfuWVTqqA7SwRisln+N1JXD9wFzuS2lPsQwheqcru9yAmRVp0+d/\nv2Mdg2w46rzaqweHBS/lQKn7SwQ6WNQakGEJgyud00jT/9VZzmgNqqOr9ozR\nGxvd1MqO8t5oSDbaqrlrRlMELQnNrtv6HHDn9gXoCwMwW4fTd7UfbDt+0a65\nOUyFriHlHV3EFUS8in9M3yeHCKqvc4JE5gvm83seLwUZvchLeA11r80qz7+t\nFgYh\r\n=HU8U\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"50b08262743d25109a9cd3d4c87d82d0631d9c79","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.21.0","dependencies":{"tslib":"^1.9.3","@material/dom":"7.0.0-canary.4757a16b4.0","@material/rtl":"7.0.0-canary.4757a16b4.0","@material/base":"7.0.0-canary.4757a16b4.0","@material/theme":"7.0.0-canary.4757a16b4.0","@material/animation":"7.0.0-canary.4757a16b4.0","@material/typography":"7.0.0-canary.4757a16b4.0","@material/feature-targeting":"7.0.0-canary.4757a16b4.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_7.0.0-canary.4757a16b4.0_1592862817216_0.6773649896842211","host":"s3://npm-registry-packages"}},"7.0.0-canary.f8f472762.0":{"name":"@material/slider","version":"7.0.0-canary.f8f472762.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@7.0.0-canary.f8f472762.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"b582041c5d65d4b24f43b4a8f3b284535f448a8d","tarball":"https://registry.npmjs.org/@material/slider/-/slider-7.0.0-canary.f8f472762.0.tgz","fileCount":36,"integrity":"sha512-5TH5hSziHUsEgPuFRfPwbwHiL25gcaOaNvJ6meUouiHhnqrPaXpyGgzxRSCQygvtPD12HniXyUdbGNTyv8TZvA==","signatures":[{"sig":"MEUCIQDMnaGCq50hawNzeq1N4590o8EO+gppP5DgB+8udTs1FQIgTgmZIcuP+LZpon5s9p/9xr9ognjs32m9Ou9rvxPlrXc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":394734,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe8SlWCRA9TVsSAnZWagAAmBAQAJM1HgGbyc9/xTdPnpz0\nojwnEFsIolLnUugATz1H0NYgvW09v88YyXLkyAho0qcVNfGYUK5k5CEDRpNA\nZmbDf0QUvDs3sNlgu27RAO9DCz7VUk3fzpNIwvpq+vCRXIogZdn95d5FeUCj\ng10EqQ44s0TTXmmN+JkcSc7kjQxoNnTaA67rRG6pjLJmZvjvxkihekSmdPKS\nLdI1ASvwxXYyZyUIH1/pt3d6dBge+dH6oynZ81jyMG/hXzW4WaymGYBjaBSx\nvKMzkBTd7TE2LIrsz27HFiKoST2OeytsoRk44mTSZUeqN3Pn1TBOuvn74PC8\nDs9jzKyz2EjayIVrXbPKXm22C7POw6KgGxYajdf50ecqfsLJ8jzob2u1WsYJ\n5mqj/5j7SecNiUyKQuvkdWLaM41IqzN18sVTPmV2BB3gWMqVfuOgrkUVrI3e\nPjs6GnaP1oehVdM4b7QQgrTQzTAr+jAPxX6AY6WL6TuMLxC7kJUH866m9tlq\nyvlOoZb1SqNS92KFMSZW6lvG6VEd1st7UvC2IOWu6yTMtN03VR3l7BKsrrJT\nQDlIz5NRDtMsfKVbyJa78KASMvGVHuY2KbwRkgVFa8yZApNdPecBclh5ob/X\nICPBZ3yVxw6vi5kRYrTdxNB+MLMJPxTBtZSWQSa22EMC+qtQKgjP1yQPKXJH\n3fPP\r\n=95Gz\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"b72e40a4e5c11a670f3423da9ae1ab370f088535","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.21.0","dependencies":{"tslib":"^1.9.3","@material/dom":"7.0.0-canary.f8f472762.0","@material/rtl":"7.0.0-canary.f8f472762.0","@material/base":"7.0.0-canary.f8f472762.0","@material/theme":"7.0.0-canary.f8f472762.0","@material/animation":"7.0.0-canary.f8f472762.0","@material/typography":"7.0.0-canary.f8f472762.0","@material/feature-targeting":"7.0.0-canary.f8f472762.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_7.0.0-canary.f8f472762.0_1592863062262_0.6478351901481274","host":"s3://npm-registry-packages"}},"7.0.0-canary.7e4d55c34.0":{"name":"@material/slider","version":"7.0.0-canary.7e4d55c34.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@7.0.0-canary.7e4d55c34.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"48a55c8b8cf5ac7991ad56c9df303fc50a34c78d","tarball":"https://registry.npmjs.org/@material/slider/-/slider-7.0.0-canary.7e4d55c34.0.tgz","fileCount":36,"integrity":"sha512-5YLQtgGaqyEVf+DliMrqCddIU+i/TczNO8nvlB2WI/eVhrd8k0Z9bPy7khgzeeqmU0/LFxYSyBNvPfsPWFJJEA==","signatures":[{"sig":"MEUCIHZOE6FR0RkG57SPjOmWOVtzxoZ75/hIgLGm8oK5wc55AiEAytEMfH8+j3sewCIYe60cYZ9KVc1E+oxF0OfgOmU3CGA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":394734,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe8TDOCRA9TVsSAnZWagAAp1sP+waxX/TwoOYFFRfJdnZU\nVpHr6HLToGjRANXUDeaOTfgiS/82B1cW5bs81ciQtE58Eyokjy+SzybTQkvT\nvHAo7QsoT9RxTmadA/EXnTIFd1u5vUcVloiF3DsGkFVYTSfzM3SDx6YoWaSP\nMRa4aixYCvb9VKUYFzqbLNaKXjdGWgOhD2I/XjnQbJxx7Bvdv4VP7vVx5Kex\n+0M9JC04kFc1ojkUEWgnQNYa1j0SpL3ZnXrbAv+h8FmGqok+QODuIuu1Fpad\nzM3F5WPDyNQEL90CLbkH1uftjxOSz3vDnE0JBqRR+fdsN6gGaozCyCOJWI0S\n78PTJsOKixX5ndPFiy+hCUgNkMOfFXKzHZfrLlLD91DJ72m06WSgXZzyghE8\niw2vbNuK6+xcxH/pc4H7MmLEktX8p2DZxOz0+Qc8DrYnxnj6LGjIzh5wLQnk\nrP62BE7pgfkju8wDfjI0YEg9xyP3YLDGMwWozzXWzy0oMmmEpFm8Czcn1w4E\n6vF0x7QE/6KTfMLCEjG5G94uXJxZHJ+8sjXnFl9DMb67+erPNwFepMPIsAuc\n3hjJIK7SPiDroiZeU7tSbaPfZpExq/MzPHDtBIW8KQgbcSOp7XwUJaw3AUWI\nUMnopn3RDMLWqoeMsKf4vULl5eKJeA0lHnl/9tUKXAPtSXxoSPci23GtgO5Q\nBbkj\r\n=Wu5N\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"1dcee78d27cafcaab3b8f265b4f1bea83600563a","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.21.0","dependencies":{"tslib":"^1.9.3","@material/dom":"7.0.0-canary.7e4d55c34.0","@material/rtl":"7.0.0-canary.7e4d55c34.0","@material/base":"7.0.0-canary.7e4d55c34.0","@material/theme":"7.0.0-canary.7e4d55c34.0","@material/animation":"7.0.0-canary.7e4d55c34.0","@material/typography":"7.0.0-canary.7e4d55c34.0","@material/feature-targeting":"7.0.0-canary.7e4d55c34.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_7.0.0-canary.7e4d55c34.0_1592864974027_0.8781076739421778","host":"s3://npm-registry-packages"}},"7.0.0-canary.bd1dbc91f.0":{"name":"@material/slider","version":"7.0.0-canary.bd1dbc91f.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@7.0.0-canary.bd1dbc91f.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"bb962812d7b684b73b3828a94be4aede31da1e2c","tarball":"https://registry.npmjs.org/@material/slider/-/slider-7.0.0-canary.bd1dbc91f.0.tgz","fileCount":36,"integrity":"sha512-c2T2LwO8WLA2asNvmwK7gBlc30eSO4oju+U7rjy5uiSJGbwoFDmaLjYZFx/9o4Jc2wtaCzVvhyRjKGQcspk2Vw==","signatures":[{"sig":"MEQCICgZfG+eImU5IRhpUpGqy3/py5KxSU/G//DqADsRK/+3AiBzaWE3+BfzPfOyXn1VSpsU+dkeq8GNMDI4DqaIT3BBtw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":394749,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe8hGKCRA9TVsSAnZWagAAK7wP/iikFNvVp6ORB5CDMYO9\nGIpPlX9QN2Pq8vhA/pW6fkQpggJc3VvmhLwqnWuSZwtq75hZsfMWl/3wFDkl\nUz9e1ntFfAmDBZMDPET87qUC4E8tULj0V3rOnYGbybToJGZgKdUpX3E3IHPR\n+dYcRrIWI4xSd0o3+yezNHiom1LdOmgVZM47xcXowKag9SX7ddqcY10XKBnp\nqy9vnGk2txWZX8pTFovw2i+556Uj3fwQDsjuHAzcB8+ci2+1UOHL2uEndvPC\nGRl+U5e0bmnqG++SeZoZrUmEuiv4MeFOkxN56dftf2ahRKLfThfKfCpm4N9E\n0PBwu3y3V6AZ5Bw1UMSAclG4KxWE3+cDiMVhpiFQOtnwqd8eo0egU6p7/ktj\nqlz+Krro8NX3bofJZF+8t/lSjU6ZHhANozA+0FLji1TXVQcejIOLCPjDk/WS\nhK6b+7aXjx60da8I80UhI04ye3wyr3w5L4+6c/aa4YSiBe2l32t+ot1PgX9h\nuhsc1RqcTQR0xDXJx/DnVLDghdJCfBthKrJkoorMBs5U+eefv5cSJ5WvK1DE\nL4e9SIZQ9AYaQxWembLatZ7IrFJO5LYseZ0osr2ToxEdAMUCcTmwJXS4vTJB\ngi7Hq9z6P5vCualU9FXENs71M6WjutjpuKth3sNAHXvFPSvh87wkPNChpQrA\nz6Ff\r\n=6h7j\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"b63b8059c82f418a3f6134124de3ad8bbb08976a","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.21.0","dependencies":{"tslib":"^1.9.3","@material/dom":"7.0.0-canary.bd1dbc91f.0","@material/rtl":"7.0.0-canary.bd1dbc91f.0","@material/base":"7.0.0-canary.bd1dbc91f.0","@material/theme":"7.0.0-canary.bd1dbc91f.0","@material/animation":"7.0.0-canary.bd1dbc91f.0","@material/typography":"7.0.0-canary.bd1dbc91f.0","@material/feature-targeting":"7.0.0-canary.bd1dbc91f.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_7.0.0-canary.bd1dbc91f.0_1592922506023_0.7467856022834642","host":"s3://npm-registry-packages"}},"7.0.0-canary.31523bc62.0":{"name":"@material/slider","version":"7.0.0-canary.31523bc62.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@7.0.0-canary.31523bc62.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"30d515958ac7f31e84f5f238fb5be8a1a8c4e26e","tarball":"https://registry.npmjs.org/@material/slider/-/slider-7.0.0-canary.31523bc62.0.tgz","fileCount":36,"integrity":"sha512-EWn3ycp8PmooasvB9l8I55csVqKUNZhy/DIiZ8Jwo2jANERujOd/MkGwtsltkysdDjWh3AqZnPNru8ZwBQ4i0g==","signatures":[{"sig":"MEUCIEs7qqdX+0d3EK25ViF9hBbos+M/OmMdmQxFymAVk+4wAiEA432111hd1tkFBndTjOAs8B03GgjRzPLq7G/lZm3mprw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":394749,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe8hLXCRA9TVsSAnZWagAALVkP/3SVZL5Mocny0FoGUYZM\nosvfUJIWdahRhHL0VWyoTJ6Il4ld5qLJhfS3/7YZNnALI8TkCcGPuL2S9Njy\naVq963ASjJrJojATees9xJUrfiYn/sum7jibL9SJX6rBsL+kYZL0N78x6N5j\nZ0UFe/Iy5vg3PPZmec/LT/X2iJdVHihbXoDgAAkwfgSugggsVylbSWUJqkbx\nHJFIF7++H108/7WgnLjbglHj8GlXTwyQo9qhHoooGf2qLWIEw9v1+GR8/h3m\nPRNyb2csig+Jj3MS4yz5uUOSDgSKHIfooNtAwt5lFjsd9IZDKBP/TPxVHZaI\nfUTbRdqoyouStYTS9/htORprxIk5RwR81Ep4/aT9Ocmf8msNqBoLuK5S0ZZf\nLOb3Lnifi7RVRRng8cp1SkW0PcgQ8mYRH9GaOj1Bk5WMWAdW4DzzPEnou7ii\ny1aunGEvzKF8G/cmjuNsHh5jSmdBm2io8T0zUnZfW5xsXrH82zeNzV8GBNep\nHHaF4qgNdEkFDJhwlqaGpkIDjAD6bKDqNn+8LSFH0/3pAFmxIAvWjt5TIxO4\n3t2H1ELZx6vVdas2bowYThWM+07dOV9jJ21bKQ6Y+At/+p09rN4iEYuvTc3R\ndRtrzNQlbantoGnJ8mi/AQKlvpEeFvYquuC+WKa1ASn69qomRSpczZwEvDli\nJASM\r\n=lttz\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"035ab4d41a8c444abf721e44192fa6e10bed9f79","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.21.0","dependencies":{"tslib":"^1.9.3","@material/dom":"7.0.0-canary.31523bc62.0","@material/rtl":"7.0.0-canary.31523bc62.0","@material/base":"7.0.0-canary.31523bc62.0","@material/theme":"7.0.0-canary.31523bc62.0","@material/animation":"7.0.0-canary.31523bc62.0","@material/typography":"7.0.0-canary.31523bc62.0","@material/feature-targeting":"7.0.0-canary.31523bc62.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_7.0.0-canary.31523bc62.0_1592922839250_0.052420409324369865","host":"s3://npm-registry-packages"}},"7.0.0-canary.a96b6d4d6.0":{"name":"@material/slider","version":"7.0.0-canary.a96b6d4d6.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@7.0.0-canary.a96b6d4d6.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"bbf7ec5027172d904d3ca509a140925d835b88ae","tarball":"https://registry.npmjs.org/@material/slider/-/slider-7.0.0-canary.a96b6d4d6.0.tgz","fileCount":36,"integrity":"sha512-e/CX4R9rOzKPhVfaIeTKKgD9+OIm9Ype8Z1b6nA3+t5KHs6B9G3ccM5IW7lPxopbpnuoejJJCwg1/icly1BnRg==","signatures":[{"sig":"MEUCIDD5V45dkF/e/LwR2+M1Qj2sm+EV46T28ATW+hm7Mq2fAiEA9xnK+CIsWlTUyKnIPejvKLUmQEaZzeaj/DBc4GdNwy8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":394797,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe8hRTCRA9TVsSAnZWagAAwFUP/AsrsAvmeM6Gn0x0XAnA\nad2iOTKme6nQ5h2WlQWzL+mL3o70wEU8PRZ8gI6KE8vke+MOWQHncjtzVI8r\n+bQ68nFFbLA6V/oJoNDcINcrAmIrc4DqNOTbuZiawsXlKQ++2rHU9OYbEAae\nukjLl50N1TCv/KC9/2Xbshn0pb1x4Ag0opadij1fcrbhU5j+xc7keIsZZ4LG\nwdob7EnfUhxhat22zS4EKr2CDPq8dm1JjtwtNpV0F3L11Vk85QJera3xHy6u\nSxKraGvnpytLHK+9kIQqmE+5S71XGgsSDoIbUEuCYA53Df3Cm6C7VCJ6Ak+k\nUB6kyWLldU9fkrGQ/g7AFKXx6tVxxCX0lEnz6fS6R1GeCy8CK93d3fiskUgj\nM5L7ZZFvBq/9Zto+v2MBFP4+9Dhcl+qclpFlYczoiXDg5KfPrViEbhMwBXQy\nYH6qwID65e5ehBeR8mI3/Z9FH4QMuCFNVCrgl7Y2xS3q/Qq+D/Qf3PMzn57K\nXyBFUJ2TyEB59FBO8kmXpGEUOK85tyMKwlWpTmuA0TkLzEbGhuvK1rnhDR3b\nPNsN5wC1Z3p9AnV354CUsdRDh6sx3cnCJc+oH/L4WlB+1Lea3jhPNZywJk1u\nX/hFM1kVFl/ebw1/WUhLU6Dfd/WN3nxRlEF0qQEDn9z21KZsQ0hLAgX6BvjI\nQ1bv\r\n=4IRt\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"ddfc88933cd9a6210bdfc449fd3fbed391abf4c1","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.21.0","dependencies":{"tslib":"^1.9.3","@material/dom":"7.0.0-canary.a96b6d4d6.0","@material/rtl":"7.0.0-canary.a96b6d4d6.0","@material/base":"7.0.0-canary.a96b6d4d6.0","@material/theme":"7.0.0-canary.a96b6d4d6.0","@material/animation":"7.0.0-canary.a96b6d4d6.0","@material/typography":"7.0.0-canary.a96b6d4d6.0","@material/feature-targeting":"7.0.0-canary.a96b6d4d6.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_7.0.0-canary.a96b6d4d6.0_1592923218473_0.3714976645543566","host":"s3://npm-registry-packages"}},"7.0.0-canary.ef3a09533.0":{"name":"@material/slider","version":"7.0.0-canary.ef3a09533.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@7.0.0-canary.ef3a09533.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"7c36186f34dea111090969846a0b0534f137c93a","tarball":"https://registry.npmjs.org/@material/slider/-/slider-7.0.0-canary.ef3a09533.0.tgz","fileCount":36,"integrity":"sha512-bXBlR8hQNaxW5TRqapoCZmKK3YVzXWK+BumV1jApclhu09dBEml7xplrjJHWyqjVA5HWPLRYySHDTyV9hEJ4pQ==","signatures":[{"sig":"MEYCIQDUXaVZVG3N1y4EkM7LPtGuAnOQ35cp3MzQFmUQoTWCDgIhAM09mgTpvJXTD/LOXoayoMmC+VRtUz+2z7Xndev6AjXn","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":394797,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe8hY9CRA9TVsSAnZWagAA3lYP/2GfT7BpM18L8NxZC+gZ\nP0CgB71fnYrFZr45q5JA2kmuubzGEemCNOhOFOeP09J0z/SZFRzar4LelPrw\nTq5eKgEmiPMpqn9ZKtPlsO4X2cs+rx4ByLakpn0ZjGDW1Oy4/pJjeqSHjqOM\nOD1SMIwKmjtpxfTdisKoQlvDQ3U6GY46p2dmGqErKCVguhuLyVsnrpBEr/Bf\n5PilYbG22zEj0wZMftSlIXx70KuRjAzv9phgOmbRy5M4DWr+zvg5Z9W+E/v5\nGOOk8ztfMZjrd0F9OdA66z6rD/IBHxdsDRYyU5r00fBE8p/gkhJIy7xlSkiD\nIaka/jcsF8MbhJSRU3FCMQ4Aib0nLKedPSNTLKU3VIj6xrm37XPFwqWkzcyB\n0lxoluog3ey8HrwL9pkyxWat1AdRDJv38K3jIKZT+9C7idtx8PFz2ze0O4jU\nRQ+PjMa2QxjK/vf9YY7RZ/KsdQ37ptf0au9fFVzxsAA0Te17xdu9VimVTzGm\n9Gph3/H/Hyd74QbLq9Ks4BnAEdczLQ9bFT55EfuK3z08t3Hkx8jhMym8H2eC\ntIwCxYJZwSIQMLlRajSA/+iqUyFqtpABUP9KX8mCqxuyHkSrz1+TO+27K/Nh\nszA7b3eIZsGrJ+PgaIpkk3ZtotgJO3PNSJB31kobXyzjyI+fFUiNPXZznUDs\nUCjM\r\n=PNu8\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"2af091492939e0fee42736977683591ffc221f15","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.21.0","dependencies":{"tslib":"^1.9.3","@material/dom":"7.0.0-canary.ef3a09533.0","@material/rtl":"7.0.0-canary.ef3a09533.0","@material/base":"7.0.0-canary.ef3a09533.0","@material/theme":"7.0.0-canary.ef3a09533.0","@material/animation":"7.0.0-canary.ef3a09533.0","@material/typography":"7.0.0-canary.ef3a09533.0","@material/feature-targeting":"7.0.0-canary.ef3a09533.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_7.0.0-canary.ef3a09533.0_1592923708752_0.4238025077503147","host":"s3://npm-registry-packages"}},"7.0.0-canary.080965f39.0":{"name":"@material/slider","version":"7.0.0-canary.080965f39.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@7.0.0-canary.080965f39.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"702691ca7d323bbc154312025021c42244d36631","tarball":"https://registry.npmjs.org/@material/slider/-/slider-7.0.0-canary.080965f39.0.tgz","fileCount":36,"integrity":"sha512-cSCtr8Vv4nFDL/qew4ug4tt6mtlEgeJ0Nuh+aCJiU9OYw9Tt80OArrs8pmEO+T8Vb5hbB8z9cn7VYJ7+uh8ldw==","signatures":[{"sig":"MEYCIQDL4KAZSynLaUwhiyhEGQuiTYudiUYwsACRRD9mRD1BvAIhAIqmLzTHvDwJ/f6WvoHKbf9KakGefxI8Te11zpjeBWnW","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":394797,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe8h0gCRA9TVsSAnZWagAA4OsP/jYuwtrl07mzyZS3CXkI\nd6nFqOq8++NtDYYSyVXse58WEclueLJqX8yM8ffEpwIkLefSegCFszBsXHOg\nKeL5KcfwuTAhdUV7Ef+M/TDnkKdaR47se0Nd39LMVGxr9KzMkF1azqGiYPf5\nsR76W16kxwbxZ1AEd5o3NflID3KhyKbhEPgzRx6gbrOuPgWWVW0pw+dlHP9p\np/dcgHl1XGSUWfovk6VS5b0mE80NfUF4hYE0r2TT1f10EwQQnBrYCYpjN8YM\nLcWuwa6dfE/s6XF5Cq5UsEgCtj2UjNMElMhHPJWLnIEA8YCjsl8d+YZ0Snys\nygx4bE2D150B8HNxEqhBXxZ90Ohhrfyb9XJMDqrn6I5L7ujoIPG1dz/SY7Wo\nocsKggLUwDeGneQCtsNJG9Mg1wTN7aBzD/+PrG9nXi8yNUKvfPjE0QPaHpk8\n5pnyACCQucau8CPMwFXBKn0YxEcVb7WWutp47lkTGLBKa6bwil2dr2YdYCFZ\nccX3c6mGOPbRpjd0+3BFiJHi0E/f0IyHb4FE9h/e8a6vgBJENlo0wVBBbSEl\na4XWc2K/kIqb4kuoTJIkEixbttSEBUpPbPlPM0FtWtf4jCGTaqRTvLls2a70\n0DR2u28dymmUIQvGz+V3pnKDl0dvhQTDBxLu1Qh8ShPuZ5sKQ36ZECvH91kR\nNTGx\r\n=y6zz\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"c0d7c5371df46e0114aef4ac9bc2b3aad1377f76","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.21.0","dependencies":{"tslib":"^1.9.3","@material/dom":"7.0.0-canary.080965f39.0","@material/rtl":"7.0.0-canary.080965f39.0","@material/base":"7.0.0-canary.080965f39.0","@material/theme":"7.0.0-canary.080965f39.0","@material/animation":"7.0.0-canary.080965f39.0","@material/typography":"7.0.0-canary.080965f39.0","@material/feature-targeting":"7.0.0-canary.080965f39.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_7.0.0-canary.080965f39.0_1592925472112_0.6771901106591292","host":"s3://npm-registry-packages"}},"7.0.0-canary.1bd67b65d.0":{"name":"@material/slider","version":"7.0.0-canary.1bd67b65d.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@7.0.0-canary.1bd67b65d.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"95a24ad78fb244aea1d041e71a893cfd0f06957d","tarball":"https://registry.npmjs.org/@material/slider/-/slider-7.0.0-canary.1bd67b65d.0.tgz","fileCount":36,"integrity":"sha512-eUEYWG1Z10dwvvFVOlNCwhSqoN2sw34HrwVJkllkIp1BKf927a4q3K+lh6AlEOhnQpIC764el9hcOPDmS9RavA==","signatures":[{"sig":"MEUCIQCBZtHT0t6wQOCrQUnaByFjKbdqw4f7T6E8+1uN8lwWcAIgbt3MYndoR8hSF0cxxeCWo/MdqYWq/ZndK8zfz9ACBAg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":394797,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe8icQCRA9TVsSAnZWagAAjGgP/jkiF0Wr9A8TPTljpYY4\nJhFpmisOC+C3Lb+xitPDVaEU0vyTX5gvpjAWKrpbzj9ncB4wgnxNAhGFT1U4\n4YWFfiTMwj9fKvSEaq8ThGja3gsXkrvdkLz+GbKTKGprmLSvEuf2AnLvDdNX\nhmcWG9Colb88ty3Fa6G0El6cK/tnoic8chaKV8+s98/1UK3gfArb4HKbjX+q\nVc1l2ZE/ykHBITTivHW4qiJYtZjxJ0cNol/A84tbWj1K4IXZc9EVPsGs4IeI\n107OPJ8dHI0fcPSynpYi6CMuE8zekU+NDYqarb9CO4dQ9bGa7+eLey4g+ejR\nr/07XydJf57DIGkEMNGR657qhYSTYe6KMLGq9jyLj0aSlUYjpVUd25aQhAZ1\nIfKkyPs7ua/gD+Zj0bSpJiQmq75Z/UqC6LaRbHw952887BcRXuW/tZdUfY7r\nxtu8NMhBgi73UIMPaZYEnl/EYIwA5U+1SG74iiVqNW3s8L1Fd6iZNpekGN1e\nqMk1S6BsN/y8vQdgjW5yCTDIreN7HVLYWsRyp9HoJLj8Bjn4YL7djRbWu5nH\noC/hdWJVrOBq/Csq2x9QG1z510A2C6VDCunYvobz9NMRmOc8ehd0MfXF0nrZ\ndwbIQWuKnzQ6f6Ma8IhFY9tCaie+ccgbsRShYg+wJPUAGsMaDz64fYlMaCFP\n7fs5\r\n=yT/H\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"dcb3206c3f6c1567eec203025b36bff594d66678","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.21.0","dependencies":{"tslib":"^1.9.3","@material/dom":"7.0.0-canary.1bd67b65d.0","@material/rtl":"7.0.0-canary.1bd67b65d.0","@material/base":"7.0.0-canary.1bd67b65d.0","@material/theme":"7.0.0-canary.1bd67b65d.0","@material/animation":"7.0.0-canary.1bd67b65d.0","@material/typography":"7.0.0-canary.1bd67b65d.0","@material/feature-targeting":"7.0.0-canary.1bd67b65d.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_7.0.0-canary.1bd67b65d.0_1592928016189_0.3751983260562126","host":"s3://npm-registry-packages"}},"7.0.0-canary.18ca31248.0":{"name":"@material/slider","version":"7.0.0-canary.18ca31248.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@7.0.0-canary.18ca31248.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"b1f8169822203b5aa6b3744cb8391e4cc005998d","tarball":"https://registry.npmjs.org/@material/slider/-/slider-7.0.0-canary.18ca31248.0.tgz","fileCount":36,"integrity":"sha512-WuD0T0fp4U9/GOmElLIorciUFPbOVrAc30umqLeffMv5G0QTFjMFJRMHH3CMqENYFtNI7rCzQw7ZxkKVDsuorg==","signatures":[{"sig":"MEUCIQCzfy/XYCH/S+VnbypoBAYUZJfah/7lymCZ9lgrlyaLPAIgPqWE35HaeXTCH2p+7R+SK62dKNTv7fAqpNzw6+rQxik=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":395149,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe8kkMCRA9TVsSAnZWagAAkVcP/jSbqPm3XaIzcGYtIjgG\nOSEfJYWW41cadz9CR5Sb29TIN5fBRnIRqpSltxDbmGhTAXuiN1689702ipER\nXLUVu9c1c2TQsA2S4nAPV64pZbCI3W4EgnPvVwax/Tg5PV71fWBLu2ttqLZF\nOV+Qc/KsA+IJyr/TRkjqFTVKuHl94uOVkdGiWjOLWh5H04jrky05TNzrcdJY\nzsXG6oygJ6X5peQ7uglBVxv4Gb6PTlBLG+O4ZGw36Cl74YsKVJCgWC7ZpdnH\nrgCWpWbnEKm+SYsSOsQ//ND8bXc1q+JKg9zdUgikLeayYByKgllgH1mjqRoR\nMdxHcQ7DEEBGNn+yqEoMSrZ2uf7Je8oE1HZSa6yzO/QX/v+2I6qHK2NnyhZ6\ncsX9BSnlsIQT0WcEh+eJEUvSq4HEWbXSAhGyBcSx/MZFiG0sGOe8iU6fnVBv\nj9FAluBvE82AAcFPtZYSyyiwuzuvN7RNSPBjuXu842vGEOSmm7W7BDtQZ2+J\nQBy8zsQJMe59M2WiEziMiN+MfwSNh2634RdFr1ArcvUrlq3BA/lb+r88CYRr\nb601qCDoyzZPzBC2B/gOOIlh+jxqVdDxQ1HnZ8929xlIBxYrfnSzb/eSIPpF\n3usYrSc/T6+M79RuzuRHnavg77/kt363IX+OtUyqI+VJKKxZnMw8YQTLPTU9\naUtT\r\n=7jqp\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"34a77f9ac5b41ab1f71969d01fde32c58ffc08ae","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.21.0","dependencies":{"tslib":"^1.9.3","@material/dom":"7.0.0-canary.18ca31248.0","@material/rtl":"7.0.0-canary.18ca31248.0","@material/base":"7.0.0-canary.18ca31248.0","@material/theme":"7.0.0-canary.18ca31248.0","@material/animation":"7.0.0-canary.18ca31248.0","@material/typography":"7.0.0-canary.18ca31248.0","@material/feature-targeting":"7.0.0-canary.18ca31248.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_7.0.0-canary.18ca31248.0_1592936715652_0.2991224588188537","host":"s3://npm-registry-packages"}},"7.0.0-canary.39cf00836.0":{"name":"@material/slider","version":"7.0.0-canary.39cf00836.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@7.0.0-canary.39cf00836.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"cc0bcdc5eae539adedc635c4c529b71df33576d2","tarball":"https://registry.npmjs.org/@material/slider/-/slider-7.0.0-canary.39cf00836.0.tgz","fileCount":36,"integrity":"sha512-jZ/TgoK/iz8FGXHKMRXW2zSsBAozwO6LjGBGDazKSt5SvZCBBotdRgZY7I6+vxuPKKr4hZ5Yl+JXGRsW/Uvgww==","signatures":[{"sig":"MEYCIQDAEyZVhvG1VZxT1HVDzjoLrqcsahH03+PCkfmbsQkvkAIhAJW7OhepyZSU42+rJf7Uj1cAGLXYxMZ7Kp7Cl60bsmCV","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":395149,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe8k5rCRA9TVsSAnZWagAAw9EP/1pyZwwB3mnM7W9rM4ur\ndehzQtdV0JNjXIVlkaI8jj4ImSLWlx41I1JfkUYLYqCZwfB/OuDwY/NfHFme\nD4OoTYb4ZSCsazdc8khk4Ub+kGncBY/SIPjSv2MhvzF/GkN8ir7WdkvvM4g2\n0ZUNJlO6KpQA7cD5aKpCRZ78iq0gLtHL1nOtsNMEzsScSVu3og6MLCcaM+Xy\netHnYa+h2o0YVLjgSXkjyncFi+gKZWP9kpQJhZpUpeJ3a4FeRQkJyCLHw4r8\n7nBxu4EBOeOCmcldYEBFtjLO0Whacnf945EBk213WBBBxOcAlK4v9PS4Yrop\nUfhd9gRR5A2kseMg+l38pxaJPu+X9bWtYbm6oESlHRhSlK6nPbn/FjFJIPrB\n7S+kpEwIKZeJKAhEGVkEQWDxWZnOZd6iLTPmanKwqxcW2kEB/rUh6Ewqoo07\nEaoaYZEqN9SFGPktA91gzLzAIMrYDIpecyrGJsUcZY3oH6KBVqVHVT3EwW4i\nl4TDNYUSdZjj0k09WZKQpfcYbiumRFBtaRsEvQ1TIKOM1vivmI6XXaxdclfV\nFaVVMCSPCqsRnrim2AUSSCHtdl///NxHa11N0b7d1d2mDQNXCoNChkO5S1yf\n2F2qW3i+hdX2V0Rhv2GAL6klNfk2ZlAeRUT1LH9RdV9RJb6l03p3wlenm/pk\nBwl2\r\n=c5M7\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"490def2a6575f8ae6a6151f024a9af3fed1f5215","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.21.0","dependencies":{"tslib":"^1.9.3","@material/dom":"7.0.0-canary.39cf00836.0","@material/rtl":"7.0.0-canary.39cf00836.0","@material/base":"7.0.0-canary.39cf00836.0","@material/theme":"7.0.0-canary.39cf00836.0","@material/animation":"7.0.0-canary.39cf00836.0","@material/typography":"7.0.0-canary.39cf00836.0","@material/feature-targeting":"7.0.0-canary.39cf00836.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_7.0.0-canary.39cf00836.0_1592938090422_0.41979095352624696","host":"s3://npm-registry-packages"}},"7.0.0-canary.1bfda9e05.0":{"name":"@material/slider","version":"7.0.0-canary.1bfda9e05.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@7.0.0-canary.1bfda9e05.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"3742b7b9ea7000d34e11eec7f3b9da33883d6e9a","tarball":"https://registry.npmjs.org/@material/slider/-/slider-7.0.0-canary.1bfda9e05.0.tgz","fileCount":36,"integrity":"sha512-Q4gl9YtT0L2nPvUwccmgkzqFDWwV9fKGE9hJiYo+Ww0LPCnmztbMff6SX1OYO/85ec/hJySzh4IkpE/F++u/dQ==","signatures":[{"sig":"MEYCIQDwxC1xXAlxf9o1Yto9q3IQUKg6w7qaHnsTzoYYIT0hiAIhAJ/KTtgmz1pkLGXEc6D4UyeE9aY01wSK/FwusQvb2Jkh","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":395149,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe8lFWCRA9TVsSAnZWagAAi2kP+gPYx/yaGI61YLc0+xL3\nTHO6RcvhxFNmUjE2cErKAbDLA3mmM6JaPoIUlySxww7lPXW1fTIey0Vra2gM\nj9p2cvLzH9XlvoJKG+QPdWIkbYqXAcbTE1YN3clBK+6f6vOExVIdBVQoomdr\nyc5k6XHlMgkqk1rzgfK96/K/7+bwZP0VH32zgKaLI9TZqN2CVtH7dAMdld4t\nY53myFf+5qaeY3zxYUuEEMunVh1+DHV6mF9DUUjtiUHoBFxbKvLEdHnxbzfy\n6hQp23GMPGGeGj2k3ajQ8kwMar8rwUt9sec+n0HS5jEWjqE4laMIkYkCurFr\nrhxXisoq2je2WPzppctD0084lvd5E6GLQVzDmhaVczgLBJkq/WxWF3htWOGh\nxDARPosKVBEggXdgz3iUfaGRpqZxikdsQrjbGeP3Va0I8HeKGSMX8WoXiSR2\n0D4Abuw7sJ/N6Izc8N0B8g6lmP8lcbWJtHIu6i/3n2DPwzY07B79WTsJBJb+\nzqocXz/fRv0VUWs/lg+tY34kUJfddPcT3mcuebnf4Z9VfBy81SOcgPB9gIi5\nV/qO0UOWGlULjwFlIWlAB9Nnck2ECOeCxb5cKHRP5qWLz0xr6cjbxp87snsN\nzQOxtrRGj61O4ucuWcyWyGnhtqywTTubXkxzRt2vZbnnyo0hZp6E4f/iy5g0\n/yxy\r\n=76Mh\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"d858287d263a004329d22036ef43b63b8ec8eb08","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.21.0","dependencies":{"tslib":"^1.9.3","@material/dom":"7.0.0-canary.1bfda9e05.0","@material/rtl":"7.0.0-canary.1bfda9e05.0","@material/base":"7.0.0-canary.1bfda9e05.0","@material/theme":"7.0.0-canary.1bfda9e05.0","@material/animation":"7.0.0-canary.1bfda9e05.0","@material/typography":"7.0.0-canary.1bfda9e05.0","@material/feature-targeting":"7.0.0-canary.1bfda9e05.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_7.0.0-canary.1bfda9e05.0_1592938838374_0.7707833764535783","host":"s3://npm-registry-packages"}},"7.0.0-canary.08731bd95.0":{"name":"@material/slider","version":"7.0.0-canary.08731bd95.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@7.0.0-canary.08731bd95.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"5b5afee6a71a0ce03ba52005a1edfab8bec91fcf","tarball":"https://registry.npmjs.org/@material/slider/-/slider-7.0.0-canary.08731bd95.0.tgz","fileCount":36,"integrity":"sha512-KqY5q8acl4uk761X//FkL5etmAp6x417fTXS2HZP9Ts9wJHMJMNqcF2oEDHDQ+qS36ZDyMtSKg1fH8M4DrVxVQ==","signatures":[{"sig":"MEYCIQD1RFJxqEMG4SDxTwuFkA6hVtiLAhkI6uMfQbhWA75n5QIhAJ0hacQmIZOenW2HhIw8222I+bQI8K/3GPIAPrmi8Bqp","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":395149,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe8lHzCRA9TVsSAnZWagAACyIP/3ALb2n1CLFAHDZVW27M\nKURnZMaCQ1jK8CxQpzC24n6leUugzuhxXemJQEmAQRilpk0WH1FbsuXh3WBh\n20yrM2THMhPn++1FZ/QN9RQ8udUtlplRfvi1AMOmuTamow6Pct5Zjkf5MEJ8\nuz3aNhyeIU+RMDF949gIGcxiSRpTMXbsoRwjado/QAFI/wuYdMgiga12ZhKA\nRmK0yPbZMfPM8JMzhkL0VxuT9e5UyZZ7/WPeQU4XtkU5SSOYPnbQBZQF4Krr\n03w2OqkISb3pTsilsSpH3ZRzeX9/fd6oPvlEQEdjVxb+DenWHp25XSxuZaO+\n04xvxH1gv7ZkMBrnPCGTUFa+0uoK+PkspmwiaVKKmDRC/Dl/3mywKcvody8L\nCRUaKHK5U+aNMamWt5l/38V4rAY08S8u4wjQr2WPTg4gtxGA+KWHE6an3F3U\nyDG0wsErEGLX5KlMVXXoMKB3x3k8ZxXDKgUixXnD7zRRrAkIuwDSrfZz9MCf\nRTq1JhhbDQezDeNWr15/p0tgCPr8h78Hk5QjlK9ddC08nPNqQ4g+e2MPnlhL\ndaqv+6qatT2H+yzFGn83w4u8IC7g6gKIudlU21a9jGsx3rYpJhEQKblRZJDl\nVkLTiYSYEI7QcpzzjjdsNS4efr4G2UIZXD6wOHMANunnHrUqXew7OaxgTOgD\nSaIL\r\n=6E2w\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"8e24a4ad4b32b05eb883e0de21ddbefd3c8f641a","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.21.0","dependencies":{"tslib":"^1.9.3","@material/dom":"7.0.0-canary.08731bd95.0","@material/rtl":"7.0.0-canary.08731bd95.0","@material/base":"7.0.0-canary.08731bd95.0","@material/theme":"7.0.0-canary.08731bd95.0","@material/animation":"7.0.0-canary.08731bd95.0","@material/typography":"7.0.0-canary.08731bd95.0","@material/feature-targeting":"7.0.0-canary.08731bd95.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_7.0.0-canary.08731bd95.0_1592938994976_0.6306383655065848","host":"s3://npm-registry-packages"}},"7.0.0":{"name":"@material/slider","version":"7.0.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@7.0.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"02bb99929728ff39ae4d1abf991754499bfc9513","tarball":"https://registry.npmjs.org/@material/slider/-/slider-7.0.0.tgz","fileCount":35,"integrity":"sha512-/1X6F7voWxCrprJLnul0CwYKhbJUsqWA1bSmJGcmWYHDMG6pjCX/V1PITBB3A9Cifnig4WC3feLQdwhTCYXXfQ==","signatures":[{"sig":"MEUCIAjpZ/2jy4hnQTPHkcuynPGCCPWZ2/3gNWu39+vRKfOiAiEA7bTJW/88dPj6OPLofaMVTyRl+3Gvxzun1p0eU/CUoaU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":393427,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe8lPFCRA9TVsSAnZWagAAWIcQAJrktwUNk493Z9h7y4az\n0Dwd8Y0w2D4RiVQIr7R+fPRqK9KANZ3OMPmLwaydcSHiUBFRdASJVVYqJSMl\n7Ru5vSmi3/F6sractRp+sEI3Y6fQxNiyHnEXx1Bn9vmEWpWKtMe+uFgMP3qe\nJMSmYC7PJElHOGsWEDuWY+1Ag6LBmqah7XynoK8fMdpg9/kyuGZjBQPq8Rhd\nO7VXSLY4+psC+fe02TLAWJdUsF6BIEegwngMl7dD7eE8lLMQ2H4b7u2faN15\nFvjnPt6e5HZpkFQgSE8C2YnjcIRJPdnS5lJuVPppNULHdeXe4I1TEM68ljLl\nVl7dwVjagpl2MNfiFNi30E6+WjbjlPRgIRWXm7hBShimFiIzEhiSDthv57/p\noJUpbSBPWtZDg81gMF5wKtI1VM/KAADy4ZV1psXBVAJ6XOsAPLP8KlOE/eux\nf/XcwKffaZ0VGPZlaJLbb87KPs2DWvrPbM0LwcYvJMUUzMTXCY/BxTE1MNMb\n/1SfEIprUQMN1c8NBfbZJHhQz7eEgbDDaWwVshKRjjNSqXKhVi6TRUZM4KQm\n4ANQ+XzuKOb3vLFetaiAOKU+jxdbZzdGCa3lPHRsyh0GQMhPEd/UGADsKxFY\n5BRnmDRvEnml55siUi54ZsVl6qbd1Gi2kdN/lWUXOnyDcs0zlGvV21vpGclG\nS9Sc\r\n=csu3\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","gitHead":"a3212b2099765947f2a41d71af2cd95fcbca4b97","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.21.0","dependencies":{"tslib":"^1.9.3","@material/dom":"^7.0.0","@material/rtl":"^7.0.0","@material/base":"^7.0.0","@material/theme":"^7.0.0","@material/animation":"^7.0.0","@material/typography":"^7.0.0","@material/feature-targeting":"^7.0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/slider_7.0.0_1592939461392_0.7077894199057131","host":"s3://npm-registry-packages"}},"8.0.0-canary.a3212b209.0":{"name":"@material/slider","version":"8.0.0-canary.a3212b209.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@8.0.0-canary.a3212b209.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"a5af0d9aba404c1d88d218c3ebb19c890933e7d0","tarball":"https://registry.npmjs.org/@material/slider/-/slider-8.0.0-canary.a3212b209.0.tgz","fileCount":36,"integrity":"sha512-LLR145Yba2dVatUhyWJabK11izeg1+DtgXDJpmMy4MHSeB+qN2885T4tC6GBOrfduMJvuRL3GuX5nrscwEtvvw==","signatures":[{"sig":"MEUCIQCHc8izjuoVgHfBWtvvQDC6Tm6xWM8pb1RrWn29D/LRNQIgWJvvVSpVYDKaTMZ4oxma53wmh3udE2/eLHzMoyO+lfc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":395149,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe8lP7CRA9TVsSAnZWagAApP0P/3Of15aKUlykfbKtaTMN\n+WDXPGKU3i4p4T3MUF0fM2xMSocrrxl3XEw7R6Qj3hvkTnB4iBX0wtenO61r\npWdpEgc8JDVGhlbbcE7RKzas+rSo9nPR+NEHiXBpFHVyBsev5q5jG/Y1K4Ss\nXXJMsgD+Uc6g93jVAST20sSzXhIgRxgHCZXbdkVtjZb8FCOVkCCZEjZ3jMjm\nWniRemmXv/JLi0P530VnF1Mos0KLMWY8AuNaN4zt1wPetxK55QRmD2LVbZo3\nt0xJDxJJO0xut5azTTaom4uz2lqsZQCbKTmsPbYe5F00TedDG2OzTbs7ccS+\nPzMmDd5OV5bAbKZe55qTlWAJp/mZxJI0OOpf54cQUtYFv0NgNzxUD3ABUFR7\n8+rNOKblz6bUCOQTa5xINs2XwdDjQ/StZ2f0AzSohQzmAK0eWISk/SEJ4oNX\nmkL1wWtQY5Q1eRKJ0OmMWqgrKVbXR0UoRwkO9mBQ2lni6cfM4vhCHhegD+EG\nEHFWQT0Px187vRuEQBv22Q74RhjESqLMr8g8BITahuk+Q9wCjyNLCKmPsLS0\nh/2/k71KAT10NLs4sd47aM9JVdHulkkA7AZcmis2en6mfWXurCta74yUgu0U\n85zaXJO3YnrFa0kM9dj313BmMWod0yCyH7UQnJwVBWCstpY7cmCzGu9P2f6j\nh9wg\r\n=9lLa\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"c48f67451e0470c28a2a044f902a31f9fca577d4","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.21.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.a3212b209.0","@material/rtl":"8.0.0-canary.a3212b209.0","@material/base":"8.0.0-canary.a3212b209.0","@material/theme":"8.0.0-canary.a3212b209.0","@material/animation":"8.0.0-canary.a3212b209.0","@material/typography":"8.0.0-canary.a3212b209.0","@material/feature-targeting":"8.0.0-canary.a3212b209.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_8.0.0-canary.a3212b209.0_1592939514808_0.5674845349989575","host":"s3://npm-registry-packages"}},"8.0.0-canary.15e81fe98.0":{"name":"@material/slider","version":"8.0.0-canary.15e81fe98.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@8.0.0-canary.15e81fe98.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"63b9f5b355a864e7e0ac60539e611e56f3e75d1a","tarball":"https://registry.npmjs.org/@material/slider/-/slider-8.0.0-canary.15e81fe98.0.tgz","fileCount":36,"integrity":"sha512-tGeaDVqgxwnSH4utetXRoHZ+Lv/cvcNMfelojnpLWXChkPLkkB257RN/GfN2wBZECx+XM44BiQdnC8T9jLHc+g==","signatures":[{"sig":"MEUCIQD8/sp+OoUS12epFqOt+KeGx32LPhQcVGUdsbXMIp1O3gIgGmMPZEr14z+DYrkxpab1LWekMcP7hwuxsYT8RStiCBE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":393946,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe8lrhCRA9TVsSAnZWagAA1ycP+QG16zsJe7HJcgsLUCqb\nNUSn+dx8MfGFzyr8w7M+yytfR5UB34bRuIryEFECy7ayfGyAzf9ZmK6kHhCY\ndDu1hgnRDuogicQcUYUS5utdasSjJtZua0/R0ondb78tQEvukaWH7MYJ+eqf\nrbgVob1+3+yRyd18NY1m5oFB4I1tKDBs8ASkIql9KRCoOALzB7ts1eoquSbv\nrLw8zOgVjfsSQHmQ+upk6aJHu/nzkJPDwbFZikQLQJxF68kLhXr1Rk2jBiQq\nvd0oZ3QzO5JtkRk1yRyC+eEpV/I+Xm1rh78YkvNr3vYKgVcbHoyFM1E8OXd8\n0L69WNOhyngMu5XdkX5N78w7iq3uOvStsvL/p7qNyKuZd6FkFeVzqiE5j9Nq\nWC43CZ3iIquoMo12Vd2y30FIGtkO5g8ktMSOQQCitHNE82kMMxi7AYKNrfxm\n6BwFqtdRAol6zTjEWAr26cQ/6hieJlVIv9jSUPMeKosx/lFrmyLBKjaFhVqm\nIZDKoRcMjbLf2yTpmFgzLGZitJuvCLyYeI8XAV5hi7A1546ifTUwy6FPjs6s\n/knbf59Voacqr0Ch+isxa4B5CnjUAOytcuYYG71zV1/jImisPqyhLU/UgQKo\nbABZVYqiSIRcpNn7/EOL1/fWptKjc1HlW94bWO1+6xtqqX8XIWDGUb/ngtc0\ngYq5\r\n=M9Sd\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"6c7873baffc445c3cff5a006913ebf1bf53617ac","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.21.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.15e81fe98.0","@material/rtl":"8.0.0-canary.15e81fe98.0","@material/base":"8.0.0-canary.15e81fe98.0","@material/theme":"8.0.0-canary.15e81fe98.0","@material/animation":"8.0.0-canary.15e81fe98.0","@material/typography":"8.0.0-canary.15e81fe98.0","@material/feature-targeting":"8.0.0-canary.15e81fe98.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_8.0.0-canary.15e81fe98.0_1592941281025_0.11783695844384834","host":"s3://npm-registry-packages"}},"8.0.0-canary.004c9d392.0":{"name":"@material/slider","version":"8.0.0-canary.004c9d392.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@8.0.0-canary.004c9d392.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"98a47b8d3bafc86a956dcf0bf51a7a2e6bcf5d23","tarball":"https://registry.npmjs.org/@material/slider/-/slider-8.0.0-canary.004c9d392.0.tgz","fileCount":36,"integrity":"sha512-PA1eXqlmuUl+f9dWX4EUfdBHp/03QDzqI7DGySv2sEtY4dBju7aLxOjsv9mOUhk1Qwo3wjI5aJKLm937gEn/9A==","signatures":[{"sig":"MEQCIAJESnMTEjGd/L5enGmb2JdLF3z5cW/C45fwjOwlRFXvAiBiP6NmkHPSxc/N3PphgHDrmQASYbwuL5PSkKBo8KueMA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":393946,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe8oiKCRA9TVsSAnZWagAAEx4P/jydHCqYzcHnbYg8o2Pb\nC1MrZi0aONfA1mQfRErbVKpzza7tpxLwFPL/y4dhCgPc4WNTdTXKqL9+z03t\nuu5EzPUVulA8qr4ICo4M4FE6UtqFEnRBsyROFHMI2imO83tDLqmsbe2qB/8e\nzrOUOfICyeAAxs8sqXpStIAPQaqGq+XRFI9zNne4BEDDy9P2sbFgHYq1ag/t\nTnHRvKLqqZZy4RjRDXFMWTMdtOpQ2m0WKHcR0AEdtnLj4Ya9+e/ZvEbtuGYm\nGnQflSxdmNBFkG4ighckqUj6zZTrpr78n2GV3O8nHh1gqUAv1f3hmrIfmsSi\nfnLsW+gKE2L3xkLSX9gPjTJkjTfvjP6h0m62NWMx5b0jhMPvM43mGpbJVFvA\n3KQXupwKD6YHvaYH9Ix6XYG50J8Es3/GiRHy6lgwGKYYwUEWjZLUIRX76niK\n6g1yTAovmEV+An+xRWsf3UghGjSSCJzJd0DixWKe/eQOyeUqW11NVfkmyNI7\njcYf+IkocA6BvLPRIH3PdMW5eCNu78/n/7chzMbL4JEy3+/rCDDeFKrJ3ul9\n5h3wEKiN/iVba1hFOxKcJVgmvtPjf/4mf/uD0qRK00cRNs9CTsD4bPc16Xva\n/c0uYOW2zyE8LFc7XFsY+hGPu3UdUpMeV86hFUa7lKKMNzPXwqG/a+8bERtk\nqXls\r\n=DDq0\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"776ec8815215499686a6c5d2a13543285c30a7ba","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.21.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.004c9d392.0","@material/rtl":"8.0.0-canary.004c9d392.0","@material/base":"8.0.0-canary.004c9d392.0","@material/theme":"8.0.0-canary.004c9d392.0","@material/animation":"8.0.0-canary.004c9d392.0","@material/typography":"8.0.0-canary.004c9d392.0","@material/feature-targeting":"8.0.0-canary.004c9d392.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_8.0.0-canary.004c9d392.0_1592952970309_0.3820229375263253","host":"s3://npm-registry-packages"}},"8.0.0-canary.03bde00f5.0":{"name":"@material/slider","version":"8.0.0-canary.03bde00f5.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@8.0.0-canary.03bde00f5.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"c62b87317d3cad983adc375f5095f6b807f9d551","tarball":"https://registry.npmjs.org/@material/slider/-/slider-8.0.0-canary.03bde00f5.0.tgz","fileCount":36,"integrity":"sha512-Xcv2tOXOmSuSBQRR2B3a7CSR0nJpt+QlECPigOdbeCXACqtr9FSPYdbD95P7S/v03CPGZtjIAYJe03kNcXGr6Q==","signatures":[{"sig":"MEUCIF4Vc/MMWjzLJojXdjwRKetDIi6WAWTtAX0wzT/5SRsEAiEApOtdXROoChsXXuX/4J9Wdcl60O5dMN4R6OMdvwnRabI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":393946,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe8p75CRA9TVsSAnZWagAAYGAP/iTb8o0bWBeyJvIUOHWX\nfvGAj1NCKTYEXhDW5YRQo6EemC5KGrA/uMXXQefdvTekDN1HMirwdX7HuXsy\nzw09jboXebuhrk+LEKUGUwa+RLfXsprsdy3fBW16oB9J7q3l8YUTq3Ks4y2C\nDFBrmV8kAdM6/M+QHuaqTE+y0nHQpYOqH745ZxcOwBUr7IDS4cnICMQ8oUvl\nv3a3Lsy5PZratmsT0l1EuPL3OTAAZBNdgu1OgmA8y/EeJhQj289b4Ry7VceY\n87wqLp1iJdPRIqBNBCVGPT5kL6zf4mqZCZSHY1PcWLGpSYjjnwBTVfnZUQ3p\nwRj/ziVxosuHEsk1yyJe8HkWY6PA9ak2zXVbbltHTEwQ+SJRZsmr2mPRw5rx\nOY6wLWkwgrIS9gmbtNFGDt9Pg0ge9p7ioruuj68IUr0N21jJ5uk64/W7pA78\nN6Mq8y+k3IQtTwUozGWtJRDgRdoSoijuKm12nostWlQee3XWm+NPduE9wqSX\nFnuUiMslK9J/50Bb88IhbuxUZpLsm/FuA7pojBYr07s7ku33zdZnyYTyjEAH\nRgMmkCQVCJ+VVoHSHde0/MfFPCr3Tb3ZiD9dkOwjXAzksxkn2T9iuIBRY1f7\nhtivfcr6oPR/4isAWjKMtfCFr5oYNKfMtNhXAxeGeENfn7fPArQAOl0SB7cM\nLjEO\r\n=cE+X\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"c3937a4069800a251640cebe987bd7911de089aa","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.21.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.03bde00f5.0","@material/rtl":"8.0.0-canary.03bde00f5.0","@material/base":"8.0.0-canary.03bde00f5.0","@material/theme":"8.0.0-canary.03bde00f5.0","@material/animation":"8.0.0-canary.03bde00f5.0","@material/typography":"8.0.0-canary.03bde00f5.0","@material/feature-targeting":"8.0.0-canary.03bde00f5.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_8.0.0-canary.03bde00f5.0_1592958712745_0.9270514401644943","host":"s3://npm-registry-packages"}},"8.0.0-canary.599b8c319.0":{"name":"@material/slider","version":"8.0.0-canary.599b8c319.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@8.0.0-canary.599b8c319.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"9ece5944d7bfe41a9cfa814bb94e3525b6a454ec","tarball":"https://registry.npmjs.org/@material/slider/-/slider-8.0.0-canary.599b8c319.0.tgz","fileCount":36,"integrity":"sha512-l1PUxTo92Vu7rGo+jrOCFx/5CVwGg+PuQiAd+7cDhA+QJDLHyAdtknANPpoyG/FHirgwrVAF4cX1lYeOA5kukw==","signatures":[{"sig":"MEUCIQCMikqMgomqV999tgQSzCaXrq+vSkbeThf3K96CbNN4VgIgGV0HoBJkiUEun173LTvhBoxCs0ak9dY3+KEX9APMsXQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":393946,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe82myCRA9TVsSAnZWagAAwLgP/3lnUl+GbGv7v5SehBL+\np1aqMqc+HiKHyNjeIzJjflMMLzmnzF/nRWUI6ORNMucve2+ybxSRNYYX2XBr\nLnLdm3TL1N4R85TWTkj7A+oJEFyKc0rneaM/e1ttgpRFyMfamJYnUgs+Kgda\nklNbB4Gz5pyrnsC1jfgpZ6CUuaytzjOpwMFRSIEXWXTP0ynqaiODYANCBTez\nTo/RF+rXjz4LCDwi6Ljz8Qoie7X5KYjIGiBGLLa/vov24tvUoY8Kg7NhymzR\nYlfr3+LQ3iK3iiZIbaaT9rZbH45Fla6AmMSBeMtyABV7aJxs6C/9WbiqA7yO\nM7ObQohFeohA2ZUKnWd4wcoAYShY4Pm771d96QgXb7wkQ/ZMLh/JxZUW2fHq\nMYe2JXMYT6Jku0BX59JzaeE+K/IZWg/8hbx/yrLWgUA4Dzi8Z+SAwuTsMnmk\n2kP2wA3ryXMccC7GbrJsUI/v8juPxTQQ2fxJINe9FhJvd416dP7ZsXtdnx2F\nrDtpGF4WnRUcaD1dHyp/6RM8PyTipVcJE62Cu82xeay/cH3PvMzbM3pwZLzK\nRPwPXa/A9YvQvJISsBdkja08Fuqmhdz844sJFJWGWdWwbObJKaoiVzhJr688\nEzkITuz0k0UlolV2blzmFOWnwScbRQ26TU7CI2DTuejW3OiRNrJQ7Dcob5G6\nit3c\r\n=QFa8\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"dc6dee1190cd8d60caae49aba599e9d7072433e6","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.21.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.599b8c319.0","@material/rtl":"8.0.0-canary.599b8c319.0","@material/base":"8.0.0-canary.599b8c319.0","@material/theme":"8.0.0-canary.599b8c319.0","@material/animation":"8.0.0-canary.599b8c319.0","@material/typography":"8.0.0-canary.599b8c319.0","@material/feature-targeting":"8.0.0-canary.599b8c319.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_8.0.0-canary.599b8c319.0_1593010610536_0.2561356239278254","host":"s3://npm-registry-packages"}},"8.0.0-canary.87e3be418.0":{"name":"@material/slider","version":"8.0.0-canary.87e3be418.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@8.0.0-canary.87e3be418.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"93d20fcdfa9e080c0e6ff43e7cc2cf7279a6b3b0","tarball":"https://registry.npmjs.org/@material/slider/-/slider-8.0.0-canary.87e3be418.0.tgz","fileCount":36,"integrity":"sha512-40TYQpcJ0RS6EQps65LccNvYDYdGmoM9r8yQgzcTevrXj+/hHpxjXRLkHy8ZS21eDswl1JPWCUxtTZEvGl7G1A==","signatures":[{"sig":"MEYCIQCC81JGpRT3D5d3V8+GiWLPKSIyYOYqJTAEVJ0mF+IWPwIhAMauCddDZ16E2Q0x9gIUMiBWuD94k7gsIyv2PENpSEN0","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":393946,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe85MZCRA9TVsSAnZWagAACo8QAJCG3ttcSOJnyIA/8INu\narMyXZ7H+7nNtDBdjit/m2SurGOVribLWvRd2bWhmZgdPSDRDvTU0pld4Omw\n5c3cq5f3RgVbjx8YqUT5CGc74obHk9ke8C+8j/PnC0O0dW6qy4MCORN6l3u1\njoYcREnhYKrLRW7QOOnsFGEQalNxKS+iidXWBLoyTOdoJ0zDD3P6QAC6lyNp\n93P7u3zo0PzaUIxuUX6xMf1sYjht/lE3HGd5jiHlmtMczfBrGc8E/u/EOdlV\nmmX22KxvRTwjMywr1EFw9aSLj+FZwp9n0QqumYfMcZDbsM7lQBw32gSl4BZu\nBuRs5Uh8MGGz9hjlc3e4D/i80B6pNdU4fGUKY8CEQpIj6N8mQJ9iwEdw95i7\nLSN5eFef5RIfUd7LhOdGBG5aX0oR3kpmpXTVO5hPapbj88msVMkYzDfDIuSH\nZlPyEfrlj5EandRVEY2g0nb5WKOEMPXF3K9KQF3CMqAHDLqdyojZRuWuaV5Z\nlfV0ilKlGuUHnHMju5sLUmG0CpR4Q1j64ZinPDTax/ClnR4YJaQmbKUXU/5c\nOov7p47mpZzjHkULvP7cMtLjOV4anfL6m5YrlK/b4HO3z5gKflMke2Nf8C8i\nYYIyO2ZdlgFwjC4iw3Wjd9pM6MtK+Rd9V2mMUj8oFlbdVvqGImgS7V23Lur3\nCYQC\r\n=MU7C\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"4f20e6e641b48a8ec7f7916b83272bb1322a3663","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.21.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.87e3be418.0","@material/rtl":"8.0.0-canary.87e3be418.0","@material/base":"8.0.0-canary.87e3be418.0","@material/theme":"8.0.0-canary.87e3be418.0","@material/animation":"8.0.0-canary.87e3be418.0","@material/typography":"8.0.0-canary.87e3be418.0","@material/feature-targeting":"8.0.0-canary.87e3be418.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_8.0.0-canary.87e3be418.0_1593021209056_0.6875407510876672","host":"s3://npm-registry-packages"}},"8.0.0-canary.035cf2a6f.0":{"name":"@material/slider","version":"8.0.0-canary.035cf2a6f.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@8.0.0-canary.035cf2a6f.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"5f9d517bffaec1ad71c1040ccea0a19d56f8c8a1","tarball":"https://registry.npmjs.org/@material/slider/-/slider-8.0.0-canary.035cf2a6f.0.tgz","fileCount":36,"integrity":"sha512-FYmHhqHefpqHUShXBw9As36/PnxMaSxfoVnm9bjMB+3Rzpzh2OWJNpV9/Fb2fv6s3dXQ9D9v7f/Gb6aVzMmSmA==","signatures":[{"sig":"MEQCIBi6D7k/HMr0tWZPGm8ENZts1mkG7wT11WI6HiY0ZKhwAiAkXEqgP/J9sI/OjTqzuRibjiezIX7AP6yi9Ubt6M8I0w==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":393946,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe8527CRA9TVsSAnZWagAA8lUQAJ+yM6vVMShB/R7Lq6dn\nZFHiF0EstC2sP071pCuRCjrJC7p9AzQeEXJeaM9iUWtDFFijZ5sud9N8mHbc\nwYRLRTZ5vci2qfyqMZj3mmss+1OAwXIGaE4X3npSuRDpxdg1zoUfjqJcVat6\nlkx5yU/z5tgDDaZWQiswjb0w54IzDGvi0R2lUWXcPpoJCeRrYlcKUy9NcxK+\n+EZktVUvBY2FzybzmQy40zqdOFiffFI3BEEOcD0r4dpB0OpllESBJLzNfaPM\nADUTBFKN6ZRbVFoVqz+ULPej/wiefs/r7NJGyb3ixgasixnteByWaeGkvlaW\n8mO8J8S2Kd1JfnlC5UOA4kRvGGFsCHrx+35zcdkCZwkdd3lP1+M3uf/vgNW8\nixlymchU+6om7xePrT4vj3W7cpBTJ8PuNvK5ozIMHTMObt2lNaJ/3dRF24X5\nVUdnxklmMX8LYVD6UrgSAPUa4+juAlHQ6tuLHKC088IMQERLwRy42efa6ozx\nDrvOsW5klD+p+dWfqVgqB1a19Laf1IJRpOk9hXmiC0Dq8QD87CXobk3cWF5w\n/MVO3JcyJB4+WFExcnRiQl+o8tG708yo6iNEth0pqUOdk1YMXL8LvVzE7/HM\nzADkdm51KEfyIdbBv51VQCLKsOCXcdyBmrGRBXraWVBvieqitY/TrI60GZVd\nOsh6\r\n=XKYK\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"b41149a9f9767b120dac2367ee34f615761dcf3d","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.21.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.035cf2a6f.0","@material/rtl":"8.0.0-canary.035cf2a6f.0","@material/base":"8.0.0-canary.035cf2a6f.0","@material/theme":"8.0.0-canary.035cf2a6f.0","@material/animation":"8.0.0-canary.035cf2a6f.0","@material/typography":"8.0.0-canary.035cf2a6f.0","@material/feature-targeting":"8.0.0-canary.035cf2a6f.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_8.0.0-canary.035cf2a6f.0_1593023931253_0.9938819060029052","host":"s3://npm-registry-packages"}},"8.0.0-canary.2fed2c12f.0":{"name":"@material/slider","version":"8.0.0-canary.2fed2c12f.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@8.0.0-canary.2fed2c12f.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"169b4cc51bc99ac38d44b44274e348714895063e","tarball":"https://registry.npmjs.org/@material/slider/-/slider-8.0.0-canary.2fed2c12f.0.tgz","fileCount":36,"integrity":"sha512-DtIgH1mqYlBH5U/m+Rs9I3siQpM85oiZxNC8LqDwdN8USizDd+CC2mmjKILEAOlP2HJZQLBoBe2aLRafcg6pow==","signatures":[{"sig":"MEQCIBy60q8rtgtk707VJMuN8IoW/Th2VTOmgQ6wYWeW+hmfAiADsZ90FhDTPm2EDS2d3sIM/bLKz0wk3GAkC809EUbGSA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":393946,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe9QK4CRA9TVsSAnZWagAADgcP/ihev8CCQ3oReMwl5k0A\nL1AbGYRb1itV1kNtjsImG0w5Jfc6uR0Szk4T2T1qNJhIGWVwc8aLXZM59NIn\nGDGbUPhd6AEWgQrSdhfsIkst4IIats2SpI9DlrVY68WDKzkiRNOnh9DBgRaW\nIeIpB6x0hf17/QlWI5g9dSbwmPl8RGaCHjkfnwuL/GbR30o+4a58q3U+b/LJ\nscew10DsD4eUowc4WHLOxAj6Ms9JT72VL2X6HpMwZXC3/qGGqW/uwNncmZuy\nX3cbJmK5Chlguekl61m12yMmGJNYRY41s1sBowS37JVrtji2f3wOW4pK3PDh\nxDcU13azwmano/wknHTl03bWkhfSTxa45nrTqC2GWsqiwYvKwRKLm2+g2XxH\nrlsyOCStTeaSdqnKUAuTQoXlt6/Amr97K2lS3zPQv6yuuq0y/4ZOdPZydlBc\nLt7oPQorZp1UqHp2hu0Uv7+gz3BwaiDechRGPqSUoQdPF0Q18uqoNQslvE2l\nrptl8hyXjE35AMlRicNS1LNIbzjfXtcof2A2kxtVad+NQbn0hlyjjcQjA4Tw\nfbba0TkhrBwBIPIJqy+bYYPeXviSiI0R+32XL/qaKyu46vQEFeBp/YLAID5n\n9HSxNf6Id3SNsmJsBzG92zWWis7g9lNZkAVPUq7xN69fCaM3spHVBJQ1zpmn\njKOp\r\n=ESyQ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"9c7b4d7bb8c365a3b1a4408204f63c124455f635","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.21.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.2fed2c12f.0","@material/rtl":"8.0.0-canary.2fed2c12f.0","@material/base":"8.0.0-canary.2fed2c12f.0","@material/theme":"8.0.0-canary.2fed2c12f.0","@material/animation":"8.0.0-canary.2fed2c12f.0","@material/typography":"8.0.0-canary.2fed2c12f.0","@material/feature-targeting":"8.0.0-canary.2fed2c12f.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_8.0.0-canary.2fed2c12f.0_1593115320423_0.4865101906637095","host":"s3://npm-registry-packages"}},"8.0.0-canary.38197b443.0":{"name":"@material/slider","version":"8.0.0-canary.38197b443.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@8.0.0-canary.38197b443.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"ff1c07a1388d59f0916678a12927bf83bfe01934","tarball":"https://registry.npmjs.org/@material/slider/-/slider-8.0.0-canary.38197b443.0.tgz","fileCount":36,"integrity":"sha512-W2cPmCxvzNV2+OsWip/7O+xZPdm5MIXDsHOsVy6CF15CLnCDWGR/bDC+r5U9sEp2GC6O95ABeaGuflNale27EQ==","signatures":[{"sig":"MEYCIQCDDFm0eO1jvqeXd4vnFsxXMx9agvp2/Wx+LQJw7M6LuAIhALpFTRfGhT9vEncok0KDATF1PTvbLn/EoWgMixQvfNEZ","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":393946,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe9RWkCRA9TVsSAnZWagAAlloQAJwQGnmvzehOL4ERUOCc\nBzGYaj4Yor/oGLz3OwiKZ1Xq2VlRxNRPPB0+g+V+8WTyHYdQk0OY+U+SK2Fy\nKqk+NIrrVoEvNlP0U83J5o24fKVE/4izo+E9AlXYVzUetL1LeCPrT03PYZNB\nYYp9d7TwHfR4GYy/rfdB3V1ZQRvuVCuO5vHHSwPAHeKVkYHEY5wDrvRYknrB\neO1OLlDIPopdwxciB/TIpMlSlV/LVtEHHOQ6QUKb+KdeukW8eSAfxTyY3+MJ\nfKlIHEaMGwaY+MISAc9qEfMAd2Ebftu/KNdnGAJpBNzF9RvGva/B6NDTPJhO\nmx9eRxhDXlVnyMm6usYARbNhCUsVcN4uZlcO07J4VxGahi6lhbppWpNpUl4+\naljSJJytQ0a9tQnoz6CN64YZJ6HQbmU8S0yjt5XlSJIoiL7tOYzt2jdbSWaC\nNDEi7BkPHdkiX32UoDiLN7FqpU/YikgVYAifOtFbKGYnq8W/ebBwcLtL5Xgm\n026Q1gLWSPrdSGgyBBrj2cQPi7Oqcd+/BJJ8BG/B9xwWKJ3V0CidtCQzvPKy\n7msd0ol3svXMgvly3OhL9qJ/SWrQV9XZk0cNj06hHLTkPyrUgWqfT9R+pP/E\nRtefoAPRpZgc9BKH25QDhrD0VU/2LhZBTf7igpGnMqCt7ka+Lu5YOnQov/WS\nTP4F\r\n=QU5B\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"d5e18162ee3d69aeff0d489d4f3f73bb1cad7b1c","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.21.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.38197b443.0","@material/rtl":"8.0.0-canary.38197b443.0","@material/base":"8.0.0-canary.38197b443.0","@material/theme":"8.0.0-canary.38197b443.0","@material/animation":"8.0.0-canary.38197b443.0","@material/typography":"8.0.0-canary.38197b443.0","@material/feature-targeting":"8.0.0-canary.38197b443.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_8.0.0-canary.38197b443.0_1593120164397_0.7901915577457492","host":"s3://npm-registry-packages"}},"8.0.0-canary.69a35e80c.0":{"name":"@material/slider","version":"8.0.0-canary.69a35e80c.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@8.0.0-canary.69a35e80c.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"5868ea372faa8f48cb69788b4909312970952b3f","tarball":"https://registry.npmjs.org/@material/slider/-/slider-8.0.0-canary.69a35e80c.0.tgz","fileCount":36,"integrity":"sha512-xE7kvWVqH5ggYl3Jmd7oBU9mK7TFPn01zHnV/NqSMs4QuHf6/FEvnUfrhp0Zk6hjQv/G6xV/hD9e5EOL4rDWWg==","signatures":[{"sig":"MEUCIHy4BWT0z2QQfqfPgggxkWwy9H7xq+/fu9G3EqSIvHoOAiEA+Lgw4IEt7wRbiS7OJGM8Ks6d1QuwHrH0qqA4Sx6yrCU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":393946,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe9jKzCRA9TVsSAnZWagAAPjYP+wec7pnAn7IiWrmcmZQD\nSYIQ/tW+rSyEsM6YXnde/o+wBq6/61GyNrLry8lbSimUbMv2pVIYsUdQ7hjO\n9iHa96GPy4W0RFFDw8iV6lAXqQOtyu9ahtWLbx9aZWVi5SkM0S/A1XZPxJ83\nNw6c4G+ZTflaG+QP5xa8YVHcCftYFSB2Vyyk/t2IfB9XzMCAyIk4Es/WRX6b\nSAW/1RVE3ctKkPqhzPwbk5KYTef6WWOulJhqXveryF2CMcKSE0hGTVG+hJC+\nCUfOCI5j3rfdikFTACF7chpPy9vMsepA61qcSPDXNhhoGQfkKpTV1tsEp2VP\nH+EXkraPaiL3emoc8oDiomnrrWkn9R1bzUSRTPjTb9n9VyMRYWK58YoPOfYg\nq6DZzwtvigsxK7QqkdDpZZJJlccdhEM3PEf5uZ9RCc10FW7V1jDZtj6FuTwx\n0ZciqwEnUq2uNbwDQcntbr/eVrFTFapSWujFJdnqXYKpGUsSU12SL0HQiLAH\ngNYmjGCKWSdyivwOR6p3iflVS10yEQVGsXSzAZnYn/B6RTLsmrPe/oE/yBIP\nwTALMLyd+L4tblK61YhVLQU8lnOcgL5VrFbOeEPRU9OZM83CVotg38IQsnX2\ndazDWUILCP3k0Ou3OLakyU+rhl1tNMJjy86+Xn9X5KeDnCqXaFNWpnN/nb8W\nQ4Uw\r\n=8mj/\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"35bab77d7ad4b820da5ee4944c2cc2b7fe1533ba","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.21.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.69a35e80c.0","@material/rtl":"8.0.0-canary.69a35e80c.0","@material/base":"8.0.0-canary.69a35e80c.0","@material/theme":"8.0.0-canary.69a35e80c.0","@material/animation":"8.0.0-canary.69a35e80c.0","@material/typography":"8.0.0-canary.69a35e80c.0","@material/feature-targeting":"8.0.0-canary.69a35e80c.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_8.0.0-canary.69a35e80c.0_1593193138879_0.8904487405244694","host":"s3://npm-registry-packages"}},"8.0.0-canary.df7154fb3.0":{"name":"@material/slider","version":"8.0.0-canary.df7154fb3.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@8.0.0-canary.df7154fb3.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"e69b8c72cc02f80572a6f2b6ec2496e4366d5507","tarball":"https://registry.npmjs.org/@material/slider/-/slider-8.0.0-canary.df7154fb3.0.tgz","fileCount":36,"integrity":"sha512-DEzt7f2vJZ4hWONTNj45TpX5BdqJwedo7z50sSJp3oTu5lVpAB40SR6MvKJSNp3K32kq1tzZjOZYlwPWLcAz+A==","signatures":[{"sig":"MEQCIBgDQzKq2rQaLfg7CiY2GxOZo/+xAojIqpMvoyO5grbgAiBMRO/4L6gVVe8OM5akFN/+KLDLQCFxxQGBvdqCDhMlYA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":393946,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe9jubCRA9TVsSAnZWagAAADEQAJutQhIUmrn6OqajdZX2\noQWpHdnT1cPcrhDAv+x8qm+oNuc8JK1I7H9Mx4NJr9E+z0rrl6ibXwGebIqZ\n7uEa55xuA1ju520IBDQgZuSnCVu5ibqft4zsq9mpnUGOUg5CRa5s+8PPUlq+\n6KSh8hTjlrMgU2NtSF62/KYjNOhlKyBW/+K3qiYSOJsW1raMXQBhqUNMlR/C\npySduXA+ZrdlWFwxfG5hUOugEH1oyGAtLhYS/ql46GEf2rfrMg2N1ueQ0+sm\n4z3P6zxpnl6ZYOsFkbSdBSoCktLn2Xl2PAy0phSFbZTpOAvZev8AGv87kmNC\nvUt3GrmFrtTcMRdyE/pBVxccyCVRB/VxlVZcnDOjPgjaXbM1t98chF4wCJrt\nooKro+8pwhnPKYECqwP0SARVcQIcFBee1VoxwhW5oRCw1EFm8gLnTAsFt3lh\nP9u1TnliXRWPPdulc7cD7p9f22TSrs6XHhVtHrjB4U1o7cNcR1A8JIvPbAlX\nuC+uwHpAXgDSO+wBw85wPTWFb5drnbQ+dHt/CPwYbNhQSMXuOc8azxEkHqos\nRZAxFtlPbqXI7BaEBwzVBz2ohzL3HTIUnVwCaqZUy23pPd/cmQj6SAmeBfCW\nKBQvkbD+0b038MfJ0s3Xi8rwLeVfVETKMIBBhyhzeZ+3lgF7vF2Bas7JStDn\nQh8D\r\n=Qdgp\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"9081758d517c13eb6f120c62abd9689f1fa99906","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.21.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.df7154fb3.0","@material/rtl":"8.0.0-canary.df7154fb3.0","@material/base":"8.0.0-canary.df7154fb3.0","@material/theme":"8.0.0-canary.df7154fb3.0","@material/animation":"8.0.0-canary.df7154fb3.0","@material/typography":"8.0.0-canary.df7154fb3.0","@material/feature-targeting":"8.0.0-canary.df7154fb3.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_8.0.0-canary.df7154fb3.0_1593195419202_0.92560191638745","host":"s3://npm-registry-packages"}},"8.0.0-canary.d5618602a.0":{"name":"@material/slider","version":"8.0.0-canary.d5618602a.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@8.0.0-canary.d5618602a.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"677e0b4ae82b89b40f597bb7161b6fe164ff9b5c","tarball":"https://registry.npmjs.org/@material/slider/-/slider-8.0.0-canary.d5618602a.0.tgz","fileCount":36,"integrity":"sha512-gQ3HhTYZT5l42oFniHVLFJWOBVNynOZWyDvNlIIVHsPUHZXI54SRiRolIGkC4TayKtllPO0RhsH+Jfk7OldlNw==","signatures":[{"sig":"MEUCIQD0vkyu/v1pu4I/u5mTPlP16jakZPAceKjaSqNmCzXzTAIgJW8+3a+YVOHcjIkhiBSDfpCKi/QXx9dbkXjWefoHvmo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":393946,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe9m0tCRA9TVsSAnZWagAAlBIP+wY/6eF1Thr9LbdenCQ0\nXz1IIF24Bb3pGSlfClMm96FJR75pDYOkn41IRf4cGy3FsgM1I4+gJN+Fk0bP\nb9eabF+bIxQCuktTJhX49nrVgwqHn87xPLrJ56Tuk+D/RAFUwP64FAb2dJtd\nBbvDuvu/qpquRd3mNyJVjR35/Goy+Z0eF0qtFl4vY77Eq2xfcy2tpbRM/Qbf\n+MR8XS0Xzc3I3bgLtBm1d6KWEmgKlduAzCaJdmklveB3bw1HjECQbcxU57xs\nCVLndcvMK/LtZDz4h9YiyGGFm5kMtafqlYSLaZuM7pbS3SbLl88qfFGFKnkn\neOpdYarhk+BF2I312dMisfC9WiBLJP+eT94xJcL79oxeKIq970Vazr8aqD9S\nI+iRlUWA0uRmhr+dfL6UPymFgzGw1RR8DGRtZ8bBJMNJyx/b3Sc8hgMgWts/\nxDN78JqT33lyVFUko3f2CkApuhq2c4dil/vbRyAKZ8Z02xpbbtF3YCPCAmyx\nTQ35FDYjdNXf84P1V5s3gC+abUrPMxZFTMmKZtbwTi8H4I7w1vLJYBp9Jec7\nMr0rhftQAIuIdgVi8PfOXPIHsY+jVEKtRRz0/uMjm8cHGBHeMTBpbxeUYJEz\nceE4j2/1tw/fClbdJ3MILd15SpJym44owGKemEMgEitzfg7LpXqhD7YhpUKO\n2MjK\r\n=P2GF\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"ced8c184e8043c7ac8faa813b76b9661cbe247c2","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.21.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.d5618602a.0","@material/rtl":"8.0.0-canary.d5618602a.0","@material/base":"8.0.0-canary.d5618602a.0","@material/theme":"8.0.0-canary.d5618602a.0","@material/animation":"8.0.0-canary.d5618602a.0","@material/typography":"8.0.0-canary.d5618602a.0","@material/feature-targeting":"8.0.0-canary.d5618602a.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_8.0.0-canary.d5618602a.0_1593208109047_0.5372085868130803","host":"s3://npm-registry-packages"}},"8.0.0-canary.e590b376b.0":{"name":"@material/slider","version":"8.0.0-canary.e590b376b.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@8.0.0-canary.e590b376b.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"ddbefbb8cee956fd14303c2d6375fefd00776fec","tarball":"https://registry.npmjs.org/@material/slider/-/slider-8.0.0-canary.e590b376b.0.tgz","fileCount":36,"integrity":"sha512-HtPWjCPcWIVoqapjnj0O79WhBNcFHa05AQ24Snz35cH4i5zbN6Pfs9fd1dyEqg0nD7Cz4wWBAxeHVHxwhemv3g==","signatures":[{"sig":"MEYCIQCsv8UIF38+wqzlS1xoThw//RH/LTQczWtH/BWyBodfJAIhAOnH/P4qmQ80l+6eXhJ8yUuzyG2b5bFYXjB+EPrLcpRU","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":393946,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe9oOECRA9TVsSAnZWagAA9oUP/jh9WYpDiuirPd7JXnRZ\nzFoBWBvsy6AHEiQfBR5wvlN/uU+TKFRpYkzN/oOhPZ00t4SJYufN5WuBz/mX\nvvCUq/srHp8QBxt22ukQrdFD6NVRLIY34kBclZq0xyFl37POy5OvvXrye5uS\nJ9ji5TwYxhGLbTQxpccdyj4C+1RuY/vH24CdVYNPrBzJzrrmZ/4CMSTmj+Ry\nzayr/xdNJ9QEM5a0rnehpik4N/cMx58U1YJOAOz+MDj1OHN/PKaK5iJpF2Fa\nUauJ6Rt12YgyLf6MARH1+feeJ3+DMTlpI7ipF62UdFeAAQ/JaMa0+QqPURAl\nLEJW04z1bzGGL0Kw1gljrkVyXbuhI5Nyje/NR/hrWkbUpicS7dblFuiDW7W2\nGiMD0uen3GtbB4vz7gsEvPBQOdrT+UoskqzVmygcTW/P7Z9MAoSv3xdKiHEX\nweA8QWTYkwG3hvItTydHoQEDad1WMz+RBaR+7mi7B8t9p65nlodEfIZxr2VS\n/zvR8U8HxLAdZ7gt+q+g6VYvi6boT51XmAlD9Kh3oIgmCCvia06aJ5EAFrjj\nGcOtSPBXNtRYVBE/mRDUOQ8LsbRymjJtKjl8O+7D2Y+ZVTMfCk8RcNRvRzey\n5zND+viEeD6LHC+GFevmBoIBPO4qaiVl0nt0Ch/kUrCfftmss02UO0KtYAWH\nIzeP\r\n=zR/W\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"0ddfb390b804034a98ec0b8e7741dd3f3250b5ab","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.21.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.e590b376b.0","@material/rtl":"8.0.0-canary.e590b376b.0","@material/base":"8.0.0-canary.e590b376b.0","@material/theme":"8.0.0-canary.e590b376b.0","@material/animation":"8.0.0-canary.e590b376b.0","@material/typography":"8.0.0-canary.e590b376b.0","@material/feature-targeting":"8.0.0-canary.e590b376b.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_8.0.0-canary.e590b376b.0_1593213828018_0.07616772371734237","host":"s3://npm-registry-packages"}},"8.0.0-canary.0c9d6bd2d.0":{"name":"@material/slider","version":"8.0.0-canary.0c9d6bd2d.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@8.0.0-canary.0c9d6bd2d.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"67b8706b37ca0cc30cf540b536ff22c8cbde2a49","tarball":"https://registry.npmjs.org/@material/slider/-/slider-8.0.0-canary.0c9d6bd2d.0.tgz","fileCount":36,"integrity":"sha512-qNDKk2Ip1GSwxv86VJvQm7JABx3Cbt643RPD1pxfXJ1LXE8vHVGsqmLmGSYBJxEZFG++jF2wOPYeoZgFensNMw==","signatures":[{"sig":"MEUCIA3PQf6brYSihJtnjR43wBuWoqVJfOxWq9tmljy8Hg3PAiEAttfgn1RZ7qJlzScN66Ac0w5q6JXRqM0GIHT6kHOwZho=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":393946,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe+iGzCRA9TVsSAnZWagAA010QAJzrdwALDDVdUbaoI3uw\nbtQ7tLx+b/+9INeIWZB68a60egN6QquLZJd6T2nkT7wizoCCmp214rgQkzpf\nzSEWvR8zgQYc2Jl3UbCI8vnFuNlskD5htyQ5HuusM5yGfnnes6CuL8M8jFj3\nrJpX0o73O4G2SlUTE22wXT0MRtpqBxwMH+yKqQfJerqPIhZxDLbnVuvaT6A4\n5Av6EjgS/xRmI2q3+vy7yo2Qjkz0dpBxi+0iqGphh8Mg7xgRoXQ8qY1URlCr\nthL27w+JqTbhGUlqaHqxYT6GpVmSQwvzjcijBa7Ic7MjIqlgGQ4sVLfv9pN1\n4TylaB10e4LBIH8OBjmHKt0R3XbGZh2vBtnWGhpiQfaIYsww3Ynj6Rdx3C8q\n74vYN2ecquYsCGEdtDhZzLzuzWxqN4Xd6lgrt02DuxvN+1MAzM/N086WkKep\nqmO3AgNpFVosmzdC/pzC2HA+5iNUTSWR5A3fA6aI05887Oi/chkw8kPO3dzN\nxgKfp5gkyNA8vPRaUuVpvLZpwfVF4B3cPgpP1fECcGEVA1F21xx/7AxC+bYN\nTRJy7YpaXG5UpImqs8U7H77R3e08dcMPbtxpwxI0MhNbIQ3pNuC5yLujF8AV\nDHxW+vFr9pkBq5pSbgLSMHkbN17iYRTS9pP3jYCwJrYwBY8jaFVqjLZdUAU1\nkVMf\r\n=hS69\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"4f171433da859f637823aa04bc12d72783771f90","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.21.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.0c9d6bd2d.0","@material/rtl":"8.0.0-canary.0c9d6bd2d.0","@material/base":"8.0.0-canary.0c9d6bd2d.0","@material/theme":"8.0.0-canary.0c9d6bd2d.0","@material/animation":"8.0.0-canary.0c9d6bd2d.0","@material/typography":"8.0.0-canary.0c9d6bd2d.0","@material/feature-targeting":"8.0.0-canary.0c9d6bd2d.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_8.0.0-canary.0c9d6bd2d.0_1593450930627_0.4031082359374414","host":"s3://npm-registry-packages"}},"8.0.0-canary.c1fec4246.0":{"name":"@material/slider","version":"8.0.0-canary.c1fec4246.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@8.0.0-canary.c1fec4246.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"80202b6abccc4639c9af9f81716a2712dbe7d691","tarball":"https://registry.npmjs.org/@material/slider/-/slider-8.0.0-canary.c1fec4246.0.tgz","fileCount":36,"integrity":"sha512-IphaJqULlotWlX1n/Y5hCWrbbZdfKkUgoL2JZp3OVMqUYoJTNeDSV7x+Im2Dg+UOnfXx8TDkXUvtj9/u3MBkuA==","signatures":[{"sig":"MEQCIDgu2pxY9KbTiis73aoJWjcq1jTF2PXotAqqXKFQYx2OAiA/FJEMSDQxEy6+6IvSyCn9biyTx5HaVpNb8Zjcq5Z7uw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":393946,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe+iVPCRA9TVsSAnZWagAAS5wP/3EiLLTUUd0o6pT2IK4i\niVzGAIM0HCrHN66BPVJ28coBOzBp20NsF0eeeq8/iKu9y7XIWA9yL01xGI82\nT5NKu3EkcKfPJU3GS0ccPZag0b/Ji+S7XPKdbp4AbUKSTnbvHvmg6B0LqMQq\nxWM6qdVXBtAUsDiRGS+2d0+FW38c4infIcZxWI1v+SEPE6HwazbkAuBIwVO8\ncUIMn44s53d1WcKAkQARWXgjLctxZl20/T6L8GJfHCv9DyAPeEPQQ4hINoR4\neAbF+FfLZbF0A4XUFW7eGU8vqHQh4wJSC5TnkRz+yxrQisLWW0VErUTSAeOM\np7T4lz2pNsAv4AXVO+dbPTd4gZqMSJy72njlWbKitHkrwcg5ISS5IHuiA6GI\npLLfcJUn9Sud02jVJoWwfTYRTFP35d4Yjybf3FnE3ImqX+giTonPdF1bAeLP\n9ww+DH66sGIEnZhrhnknU+Dlr3QciWI6eLd77Kqnwtg4CI8L4tKBLw09b3jt\nELAJPsXJDV6CWVVGBnMJ9OBLNs/WXFOKKbDekakFgbTr8n6oJKMGsyyoyB5O\nQrGEwhWjIsG5NQuLQQmH5bV7TEH32VHBEl98Wfzo49xoHjuoC8sMRZLy6JrV\nd/gWnaZgzqqw91270qUSVDwgfYuvH3UhAHmGJHYM8XTTDE2ZgOChA4qwXiVJ\ntxOJ\r\n=HtpZ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"0a588e37208b314f42e946ab4add50d0ad1ebf7c","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.21.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.c1fec4246.0","@material/rtl":"8.0.0-canary.c1fec4246.0","@material/base":"8.0.0-canary.c1fec4246.0","@material/theme":"8.0.0-canary.c1fec4246.0","@material/animation":"8.0.0-canary.c1fec4246.0","@material/typography":"8.0.0-canary.c1fec4246.0","@material/feature-targeting":"8.0.0-canary.c1fec4246.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_8.0.0-canary.c1fec4246.0_1593451854892_0.8801337570049628","host":"s3://npm-registry-packages"}},"8.0.0-canary.c678a9d34.0":{"name":"@material/slider","version":"8.0.0-canary.c678a9d34.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@8.0.0-canary.c678a9d34.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"12a46ed17906e7ddd42262251f776496fa0de352","tarball":"https://registry.npmjs.org/@material/slider/-/slider-8.0.0-canary.c678a9d34.0.tgz","fileCount":36,"integrity":"sha512-HGmvk+fd44B1hsmAGB9sPeFZWrRx/VJuVhOaqNOPmfC+CnOqA5U7a4wDcJr7fjc0H36S/hgXpThnLLcGa/LLsA==","signatures":[{"sig":"MEQCIEFzj1IIFhYYJFt+bsxo+tbkk9xN8sYllyU8laGd2VtPAiAjhojlGnlYGFxOSpINNA9FEnnNfrdUR++4RDv3yU1g0Q==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":393946,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe+ipUCRA9TVsSAnZWagAAGEgP/33lERLYN/jQuXL2I9gj\njmEn36eqB35vUK8NgQZcczbHCLua4BE4dXg83/gyvq5zuInyOaL9M13QzyV5\n3T1utLbnNtmfXIiNS+Zx5x1rXu0XXrbKBPGPTfovHMWdRhdIFUVg1mtPl/zZ\nJIH/rMmTZbzRrs+c0xAC4x5HKkSpB9EZ9NZnNfBsVykPUa3aueZlZeXspQLc\ng12S7fuE/NRaJdreHZYZXtyDykTl4bSYxNwXD9m/KK1Im9fLOG8S+z/W24JV\n9jm3Hphxp4LYQQs4eafFWVBWhfVnnWYMvbIRxicaMxphL2e0WqtbXo6yflwl\n8xl+kSOH2CJKpkRF1jmGE+snDiOzWjFKwDMQlERV7cvfYCaw0rLKjKVv2Man\ntt88AbrogBV/ZVgCG1vdK3h62xP8JNZuI9K88dk06sH1XkFjmWfB2EAeQ3tY\nDNQxtJBMvbgkmMt58+Hu5uZF7tT3UC/f9ZFYXOAFl76hpcs0XwKsLaDTWRjT\n0Nf/S3fMTecxTvJPsqFSGoRRQ8N3yao7pLCmlYmjyC6DnQgXiVrGd6M1b86h\nfQp2qPDC35AV5Gs6B8Eqwptyrm7BkXYmveF0qU0vaeQdsbulJ0hrgU1PAjZf\njcCi5tFxF4IksgqMz+/bmZbwR13jMrggBMIM1STKEUk3fZZHGY4nzLehH/tq\n5eCS\r\n=V91Q\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"bc361f7c6bcb498f3a6dbbe6255c06a66b7dea5a","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.21.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.c678a9d34.0","@material/rtl":"8.0.0-canary.c678a9d34.0","@material/base":"8.0.0-canary.c678a9d34.0","@material/theme":"8.0.0-canary.c678a9d34.0","@material/animation":"8.0.0-canary.c678a9d34.0","@material/typography":"8.0.0-canary.c678a9d34.0","@material/feature-targeting":"8.0.0-canary.c678a9d34.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_8.0.0-canary.c678a9d34.0_1593453140348_0.6048686882155527","host":"s3://npm-registry-packages"}},"8.0.0-canary.521afaf6e.0":{"name":"@material/slider","version":"8.0.0-canary.521afaf6e.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@8.0.0-canary.521afaf6e.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"c13d3d20fef5ad5c58f35fd1947a36d3d8da0372","tarball":"https://registry.npmjs.org/@material/slider/-/slider-8.0.0-canary.521afaf6e.0.tgz","fileCount":36,"integrity":"sha512-y9WwWTuQ3x0pbf5tOIUrBRyjipe2U1gz8ycZmDrUDjqsNDAYdIc9bxuxMrXn8PjzXe7BWPz3YgaaRIMN5Hasaw==","signatures":[{"sig":"MEUCIQCQxsrDfDlBvrLrmTb81psY2Lm+QbkII0fiiTbi3Jf2QgIgBwjchysGmObAn1VNU7fGeLQy0musnqtLewElBhjy5mE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":393946,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe+1TMCRA9TVsSAnZWagAASl8P/A63iQqLvuKoqzlv0ANM\nLuwjoDoZNCt9APqVnY03TWBef1FnXYjrRKwohQwmx4gaCVTIoYJ4mWgKZ66p\nJ2YFQhbmcVZ4nvp5h/3kEH1DKwXX8NBpqXE6xzKtJQcsQ2HYueIYxpf1AER+\nOilJSEMCZ6TSdPismIyCm+uDkkTNNrxzsju1767rYk7JFh/eErmw6oL0mrtw\n0F8Z0PFfzAv8THzKmt9jTlszxA72d+Nsp9V4NORTqbbNIFC4WeWdEMTPOctt\nyLyb9vEelsPMdx7HTlqzOTU2OV4CD3VoK6d8gnbNgReb6J57Nr9DBYuTFZjG\nVw8tKQW8Uq0I+843La6DdR9a85wpaVc6tJTIiFyLsmSUSOoNo9EifjXMLtiq\nd6QE9snMIYvUC+xGQEIuDnZrfoFnQU/mVJ2eNPeO9ucLfhApthMo1yElOlrX\nuC/mBMZJWlKLd9azKrHi+XcuzhoQcCRf/Kan4VY6iVbk461t6UAWY774EtXj\nzgH7xmWK2xYaLt9hDeU2ppsJwM4A2CfrStoCFVxUlEeJJstMf4GStlI5kbLy\nvE4phBBBRp6eYKjDuS1Dbo+cawSITMRDF7bO7ekYEJztg2gj1Ejj0X5bmvIl\nHHWS2MZFbzo4obciAPzBH4VnBXAWX4ToMXS5+C1xHPfZXhe8EQCfFOzkSPg0\n+kuT\r\n=VLTW\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"7ef14e207a6031cf299541a4dd72c2eafba3ef91","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.21.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.521afaf6e.0","@material/rtl":"8.0.0-canary.521afaf6e.0","@material/base":"8.0.0-canary.521afaf6e.0","@material/theme":"8.0.0-canary.521afaf6e.0","@material/animation":"8.0.0-canary.521afaf6e.0","@material/typography":"8.0.0-canary.521afaf6e.0","@material/feature-targeting":"8.0.0-canary.521afaf6e.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_8.0.0-canary.521afaf6e.0_1593529547688_0.4026165150719361","host":"s3://npm-registry-packages"}},"8.0.0-canary.a2ad48839.0":{"name":"@material/slider","version":"8.0.0-canary.a2ad48839.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@8.0.0-canary.a2ad48839.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"a7af34a9d15ebe1c6eb5f515ad0681fd52fe362f","tarball":"https://registry.npmjs.org/@material/slider/-/slider-8.0.0-canary.a2ad48839.0.tgz","fileCount":36,"integrity":"sha512-hiIMEdN6RWToEN/teKXCObk4X9qpuG2j9pbx9V4nq6adn0bSCF4F37zIFnZwHYURb8liiSnYEn/04A4rXxdRug==","signatures":[{"sig":"MEUCIQCDWVZCcL4SbIsEsCe5GCZAt5xoDprMaCMhHxL4ZHWd0AIgUVRxJV6mzaTU3nGQg8uSbJFcmsZgQzYE+Xkf9FP7P9g=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":393946,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe+48bCRA9TVsSAnZWagAA81IP+wbGYCk6KaScvD2OKSXB\nhDq33IpQ6kaZcyJqwBQ1nUvBoS5uGarw5w42utHnHM26t0huJ2mi0To7Yg68\n6ugjxbLToKHaEBlAP/lB0+T+SpA8/StFfjF68Ecq/fPICv48us9Qf5Mp41ZA\n51GHAjhmwlGuVeQJ6K5LFxARmieijIZwBTx3qzKMDcMpn0WyLG28E2I2jslW\nufSTd1phF2XpDPpQNzGiMaKy0hWB3+Nakui5RwjRHdvlzqYEz0o+VvnsA5Jk\nMCT5Ghz8nSxSPeznbY/+iJPmKcSNFDvYiOSPWDHoLwtkRRYv/BkIv149UIn4\nbqye+ObdFKHGLOr0TBfpURSkvGbQGuB6e4ZeLov4nKOMS2ZotjHfWKvMQX40\nxkURyozc2aPnN/rK+aoMj9H5Vn31SbmyjawmtED/hqyfy5O0z1mz6XAs4QZ1\nf0fdGTJMj0YK84N4QxOf2BcttIQisMKLYRb7F/4YQ4gEYgFO899DC2GkqEgD\nMMNNbIMkip6eIbMN8gBN4qbxEQTjI8zWeqGXjrrnfSyD6uVIDyXFMtk72+cE\n/v91B8ubf6uusgqfqzkvZvcjbog0rUmAjwASLe/0vGWmUsUnQA5p671tbVgi\nN11V5ZVC2xKplMtbzinf03PC93B8+x23tWTytpxUFYFhnCf5l0234oo+2wp9\nB0j1\r\n=7NLI\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"f7f949a98e604fd4cce2507e8d63c145d2f34e55","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.21.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.a2ad48839.0","@material/rtl":"8.0.0-canary.a2ad48839.0","@material/base":"8.0.0-canary.a2ad48839.0","@material/theme":"8.0.0-canary.a2ad48839.0","@material/animation":"8.0.0-canary.a2ad48839.0","@material/typography":"8.0.0-canary.a2ad48839.0","@material/feature-targeting":"8.0.0-canary.a2ad48839.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_8.0.0-canary.a2ad48839.0_1593544474606_0.25512238985478053","host":"s3://npm-registry-packages"}},"8.0.0-canary.ec2385881.0":{"name":"@material/slider","version":"8.0.0-canary.ec2385881.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@8.0.0-canary.ec2385881.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"15d95438abd1ca2ca7953256e837042c60a26875","tarball":"https://registry.npmjs.org/@material/slider/-/slider-8.0.0-canary.ec2385881.0.tgz","fileCount":36,"integrity":"sha512-eYKZpUj+cMYm7xkWmwnl0nzzK+jpMbUDlJ/M2SjrXrmVO/cgDmmePs/M9tzIMPDequj+XXktFMA0SvdNZj02Zg==","signatures":[{"sig":"MEYCIQD0+fSIDIJ31Z8k5kx3ngJ34RtnHRR5RpQ6uIo10nkcMwIhAN19/XEk6bBH8VaOXrpSTzUC+Nh9d4CDQ230BhENMRnL","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":393946,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe+7LiCRA9TVsSAnZWagAA0LoP/3StJfN2e5FSW52S4Jmh\nGgFnObgYnCX/BC/TyxgS2/7cTeZVZJbVhZzEFQyQtHiIufStrZB7diqMTaWh\nAaDaxjzMoHaZwqtwpoMDYIsNC7OR8adMrAEXGuNaipqk9CyfiYCkdGeiYadf\nK7YTKse/CsMIiKKMPQlEsM9gcAvMJe5Dh+lUGFbGi/OQB9uE7unULjRUE71v\nZD4+joLbppChxDoGFlwRlJuKidJXvKlL+mSFtw8D7yAP+d9KFrZVDQThOv6U\nplgCl0sWriDtrE/ynhJ3+DcDgo9I4d20ewGRBBz0sLaN6pXjEk9fDzVNxpm7\n01xmeZYNHLV94sfh25ZOW35GNNGZN6VUopSytO96uYTRjnouSle1ytnXW75K\nDH5ZU58co7ZCiRmDjhhsyHOK7QCXGDF+VqsV8I94cXh4KLIja/GUSiKECSuf\nprob6Fs1imtKgTBAPdpNKpyxRtEHe2dey1n9fVBveBBdjhBaBnVEhj3XUENo\nHWOdh/f3LHU4/hVZb8ty9lNMRZpwjK5egZ7ubbfbVXS0m8Dg9+k2R2Cz7g0U\nKYzxKSzYjvelgwxjetwjZ0Ufg1x3CpCsxE4AplPYGaRxqev6VxRUKlT1VuDy\n85LsBdrgvjizOCZ1XINMLR9OrDLBBrX5JeapvBQE4PSoh34786Z8mEYQNF0z\n/iiV\r\n=muJN\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"0039d314b5ff29856a2f17a5ede426f3f01c80bc","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.21.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.ec2385881.0","@material/rtl":"8.0.0-canary.ec2385881.0","@material/base":"8.0.0-canary.ec2385881.0","@material/theme":"8.0.0-canary.ec2385881.0","@material/animation":"8.0.0-canary.ec2385881.0","@material/typography":"8.0.0-canary.ec2385881.0","@material/feature-targeting":"8.0.0-canary.ec2385881.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_8.0.0-canary.ec2385881.0_1593553634326_0.4983431081980556","host":"s3://npm-registry-packages"}},"8.0.0-canary.610c26c4a.0":{"name":"@material/slider","version":"8.0.0-canary.610c26c4a.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@8.0.0-canary.610c26c4a.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"f15a8e99094d487150c953c7b32e7e7339a304bf","tarball":"https://registry.npmjs.org/@material/slider/-/slider-8.0.0-canary.610c26c4a.0.tgz","fileCount":36,"integrity":"sha512-SkTlFe2jR9ky5HkB5a0UkPIo9/ozc81xlT85EHctF/XHp5DZ7eELgLXq8ASi5FXzW8gT8TNf4EZ6vipzoFeukQ==","signatures":[{"sig":"MEYCIQDWqCvDfilBo4Ib6mWH3Abh2B2pfRsX5XGjD8Py7aF0WwIhAIGYYpwerdAZyzeuJlC1PD1ec0icj2glpy9d7C4VQTpi","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":393946,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe/KQbCRA9TVsSAnZWagAA/10P/1uJixZqeyJo8C7mcYK3\nDrGy8chr9x5aVd8qqjvqOY2rZijwPQGi6+gl5staFIVYxYxtaXKttjLCtNja\nOv1HUT3v0N40HNkQ7USXaH1rYYYad0MRF9hiuYdiycKBBoNXQIlIqvb2a9pO\nptp0/FO0kro02HoT5ozvGxZI7yvHNxJfOzKp4QYKvhVKE39FU3S51dIG/vXF\ndV+jGDrTfz+k9NUsxqyVFrGClVJZY0GAcqoFNJP6UkxVM8/ZckCmAljNWbAt\nWJ9wlhCxZ65f1PS+2i5AKNNeopoLwDtjO/HAffysE4+6WBx07PYoeCOA1ewX\ns76NB7NmDT0B3E5rrwCgn5n4adWXHv9AAEXbpy3Sk4qIsylTAY0iWk+lEHGl\nIciiXYVohdos89mBVSf6ZugLHmkMiR0a3iRo170mE3L5h9GBUDXgpXWwIQbl\ncAKMBRpttKWG7DmlCo+pNn4IzACSFZikeESvjr/6Jjtf7rWZzxNLIIicKJpX\n7Hhf0HyHMiIKgN/QG1mLHONqlOuxtiy0E6Ojxw8HbpAHZcP21ArTIi6fcgq2\n5+GFwrJCR/vHQGZ2EdYvoMie0tMdJkdk9/IX3Otl9vO0Arjf18EGR+bFitAt\nA0+WOISULY/+Wg6IUMrEk4nSmnxtql59xF5xZKab2syqDVWmRj8zF/SWNlrb\noNQU\r\n=LhxX\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"84352d6873c8f275f890267635fa416189f57a3a","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.21.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.610c26c4a.0","@material/rtl":"8.0.0-canary.610c26c4a.0","@material/base":"8.0.0-canary.610c26c4a.0","@material/theme":"8.0.0-canary.610c26c4a.0","@material/animation":"8.0.0-canary.610c26c4a.0","@material/typography":"8.0.0-canary.610c26c4a.0","@material/feature-targeting":"8.0.0-canary.610c26c4a.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_8.0.0-canary.610c26c4a.0_1593615386614_0.25293961645763763","host":"s3://npm-registry-packages"}},"8.0.0-canary.e2ea4a99e.0":{"name":"@material/slider","version":"8.0.0-canary.e2ea4a99e.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@8.0.0-canary.e2ea4a99e.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"59e12e4d9c3e2a48e7fdad980b350d74719a3660","tarball":"https://registry.npmjs.org/@material/slider/-/slider-8.0.0-canary.e2ea4a99e.0.tgz","fileCount":36,"integrity":"sha512-qQRWISNGaoLZfhF7yf8/I+el+0HbnRn9lVv66JRcYR4iu7y/6I49xUUWJoW7Mv8Gs643kEGyE6U7K9db/LrA9g==","signatures":[{"sig":"MEUCIQCxUeZX3FoLK/n3SPJiiB8Z3Mr4sFbYlXphzBUI+P2P/wIgKdPi70GmCOQrt2k6mT3Y7PcSkq9CO7k2MflumXT5/Gg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":393946,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe/OOdCRA9TVsSAnZWagAAvYwQAJxKqZwWHERNO7vKWnb6\ng8czc1+P3LZULsUvHvXeSYiUwMiJtH7Fh+9KDhpT5on/voEI7tahdJHhhzWB\n6Lp9GlD7dicX1k81RITN7Kiyc4ynSFseoYqbvSX5Y+fQSft4psdw2wx1fRhU\nAHAQ9DyNVuGNwDrG2+Qpbpd2P8MGKWHkohmsGg+qt/x191ZNJlr24cl+1TGS\nGFuKhZKKfi5qb77dRegdC4+0db/4yj1HraHYtaUZ+eBTnsiG8OE6H3rKElMc\npOd+EWhD2gYQB2rvmNJjSr3w+/UOzIzQZqwfgJ8VyUxw9wNlZT47/oySg5zo\n04q5PupHze1aKxhJrLdb6lzmx/G3DZWaJGPiuE/UySgbrT6R8rlQiKdrUz8b\no7o54tUg8zMiRCg8J71H200tLHWIxzUeZ+zNjJpQR7HvXt1h7wwE4yRwnMyd\nhHPgi1GQsn+Y9yMGWo+kMcAClnhZyyZ7G3gY84jGsVbpW7UKjfnQLrmPg84g\nz/H4yP6M1SAk2GpaoGdxBXDxFUdoQYDZuqLpZfTTbzii6iVxGjzP9TTYenku\nWJ0KeGgVaPq11vmJYbuz31WyL3Fs+7+XfutzmjW62YlJ7iAYpbDgP9NxuV/k\nCyOB+SgCY5T37kbVb5HQLvQaKf4Ui8bEInhKp8NIX/lzmghtqAmBcEUtjeTv\nhP4D\r\n=nXWv\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"42e9f40d91c643a9770e5a563a204c7f36196a3b","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.21.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.e2ea4a99e.0","@material/rtl":"8.0.0-canary.e2ea4a99e.0","@material/base":"8.0.0-canary.e2ea4a99e.0","@material/theme":"8.0.0-canary.e2ea4a99e.0","@material/animation":"8.0.0-canary.e2ea4a99e.0","@material/typography":"8.0.0-canary.e2ea4a99e.0","@material/feature-targeting":"8.0.0-canary.e2ea4a99e.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_8.0.0-canary.e2ea4a99e.0_1593631645145_0.27672979433181055","host":"s3://npm-registry-packages"}},"8.0.0-canary.a78ceb112.0":{"name":"@material/slider","version":"8.0.0-canary.a78ceb112.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@8.0.0-canary.a78ceb112.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"1c488eb0e74387682c98e76830b9ba5ec127c09f","tarball":"https://registry.npmjs.org/@material/slider/-/slider-8.0.0-canary.a78ceb112.0.tgz","fileCount":36,"integrity":"sha512-9cE3Cf4wEzxI0KOmAD6IP/OaUosjNq6XBr5API/fd+HooYSJtoQNY5iNLt09CQSOA84eg59+bXvXnmVkG71+bg==","signatures":[{"sig":"MEUCIAngTBvyg2cKQgAhhHwTdiz3YrKZ8jmjvMNIASRMk1TVAiEAj59w+GC08XWgI1x4eAiaW4PoQJL/TzQbik2DAfH3CaY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":393946,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe/OZgCRA9TVsSAnZWagAADZ8QAJ+gV+S/0uc7S2DrcTQS\naiPuc7pYIk9JVr+VBmAVu2vYjY3k4ND02mSBuvTC4nLGmnqooMrvvGY3qOH6\nMB6KkRIHLTAafXOEujo+Goj/rMX+pMszwD9beQzqGnyrAFiJAVpV/QCLxa3N\nJZqlgDlDQz5tH9FaQx+d1zL9VR7fm5iIFwj/WqohUt6JbkUq7ctSaJ6H8SX9\nfLwGXO1bKkdaDsiVArwfMvlzS6f6NxKZ60ssIBOS2oaMeURcacJXRgkGwrFE\nDdgQGv4W1GfvWIUrDVn5DG+gavZDuq5fQZSGIsSI0NFIrUh6t4uv66Jel8z/\n3PYp7Yty41QTxXrtbu9NrN1Ffa+SQijmIP5nQkImY2OSR6TSsHhjrV2kfXMO\n86/HQBMAaaoobtapIXBUDAUI4yW+9u+2KULPHasaerARxyPje5UnQ9xmQkG+\nNM8jRUn50WoiXmYJzUqAr83enexvnFvhJ5AHQ22nfR0VRUN2I83jatzxYwm/\nKaxa89UJiw/j1qJPXH7a/GEgMJWtbGSWhG6TsmKZkkCX/E5O9W/ZM+ZbMFaL\nviMKupySWXldetH0a5t/0SaHfGvxlfpaq4ejxM+4z1/GKu+q3SNMZVQ29adE\nCvB/q3SgcrloI21lmHac8BdYd3qafc2WEX7asr4fRrJz982gsletuxqmoOy9\nw7K4\r\n=uzZF\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"3a38e39f3d172dfa99254185d8b0d4c03dcc61e3","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.21.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.a78ceb112.0","@material/rtl":"8.0.0-canary.a78ceb112.0","@material/base":"8.0.0-canary.a78ceb112.0","@material/theme":"8.0.0-canary.a78ceb112.0","@material/animation":"8.0.0-canary.a78ceb112.0","@material/typography":"8.0.0-canary.a78ceb112.0","@material/feature-targeting":"8.0.0-canary.a78ceb112.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_8.0.0-canary.a78ceb112.0_1593632351936_0.6917691720110561","host":"s3://npm-registry-packages"}},"8.0.0-canary.b0c456d33.0":{"name":"@material/slider","version":"8.0.0-canary.b0c456d33.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@8.0.0-canary.b0c456d33.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"5f854b5e5caa4a35bbb2705c2d8470a4882bd273","tarball":"https://registry.npmjs.org/@material/slider/-/slider-8.0.0-canary.b0c456d33.0.tgz","fileCount":36,"integrity":"sha512-H0cUIlR5wXzSb4L0u4vKRRn5ghrO4q+gkcc+qO807ZtD1zah9apQ7VTwIuACLP9fkPGs1r7zsyx+wrrXnWd0Aw==","signatures":[{"sig":"MEUCIQDN3RFz832X8SEtCMYIkTExFJCzj7V8Fpiw9zcubXYoeQIgLMSpnwDcKKsUoIIZETm5Bj0GA9zfyjXgGR+UK9hcvMU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":393946,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfA6ioCRA9TVsSAnZWagAApH0QAJuFAQ1A78VEWSSDh9iE\nk9w4HNZezzNzvyt5YO2PUmqXK82Bin4gLbhH3VYriyuIroEie4w/wQAIhD1B\nhHJfWkAZTpTTdvJk6KIzY8NPwZo2oXGwR8wtcs3uft9ys+SbLp3KjmGBp4e8\n+xsQ+EqdszYoP0B6UWvPtAu6YcLqXfYWcuSAIfDvMzSd0npbbSBb1PjugKZf\nLTDY9UNbH2BjvE45s7HPSSIJaOvZ/B0U/2sVDXl6+zFHjFdvSC8I7fIDocvw\nOzCfc32HY01QgyLUtzFmTL8vzL1OtajRhH8ZPUXG+gP628EENuMsN+hWWApX\nPo8lbiF9eqkTA6lpCrsD3J6lkHqW7G2YWCCd4yS0Nwfwaqs3jPQ0KqYoKuOM\n8Eo5fvpB+SjSvgyzVVpMAJCr0XliK7nqBShQKT+3lEWJlReSgtFr8RUGx+6r\nGFR7MOPkTtjkkv0u5sQOqX7mhO0DXVgaB3XOjL1AMVGics/p195IAeGvnoCk\nG+JupUfrqR+thds5+GxgFiccEtdouhHdOsV8XtaOUutfk+BcoocitPQ7X2/m\nuGtIEDjkCCYAd0WHtUk72Sxmd84zFDJnH9bo8mouxfr6xgR2HxfgZMSedZWg\nwFHCIReCQib/srfySrP2itnFJcthVVGogyMop8QrLBLoH4M2nzw2KR2IHc8N\nW+7r\r\n=tydl\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"c9a540f1489e069a2e5cd262f5daabc034039d2a","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.21.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.b0c456d33.0","@material/rtl":"8.0.0-canary.b0c456d33.0","@material/base":"8.0.0-canary.b0c456d33.0","@material/theme":"8.0.0-canary.b0c456d33.0","@material/animation":"8.0.0-canary.b0c456d33.0","@material/typography":"8.0.0-canary.b0c456d33.0","@material/feature-targeting":"8.0.0-canary.b0c456d33.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_8.0.0-canary.b0c456d33.0_1594075304100_0.893388509041005","host":"s3://npm-registry-packages"}},"8.0.0-canary.2e5711e04.0":{"name":"@material/slider","version":"8.0.0-canary.2e5711e04.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@8.0.0-canary.2e5711e04.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"b6599471e5bd505eaa057b31ca4c04c391b965a6","tarball":"https://registry.npmjs.org/@material/slider/-/slider-8.0.0-canary.2e5711e04.0.tgz","fileCount":36,"integrity":"sha512-ygePRHbZUTUjvh97AVS9fayr1rxxkVpDy0DwckbEToRPxU/+pliUCPd+hXcaWr+kd8ZYDLD8EGgcfPyPd97arw==","signatures":[{"sig":"MEQCIELXcRbt2td7qRokGe8BkKq31GUpsCxmOvzJaoP5F+2nAiA9yIUwi6JDL/KtUHsqq6EBL1pW78/rPVu3Ebpq79bSuA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":393946,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfBfjaCRA9TVsSAnZWagAAbO8P/2rI9rjbwcd1X2rRpd1i\nSBgj88buvr1nCUFd/BlRX4LXq00qdExO6kdn/8cR0dZQBi+OAzVFHdJLo+XX\nEfz3QWUcDtmJIm23KmuNcAg4Ya8qiYy7SsuQt5F8uGCMnNsC6MQwUSnDWwBU\nP/R1v9nslL9b83FTDl+PucjHv5QAD0YqBVPXobgHbR91xc7ywsw6e5T5m4fh\n+Eru+m4Kt+a7n6gBstv0KqIruiXfT9H4OvXrR4u1gnxzqfdO6VjXx39uP62l\nhJofn1j+97wOp2UQ5q0eM4kDUUmN+XEt2fflCHFQO1PN3B+evvwGk9Qf3pNp\nDV1eEPD2vBeDcV6CV1NBtdWOrPPaUK9X6BNQ7/HSNZCerh90GqeVjX86Ek+Z\nKnUR2cKCtshlZAs9FwrDYjqjDsX/pb41o503ErqV0f4Ht0r45WizKeyywez3\nNFdDDm9eKPLUX7dQCTTuN5jBbzXqYbwCb8Afwk0acQJNWidYPUKEjyYpduXI\nhJa9CEcZh0oms6qISWAUh3+Y2pjZffvCIwEiRAOk0zEJ27p0I97hG5CTc5lK\nS1jee//FdIhkugNuzrunBLmeiXR27q+9L6LdzEYDcOBt4tJy9a5CH9KgUoDK\na8MeHxIEcOXbktr82TGoPTBLlTNPvVlKGSfI8+mhEwq0zq7EV9ad6awCRb+r\nETxR\r\n=ijwe\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"4786b99e99bbd4c7b7f10a9111b884c165f1bc7d","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.21.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.2e5711e04.0","@material/rtl":"8.0.0-canary.2e5711e04.0","@material/base":"8.0.0-canary.2e5711e04.0","@material/theme":"8.0.0-canary.2e5711e04.0","@material/animation":"8.0.0-canary.2e5711e04.0","@material/typography":"8.0.0-canary.2e5711e04.0","@material/feature-targeting":"8.0.0-canary.2e5711e04.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_8.0.0-canary.2e5711e04.0_1594226906010_0.8843918768857975","host":"s3://npm-registry-packages"}},"8.0.0-canary.811fc5d24.0":{"name":"@material/slider","version":"8.0.0-canary.811fc5d24.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@8.0.0-canary.811fc5d24.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"5648c5b1d206e874728bd93024848ea089f6a8f0","tarball":"https://registry.npmjs.org/@material/slider/-/slider-8.0.0-canary.811fc5d24.0.tgz","fileCount":36,"integrity":"sha512-EpLsxVACVxamoPVOMa58UjU4q/p/JVcO1Zvmfkb5m2nkwZQVI22rBwulIPjtbE99eSxPCSc4Hsn9mu2Ncw9ohA==","signatures":[{"sig":"MEQCIF/Su+BN6YSdOV83Tbn5w8+a+X7M8KPyM7plxUkHLDORAiB965lMVyYMbz+JkMaRlL55CPCt9v1aGGAeQbYzFQOidQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":393946,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfBf9XCRA9TVsSAnZWagAAeTkP/RycHQizSi9P0HbhdTx5\n5D+S6/dQlhVzIfFZlgIQzjpZF+fsZH4EEDqzFdyd4sWT20QraaORgfwrUEjA\njUmkwWFSKRBGOQzhT1vL9gNVZSOGf4c/xInrEJw2VlIDnFbeT3Ra6fHP1KM3\nNwPuvGDSJxUja1IbR2wxLZr7euj9RlVqel9i3T40YV2cxxnCIOeuScZ/t07m\nUIWQspGD1DTsWBUGMOJ7i6kgPmCL1a7bkehuv/pb6quvKmxtl0dVd5EJCuic\nB+qcfAYPzyYKV0QmkgercSAj2TbRs7+peyq0G17oUZKnQvTeL/lU0bkRNPN8\nEWzu5u5OmBxv/JeEkF00HwC1/dT0hBo3FPzr2/YExfop3t4Ur1fLtkA/iMOL\nFyIZsbolvDxlKP+62m4iimcqIZi1z7wQA2E7XlX7ut8VDNVI18/o3boI7Db5\n3DxSsdHkgvmads5Uk10RlQRzpWzfWVoNLwOjeEZTlmxMHAkeLLhxMWdI8ug6\nvOAquQOG+ilZ/U+o3mHmRllD8aTPXsEM6yYXVne/mNUEJGineT7OigAscDbW\nUExKOLexhNb9AWmY3HObdkdpTXgJziXmk9hvRTifL7FrIG7zSLHY88oCzqO8\nF+1eoe3FE7lMJbxMwCzqBndljhXs8Bw/eJLYRaAX6cWgFVb7WGR1BAmSXeo0\nmY/7\r\n=HvTk\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"d1a1abefb8800a6dcc0cb20f74923403ee1ca66d","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.21.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.811fc5d24.0","@material/rtl":"8.0.0-canary.811fc5d24.0","@material/base":"8.0.0-canary.811fc5d24.0","@material/theme":"8.0.0-canary.811fc5d24.0","@material/animation":"8.0.0-canary.811fc5d24.0","@material/typography":"8.0.0-canary.811fc5d24.0","@material/feature-targeting":"8.0.0-canary.811fc5d24.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_8.0.0-canary.811fc5d24.0_1594228566704_0.27303369001767397","host":"s3://npm-registry-packages"}},"8.0.0-canary.6ed717ddd.0":{"name":"@material/slider","version":"8.0.0-canary.6ed717ddd.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@8.0.0-canary.6ed717ddd.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"eaaad23d2c663214ecd4a2d842db483558463eda","tarball":"https://registry.npmjs.org/@material/slider/-/slider-8.0.0-canary.6ed717ddd.0.tgz","fileCount":36,"integrity":"sha512-dPiG/b5Y+dZNhYYkYxXEeV8hqw5v9oqTPVueRdLVYmd338IgroJcW0N+ig3je/CyVbmykNhSrQxiWh34DQDOJA==","signatures":[{"sig":"MEQCIFj5zQZiAhX2ulPiIlxmMxp47NwLjzFphP/qVhWxbOtJAiBZn73wsAEUzcxSxhTclQTdViO/iXp12x36NN23oRKpTw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":393946,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfBiIWCRA9TVsSAnZWagAAbxUP/Rn93A0N7WTr/22QVWu5\neMRXX+OaewlqddaizXvKqXgJo5QWP/Ti07fNKQjA3o82RALPypSSZdSiv0Xi\nt0jluMWerxpu6H2fHJDI8PLq77QPWIIna8RcZgnc+PfUwesi8ToQ5Ased93i\nmRJPEckyukRogAQO+ZvGCLJ2b7/gOrq1AovNJ2aur2Cy7F6RZ9k/Q2UJNAPN\nfYrMmDoDFY7kJxDFbYmw1nPS/iD2KgtqDLQCHMehQ40pUaKhgxVaPbmbgFVB\nxzu1fVkZ50DrwOtAsxsUGbSxWMAc3ePGplZA+0BovVWFea/NhtkTZCmLh9fY\n/G6W5YQG+kkp4NwYIO9F8BO3pJbV3bBJpa1W3RxLqneXtzZiZl1PvEsXbKKs\nDbHCOZiAOIzkvd7CBS47I7DRRcS80ZOr0391nO6Oj/n9Eupv/4lA3HWgf0iO\nKbg++HTnt+FqcmUdJohNRJEFF288UUAtM2RS6CLUs1VlOhg3JUgp9/Hf5mTZ\n4SDs3IrVd89Qxzy6u3knEkDBVL7amyXcu6sVNiDhVYJSDKrgqkzCpp8SkOAX\nx5akSpHolhT1FoyIpZVFx3ihL+qRcRDuQ1bVbu+S32GWnwo+UWmIi2PjGmJ3\nkL63Jt4KSw1MMl0WP0qXpuHcul6RFgJAaQl4MksaFIm8ZMMo5NLgPZgMUhVi\nA1Q3\r\n=IDTE\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"7c9c6df731e0edf42938b11082973eba27e870e6","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.21.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.6ed717ddd.0","@material/rtl":"8.0.0-canary.6ed717ddd.0","@material/base":"8.0.0-canary.6ed717ddd.0","@material/theme":"8.0.0-canary.6ed717ddd.0","@material/animation":"8.0.0-canary.6ed717ddd.0","@material/typography":"8.0.0-canary.6ed717ddd.0","@material/feature-targeting":"8.0.0-canary.6ed717ddd.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_8.0.0-canary.6ed717ddd.0_1594237462432_0.1864524733304993","host":"s3://npm-registry-packages"}},"8.0.0-canary.d850de590.0":{"name":"@material/slider","version":"8.0.0-canary.d850de590.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@8.0.0-canary.d850de590.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"eb5a00262db96f4fd1bcde5b4439a836f9aa98c4","tarball":"https://registry.npmjs.org/@material/slider/-/slider-8.0.0-canary.d850de590.0.tgz","fileCount":36,"integrity":"sha512-DcTexEJqMVSaFE3yGY4jPlf6+lmimt+VAJeXIwL9WIah5B1Vuigkselkt5TRkxt47uMZ4meWYswfsBC844VzIQ==","signatures":[{"sig":"MEUCIFP456CzdBerlAVjd1vbXgVcbAKfmIrgiGrMiVo0NBQzAiEA/wuHB78u8J8gSmHETL7yWwsVt/GCT4vgNxdEUdvd/n8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":393946,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfB1x1CRA9TVsSAnZWagAA+64P/3u6fQa7uZQ8jfjLqDN9\n73OeK3mB9XsSIx+7kbOWfpZg6JTdnCNjDF7qUlKpRGSKe5aa49whYWBlFDaz\nyKIRNTkYFdjKWxB6kR4Qi9uEa9pDxVISs7INn0xrcRd5Kl1+2PCI8nTmlzfB\nhQYQt6nWZjao4P6RMfm356u5aHKuGnAGB/6YMzbMc6sZ6tPu10ZFSKytJInG\nJKU55jn5R1WEn9u80eHtPWm/LhlIyY1P7+cbc6I/o1xJIrwGg6EFLf3YNK42\niG5bia/MKyPXUP+STBJMgv2EwEWqsTW0rD1LwqX4n0aEJEY946dp4PqyezA/\nKtrtB3jFSJdWbLy40KZZnAi6B52T9bWAoY2n4ZIocD5cfbukvQvEvLihAbCx\nJCp/X/bwJZNR/IVV8/V4s0GMLNUgh5kXwmK1GXmMIYPTS/eHbPvi7utAjB0Q\neccV7lFOKLhX+wqspRiYwnH+/3+EViJc2+DvXs42NPID8UcBMZBk6E7yNA7f\no5b++Udkm17HrGliM2/JZ0TPln1n6n9RzinSL2lNIUNF2lmUeH8t8YuRGoXz\n1Iv6P8rnYkcDRiVgEoiBQZLA1qxjmcGmVzh272a3iJF7G44TLMs0Qdl5qHn7\nl7n742Gnxw5lEB1hixWPJbxmuPNP7S8xRDNDj5ENHv9C3TkLTK2xwsZwV4AQ\nbT8p\r\n=umiL\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"85039ad97bde95db4d57918266320d54c581a680","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.21.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.d850de590.0","@material/rtl":"8.0.0-canary.d850de590.0","@material/base":"8.0.0-canary.d850de590.0","@material/theme":"8.0.0-canary.d850de590.0","@material/animation":"8.0.0-canary.d850de590.0","@material/typography":"8.0.0-canary.d850de590.0","@material/feature-targeting":"8.0.0-canary.d850de590.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_8.0.0-canary.d850de590.0_1594317940229_0.5506747575613444","host":"s3://npm-registry-packages"}},"8.0.0-canary.e07a70841.0":{"name":"@material/slider","version":"8.0.0-canary.e07a70841.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@8.0.0-canary.e07a70841.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"332e979468a377541b80a75d8208f49136ec5e29","tarball":"https://registry.npmjs.org/@material/slider/-/slider-8.0.0-canary.e07a70841.0.tgz","fileCount":36,"integrity":"sha512-QhsuNAkhXB/IZHEQziMQVRMeh8bKnIiVL0wdJ0EjBxAd8NGID5RY8btb6NNIRv6cDOOiLhjNvtLNZYAP19dsEA==","signatures":[{"sig":"MEUCIBWR16G9/ByiCX5eEI2J6fdMo/ML5NQJhIGyXw8bXYsoAiEArvmfmpuGDWHfs3tTOeF9S13D60h+UZeJkiBlrSHP2E0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":393946,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfB2NwCRA9TVsSAnZWagAAbzMP/iHrK3ngYnTTLSpWFnRU\njXZTTnJyU2JNR8kHle9jxTBlJA8MwJoKwQRPPNYBJ+1Jy0/decmz//T4qQaZ\ncr3FX1pbCjPJtJXwvtSZVQEKU1jphnanyX2pPzoiJ+kpF3srmXISWtHtrKJK\ndIpM4y9FRNAJSD1mgJpEqGl2gsUKE/HL4xzD+t8nNOyTTmVHUoZs3EbUUkwh\n0KfiwpLgifZodpBpY7vFuiqje1KX6z+2gaVz0jXSCOgLcI5fJLE6J2oN8ZUo\nfHtl1StjRSdXn8Cyxq8hK1YrTSnmmewLKK6gvg1rZq7gwhStykmZnmEoAMt8\nAbrvilvA18h3W4pifcQuYpfhFKuySpzad59BITUcKQ/CtABHu7wMFjT+YouJ\n0AwtNMKt41IM/8PH15bcienCANb+UKiYfsdDZSxS53K3Pa32s+T8ChsABhNe\nGeCNIDTnVcLhdfrhwl2QbGQaMV8qROk/lSrcoaNMzsuhekJRhuphfhSH9zVG\naDQXVcQmxY5bls4TD96fHJYKHt9X4ww45b+XMp22kcVfWe7KGStbmLqg+uQK\nUOrDE2Z1Uf/wH1QsViXAiJ4kAso7ojmhxbEaU1LTK3gUbmaIvYE0iHtJ33cm\n+zhMirxOH6wBRGYNwFwhu3dH83KBPldHIEdqv+xY5jFzPr/6+6eBJnun4OJ0\nl7XJ\r\n=vmYA\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"105e9fd32899b2c9a4309baf6e879287104cc0e9","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.21.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.e07a70841.0","@material/rtl":"8.0.0-canary.e07a70841.0","@material/base":"8.0.0-canary.e07a70841.0","@material/theme":"8.0.0-canary.e07a70841.0","@material/animation":"8.0.0-canary.e07a70841.0","@material/typography":"8.0.0-canary.e07a70841.0","@material/feature-targeting":"8.0.0-canary.e07a70841.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_8.0.0-canary.e07a70841.0_1594319728124_0.9354270501328397","host":"s3://npm-registry-packages"}},"8.0.0-canary.37947ed6c.0":{"name":"@material/slider","version":"8.0.0-canary.37947ed6c.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@8.0.0-canary.37947ed6c.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"d6ec05fde985f9cb04ba1a3f9c3a5a084389739e","tarball":"https://registry.npmjs.org/@material/slider/-/slider-8.0.0-canary.37947ed6c.0.tgz","fileCount":36,"integrity":"sha512-lnuf+ve0De8wUhTqP2rKBb89YWrtygO3msvV1+ct9VRKx4Rpg3OCu5NQbMRQunOxN/XhstYqzeh9O+Dk2jGbNQ==","signatures":[{"sig":"MEQCIByy0S+ujDV62LHJQDnSoRhNEnsKPppbx7HXhG0s8vVNAiAuE59b9QelNsiT536DWuthI5hGzCO/1Zr/MI9RVECM8g==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":393946,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfB3/iCRA9TVsSAnZWagAA8eQQAJfGfrapyp9d5jYgJbpx\nJ1HbhMj8MPOv+4ENP9SvzF/akegGrxhjDDS0mOqybeSKXlUCQgw5dnRqpXaQ\nyPryK37UordxnWG31KEVILKdsbQAjrPSmQIxsijk2bWXlRPG7h75snA85WSU\nB1it0zpgYsGtYgKKrWV5ijI5jTIMaoNRTtToWKb/pIGQ8sErdOnIqmHRyOgB\nm/rVfEvlinrUqOsonMeH/EzbXnYJOBODraCUfDBO1KcpcyG2urdutCYkUKJe\nlhdLfauD6llioSsYFh89rHqeuhExiNc+BFNf4hsaR6obusyPG+mT9KJFvgUn\neOfRTTlkpjdch6PzZ9KRpFmXGI40D4W20WoeR3zJpI1Lt3qzBjBrqkm7fo/k\nVGKw2+sS+JJukqJrvRArHmTLF6mJuwfiUSrHTPUfgNzj/xsSPwuWvvA/E2XA\npb34bVU9+TFmbDFjzAbk61u+yPBwBgMPjs/e6aE+50v6bvmX2AgJ+LvaO442\nVx1StduaIJ/GFYd9z66qOk4OudxsFqCn03qRJcjTyVNmpfjElhp7jHKGoJbs\nA0QsrwUt+1CtF+W7JXbnDgQ27SBCf0yNaxEPX52KeDLNX3PL2P7rw9tOJhRv\nqLAALdknXdRNrjKnnaMGT0R8tQAeZxt1tDTMGWAmn/QInpVIQGv2+GhRQln6\nnZaH\r\n=0lRZ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"80c4a00e688d5a2b1a35ee55744d879b782effed","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.21.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.37947ed6c.0","@material/rtl":"8.0.0-canary.37947ed6c.0","@material/base":"8.0.0-canary.37947ed6c.0","@material/theme":"8.0.0-canary.37947ed6c.0","@material/animation":"8.0.0-canary.37947ed6c.0","@material/typography":"8.0.0-canary.37947ed6c.0","@material/feature-targeting":"8.0.0-canary.37947ed6c.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_8.0.0-canary.37947ed6c.0_1594327009602_0.8126974251443537","host":"s3://npm-registry-packages"}},"8.0.0-canary.5d443afec.0":{"name":"@material/slider","version":"8.0.0-canary.5d443afec.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@8.0.0-canary.5d443afec.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"d989f0fc265720470a0816b2e666caceaca89b37","tarball":"https://registry.npmjs.org/@material/slider/-/slider-8.0.0-canary.5d443afec.0.tgz","fileCount":36,"integrity":"sha512-+NuoZTw3gKt2n6cR9Z2AF1bifC+zzpzxANQQVO6AYpDgrCTX1Yo3vNglZcrmmh1nrY0AqY0OBrtK395N6BFAjA==","signatures":[{"sig":"MEYCIQDGyha8E4zzAl/3uTMR4DkAovwfnRhAvrFzlc56zF1T9wIhANVa56jIB2sA/I80V5D9S/vt1JC5AfIWO9dQ61b+xUTd","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":393946,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfB4NxCRA9TVsSAnZWagAAY0oP/0/76FxVjyslgoe4tvpz\nhOna2G/GoybOiuzAaZu/Vmu02fcYWQDfpOW87dfT7o/76SPe9dLFPQaz2Jcu\nIatK8uCpUlZubP2P7Ut15/5beGJRvKBi2pt/cazPG7mEGUUVTaUYATkehNRF\n8SkjaXrKTaqnOEXYaG+UyKl4mLUbka2T5ajHDmHuVxFJkqiFl/wMDgjmBB7D\nChgpU7qX940bH9KAJddASvGI0+pl1/TGGKZYBldZRn1urfPlI4BHQd591H1L\nvpJgCoTizC/fa0BRoBktPFEc0u44IjOXm5EQyyif8tCtMTkv8XEmbOj7/Jyh\nY4w6f2wXVcFw764h6g0Iuanp5CDBZoW+a4MVOJwxf/Ot3/Ou+3mQxtCvn4K8\ncOA9MP+aLZWzhL0Mu8HzaKWsATsGe8XEFjziuypgnVmV9vYerSM9AJ+AdSTy\nPt2yuKDhgQIIi5PQdQsuuMmZsEGuvPp6b+qIU248qf2k3PUQIxggN5ZvyLIZ\n7U9xPypPoMQBFoucL86a1yqKCNcIv4AhNOKrOjJ/kjvTIQOL61PZMI+6kSWe\n2yBrrnV/fdOwOvRoEQyGWzmlEkEospVG48vMmWDL3sXJ70yqCzwqGm4VRgIF\nJpFHWBSQmw3Whzhcqo/+vCz2104egIKfxLgpTAtW42dZS054B1een3vDK2Hj\nNmbt\r\n=J7QH\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"5c493d15f89898617c3127c53145bc51e8e60930","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.21.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.5d443afec.0","@material/rtl":"8.0.0-canary.5d443afec.0","@material/base":"8.0.0-canary.5d443afec.0","@material/theme":"8.0.0-canary.5d443afec.0","@material/animation":"8.0.0-canary.5d443afec.0","@material/typography":"8.0.0-canary.5d443afec.0","@material/feature-targeting":"8.0.0-canary.5d443afec.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_8.0.0-canary.5d443afec.0_1594327920813_0.30856969733500694","host":"s3://npm-registry-packages"}},"8.0.0-canary.9ac1ed914.0":{"name":"@material/slider","version":"8.0.0-canary.9ac1ed914.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@8.0.0-canary.9ac1ed914.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"9a9bf44dda7218d7b072e68d913e32ba83bd5616","tarball":"https://registry.npmjs.org/@material/slider/-/slider-8.0.0-canary.9ac1ed914.0.tgz","fileCount":36,"integrity":"sha512-vgh8NFxOus9XfuagYn2+Js3b+ULwzidcZUdu1djLcImnVQpVZkUAjrqZXYnV2puzOxebe1XlihrTW2hjPClDQw==","signatures":[{"sig":"MEUCIA03RxW5CjfpBvOm9ULG+RgCENGuDAIVAdFZIs5BgHPuAiEAsyHanTO9pJZCMVlkreK651hBd3CGDzwAeSAmLR0M5j8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":393946,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfB4o0CRA9TVsSAnZWagAA1ZIP/0sb8d/X/zK0QyDO4FBH\nY2FIDzZT1Q24xWkCFyKrgtlwDe7uC8RjuAnAFFMGtG9S/CCJKPnIyRcci7Gl\n2YwcGfCALgaeT6WXuwqw9DMUJpCQTgY+M3i4xRE4TptZgYtj2UUrFWlnMfhB\n3OLHtTGSiZFEa8VgrYCzn9p2/NfD0Gs9xJ7zn2B/BzVZktT+QWfKpp7fqrKp\nL0jdQZfKCjlyRuu39RfXoIXGaAnI2/snY2q4F9+lF2eAIgefYJoZ2wQEO6DW\nrDMqicta9XCEnInY9q2WSduViIId08cFktTQIkkTttdFrZNQtVXwY1X5jfhP\n1hLli6zQ7nlaEmoyUYMSSvbH1A+1LUnrJEtL4mFg6T/9XKiV7BC3IffJ87kC\njcasGKPOfM2ACHQgJ8CRejJW1Rzdn19kzC6HferBiJSIlGMnO7Y6DvvTGVhW\na47lsNlz/Q/fErFDmy+tcmfK42MZn7Rkls2Nmgl15MFNItAKnUFxbm7w+TWX\nzAd79XFp35HNGz/IXOkzB9/IBQyrp37wNKth/wzJgPUj8ztyvs6NrxUU9guk\nsjw0WeyCl4ThO6GFSLgAVa5PMqAY6BvSRsonYsm6X7ABdSt4+Mn4owLT+dAR\ne15Solo3/fQLNsX0qwIvtZkROFgGpvDg/5x9OYIHDEy4S/dQ4BL8LI7CpWSX\nMKc2\r\n=JJN6\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"c08d3c600bb022db1bcb4efe520bed724e653a77","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.21.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.9ac1ed914.0","@material/rtl":"8.0.0-canary.9ac1ed914.0","@material/base":"8.0.0-canary.9ac1ed914.0","@material/theme":"8.0.0-canary.9ac1ed914.0","@material/animation":"8.0.0-canary.9ac1ed914.0","@material/typography":"8.0.0-canary.9ac1ed914.0","@material/feature-targeting":"8.0.0-canary.9ac1ed914.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_8.0.0-canary.9ac1ed914.0_1594329651764_0.4539478040600151","host":"s3://npm-registry-packages"}},"8.0.0-canary.1e7cb6198.0":{"name":"@material/slider","version":"8.0.0-canary.1e7cb6198.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@8.0.0-canary.1e7cb6198.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"8e521730f3852b2a1391c0345338107af9ffea16","tarball":"https://registry.npmjs.org/@material/slider/-/slider-8.0.0-canary.1e7cb6198.0.tgz","fileCount":36,"integrity":"sha512-wats0Nro9BjTcmA5KDrm8W2WScAh6Y3zMQTmshYU3LyFW32OwHiJZmPmG0iUd6dP3LLmqVhoNXWnJHAsiSlt3Q==","signatures":[{"sig":"MEUCIEKuFm+tK0lzjole4TidKGUiR7yyZpkid9206UOwvaCpAiEAh/AgKOr71JZoTVlYHqYiZguv4zgSsbUouU/s9PxYwp0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":393946,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfB5ZZCRA9TVsSAnZWagAAqeYQAIjntcD99ZdYTad9DR/2\npcvv/Yrz+UT3Ayvc9kmKlUF9MEUXI39w1IhamBtHAQKP0j/Hr7Itn6HE5QMj\nJa9K545XcLpDbUpQBH6tdRFXlsJBSMW2rmcAxVPg8w0Di6AF0A8pRLbBLO8J\ngOTyLTTpNNzZvdR8TrhxdXoaL85TJ0IDkd0ozi63jAPAk3bzl2bl6fbQJ8z0\nNGMcz5sVQOZGVRq7B9PUJKCu077PSIuUDoEkVc+FXwCGnRkpeCzaDCP3AKHG\nA5lgnvfX2UO1h9lHw6E2FGP6xTei6CCA37onH6RvYw2AGvYRvQ9hePlpovYd\nX5kjRHiTQuZMFg5znhy2+FhKa+fdhVG70gQ3Zm9Hr5bBfvzg015RGvXdss11\n/nF0TZBvdPaCflNppdGN8tqNywqSyiDR+VsjwSYag9lajMUaKP0jqEtd2kex\nqJ8upcFnZ0pugopNwnpFcr1Ia+/JeGHv+efzo0fNas9FJwwkRyxpOufhHtfr\ntkYZBq9apdlxkPlkI1L3BUTpjQLHorjtTf9X5GNsunhAKVwCKjqr3BnKI94F\nMgNLA1BLO4p7PhDSI/o+JFFNDAkp3UGFoGoDpUa5IjTUZWVPjojE7mEsb1yb\ne4R4tfx8X4Qv7StcdyqdM4VrihbF5wMWFRkhGN3hJe9FOsoNzudcUXQU2vy1\nBaMM\r\n=4VFo\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"cbdbb55d01ed2f63aeafe8d77fffd1da5fcfc011","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.21.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.1e7cb6198.0","@material/rtl":"8.0.0-canary.1e7cb6198.0","@material/base":"8.0.0-canary.1e7cb6198.0","@material/theme":"8.0.0-canary.1e7cb6198.0","@material/animation":"8.0.0-canary.1e7cb6198.0","@material/typography":"8.0.0-canary.1e7cb6198.0","@material/feature-targeting":"8.0.0-canary.1e7cb6198.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_8.0.0-canary.1e7cb6198.0_1594332761167_0.4596057134477254","host":"s3://npm-registry-packages"}},"8.0.0-canary.843f636c0.0":{"name":"@material/slider","version":"8.0.0-canary.843f636c0.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@8.0.0-canary.843f636c0.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"47ebc465e7231ce16e5155d324fcb04394a9c1fe","tarball":"https://registry.npmjs.org/@material/slider/-/slider-8.0.0-canary.843f636c0.0.tgz","fileCount":36,"integrity":"sha512-sXvneaOS7d2xfz8frR9CEVRCkf2qu2PPrXWI+JxT7yomFczvQTnkQ7J8aoW+QSyFcucI0v11Xa0t80NTu4NCeg==","signatures":[{"sig":"MEQCIHQNf9tcBjrRX5rJB/svCnt6+C5DzNZXsVv5DCiE6yzjAiB0X9TMc9g8a+Vi4/MjedZyqTLAoTXi0fKzvrabLa5E5w==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":393946,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfCKijCRA9TVsSAnZWagAAcNgP/RfUwWwg9UEoPQYryMe9\nHv2THWW+W0JZ80RTS0OwnxP5UwsYIraqcLTz52TantKmV7aF4Upn/wL5OSSo\nzmvmZ7pAwfbOTu/JKBDs9GchsAwWofjsWE1QHjk59gUG8IlmhgQeoZrfIBUi\ntsUoie0hAvSw3kDx/5NHYHLBHQ6ELyXuwjaBn8PgUb5eXDOjR3cxinPysE64\n/A7rv6joS45Nhf4eD1FchgLNXIuh9y4gGFYTl9EOmkA21odHZVBdq117SQsZ\nIBPJSi9yxNhLNubcIZz6OVkHkK/TuCVOmhw5pUFJ0aiA5BhC7Q2jMhlziAYT\nCNlrdmNXNR5oF5BPbElZDe5QGQ1y0NMGJcIyQMZTwk5PfrZ4wIeEStn7zhZU\nxlHI7Ls8g/FqCuVbNyL6FoYpOtnm/vKwJCZbZhTBN5DPQEQ8fiOzBpuwAsrq\nwJ0YfTMyJY/+T6ntukvgZi59GDk1o9pEs6yMhSwmJRyMGHJL/GF6yZP6cKMb\nr8B4sHEXZj+F+y/XK1OR7kbuNwp7D9UjH1OOcjy1tYpJ5SqNqjaGdDWGgsmU\nz2XEc6pSO7VDG6W4SQPKipzLMT0VZXdD4Zgs30j3jNEa4T4RvvIjs1jUdERE\nkN5jl7JWvAXoaw10OYGn6xmLhg/4/z7SJ7NDI38XINaUrv9fZTifK/+LTg/v\nVVUb\r\n=p+Ss\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"641b40da40cd73b439cefa7fa18c86bfdf31e497","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.21.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.843f636c0.0","@material/rtl":"8.0.0-canary.843f636c0.0","@material/base":"8.0.0-canary.843f636c0.0","@material/theme":"8.0.0-canary.843f636c0.0","@material/animation":"8.0.0-canary.843f636c0.0","@material/typography":"8.0.0-canary.843f636c0.0","@material/feature-targeting":"8.0.0-canary.843f636c0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_8.0.0-canary.843f636c0.0_1594402979054_0.3675582630302505","host":"s3://npm-registry-packages"}},"8.0.0-canary.b2edaeead.0":{"name":"@material/slider","version":"8.0.0-canary.b2edaeead.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@8.0.0-canary.b2edaeead.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"af6f4b1c3db85827424540111ad36ada244449be","tarball":"https://registry.npmjs.org/@material/slider/-/slider-8.0.0-canary.b2edaeead.0.tgz","fileCount":36,"integrity":"sha512-zR0AZdhWnCQoLi4AQ+UcW3QD0wwO6mWJO5aSDwOxPzKz20QmNNA7eOCLTzfg0ZfIh44yBtyaCWWWJi8nDEhCdQ==","signatures":[{"sig":"MEQCIAh6LB1yQTmTVHvr5f7kYEHPoxbgLdCfo5vy6stKmypcAiApp1QpDHvwsBsmd2l6qbXvQhUL0kbk5yHoytgA7+1tqA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":393946,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfCK5gCRA9TVsSAnZWagAAOtUP/0ymLVKBhxL/Tl7Tu4hY\nFOum1rqPUGZpvs2hIGm3oKMF8P3FVzvGbjLX8yM2T9Wbns6rcAaxzaJJJ5nb\neAk0DamYF2ixzJ9Kqd0SpTOyC5y+Mx+66TY6UWXGjGrxJffRt9Ot2KGOIflV\ngZxaFCdqjujCsaKTjoRDYZuHgKD+hU+XylwSF+gRtXEPyIyxWl4FlIrRmbxI\n3bJpaCltYxfprgf0qB8YOYxBDyzvjYi4seI3l9yYv6zPL0rbtZ/l8nx2XwP9\nr2VyUTAOPdW/nNOGrU4fiDHrLX276cZXjN8StgLu6Y0pfDlfev8YGhaMYhSN\nxSp7PrVEvklolMz2N3IKEKCuVdDtveVS4UlUaJFBMpSgy9G3opgmDAkUWt9j\nAfDNJrEzYvp5lP/YXPJ2ojNivlcTGbGHY2gip0lEHZOBMAm1UqvJiqSwTzu8\nruzOsidd9C74UM1TiDTwsGgQH8PQLDmQZUIJUF3mAzGN3pjLsMpeYQGc8nye\nCTdgh0Vh37Nr+/B37mCfCqQTRIqmZssbpC2RYh8CcpQZmhJrbpB6e+c+edhN\n8iRVSrrncb5RXDcjcME2WQGOLGoB8RJFm+nI23x6r1SXL2qKwTErVX3Dk3rH\n0WqupBlWwdzldHDhw1Q0/uPfXvA/Rl3gaceBETl6UDWRR2WLutcmvC9kMNxX\nhhtW\r\n=4y5b\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"874d83aed6fef221001b68d44bfceb30072cc18c","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.21.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.b2edaeead.0","@material/rtl":"8.0.0-canary.b2edaeead.0","@material/base":"8.0.0-canary.b2edaeead.0","@material/theme":"8.0.0-canary.b2edaeead.0","@material/animation":"8.0.0-canary.b2edaeead.0","@material/typography":"8.0.0-canary.b2edaeead.0","@material/feature-targeting":"8.0.0-canary.b2edaeead.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_8.0.0-canary.b2edaeead.0_1594404448317_0.1446832195187009","host":"s3://npm-registry-packages"}},"8.0.0-canary.5dac1f624.0":{"name":"@material/slider","version":"8.0.0-canary.5dac1f624.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@8.0.0-canary.5dac1f624.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"2e5bccc2787a5716cd6d65d5a9933a5ff4e169ee","tarball":"https://registry.npmjs.org/@material/slider/-/slider-8.0.0-canary.5dac1f624.0.tgz","fileCount":36,"integrity":"sha512-YJEUscwLzOA5byWthSMZwPavsMz904V6WjG2riG9lMPnbb0n+mi+9u1xAkI0vB0ZAclJ4mjO5x2RdZTG5FZJfw==","signatures":[{"sig":"MEUCIBTVnSXpwMgNkcAZ1HuMYtExmKdXcjxWKMxI6oxNkqccAiEAreUwCmRkpmPzTAJjvDbU+9jlNZSye4LzQx76wGuzaFQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":393946,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfDI0XCRA9TVsSAnZWagAAdmkP/ik4vbGHPQlJIav4c3FO\nHsFZ8nCzOlORBNFnDHP3BsSExwhZKWLQPNseecd2+aI2oeZJszn06LYwzFq6\nO89+/jYADV6r/mJNE+4msr/jSTL2uVcfNNz6MH+25VCsYzsz4Wc4JLWfl4BC\n1TOw1I7k4ptL8gchH52kfsyHyKXA/92+FsQpPCU9qXOXoTdBV1winC/lZFOA\nrs/AFXorb0aVU9sUpk/SEdlh2+FnOHFjXvsZFnr8Pu8VNCAYbMxTJROF/MFJ\n3ixI2pJLPzXFgYUnBKrmcKgay6TjX8xDJRq5a9hb1LYNndTHizetzTdr2hVp\nxl0h+EiPl71r79dKc2nKxB8orI/gTVzBPZD2sl3MbcJcUraT6QzBZoTotILQ\n1aPDykK9g05WCdHQUZWFtq5Ldg3K2FMbm7VmsLQjKXkWGIrKz4edxkxGnszX\ndunO+6cAJ0x0mTRkns2VOJgSxmLYN10MxAHpE2uoWem+gtAe7MjGvnNprB57\nzVIjvq8Ys09EK1FksHUnpOZ7dc8sl5QFVJnBn6jDlVjZvfN4KNx3IUV7wskJ\nZ/RrnkKKceE5ZFFmGs9eQ2CKw4JhdFzca1fg/aPrAFrOFbou6kenqv4U1eFl\nvYDgII+6L6PsNHo/NnHTnDS4NAFMM+i8moKRmuNXddhXEWv8AHlIR/14j78Z\nKmTv\r\n=RCGc\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"3acf16b30fe876c0d319f5d1681d177bd0089cbd","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.21.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.5dac1f624.0","@material/rtl":"8.0.0-canary.5dac1f624.0","@material/base":"8.0.0-canary.5dac1f624.0","@material/theme":"8.0.0-canary.5dac1f624.0","@material/animation":"8.0.0-canary.5dac1f624.0","@material/typography":"8.0.0-canary.5dac1f624.0","@material/feature-targeting":"8.0.0-canary.5dac1f624.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_8.0.0-canary.5dac1f624.0_1594658071325_0.9804460791840075","host":"s3://npm-registry-packages"}},"8.0.0-canary.4497acef8.0":{"name":"@material/slider","version":"8.0.0-canary.4497acef8.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@8.0.0-canary.4497acef8.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"a3c8d5dd02effc17d19b50812299507da6b73b0b","tarball":"https://registry.npmjs.org/@material/slider/-/slider-8.0.0-canary.4497acef8.0.tgz","fileCount":36,"integrity":"sha512-QSveZKjey8VRrpxdp1D8uBUqCDfheC39QAdzY1+PEdrLc3Hxk5PHt4XsNg6HSU3ivy3b9OcKzSLJC1vb//X7rQ==","signatures":[{"sig":"MEUCIGBNjHAXvHtP7Yf+jIhdX7WFkWITYEx8fBeoJsoYn053AiEAvwBLQymBDDMiz5vwWBHKrymJDLm9RW0qKpQmjrpe8ks=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":393946,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfDb8qCRA9TVsSAnZWagAAQd0P/1kh9VX8DZa8g1lR1zPV\nDYJdlvxOHN2yi7i1VGgoxriKBMJKiMxUzKqlpDgfXHRk/bOcaB+EHZlkjSE2\nXUHlh/RGkLwzwpdwFy9qerntRTEJsAWq0CoM50HYDbXlppjZNVx78IpsKHez\nsRKgXm9fURPw/VU+JmpUDOuFenxkbuy7LiVX6f9PgJiEjEC7GCcvL1Eac3FR\nULKBMv/sjY1a+hDasjQqrARS5kdGarjnX7E+JtK1EvyynIyLqwtVFIlkqfYQ\nAJD62kg0jBF4rwNkwx/10lWDr4lMjNV8Lk9hFkyqwMwZ8/WtgIMshanyS0BC\nBwTOt43R5KQouYBDK/wvBLLtAxuK9mBGhqF9VjKlvo2dB4+GJ89D47VGcdxh\nr3MUed8NLZqRAZuTCK9ELS54XPlTLRJtv1cdhztpRwHZ8O01qCiLGDgZYw9C\n0c5+QbocnE1Dj8fiQkwVHAUxNTqAixxABA70weSNuNGK/9KEexSVJo/7RsA2\n1p3SY8GDO2Yravwl4AJoempw2Z/KRL3+NnKudzJxCU0r91BymmfRA+BwOlyP\nQjPBblGLkgQ1meB6ngPr9z+mVHZsquQ8kJJ9eul/CQz8RjWRcsH+X6BGclNb\nbAWv3LFo+nky4v7wzDaHqrHWVhi8AVpfrnbdfHDjrg0PLfPY0Tb5eVCMlh9Y\nCLRF\r\n=6f14\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"dc90b63c1737c63427815af4f6de59841a57a1bb","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.21.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.4497acef8.0","@material/rtl":"8.0.0-canary.4497acef8.0","@material/base":"8.0.0-canary.4497acef8.0","@material/theme":"8.0.0-canary.4497acef8.0","@material/animation":"8.0.0-canary.4497acef8.0","@material/typography":"8.0.0-canary.4497acef8.0","@material/feature-targeting":"8.0.0-canary.4497acef8.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_8.0.0-canary.4497acef8.0_1594736425669_0.8210704047897845","host":"s3://npm-registry-packages"}},"8.0.0-canary.e6e23019d.0":{"name":"@material/slider","version":"8.0.0-canary.e6e23019d.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@8.0.0-canary.e6e23019d.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"fb7a4d9472fe5e5317d998bfffc4a8585e2e5804","tarball":"https://registry.npmjs.org/@material/slider/-/slider-8.0.0-canary.e6e23019d.0.tgz","fileCount":36,"integrity":"sha512-BZBCyDaZSD232AIj/q8TOQzzRQ7JDt9E6ytbDO4XG6MuDP+bTcYL4pTvQONHxbYMfZia6n8ohPqt+T2kGZktCg==","signatures":[{"sig":"MEUCIDDIvorFehn7lSj7G5bK/07Mvu2ybWgzVptlWU2xmtAUAiEAkG3xumi5/jbV91X6RG682Xt1TJf1Irvr51cKrNq5NhE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":393946,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfDhFHCRA9TVsSAnZWagAAfYoP/jlG/X8tdfS/rSILZtTP\nV55foYhEdN/cXW5YJqhytJst0A/1Xi4fN+vud/rIRCjzA1XiqM64Xc9x9jXj\n8KesDHBVN1pqqFOo2J63+Mj/C6UCWs6Tx0XUT4xPf2psvCfUVFIlHBaLxM5r\nlMldQtZeGGaYB0fUyRSVjo5/3WtSHDxAJNBa20AU5/FwPWye3WCkJKGCK8Dt\nl6PBRaHuFiTom/1tdfqFGCi0XCtiLCpJt4fIUZatyLnW9+DfX4OldMWH4W+y\nqteoePLLYngjIdB+u9cfiRXVaeU9udCoGAgndJXIC73osMiIXbKk3TsCoJ9W\nUkYgXSyoVQ1BP+MIpSIbgberjNU3UiMFAp9X6ss2PLUbRVBmrugU6USiHbtn\n8KFsV5Kr+I8aeodn6weflr7yKWGCSklGv+k/e0jhCdhzrcpeJk8tyOYwURKm\n82r+ghpsyzsqmdWxITcrdX2dvDuaypCWl1M0P0SJWxUjS1nOcDGLsiNmJTwz\naxcVZitdbIxZD8eHSx0MYAKwgkTO+H9cHdNq1tXgn2a6J0C1zEQ9tdcf07d7\nrWHlk+xkxB146Mt6LuTLIPx+4Rp4nZpJg/Lr/XMxB9bhEtHBN34acl9aWiXZ\nDWfvon3XVht5ANsX88Ejd6X4k22cAVQV71u/nYBjGwVLSu0Zsa2qkvJaNakh\ngEMP\r\n=Us7D\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"db31520d2bb46404d9d5c364a2db4e2bc564e4f4","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.21.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.e6e23019d.0","@material/rtl":"8.0.0-canary.e6e23019d.0","@material/base":"8.0.0-canary.e6e23019d.0","@material/theme":"8.0.0-canary.e6e23019d.0","@material/animation":"8.0.0-canary.e6e23019d.0","@material/typography":"8.0.0-canary.e6e23019d.0","@material/feature-targeting":"8.0.0-canary.e6e23019d.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_8.0.0-canary.e6e23019d.0_1594757446582_0.527877542664527","host":"s3://npm-registry-packages"}},"8.0.0-canary.d548d7a92.0":{"name":"@material/slider","version":"8.0.0-canary.d548d7a92.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@8.0.0-canary.d548d7a92.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"a811c4fdb0f82d6a08376178b7ea67e6139b722d","tarball":"https://registry.npmjs.org/@material/slider/-/slider-8.0.0-canary.d548d7a92.0.tgz","fileCount":36,"integrity":"sha512-TrdGfkuGude8/WLVG0H+X3GkxxTYLLoSQ+GBow6eegCDEAyROpzscxXSXcI6iEEQIvuApMQpvUgurucxSlWVow==","signatures":[{"sig":"MEYCIQCdN8mHx3VNriRwKZsX6ebAy0FW3luvBvH1FgNkC2i8zwIhAMXrGaxFyRA/RN1xRYWXbCBuzp/t4bX5RbwY4ktYzEWq","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":393946,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfDh/sCRA9TVsSAnZWagAAeoQQAJCcLdEnWdunYPuRLk+l\nQd3suQW6nWZab9Mfas+tciCJZn/EH6ONON0OtWC59iVepjlA55YlldCDdsw0\nTmwYWRZ6xY9K6Db9eBBDhBZXmwsLdo3nOfi4PWhbv6/dQ8OoRCoAbKQSd8Zc\nr4HD8TguVbEKZ3RWIeHDsLmX+VSBm5im+RRkKBd9Wd5Ho9VDPWtBGGK+hYkC\n6wS6TnpxBGAr03tNL6pce9qrzULFfb0d4f4maVNA9t2srJsUQKlGItEwOGMc\nD2yuVmru6kH4aco8YarLpyEJTAGgjz6yANMVeBbhXOFRNB58z3xZ0YRAmFEE\n4ePA79oi/j5dMrg+SEhyUSflNRb8r0ZQPyuyG8p3+pc/ICAwfdWo2UAeQoo6\n9UjOjfDgeOvh+/TEd1DDO33cjCONDseMgaWpDThkBnGclK5LCorUJ4SVVI1l\nR6biwfDHHcl3yhIqLojOaeY8/gLVgwxmfGtgg0fA76gusMQip1dglXksKMYV\nHBxLGmGLIRk4SGfw6UptEhWP4v8VcNuKrK1ssyaCqmbRwE9mcuU+Z0fH3UiW\n22KSSu0wemWyYAcMrQFL6EOIg0+DeusDkXrYglXM74H8xjNdaHu1y5/ueEBj\nkpvk9+TkFRwWv6M/q3uZhaUrZW50PEQ52yGtxj3EJfAPw2NBPMIqWx78l1xg\nvvE5\r\n=/AIx\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"9ac3956fa3f0b35d113404de60048e8aa1c1a0a9","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.21.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.d548d7a92.0","@material/rtl":"8.0.0-canary.d548d7a92.0","@material/base":"8.0.0-canary.d548d7a92.0","@material/theme":"8.0.0-canary.d548d7a92.0","@material/animation":"8.0.0-canary.d548d7a92.0","@material/typography":"8.0.0-canary.d548d7a92.0","@material/feature-targeting":"8.0.0-canary.d548d7a92.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_8.0.0-canary.d548d7a92.0_1594761195708_0.47029307737349857","host":"s3://npm-registry-packages"}},"8.0.0-canary.58ce529cc.0":{"name":"@material/slider","version":"8.0.0-canary.58ce529cc.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@8.0.0-canary.58ce529cc.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"ef82a5ba72867b196b98f7b2b44d7f76176547a6","tarball":"https://registry.npmjs.org/@material/slider/-/slider-8.0.0-canary.58ce529cc.0.tgz","fileCount":36,"integrity":"sha512-EV8GkTItdugk6fyvyXwruWNcZJjbtU91EsO3yJvuZUS4SZG76mw6hlkhN8J+ddX2Qp9vtjp/b4TWdGxzGY5eVg==","signatures":[{"sig":"MEUCIQCeXTZ44jBlxkVTbuRnJekY7CWfgRxHedXxeclj4yAI6wIgHmH8nPBt2olVjztF0mV32/UteJUSk61KfsWAOH7M95o=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":393946,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfDiBoCRA9TVsSAnZWagAA8TcP/A/YZegKqMMM/Bn6cPgv\nQg8OdTEHAqIImfLoQtqqSbs7EpA6tSANHoHE12OPuq7mJW4rTtT7xON9dBcg\nOcc15aIjN08M2dkTUWOaxnf9/xlIxfGVy4CWaupL6xbDbJlKCccX7Fiw8tTt\nSe6G9RxHQoq6RgxRCa0IOj5V9zUyBIBQgoVNgnmvxZZW+vbePlyFePhAOH1X\n3CgXj2nfMKiyoHkI0c2iOydBedjV/M0o+eRb+Xy+QhHaFzUu5IamlJoHeCtX\nZBMqVxLvFauyOUz1w/Y83zhTTVC2obE/eWoOvbKmc7WZPf+XYMcfHfIkHlN4\n4mtKiYwWLnk4R0S55xq2vOn3pAouCfGlEP2Vd7JVkymRWUX5rY+jGaWTOW7Y\nVfUKPWLLWDiAAjiQRL8TDfOYcAC9mLplKn91vUO7Zp9A+TdHvpW8aKhNYhYE\nzUIUcXqRQjwnwTwZf1NktoJRp7J0dwOZR0kiGixrg2E40NtLhsCigZVz5nd3\nhn7xd3OeZGqPdr18sP4Gr7ZTNng5WWsqr1q1jPSyFz1BJ8KvsG8hOXE8ERvD\n611XQzLRjetQgviLrO99gBhgT+k19/pAjFWzfXMNHCtrZmbFjOigAlwzW2ZQ\n6v/k/M98kQLIDXl9ReAVqQEOd8wNq5CY4FFrvsamFTXZJ6FJNakHzu69I5kR\n0vS5\r\n=S48x\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"c45eee764d94f6c07b8a5b3770c89c8bb4ccfeaf","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.21.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.58ce529cc.0","@material/rtl":"8.0.0-canary.58ce529cc.0","@material/base":"8.0.0-canary.58ce529cc.0","@material/theme":"8.0.0-canary.58ce529cc.0","@material/animation":"8.0.0-canary.58ce529cc.0","@material/typography":"8.0.0-canary.58ce529cc.0","@material/feature-targeting":"8.0.0-canary.58ce529cc.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_8.0.0-canary.58ce529cc.0_1594761320115_0.654271613160802","host":"s3://npm-registry-packages"}},"8.0.0-canary.a0f1202dc.0":{"name":"@material/slider","version":"8.0.0-canary.a0f1202dc.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@8.0.0-canary.a0f1202dc.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"57625e57b0d6b197adf0281adffc0c94b574228d","tarball":"https://registry.npmjs.org/@material/slider/-/slider-8.0.0-canary.a0f1202dc.0.tgz","fileCount":36,"integrity":"sha512-MEdwc8BttGBOLmQ4MTQFQXLAOdWNBJtIN3NrrYalw8CBFYFYIyWtRAL6VU5tA/hWEA/rEGrdETvJ4EQ429LXpw==","signatures":[{"sig":"MEYCIQD2nysvY3J2L4jSE2rUzPcNMxC4Jl7akJ4oA40SSTCrjwIhAJ6Sk5Yr3hd/9WIBARaqqWmLHntClPg6PPHq7NrGOeQe","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":393946,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfDiTtCRA9TVsSAnZWagAAMRwQAJvmjdeJHLMnSgi2ya3M\n5IAWGy1moCGNJkg/X3cpDON5WaeYcjdQ4aX5zadQrhdjXzQg2mNze1gG+6N0\nesFDOufBRQVARZ/NSvlnXd2vWmmjVmyz2KznNLKW56h+YSkrwAdh2KCteMcj\nIQOsy366IA2SZta3hWhaWPHV0gQNrU94Fwf5jRzQlqZTDRwAJFhq+5u1onLe\nNlIo9bsmRYAjmstJVA2Y070MPtK+z8gAmwoJxigBGVNop9cei42YbVVzK0Ht\neaH1408Aw5qa1DcC0IZjvAq7YV+K8lkeYZH668zdniX3hMG4f9iPVzjUAgXL\ngZ0eKGljxPHRBMDMT2n/OAESgU9QRXmcUfQt6STNSOafdZZh6ZNZYwll8su2\nTmOPBS6p/6Ud128cZbfLeZz/CZVk5skT4GBvFIqwnaoLCv/JiEwgiGs7olC9\nYAmOTgErbT79X1oc1YgTL7S5niMC3QcAZ72XMQBXZuq3EAw86/iwbqu7WB42\nqnoPwwSJmiwf2yJZAYL/LBFPqaNUl491yLj7/uskx/TbHzQPmxWB6vJYlKGc\npmLIzrjJz/hJPi6B/qpBCbJS+olnZ1r/WQv9dIy87oh9rwRlbk37/RLDFJfM\njPtMPRZ+3nhv74suwzXShOXwjPgGR+G2ptaGJZd8IYMJgDk2FTqrwzh61dsq\nq5v/\r\n=25pL\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"93fc447a8bb5a55abbcf4b72084f1c65147f3cc3","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.21.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.a0f1202dc.0","@material/rtl":"8.0.0-canary.a0f1202dc.0","@material/base":"8.0.0-canary.a0f1202dc.0","@material/theme":"8.0.0-canary.a0f1202dc.0","@material/animation":"8.0.0-canary.a0f1202dc.0","@material/typography":"8.0.0-canary.a0f1202dc.0","@material/feature-targeting":"8.0.0-canary.a0f1202dc.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_8.0.0-canary.a0f1202dc.0_1594762477513_0.21732822734142676","host":"s3://npm-registry-packages"}},"8.0.0-canary.ad4df58c1.0":{"name":"@material/slider","version":"8.0.0-canary.ad4df58c1.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@8.0.0-canary.ad4df58c1.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"a5fbbd8c0a2a006c01e78caf1dce366579932617","tarball":"https://registry.npmjs.org/@material/slider/-/slider-8.0.0-canary.ad4df58c1.0.tgz","fileCount":36,"integrity":"sha512-GcPYBiXiNPm0z8vW7HYf48UbsAF6bAcuV/KVSLh4Xix+l2KlzN7myJfmwrBFmkvs5zjhVpezfarzf7voUImOMg==","signatures":[{"sig":"MEQCIBLAolXTy6PtYTZWS+GsbxgSxT/1YinRzYFfuDIrgyv9AiB4uEovNeoDjrt99Z6BL4yjS4lqhhk7nw0g5tJC/5SjJw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":393946,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfDklBCRA9TVsSAnZWagAASGsP+gJbpx2ZvBcjqaQsdRru\nMxqq6zVgKy3U/X5EO9P6LnLRvXRDaaZiJwfs27+E45JyjCfDy4wl3Bypr7Pl\nw3D+CCw8cc4a11L+0ssIyI8lyvN9Ly/krXITHEJWMcAlfn/EZgofYpv6P9jE\n2mSJyq93ZqtoUQyr+IhrEw8XPwZydJarMK6jOdd7+YYnWq0/oRgw7ob1ZfIa\n9XmryltwMqiHualPcAK1EW6guUSDrnZYEbq4NsTzCEbhoLE6nlXGCrl2OnBX\nlXsqHYyiTRPHDWuIGRVgcr47ZDW2QuRjDq+4YyYMOhSXOFNuLKFkHZs80/2H\n37fXCZy/SQVgQ8oxygD2C0qS5f22WzGSY4L8fThNJ7r6WxeOxqlbemALrYpw\nSIADlVISxK6QDkzaVg9abt4eEaTyRlpNt4HOI/EXyBLZxFzUeknHA1JW+2Zx\nS5jTRn6yU0PCLCU4YSqj9D8cFuAuHFz5lUL83GOtemKKqcLjnBLzT82yAOgz\nGQ0wgXC5muI88cExAZ1rT1xg1MEbRefdcuUroRjpfeh3XDx1EsJL6+zTDXdA\nJ9p+78RD3BurtxnLCpcjPa+eevpA0sdvRkEdQCiQ5LfdsWPgwSCumYMA3TJb\n0+VcvKrP1ckTeZz0lKEbHpU7i6lbzS2lXYpt67XeMTz6W2ZdqnITgy0FUqR8\n9mki\r\n=LqQ0\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"f3541b13d081357419478232ca7ae0021f2a6b43","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.21.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.ad4df58c1.0","@material/rtl":"8.0.0-canary.ad4df58c1.0","@material/base":"8.0.0-canary.ad4df58c1.0","@material/theme":"8.0.0-canary.ad4df58c1.0","@material/animation":"8.0.0-canary.ad4df58c1.0","@material/typography":"8.0.0-canary.ad4df58c1.0","@material/feature-targeting":"8.0.0-canary.ad4df58c1.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_8.0.0-canary.ad4df58c1.0_1594771776968_0.46059315254700106","host":"s3://npm-registry-packages"}},"8.0.0-canary.01db89053.0":{"name":"@material/slider","version":"8.0.0-canary.01db89053.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@8.0.0-canary.01db89053.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"8fb75b32b59712543e9aa20a3cdaddbcdf06c2d5","tarball":"https://registry.npmjs.org/@material/slider/-/slider-8.0.0-canary.01db89053.0.tgz","fileCount":36,"integrity":"sha512-5+q7WLC24li3iQXUMx0N8DqOLL8aKLk8uiNkKjbQhLeP8VOFE1spd+3y3KKTKzaC1srAb49WLXsXE3sE/sqDVg==","signatures":[{"sig":"MEYCIQCFvMoxr54BmkggBmVfVjmFUM+ABCs+H5Cat1n4CaR4UQIhAJqx8Tj39DLEpXdnuho8HAd8BxjsCXhuHMGrH4OpPlav","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":393946,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfEILOCRA9TVsSAnZWagAATt0QAIcgq60uvazzGqSR0tll\nyppN60OAI8lYxpF9Q6MAvT8HNiGHLtRtzhJJhwlDCW+YkVTgUex7dx4/eP48\nmRJIrgwZCD4a9yPg80u49NbfPRlxOanzKOPMwOeV7u3E6WF/R35yLhod16wV\n7h3b6Dxg7eWl68XgZbpPF2DCUdQUmCyBy1HFCifE67wdUm7Dv9HZKD7ntg+C\nmS40LCvBlJ9dKSKAP5/fL3Hfe4rKwwHWx6lh1TVdLbMwbLdi2rIfflj5XmD1\nPvoNSYGhv94eC2BzQ9TqQcqBaGyKsqqDd1YY0gpqg7+AqbkhJr0U5WONdXT+\n/cYks1cqRTeDzPDcGb0exj97MkKnJJ/xMeWZPcR6mBaBsX54zgEsfnJlAZqc\nb/yIHhjqtag7gNgj2qaYdBE/rK2wKctRz3ZJl0uL7OkN+D5qPtIViABLluht\nbpDTGgtAwz9TmkVI2sUPcgUn3uOH6/jeSkrlJhddXkuCVWnYrOyd/Wu3aDhN\n2WpHY/fK0yd/43DerNvNh+xaSLdw49GzJ2qOVckZcf5SwNqfwSCE2Z3s7Ll5\nySQD8qCjOFwmSpQnS65hunipxeeDfLLulrr+dpSS5x/QnUXipCcT2/2iD9zO\nVgvncnzW+wguPJa2rff8yHslyKMjerNaXJc5VP7oht6aVU8Y5e6m8QCGmwWy\nzGPG\r\n=JGPl\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"A select over a range of values by moving the slider thumb.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/slider.png\" width=\"400\" alt=\"Select screenshot\">\n  </a>\n</div>-->\n\nMDC Slider provides an implementation of the Material Design slider component. It is modeled after\nthe browser's `<input type=\"range\">` element. Sliders are fully RTL-aware, and conform to the\nWAI-ARIA [slider authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#slider).\n\nNote that **vertical sliders and range (multi-thumb) sliders are not supported, due to their absence\nfrom the material design spec**.\n\nAlso note that we have taken certain deviations from the UX within the spec, e.g. nuances as to the\nslider's motion across the track, as well as the color of the tick marks. Thus, there may be some\ntreatments which deviate from the mocks. These deviations arose out of design feedback from seeing\nsliders used on the web, and thus have been endorsed by the Material Design team.\n\n## Design and API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-sliders\">Material Design guidelines: Sliders</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/slider\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/slider\n```\n\n## Usage\n\n### Continuous Slider\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\n### Discrete Slider\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\">\n  <div class=\"mdc-slider__track-container\">\n    <div class=\"mdc-slider__track\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb-container\">\n    <div class=\"mdc-slider__pin\">\n      <span class=\"mdc-slider__pin-value-marker\"></span>\n    </div>\n    <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n      <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n    </svg>\n    <div class=\"mdc-slider__focus-ring\"></div>\n  </div>\n</div>\n```\n\nThen in JS\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\nslider.listen('MDCSlider:change', () => console.log(`Value changed to ${slider.value}`));\n```\n\nYou can also include MDCSlider via its UMD version located at `dist/mdc.slider[.min].js`\n\n```js\n// CommonJS\nconst {MDCSlider} = require('@material/slider/dist/mdc.slider');\n\n// AMD\nrequire(['/path/to/@material/slider/dist/mdc.slider'], ({MDCSlider}) => {\n  // Use MDCSlider\n});\n\n// Global\nconst {MDCSlider} = mdc.slider;\n```\n\n### Initializing the slider with custom ranges/values\n\nWhen `MDCSlider` is initialized, it reads the element's `aria-valuemin`, `aria-valuemax`, and\n`aria-valuenow` values if present and uses them to set the component's `min`, `max`, and `value`\nproperties. This means you can use these attributes to set these values for the slider within the\nDOM.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"-5\" aria-valuemax=\"50\" aria-valuenow=\"10\"\n     aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\n### Using a step value\n\n> **NOTE**: If a slider contains a step value it does _not_ mean that the slider is a \"discrete\"\n> slider. \"Discrete slider\" is a UX treatment, while having a step value is behavioral.\n\n`MDCSlider` supports quantization by allowing users to supply a floating-point `step` value via a\n`data-step` attribute.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n  <!-- ... -->\n</div>\n```\n\nWhen a step value is given, the slider will quantize all values to match that step value, _except_\nfor the minimum and maximum values, which can always be set. This is to ensure consistent behavior.\n\nThe step value can be any positive floating-point number, or `0`. When the step value is `0`, the\nslider is considered to not have any step. A error will be thrown if you are trying to set step\nvalue to be a negative number.\n\nDiscrete sliders are required to have a positive step value other than 0. If a step value of 0 is\nprovided, or no value is provided, the step value will default to 1.\n\n### Display tracker markers (discrete slider only)\n\nDiscrete sliders support display markers on their tracks by adding the `mdc-slider--display-markers`\nmodifier class to `mdc-slider`, and `<div class=\"mdc-slider__track-marker-container\"></div>` to the\ntrack container.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--display-markers\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     data-step=\"2\" aria-label=\"Select Value\">\n     <div class=\"mdc-slider__track-container\">\n      <div class=\"mdc-slider__track\"></div>\n      <div class=\"mdc-slider__track-marker-container\"></div>\n    </div>\n    <!-- ... -->\n</div>\n```\n\n> **NOTE**: When the provided step is indivisible to distance between max and min,\n> we place the second to last marker proportionally at where thumb could reach and\n> place the last marker at max value.\n\n### Disabled sliders\n\nAdding an `aria-disabled` attribute to a slider will initially disable it.\n\n```html\n<div class=\"mdc-slider\" tabindex=\"0\" role=\"slider\"\n     aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"\n     aria-label=\"Select Value\" aria-disabled=\"true\">\n  <!-- ... -->\n</div>\n```\n\n### MDC Slider Component API\n\nThe `MDCSlider` API is modeled after the `<input type=\"range\">` element and supports a subset of the\nproperties that element supports. It also emits events equivalent to a range input's `input` and\n`change` events.\n\n#### Properties\n\n| Property Name | Type | Description |\n| --- | --- | --- |\n| `value` | `number` | The current value of the slider. Changing this will update the slider's value. |\n| `min` | `number` | The minimum value a slider can have. Values set programmatically will be clamped to this minimum value. Changing this property will update the slider's value if it is lower than the new minimum |\n| `max` | `number` | The maximum value a slider can have. Values set programmatically will be clamped to this maximum value. Changing this property will update the slider's value if it is greater than the new maximum |\n| `step` | `number` | Specifies the increments at which a slider value can be set. Can be any positive number, or `0` for no step. Changing this property will update the slider's value to be quantized along the new step increments |\n| `disabled` | `boolean` | Whether or not the slider is disabled |\n\n#### Methods\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Recomputes the dimensions and re-lays out the component. This should be called if the dimensions of the slider itself or any of its parent elements change programmatically (it is called automatically on resize). |\n| `stepUp(amount = 1) => void` | Increases the slider value by the given `amount`, or `1` if no amount is given |\n| `stepDown(amount = 1) => void` | Decrease the slider value by the given `amount`, or `1` if no amount is given |\n\n#### Events\n\n`MDCSlider` emits a `MDCSlider:input` custom event from its root element whenever the slider value\nis changed by way of a user event, e.g. when a user is dragging the slider or changing the value\nusing the arrow keys. The `detail` property of the event is set to the slider instance that was\naffected.\n\n`MDCSlider` emits a `MDCSlider:change` custom event from its root element whenever the slider value\nis changed _and committed_ by way of a user event, e.g. when a user stops dragging the slider or\nchanges the value using the arrow keys. The `detail` property of the event is set to the slider\ninstance that was affected.\n\n### Using the foundation class\n\nThe `@material/slider` package ships with an `MDCSliderFoundation` class that framework authors can\nuse to build a custom MDCSlider component for their framework.\n\n#### Adapter API\n\n| Method Signature | Description |\n| --- | --- |\n| `hasClass(className: string) => boolean` | Checks if `className` exists on the root element |\n| `addClass(className: string) => void` | Adds a class `className` to the root element |\n| `removeClass(className: string) => void` | Removes a class `className` from the root element |\n| `getAttribute(name: string) => string?` | Returns the value of the attribute `name` on the root element, or `null` if that attribute is not present on the root element. |\n| `setAttribute(name: string, value: string) => void` | Sets an attribute `name` to the value `value` on the root element. |\n| `removeAttribute(name: string) => void` | Removes an attribute `name` from the root element |\n| `computeBoundingRect() => ClientRect` | Computes and returns the bounding client rect for the root element. Our implementations calls `getBoundingClientRect()` for this. |\n| `getTabIndex() => number` | Returns the value of the `tabIndex` property on the root element |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's root element |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's root element |\n| `registerThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the slider's thumb container element |\n| `deregisterThumbContainerInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the slider's thumb container element |\n| `registerBodyInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the `<body>` element of the slider's document |\n| `deregisterBodyInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` from the `<body>` element of the slider's document |\n| `registerResizeHandler(handler: EventListener) => void` | Adds an event listener `handler` that is called when the component's viewport resizes, e.g. `window.onresize`. |\n| `deregisterResizeHandler(handler: EventListener) => void` | Removes an event listener `handler` that was attached via `registerResizeHandler`. |\n| `notifyInput() => void` | Broadcasts an \"input\" event notifying clients that the slider's value is currently being changed. The implementation should choose to pass along any relevant information pertaining to this event. In our case we pass along the instance of the component for which the event is triggered for. |\n| `notifyChange() => void` | Broadcasts a \"change\" event notifying clients that a change to the slider's value has been committed by the user. Similar guidance applies here as for `notifyInput()`. |\n| `setThumbContainerStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the thumb container element. |\n| `setTrackStyleProperty(propertyName: string, value: string) => void` | Sets a dash-cased style property `propertyName` to the given `value` on the track element. |\n| `setMarkerValue(value: number) => void` | Sets pin value marker's value when discrete slider thumb moves. |\n| `setTrackMarkers(step: number, max: number, min: number) => void` | Sets track markers background style on track container. |\n| `isRTL() => boolean` | True if the slider is within an RTL context, false otherwise. |\n\n#### MDCSliderFoundation API\n\n| Method Signature | Description |\n| --- | --- |\n| `layout() => void` | Same as layout() detailed within the component methods table. Does the majority of the work; the component's layout method simply proxies to this. |\n| `getValue() => number` | Returns the current value of the slider |\n| `setValue(value: number) => void` | Sets the current value of the slider |\n| `getMax() => number` | Returns the max value the slider can have |\n| `setMax(max: number) => void` | Sets the max value the slider can have |\n| `getMin() => number` | Returns the min value the slider can have |\n| `setMin(min: number) => number` | Sets the min value the slider can have |\n| `getStep() => number` | Returns the step value of the slider |\n| `setStep(step: number) => void` | Sets the step value of the slider |\n| `isDisabled() => boolean` | Returns whether or not the slider is disabled |\n| `setDisabled(disabled: boolean) => void` | Disables the slider when given true, enables it otherwise. |\n| `setupTrackMarker() => void` | Put correct number of markers in track for discrete slider that display track markers. No-op if it doesn't meet those criteria. |\n\n### Theming\n\nBy default, all thematic elements of sliders make use of the **secondary theme color**.\n\n#### Sass Mixins\n\nThe following mixins apply only to _enabled_ sliders.\nIt is not currently possible to customize the color of a _disabled_ slider.\n\nMixin | Description\n--- | ---\n`color-accessible($color)` | Sets the color of all slider elements and automatically sets an accessible ink color with high contrast for the value indicator pin\n`highlight-color($color)` | Sets the color of the highlighted (aka \"on\") portion of the slider\n`rail-color($color, $opacity)` | Sets the color (and optionally the opacity) of the rail\n`rail-tick-mark-color($color)` | Sets the color of the tick marks on the rail\n`thumb-color($color)` | Sets the color of the thumb (grab handle)\n`focus-halo-color($color)` | Sets the color of the focus halo\n`value-pin-fill-color-accessible($color)` | Sets the fill color of the value indicator pin and automatically sets an accessible ink color with high contrast\n`value-pin-fill-color($color)` | Sets the fill color of the value indicator pin\n`value-pin-ink-color($color)` | Sets the ink color of the value indicator pin\n\n#### Setting the correct background color for disabled slider thumbs\n\nOne tricky issue with sliders is how the thumb is supposed to look when in the disabled state.\nIn this case, certain portions of the slider's thumb and track are supposed to\nbecome \"transparent\" and reveal the background color behind it. However, this presents a problem as\nthere is no elegant way to derive what the background color behind the slider should be. We could\ntheoretically walk up the DOM until we found an ancestor with a set background, but that would break\nthe component's encapsulation model.\n\nTo solve this, you can supply a css custom property `--mdc-slider-bg-color-behind-component`. When\nused, this will override the default color used for the disabled state slider thumb and use\nthe color specified:\n\n```css\n.container {\n  background: #fafafa;\n}\n\n.container > .mdc-slider {\n  --mdc-slider-bg-color-behind-component: #fafafa;\n}\n```\n\n### Tips/Tricks\n\n#### Preventing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content)\n\nBecause `MDCSlider` updates its UI based on the values it reads in when it is instantiated, there is\npotential for an incorrect first render before the script containing the `MDCSlider` initialization\nlogic executes. To avoid this, there are a few things you can attempt to do:\n\nIf you know how wide the slider will be at the time of instantiation, you can add an inline style\nto the `mdc-slider__thumb-container`/`mdc-slider__track` elements which will position it correctly\nby using similar logic to that within our code:\n\n1. Figure out the the percentage of length the thumb should have traveled across the track by\n   computing `(value - min) / (max - min)`. We'll call this `pctComplete`.\n1. Compute the amount the slider thumb container by multiplying the width of the slider element by\n   `pctComplete`. We'll call this `translatePx`. Note that if you're using the slider in an RTL\n   content, modify `translatePx` such that `translatePx = <width of the slider element> -\n   translatePx`.\n1. Set the `transform` style on `mdc-slider__thumb-container` to `translateX(${translatePx}px)\n   translateX(-50%)`.\n1. Set the `transform` style on `mdc-slider__track` to `scale(pctComplete)`.\n","gitHead":"8780c29a82c64caee37ec22f279b264af42412b6","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.21.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.01db89053.0","@material/rtl":"8.0.0-canary.01db89053.0","@material/base":"8.0.0-canary.01db89053.0","@material/theme":"8.0.0-canary.01db89053.0","@material/animation":"8.0.0-canary.01db89053.0","@material/typography":"8.0.0-canary.01db89053.0","@material/feature-targeting":"8.0.0-canary.01db89053.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_8.0.0-canary.01db89053.0_1594917582239_0.7169929246071263","host":"s3://npm-registry-packages"}},"8.0.0-canary.fb5a4cdeb.0":{"name":"@material/slider","version":"8.0.0-canary.fb5a4cdeb.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@8.0.0-canary.fb5a4cdeb.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"fb4de4ad7800a4eab7e4e53de95572dd2da56d5b","tarball":"https://registry.npmjs.org/@material/slider/-/slider-8.0.0-canary.fb5a4cdeb.0.tgz","fileCount":35,"integrity":"sha512-I6YpIbsLuFKdst55hxrk0iOcVJFSHDQTy03KCmjy3kt3hFIJx0iHL0T/RuQCYj510PksY4SV/yca5uLyt999EA==","signatures":[{"sig":"MEUCIDFVPHupbuKnArss8tXlT1UbNkfIle7ZP8UN/AIzi03EAiEAwjh+jNvFZm5klDBSADjNGObWXsUgftBuL8J6UB16JPU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":376979,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfFe5uCRA9TVsSAnZWagAAfVwP/2q6NNnPUga+l91T8VgX\nVAi2zcX8hXoS+Cks2iHvRsB9bYHRAFkhdlAK+vqjJ9oVAUajd0TeptAUm5Pz\n+cedFY5D51IY8qHZbx2JC0rm+3zywH64i8+SlN0Ot1l2z/bzIaDJMEO88R8o\nphEGImCctzbnbsif65fauNIfAAA4035yx1hewrQFQ6HX7fj6tGXAwS2QdVMk\n1Jn9MHHPEuP+ClcDGpsweKumfJoEY43fqfbXc31OZEPdm5TGJDkgenY1Qh3T\ngPGwaOantLITpLkSDueTrabr15Wn6v6Q6IMnpvQh5+DI/9im6A+zYwau9lNY\nnqxfkIJSRI+3MtVjHZk1HD+ObIUHrWVU1ZwljkEj87/Z9mIgM1qpuaitXoAy\nkgRc5NDV61Jk3QcrYMhTmYCcGfw2dGMb1lxk4KR5sevMFIF6i+BfKdHcx7Yr\nMHwa46rsnAIwqd7Au0F3eaC4m8g3e3W4kNogsm0REc6q0n1hoKB0yclEeBI4\nZM/EYrV65SqYLPoT/X8A2EQd3WIq8sqsxisH8CY49G3EKkkw5ZTeGSBpAo0R\nYbNevIueVWQTBDFxaH2POCmB1y1q2fOFxyJMJKlS65jD+Na3OyUYlwFyyORc\nqxWhO9kQhrajvs+S7zhG1MdpJ0PQNUKDdVh4jHnXUBi3hP3bNk9Lo76/JzbY\nufn8\r\n=yELd\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"ERROR: No README data found!","gitHead":"8e80295b6b3e0ec36934f8d691b193c740458d1f","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.21.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.fb5a4cdeb.0","@material/rtl":"8.0.0-canary.fb5a4cdeb.0","@material/base":"8.0.0-canary.fb5a4cdeb.0","@material/theme":"8.0.0-canary.fb5a4cdeb.0","@material/animation":"8.0.0-canary.fb5a4cdeb.0","@material/typography":"8.0.0-canary.fb5a4cdeb.0","@material/feature-targeting":"8.0.0-canary.fb5a4cdeb.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/slider_8.0.0-canary.fb5a4cdeb.0_1595272813699_0.9201079902368479","host":"s3://npm-registry-packages"}},"8.0.0-canary.8df0f517c.0":{"name":"@material/slider","version":"8.0.0-canary.8df0f517c.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@8.0.0-canary.8df0f517c.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"cfe3da2e6b59c2809ee6a98044530c0cf2ddeb03","tarball":"https://registry.npmjs.org/@material/slider/-/slider-8.0.0-canary.8df0f517c.0.tgz","fileCount":38,"integrity":"sha512-WPOELWxvcnR6+wzhKlefdEY8NBOPFM+hGCLzfmPU3atiNYNN6LWdOnLJCXp5fwEND0/sgMQbxEtU77ex1VRhpQ==","signatures":[{"sig":"MEQCIGcy4nfMS8uJIgZ2MuhRqxr2oG7d0sP0O+fdPwcobiDpAiBc0PlO+0Q5OB2fzz9X7ILw7XV9PQ+Bmdl/HyLzboYecg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":719918,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfFi8KCRA9TVsSAnZWagAAVYcQAJeql/GytT2pI3qjGf0b\nYNLPWslyXy17ze/oq9zjsdCgpsmvdvezBq0wI/5tKD6+vYrs8LaWUQlQJvgf\nFTYo8BwMTu2MPG+mme4mxvtUlClJEEQIV7WjcSWUKuqWJUxAdXuFiRSHSEDA\nq3NIygZ7//rduNcoxDiGdrn9BbsUKIy+wug/Qj7JfwssBk4ozJ26SuxN8Tjl\nIxdSff4bDEPap8OSLmnQcUvVQycXg3/FeotHTViJJyxwBPkUj11oMMUadfd9\nY7/fwBZkOyHdjYXfUnwHuzBhwTOhHDWQhPE8HqP6rjpTm2FYl8G24PlHAFYB\npqQvxVf5ReMrn0pSjw1EtO/RrBHKZ9hx5x8OxVtWt1EY0LwT/c0Z86FcSpBB\nLsTnbf6MnGQF3h2qwSdA2HPDqJZ58+kexsnAJbNxXT6NbJFHeRmttCNW7Ztj\nKe9CLPFzLl4V6zPGkdb4tAOz9x88FRUjNhfS8O2f+icSmcrgvZNfTzDsrDmZ\nWrIx5ibV5cEH4+TwseFRB60QGALiDfYPkRC7DFMGo51fcoEwKNqhKTt6Ufc0\nwGVDLlZNNvsmyTHSjZOQVxl33YqG/hQQfE9iUmiIMBYQOUKmYyLBqkcW7InD\nWBJLY5uVRUa+qI6vSUbGdk7JLOb69rk/5lvTvWC4wI29YK0LpPVxpg5OL9S4\ntlDg\r\n=uU5E\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is modeled after the browser's\n`<input type=\"range\">` element.\n\nSliders follow accessibility best practices per the [WAI-ARIA spec](https://www.w3.org/TR/wai-aria-practices/#slider)\nand are fully RTL-aware.\n\n## Contents\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\"\n       aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   `data-step` attribute on the root element. This will be the step size for\n    value quantization. If not set, the default is 1.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"20\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `tabindex=\"-1\"` attribute on the thumb(s)\n*   `aria-disabled=\"true\"` on the thumb(s)\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"-1\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\" aria-disabled=\"true\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the thumb element's `aria-valuemin`,\n`aria-valuemax`, and `aria-valuenow` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"75\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"5fca8679b0dad51628e898ac223795eea8e54d56","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.21.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.8df0f517c.0","@material/rtl":"8.0.0-canary.8df0f517c.0","@material/base":"8.0.0-canary.8df0f517c.0","@material/theme":"8.0.0-canary.8df0f517c.0","@material/ripple":"8.0.0-canary.8df0f517c.0","@material/animation":"8.0.0-canary.8df0f517c.0","@material/elevation":"8.0.0-canary.8df0f517c.0","@material/typography":"8.0.0-canary.8df0f517c.0","@material/feature-targeting":"8.0.0-canary.8df0f517c.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_8.0.0-canary.8df0f517c.0_1595289354322_0.45355084895776665","host":"s3://npm-registry-packages"}},"8.0.0-canary.abcdbcfeb.0":{"name":"@material/slider","version":"8.0.0-canary.abcdbcfeb.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@8.0.0-canary.abcdbcfeb.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"512b9206e0b9117e9768464297799c1644705f04","tarball":"https://registry.npmjs.org/@material/slider/-/slider-8.0.0-canary.abcdbcfeb.0.tgz","fileCount":38,"integrity":"sha512-eSjQCGQHzpUD4mrbMbAMINGyegGI+pqW7QrRMVLqK+Aa0TaJrnghQ+etchiss7N/1jg7cZjnFehc+Pc6AyS0qw==","signatures":[{"sig":"MEYCIQCwwXEPGkBo643JI5IHa5/tveT/LgRLbZGKL7zwnj7RFwIhALbITwCl3XmFV95MrTxZPt3XxzV03t+ZRC4rrarBm3hw","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":719918,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfFjvSCRA9TVsSAnZWagAAOnQP/3TOfqfAVb1AmmsWqm/a\n7RYK0qNkP1TL9YVvr67uyLfKP96VAUlgFKeVYnYD7d3A9Xi0mHu2jM3/1JMg\nXu5npOW3WqQcFTdJBjPeY5AGEZQCr+AFLzZPX41Lv+ffb/+n2XVAoKB0hPQD\nEsJL+uXXUhYle7kxwB2AbpKwsgHkS0w332uQIvzMZqGlMmI0GOwj8VC5NTRb\nAcnhXriJTpnbO2RBdo5MQdBImu+xtAmPQnNQ4k80Lq6Tfv5s2UY9weyV51qk\n28ebplwU4F+VTQLAp9YeqkzCE8+KVhkNBNPm/s5v0N+68oleOEtrlgHd4+TB\nMrKC1JpU8FrHvKSCtC1aBa4T4grTqLlcspDASBRHqgFpchRnjsOc8+MonM47\nBfzMnCoQi6ShFtP5izWLUPW8LUORDCr1y+W1kt0+bUMjVDnfHBIrQWVsZY3H\npafPYcQmh2UBwEA0uN2RWSAV2S0j4vw78TzW2f3/CB1yMVuo+WP8LeSYdkf+\n6NWdzwEV2fgYymXpQk3Wpu/Ya8NZlpHswiNlF86JMSxXbt4F/OBQen7YuUIJ\nLKSMUPC06V2CxCjY7/gQvcbu5+bLp627Ew90WXgcQv8+ZEQHvllIxBf6EX69\nhW7/cbmIOgVLxYiZ810mGkHBrp4Pg7N0k1tvcjhkSdPnLfSd8UiD4JQXc+XA\nij40\r\n=II/U\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is modeled after the browser's\n`<input type=\"range\">` element.\n\nSliders follow accessibility best practices per the [WAI-ARIA spec](https://www.w3.org/TR/wai-aria-practices/#slider)\nand are fully RTL-aware.\n\n## Contents\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\"\n       aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   `data-step` attribute on the root element. This will be the step size for\n    value quantization. If not set, the default is 1.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"20\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `tabindex=\"-1\"` attribute on the thumb(s)\n*   `aria-disabled=\"true\"` on the thumb(s)\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"-1\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\" aria-disabled=\"true\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the thumb element's `aria-valuemin`,\n`aria-valuemax`, and `aria-valuenow` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"75\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"946720776dd73c7539bfa072ea415124b3e08a55","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.21.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.abcdbcfeb.0","@material/rtl":"8.0.0-canary.abcdbcfeb.0","@material/base":"8.0.0-canary.abcdbcfeb.0","@material/theme":"8.0.0-canary.abcdbcfeb.0","@material/ripple":"8.0.0-canary.abcdbcfeb.0","@material/animation":"8.0.0-canary.abcdbcfeb.0","@material/elevation":"8.0.0-canary.abcdbcfeb.0","@material/typography":"8.0.0-canary.abcdbcfeb.0","@material/feature-targeting":"8.0.0-canary.abcdbcfeb.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_8.0.0-canary.abcdbcfeb.0_1595292625589_0.48629448507086903","host":"s3://npm-registry-packages"}},"8.0.0-canary.7bd5075de.0":{"name":"@material/slider","version":"8.0.0-canary.7bd5075de.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@8.0.0-canary.7bd5075de.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"398af68fae2546b909a3ece5a926e1d29ef0a295","tarball":"https://registry.npmjs.org/@material/slider/-/slider-8.0.0-canary.7bd5075de.0.tgz","fileCount":38,"integrity":"sha512-6r0NoGQ+Bcgc7WxcQt+/ZMtCNPtS6UcJt9NL3B1/sHw0xsCS8C0tBfYDg5qJVs5zrOL40tXEVzA4TmFKC0dlCQ==","signatures":[{"sig":"MEUCIQDW6MQ2vTIHJTb3vmhbOH4/YQ16M5XvzLAui8qJWInm9AIgI+XgNw0A5ZgIX5t7cgSyf15YuwiEU5n3HIKPfHYX8+w=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":719918,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfFzg9CRA9TVsSAnZWagAA3QMP/RALZYFhW7P08GEUeaC2\n2EnjPzFjc15Lh+PlKOSeIXTRwkyinZqGlQ3xCxPue+9ypNArWBCLbf9fD3zz\n0Jphbo5SeA9ZKFFwLakz4u+JwWn/ogaiuYxj3s9iPRqfx0aVjPhSNYcMI22T\nF6RWKgzUoo6q82Yes1H1nVngpnVgrwhV+EqzD4P8k2HdHJCNZ0KkGIUeF+ri\nMuTw3LtfEyOWqzais0RySKgVNZFGhgI6jSitkwzG9wgABNtzvrLO7XpSXr7R\nNH4Y8v7/8fQM4ezLCVZIL3QQgalbB2KKvqJiSNODp0qjeG8gUbvShvjTfJrq\nxsezU3kWmNYTKTl1UwIXEyCbcfC2uqtbt3JaDec93338OfF+qdcqF0AgtZ2x\n9sS1/TtYAn1NZJTVYPIjeOi0ZnQvUXIVI4TdYbKU3Mrf8GeUU0/Y6ntk4943\nuEOutRiV/Sr8Q204Wb53KWHOyqizn7flr4m1GjQDctPRkKRFwYD40KU4l8+J\n+drdihrYF7RoHxRER3LPtXoy0Spc6ZD6E7Ymee4dcC78eKuNeIwGVGsECUYV\nhEiChZ0fim9XrluXs9Sw7nAHFH8voo/cTbRavvF/OxT1UdhnpqlFuH+/iD9+\nxB4xVSCwdd4G74M4zdrW/hj3rv+LpFzZsTycgUO/Oe89qAKfZtIK5NoedSgs\nNmEO\r\n=sKAU\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is modeled after the browser's\n`<input type=\"range\">` element.\n\nSliders follow accessibility best practices per the [WAI-ARIA spec](https://www.w3.org/TR/wai-aria-practices/#slider)\nand are fully RTL-aware.\n\n## Contents\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\"\n       aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   `data-step` attribute on the root element. This will be the step size for\n    value quantization. If not set, the default is 1.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"20\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `tabindex=\"-1\"` attribute on the thumb(s)\n*   `aria-disabled=\"true\"` on the thumb(s)\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"-1\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\" aria-disabled=\"true\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the thumb element's `aria-valuemin`,\n`aria-valuemax`, and `aria-valuenow` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"75\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"5ae456e961b208e98164fa21047b3ff2e3f3d8e2","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.21.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.7bd5075de.0","@material/rtl":"8.0.0-canary.7bd5075de.0","@material/base":"8.0.0-canary.7bd5075de.0","@material/theme":"8.0.0-canary.7bd5075de.0","@material/ripple":"8.0.0-canary.7bd5075de.0","@material/animation":"8.0.0-canary.7bd5075de.0","@material/elevation":"8.0.0-canary.7bd5075de.0","@material/typography":"8.0.0-canary.7bd5075de.0","@material/feature-targeting":"8.0.0-canary.7bd5075de.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_8.0.0-canary.7bd5075de.0_1595357244545_0.3409262020049584","host":"s3://npm-registry-packages"}},"8.0.0-canary.405a29a20.0":{"name":"@material/slider","version":"8.0.0-canary.405a29a20.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@8.0.0-canary.405a29a20.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"bd0f1ce2c3ed0365959177327514b5c51c498f11","tarball":"https://registry.npmjs.org/@material/slider/-/slider-8.0.0-canary.405a29a20.0.tgz","fileCount":38,"integrity":"sha512-HMAHOjbKnz5T9m4PQsdlaiJY6gVLCXct2ZMCP1ydkOSqibxoKtExrAsbb43rsvlV7x6jPr11qQCh6gHxk1wf1Q==","signatures":[{"sig":"MEYCIQDrcovcNwaRHzyZsKxeZ8aMUuS9UaxxDeXhFzGzIbuUdwIhAN/fL80KooJXSQzFCbgpkoUGJRZR03X7B4t+mhGDYm6K","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":720692,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfGLxfCRA9TVsSAnZWagAA1Q0P/3seWJxxcTKnDOXjf4qu\n36w0JEhy6dS1GROtfvm6AXXCHEa4Vm53IMUpU37x9+KGU/O7CCAKYYqS6X9K\nN6nWAX7ZWJDKheT81U9iD9HOuH/A1yH7VxGX6kp82icukWtKFX1Jx1nYk5yt\nkWDPwGlBvd9wnwxS6/ELc/YrzJLaPsntu0VBuiO5lIqwKVxLGlTYm2uZ6M0D\nfyv9cMzXiUbOggiAE1qT7fXYt0u1+FMQLuB4cjFN9SFjAuwAkJuzXg7uzagb\nYPUSgu5djvjOacvHAqMWgqhy/EpWfYJSXrQDhOX52CQfas+SBW9pwzk3Y8mS\n21JSPQHn9RF+9ZJ1KXeWRKDilmv4DbuIROM7M17dhAwRvKvWha/8pjE38wE6\nsg0tJjh2LFIcTSaU8cfdDU5lS3LtqTauvVTCTUKRgy5JTkw44aXlonlShKkk\na6VyHds5MYZShbO1QDlmleo58nVCUegyqSN7pytwB87zdn344ptnnx1hu1A2\n+T2uAtfSaNyEIuUMyKQFYrWg8L7927jGEeggXa4Vz7bl7x5+d4zzvgi+Ju9x\nVJ89ACff1ADvHwxHUmMBhb81RYZr6Nk4ZfbzWH8Alh+gnJ0qfLFjKRHmhu3g\nCPemOAAtzUkYYr7KtU4wKmhZ0bfymrX7+F4E6YJtUdnraYB5Bc3yFrbIBmgv\nHc44\r\n=Uh9v\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is modeled after the browser's\n`<input type=\"range\">` element.\n\nSliders follow accessibility best practices per the [WAI-ARIA spec](https://www.w3.org/TR/wai-aria-practices/#slider)\nand are fully RTL-aware.\n\n## Contents\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\"\n       aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   `data-step` attribute on the root element. This will be the step size for\n    value quantization. If not set, the default is 1.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"20\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `tabindex=\"-1\"` attribute on the thumb(s)\n*   `aria-disabled=\"true\"` on the thumb(s)\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"-1\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\" aria-disabled=\"true\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the thumb element's `aria-valuemin`,\n`aria-valuemax`, and `aria-valuenow` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"75\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"02c4f49285e8229cf49d9e4a0df213ff914b949f","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.21.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.405a29a20.0","@material/rtl":"8.0.0-canary.405a29a20.0","@material/base":"8.0.0-canary.405a29a20.0","@material/theme":"8.0.0-canary.405a29a20.0","@material/ripple":"8.0.0-canary.405a29a20.0","@material/animation":"8.0.0-canary.405a29a20.0","@material/elevation":"8.0.0-canary.405a29a20.0","@material/typography":"8.0.0-canary.405a29a20.0","@material/feature-targeting":"8.0.0-canary.405a29a20.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_8.0.0-canary.405a29a20.0_1595456606821_0.9890515051834783","host":"s3://npm-registry-packages"}},"8.0.0-canary.f3693ac4c.0":{"name":"@material/slider","version":"8.0.0-canary.f3693ac4c.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@8.0.0-canary.f3693ac4c.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"0ca6976fcc932b7f5a395cfd607f48f5082eef88","tarball":"https://registry.npmjs.org/@material/slider/-/slider-8.0.0-canary.f3693ac4c.0.tgz","fileCount":38,"integrity":"sha512-66xDcQZ+YF+UdJbBEqN79yDkITAeiZ9IVB1pXs/A5nvHd9XBlVzkuV6Dh7WLXPga0fV+AVhOxkA8pZBXWymsOA==","signatures":[{"sig":"MEQCIAYKS6iJXSs9RsE16awi3P8TOKbKKJ9UyNaL8VSV2Vz8AiB8oX72uQ5dMtkkvv3oVrzWl30zlEHlYi2gz9V9cOc95w==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":721802,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfGL7ZCRA9TVsSAnZWagAAVFMQAJ1ysT+uCQuMuLRtkw8W\nUpU244kt2Xz7vTJ+L43omUGJbQUErUyGUIeB65ZWGyfjGj+uj0xBjzp3kRj2\nNnd2o1o4raz1sTuJlJ/t3fGHq3l8qaryza5ZQQeepbtdfuQbtrYkp1X2mowZ\nB1MArUvAmpCSRJV77Lb1E1p3k52gGopFYqfoRl4lYIQmvluE3ThAN0F8X6WD\nTdxHm+rzQdalQkOajb3ki6OPnL8la2KJNjSDMGXUl256OQ0ycsftBRLDT83z\noq9JXKqmj3Nl5kMx9HylLMKTDosJ56ibFKi5Xodzo0bbFWVBsZrb7gwWVpib\nsqeVXRKkCRsYNvz02lT/7y69OxcgU9aB3JSK7BVCF6gKb0aGD5eHYaDTPhO0\nxjN2ocyDyxwJLgQcQ6kWGOFusrYHazRyiGGu7L2zhqbEAUSP+OQ9hJkZlX9m\n1C7Hwr5A7WqjEUJHGrKGIfFZx+HVQ6lLNvq+WyVYZmZrmW+l7ID4+AonQnJU\noo4a/EPs4RrmZncb5b1otpYL+nQsZTeSW7biNo7x6BFY4u1XWYdTQLapLPcJ\nifTXKud6/2ZggOyYWskF7l7xXg5BUVd3sqi5ns6nkSy4ZMW9quyrmQVaf8qk\nUFwAWM3HelKdMhxHcwYusFtZvTg56GLm+I5h9Al0TQn/L1TcTy+xpkhIbnKz\nC9xR\r\n=LSZC\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is modeled after the browser's\n`<input type=\"range\">` element.\n\nSliders follow accessibility best practices per the [WAI-ARIA spec](https://www.w3.org/TR/wai-aria-practices/#slider)\nand are fully RTL-aware.\n\n## Contents\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\"\n       aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   `data-step` attribute on the root element. This will be the step size for\n    value quantization. If not set, the default is 1.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"20\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `tabindex=\"-1\"` attribute on the thumb(s)\n*   `aria-disabled=\"true\"` on the thumb(s)\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"-1\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\" aria-disabled=\"true\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the thumb element's `aria-valuemin`,\n`aria-valuemax`, and `aria-valuenow` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"75\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"d3170e3936d96d26a6ca17df46c1febcfc33078f","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.21.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.f3693ac4c.0","@material/rtl":"8.0.0-canary.f3693ac4c.0","@material/base":"8.0.0-canary.f3693ac4c.0","@material/theme":"8.0.0-canary.f3693ac4c.0","@material/ripple":"8.0.0-canary.f3693ac4c.0","@material/animation":"8.0.0-canary.f3693ac4c.0","@material/elevation":"8.0.0-canary.f3693ac4c.0","@material/typography":"8.0.0-canary.f3693ac4c.0","@material/feature-targeting":"8.0.0-canary.f3693ac4c.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_8.0.0-canary.f3693ac4c.0_1595457241409_0.4417256725613852","host":"s3://npm-registry-packages"}},"8.0.0-canary.12a109680.0":{"name":"@material/slider","version":"8.0.0-canary.12a109680.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@8.0.0-canary.12a109680.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"48bbed3deb99e03d5d257dd2ed73d98ec76b4036","tarball":"https://registry.npmjs.org/@material/slider/-/slider-8.0.0-canary.12a109680.0.tgz","fileCount":38,"integrity":"sha512-oS4ZMy9cfV16XNi4WFLahYUiAGSfstbBr/KWB86V98xoIRMA891qrCxAViJTykIyoaegNu8TAQiQArVCbJxjGw==","signatures":[{"sig":"MEUCIAQnmhqa9tFnXr2JW+cMrtafptfLgMzoRyM6on9fN+doAiEA+sI6kuLAuaTTjfb2PC7hJDFmkZqjvgtZ2tagJVRy420=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":721802,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfGMXPCRA9TVsSAnZWagAAjuEP/3+nI3lHkssXSZ+KwD+C\nHVrtSVrT+37SKL5RzwJfBwUG24M/TMXv4nOrvEJeIr7PvCxMfRDUdD45pVwc\nGvT0PuHe98OLCJ+89Ur4le9xuGidZI7QB3X6iSMNMFqGd4rAuhCcapL4EyPu\n5meTvBafRuUca4E8K2IKBv1OAi9H9VGDiHOu5XNNJUY22f59w43QssN+e64t\nMWzUxnxzY7ZfrVWK1r8U32EIOBJfaQ1oyYjbmWj0SjIC0UZffOGICMfciRaL\nFPWK2SVbJUjD8KI52qmCcCist8HPmf2WO3Qo7xhYBpQCahKr4d5FozxwDHzD\n64qJqJohMjT/jfee0ktAiKKHSVnpvePAhVRF6YNzq9um8PA+5isKmwDO0gmg\n32/qiwh3isgBwiDHHJnLqaCXxv2S9ezZBkzBrHIKvPj/UdqB8NcdouF5lEz9\n5iwa3I1UfO2OzZOHYvQvcf1irb6MwMQUJlZPK50YdTsz0cV1JI0NDL427S1X\nJNTURidpW0e3jGoQggd/CAq5UiGowhME2OBj7nT4jM421F6lE7npqOVIYxBT\ngMy1HEgHSW82AVj4JlnueubjTUF/S0nX9d1wxWYejii6j4AT7awZ3HRx+WpD\nFmI6WlMabHY2/nntBDR8F+KbUEmTDUO0WcFLRqn7UDxq+5DRZksg9SunJ3N1\nI+52\r\n=9eTw\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is modeled after the browser's\n`<input type=\"range\">` element.\n\nSliders follow accessibility best practices per the [WAI-ARIA spec](https://www.w3.org/TR/wai-aria-practices/#slider)\nand are fully RTL-aware.\n\n## Contents\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\"\n       aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   `data-step` attribute on the root element. This will be the step size for\n    value quantization. If not set, the default is 1.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"20\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `tabindex=\"-1\"` attribute on the thumb(s)\n*   `aria-disabled=\"true\"` on the thumb(s)\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"-1\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\" aria-disabled=\"true\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the thumb element's `aria-valuemin`,\n`aria-valuemax`, and `aria-valuenow` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"75\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"a403e743d7da095028c3ba6d0a66ef2f7812aa8e","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.21.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.12a109680.0","@material/rtl":"8.0.0-canary.12a109680.0","@material/base":"8.0.0-canary.12a109680.0","@material/theme":"8.0.0-canary.12a109680.0","@material/ripple":"8.0.0-canary.12a109680.0","@material/animation":"8.0.0-canary.12a109680.0","@material/elevation":"8.0.0-canary.12a109680.0","@material/typography":"8.0.0-canary.12a109680.0","@material/feature-targeting":"8.0.0-canary.12a109680.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_8.0.0-canary.12a109680.0_1595459022890_0.7718451532840889","host":"s3://npm-registry-packages"}},"8.0.0-canary.bbd06696e.0":{"name":"@material/slider","version":"8.0.0-canary.bbd06696e.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@8.0.0-canary.bbd06696e.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"99892a74d86b35230dac67079eed169629daf865","tarball":"https://registry.npmjs.org/@material/slider/-/slider-8.0.0-canary.bbd06696e.0.tgz","fileCount":38,"integrity":"sha512-Cz4dvIP6JUX4qOd6ll+wd/buvvLQsubkT7bW+nYteWiP6zhmPcVyWQeQ7HwSBJNIavUi+kuF2OBuvj5nlX9aSg==","signatures":[{"sig":"MEYCIQDXFY6FgurqjUubx9QLpDrcQSelRSoK7aGeNHPPNZva2QIhAI8+yIdAz19d23PuEIzjzKGM8JnMFvWN+rcMCBi/1kC3","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":718808,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfGNFkCRA9TVsSAnZWagAAzroP/3QL5sxdo28qqmVSB0Te\nTs4JEvyv3tJWsaQEoEk0tE9oVuHY0U/czEyojc6g28TTlNlH6MfiONKjlIMK\nChkuf4O/joF9DDECD+1RPjKIgkKvA73eZYJU4u74XYwEIKLDRY557cf+ZrT+\nt5uzhS24skXGPLKV09ETkgzkSj1oRLmn0phniS/xDhlMq/EjBzzx3gHo/bK7\n7tp23EmIVIBKK7FYr9clVIY20S/uF5flsns4uWAn5+s5s1dIWEpchzuSI/l2\naRZuSXT6nA6JCy8ZKBKhztcmepAjxYrUEARB/Qve2JQIcH+qE/87nF+7YamX\n35WyvMwLe8gcOVZ4HYLgKsal4YxOFKbF+RuZFsvXp6DNdJdZv59DBXPLht8V\npSXOpewQV1rxOlLmFNXO+I/KGwODG9lK1Ic6xLhDz/zdeMJQYSVKL2tmsiSy\nsR7YeHV3d1z1Bd9G7JLdG51vMaE8le1Bm2YJKprZ6DYG8OsjdRSKhSk8pDqu\nDQX527PlxB2juL4ZpQfHBM26JJkYFcTCQ5qUGlzEohsXoY39gKAouE9LSH8P\n9+UcEhV+57hQ2ivKV2RIYvlAz7lqSsevAiwcQyCuutLbMVpBvVmzwU0kryf/\n+qipsELdKQx0t0E+a7hFffVrvhJwFi8rRTPkd/z/VdSP2cl/nDEPc1+pSY+9\nSE6V\r\n=RJ+g\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is modeled after the browser's\n`<input type=\"range\">` element.\n\nSliders follow accessibility best practices per the [WAI-ARIA spec](https://www.w3.org/TR/wai-aria-practices/#slider)\nand are fully RTL-aware.\n\n## Contents\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\"\n       aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   `data-step` attribute on the root element. This will be the step size for\n    value quantization. If not set, the default is 1.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"20\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `tabindex=\"-1\"` attribute on the thumb(s)\n*   `aria-disabled=\"true\"` on the thumb(s)\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"-1\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\" aria-disabled=\"true\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the thumb element's `aria-valuemin`,\n`aria-valuemax`, and `aria-valuenow` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"75\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"1d34a386a37996e326b9ca18440ff1cda261f3aa","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.21.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.bbd06696e.0","@material/rtl":"8.0.0-canary.bbd06696e.0","@material/base":"8.0.0-canary.bbd06696e.0","@material/theme":"8.0.0-canary.bbd06696e.0","@material/ripple":"8.0.0-canary.bbd06696e.0","@material/animation":"8.0.0-canary.bbd06696e.0","@material/elevation":"8.0.0-canary.bbd06696e.0","@material/typography":"8.0.0-canary.bbd06696e.0","@material/feature-targeting":"8.0.0-canary.bbd06696e.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_8.0.0-canary.bbd06696e.0_1595461988235_0.3267326840708471","host":"s3://npm-registry-packages"}},"8.0.0-canary.4951e7651.0":{"name":"@material/slider","version":"8.0.0-canary.4951e7651.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@8.0.0-canary.4951e7651.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"2ec576126589d487061dd5b2b0f105aa0a5b7fab","tarball":"https://registry.npmjs.org/@material/slider/-/slider-8.0.0-canary.4951e7651.0.tgz","fileCount":38,"integrity":"sha512-0vsLufb/bIYo9Ndrl3Ybl7qOVsA2Rvd9ii7I+YK1qcqkr1CBmw1kT0gFuOljnwqkIxburgVXMCSqLA7L2UiTgg==","signatures":[{"sig":"MEYCIQC1O/s0YgNqt73Q0Pxhlu6m4ooDxmHkTjcdPn8GhL7WnwIhALfrzwVtzLQS9A2UhGv3vcVjlpkPtnVPlBmdJ3IbHtZI","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":718808,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfGOzCCRA9TVsSAnZWagAAeD4P+gMFavN8V3XDka+74ysq\nnVNAb7ZxJt0S+sfEDreoadXfy2HskP26Sl0wV71ZX/MEDMSnK6VN2wCCThvD\nzYNWz2KIl7RZUPvWcPoItL/BDFCUIAtt2s1oiFyugNRC5MVINeiSLMiwA+eE\nNhH0HGuXeHeh31bhR+YumI+AwVSN5EW+ZZ5ZLHLWrCM1XCSYuWp981HSStb4\nw4fq9Wu3Vfodd/ChTqonGQ18zdMffW9R6u6fI2O0PNfkcoQhVBriJqOHkGWC\nujpNZaQVSrHIUT4rwYs4wnx7i0yiYyKHQsGn0InaDwSy5EmG0p3Q7FTiGKcD\nZKlGNfvg0d5fNqOQxkb71HsLy6vpluyUuBILdAd6z+bM0lpCSrIrAXH11JE/\nGobf7cwVb/6ACEO2G8Oh1AQrVxHCVNStn9Ih4/uxXD1XoJCS2WuoroeeJiQs\ni5iNNB2sj3QFGz8ao9VMtVb/WmL3G49ZGnQHDxf5co+WclucQlRHIDujfgIK\nP3lzgAS2Y9GIfsB6qfMvbFco0yWHM5Hec7RVoDQJYhqEVZSgW7ItJ7V29ns3\nRyyP6N/FIwLzOsOGIo3yig3UpMbHv9u1+bXB97tYHvrknzScnGk6r5j34WT7\nhwvpwva3aeXupsYcpHw8ZtxO6TgF6JBeghgFuvBAMaxrXe6quhu4cHzAHb4L\nzHZG\r\n=qnHh\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is modeled after the browser's\n`<input type=\"range\">` element.\n\nSliders follow accessibility best practices per the [WAI-ARIA spec](https://www.w3.org/TR/wai-aria-practices/#slider)\nand are fully RTL-aware.\n\n## Contents\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\"\n       aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   `data-step` attribute on the root element. This will be the step size for\n    value quantization. If not set, the default is 1.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"20\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `tabindex=\"-1\"` attribute on the thumb(s)\n*   `aria-disabled=\"true\"` on the thumb(s)\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"-1\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\" aria-disabled=\"true\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the thumb element's `aria-valuemin`,\n`aria-valuemax`, and `aria-valuenow` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"75\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"32ca9cc0ab948e59f91965e96adf325a142b8336","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.21.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.4951e7651.0","@material/rtl":"8.0.0-canary.4951e7651.0","@material/base":"8.0.0-canary.4951e7651.0","@material/theme":"8.0.0-canary.4951e7651.0","@material/ripple":"8.0.0-canary.4951e7651.0","@material/animation":"8.0.0-canary.4951e7651.0","@material/elevation":"8.0.0-canary.4951e7651.0","@material/typography":"8.0.0-canary.4951e7651.0","@material/feature-targeting":"8.0.0-canary.4951e7651.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_8.0.0-canary.4951e7651.0_1595468994334_0.2439902537338925","host":"s3://npm-registry-packages"}},"8.0.0-canary.75deebbef.0":{"name":"@material/slider","version":"8.0.0-canary.75deebbef.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@8.0.0-canary.75deebbef.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"e3063fea747795f6dead84b28599b74b8c9e070c","tarball":"https://registry.npmjs.org/@material/slider/-/slider-8.0.0-canary.75deebbef.0.tgz","fileCount":38,"integrity":"sha512-Or8oAJ9ZglMI/KIyZu5xn4DePMIXlAqqbNJpIUIOIwHPn50K9oh78hgKnEu1Mgq644QbsiHnMXRztDRk0gxsPg==","signatures":[{"sig":"MEUCIAdAm8F/6qrWazGsh1+Y1oDijJtNqAFtcQNzMJ2DWoK1AiEAirZX2vIliWpLGgsEjim+BGGcIzBd2NdRqyU3PE6X6lc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":718808,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfGc0QCRA9TVsSAnZWagAAYcoP+wcZgvr4uiDHHe/Z0lIC\nc8DF7YPngr3n+h1GvUgUHXWj8N8vjl3QU5azDC79qXZbqDA8bxcE14jN42RS\noyDLaLoVkQxqCpaaDUBqKld6RJPSzwIrHJDatFDgBziNKrnh469snvZbH5nW\nwnqnIR09ul+kYG7+jDbQZbyp0XFWK3vd1T7o/VNb0GRxX3DwKMJfJnE8Fh/5\nBT86Tl7PxWCjRN2RnkF90Kf0hVV3kcRl9cKmcJKHQ9FL50NnU4KTHYPOmhEH\nbOBmlj99PJ3qxCStCYk4okpPE52jxcbdILimodrBq3tfwZ4gS8QKHO6GwrG8\nQaztc6JZ4UkxbNMDKxbgq/ZZwYfSLwl4t6zMbMMxeItCQFSckzNNMTGRqJMG\nrRSDLRc1fGBrCN0hmrrpxlQZAHfGL7K+Q7HEu+cb4woMXYnd0dCNfs7IM6iK\n1RCTcBZhv3oFqYVslH9aBuvQwbcsyF5MzeMCC3uQ9fL29ljEEbwUTgcS+q++\nrhm2r5mLoSdkDXRFWJMe9aKE4GCK1o1OO6UaiRMHjbyBR77hZh9+mXkjhDCX\nNTZTKeEO9et58jT/H16ftCufhjLmJKZK42IAqMGYRPV6VEf/BuGiC6M4VtCZ\nITyIm3Zwg+s/3xnMruF3Q3roC5432sA+Blvl99dRKZTCDvzg6HisQ94Mdt5e\nQNiF\r\n=opTc\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is modeled after the browser's\n`<input type=\"range\">` element.\n\nSliders follow accessibility best practices per the [WAI-ARIA spec](https://www.w3.org/TR/wai-aria-practices/#slider)\nand are fully RTL-aware.\n\n## Contents\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\"\n       aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   `data-step` attribute on the root element. This will be the step size for\n    value quantization. If not set, the default is 1.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"20\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `tabindex=\"-1\"` attribute on the thumb(s)\n*   `aria-disabled=\"true\"` on the thumb(s)\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"-1\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\" aria-disabled=\"true\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the thumb element's `aria-valuemin`,\n`aria-valuemax`, and `aria-valuenow` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"75\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"3df5ec3c8a254202fe3ba9017528cce3d5d906ed","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.21.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.75deebbef.0","@material/rtl":"8.0.0-canary.75deebbef.0","@material/base":"8.0.0-canary.75deebbef.0","@material/theme":"8.0.0-canary.75deebbef.0","@material/ripple":"8.0.0-canary.75deebbef.0","@material/animation":"8.0.0-canary.75deebbef.0","@material/elevation":"8.0.0-canary.75deebbef.0","@material/typography":"8.0.0-canary.75deebbef.0","@material/feature-targeting":"8.0.0-canary.75deebbef.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_8.0.0-canary.75deebbef.0_1595526416237_0.5405403182097388","host":"s3://npm-registry-packages"}},"8.0.0-canary.95aff33ee.0":{"name":"@material/slider","version":"8.0.0-canary.95aff33ee.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@8.0.0-canary.95aff33ee.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"8e103f0a734da792f63ab844bdac2e61d288bf4b","tarball":"https://registry.npmjs.org/@material/slider/-/slider-8.0.0-canary.95aff33ee.0.tgz","fileCount":38,"integrity":"sha512-qjBWoPez66Y3XpUBwSMGshiIyTx7qS07o0EWM6g5f4KCPq+kA5/1V1kBwBBkSslWItNIkXOYA7TJmeLWlXyh2A==","signatures":[{"sig":"MEYCIQDGmN1KJtvGi7yyvMRbcsCCgJwCxhmz2Av2Pywm4IWe1wIhAPaPbLTszhrqY0+6vj8Tl+F5cMEQwzGGpGQBp099fw4D","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":716579,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfGdtLCRA9TVsSAnZWagAAsN4P+QBpQjLkz2v9yN1/K2JX\nfadTIrLZV3C/BF1vHERTnzxCx1F9ZgRxyBpcqA2rRah3U9zKYp3CiA/21EaZ\nSgRnxOGmVj7N6dTTPZf6NmElWHo9uOs4KGnVca1dYLfdX9roFjfoq16PG7vo\n/lh+2ZuGxDNr8jE61QuzJWjZec4MNqTH/vV+ePqjBWMH2NSIJBiMgspH3v7M\nNgR17CXRCA7ELoKvFPf6+kNqQ/H3jC9+t6vB1UodLXDARL9HlRpedjSyGFHr\nWxXGEG5ZN27CzmyKgLp/tspYyBmHOUdSZKaiBIxuLymap5qaGioQsNSzvwiX\n/ZJnchlgRi3VUknf0X8efC3vxaM+pQUoJHchcO7GXUXUZgM+OATwlr6HvbcZ\no/oQr5g2wwZf+FssrnaM37T5cv8hnoRXy3iwKbLPvon72ABSbvROJ3k4Iqau\nueOwNqlfEMY4ixz5duQ4sXDVI1vtgCAd6Enn9Y8rIRu9mzi7FKG7H7nruCYr\nR94LKIsAGWoyvfIgCEADXdBHiYlhQGZGH+xrsVaSCqHXKIaIfmS+1aq/GAxL\nTj9mgHZKQip+qeLnyWnA2s1+Q5OJGs3TQmVq32Dcx5bMk63t0/88oKKNAtYh\nGfbDerrtPiPyN82nObgxEqmxz7uKnq+W7iNRbndhQRESEJSravntNGRMvkC3\n+Son\r\n=ns1z\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is modeled after the browser's\n`<input type=\"range\">` element.\n\nSliders follow accessibility best practices per the [WAI-ARIA spec](https://www.w3.org/TR/wai-aria-practices/#slider)\nand are fully RTL-aware.\n\n## Contents\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\"\n       aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   `data-step` attribute on the root element. This will be the step size for\n    value quantization. If not set, the default is 1.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"20\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `tabindex=\"-1\"` attribute on the thumb(s)\n*   `aria-disabled=\"true\"` on the thumb(s)\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"-1\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\" aria-disabled=\"true\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the thumb element's `aria-valuemin`,\n`aria-valuemax`, and `aria-valuenow` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"75\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"0343ebd62969f5d4315e249ad81f2837fdbaa096","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.21.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.95aff33ee.0","@material/rtl":"8.0.0-canary.95aff33ee.0","@material/base":"8.0.0-canary.95aff33ee.0","@material/theme":"8.0.0-canary.95aff33ee.0","@material/ripple":"8.0.0-canary.95aff33ee.0","@material/animation":"8.0.0-canary.95aff33ee.0","@material/elevation":"8.0.0-canary.95aff33ee.0","@material/typography":"8.0.0-canary.95aff33ee.0","@material/feature-targeting":"8.0.0-canary.95aff33ee.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_8.0.0-canary.95aff33ee.0_1595530059503_0.9911221851404541","host":"s3://npm-registry-packages"}},"8.0.0-canary.9d9f47473.0":{"name":"@material/slider","version":"8.0.0-canary.9d9f47473.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@8.0.0-canary.9d9f47473.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"ecd2886f61e1464b59e83d17478cb18af5568cd4","tarball":"https://registry.npmjs.org/@material/slider/-/slider-8.0.0-canary.9d9f47473.0.tgz","fileCount":38,"integrity":"sha512-HSs//dKv/qsNkHrMoYtwBKZyS3Y1XEdq1fAqr1Ykep/II8UA1fso4ODne0x0hL3NObFUqShRZaqxc9JFD6l7hw==","signatures":[{"sig":"MEQCICz1YLqtNyi6MOAq7tnqJHtd0E39FwK6075rZqXyGA7dAiB8h0lOsPjDn9Fg/3g0lt04/NBIWFeKW7uMr7ST1GYU6g==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":716385,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfGewKCRA9TVsSAnZWagAAv6YP/38DMOF15QMMYnSfmDqi\neZ89LJV8WQEO3AxGZO66lJ7VukpBJ6iV6PVFiCfrAHgZ0m+ttzlGxFRZxwOB\npw1aRIVURI4ecxrd9wA2hBjcRHxJqbF+uW3hqb5OgDyG+M75q1PtXxDi2yC2\nLrO0x5RwPqXGgVlotbgZpYgTIRuq8qhzi+PvDdX7UZPrjZrmF2WOiK826r0n\nIQs40ZkQHYUx4Ai5YgkzqMI0vDbrbTyefFuRHgvI0BWuZhHIyX9MbARik6Of\nA6gcnuys1F6S2SPd0ZXFqIVp2LbEhRFl69hGRMmJqZPQ2Qe93Q2TIwB6ZZjD\ndDWKwPCDcxDrQurosdvI/6077Uu1DC/S30RmRhg7OQAMWr9QPwNeVozX9hMt\njrQOsJB11v5uducih+KqpGrGoswZoN1CPBXX1CEwa+Ntx/Vntomgb4DOYH5G\nsOC+/p3zdFSDx6lNXxYxRr++N7ucxb0pCd1wRrq4m932iVY8sSLVyoZWFCpo\njgsMjlz7NCCGSF8kqirc43cVfEBCB+MTifErKwWcmGwTwPz/85jZV8IQhnyH\n6ngWep1Nxpk5I1H95KgCmiVoCUuwrM48Lmo35ierLG2+aoHJ1Lf7o/vss/j2\nQuhp45z8+hjPHV/KcMV/4jJ3t4eAaNx3M9b60Pvf+UAZHlKUzas+wKIG/cpl\n8qKF\r\n=PBEY\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is modeled after the browser's\n`<input type=\"range\">` element.\n\nSliders follow accessibility best practices per the [WAI-ARIA spec](https://www.w3.org/TR/wai-aria-practices/#slider)\nand are fully RTL-aware.\n\n## Contents\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\"\n       aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   `data-step` attribute on the root element. This will be the step size for\n    value quantization. If not set, the default is 1.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"20\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `tabindex=\"-1\"` attribute on the thumb(s)\n*   `aria-disabled=\"true\"` on the thumb(s)\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"-1\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\" aria-disabled=\"true\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the thumb element's `aria-valuemin`,\n`aria-valuemax`, and `aria-valuenow` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"75\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"b21be0611a45dd7df8e3b48a3fd0aab09d6cb236","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.21.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.9d9f47473.0","@material/rtl":"8.0.0-canary.9d9f47473.0","@material/base":"8.0.0-canary.9d9f47473.0","@material/theme":"8.0.0-canary.9d9f47473.0","@material/ripple":"8.0.0-canary.9d9f47473.0","@material/animation":"8.0.0-canary.9d9f47473.0","@material/elevation":"8.0.0-canary.9d9f47473.0","@material/typography":"8.0.0-canary.9d9f47473.0","@material/feature-targeting":"8.0.0-canary.9d9f47473.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_8.0.0-canary.9d9f47473.0_1595534345406_0.34063454521636016","host":"s3://npm-registry-packages"}},"8.0.0-canary.00dfbf6be.0":{"name":"@material/slider","version":"8.0.0-canary.00dfbf6be.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@8.0.0-canary.00dfbf6be.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"57849b84c65bcfc3d6abcd55d9186a6db63f214b","tarball":"https://registry.npmjs.org/@material/slider/-/slider-8.0.0-canary.00dfbf6be.0.tgz","fileCount":38,"integrity":"sha512-ga6xdPP3s8TdHtJLPU8VLBhI60t6qIsJ+/qyU3Ncil3HSnbjcZ4B3+2yhYTAMMm/aObQIqOi6L4kMqJWfNaI9A==","signatures":[{"sig":"MEUCIFOHtO/9nhOXMJTuKTYrMQ536aQHb4YsaNvFf1Y+uw02AiEA8Uyw9Ua3PMUycab4jgZZDV7CxojYDe172qt7+y4sSLo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":716385,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfGfpICRA9TVsSAnZWagAAN4AP/RqfTop7RuxZSlmod/4P\nJcIyCraERzoZza251dQ8mhMM63/RjtQyDOl6gKscUg8Ekxvy/rJF/JPJUlik\n9LTeh6lxBS8zXBcROuRF4Vpffy3W+uY/PxPPFY4Zv1S6kbv/t2ynF0HAOcWN\nn6e77DZqjIomsCWPTED7Ig56/NB233prQjsX6cHZqBeZDiAYJu95VGQ/Z1Wp\nXjra0h2dSEpPoTABgebbF1N1MgWDmRTSGf4MqWUnkKdXduESgGvM61aZh/vV\nQ5ss1ihNt5vQaE6DWPqQM8M74u6D8ts9ys0ROIGEf35EDu9amrTvISY00HE5\nX+wSZHTZ1nmUcAO8S1d6VywrGP7dzoKqTzodSuAx5d06YZRf7dZDyznZnRSx\n+RJ1A5M37iGC+VGtTx3any+u/k2dMo/qhRTE5KqX6KWTt2E71pj07uM7WrjZ\nvDbfLf8caDAHHEKHvXUYlA8vYCJkGcXNaOV8KQMmF854KOinSmP4y7ACf/Pv\ngl8siwLLkM4VsSDozeF6DKsrAt0zjPqLdqWbJMAYbVde5WXRpDJ8JwY5ZLpt\nDMWWUyk5Cbe5Ys1lQ56m4ucnzBxHasuKotTt1eiptGkKLCRav+7enjf8QsEU\nTbPqMMOUVlfltenuewG/jUsNntZ3i1RCTM3QbTzIFd547dzAZCXo3+1jg1rC\nfj23\r\n=nqoM\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is modeled after the browser's\n`<input type=\"range\">` element.\n\nSliders follow accessibility best practices per the [WAI-ARIA spec](https://www.w3.org/TR/wai-aria-practices/#slider)\nand are fully RTL-aware.\n\n## Contents\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\"\n       aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   `data-step` attribute on the root element. This will be the step size for\n    value quantization. If not set, the default is 1.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"20\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `tabindex=\"-1\"` attribute on the thumb(s)\n*   `aria-disabled=\"true\"` on the thumb(s)\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"-1\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\" aria-disabled=\"true\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the thumb element's `aria-valuemin`,\n`aria-valuemax`, and `aria-valuenow` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"75\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"e4a97455c736fab77028e52beabb53323eb60ed3","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.21.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.00dfbf6be.0","@material/rtl":"8.0.0-canary.00dfbf6be.0","@material/base":"8.0.0-canary.00dfbf6be.0","@material/theme":"8.0.0-canary.00dfbf6be.0","@material/ripple":"8.0.0-canary.00dfbf6be.0","@material/animation":"8.0.0-canary.00dfbf6be.0","@material/elevation":"8.0.0-canary.00dfbf6be.0","@material/typography":"8.0.0-canary.00dfbf6be.0","@material/feature-targeting":"8.0.0-canary.00dfbf6be.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_8.0.0-canary.00dfbf6be.0_1595537991748_0.9054638405907109","host":"s3://npm-registry-packages"}},"8.0.0-canary.b87e522d2.0":{"name":"@material/slider","version":"8.0.0-canary.b87e522d2.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@8.0.0-canary.b87e522d2.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"04f4663350ca5c99995e2940501f5adabe639f62","tarball":"https://registry.npmjs.org/@material/slider/-/slider-8.0.0-canary.b87e522d2.0.tgz","fileCount":38,"integrity":"sha512-ts6cUHjH4MkKd4RYwOavWAo83L/gIvQsYBS/GSG+Qi6vgAFrF5YPG+NPWwsBMfAkKFXgaXyFQ47qebdea96AhA==","signatures":[{"sig":"MEUCIGt2ZoSLSGe0bZixGsRjEL/PlaTvUxsjHP+CL0efaAJ4AiEAoRmjyXte/D1qES1juBLw3a9iU98yTBBwvHaDaCmYgjo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":716385,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfGf/uCRA9TVsSAnZWagAAPsAP/0h9jEr0VftHoJsYdoGn\nuZEtMax1xYEBnVOkZIrRYFadjp2QoqsTnysRR21zup+ETb1wYL7GS/UCJtag\n9aBJQg3nwRtVoIHFrfvRZ13Z7dZ+jre4GF1qGUWLI6/AFaCacWdr4TBBIW4V\nkK5IY8Y+S9HAkv4FHNVo1F0qlvG1gcM86+ilMBGRw2jMAG+ajEHFvBEAjjmR\nnu9BeTLPJql35bdlNIL+yEs3iFLjE9qcNRcbShdcZ6RXAgoeyjDGuhm0GFoN\nPZYC2mv81CeIPWHtSzWFrrfNN/C/f4RaRPiBHa2HfkYmuU2/wj1GPmBj6hzI\nZsKpHWv1bhfG1ZfWxTxaNk2slLK9kUUf/lbRZVAO8J14wuTqlCB+f0XM9Ck8\nuEMSiBoU2Kw9CT53Lf/qOlmdyiaDqsSKlXK9f6F0qIae5cEs/2dotYPe6LJO\nxeeSUwb5WPighrB4Cnyp/tAcOX3A3nC9JUwUh2XCy2V8s3mU0zrECoxQOhP1\nqw/XbnpE1oO2wiGp1fttxABl5Qy//6QIgnFnI2rtK1WkWlJuMPWOMYTcPXVO\nYci/BvkYIzbkUwBxgv6GLVa7v7haB5RjAn9rw9WE25WlYAhIQwCsw32rWCXu\nLUTbj8JBKgKQP6Q46MVQnJLynLFDBAVQowhiRn+mUTMVjPfOeDfDAuhI3TB/\nbh94\r\n=niRv\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is modeled after the browser's\n`<input type=\"range\">` element.\n\nSliders follow accessibility best practices per the [WAI-ARIA spec](https://www.w3.org/TR/wai-aria-practices/#slider)\nand are fully RTL-aware.\n\n## Contents\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\"\n       aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   `data-step` attribute on the root element. This will be the step size for\n    value quantization. If not set, the default is 1.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"20\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `tabindex=\"-1\"` attribute on the thumb(s)\n*   `aria-disabled=\"true\"` on the thumb(s)\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"-1\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\" aria-disabled=\"true\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the thumb element's `aria-valuemin`,\n`aria-valuemax`, and `aria-valuenow` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"75\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"c6b4bba75848a4cc1d6ee29d1b67848ff11a8ba6","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.21.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.b87e522d2.0","@material/rtl":"8.0.0-canary.b87e522d2.0","@material/base":"8.0.0-canary.b87e522d2.0","@material/theme":"8.0.0-canary.b87e522d2.0","@material/ripple":"8.0.0-canary.b87e522d2.0","@material/animation":"8.0.0-canary.b87e522d2.0","@material/elevation":"8.0.0-canary.b87e522d2.0","@material/typography":"8.0.0-canary.b87e522d2.0","@material/feature-targeting":"8.0.0-canary.b87e522d2.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_8.0.0-canary.b87e522d2.0_1595539437923_0.1426737595716263","host":"s3://npm-registry-packages"}},"8.0.0-canary.5b3e150e5.0":{"name":"@material/slider","version":"8.0.0-canary.5b3e150e5.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@8.0.0-canary.5b3e150e5.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"6c0acde909afa83c1fadcbe8d4b692e42fb443f7","tarball":"https://registry.npmjs.org/@material/slider/-/slider-8.0.0-canary.5b3e150e5.0.tgz","fileCount":38,"integrity":"sha512-uwfuwgvubz5SCQ/MW73pXa6RDoqvn1+rZIuhkcE7X43zCk4+L7f60juYlqo5WBrFrMqACKMIIVbP/6uW4fleRQ==","signatures":[{"sig":"MEYCIQCmr6r+WVRcBsG/MChhyJqRCVhgHNaT4lGusrM92o1FEAIhAI/uEP/CoKiQSsSKe9s5GQOfklQv2W2bVXtCEkO6O2tv","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":716505,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfGjhACRA9TVsSAnZWagAAGU8P/iwzSkVsYZR10sFidXYM\n30YP+OmqMCdlc7XpsSStnUKj+lF4rFpIzBFHOWyDXP8X2cHfM9pjOuoTd/Af\n7NrCO8MUehop6MRt4LGaibH9jUIGdguN+xqKWewT3TC0D4G3vRuw7a0p9pLm\n59PtBrA9LYdNKB0gqE0iDPz4BKhpioDu9Rj+kvP9iQNkcUtuMn9IBZL0rFfY\nPv56yIda7XidZjMtOYR3Q+7IxEeU/rgmef8LORUJTRBZaOnK4aZwZvd3SsfE\nsvJk1KnFK3sHbjI3Vm+BQkwJnK5fqiHsmIlHdQoQcDU6k7N3Q1D8RRQih9+r\nAkNM6HoIGpb2LxnYj+fps+UuqJ5y/vac4KR79ekSIA8dk9jZ/P6dQ3aDysNP\nluap4fUg5s7Eh56bCvRYQxWYMpbAJ9BDmWm0kylthXKMIW7g7/XHsqeC5kqR\nvslPWQjVyardEl0afH0u1KDcIsIR16HdkjPO1aGmliA3gUBOzaqcPighupO0\nq64pBe5SkR//e1bhkp283Uf5XiD32dtt/EiQ83DVKlpid1DOrL8mB5BW13L3\nuamj/PDPjDNb6gmVtYEO8FDmBSnz9Iuv+WXUcvVxm+7DvBPgURISASSFWDId\npFS51HzJXP+4tUvcPvPcepIv+jOqeh8eWooBiDLmdoZzpek+Vv/Yn+E3Uren\nJqXe\r\n=YaC8\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is modeled after the browser's\n`<input type=\"range\">` element.\n\nSliders follow accessibility best practices per the [WAI-ARIA spec](https://www.w3.org/TR/wai-aria-practices/#slider)\nand are fully RTL-aware.\n\n## Contents\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\"\n       aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   `data-step` attribute on the root element. This will be the step size for\n    value quantization. If not set, the default is 1.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"20\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `tabindex=\"-1\"` attribute on the thumb(s)\n*   `aria-disabled=\"true\"` on the thumb(s)\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"-1\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\" aria-disabled=\"true\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the thumb element's `aria-valuemin`,\n`aria-valuemax`, and `aria-valuenow` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"75\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"bdcd04000450742ddf94918c2953ff0bbfdfe9cc","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.21.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.5b3e150e5.0","@material/rtl":"8.0.0-canary.5b3e150e5.0","@material/base":"8.0.0-canary.5b3e150e5.0","@material/theme":"8.0.0-canary.5b3e150e5.0","@material/ripple":"8.0.0-canary.5b3e150e5.0","@material/animation":"8.0.0-canary.5b3e150e5.0","@material/elevation":"8.0.0-canary.5b3e150e5.0","@material/typography":"8.0.0-canary.5b3e150e5.0","@material/feature-targeting":"8.0.0-canary.5b3e150e5.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_8.0.0-canary.5b3e150e5.0_1595553855616_0.08041184700967774","host":"s3://npm-registry-packages"}},"8.0.0-canary.f0ae11786.0":{"name":"@material/slider","version":"8.0.0-canary.f0ae11786.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@8.0.0-canary.f0ae11786.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"823e5a848b09c9484fc15f1b390d1939353a26b9","tarball":"https://registry.npmjs.org/@material/slider/-/slider-8.0.0-canary.f0ae11786.0.tgz","fileCount":38,"integrity":"sha512-i8CEJSatsGTsMpLr2CkMwPnMR4FOmTzgWpqy+vTKqJTjPhEcA0vEoRkYZvql7oOjV4kTfEhYy+OmIp6Le4yEBQ==","signatures":[{"sig":"MEUCIQD3TRYmEXvh9EftoRBzoLoTQJWSCuPP/7wQzFece2nudwIgWG/uNg7emLm/GLW1/ZaiOD3WQAgGrw+NLRlFw5CGdys=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":716052,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfGjzYCRA9TVsSAnZWagAArEEP/13d8jPo+NDSVDO87UOS\nmg4uYoY2r+Ti/l0LQM/4CcY0yTbiRk5I+ktcUbunO6qydqxbM8HYKdzYK+D6\nPyy0n1al/B1ZSJ2fsj9OTrPNYLxDx+NrT/RQwsAu0gIX0TgIkSJfRr7mOLr9\naVYIR077sLghy2SOTQOZmShgmkRZcachlkhBQ/OVRI6Enn2IIYbM56kyYtji\nvCZc+t20wRGi2y/xo5q4RWfzjWNgkSVmNUU0wEC+tCrdFVb4eO70hCrBijgE\nxRA1AJPEkBuFyGIrZvXyQVYgFLIjdXdobi70QwDOLCgJnawK4YoMCo8KFZaF\nF/ApH5X+Wol8t0k84YsjrorvVeS3NTEmxQAbxD1JpTxHKBAvsBvhoyFDmOEh\nGw47ioieOH8MOvfGE1um1lll+MA1TvkPpLOaFywTLzghT6rpOP/Q437CSmGD\nLOBzE+dkEJNBxi8Wp31fAcy/qRf8Z1CWxJsHHnSMAFeZP283JK5AlOgfNmqg\n9Tp5GOzD3uM2+iC8dVHz8nvFqd5WI9SKfp79C+ptE0aE6a8oEY3Jm3FeQLyA\nr3y5zKHmsD5y5V950MoF/jCN65keLs2OTcEE1z3D/kJJX7ypzC9Ole73nFt9\nfJKjtzOXdVsJpCguTQdodDPyvP7yVUHxHX57MKS292mqv0eICCuX7KCZxDrG\nCoPA\r\n=2/qT\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is modeled after the browser's\n`<input type=\"range\">` element.\n\nSliders follow accessibility best practices per the [WAI-ARIA spec](https://www.w3.org/TR/wai-aria-practices/#slider)\nand are fully RTL-aware.\n\n## Contents\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\"\n       aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   `data-step` attribute on the root element. This will be the step size for\n    value quantization. If not set, the default is 1.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"20\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `tabindex=\"-1\"` attribute on the thumb(s)\n*   `aria-disabled=\"true\"` on the thumb(s)\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"-1\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\" aria-disabled=\"true\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the thumb element's `aria-valuemin`,\n`aria-valuemax`, and `aria-valuenow` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"75\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"2f6df990a3e45b1985740da9e55bce17882e69d6","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.21.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.f0ae11786.0","@material/rtl":"8.0.0-canary.f0ae11786.0","@material/base":"8.0.0-canary.f0ae11786.0","@material/theme":"8.0.0-canary.f0ae11786.0","@material/ripple":"8.0.0-canary.f0ae11786.0","@material/animation":"8.0.0-canary.f0ae11786.0","@material/elevation":"8.0.0-canary.f0ae11786.0","@material/typography":"8.0.0-canary.f0ae11786.0","@material/feature-targeting":"8.0.0-canary.f0ae11786.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_8.0.0-canary.f0ae11786.0_1595555032195_0.6764706117104811","host":"s3://npm-registry-packages"}},"8.0.0-canary.fb4ee66c0.0":{"name":"@material/slider","version":"8.0.0-canary.fb4ee66c0.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@8.0.0-canary.fb4ee66c0.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"cb42ebc96a1ef0380bd966bda8144adead80a7be","tarball":"https://registry.npmjs.org/@material/slider/-/slider-8.0.0-canary.fb4ee66c0.0.tgz","fileCount":38,"integrity":"sha512-qgiJCLL65SlkeoNQ4PmAVA4jn5mDit9sgNNtP+eG2AhrQnyr7bvmUQnqS0/TaUCIs1qdkH25QBfydOsZCEeOmg==","signatures":[{"sig":"MEYCIQDj4RElxyg3ie1YP1qYeycMuVBhP5I/bniFn8CKgmVUfwIhAJvP3zWrZDCwwWBqmcOxxHfmba8OE8fp9/AR7qtgOt/Q","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":715917,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfGkM1CRA9TVsSAnZWagAA7AIP/A8jgR2V3eAlxJILFn/r\nw5Dbgi9gvUb4i/F1BzJLTwdBrDL0m3nqtEnoofR4UoFXvm9MScggTR0evbb8\nkzIAiDLvSzENHEoutHcbMcqOtb4Eqwp23NjHXiz1o4WHxnAF0mEczmpk07kQ\nOyMgJ4QjgwSelb99AhHMy4pf9EiLAsEjENr4BHA3w3GxPbWvXXXTkLDJmtWM\nC6cvg30EaAyOtnF6W0cHqyDxG67vC137U8LKhgg4nmDsNBpk9Q1LQBGjm1sW\n1YV9unrqzO+45VZ+Nl6TsY6BKMRp4OZ+LLOeeacXCU8WjytSKo4gL6c/fSPJ\nv/EEc67OXT8siEXJo+9i3me11tGjLC4OChC+V5YZ5DV+ViepEcDZ0OkIEHEa\nCUW7+9s4HYQmuiuJyl3xVZT+4CHrqqUT0TiReRH9kgEjIukTtEQn8jApCdST\nLOi9MOrxU3V3Q+uYvFPKh3lhy7pVQQRfY5yIzX61B2ucKGLZPIz8f4+Z8n0O\nN/rqGMxhpeLVIq1+Ih20V3RZUjMr5178CN+tvZB0rVN5dS64Dy0efCrPs8GW\n1uSZKGg2QbwmQfEflZfxITIofE+qAPLqIm7gyTjhlCmIUz3eMMzFUnRUseOd\nBk/8nLVgWD78HQt7tuVoBekTlUBuAS4Y0KUysjaY9ie7JPcKoIrmlR1t+lfO\nOH2u\r\n=tyL2\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is modeled after the browser's\n`<input type=\"range\">` element.\n\nSliders follow accessibility best practices per the [WAI-ARIA spec](https://www.w3.org/TR/wai-aria-practices/#slider)\nand are fully RTL-aware.\n\n## Contents\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\"\n       aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   `data-step` attribute on the root element. This will be the step size for\n    value quantization. If not set, the default is 1.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"20\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `tabindex=\"-1\"` attribute on the thumb(s)\n*   `aria-disabled=\"true\"` on the thumb(s)\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"-1\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\" aria-disabled=\"true\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the thumb element's `aria-valuemin`,\n`aria-valuemax`, and `aria-valuenow` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"75\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"38a9d8f8bf46aca600cb4ba84272480ece6c67bb","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.21.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.fb4ee66c0.0","@material/rtl":"8.0.0-canary.fb4ee66c0.0","@material/base":"8.0.0-canary.fb4ee66c0.0","@material/theme":"8.0.0-canary.fb4ee66c0.0","@material/ripple":"8.0.0-canary.fb4ee66c0.0","@material/animation":"8.0.0-canary.fb4ee66c0.0","@material/elevation":"8.0.0-canary.fb4ee66c0.0","@material/typography":"8.0.0-canary.fb4ee66c0.0","@material/feature-targeting":"8.0.0-canary.fb4ee66c0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_8.0.0-canary.fb4ee66c0.0_1595556660767_0.75326996643965","host":"s3://npm-registry-packages"}},"8.0.0-canary.5511e0aeb.0":{"name":"@material/slider","version":"8.0.0-canary.5511e0aeb.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@8.0.0-canary.5511e0aeb.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"c42b7202bd086d3867e39417665452a84e7f85c0","tarball":"https://registry.npmjs.org/@material/slider/-/slider-8.0.0-canary.5511e0aeb.0.tgz","fileCount":38,"integrity":"sha512-f9JpMNXrb/Bkb7nvLuCVX4Dybs+2CI9dId1upPiAv38z4U9oshODkzIl00QQViokQmVf0F5I9A9bZgleax5cww==","signatures":[{"sig":"MEUCIHut5xXtOeIlDmOdpGrW300zG4my8FH5v79DYkfX2KAyAiEA9hHSKhCno4BhTVBdKUabrMwLKQ1RL56d/IWXMM6ovbQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":715917,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfGxLiCRA9TVsSAnZWagAA0B4P/3Zodyb945/LcVg+sMT2\n3VkxS/INFflEVUbABf578Og4jDzJbzyBW9Q0VaU1WprTt+XtAMy1/ZRvP1+6\ndr5md+w7RLSoXTHu2zvoWY9CQ1BZQ+4fBqo3OR/RHNzLkCpfiOZlqOMP6kII\nKVBc4UtDDDCnTrPmW4xAOIlD+omjoWpShs+HyXn+eZRuOpM+aJa9CMmZ4Gqt\nlkMeIvDqRjAOGGb+zaRmZ0yuBZj6KBY2xHlgh79SiV+HeV6kAvc/C8uWPWyr\n1s2m7EWCUfHgfZYkSHn/rW2j9eZHXKiEIEom9AjDYg6eK8Z8SYmyKHlat+H9\n1TZ7qnUKyLgJPEdoS+Uk60s6meOy/7lxv2CSLKUf49IdyhOa16PMFc8ErWXU\nrvkRyo/NPdAQ2f9JBP5sQ3520ojCtI7mBlx5VmmB8DCV+ifEx7qxhSowV1ht\ne1NTKZiDSEWXQ83MaftYNq7jfa42XBjZGGyEszZaFLo6k3RACuabBRM4QFEd\nA87MaQVpqPYqZKt/Dqa6w7/jtaKKQqK4C0pvzvnW3fJGKOyiRZWinyf80+oQ\nXhZTp+vsWpjibCQk+tLT2/6RBfv1DxQr10k6fEv5bgirKtdIi+zIJhfqh8yl\nwKbUtpYyXPRBnQ3PYILuazM0AlFHKNwDDGzJOWjdYeb/IGFsV4AOEXX02yBQ\nL9ZK\r\n=Vqdv\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is modeled after the browser's\n`<input type=\"range\">` element.\n\nSliders follow accessibility best practices per the [WAI-ARIA spec](https://www.w3.org/TR/wai-aria-practices/#slider)\nand are fully RTL-aware.\n\n## Contents\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\"\n       aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   `data-step` attribute on the root element. This will be the step size for\n    value quantization. If not set, the default is 1.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"20\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `tabindex=\"-1\"` attribute on the thumb(s)\n*   `aria-disabled=\"true\"` on the thumb(s)\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"-1\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\" aria-disabled=\"true\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the thumb element's `aria-valuemin`,\n`aria-valuemax`, and `aria-valuenow` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"75\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"dc830dbf81ef9cb796c66b2d35b70355ca46a37e","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.21.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.5511e0aeb.0","@material/rtl":"8.0.0-canary.5511e0aeb.0","@material/base":"8.0.0-canary.5511e0aeb.0","@material/theme":"8.0.0-canary.5511e0aeb.0","@material/ripple":"8.0.0-canary.5511e0aeb.0","@material/animation":"8.0.0-canary.5511e0aeb.0","@material/elevation":"8.0.0-canary.5511e0aeb.0","@material/typography":"8.0.0-canary.5511e0aeb.0","@material/feature-targeting":"8.0.0-canary.5511e0aeb.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_8.0.0-canary.5511e0aeb.0_1595609825409_0.4786598423888031","host":"s3://npm-registry-packages"}},"8.0.0-canary.8388a9bf6.0":{"name":"@material/slider","version":"8.0.0-canary.8388a9bf6.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@8.0.0-canary.8388a9bf6.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"36ee743fbf813c471aea86b3d96c60e83df1d3c0","tarball":"https://registry.npmjs.org/@material/slider/-/slider-8.0.0-canary.8388a9bf6.0.tgz","fileCount":38,"integrity":"sha512-223qcndcmWX9VGEXHePd5Bqb1iDRRH4Snrq9fQAnkW+CPe4d8vlR3w/TCUmF7Ys51O1ExxJ81WOCxSKIghYUZg==","signatures":[{"sig":"MEYCIQCSl0pBjM6PHH6ipVdXpHPtJlc05pagj6sIP3EdAKivzwIhAOMQUnzdlb7fQU9AIJNKa5hkqNMqE/+GFUIQ8X0jYkxZ","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":715917,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfG0DtCRA9TVsSAnZWagAAcrcP/1lvOjM9Fu/gO8qPUqIE\nPhGTJvpO+wCOisyt53jT9/40Bwq3eywdj9i39ON49o+yZF+zVMjTE7Fvjijk\nuwRlGCHP9PJ42TdWnrs+OQNP8lW2hVRBPOAcGZJXXb8on+kk1ZZ95JpP/E8h\nr+EvLqTTGM4O2Xf6gV7SmKYzVqvbokZc23AEzuWlpQLK01zoEnUSwPc6gowm\nycPnCfMJkVeAVTJhrrSPVGLhlZ6rnqIVSoTCGktP8etzqWWnUeP/vCWX01Y7\ni+zgfs5zQK3z+ghjqPTdkRZ8ZVPS86LunAqZ+VIDzBB7+hKb8dpw2rX3fc7R\nLGURcbVX+8VPqn6Gloq333z571m/ATolrCAHTAH/kZPFpHURa+e2ngQ2z57W\nHWdcyu0d+9u6fiZZ4AQVq+axRxwYJKiSR4G/hnikEq5Mpfbk94tUJ5oQG9uO\nz/R3OMZtG+yR+YQKUPuBaLJqM3L4H9E45mxPpvz48QzY/VDt/4xnk1Q7bXeB\nVnMfD3PNjVVRYnb25s/xb6Bj72Cc4lVmKRmrexNHypdS6h4MdKvPSEGykIQs\niwXq6kndg2sykOO1J4wBsS5OvWEGLLpV8g8gae3SlKvO0Nh7PmiBqXJrW5Ms\nbh2R1lSfoWkVn6m6YWTMqfzTbkMb54AbSFNllAfDBvs9gEO3NLW6EX54CBxz\n3nfo\r\n=8ep1\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is modeled after the browser's\n`<input type=\"range\">` element.\n\nSliders follow accessibility best practices per the [WAI-ARIA spec](https://www.w3.org/TR/wai-aria-practices/#slider)\nand are fully RTL-aware.\n\n## Contents\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\"\n       aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   `data-step` attribute on the root element. This will be the step size for\n    value quantization. If not set, the default is 1.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"20\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `tabindex=\"-1\"` attribute on the thumb(s)\n*   `aria-disabled=\"true\"` on the thumb(s)\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"-1\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\" aria-disabled=\"true\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the thumb element's `aria-valuemin`,\n`aria-valuemax`, and `aria-valuenow` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"75\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"f2188ad8c46b8f947761bceed0fcdfd08019e97f","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.21.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.8388a9bf6.0","@material/rtl":"8.0.0-canary.8388a9bf6.0","@material/base":"8.0.0-canary.8388a9bf6.0","@material/theme":"8.0.0-canary.8388a9bf6.0","@material/ripple":"8.0.0-canary.8388a9bf6.0","@material/animation":"8.0.0-canary.8388a9bf6.0","@material/elevation":"8.0.0-canary.8388a9bf6.0","@material/typography":"8.0.0-canary.8388a9bf6.0","@material/feature-targeting":"8.0.0-canary.8388a9bf6.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_8.0.0-canary.8388a9bf6.0_1595621613196_0.015279996303103616","host":"s3://npm-registry-packages"}},"8.0.0-canary.ac405eae1.0":{"name":"@material/slider","version":"8.0.0-canary.ac405eae1.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@8.0.0-canary.ac405eae1.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"4ef765af3ec9512736f7fa1fbb3bf6e92bc8152d","tarball":"https://registry.npmjs.org/@material/slider/-/slider-8.0.0-canary.ac405eae1.0.tgz","fileCount":38,"integrity":"sha512-kZriRWsn9ab7BQJiLlYK3hecOTXA2EW30FtBqv6efOYLZWCe1bAXMylspHkC4GZzfY3K5GOQGnaS0URI9hiaQQ==","signatures":[{"sig":"MEUCIQDPwcwhs7Iq244iBJHhEvxGwzh5N+cUQm/OWO8RJCBaAQIgRVTCZw48dzLFWkKf2MqyyBF3vwxNlfSjZtCpXoBDfyA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":715917,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfHu2MCRA9TVsSAnZWagAAtPIP/21PmV08Ja/JuYJw4VBI\nMC7jrmcb3JmqgKgNO4R87mzTcanZJilHz+oZ6R7nkjVVNMr0IPnYuzFj/UXK\nm7QWBWpWSmjbMeBpTokehiH4IM5oymKtngXHcxaGSgqjVrXLIrbE8WWeEklO\nwDjcgFAZRsjGJINbu7vCH6JRi3tBPEWhVQYgaQqkgPyi98rfh6s3tNTqtG+W\nlB7rdAd8rc3KfBoopn/X5SJlC4LbzEPV2Qm9MX0o3lXBk0W8Oc7Q8ph6qV8U\nHzxlO1/3nYhOuy9U1pEQGsBedwdiUX6fF/XN6Zt56q+VeJd8BPAmI5Dsjjjr\nimw2kqECh6qjeMuYO+gSDcfkzrvnxXInhTzhBuItaCMnzbRU/+7/MZ6cISZB\naOCPQyTdsAVYUzYvzFpPF7kkDONGTsx85dB/E7ev6m4hjbXYQlqFH6+/tXkC\nohRK+UtoTsqGUVtRY9r29ZUSuVPimv59VFAzSrPR9xkUutrfmdEpLRI3y+gF\n1b9QdqFDc73MgkRVbX59FbORX3ly5T8zDAyoC4mCLSpxh9iyD3fdD6c9D23Z\nj3BS1A6hyVyNd9Epp9jhGizB+Bg1ATZnhvRf12EQuqZwWyDMDi0mnMuWG7Xk\nZjU07GcdJPaay4hTftG1bTe1zCiGikJS24dLNogYBpgxadKfzt9iwx/d6CCc\nse26\r\n=5L5V\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is modeled after the browser's\n`<input type=\"range\">` element.\n\nSliders follow accessibility best practices per the [WAI-ARIA spec](https://www.w3.org/TR/wai-aria-practices/#slider)\nand are fully RTL-aware.\n\n## Contents\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\"\n       aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   `data-step` attribute on the root element. This will be the step size for\n    value quantization. If not set, the default is 1.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"20\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `tabindex=\"-1\"` attribute on the thumb(s)\n*   `aria-disabled=\"true\"` on the thumb(s)\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"-1\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\" aria-disabled=\"true\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the thumb element's `aria-valuemin`,\n`aria-valuemax`, and `aria-valuenow` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"75\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"c4f229736a36f17b97137adbdd4b59901eeac852","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.21.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.ac405eae1.0","@material/rtl":"8.0.0-canary.ac405eae1.0","@material/base":"8.0.0-canary.ac405eae1.0","@material/theme":"8.0.0-canary.ac405eae1.0","@material/ripple":"8.0.0-canary.ac405eae1.0","@material/animation":"8.0.0-canary.ac405eae1.0","@material/elevation":"8.0.0-canary.ac405eae1.0","@material/typography":"8.0.0-canary.ac405eae1.0","@material/feature-targeting":"8.0.0-canary.ac405eae1.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_8.0.0-canary.ac405eae1.0_1595862411549_0.8853808706690314","host":"s3://npm-registry-packages"}},"8.0.0-canary.75553837c.0":{"name":"@material/slider","version":"8.0.0-canary.75553837c.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@8.0.0-canary.75553837c.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"70b205c655941cdede80653e556271c9c904cb07","tarball":"https://registry.npmjs.org/@material/slider/-/slider-8.0.0-canary.75553837c.0.tgz","fileCount":38,"integrity":"sha512-pQpQByUD/aA3OcB9w+c5/WWdDVBoIaFV4T+SFjHNCIfxSSDy9ixwBR/z7UvXEaVSmXgYW42OlCVM1hBtTK83KQ==","signatures":[{"sig":"MEUCIQDy+s6vh7+9h4vhK1F7HFFQGZgWy2ycjlwyt6ZWFlzgRwIgBTWEijXV8zKeQhYyqRS3Cfog/neQ1+uYysM21upSpEo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":715917,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfHu7xCRA9TVsSAnZWagAA46QP/3FRD6jI8/f6Kx4apbVc\nf+S3yVM5rI3IZYEjeBco62ATsiaw0+d2SZu0knX8VID/KRGJbrf7X+VEwq4G\nYWV7QMz+yK9a9mQCsygkdRR2GsUde763AFAYoW6Yirgp0Ypf2Li5k43HUwn9\nbaCFOn761t/hPK92vZrSuHKKUU4gNLMl5tEOda5vUcIMAgt4wEU/OidQDPpq\nA/mEU/MuEeLyKQG8yutsQF9Am8ha9jBa1DmrXjh8Q81pgISTE6OaJb5ZPNco\npXuSkh3ZPxitJcu6n+l7PL+Vc3GXW0I7PTyasAV6t9yCTGMEozhZO63G35IO\nbDoKgVfGrCT71lnIhFgK33bt6YdMYsdwgToK725XDPHMU/YbCe81V9YJVOIW\nVyH1qlaBybf2llC6E4DrA0H+kEVgzD19JyGMnkywA31Yij7xT90mPvnQ7wHh\n5mwgUmgS5XDyejayd9Fiev9ZMVxslnVQytyi0znfPqz8crs30VyfKR23kd6O\nPzfCXbvDJE66WyxtfeFWPItjh8pp8wa1NxG1UNlAE5+m+0L8I7PdqJ5hhImP\nR7EQHILx5kBa8WLIq4YO3uBgTvDp1XG4LKwvakJyT9yd4Uemva2DfoW77Axw\nxL0xaokCjKNPZlsmQTMr56apoILhdAz/JyWt+JkuZibWgYexjojiw/DwppDU\n4iWJ\r\n=V7sT\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is modeled after the browser's\n`<input type=\"range\">` element.\n\nSliders follow accessibility best practices per the [WAI-ARIA spec](https://www.w3.org/TR/wai-aria-practices/#slider)\nand are fully RTL-aware.\n\n## Contents\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\"\n       aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   `data-step` attribute on the root element. This will be the step size for\n    value quantization. If not set, the default is 1.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"20\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `tabindex=\"-1\"` attribute on the thumb(s)\n*   `aria-disabled=\"true\"` on the thumb(s)\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"-1\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\" aria-disabled=\"true\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the thumb element's `aria-valuemin`,\n`aria-valuemax`, and `aria-valuenow` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"75\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"18c0e52ebb63979ca614d6df13d96e2c1cc93216","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.21.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.75553837c.0","@material/rtl":"8.0.0-canary.75553837c.0","@material/base":"8.0.0-canary.75553837c.0","@material/theme":"8.0.0-canary.75553837c.0","@material/ripple":"8.0.0-canary.75553837c.0","@material/animation":"8.0.0-canary.75553837c.0","@material/elevation":"8.0.0-canary.75553837c.0","@material/typography":"8.0.0-canary.75553837c.0","@material/feature-targeting":"8.0.0-canary.75553837c.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_8.0.0-canary.75553837c.0_1595862769312_0.19070795318691913","host":"s3://npm-registry-packages"}},"8.0.0-canary.b96fbfc7a.0":{"name":"@material/slider","version":"8.0.0-canary.b96fbfc7a.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@8.0.0-canary.b96fbfc7a.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"9181d6450a1957c8f14ef4aa857fa54c0305523c","tarball":"https://registry.npmjs.org/@material/slider/-/slider-8.0.0-canary.b96fbfc7a.0.tgz","fileCount":38,"integrity":"sha512-0o01ViDYZ2JF6T15IbhgxiO8XFSidCbndQdbt59I3J9xxA4Sb+iZjAYs0/jaXfYOP3nvCNFItZmWSYnhTMN/oA==","signatures":[{"sig":"MEQCIB9gQuE/A4PlCUVwVPwRDh25Yxivnlut6V7FNTOkejl0AiBQnxct7umxvxVxpwlpkl4CjiEae6QDnQspFuX7tqtaRA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":715917,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfHvTwCRA9TVsSAnZWagAAS5EP/3fD1ezX6m7vsD4p3BxZ\nCjNRPJichgMWv7AiR3keO1/DRtQy1KUM+0cewsBmwglyZayEj1oqcWijV+5V\nnOtsFRO7pg5Pb/rscDvGSq3rvuF6rMiW7kCA7dHOWm9i8j4CsL04AiapdmSZ\nVYbFNbUnRheUstwFgSnlJZMFKcR5+oitR8cUnL8BsNui/BvmMJgBmaaSewmW\n/PEea5FNqfnugM2z6O6Bi6NGaG6BCVyplATHlYUBC/v8HA4qvAq3lhoOWnuo\nNqdi2Vqx21WWHlFl0Z1vckLmxN3sOPlzRP+ZmjCxBkofiq2Bxv+kP+wnOMlF\nYIADe4tkdFz9vVS54wtnykkL9UcdEACAZ3F7UY/J33AJ7GajWPz3ppLvtIB2\nItyKVdmhfWp5WbL3zUztAwF58kad/MAwOa+N3RmmaaO8FwTkPomgMPSVla8N\n7bYLlYh0rCuf4KCEDv0iMa5h0ExLf27/0OKtCPG7W3OzTCIcoP6CQeZjR6YZ\nJkExnzrxyiZCwOE7LvuCPHOszaRcCo3cvqfrPVMyPgXUxBSiB4dlNbzQhyiR\n9/S8e5yBbJdgdswS+0tLhqce51NMO4TtgToeKC+ydXl5O7qKVz8x3rW9cr9Y\nMPfvnD3dfTQjIcxGJUz2sorvWKEmdZZHcY6MY086jYcptBwJqbHtmmUv0Lps\nrWSU\r\n=PGCI\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is modeled after the browser's\n`<input type=\"range\">` element.\n\nSliders follow accessibility best practices per the [WAI-ARIA spec](https://www.w3.org/TR/wai-aria-practices/#slider)\nand are fully RTL-aware.\n\n## Contents\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\"\n       aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   `data-step` attribute on the root element. This will be the step size for\n    value quantization. If not set, the default is 1.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"20\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `tabindex=\"-1\"` attribute on the thumb(s)\n*   `aria-disabled=\"true\"` on the thumb(s)\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"-1\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\" aria-disabled=\"true\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the thumb element's `aria-valuemin`,\n`aria-valuemax`, and `aria-valuenow` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"75\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"0e9c13ddacae3f3bc09bd4f168d276110fb5677e","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.21.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.b96fbfc7a.0","@material/rtl":"8.0.0-canary.b96fbfc7a.0","@material/base":"8.0.0-canary.b96fbfc7a.0","@material/theme":"8.0.0-canary.b96fbfc7a.0","@material/ripple":"8.0.0-canary.b96fbfc7a.0","@material/animation":"8.0.0-canary.b96fbfc7a.0","@material/elevation":"8.0.0-canary.b96fbfc7a.0","@material/typography":"8.0.0-canary.b96fbfc7a.0","@material/feature-targeting":"8.0.0-canary.b96fbfc7a.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_8.0.0-canary.b96fbfc7a.0_1595864304004_0.780546694443039","host":"s3://npm-registry-packages"}},"8.0.0-canary.61f1a8d85.0":{"name":"@material/slider","version":"8.0.0-canary.61f1a8d85.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@8.0.0-canary.61f1a8d85.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"d8c52a0a7c41e28f78b30db0e7fca1bc2d8876ea","tarball":"https://registry.npmjs.org/@material/slider/-/slider-8.0.0-canary.61f1a8d85.0.tgz","fileCount":38,"integrity":"sha512-GvR6G+HzPropECziqczI4sEfd12mqsjBqhRAcsWr0L8NwQlS7TssJmvI6WRAk09dSglzpGaycbWcMwLwpvolng==","signatures":[{"sig":"MEUCIQDBZ1IB8/dlEzUteEr6vIvmfECB68Wd3gp/XPdeyO8zcwIgLUIjLbtF/EBDdufOuAWquI++k0gJRQk6ZVWhRb64GX4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":715917,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfHvcOCRA9TVsSAnZWagAAct0P/1KmOP870+G8MJH79dQB\n8/IhRaRt9GjkQbBUfqK8HtKJ4US55/4wGFmpay5o89bGyAQpvLi8u3wzknp5\nOQRiB3jrsoqea2Zo4kbXu+bVUfF+TkVHs+LrNp22hgabn8Db+B91SyAgVULB\nTOgf/oKPSfuePFScvr8ICK/OIqnSpdxZDrgx3X4UpyRZnRvbgj18/a7CGN7G\nffLPeGEVvIaPQGVRfHSteX70McxRWDsbCmc+Sv7waMNDO9q42INHQ1H2d+0p\n2R6UAPWeFSiDFl3QtKzoFHNAjXr/0qifovFSF70hTp/lg9VOLERyzfiW23sc\nB2z0WsK0szpVpZPkDyA6ZmNbKKDMb581e0U2pqiF4dwRyC50iesDeyx5XSE9\nBVwjk1AwdAwN4bZr9gQCWyx8QFgPnla2y5HC7VD4e5RoSw9en8p7p4MqPWR0\ngLvmRP/VrUkLNx/snY1dZMlxQMTT0yKe8i+x9NOpM0lOJLx7cTXk7UXTFhsA\nC0CCm43ksprnoPXo3v0IAtqSoqKxggFGXhPP2GqWa+I6SRiMKrpTwcxyPdLc\n4LQ4ALUr5INk2xqV+bMXct5Rk/nPatK8/+VnCr2Q6LyQRHUjY8tUWnXF5gQR\n2mwzXG6oFPfY/El6LWXz8cehQV7BRdPx5k7HUMJsQFxjFH3gToFG6lR3O5sC\n0IDV\r\n=x+s7\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is modeled after the browser's\n`<input type=\"range\">` element.\n\nSliders follow accessibility best practices per the [WAI-ARIA spec](https://www.w3.org/TR/wai-aria-practices/#slider)\nand are fully RTL-aware.\n\n## Contents\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\"\n       aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   `data-step` attribute on the root element. This will be the step size for\n    value quantization. If not set, the default is 1.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"20\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `tabindex=\"-1\"` attribute on the thumb(s)\n*   `aria-disabled=\"true\"` on the thumb(s)\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"-1\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\" aria-disabled=\"true\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the thumb element's `aria-valuemin`,\n`aria-valuemax`, and `aria-valuenow` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"75\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"71b0bdc987ed1b1b5ad827abc78149cd4efadb89","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.21.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.61f1a8d85.0","@material/rtl":"8.0.0-canary.61f1a8d85.0","@material/base":"8.0.0-canary.61f1a8d85.0","@material/theme":"8.0.0-canary.61f1a8d85.0","@material/ripple":"8.0.0-canary.61f1a8d85.0","@material/animation":"8.0.0-canary.61f1a8d85.0","@material/elevation":"8.0.0-canary.61f1a8d85.0","@material/typography":"8.0.0-canary.61f1a8d85.0","@material/feature-targeting":"8.0.0-canary.61f1a8d85.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_8.0.0-canary.61f1a8d85.0_1595864846049_0.08511784717065285","host":"s3://npm-registry-packages"}},"8.0.0-canary.81dc33377.0":{"name":"@material/slider","version":"8.0.0-canary.81dc33377.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@8.0.0-canary.81dc33377.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"fd90e080ff111964229f3fbaae927db219354484","tarball":"https://registry.npmjs.org/@material/slider/-/slider-8.0.0-canary.81dc33377.0.tgz","fileCount":38,"integrity":"sha512-YCNvboy5H88pekRJ0n5sZjT0OvRvzW8gErhpU4USy5qSvoWX0544+AoXkl19EKoDn10ivd1G1wuQG+xoe1poYA==","signatures":[{"sig":"MEYCIQDiCNiwl5iUkjmlS8BG6hPI9a6CYnXMm9fc6A+O2/mppQIhAKYzrF79XkE+EvIwEcziOXrpjKFzY2nY2OVFxdJ/GvZE","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":715917,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfHvnmCRA9TVsSAnZWagAAVawP/3ADQ+8eQYneuCUgqc1r\nPsEqrm+IOeihsGGwSS8xxOy02y4ciRkqZnfilbtzmVa6vLB32cm6cC6uf0mV\nByHZDxU2o4T7zUHFrKaPHvOR01TfpD9fKqzqE43YUmPGZ9NSGyOVkbP7PtE9\nMJNgkRCPxOReDijxkuqZeHDsQ9FwxjZWOyFjKYNxFbhyhSzDEbA4gU42WHO/\n+2ImcxJXdSybeBkRQBKc0e5M5qiqkKzqNQqvJEQyy7xQgY+9OqtwPY/4kgmj\nvkWAIIAF2U/B2wCJNtUUPoZJ4A0RIrQjvpCKxkSXV4JyQTyJUgkWX5mR9S88\nNYLC5rxox2gy0W/usJFaKbd2GOZbeG0/IJyp5X4XIZOfaIi/0HXts0YdYxso\nHx7ujK/du3Bx5E8ckIm6E75jLhcuE44ZR1kL5MUSF2hAEGUKa9ZURvlwD2d3\n1l2UkksumyGZMfnYVWG1PG1UwCPscQaUTSVfYdUfwQZxCLlVkt6Gv8RiEJu5\nKbwm0wtzXg4YJwtgxPpI1wuxcwYuN82ShlHNBFKATmdUDk+4Hf5WeSOkOS6Q\nVLGgv8w+TV0X4jyoXrJpy+7zyoLotlPgIZcpmuhx5SEiL8ysVW8PukNfDSNt\nbZnM6DRAH2xkZY+vJm+m6fiwXCyoR/tmByiRoS1sQudmOHYMnD1xtn4cuutg\nML2P\r\n=CnQD\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is modeled after the browser's\n`<input type=\"range\">` element.\n\nSliders follow accessibility best practices per the [WAI-ARIA spec](https://www.w3.org/TR/wai-aria-practices/#slider)\nand are fully RTL-aware.\n\n## Contents\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\"\n       aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   `data-step` attribute on the root element. This will be the step size for\n    value quantization. If not set, the default is 1.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"20\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `tabindex=\"-1\"` attribute on the thumb(s)\n*   `aria-disabled=\"true\"` on the thumb(s)\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"-1\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\" aria-disabled=\"true\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the thumb element's `aria-valuemin`,\n`aria-valuemax`, and `aria-valuenow` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"75\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"14e4858d309a20ecb69620f07c8f427bda0821ad","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.21.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.81dc33377.0","@material/rtl":"8.0.0-canary.81dc33377.0","@material/base":"8.0.0-canary.81dc33377.0","@material/theme":"8.0.0-canary.81dc33377.0","@material/ripple":"8.0.0-canary.81dc33377.0","@material/animation":"8.0.0-canary.81dc33377.0","@material/elevation":"8.0.0-canary.81dc33377.0","@material/typography":"8.0.0-canary.81dc33377.0","@material/feature-targeting":"8.0.0-canary.81dc33377.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_8.0.0-canary.81dc33377.0_1595865573639_0.10867877780128521","host":"s3://npm-registry-packages"}},"8.0.0-canary.ffd9ede58.0":{"name":"@material/slider","version":"8.0.0-canary.ffd9ede58.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@8.0.0-canary.ffd9ede58.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"adb9a129a6a2e0db9a8444833fd69c12dc91765b","tarball":"https://registry.npmjs.org/@material/slider/-/slider-8.0.0-canary.ffd9ede58.0.tgz","fileCount":38,"integrity":"sha512-CTepRmrqDvc8QwNW14TA3+oSv/mRDRpLpgSZaMGazsyGQk9KMvIxI7sOnhRNFGwUH6hVAyAyaqRsxN/p7SzX6A==","signatures":[{"sig":"MEYCIQDDQFcpTU323ter9lD0yAUttsL6RWr1RdBOj2GR1IeTtQIhAJzXxj44FdxhfmlAYqmd7MXKbRV2tWAWa3HENfodIMbz","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":719306,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfHwG0CRA9TVsSAnZWagAAhCAP/1v4xJqS+8l6vTbjJefq\n/G+eXV6+c8uSfWvKdIQk/mytWWSTe7cDGBW5ygQrV7rXkxeQgORh3hJh+LT5\nltFIIY56g6dC29wnKpk/ZfXjwDfcCNuPWeWPC1Lp6sW+m5h40v1c+4kkMYYQ\n6H0affeJwhMY2nyaB9bfeNga+OCDdX+7mMPUlSPrrAN69dXFbpmtlESas7Fp\nLgSX/qCU/a1IIfzKic/vqG0ifdjIldurPj7uKSvZL0N6Hz4mkk+7k1tbCSfn\nTnYoowlLtdehg89RV/S9TsU+ioiyDm1E+XSrNuOBRzOLzbucrz05QYwUSJvD\n/7viKCUYI4lZ6wTxaXfPG9fe6L4/YhmTHHr5p/eeRCS0BdxZAetR/V5/WaoW\nigi3BrGytP44zUfo6VWnJvHJtbZlsbGCA8Dw3QST84FMEs4NL6gMK/n7iqg3\nrMw+27y0f/kowjMa//J+jxeRngSLnWRFFRYg/I/s9F9EPSjAI6PQTSbjH6Xj\ns5aNeVpQ0q7C7NOSklxWJWqlZQIaM+18bT34kszbcY9/HcBEgAVOOIrQqCCn\njR2SMcxroci9QRTIDcHAEKh+muS9KUyCX4egIMgZ5MlZjBixgZiDCrvA1he/\nsjgIdsCS/+Eu5woMlgxkVG0tUx7fXzdZWs2Uitd7vbVqCwfL6VXFigMwqVNh\nwllm\r\n=sChY\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is modeled after the browser's\n`<input type=\"range\">` element.\n\nSliders follow accessibility best practices per the [WAI-ARIA spec](https://www.w3.org/TR/wai-aria-practices/#slider)\nand are fully RTL-aware.\n\n## Contents\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\"\n       aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   `data-step` attribute on the root element. This will be the step size for\n    value quantization. If not set, the default is 1.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"20\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `tabindex=\"-1\"` attribute on the thumb(s)\n*   `aria-disabled=\"true\"` on the thumb(s)\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"-1\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\" aria-disabled=\"true\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the thumb element's `aria-valuemin`,\n`aria-valuemax`, and `aria-valuenow` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"75\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"8a029ef9963cd4799ffbf7dd03908a696d110f7f","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.21.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.ffd9ede58.0","@material/rtl":"8.0.0-canary.ffd9ede58.0","@material/base":"8.0.0-canary.ffd9ede58.0","@material/theme":"8.0.0-canary.ffd9ede58.0","@material/ripple":"8.0.0-canary.ffd9ede58.0","@material/animation":"8.0.0-canary.ffd9ede58.0","@material/elevation":"8.0.0-canary.ffd9ede58.0","@material/typography":"8.0.0-canary.ffd9ede58.0","@material/feature-targeting":"8.0.0-canary.ffd9ede58.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_8.0.0-canary.ffd9ede58.0_1595867572097_0.05326026397625938","host":"s3://npm-registry-packages"}},"8.0.0-canary.52dc55acf.0":{"name":"@material/slider","version":"8.0.0-canary.52dc55acf.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@8.0.0-canary.52dc55acf.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"7a3d4b4c7473a39b970e5c12238e6ecdb5528fcc","tarball":"https://registry.npmjs.org/@material/slider/-/slider-8.0.0-canary.52dc55acf.0.tgz","fileCount":38,"integrity":"sha512-4CMFt3rN1mNb/L9AbDSpmuxqaU240iYDT8AaEC6g9jovvAZ7ZhBdy5kBRB3hAsDAYF8gL6olHvvaVTUbmDJcYA==","signatures":[{"sig":"MEYCIQCRgHoDiHhHW1BNQw+rGIJLT2DymVut9fJ/BCyfv8itVQIhAKGAOO4qRsE34tQUaqdj3vQgIFUmCKXcnuZ4FGqxRmRx","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":716794,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfHwojCRA9TVsSAnZWagAA3esP/0aZJupcjY185sOvMqzL\nADpj9M7GOcFOIcF024ETHM4k0Wan/VP2m9bQzE4Pn25bWwSuB1YK4RcbywM4\nTOJZuv2N9CjnHUh2G4LoLm1vMWch9N6YthXBgdTCUC+zbAJWjAeLpkEl4EIc\nCU9e6HhpgtEoDBmVFs6dEKTCwOrMYQV7jhfKJKpw4wPHdWTf+/9vmgPmetI6\n0aGE+vQayjsipqFRU4Vfj+aFSwL/vt/IiLEHW+6P5hSqKX56p2OSPqop/2Uw\nHnvrZrpb96lAzjgXzHU9lHodIqyH0CafE8PRHlNDv2YlRy4FDvWD19VnasV4\nKPPECHuFgJptFyLLMEByE8knRprw7Pp4vASU8S2tFif/yC0aegzBi4Dg5QbA\nKn/8tQWvQ3QuYPkjY9jZ6h3dSQZegHNpJ0cnfi/VnG9JEcmQyv2AKm9HxL8r\nN0AAVHhoJeqh7jkufcS0IhYa3qdluwWQCxvMT99hsQgCmv50vc8CJQXEYpgb\n9eQ3MAtNZio2LHXeOyuZ9neYG09/9FRcht77UrRHW2lC2JYHRhEIkOzDDmoZ\n5iPKgmsR1cXHwphXuj3tqmJVE/HNk4DygT089hd91kYNA274LllHRs4RiPiV\nUFiGeXsDmomESMnLtfBrtHXw1Mfr9ZBzxPxPd7QJi6sEA3AQrWv6KxYbvu4S\nXxyT\r\n=Pbjx\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is modeled after the browser's\n`<input type=\"range\">` element.\n\nSliders follow accessibility best practices per the [WAI-ARIA spec](https://www.w3.org/TR/wai-aria-practices/#slider)\nand are fully RTL-aware.\n\n## Contents\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\"\n       aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   `data-step` attribute on the root element. This will be the step size for\n    value quantization. If not set, the default is 1.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"20\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `tabindex=\"-1\"` attribute on the thumb(s)\n*   `aria-disabled=\"true\"` on the thumb(s)\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"-1\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\" aria-disabled=\"true\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the thumb element's `aria-valuemin`,\n`aria-valuemax`, and `aria-valuenow` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"75\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"b5253c9af3b0721aeb0cd096ac48b4c113801757","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.21.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.52dc55acf.0","@material/rtl":"8.0.0-canary.52dc55acf.0","@material/base":"8.0.0-canary.52dc55acf.0","@material/theme":"8.0.0-canary.52dc55acf.0","@material/ripple":"8.0.0-canary.52dc55acf.0","@material/animation":"8.0.0-canary.52dc55acf.0","@material/elevation":"8.0.0-canary.52dc55acf.0","@material/typography":"8.0.0-canary.52dc55acf.0","@material/feature-targeting":"8.0.0-canary.52dc55acf.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_8.0.0-canary.52dc55acf.0_1595869730610_0.03788909256432449","host":"s3://npm-registry-packages"}},"8.0.0-canary.d4274ff05.0":{"name":"@material/slider","version":"8.0.0-canary.d4274ff05.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@8.0.0-canary.d4274ff05.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"8107b5acacea9e5cc2e3de2cd9170d0871103238","tarball":"https://registry.npmjs.org/@material/slider/-/slider-8.0.0-canary.d4274ff05.0.tgz","fileCount":38,"integrity":"sha512-qMdiSLggWd6rQxgoxMJlOumAzLVh1D3d/dp6QQ/95NNB2OpGrJ17rGD4e9J9+qWFprcBSezoday1LMfgPdiRxQ==","signatures":[{"sig":"MEQCICGBL4DRSDFIFKPH6qrFqcUQKGH4tqLo4GgTqs+xqXbYAiBqeyAlnUI61lO7TRxSNQC3ajJJLYvEVAt4tfUZsPIFyQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":716757,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfHzBRCRA9TVsSAnZWagAATCwP/1jhka2DiwdfOl5o/Zdp\ntIIpJ08ZWkSBKYiLsw9FQ7m9pfsIvxV5h6yCRj9q4Kc2skFW5EZHDE9Hf9di\nlO7TB592zSLhSA+fpqPJa5lf0Ii4PRT0PKXGNp9R8MDYr0P+3kjTR5rvrEPx\nDUeHD+iAXmOqmV6BbvFMYVIsJ+VcgopH+YawDW2Flzih+dVgIxmQ4tnfdXPP\nvUaeLzl9jhMXatAHp0Suwydi7X7kBbHyD9zGCAeyQELcDw7wwUOL/tNSWtEg\n8NjqW++gK6glqmIKB0ekxkE+x7DGWJ+U7BQdfbihRxVXaH7JMWWKEpwic68h\nneocJNdIdPjbrqIJMfwCFsOCeGl10d26m6XOQ58/O5O2BgcxT9Q2ChDv3Oky\n/0J6sy7fvdsByqatqi/MMZ8dHtHDroHZdRroq3fQFrx4afQX/vecHKyt0mZk\nchuRHNvKMwk5gOLT9y2A1WfkRFV53vCdBPMtjpWFmH5Xc6cRDqvLKcSdTqN4\nm3TP9I4Ol/EJdTcOlIBk5/0cignFYKOpuwVRAbRsqamgVt7ib+Bz3zbaHJvl\nflnDNDOFTn5OodAxOoEOVVF8XxD2NTScPVRTTjrIEUxuoPj3cRA47A2uRMCG\nOxBERbKPJ6g3+aLdJI0I7RariOIZ0KRj97cVE92JGUJyF5HEIUT0PaqqWj/K\nYWd8\r\n=Vrpt\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is modeled after the browser's\n`<input type=\"range\">` element.\n\nSliders follow accessibility best practices per the [WAI-ARIA spec](https://www.w3.org/TR/wai-aria-practices/#slider)\nand are fully RTL-aware.\n\n## Contents\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\"\n       aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   `data-step` attribute on the root element. This will be the step size for\n    value quantization. If not set, the default is 1.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"20\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `tabindex=\"-1\"` attribute on the thumb(s)\n*   `aria-disabled=\"true\"` on the thumb(s)\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"-1\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\" aria-disabled=\"true\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the thumb element's `aria-valuemin`,\n`aria-valuemax`, and `aria-valuenow` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"75\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"b4607e708cfd7069d540b1fd6042775c4599855e","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.21.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.d4274ff05.0","@material/rtl":"8.0.0-canary.d4274ff05.0","@material/base":"8.0.0-canary.d4274ff05.0","@material/theme":"8.0.0-canary.d4274ff05.0","@material/ripple":"8.0.0-canary.d4274ff05.0","@material/animation":"8.0.0-canary.d4274ff05.0","@material/elevation":"8.0.0-canary.d4274ff05.0","@material/typography":"8.0.0-canary.d4274ff05.0","@material/feature-targeting":"8.0.0-canary.d4274ff05.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_8.0.0-canary.d4274ff05.0_1595879504998_0.14661101419394296","host":"s3://npm-registry-packages"}},"8.0.0-canary.b82d0696d.0":{"name":"@material/slider","version":"8.0.0-canary.b82d0696d.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@8.0.0-canary.b82d0696d.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"78805ae864110406fc4de2dee82a2d6b2fbed19c","tarball":"https://registry.npmjs.org/@material/slider/-/slider-8.0.0-canary.b82d0696d.0.tgz","fileCount":38,"integrity":"sha512-qyhL4MRpW26R5CRIz2+Z+PsDICHwx1mJ77hgFTh/XqnAcHZG6HBCVYEyoaxZqgWhzHXwzpPQqQiN+kEVfTRWQw==","signatures":[{"sig":"MEUCIAcd0z2D//8LZg0NNv6/qiY38lUcPhcCFCPZ11kLiDqXAiEA7ot+DAYG7wX4Llpsy/YndP/CgycGt0kUXiF+4qf5vQg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":716757,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfHzHjCRA9TVsSAnZWagAAGosP/0iSS8Lb+Rt8JmjIfuN4\nWDahVx7t9IL1nfQix8OCvgwDQMNgACLAdofeI/ZcWbOvP69HEbY/QO2eJ5oY\nYFAP/6icdeiA9XB2zXOCbreOkNk87PvXHVfXsg6q+BoM1UHcbhnjMhzVUN6r\neTBccIED7PVc7qTnfOuj44qnmFqpMRKidsmWLAhmHQCY4qqGHbFhquuNnOPA\nq4FAS4AqObOFLFzJ1+c2Xjb+KKdVa+RfTkeuqLdZILhDyF/hChkof/tDwWtt\nVgdnYNr9eKWvtA0FMoKw14zlELFqYVOPhd4uhQt2/ANLVqGPij6Gs+h8sxr4\nrYKQpCBVkAlSOAu5fSW9UJh6SQZNroc4ir3HjNXJRc/pRslNJNfNrmKXXJTG\nLYhvMa3i9gOEafBFNsDw2OEMNcUWQQefaj0IPwBTWtiWzf1WCBeE+sD+iIlA\nQSCEOK150km8iyX0SBeOz4//a1mBwxT+lg+3w1Yk06SZER9LXq00Sd09aOad\nrq8adwj/wAeeCMSFpJH7xezx8qIMQUw2BZun3xEPto5vbO2WHAcAn+g6xhpu\nUUaXkgQ1NqdR7pTBi1uo/pt1Tq9d/Wt3xrSNjTghhg9xAFfbZFo+xpLfah2y\nQanj2LSmQXjjj4u7qv5pNjHXfh6e57Qk6zftVyyi3+jCUxbtYS8FT6sMLP+Z\nGEYK\r\n=lxCZ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is modeled after the browser's\n`<input type=\"range\">` element.\n\nSliders follow accessibility best practices per the [WAI-ARIA spec](https://www.w3.org/TR/wai-aria-practices/#slider)\nand are fully RTL-aware.\n\n## Contents\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\"\n       aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   `data-step` attribute on the root element. This will be the step size for\n    value quantization. If not set, the default is 1.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"20\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `tabindex=\"-1\"` attribute on the thumb(s)\n*   `aria-disabled=\"true\"` on the thumb(s)\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"-1\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\" aria-disabled=\"true\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the thumb element's `aria-valuemin`,\n`aria-valuemax`, and `aria-valuenow` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"75\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"914e71226c9aee0625b5bd1fff56b887e3c924d7","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.21.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.b82d0696d.0","@material/rtl":"8.0.0-canary.b82d0696d.0","@material/base":"8.0.0-canary.b82d0696d.0","@material/theme":"8.0.0-canary.b82d0696d.0","@material/ripple":"8.0.0-canary.b82d0696d.0","@material/animation":"8.0.0-canary.b82d0696d.0","@material/elevation":"8.0.0-canary.b82d0696d.0","@material/typography":"8.0.0-canary.b82d0696d.0","@material/feature-targeting":"8.0.0-canary.b82d0696d.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_8.0.0-canary.b82d0696d.0_1595879907236_0.534173736091422","host":"s3://npm-registry-packages"}},"8.0.0-canary.c2852000d.0":{"name":"@material/slider","version":"8.0.0-canary.c2852000d.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@8.0.0-canary.c2852000d.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"945572ca9e21adb814a14f7734ca7e36a1c90414","tarball":"https://registry.npmjs.org/@material/slider/-/slider-8.0.0-canary.c2852000d.0.tgz","fileCount":38,"integrity":"sha512-86fkYMLCkMH24L4zj5T77C6DDwbgLXMGAPmRuGbtNCWmDoPDpyXNBIblHjh+yvjwmtmQhXH6ZVhhMCem4LxIUg==","signatures":[{"sig":"MEUCIQCXOg/4v9G00LULHm5kSsWSO57ED48NHknlrRWz0oMGrgIga5l2U1vdpp9p2UwrvG86V11+SYY42WRCVu7S4SS1kms=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":716757,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfH0ABCRA9TVsSAnZWagAAn50P/jrHa0JO0pjX9NmKveBU\n+DQI/7zmkhd1iscYWYTQuKgrCoFX4jfSYUrCTxoEWIWdR0+Gag8oK91QTeFW\ncvX9lfCvGBgaAXN+PcL4zNfD8r56prq43cg+elxlxr+/3xkNqf8js2ogZplJ\nYJLqDz7I3KPE1RHEfWeevyUWNiSWkjzX0kbxA280LTQWlr9Taze1RPIM98Qm\nULZWkCg3z+xWsf7aMNzk15pnQTBa8R/OYa5C42WqlCznD8+NKITsiP5Z4C+G\nKdBdPIwfayEzuDrWjzIGZZ/Bmwtmulb8DDp8x11ooLK2RmgFcFX3RpQdcsmV\neB1A4jwdy0P/CWbw1HBRq0eShF9DpBEZ1ZaxvtQEj1BKf2NWIgZTW8P1LuLv\nG+Z833f0ZmBQNQalwUsB1SQr+H79nc0Uv5am95uTC2DmGfES0NmAkcNSy29h\n5A0vO6i8uHFBUrMCCYZe1THSTqYBcDw+3/8df4JOkneerEv3wpLAy8o0LTCn\nWFzqiZRj1O4k/t7ZtIP9TTOq4H4uvicP2KO5boHsjwgSZTOh3M9oU6JQjr76\nXariKf/QqM7qiniiX94gtFkTow5tJT4QBTbwT/XEd1R+bSXZGXOWDAUd3ImJ\n/82WRmLHwrI56WNS+/jylwC7sm9/M94fGzrv+env3YehHINJeS0O+5GTqGng\nd3gn\r\n=bjLn\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is modeled after the browser's\n`<input type=\"range\">` element.\n\nSliders follow accessibility best practices per the [WAI-ARIA spec](https://www.w3.org/TR/wai-aria-practices/#slider)\nand are fully RTL-aware.\n\n## Contents\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\"\n       aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   `data-step` attribute on the root element. This will be the step size for\n    value quantization. If not set, the default is 1.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"20\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `tabindex=\"-1\"` attribute on the thumb(s)\n*   `aria-disabled=\"true\"` on the thumb(s)\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"-1\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\" aria-disabled=\"true\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the thumb element's `aria-valuemin`,\n`aria-valuemax`, and `aria-valuenow` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"75\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"53080ff99f83ab326fefffad16cd09e449e79f27","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.21.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.c2852000d.0","@material/rtl":"8.0.0-canary.c2852000d.0","@material/base":"8.0.0-canary.c2852000d.0","@material/theme":"8.0.0-canary.c2852000d.0","@material/ripple":"8.0.0-canary.c2852000d.0","@material/animation":"8.0.0-canary.c2852000d.0","@material/elevation":"8.0.0-canary.c2852000d.0","@material/typography":"8.0.0-canary.c2852000d.0","@material/feature-targeting":"8.0.0-canary.c2852000d.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_8.0.0-canary.c2852000d.0_1595883520599_0.7841258584209387","host":"s3://npm-registry-packages"}},"8.0.0-canary.f86f83f54.0":{"name":"@material/slider","version":"8.0.0-canary.f86f83f54.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@8.0.0-canary.f86f83f54.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"c88a880e7e09dbf43b45982a2fc0b675988d5fda","tarball":"https://registry.npmjs.org/@material/slider/-/slider-8.0.0-canary.f86f83f54.0.tgz","fileCount":38,"integrity":"sha512-LUEZch0G63rfb3KMeTJObJ8OrPG9zQ/lxg/Ol2/AN4O+WLVCdRsB1N4HdmoL6EfIrLYtrC0/YJFasEGgBOoIiA==","signatures":[{"sig":"MEUCIDzD598duH6Jt12kvsON6ov3wjesZi/Pxy7JCuoshAjnAiEAs1dakqoF3YtdqyJytsJBZBQJvoaAWKICP7lfAGGj1MQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":718654,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfH00OCRA9TVsSAnZWagAAG5YP/0MZ4ynu5TFtJaJHcFt0\n5WbJGtN0dI9CHEZLBzY8iylKklrecQvDg5RU2LV1a++F4m9hlcEkyWxf2COm\nH3YKB07tMxf/DAjoLqHf0MhR4SFQhnKTDxmp0CPp56IkUsZBThkTK+zR3ovH\n+5rQLXrm7Nxm8a+yWD8Vjc3/4YZ/1zXwZbMNPKJurszfPkU86kZ/mr5wNh38\nWLdHGkRkaEMKwBVA2ovGz7PnmlvbHEBG7KV0k5T9zUNdjuPkRhiUUoZprYUA\nQ01MW+3v38lMjm8YSYN4xL8moVOV3JM/jjeKzqaSmjm/SIJEiWReK52fKy+u\n6eQwmDNhf7n6zSiq3+LP3k7OkI2H28MqyIH5qoayBuHB3avtYMNYuZJG3riG\nIFDyi6kioODXITBeRVEOoK4Q7kGhM+XLs2ulrEGz+l3m9/VC8N+OO9SW2Y/E\nVZht/Sg/SwXteqBwAnlYf1Yv/jeN+/XFCFHefvDL+wIAu3Rq+Ubk/Dg9kmdL\n/A+S4P6cc3heyJ8GDBdheTlc7wja8VfMe2WJWXELTgHxrd4nM+FSdjXb9t/B\nf1WUl2VaQXCBHZQ5TRG88q2lwP2nP76xxerS95b8YkjdOpCSClwcGuGuad7f\ncoo0il5GBpAK60tzjk232Rz5nDcXGMls2G9CWcUB6OJXNoTD7hWazgyu+6Ru\n9EQl\r\n=fGbh\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is modeled after the browser's\n`<input type=\"range\">` element.\n\nSliders follow accessibility best practices per the [WAI-ARIA spec](https://www.w3.org/TR/wai-aria-practices/#slider)\nand are fully RTL-aware.\n\n## Contents\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\"\n       aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   `data-step` attribute on the root element. This will be the step size for\n    value quantization. If not set, the default is 1.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"20\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `tabindex=\"-1\"` attribute on the thumb(s)\n*   `aria-disabled=\"true\"` on the thumb(s)\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"-1\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\" aria-disabled=\"true\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the thumb element's `aria-valuemin`,\n`aria-valuemax`, and `aria-valuenow` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"75\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"3c8abc334934dd33ace7aec681868717a4e26d0b","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.21.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.f86f83f54.0","@material/rtl":"8.0.0-canary.f86f83f54.0","@material/base":"8.0.0-canary.f86f83f54.0","@material/theme":"8.0.0-canary.f86f83f54.0","@material/ripple":"8.0.0-canary.f86f83f54.0","@material/animation":"8.0.0-canary.f86f83f54.0","@material/elevation":"8.0.0-canary.f86f83f54.0","@material/typography":"8.0.0-canary.f86f83f54.0","@material/feature-targeting":"8.0.0-canary.f86f83f54.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_8.0.0-canary.f86f83f54.0_1595886862556_0.13990839836220648","host":"s3://npm-registry-packages"}},"8.0.0-canary.41eb1684c.0":{"name":"@material/slider","version":"8.0.0-canary.41eb1684c.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@8.0.0-canary.41eb1684c.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"fba4bf109954e683281c83937feca6b1bddd3b3b","tarball":"https://registry.npmjs.org/@material/slider/-/slider-8.0.0-canary.41eb1684c.0.tgz","fileCount":38,"integrity":"sha512-MPi3mwWsmDn2XPw+4+cymFAO7quQKRBthazrrMUPsueEwmHl4yiMhDlUzArzavKuctnMW3qPONycYHmGN30v6A==","signatures":[{"sig":"MEQCIDmBGieeB5TheEGPawYbbxxkipmr7GRo+UZXqydcX8wMAiB8xl/D+zPX/8bzNTDEc0X3eMVmyfnwj3yvJx4y3l4Xlg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":718910,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfIGVwCRA9TVsSAnZWagAAUHAP/31d/nUDcnlrhi8c0SCq\n044gl6pzQihgb+KA74qWCaVytR3qsTybnzAXPK/ACNigaBO1rgKsjGgGOQia\nMExj6raxoFLgdlCPwf5KGRSHKa/wLZwGg1BnmCKUq0vwoNRKOkYml2VmtQzW\nQFuql9shNdvVAOT9s30YABiVoq/dR21z6cdXfZdidxosonQ6CKkkpIkeojiU\njKSmhaRFodPyVoPxW5ZVe4tS2lxSKba3rFVw50+M0xl6HuhXi349rz/fXN50\nMxF0zl3iJF//g0Ot4kfIEpoPr3ySpfxyked5uiVVB4zMQTjNAjVV2yjvbXqX\nn5qUhrkzV6dPy5L/MWrVrIwfKWP2W8hdIxJwXsVHXXIBAbF0qKmR1rrmxyuA\nJEQOLHzmZr7f1O8MZv68eEhMN8ksrRu1MqYiU+Ih+vks2vmtObszaFVXKH+a\nqd+xPwAbizlQinh3FhMaN5opxRFskHLRi5r6//TUVHWtuiWsCuVjbf/XjlOi\nPX8XwhVqBD6nvPsAbRCZ/pFGqZoDWXOvd1HNlbBrUfISj1ccO5a7ZK20lBbz\nIwrZwcjP5mogga+8lM/RWPE8NgtfFrEOUOwVH68DpZkLLisuqQldF5AwSd8+\nK/jaUtHpt49WT9xsllaUvFb6dp7gKaNRazPfQW5ExdoLfNtJ9oIPSF0yD/bE\n+Cw+\r\n=0I+V\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is modeled after the browser's\n`<input type=\"range\">` element.\n\nSliders follow accessibility best practices per the [WAI-ARIA spec](https://www.w3.org/TR/wai-aria-practices/#slider)\nand are fully RTL-aware.\n\n## Contents\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\"\n       aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   `data-step` attribute on the root element. This will be the step size for\n    value quantization. If not set, the default is 1.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"20\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `tabindex=\"-1\"` attribute on the thumb(s)\n*   `aria-disabled=\"true\"` on the thumb(s)\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"-1\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\" aria-disabled=\"true\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the thumb element's `aria-valuemin`,\n`aria-valuemax`, and `aria-valuenow` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"75\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"ca556c545f0bd908ba57eb0e24e99d142cc05b1b","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.21.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.41eb1684c.0","@material/rtl":"8.0.0-canary.41eb1684c.0","@material/base":"8.0.0-canary.41eb1684c.0","@material/theme":"8.0.0-canary.41eb1684c.0","@material/ripple":"8.0.0-canary.41eb1684c.0","@material/animation":"8.0.0-canary.41eb1684c.0","@material/elevation":"8.0.0-canary.41eb1684c.0","@material/typography":"8.0.0-canary.41eb1684c.0","@material/feature-targeting":"8.0.0-canary.41eb1684c.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_8.0.0-canary.41eb1684c.0_1595958640272_0.16405667602639906","host":"s3://npm-registry-packages"}},"8.0.0-canary.9e2f6c450.0":{"name":"@material/slider","version":"8.0.0-canary.9e2f6c450.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@8.0.0-canary.9e2f6c450.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"3a52b82ed3d742cba6de9cbdbec5f370956ca45a","tarball":"https://registry.npmjs.org/@material/slider/-/slider-8.0.0-canary.9e2f6c450.0.tgz","fileCount":38,"integrity":"sha512-E/EXTPjuCTV8MoVKFZcClaCpyaFwOhdjQ0Y3/M8GNp1Xtnm4B+c17RPUF7YZvnvyd7ziF/jiwlQmdTiWp5GqCQ==","signatures":[{"sig":"MEUCIQCOHENDHCQcHZrxjXOu98DybX01lgGHjoT+nXD0xRyKsAIgOM41d0bnA8HBdsvD6n7d4RMgqfuW/UCvNS4ItgRZ3iY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":718910,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfIKkoCRA9TVsSAnZWagAAA2QP+wQPFNq/Z86TQ5MkhYE9\nkeQ5FWuqcMiNOpW5kE9flVkNugstIu4v4y6tyQwfIjZvJuSrkhNDYZ1CFkmB\nd/wUNSxc8TuCAFmFgLSg4xoP5uH56PqShZDSkD4hMWAGHeqe112C7u9R5M7b\nU42hgWnR4xKGS6mlzKRVCqfK/cEHW46tQqeJ/qSxNiU0nOaevPewnUKPYnNu\nEl6rM6vTEYkyVk3WUqFmHyHZACSPmEkp9lHcIldD84YGLx4rIQCzolaFiQU2\n+LcZTMWoSaqlct8WlcZ+hHhHvrhx+xIhSh3f55vXSlb413/z6+ZRkJpnc8db\nl0NI08Jg60e1HUZlHe9qUGmGiA/CaJMudiQ64okas5WQpzr+8aVMSAg55tAT\nnSfTD9o3UOyPgs+NVVPSF2ib9JFmMEHtktKkaGaNw99ElIA/nMAIvCoGqlw9\nX5F+pSed6sn/wS8BkH/ETh1dVAY7OMJo1Ms+PLMEapCAsrC2pWbLoVMsRlWc\nfGaG/T0NrMwk0TBjIShp+ngVwG4nm5RG6nhsBnJOelzX3yL/TkPiVWWcEkUV\nBgWD7ogBPhkKP14d7x8yJdHvkEHtNW5/fpUswEjl3ZwVpSSj7x/SIdOLBsJr\nxcUN5xjFA7NBiJmfokYgkGdnzo0ZkneSm0l0CmE4rYc8eDk4OWGQMumVTIfZ\nKGHf\r\n=atNW\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is modeled after the browser's\n`<input type=\"range\">` element.\n\nSliders follow accessibility best practices per the [WAI-ARIA spec](https://www.w3.org/TR/wai-aria-practices/#slider)\nand are fully RTL-aware.\n\n## Contents\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\"\n       aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   `data-step` attribute on the root element. This will be the step size for\n    value quantization. If not set, the default is 1.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"20\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `tabindex=\"-1\"` attribute on the thumb(s)\n*   `aria-disabled=\"true\"` on the thumb(s)\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"-1\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\" aria-disabled=\"true\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the thumb element's `aria-valuemin`,\n`aria-valuemax`, and `aria-valuenow` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"75\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"20a3870f861650ab884eeffe1d7657aa376a8ee0","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.21.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.9e2f6c450.0","@material/rtl":"8.0.0-canary.9e2f6c450.0","@material/base":"8.0.0-canary.9e2f6c450.0","@material/theme":"8.0.0-canary.9e2f6c450.0","@material/ripple":"8.0.0-canary.9e2f6c450.0","@material/animation":"8.0.0-canary.9e2f6c450.0","@material/elevation":"8.0.0-canary.9e2f6c450.0","@material/typography":"8.0.0-canary.9e2f6c450.0","@material/feature-targeting":"8.0.0-canary.9e2f6c450.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_8.0.0-canary.9e2f6c450.0_1595975975828_0.823226522468872","host":"s3://npm-registry-packages"}},"8.0.0-canary.e6950b55a.0":{"name":"@material/slider","version":"8.0.0-canary.e6950b55a.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@8.0.0-canary.e6950b55a.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"df491be1d098b97793b1107e87dad08fbc48f7cb","tarball":"https://registry.npmjs.org/@material/slider/-/slider-8.0.0-canary.e6950b55a.0.tgz","fileCount":38,"integrity":"sha512-T203xZ+1nTIFFYWjQVwebCQ6nyVAjYx4B4Uyr96gXHXfVk1wlsCzSWYFAPYFdx4V9PUevDJ0mYDJfUxJjvNCNg==","signatures":[{"sig":"MEUCIQDD72BZRVasZLoMn6aT7D9ZUJfP5PVNe6OOEKVLWVSy7wIgXYWvCrq9jVn1XKjEXQI7lx4CLeiR+C4KhTaVjjTKmMw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":718910,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfIKxCCRA9TVsSAnZWagAAOX4P/3hQ8rDPPNcV8VkXjW+m\nlAtXgNz4c7mHeGWf3Zuk/wXs/Q8syim1hbOLfpNYMYngXhxu2FFP+D8XTjfZ\nToo1DdEl16/MVJy/XfyvkkyC2Q1y5eCWY96dMbLg7ATV+D506+do89D3I27S\nXv44wzOAK+1IWT6FEq7P3DnzgkztraRCgJXSwzwgkNwpvF65j4X03FEwz8eZ\n7eCFfUQXCTRTskCm9+S0BWQRA8f54/BBIRokl3OeMNVuhq4LkBzF80UtiBDt\nh3brG/aVF9FHddEuZ/90ZoY5w2iQPFa954JPlUZ8V209NIag+4gcoFylILz3\n2/YfI6+cuzh+PS6kVSdqh+IigM+DLL4nKOfIXGVHSloUkhyNvwJpMEifaVZT\nMUwZ84xfUi5FZastQRBuZp9OlAvl614ZymdwRnV6E5F7A0jgtplWUFFInUow\n+m6ELZZipsexr+KsHK/7CRg9ls9LCXzppujhjr7HNsiA6Th332qZ1YEghwOQ\nTtvAs15UJZomjb/5NWcFKi/4LQ7THLsX4YXLMcsvYrMnyDV2HWERDjOyM7wr\nCvdNz0W9Vz008ak1jybwmdOfs0DFc69jthZKVElmw1HfClYD/4BDfDfaPDeX\nSykdeSGrD1DsOQonxCYg2Km4eZr2vfVmTrwVDymaLHuywJ1psMWzxxIIPp+9\nKmO6\r\n=gKg7\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is modeled after the browser's\n`<input type=\"range\">` element.\n\nSliders follow accessibility best practices per the [WAI-ARIA spec](https://www.w3.org/TR/wai-aria-practices/#slider)\nand are fully RTL-aware.\n\n## Contents\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\"\n       aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   `data-step` attribute on the root element. This will be the step size for\n    value quantization. If not set, the default is 1.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"20\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `tabindex=\"-1\"` attribute on the thumb(s)\n*   `aria-disabled=\"true\"` on the thumb(s)\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"-1\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\" aria-disabled=\"true\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the thumb element's `aria-valuemin`,\n`aria-valuemax`, and `aria-valuenow` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"75\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"c71461d7d95f313de3fe5609fac67c2302432c36","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.21.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.e6950b55a.0","@material/rtl":"8.0.0-canary.e6950b55a.0","@material/base":"8.0.0-canary.e6950b55a.0","@material/theme":"8.0.0-canary.e6950b55a.0","@material/ripple":"8.0.0-canary.e6950b55a.0","@material/animation":"8.0.0-canary.e6950b55a.0","@material/elevation":"8.0.0-canary.e6950b55a.0","@material/typography":"8.0.0-canary.e6950b55a.0","@material/feature-targeting":"8.0.0-canary.e6950b55a.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_8.0.0-canary.e6950b55a.0_1595976769471_0.42522565374888655","host":"s3://npm-registry-packages"}},"8.0.0-canary.5e51ee38e.0":{"name":"@material/slider","version":"8.0.0-canary.5e51ee38e.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@8.0.0-canary.5e51ee38e.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"7dbe234090b615138857f1c435587a1082e2ff02","tarball":"https://registry.npmjs.org/@material/slider/-/slider-8.0.0-canary.5e51ee38e.0.tgz","fileCount":38,"integrity":"sha512-yNsO0U+kySMVtwfFirRzViM3yD6/6eWmk8KqnJyGVCU9Rk2gowv5u4R1WS3znz4mqnf9cDA3LLsGgqxYQlFpAA==","signatures":[{"sig":"MEUCIQCB4hNJqF6Bz89M0P0Waod2ilqzRu+PzFXe9JbjKnGWkgIgbUg+MWsndYmxLl49XaTp2j2NySVdgVLVoR9Hk62MrIo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":718838,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfILHHCRA9TVsSAnZWagAAVq4QAJhS1gyiMCMKYPgaR0QU\nngHwpdALEZqNxU4VCDQ0d2QuPr88EVNsTo0qWaWKpbkMJpN0Pq6G/C02CtWM\n49JXjk5iLtYH9jlq9io7Q1GDKQtgG/BY+YPlD+R2iy0kJNLzPh+9wxCbeQvP\nv113RPL6sJHt3PV8CHT1osKsntmC2F9rWYSwgBueNvpackD36ANFtGTxa8XC\nVS6axZ4fFH1plYGFY14zCKmW1f1jx0dvw6TwfrcCamtyceaRRw7bFXPBJUNj\nypR+cluCHh4sGsoGhcU9RyiMhSfgL95sVaPeHENL+gCnXmM74pgtaa4yjcCH\nBAyplLNxwkaB2RvFtkwEM/EUxRzh4XOTQrhFVMXv2ShcBJWufOzFDWtaH57B\n8JI55CmItGac3WpH/XZMPuwTeMSVHydRr/VPR5cFFfoYDL+NRwPBa1Sq086I\ncJhAAD5dFtQN1UtSOMSAXVVXST69Ba/qiDky1JiCS/XmUd454JAWEL8gyhjY\n/dw/cRn4Gbw8fg+kptNuYi9Il8OjOmmAiiP+rrCFOtjoOKRbgVCmK9Rx8vyS\nuJpp9gvmen8X97EsHcVnYqU/2ayBnjlNLuyUd6IFXPwAcqZjLLmPbHwUYZi7\ngbs36/jFwOYtUSaLKs48hRXuIqPsq7ZAf+bU7c0ZNjoidQuutjfS1lbM1J8u\n/d/K\r\n=yy7F\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is modeled after the browser's\n`<input type=\"range\">` element.\n\nSliders follow accessibility best practices per the [WAI-ARIA spec](https://www.w3.org/TR/wai-aria-practices/#slider)\nand are fully RTL-aware.\n\n## Contents\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\"\n       aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   `data-step` attribute on the root element. This will be the step size for\n    value quantization. If not set, the default is 1.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"20\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `tabindex=\"-1\"` attribute on the thumb(s)\n*   `aria-disabled=\"true\"` on the thumb(s)\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"-1\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\" aria-disabled=\"true\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the thumb element's `aria-valuemin`,\n`aria-valuemax`, and `aria-valuenow` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"75\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"a7ac25d06cd849dbb8b1620235e913c46f5d7849","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.21.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.5e51ee38e.0","@material/rtl":"8.0.0-canary.5e51ee38e.0","@material/base":"8.0.0-canary.5e51ee38e.0","@material/theme":"8.0.0-canary.5e51ee38e.0","@material/ripple":"8.0.0-canary.5e51ee38e.0","@material/animation":"8.0.0-canary.5e51ee38e.0","@material/elevation":"8.0.0-canary.5e51ee38e.0","@material/typography":"8.0.0-canary.5e51ee38e.0","@material/feature-targeting":"8.0.0-canary.5e51ee38e.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_8.0.0-canary.5e51ee38e.0_1595978182687_0.77065415938556","host":"s3://npm-registry-packages"}},"8.0.0-canary.a3898ffcf.0":{"name":"@material/slider","version":"8.0.0-canary.a3898ffcf.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@8.0.0-canary.a3898ffcf.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"0da9bafb42bb2f9e2baf9b7a7ea9777d49c8b5a5","tarball":"https://registry.npmjs.org/@material/slider/-/slider-8.0.0-canary.a3898ffcf.0.tgz","fileCount":38,"integrity":"sha512-fAVzUDOM663TNKzD/AppCoj8lrCibRYk3oF8KIcl9D1NG3kudhfHalX71gRLs/dBNs1kyliTsBSfxGh2jgC4TQ==","signatures":[{"sig":"MEUCIACZt+tpP3vnF6xV/2T+GqHXsIeKZHJV6eqGfAlQXSndAiEA67ljMuBvih22o1FmmUXt2+lK09ZNLloe7Vw9SYSovCs=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":718838,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfIMSaCRA9TVsSAnZWagAAHbMQAKRMHMYsO1K97BGHLXlY\nREiXSjd6qMS50+jw+Iih2JvL6HY9NZt6JtJRI6GDKofYOUEkcHxwhBPD1BFB\nffwpmwSBMxg5i9LxPfg1wgxaniCsUNdTFc2wMIiz6OktQCUQZX30EjSGxLA3\n8Y5faPSzJOMVwyJ1buDOWf+t4po8iFAjE2mP71+kEU8uSr/yAFgQQlIFKX8w\nPnkNYaU5rMJXJ9Z474YsrR2Wq5krhKQckCcUI1NmovrA1xvKa66Sq50VHjn9\n0ad+XNoI6e2QHq2xfO9NoMBSTLiYPC3bnHfnWDbVXA1VTbfzMyxT6wFV7ydZ\nZSakHrWoI1C0VRu3XgV+3h9oTSJW0BzfpCYglyvAnLwwhvehsx3a//LpHWyG\n0wggVXkmSped0xvlkF1oue0UOnZMdw3TljuK+R4YT/emd4DqjDJJ2pVezREO\n5kdCLxP7F0OAIdn1usfaLhN0svTrjXFkHVy+kzhpnQAdDjtMXAct//shoeSt\nwdrxKG4xUA5rBGwAJBIYJYCRXbtlAprkTuxElcc/sRk3wgv8CA21IOy5aKx/\n99Dqc4lfHh8XxUV0RzX5B+YdH8mBP22HCO9amo7dXsPPdmYzZjGhAo+7/DtE\n96A/pBWxrSS0ap3ZS3XMK+j2/CD+Tpi8Sh4hkYl8If4+v9tRRnIEZ+Hw7Mwt\nxQO+\r\n=qhCf\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is modeled after the browser's\n`<input type=\"range\">` element.\n\nSliders follow accessibility best practices per the [WAI-ARIA spec](https://www.w3.org/TR/wai-aria-practices/#slider)\nand are fully RTL-aware.\n\n## Contents\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\"\n       aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   `data-step` attribute on the root element. This will be the step size for\n    value quantization. If not set, the default is 1.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"20\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `tabindex=\"-1\"` attribute on the thumb(s)\n*   `aria-disabled=\"true\"` on the thumb(s)\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"-1\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\" aria-disabled=\"true\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the thumb element's `aria-valuemin`,\n`aria-valuemax`, and `aria-valuenow` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"75\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"4382580dcbfc3da31d5107a92231aa87122f3f30","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.21.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.a3898ffcf.0","@material/rtl":"8.0.0-canary.a3898ffcf.0","@material/base":"8.0.0-canary.a3898ffcf.0","@material/theme":"8.0.0-canary.a3898ffcf.0","@material/ripple":"8.0.0-canary.a3898ffcf.0","@material/animation":"8.0.0-canary.a3898ffcf.0","@material/elevation":"8.0.0-canary.a3898ffcf.0","@material/typography":"8.0.0-canary.a3898ffcf.0","@material/feature-targeting":"8.0.0-canary.a3898ffcf.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_8.0.0-canary.a3898ffcf.0_1595983001741_0.7452730010724478","host":"s3://npm-registry-packages"}},"8.0.0-canary.bc5cc6c96.0":{"name":"@material/slider","version":"8.0.0-canary.bc5cc6c96.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@8.0.0-canary.bc5cc6c96.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"86447ad985791f2063d419073cb95e236605ba69","tarball":"https://registry.npmjs.org/@material/slider/-/slider-8.0.0-canary.bc5cc6c96.0.tgz","fileCount":38,"integrity":"sha512-I7dW/Jmp/00bSG6lWZ7ngkhn81YclUengLsqwX3w7+r20PCR1Wze03878zgi+tzfarDv40uuBHQEn0m7VVRlmw==","signatures":[{"sig":"MEQCIBwChfeX4kzDmBc/R4xAh4cgzIfkTimXwKD1OJnPxYAhAiA9KRdKQnCwMfi5jtFoMWMOgvNJ+Et8lsqsAKvUeHpwvA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":718838,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfIMedCRA9TVsSAnZWagAAkgwP/2UnbYW9+mbDqaeIIvBw\n+r8xgnLKaxLDRBKk9Jc2T/YHJ80MReXwkgC2DpVNo/7gJ3mOtuACaIA7k7mn\nWgzjLK5upagTSPnj5UzEqHcDTBK3E82Ajil7p0v6YoD1fEFAiumMA82rDE6N\n3UrkuFsN++s8UZi7Ypv3oDknAJec6kmpbE1kPtPayAcFAAt9EZi/xGljwvgq\nlVgOd8yEbFfpSS1AyiZ57P8XfDYTqom7HlwK2VD4VTf1qk8mteHE8eGz2N8+\n0ARbwfifiHAJiLFWBL5W8iXldP4AbCUByts4lpxXpojRTCSduEPvJbG61ibV\n56biO0YOvSiZcRfUcy82WamFtDkM0pZu0sd/Ot/US1V+8Wux6wjEOnMgWMpH\nsX61LDikxoEzFO6oFGlhKLaLfOfxTKh2VoyAky8ThOMYm400rInYGMfnbalm\nI5wh1QWhb4NCKAtxBTdI+9pgUjw5oqdef9PGWyW+0eVvldI2SClUdI3rcBEt\n4JHTfy3JZNGV/2uPGBaQJ4kZN08P9ICtNPj1aKmj5t1B+3ET4ZvYIFLrOrmj\n7O65rKvOhz3WIM50n5/YQLXCLAEkCpAYA5HpLg0F6xjYRHw+aFYFL1Wske+m\nvs+Hwd3nkXhwXmi/WT5HKYm6B9rDvjf2dAnDFSQgjn7YGsJ3oYpLCfpLD7aq\nvG4Q\r\n=jtxc\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is modeled after the browser's\n`<input type=\"range\">` element.\n\nSliders follow accessibility best practices per the [WAI-ARIA spec](https://www.w3.org/TR/wai-aria-practices/#slider)\nand are fully RTL-aware.\n\n## Contents\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\"\n       aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   `data-step` attribute on the root element. This will be the step size for\n    value quantization. If not set, the default is 1.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"20\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `tabindex=\"-1\"` attribute on the thumb(s)\n*   `aria-disabled=\"true\"` on the thumb(s)\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"-1\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\" aria-disabled=\"true\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the thumb element's `aria-valuemin`,\n`aria-valuemax`, and `aria-valuenow` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"75\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"ef5b32f85df29f3c19f5f6960f0f2e58025012da","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.21.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.bc5cc6c96.0","@material/rtl":"8.0.0-canary.bc5cc6c96.0","@material/base":"8.0.0-canary.bc5cc6c96.0","@material/theme":"8.0.0-canary.bc5cc6c96.0","@material/ripple":"8.0.0-canary.bc5cc6c96.0","@material/animation":"8.0.0-canary.bc5cc6c96.0","@material/elevation":"8.0.0-canary.bc5cc6c96.0","@material/typography":"8.0.0-canary.bc5cc6c96.0","@material/feature-targeting":"8.0.0-canary.bc5cc6c96.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_8.0.0-canary.bc5cc6c96.0_1595983772994_0.09258357887394775","host":"s3://npm-registry-packages"}},"8.0.0-canary.9bdeaf928.0":{"name":"@material/slider","version":"8.0.0-canary.9bdeaf928.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@8.0.0-canary.9bdeaf928.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"aebfe4fc025e4f3144e58380cdf15f3a6032796c","tarball":"https://registry.npmjs.org/@material/slider/-/slider-8.0.0-canary.9bdeaf928.0.tgz","fileCount":38,"integrity":"sha512-Vkls1UkMrYhO+FMxLkvBoxQjDzFmgESNPkhZi0/6IdLQ7+zXeALH6Z79VUS7l+eVlrT4KPbOvdhB5LwQS/cG/Q==","signatures":[{"sig":"MEYCIQD4R+MVF2p9bTFzwb2AAI41HPy2VI0aRVNNa8j5wpzYiwIhAP+5oPyd9CKrQJl7uWGUjaBo5Nv6huhBXWoxJ6l3EuRp","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":729380,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfIM79CRA9TVsSAnZWagAACf8QAKB5zO1UHFGbc+3TQKST\nvj7JPi/XUxaKovdiMnrBCCBZST7rVsCDeT8U9pxj1X2oBExnAjJ+jxkwffMC\nQ18W+W7Bsd7WshL5bw9k1pmH9hoAe9m/X0Of6V4vNfHlJ/6IKdeboQxp6CsW\nMi3fv62TYx5EQNxsRNExoYZxBH4vuHyE0BZ0eDZIlET5XBrkpanDC7UTMK14\ndOUvA59DbX0LH5LRz7l5TMxj+FYX5rzjyR0fulz5TvFIzo5KTt3L4RCzVIkt\n+X4W2SZ4Xwv4rYlr326pBm4yxs0j5z43b7HoAkfvlqtKgZEi8FN418SOsuhb\nhwKci7uAnxl4NYLX2QwX4VfhRr8dqObzQ/nTtTZcQ0Ay+x695weME7rBnKEV\nqW0Uj+VPB5XNGrK2w+yeW6DnJVlRdnG4RgSZmBv7YQyRZ6xv+HU2Kv7eeQo6\nFNLFtjQicZ78Auq/5YQdoJi8Hr8qHloA66FVyUX/TITb7pid+DAhW8nur04K\nMg8GHP5zu5phZoxJGd/CggAFOw+She3dQ7MQNVukU6kSqnfSQVopIdJDS7tD\nN1/jbK8OiONNziXcaWuhcbwmrxzji8PTh5Gh8dPhc2IZfunnk49jXNMv3zMH\nzeI3T/U/ByPc38fuXZSG4UWtOgCOWv7kmcaPZ3NcoYJLrzV1gC0q6Gvzkn2k\nCau8\r\n=zmFT\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is modeled after the browser's\n`<input type=\"range\">` element.\n\nSliders follow accessibility best practices per the [WAI-ARIA spec](https://www.w3.org/TR/wai-aria-practices/#slider)\nand are fully RTL-aware.\n\n## Contents\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\"\n       aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   `data-step` attribute on the root element. This will be the step size for\n    value quantization. If not set, the default is 1.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"20\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `tabindex=\"-1\"` attribute on the thumb(s)\n*   `aria-disabled=\"true\"` on the thumb(s)\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"-1\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\" aria-disabled=\"true\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the thumb element's `aria-valuemin`,\n`aria-valuemax`, and `aria-valuenow` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"75\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"0fd3de7a6a462365d56e724dcf32c2c1890f553c","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.21.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.9bdeaf928.0","@material/rtl":"8.0.0-canary.9bdeaf928.0","@material/base":"8.0.0-canary.9bdeaf928.0","@material/theme":"8.0.0-canary.9bdeaf928.0","@material/ripple":"8.0.0-canary.9bdeaf928.0","@material/animation":"8.0.0-canary.9bdeaf928.0","@material/elevation":"8.0.0-canary.9bdeaf928.0","@material/typography":"8.0.0-canary.9bdeaf928.0","@material/feature-targeting":"8.0.0-canary.9bdeaf928.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_8.0.0-canary.9bdeaf928.0_1595985660740_0.6284989187444634","host":"s3://npm-registry-packages"}},"8.0.0-canary.fde2c1f9d.0":{"name":"@material/slider","version":"8.0.0-canary.fde2c1f9d.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@8.0.0-canary.fde2c1f9d.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"d89e51c511630fe3ffcc1313082d34dcfe1ddb90","tarball":"https://registry.npmjs.org/@material/slider/-/slider-8.0.0-canary.fde2c1f9d.0.tgz","fileCount":38,"integrity":"sha512-kRBPzBbhI8aBWjNp9HRMiJin6x2ksstp1mZwgq9BPEhzpbecQTEALqCsbbNBCeBlAOondPLR6KOTEN3HkkWmNA==","signatures":[{"sig":"MEYCIQChCjRYz4eCXcVInFflM/dzxghQqXC9LmtJS1gS5k16yQIhAKIl+enKP3WU72Phwo5MSLVBQEmx33tF8PQ+tvLk4PMc","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":729308,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfINJXCRA9TVsSAnZWagAAk3UP/3At9dMw5x1bA18SbvPQ\nw8OC4goi/lGUowVe4NyiHsg3FntQwIpa/+pPMELJwtviaee3d0d7Yh3TiPHC\ndArP3ywVYerZb5setDV5sdYsYLFVcBsGY4oqR5C23OmY7DyLBU8FG8w+qNrg\n6qwckYmH4tjWM5PKEKhPAomcj9KebEMv4P/epI7imN8cyVBE3Rvlfs/zs+oK\nMNKM4FaCtKOKmdHCNs28rTyEJr1/T53i+tNg0DxlcuGACGVuxedLyz/Wk/Xw\nFL/YPWZ6VTNfK7NtPO/Xl7m2y4drcUwP8nVIDqfhy/IdCrKh/RutpwmW79jB\nH+p9tc8nu+phEcTHNFyvsTk34ejRxTVeczQBxao1GxJNHzbHg4VZVNx0Qm/N\nR1rwOnCqVozLEoOfP4Blo7KmCMiaPmol3YzSp5DxuArrv54AVcLb6cmpiiPy\nQgVeM6ywbrOz6094lyVUON4l9YBvi3PvhhSoJt/j784PoWiOfk7QsxE1suB4\nDeXQ8Co9pWUHZagEuRypG8ls+WAPJN5I/CUs28Nmv9eHhzaH/ug8VhG34L/T\np8FqDqzvzNZx+Bpv/a/SPkBkQHhtJpqa6MRyEUifoK3G//mjqM69EWB6F95R\nAdSaWDI946ghtJVYhMvJaQh87LPsorcUblGQoIVT5Y+yV0BjzaAyuKvPF1Iu\nXLJH\r\n=nIYS\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is modeled after the browser's\n`<input type=\"range\">` element.\n\nSliders follow accessibility best practices per the [WAI-ARIA spec](https://www.w3.org/TR/wai-aria-practices/#slider)\nand are fully RTL-aware.\n\n## Contents\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\"\n       aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   `data-step` attribute on the root element. This will be the step size for\n    value quantization. If not set, the default is 1.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"20\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `tabindex=\"-1\"` attribute on the thumb(s)\n*   `aria-disabled=\"true\"` on the thumb(s)\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"-1\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\" aria-disabled=\"true\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the thumb element's `aria-valuemin`,\n`aria-valuemax`, and `aria-valuenow` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"75\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"f2de51610533bd781edd8339c8555a3c03546e3a","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.21.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.fde2c1f9d.0","@material/rtl":"8.0.0-canary.fde2c1f9d.0","@material/base":"8.0.0-canary.fde2c1f9d.0","@material/theme":"8.0.0-canary.fde2c1f9d.0","@material/ripple":"8.0.0-canary.fde2c1f9d.0","@material/animation":"8.0.0-canary.fde2c1f9d.0","@material/elevation":"8.0.0-canary.fde2c1f9d.0","@material/typography":"8.0.0-canary.fde2c1f9d.0","@material/feature-targeting":"8.0.0-canary.fde2c1f9d.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_8.0.0-canary.fde2c1f9d.0_1595986519374_0.6642719937634269","host":"s3://npm-registry-packages"}},"8.0.0-canary.6b3876d5d.0":{"name":"@material/slider","version":"8.0.0-canary.6b3876d5d.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@8.0.0-canary.6b3876d5d.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"e77b18ca7ebb6ea1bac2d69a9410a0e6c3829965","tarball":"https://registry.npmjs.org/@material/slider/-/slider-8.0.0-canary.6b3876d5d.0.tgz","fileCount":38,"integrity":"sha512-7VZ9jffSb6cSHT+TfybYB6VJNrOak3ZlfatCSssZyb3K+Mh/oqR/bvtjZVnMGuFmIZwILV3W2Kxdgrzbn/rXYg==","signatures":[{"sig":"MEUCIQDVT5gE4BrQc8rkQdSwV+SI0tYna1eP1rXSv53ckoMtNQIgP2/7GEc6Wkfmh/bs6+v8mexqsTDTdsszBkILe1NDeYE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":729308,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfINM6CRA9TVsSAnZWagAAjfUQAIBr444lT3hec9swYdIO\n7abIIKc3GfcFdYNw/2UBe4LQwrKtbSYORdLRa4wrxSuuY7MmICI2YF3gRhJb\nKLknrbOJ93Wgn4s8M6GQLsAch2bDXu1JD/BsoV/7fngwb+vaDL1AerzhrlSz\nCl3TUyjO0ZpD7u/8ytcqehUhFBpqdhseewIcpFNUFbTKubdLsQaQC8+vULcG\nr/OVbEO1PRhPv9x9a9KnNYZer97o92wMbFI54Yng0E+xR3dwWHQBW18MGiP8\nPN3Ej4OZpHo4ND3BlnG6yshRCvhunqEEYGtE9uOx19SAjam4xOab7N9UWKgL\nydQAViffzeza0NmAVXh5xkmYKrTEWLpFSD8GA0Jjyc5kSHQBvjgj9GQY/PlG\nfsTgRlJM4fE1rU8Ek5Ns6vKSsRHB/2LlhTZaLsoIVupwbfMbuQ3S/F8OetGM\nErGNKUDDUfaQBNOoajJA1mcNGfIyaXBuBrPHQhRFklia8VaKIHwffy6nd3gA\n1hg+da5k5AqHSjq9XJSD+0qPWvHpQsTa1uo5T2ix8xReCtxkebioXZPnxUIs\nAijC3NvWmsxJTcu+tI75MGkEIMp2vMUx2udJjHO8JRPcY2/w7TI7jdua7tE8\nyO80AWpDOeMUIHnirBY36SY2gDWri0YW1A2inBL96P//eqNsZfwors9TfM07\nO9E8\r\n=YGeB\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is modeled after the browser's\n`<input type=\"range\">` element.\n\nSliders follow accessibility best practices per the [WAI-ARIA spec](https://www.w3.org/TR/wai-aria-practices/#slider)\nand are fully RTL-aware.\n\n## Contents\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\"\n       aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   `data-step` attribute on the root element. This will be the step size for\n    value quantization. If not set, the default is 1.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"20\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `tabindex=\"-1\"` attribute on the thumb(s)\n*   `aria-disabled=\"true\"` on the thumb(s)\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"-1\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\" aria-disabled=\"true\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the thumb element's `aria-valuemin`,\n`aria-valuemax`, and `aria-valuenow` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"75\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"3559342f661baeb39f2e70f1172040aba07dbc1d","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.21.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.6b3876d5d.0","@material/rtl":"8.0.0-canary.6b3876d5d.0","@material/base":"8.0.0-canary.6b3876d5d.0","@material/theme":"8.0.0-canary.6b3876d5d.0","@material/ripple":"8.0.0-canary.6b3876d5d.0","@material/animation":"8.0.0-canary.6b3876d5d.0","@material/elevation":"8.0.0-canary.6b3876d5d.0","@material/typography":"8.0.0-canary.6b3876d5d.0","@material/feature-targeting":"8.0.0-canary.6b3876d5d.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_8.0.0-canary.6b3876d5d.0_1595986745890_0.37513516563616456","host":"s3://npm-registry-packages"}},"8.0.0-canary.30ce17873.0":{"name":"@material/slider","version":"8.0.0-canary.30ce17873.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@8.0.0-canary.30ce17873.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"40f5c2e6a5c41ad21350aac40659536ace16cd75","tarball":"https://registry.npmjs.org/@material/slider/-/slider-8.0.0-canary.30ce17873.0.tgz","fileCount":38,"integrity":"sha512-q7rfZC+ltCfpuCHjjUg8cw8PPppST4JrfJ93o2x74RnEPMrHrxw/M0t+apjuwQs1Nx6WonouKQbR0PSFMiRbmQ==","signatures":[{"sig":"MEUCIETSuzxkqsaP/9mn9RzRfma8ndyp2EdCxQSnbUajMDiSAiEAqKo3yyBfb8nYmk9/jHFF8yBzx/8TUwcZ8F8ZPx2VZjc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":729308,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfIa6dCRA9TVsSAnZWagAA5xMP/AzqNfIoSTo9qX8Fr6+k\nzkgR7wVaWvMUDh4PKLlcsZ6GWgFA5RNpsWweoQNhFhWk4PHa0Ow1AUUUHSUr\nreg41KSDnE4sZOyzl+Aj4M4ohmcbrqEBWXEzv/6AzPPX3tBMpH+HYuxydHkr\nr2U7du2YZM9T128W8z5GvI40N3sW2+zFcD/hykrLVQ90cadBNmeKeoO/w67B\nTh7/cg2Eibb9FtF2ALcDwmx4rRQQAk5R5xYLdYQEnxFekZc16R/UpMe1b4Fq\nSnsANB6qC7ULI/dVMImh3xLwhznNIGHvSRSlST4ZwNNtPC1J5/JPvL7/2SEv\ni7WykT9R1FE16M+17YPwzImTp+SoWCS/3HSdOUdps0SltZnYbN5yOB45KgLn\nGEHl/BK3Z67MeUIt/jeKHbXuFHnmmMPwbOtrl5J3f6R3StGR2SorGwn9YWcG\nyhZDsLvYgQvar/Nl93ykGWEQRPQ1/MNJCgrHVhYydEgFUnbZjXpsSuLh6Yu8\nHEIVlc5mnTi19Vu9wGizzInKFynXqlBhyWcxaSmGUT5hILpyhJxDVoDh75dI\nsNlGFFqqfZ4rOpW94dcUCYUdOJChc4MJYG3TBdqgxrVvb8yfWIAYHMWN7j20\nwouyN0RyXPinuwuTcdoF0iVmNwLYfU7NITbGysCrpVFGwOtTO2lYscyNzf/M\nzZ3V\r\n=JXMb\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is modeled after the browser's\n`<input type=\"range\">` element.\n\nSliders follow accessibility best practices per the [WAI-ARIA spec](https://www.w3.org/TR/wai-aria-practices/#slider)\nand are fully RTL-aware.\n\n## Contents\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\"\n       aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   `data-step` attribute on the root element. This will be the step size for\n    value quantization. If not set, the default is 1.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"20\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `tabindex=\"-1\"` attribute on the thumb(s)\n*   `aria-disabled=\"true\"` on the thumb(s)\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"-1\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\" aria-disabled=\"true\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the thumb element's `aria-valuemin`,\n`aria-valuemax`, and `aria-valuenow` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"75\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"88fa0309b6185f09fffdbd61d0c3e16f53c2530d","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.21.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.30ce17873.0","@material/rtl":"8.0.0-canary.30ce17873.0","@material/base":"8.0.0-canary.30ce17873.0","@material/theme":"8.0.0-canary.30ce17873.0","@material/ripple":"8.0.0-canary.30ce17873.0","@material/animation":"8.0.0-canary.30ce17873.0","@material/elevation":"8.0.0-canary.30ce17873.0","@material/typography":"8.0.0-canary.30ce17873.0","@material/feature-targeting":"8.0.0-canary.30ce17873.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_8.0.0-canary.30ce17873.0_1596042908759_0.9662631189149751","host":"s3://npm-registry-packages"}},"8.0.0-canary.f6bb43bf0.0":{"name":"@material/slider","version":"8.0.0-canary.f6bb43bf0.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@8.0.0-canary.f6bb43bf0.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"d1481a44d5649e5481e3be8c5681c2651da5336c","tarball":"https://registry.npmjs.org/@material/slider/-/slider-8.0.0-canary.f6bb43bf0.0.tgz","fileCount":38,"integrity":"sha512-EiZjhQ8DLjXvSPsH87QMV0hpicX7ITldGCk7ai/sAxQlQMIBqK82hTlP258i0q/C9RQa3Lq1m1cUhUa/Io4VFw==","signatures":[{"sig":"MEQCIC2IldT0gOK2ygPDzKrZfgFnWYuFeNEvIrJYZdz9JIjAAiA6tvM4PYItroJr/04ftDIdNuSvglOMfXIB7/FpySPqrg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":729308,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfIb8rCRA9TVsSAnZWagAA4q0P/1Vkgpy+SKWgNIYdVD+B\nRxeECOBvuLwX8VHsYylDn/A3qsneVvj/z69zsSj/vTF51jqfJ6T7z/+OOv1w\nCu+Z64yKFONbxoG8Lg59Uc3DvVKLlwe4wkCsUe9kGhn+oMNkOhKc0sKiDlS5\nx2Oee7fHC6loyHSUXI0voYTJmY1kfGksU0f2kky7zoSxJeWuCVxcE4AJaERs\neWN4GLmhYA28Njfd8NwZUc/6BBJQKmSsA2M/aMR0ZlIYxKhEaeojEoqDxz7W\nYcJIOxtCL3Qdfkhniey3Mt/P5zvfdJq7qE2P+3CJsIjKDFVUfyZiR+FOaRwl\nuGoZNeGW0EIWvuRIdEzrKZJOXG9RH40fdiR8CiNhttN7k8/VK+FMA0Um2td0\nkTcb8Jlq32B70mqEdUhZcrOVXg/xtG/wktWUwWB+90XJx6ctMSQM+p4W9EAu\n1My/W7p71XB1OMO+ITfgXnbDf9tIQcntnqDoFsg7XTaFl+qmjjVk2lFP9aVo\nLhCdLCjD1wkCwhawokxzgoP3fzXO3QKNelAm72Jac1XOkyjV8e5x6OmkSKzU\nUyhtUlIKwLODt+3pOkKo+aTHLpuz68VY5BVlMjRZr+D2rUVYUjfYHBvcfEhT\nLpk1VVj+cF7x3ehTnT4dQODRh4kIF2/DKXB0GyJb8eQtMQjG6FaovY33eT6w\nQVW2\r\n=Onk0\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is modeled after the browser's\n`<input type=\"range\">` element.\n\nSliders follow accessibility best practices per the [WAI-ARIA spec](https://www.w3.org/TR/wai-aria-practices/#slider)\nand are fully RTL-aware.\n\n## Contents\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\"\n       aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   `data-step` attribute on the root element. This will be the step size for\n    value quantization. If not set, the default is 1.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"20\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `tabindex=\"-1\"` attribute on the thumb(s)\n*   `aria-disabled=\"true\"` on the thumb(s)\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"-1\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\" aria-disabled=\"true\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the thumb element's `aria-valuemin`,\n`aria-valuemax`, and `aria-valuenow` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"75\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"d511f86ad9ca4460730b732c04ab497fd558d515","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.21.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.f6bb43bf0.0","@material/rtl":"8.0.0-canary.f6bb43bf0.0","@material/base":"8.0.0-canary.f6bb43bf0.0","@material/theme":"8.0.0-canary.f6bb43bf0.0","@material/ripple":"8.0.0-canary.f6bb43bf0.0","@material/animation":"8.0.0-canary.f6bb43bf0.0","@material/elevation":"8.0.0-canary.f6bb43bf0.0","@material/typography":"8.0.0-canary.f6bb43bf0.0","@material/feature-targeting":"8.0.0-canary.f6bb43bf0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_8.0.0-canary.f6bb43bf0.0_1596047147388_0.3833358012035446","host":"s3://npm-registry-packages"}},"8.0.0-canary.6af75f6ab.0":{"name":"@material/slider","version":"8.0.0-canary.6af75f6ab.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@8.0.0-canary.6af75f6ab.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"57f31b388a01423d3601e731ae7adbe90bba78cd","tarball":"https://registry.npmjs.org/@material/slider/-/slider-8.0.0-canary.6af75f6ab.0.tgz","fileCount":38,"integrity":"sha512-o0uPAAHUSZoRwXyDXgc7u3Baj/whJgRvLGrQFLFa++Hnlrfdu5UCPWtrNTmMWajdU4ymfn1ehxFWgfHeuv1TBw==","signatures":[{"sig":"MEUCIQDkr75c5JqK4cqLMI5YdwXnErLp4GBylSkHzzL6Aeh5TQIgfhnNXKZADzE8nhIRSk1YaLK4zxlJ5bFMcyL+6Mt5c7Q=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":729822,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfIg3kCRA9TVsSAnZWagAA/kgP/A/PZPj5OA90qonRSsFD\nl12BGxjLhagrhv7zB+yPGNNfIqnwokN351WRMY6P3fU11wEsVeLfnfe5b8Qq\ng1FTso2/fnBSWHKGa4pH5Wy1+2fmssa/WnM0WzlyydPlOF4AueL6K4qfQSVJ\nuyE2p4Z0LQ4FDHzquagCUupVIKSjX83wtKk5pmLfSXVp83piN8MUKY8wm7+v\n7OBfWAmq+bS9LW1729Dj6AGbVrmSOtK1fH7p8352a7c6+r9vWYrQQgUPNCzd\nxH5wX9ZVakBay90qeA7CFtH4KaPzKyb5yQNNdpTyZY3oMvFW/qBjTDCqseuT\nGCNOFwGgvMh1v4kP3FV6nB6IEsvm5Dv4VR2mn4MEdOUuCIsZJzMoLzULZPa3\nc48ZCOb4iIODIehAqJT3Cu9RwzqG6QPfU6XTSeMD7pgXa0jXyhywT7Fz6yWc\nGQVLksia0ZDo/tfw40qXEpSnjP/UtuoSyYbKLoQtfGFuxcedzaFIx384CWoK\nno9PQozGRj+G+NhHrPozF/YZrXlJPPRHUGTYT1D3hM0qSeUnD2n0z2euGsTv\nmNIgPUfcb/Nkv1YrIJxjTwPE1uWl3ISd37r0fgB31O/dwEttZTyqwiHY0n6O\n5y0z4eFCfUItcPt1XRVX3XEJDf29IhsdeXyA1+7dexBLen/B/rbd9GsTHyup\njcLH\r\n=S0s4\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is modeled after the browser's\n`<input type=\"range\">` element.\n\nSliders follow accessibility best practices per the [WAI-ARIA spec](https://www.w3.org/TR/wai-aria-practices/#slider)\nand are fully RTL-aware.\n\n## Contents\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\"\n       aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   `data-step` attribute on the root element. This will be the step size for\n    value quantization. If not set, the default is 1.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"20\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `tabindex=\"-1\"` attribute on the thumb(s)\n*   `aria-disabled=\"true\"` on the thumb(s)\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"-1\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\" aria-disabled=\"true\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the thumb element's `aria-valuemin`,\n`aria-valuemax`, and `aria-valuenow` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"75\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"44ee60f895715b8f7c0a7da67637babfd33452cf","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.21.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.6af75f6ab.0","@material/rtl":"8.0.0-canary.6af75f6ab.0","@material/base":"8.0.0-canary.6af75f6ab.0","@material/theme":"8.0.0-canary.6af75f6ab.0","@material/ripple":"8.0.0-canary.6af75f6ab.0","@material/animation":"8.0.0-canary.6af75f6ab.0","@material/elevation":"8.0.0-canary.6af75f6ab.0","@material/typography":"8.0.0-canary.6af75f6ab.0","@material/feature-targeting":"8.0.0-canary.6af75f6ab.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_8.0.0-canary.6af75f6ab.0_1596067300276_0.24664949021779203","host":"s3://npm-registry-packages"}},"8.0.0-canary.42d7a65aa.0":{"name":"@material/slider","version":"8.0.0-canary.42d7a65aa.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@8.0.0-canary.42d7a65aa.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"d74286d6c48a7347c13eb572b2b47b57af4f77b3","tarball":"https://registry.npmjs.org/@material/slider/-/slider-8.0.0-canary.42d7a65aa.0.tgz","fileCount":38,"integrity":"sha512-1zbmzoUzrYF+gQoQxrlr6bvCt/ePsXtHe/72TUGBGFof+gbLhl/JVurkQ3FtYBNLu+v9wupQROCORsWv71SHhA==","signatures":[{"sig":"MEQCIFbcdhV9/Q61FQJ41zjZ+gZjVm0cR/k4Wol/Ct0Zczp9AiAhtaPk9d+LQVXUuR7dp0Feeky2YiHzjQv+/BfBuKwSsA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":729822,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfIhAJCRA9TVsSAnZWagAAb1cP/iHt5kF01W1aZqegODLc\nfcH5eLNVv+0HN7l1+ICXpCP0GYkK4SMZBevIEVzwStXWpnJPFmAPEUpAa6y0\nGFjfjPycoc2KE+O7lxJKyjlFz9uQOvtvjcjhYj4vgpt9/y+gmimRVozMadai\nXUDLdDUq2NcDxhl1m4p2KWJPrkbEJq8ulZegBCTgOyDgm2gbw66CVwhvUdhy\nyHRC7sFVsqRvS2SDZ0q9r8rpgI/FeExX+imBGrrDVnRD1l6LUx21vT0Tef01\n1FhpRJnwcXSh08HtqVic153JLTWGmFOzJdKouiMBCvcjglq/MJ62l+Gs7ITv\nf/5IFTbwpnV1L0TiN/D7RhLtf3Q7t+e6lgi3NpF8JaFFTSNF+702sWSItt7l\nX7m4ugrTP9LYhMvT9dbCHglqZRUG4Xntdz7zKzLM1pzM6SJor1clrDTbS2yC\ncwvDnp8RaJVKn5BWgEfJku8+26xqvWRNtax+GGWcJ+/6VVScGTKwa3YeILER\nC2u3wT8W6zu/UQSUSzCV1gZ0pBr0gouKhH9fDwTS+Bzpfgr5xl7wcHoiwMZc\nmrNkj35CeLInpWNymrEb/4F4zoRHTU3ARzTBJ3ARUayc+XyDR7cE1WnhEx11\n1dJNQT67ZU1aZKAIkazczGywj8b+F4vnilgj4bRBDNa0P4GZ76Fp4K+k+xC6\nJzzS\r\n=vgP9\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is modeled after the browser's\n`<input type=\"range\">` element.\n\nSliders follow accessibility best practices per the [WAI-ARIA spec](https://www.w3.org/TR/wai-aria-practices/#slider)\nand are fully RTL-aware.\n\n## Contents\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\"\n       aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   `data-step` attribute on the root element. This will be the step size for\n    value quantization. If not set, the default is 1.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"20\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `tabindex=\"-1\"` attribute on the thumb(s)\n*   `aria-disabled=\"true\"` on the thumb(s)\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"-1\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\" aria-disabled=\"true\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the thumb element's `aria-valuemin`,\n`aria-valuemax`, and `aria-valuenow` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"75\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"b6645573c0460e7bc8187d1a21ef306b674e1017","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.21.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.42d7a65aa.0","@material/rtl":"8.0.0-canary.42d7a65aa.0","@material/base":"8.0.0-canary.42d7a65aa.0","@material/theme":"8.0.0-canary.42d7a65aa.0","@material/ripple":"8.0.0-canary.42d7a65aa.0","@material/animation":"8.0.0-canary.42d7a65aa.0","@material/elevation":"8.0.0-canary.42d7a65aa.0","@material/typography":"8.0.0-canary.42d7a65aa.0","@material/feature-targeting":"8.0.0-canary.42d7a65aa.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_8.0.0-canary.42d7a65aa.0_1596067848911_0.924248995585683","host":"s3://npm-registry-packages"}},"8.0.0-canary.85abdabb7.0":{"name":"@material/slider","version":"8.0.0-canary.85abdabb7.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@8.0.0-canary.85abdabb7.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"f9246488459fb05e3a9c02919e880b534dda7dcd","tarball":"https://registry.npmjs.org/@material/slider/-/slider-8.0.0-canary.85abdabb7.0.tgz","fileCount":38,"integrity":"sha512-mdfm7hpYYsJI628MQgjtexyD8UBarpWA1J6TB4lht79EBEmWqiH4FypmUKov5pdGrRxhyIrAVexyt9gFE1SSJg==","signatures":[{"sig":"MEUCIEw3z2e55x+HF/FySvKQXLb/obkrrz3TBCUncH+KH/pjAiEAoNa2PcAFf+yrVIu2+WOJZkoLc6/VD1DTsyfSY0AXT8k=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":725534,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfIhEqCRA9TVsSAnZWagAAGmkQAJAs7htakcZ1RCx1GJV4\nIxoeyt0v56T4mxp4etXfjE/H0/fWxwKZuZNr2EniIUgEh07n5TCaC8Qt8gBq\nXOeH1skI6dYI2hoZo6g5ULbWNy3QAZgu22QAHuz9gjlvKE7Dl9pe9HuqNY9y\nm/vjABIKKYXnVjQCT7GzLgX3abudNEIrD73y39Zt0B3ohGtkLu58IM9HkviI\nHz3F+hQ3njArCLG15FBsJPnniYp0PhMl21Kr4qxo6m94N02vEanLfL063+6R\nSgxquV7vSk8fK74MI5p6yU6Wtsg7ugedhKxirISuq2mQ/j4NTusPPX3FB+mX\nfOf2LqDUKef4uFo+q6N2zs4caxy5CfQhgi31eiUn3Ty27ZD7RLpxtgminPjL\nzOKbTU6+leKZ/HIeg+cI96dwPbwc0lORvI7SFQ3lFb9XYNa6CCUEu3ycfKlM\nMbPutCrn7IBeZJj7hF3Cw4g6GZ3Cgtn20DihWE3JyMghDww3i/thA3kQXCFv\nuGzzD0GrsG1xmpbw/HLdehYrFcSHjN9ifUpUFKOZj1TKEq83hlGmbxBaj64s\n4U/kGqMZfmbOqcmGDe97M+okF9moFlhQdcqnQHSh0UT1sYHXaWSXy6TsUh2I\n9nxZtrBWpbrnWzMttmrE8CzOndbAy1dFe+2XjbDgRzeR/1RoMeU+SURDK921\nNOMM\r\n=LXt5\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is modeled after the browser's\n`<input type=\"range\">` element.\n\nSliders follow accessibility best practices per the [WAI-ARIA spec](https://www.w3.org/TR/wai-aria-practices/#slider)\nand are fully RTL-aware.\n\n## Contents\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\"\n       aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   `data-step` attribute on the root element. This will be the step size for\n    value quantization. If not set, the default is 1.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"20\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `tabindex=\"-1\"` attribute on the thumb(s)\n*   `aria-disabled=\"true\"` on the thumb(s)\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"-1\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\" aria-disabled=\"true\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the thumb element's `aria-valuemin`,\n`aria-valuemax`, and `aria-valuenow` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"75\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"4686052ff6039efa085c0d360393374ff4b2143c","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.21.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.85abdabb7.0","@material/rtl":"8.0.0-canary.85abdabb7.0","@material/base":"8.0.0-canary.85abdabb7.0","@material/theme":"8.0.0-canary.85abdabb7.0","@material/ripple":"8.0.0-canary.85abdabb7.0","@material/animation":"8.0.0-canary.85abdabb7.0","@material/elevation":"8.0.0-canary.85abdabb7.0","@material/typography":"8.0.0-canary.85abdabb7.0","@material/feature-targeting":"8.0.0-canary.85abdabb7.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_8.0.0-canary.85abdabb7.0_1596068137804_0.7731365108511472","host":"s3://npm-registry-packages"}},"8.0.0-canary.49fb20ca3.0":{"name":"@material/slider","version":"8.0.0-canary.49fb20ca3.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@8.0.0-canary.49fb20ca3.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"376a92475e757da631c4942679b84e24b061b64f","tarball":"https://registry.npmjs.org/@material/slider/-/slider-8.0.0-canary.49fb20ca3.0.tgz","fileCount":38,"integrity":"sha512-tnGt5wJfcXP2GMDCTwXIxIjhLn7pT/dQqfd49ov9I7o2pjrIxLE4g/4C4AhCB4SW53PPGlRsrSHJ47E2g6bA4A==","signatures":[{"sig":"MEUCIQCdXurtDF//kjz+PuBbylBRwTw0cAwOLZgTpfnKj3SIoAIgGh7PPEz3dKeKuLizEkURgH+UCOsHOHhn92uhTzvTsC4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":725958,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfIiIcCRA9TVsSAnZWagAAyWYP/0eMvf6drbWr5CTH6u/n\nbG6N97KtBNG/o7o9lZVyLNQ4DFX1Cr8T/vAQhzN6ARAVdX625VouJhgxfp2D\n1uSKo+rbiHlXSEufSsoADddkMUrtLpIsUVDYXU1FlG9JisVmdgsKv1w0vmRY\nlRU/kCh3nYD6LTWoWnNvVKQ3h9yCIG8UzEATPkrlE3b3CYMj9Bk7BhoqYlOc\ny4Y1FM23159HipF81K/j9thmnhV8ojoNGpPv6CFb4x7BaINywTRfa2RdtTek\n/SR9p+bR7/U+cCtw8a42AbyZ174pX5bpiCWNXOOGz+CYGx4EzzQ7fYMXXcVg\n6R36RMZ0+9NSBxgCSp7Iv5+nqSgkGuKB0gZIkqVg7FVytPw1+l0IefvWl0ZN\nTqcjYCU7bsrqOS8ntKAqbDhwb2svXdgV5eVK2jnq/SzdGCRDqVnnibrex3Bd\nQwFq4Dlxj/dMqfd/XY4kio+60giKsuDUrpZ3S1swsqz/bsJItWQFSgAvI4yF\n7sE0VIdPtNX1OLm9nhQaZKrPgtjdppzwbSyvhvuMa7JCb0nXCEsWGOatc9eb\nkznjjnuTNldHY7Q3E2eXkd2I8yy5WL92yO1z4Mvorakmm3hHWlDJ47aPUZO+\nRHEmnKlNRsxlytCZRiZTezPoBY7xmkyuXA0cNg9Rb+A7BUvZQ+0THrRNHW5V\nqVQA\r\n=4jMQ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is modeled after the browser's\n`<input type=\"range\">` element.\n\nSliders follow accessibility best practices per the [WAI-ARIA spec](https://www.w3.org/TR/wai-aria-practices/#slider)\nand are fully RTL-aware.\n\n## Contents\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\"\n       aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   `data-step` attribute on the root element. This will be the step size for\n    value quantization. If not set, the default is 1.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"20\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `tabindex=\"-1\"` attribute on the thumb(s)\n*   `aria-disabled=\"true\"` on the thumb(s)\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"-1\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\" aria-disabled=\"true\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the thumb element's `aria-valuemin`,\n`aria-valuemax`, and `aria-valuenow` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"75\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"9c66ae7fdf6570d9cf334102b5004c5a04b628fa","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.21.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.49fb20ca3.0","@material/rtl":"8.0.0-canary.49fb20ca3.0","@material/base":"8.0.0-canary.49fb20ca3.0","@material/theme":"8.0.0-canary.49fb20ca3.0","@material/ripple":"8.0.0-canary.49fb20ca3.0","@material/animation":"8.0.0-canary.49fb20ca3.0","@material/elevation":"8.0.0-canary.49fb20ca3.0","@material/typography":"8.0.0-canary.49fb20ca3.0","@material/feature-targeting":"8.0.0-canary.49fb20ca3.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_8.0.0-canary.49fb20ca3.0_1596072475796_0.1112433347839552","host":"s3://npm-registry-packages"}},"8.0.0-canary.962d4abbb.0":{"name":"@material/slider","version":"8.0.0-canary.962d4abbb.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@8.0.0-canary.962d4abbb.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"242dc3333f8d4422a6bffc078ed47c8f83ee7f79","tarball":"https://registry.npmjs.org/@material/slider/-/slider-8.0.0-canary.962d4abbb.0.tgz","fileCount":38,"integrity":"sha512-4sxzi2JmD3PvPlAqGJfD/D2esCOutWL4sIB3p/xlk2vJvrn2YnOeL8gEcrEeN3oz+9B4krnjkwGns0rND3PM0w==","signatures":[{"sig":"MEQCIDZgulacEcF5G7cSejNZZiztcuqY3YY3nzFFrwfTMViGAiArUH7uTkoRcGfn6UgKzXgYW7+hCBm2hqzHuTA5PbZqDw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":725958,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfIvD5CRA9TVsSAnZWagAAO9gP/2R8XzqSo2XAqn2JKKu+\nwsVWyEjHxgt60N4TAc8wl69Wgep2flxDR2bhvi7soT6TFChrf2hkwMn3ht4J\nB6bns0Zk2WhbUbpYVIBRep+KD9wZzDJ+dJi6u5bhE46cL5q3/xUX9aUd3u7H\nM7MneZWJsqwPbiMuuflrg9FbxNVKvR3pSy1lR999WCuTBmBrl9+AQ2nUd8hp\nbX84kChpqMW/oteZUsqSq6TqgFimnlibXjUIDM0kzzMOSZd2EFd1t6oqK7kJ\nDXk5IvSaruo97lAf207poyfqCzVy2itRjFQNxzIJUgdhhFwhMuVdE8vA8MVm\n+eTVqC7W/wQvWuAyzGcRc6lx8es1AWfssHan+kZaB/rbvZMtI0nRt7F104+u\nJ9LhPNPE78+ERQ9+hAlSqB/JpW5mvU6IQ1FV04w6gmvKJ+QtJH+ePZON2nG5\n0y25PDmf4t/KSy9lvaoPyXmqVU/B0qK50ILpEYbMgyYkXvXHdQnMZIx4vWd5\nKjHV2EHFCb/JWYJmbPXHUrDApFntX/Xn6/h8qrgop1Ql8TVuWqaEVk5pF+TY\npkpAGphBzUvC5ZIzo8a3m8OFUrQP7z3goi+4jmdFQnTeJybFJ2o1Vz4jNFDb\nyX2D7IW3haltaq7btLoggjHN/lGHxHkxZMj8ymvX9WgDetBP21uZH7zakBmP\nXaZ0\r\n=xRGa\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is modeled after the browser's\n`<input type=\"range\">` element.\n\nSliders follow accessibility best practices per the [WAI-ARIA spec](https://www.w3.org/TR/wai-aria-practices/#slider)\nand are fully RTL-aware.\n\n## Contents\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\"\n       aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   `data-step` attribute on the root element. This will be the step size for\n    value quantization. If not set, the default is 1.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"20\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `tabindex=\"-1\"` attribute on the thumb(s)\n*   `aria-disabled=\"true\"` on the thumb(s)\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"-1\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\" aria-disabled=\"true\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the thumb element's `aria-valuemin`,\n`aria-valuemax`, and `aria-valuenow` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"75\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"d373d2867180ff5f61fc4d7afb88a8825cb5cc9b","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.22.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.962d4abbb.0","@material/rtl":"8.0.0-canary.962d4abbb.0","@material/base":"8.0.0-canary.962d4abbb.0","@material/theme":"8.0.0-canary.962d4abbb.0","@material/ripple":"8.0.0-canary.962d4abbb.0","@material/animation":"8.0.0-canary.962d4abbb.0","@material/elevation":"8.0.0-canary.962d4abbb.0","@material/typography":"8.0.0-canary.962d4abbb.0","@material/feature-targeting":"8.0.0-canary.962d4abbb.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_8.0.0-canary.962d4abbb.0_1596125433162_0.5475818050298613","host":"s3://npm-registry-packages"}},"8.0.0-canary.2fcee40cb.0":{"name":"@material/slider","version":"8.0.0-canary.2fcee40cb.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@8.0.0-canary.2fcee40cb.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"16671548057d6bf3f4143a92b21aa4256f3b44e1","tarball":"https://registry.npmjs.org/@material/slider/-/slider-8.0.0-canary.2fcee40cb.0.tgz","fileCount":38,"integrity":"sha512-yjseydlU7ssNSFO4bSSnw0RMBfWKGplEGezzwnc+utRWmio8YWroPy6/eUXTCiHlsY1UkGt9LLSu2IYV/C8+bg==","signatures":[{"sig":"MEUCIDSNbPpu4hXpWkL/kEr32GpuvUxf0zBhOXHxJ4ZO5aPhAiEA/AZdN+FqagQ/xtOFDw6Z5RviwZ0IxTNJ1Zk96/KDLEg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":725958,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfIwGuCRA9TVsSAnZWagAABwMP/3Vb7B93mnMnY69J2jft\nzFM6jc6LBhvIocloJ4fyGVIFsGcR0GD6jlZXHgypRox+JvfiX2+ebJ5QowVd\ncUgI7XGGxcJMI2FDculp/CSpcFucxXl2gux5ERLCrp1HJJw/HQHvpPftxpLg\n1MqXoD6bhxp5xPzyoE4A+8fuwflUjTo57Pwids0RtxDi1sjEKMXbleG1VbBJ\nkKXwS71sYVoXUCs6ZJcawq+jTpXMYllvQVir4RonRftzx8pG0t/0SKZ+qqMz\nZ9sA7Zd7aehEEvZqzfFqC9VpkK5gW8CaHEzKl4FV3HjFsnEhuhLpwBkY/mM8\nRd0WydZ0t+SXiOoP5/wYTfWRjrb5OanxAZH2/z5BFRbbjErV/o+JkUsrV3nC\nSkYzHrzq+h1GcmjjQvFijlTBds5/gQnIC/3fCVAIRt0kNGd7JWEHOWd4G19f\n96dqAx/cGnXWlyEI3okFnZb6hKAea5DlUS1VPyti8njtWdB+s72AbFvEyyvO\nxU9jndy8KU9llCd6Gnt1w4mceVB7/D6MVOSA5L4dXZ4HDBQcDVZtNqBtlYY6\n6SZXGSVe0SVdBuhKjeyts2BVgae5ZaKKsQlBREj1t7lkdVLTrlzKJQpXCx4W\n3a9e1HYAAguRj543z+VF5YPQjifyHB28fKWoycJdLvulEgVRK09CQu95vqjI\nlPkP\r\n=28p/\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is modeled after the browser's\n`<input type=\"range\">` element.\n\nSliders follow accessibility best practices per the [WAI-ARIA spec](https://www.w3.org/TR/wai-aria-practices/#slider)\nand are fully RTL-aware.\n\n## Contents\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\"\n       aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   `data-step` attribute on the root element. This will be the step size for\n    value quantization. If not set, the default is 1.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"20\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `tabindex=\"-1\"` attribute on the thumb(s)\n*   `aria-disabled=\"true\"` on the thumb(s)\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"-1\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\" aria-disabled=\"true\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the thumb element's `aria-valuemin`,\n`aria-valuemax`, and `aria-valuenow` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"75\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"f769a8a60e9cefb9e0e6306a96914e8e4b4c0c90","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.22.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.2fcee40cb.0","@material/rtl":"8.0.0-canary.2fcee40cb.0","@material/base":"8.0.0-canary.2fcee40cb.0","@material/theme":"8.0.0-canary.2fcee40cb.0","@material/ripple":"8.0.0-canary.2fcee40cb.0","@material/animation":"8.0.0-canary.2fcee40cb.0","@material/elevation":"8.0.0-canary.2fcee40cb.0","@material/typography":"8.0.0-canary.2fcee40cb.0","@material/feature-targeting":"8.0.0-canary.2fcee40cb.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_8.0.0-canary.2fcee40cb.0_1596129709598_0.2541607570324711","host":"s3://npm-registry-packages"}},"8.0.0-canary.bd5987f5a.0":{"name":"@material/slider","version":"8.0.0-canary.bd5987f5a.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@8.0.0-canary.bd5987f5a.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"544d17c365e13b7f9cd023aa83fdec962053f8e0","tarball":"https://registry.npmjs.org/@material/slider/-/slider-8.0.0-canary.bd5987f5a.0.tgz","fileCount":38,"integrity":"sha512-qLQHywZXmpQT+arjYvtwZ6hon8mmkXjj2nRN64t4lWTKTnw/moj1/h+7/1aI4G7XYIu3zizpql1kmgyk4oxcdg==","signatures":[{"sig":"MEUCIHgzjJ1GoC8lCzx7rtMuLbSmPCnWxGRvrogYXoD5+OepAiEAu5uQCGZN2xFiLV1hH8dmkoSLFzO5QmjVx8Oiq4jwmik=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":725958,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfIwd0CRA9TVsSAnZWagAA+qwQAIkcvtwXtUqUKtB1x16Y\nrZM4Kk/is0ZfgkyGtnRI1dItRefPPaK5P/2ZHUKD0tYInKeOvx6UVDDJ3uZd\nlwTd4gqY2QAzeZCee0XNqVnozFphsWtxuI6nqkBlVWu344cPl7tvtHiBIuA+\nqll13MTmxhsFfDkwtUh1meIzyFDkYM4zaH7k9vy0fQ+7rMoCudxkuzYv3y4q\nEg99PdLKllFnn0CSYWfAk9N483Gq43HcLalq5EnjGGQ7TBVW+oaYG+d30r9b\nrvQrciJL5eANLdZcYGHPlq9bQ/KqPU+sn+FnTPWDKknH95LDJ0/AJUtTU4/U\n6Sluv6U49SDfn0rlN7pj7s9SOa45S1sz8OSM5kGm81EAPE2kvjaFyFmpPl3O\nsS5oUMZvbzT6bx75ccPricDxEAg4L40OxDI9QmLXewxjpGNqLKe53f3PN4WA\nj65wG8a6xUTEGaMTirgESXLyj2mXDAHQTXOSut4ZCHqBVrw6fab2NyAs3zcI\nebpPAdtkCb/q2FXFPH2fr0CnP48Kt3l7DwsACtDCA5Sqarv2BvEVr06lDJ0t\n8MU+C9XrbNnrRAiaqWgvCIedABmEt8jwQ43tJptwkQtR1thDGobzgMTH5l+p\n/M9fJaymzwGr8zpmpaf8GSpaNs6gNhG9/D5XkRwJvqwomlNRV5/lq2kcJSyJ\n7uEv\r\n=Z3OU\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is modeled after the browser's\n`<input type=\"range\">` element.\n\nSliders follow accessibility best practices per the [WAI-ARIA spec](https://www.w3.org/TR/wai-aria-practices/#slider)\nand are fully RTL-aware.\n\n## Contents\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\"\n       aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   `data-step` attribute on the root element. This will be the step size for\n    value quantization. If not set, the default is 1.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"20\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `tabindex=\"-1\"` attribute on the thumb(s)\n*   `aria-disabled=\"true\"` on the thumb(s)\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"-1\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\" aria-disabled=\"true\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the thumb element's `aria-valuemin`,\n`aria-valuemax`, and `aria-valuenow` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"75\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"7825c698a6686a8ea967272c1f150363b3845900","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.22.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.bd5987f5a.0","@material/rtl":"8.0.0-canary.bd5987f5a.0","@material/base":"8.0.0-canary.bd5987f5a.0","@material/theme":"8.0.0-canary.bd5987f5a.0","@material/ripple":"8.0.0-canary.bd5987f5a.0","@material/animation":"8.0.0-canary.bd5987f5a.0","@material/elevation":"8.0.0-canary.bd5987f5a.0","@material/typography":"8.0.0-canary.bd5987f5a.0","@material/feature-targeting":"8.0.0-canary.bd5987f5a.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_8.0.0-canary.bd5987f5a.0_1596131188348_0.7324747741425408","host":"s3://npm-registry-packages"}},"8.0.0-canary.005e86a9b.0":{"name":"@material/slider","version":"8.0.0-canary.005e86a9b.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@8.0.0-canary.005e86a9b.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"f16409c2699fd9dcbf00964bbffc07fd9a754880","tarball":"https://registry.npmjs.org/@material/slider/-/slider-8.0.0-canary.005e86a9b.0.tgz","fileCount":38,"integrity":"sha512-byxkxFZTHPT/uHp6BeTyNextG7aqt+9HssfMXDogFMGLGZYPDK9acGtD4KSmDyWnwLCMpaKvDMDNvYXJj9Tl7A==","signatures":[{"sig":"MEQCICMAb3iFC0S7NuE3QOw/i/toraSZhq1ELpncz+MKU6I5AiBCLXbVZIT7f5sGga8E6GY0zltSbSEO17Dd0Jn7AEZQnQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":725958,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfIwqxCRA9TVsSAnZWagAAdsEP/iusVYOMW7IDuipO8PhL\nFEgK1AzSr9gISBbxKqABWh8eB0Zu/P46pQguGQKpWNSprmQFXHx09GpO5xuz\ncNZgTw8hOxfjFBdcOmK8DxF8dnwNt+lsaCO1Vha6afo1r7Vo1CE6IDwctoG4\nIl/I24zwbdYMMUwMkN0bRShlLef4njX9IDbr8plmfvcrWTIqUwIHrJhVmBQM\nQNFCPE0GA/y4x9Ap9/0gz/VKZQv+pYH25gX5wc8myoQhTpLtf4t4qRz7Hj1C\nwSHnjpODZ6t+l/jEBYDrRHZBZNqjdOrxxJvUQ47vM1PYXci8Zr3fiSX4qioj\nn5MUlzIRmP4oSnL8k8Q8bYoV8aLlH5KQS5X0fHZTpjrfGuwBr0p6uHeJMcDr\nMJkHTFxe7qrP37Ft69/+rZFd4E4USPevL2kuTbz+27miqVyF82VlShfQ7DO9\nrLEFhctFPLXr/yFFS4JlUtkD0DMpSpzgNmdMm+TPkwpgqhB5bvZpBIJqJtOD\nzP8udVgNM7DCxYlSPhaWCkqtOafvJkb/OlupYHzd5Wy+7diPTWS3/Hf8kuqJ\nVph5TumAdHsX1pAGXLLlfbFJxE6hOxmjNJj/I4yU9cFNBFskpeR3YmXJGt1H\ntrjDYR2MValp1A7nLWoZ2UbVmw2UiJe2hQxgvdF3Th8rsPrY+mHl79ew+LUi\nkhH/\r\n=jD6/\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is modeled after the browser's\n`<input type=\"range\">` element.\n\nSliders follow accessibility best practices per the [WAI-ARIA spec](https://www.w3.org/TR/wai-aria-practices/#slider)\nand are fully RTL-aware.\n\n## Contents\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\"\n       aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   `data-step` attribute on the root element. This will be the step size for\n    value quantization. If not set, the default is 1.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"20\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `tabindex=\"-1\"` attribute on the thumb(s)\n*   `aria-disabled=\"true\"` on the thumb(s)\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"-1\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\" aria-disabled=\"true\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the thumb element's `aria-valuemin`,\n`aria-valuemax`, and `aria-valuenow` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"75\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"1c429f861ddbb35ec8588ea55cb1845296ab0218","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.22.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.005e86a9b.0","@material/rtl":"8.0.0-canary.005e86a9b.0","@material/base":"8.0.0-canary.005e86a9b.0","@material/theme":"8.0.0-canary.005e86a9b.0","@material/ripple":"8.0.0-canary.005e86a9b.0","@material/animation":"8.0.0-canary.005e86a9b.0","@material/elevation":"8.0.0-canary.005e86a9b.0","@material/typography":"8.0.0-canary.005e86a9b.0","@material/feature-targeting":"8.0.0-canary.005e86a9b.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_8.0.0-canary.005e86a9b.0_1596132016745_0.8535883562344155","host":"s3://npm-registry-packages"}},"8.0.0-canary.e309c7c68.0":{"name":"@material/slider","version":"8.0.0-canary.e309c7c68.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@8.0.0-canary.e309c7c68.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"2ea9c5f52b730ad63bb72c1a56046911e5d447cf","tarball":"https://registry.npmjs.org/@material/slider/-/slider-8.0.0-canary.e309c7c68.0.tgz","fileCount":38,"integrity":"sha512-vT0bc473A4MBbU+W4qN6RybcyYkm9A4uRfxXXLgo8lOJ1DzzMM5ooQJb9lL9xsTaPYwuMX8ytk5UW9ZLH50Jyw==","signatures":[{"sig":"MEQCIBBPvVBVFV2h16I7RJi6s+C7lRIrh34VLdzUmDVq5lTVAiA/TXT82afsZ4CkYCa7p7HvBRf/J3GtAFDsDtdsDP0bEA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":725958,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfIwzYCRA9TVsSAnZWagAAk+YP/RjGI8CLuDZ6+mki9ks3\n+Hplr0ZUA9FD7m2iHmIvYP0fhGvoWl3VOfr1RN2wZ8SNncFjbgz8pKYRVqQP\nvnJBQ1TMVcKkep6KvmKDfVlH30KYvaBog0B9n5O3VYXJC9hKxDnjnwpsCzXr\nUU6K4DevvAzrY8ddDJbTYZBQgNhS7eZnXk5W2xoLYWxere2D4YoheA42o9lV\n1XsAugOfIjnqFtunC+DJ5xzoDOrxcl1mFRij+nJ2EUFPO2US98l62VKzNl12\nJSUysea1eZL8LPhKUu8ghB14OvLXgPMKTib4dr8NxHHCDpf7cGpfZlh2IwyA\nM6lc43wITDPhYSj2SfKckomZlpyPxOE2icHyD35XWzdNiAurVPvhSeb4LJut\nLNGdl/AonbwBRmpWJNFPxOkYK4otKanho48mWgrmNCXcTvDhKdTfgEMa2M2G\n3e0uKTXumsoZu785hIWTvMyOVQ83BM2SNxxSlEnEyUkNtmarFfofYKguINPg\nUAmPlbgkPQR1805aGH5+hL/hCgfetsYuZbwWaUD1YR1bj6I5Qsr0ZvfT8MzP\nMtQVayyJjRCLotLuAOTc3KZFU9c+1salAJKeDg1giOmWonmRypKYK1L0NulZ\nP21JvEu71mbyN4l877BbfycKcu5N1UMXIhZkpFVA/F826XJZS/Ov4PfH4Q2b\nFktp\r\n=Xrn6\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is modeled after the browser's\n`<input type=\"range\">` element.\n\nSliders follow accessibility best practices per the [WAI-ARIA spec](https://www.w3.org/TR/wai-aria-practices/#slider)\nand are fully RTL-aware.\n\n## Contents\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\"\n       aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   `data-step` attribute on the root element. This will be the step size for\n    value quantization. If not set, the default is 1.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"20\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `tabindex=\"-1\"` attribute on the thumb(s)\n*   `aria-disabled=\"true\"` on the thumb(s)\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"-1\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\" aria-disabled=\"true\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the thumb element's `aria-valuemin`,\n`aria-valuemax`, and `aria-valuenow` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"75\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"3ea460933f859061781daca3ae127802388c28bb","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.22.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.e309c7c68.0","@material/rtl":"8.0.0-canary.e309c7c68.0","@material/base":"8.0.0-canary.e309c7c68.0","@material/theme":"8.0.0-canary.e309c7c68.0","@material/ripple":"8.0.0-canary.e309c7c68.0","@material/animation":"8.0.0-canary.e309c7c68.0","@material/elevation":"8.0.0-canary.e309c7c68.0","@material/typography":"8.0.0-canary.e309c7c68.0","@material/feature-targeting":"8.0.0-canary.e309c7c68.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_8.0.0-canary.e309c7c68.0_1596132567816_0.12941553504519931","host":"s3://npm-registry-packages"}},"8.0.0-canary.935a51cc0.0":{"name":"@material/slider","version":"8.0.0-canary.935a51cc0.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@8.0.0-canary.935a51cc0.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"66601656a22727ae6a2321c98834a9a8d2cd4bdf","tarball":"https://registry.npmjs.org/@material/slider/-/slider-8.0.0-canary.935a51cc0.0.tgz","fileCount":38,"integrity":"sha512-I5iVKpefnlskXkitmRIawUCbNwv7WMUq/BFPbGpWU0U/yzFx11I2fzVd4j+gWYe9++ZIkkZyE6lRpwQhccRDwA==","signatures":[{"sig":"MEQCIG2lbKmqfrTASvQhZpbnVrBe26g/XIYYVm1GZTOcqkn2AiADmvhT7YWmKAB8UXGhPggJ+u2sFuNejkkeaW7pLMHFcQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":725958,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfIw97CRA9TVsSAnZWagAA7FIQAIk2tbSRmL9aaOTplg2+\nwZWtAUF6E/WcNY2wLR3kAS5WCkEPOA3upmEsVOEl1dcWVK07CbYoA9qy0JWu\nE9yF2P4LFUr4hCjwLdHH8g4p/LbYSh0eNb/dYyJNmmR21q/a0SHmjYoS5hHk\nwlFKGkVCIIRI2zaqWwgKhdDpHwO9cxRECPF4N3lM3pd0VlnLreQbHONBdi0a\nkZhy6O6kl/mg221KBOFF6pgSAXYcAzNFHAmrimroeZXM8Q0Sglmw7rAQchBy\nroa6omr/Pz/7DjrEkx4PB1vxqvw01940i6Xn+9F56b4vCwPkd58mvQ1oHNIq\ntunOCJRBEQYR0GrU1NEmdkb6yrwT+SNf0JZEvCGQf6KS1WpqCcLxDVt6bR8w\n1YxS9lMMizQfjvfwSJU4F6JpXTRGfsLqreIy2KqwKp8BtVs6D94CmPGi/8S1\nEn0AuqcrQNeNLsoSB2eN3syWEdvrJmm1///wmSPBsMdkvl7//WNemqkmQoYK\n+Zj3PoyvXhA9WOsAiQlwckRF6bHZ9fSymSzU6j/U4KbcYIybvY/IDhwCNxI+\nPSrZiDk2Qd9kRADucbQfcAoWZ9q59U8j7IdbuWnw58VXwxmG4zweghXnU6EW\nW8B1UD3gobMYgmJy85kH6W6lqqGPcksssgMLuSYGoBWcTdi3tJIW3T1X9s/9\n9LLP\r\n=4WD+\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is modeled after the browser's\n`<input type=\"range\">` element.\n\nSliders follow accessibility best practices per the [WAI-ARIA spec](https://www.w3.org/TR/wai-aria-practices/#slider)\nand are fully RTL-aware.\n\n## Contents\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\"\n       aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   `data-step` attribute on the root element. This will be the step size for\n    value quantization. If not set, the default is 1.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"20\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `tabindex=\"-1\"` attribute on the thumb(s)\n*   `aria-disabled=\"true\"` on the thumb(s)\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"-1\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\" aria-disabled=\"true\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the thumb element's `aria-valuemin`,\n`aria-valuemax`, and `aria-valuenow` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"75\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"79622070723d97d5c4052839435f92189e8fb6e6","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.22.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.935a51cc0.0","@material/rtl":"8.0.0-canary.935a51cc0.0","@material/base":"8.0.0-canary.935a51cc0.0","@material/theme":"8.0.0-canary.935a51cc0.0","@material/ripple":"8.0.0-canary.935a51cc0.0","@material/animation":"8.0.0-canary.935a51cc0.0","@material/elevation":"8.0.0-canary.935a51cc0.0","@material/typography":"8.0.0-canary.935a51cc0.0","@material/feature-targeting":"8.0.0-canary.935a51cc0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_8.0.0-canary.935a51cc0.0_1596133242893_0.18637491529518435","host":"s3://npm-registry-packages"}},"8.0.0-canary.74839da7b.0":{"name":"@material/slider","version":"8.0.0-canary.74839da7b.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@8.0.0-canary.74839da7b.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"370708f521d8602ebf039f28e54cd06fe9aa53f4","tarball":"https://registry.npmjs.org/@material/slider/-/slider-8.0.0-canary.74839da7b.0.tgz","fileCount":38,"integrity":"sha512-cCsZ8eMRHbgUoh5JW7aPSGe4djLdk46IBOVyUG84rk8ufLChe+wOiu5q5hvhAR4Dgu9ofvmFn9z/RfhsjLhKTA==","signatures":[{"sig":"MEYCIQDCq5PgTlARKT1gPFXJStzkni7+SDC+c0DpCr5Q1ypLOwIhANWTeFvr6cKS3jNpzUWR9XktW0OPTbbOUKCT9PtK3hGF","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":725958,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfIxIOCRA9TVsSAnZWagAAX98P/A3RB0/xskrA+YjzIybp\nlGs/n0t0EyTlde2duijTObGMU3mG8s+pXWJKEzsImu6T8s381qNKURk5wmCh\nXaSd6XfhxRfErjTW00y72sZk4vgWOhIiS9aQpa8CukL1+ge33d1osIJzLJfO\naS+TwCeWNOyO4Fnu4vShRM5Mm0QfDgXcHK7l5YhSES2qywuYTFSAMYq23pol\n0GltkYNt+hveUNdq3yYakJu+qVlEfnJ7PFG63D0PVjVEfpnKRT2B6ZdQXGED\nPjFVtbVErI0wXeuPQW7CRt6/P/gG2dF2v89Inf/84UUTX+m+6E+gBBu44bSZ\n58NzclhO1T3bGf3CwMog0RpLfzGX/+r82Pw6xKnBoyROy/xSyJnm7HI/ZT2w\npUeEAhFNH99CG63C35U2L8MEVlLLlA/xXPEIY+Vaum9m6RFb+KHfgEpe8naV\ntXo2iER3CT/px6Uuyy0K5EWvl68gYNuuTbwKAoiPDszGwDccbjaPt3dliYpn\nzWXrbY8m1RYd/zMmMdykH5ZtZ5a4MOVEHwvO3ApWholGrsC0ITKcMLYVBFI/\nMBUljotCQQqfSfGAOqQzT+YGBUhqf1MFLh062IIqABF2Uv0ZRVFKoAuF+V+P\n7uGxEWDMAQtiVjMI0gFgZxxqsP9EoH64vn6MCZaBoo1hxGf/+9+2aIZIyjME\nWbwK\r\n=dxWP\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is modeled after the browser's\n`<input type=\"range\">` element.\n\nSliders follow accessibility best practices per the [WAI-ARIA spec](https://www.w3.org/TR/wai-aria-practices/#slider)\nand are fully RTL-aware.\n\n## Contents\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\"\n       aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   `data-step` attribute on the root element. This will be the step size for\n    value quantization. If not set, the default is 1.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"20\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `tabindex=\"-1\"` attribute on the thumb(s)\n*   `aria-disabled=\"true\"` on the thumb(s)\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"-1\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\" aria-disabled=\"true\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the thumb element's `aria-valuemin`,\n`aria-valuemax`, and `aria-valuenow` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"75\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"ad186768bb65467a86f70e827e74fee089e25811","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.22.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.74839da7b.0","@material/rtl":"8.0.0-canary.74839da7b.0","@material/base":"8.0.0-canary.74839da7b.0","@material/theme":"8.0.0-canary.74839da7b.0","@material/ripple":"8.0.0-canary.74839da7b.0","@material/animation":"8.0.0-canary.74839da7b.0","@material/elevation":"8.0.0-canary.74839da7b.0","@material/typography":"8.0.0-canary.74839da7b.0","@material/feature-targeting":"8.0.0-canary.74839da7b.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_8.0.0-canary.74839da7b.0_1596133902137_0.31815810879042017","host":"s3://npm-registry-packages"}},"8.0.0-canary.f041a48c9.0":{"name":"@material/slider","version":"8.0.0-canary.f041a48c9.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@8.0.0-canary.f041a48c9.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"32e37a42a1543f188a645f86c08083692570525e","tarball":"https://registry.npmjs.org/@material/slider/-/slider-8.0.0-canary.f041a48c9.0.tgz","fileCount":38,"integrity":"sha512-exfQ+Jl3/cmrvYB37wBsCLAt6kUYxdovro5dadInbnBEhMl96DnkekvQssgIfyJmgbsge/JVsXsT0YnbV7WFpg==","signatures":[{"sig":"MEUCIQDecCZyOyXnW/Grn6fXQ0pRmEnItpeBFhaPNJ0ma0uSfQIgRyPztwWz9Qr2QjSmcEYWImwJYt0WbMSP4Lr2n03JF08=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":725958,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfI1DsCRA9TVsSAnZWagAAUnAP/jabeh0ihTjAcP9GwcTA\nutRRBwUBWyhiXtqiOilQ6KU+l/Oln63jsljZN6NcAC0deRC4WfxffjlTnoVV\nEjSPaFUy5u8Ctmpged+5T0mILe0q1tT8G7VF5GKaNYuRH7PwQiK7kJSk5/6b\nRuh/cgoUBsUUsrWT90LNCCpQNQuYvuzTNmkqlnNcPBuOsB0BJjfiiUGdqtCU\nkv34Tn2kKId4L0bw6puQlcPTcS7rItdZ/yl3hz3EOsd1l90Z7CHkMiQXD+03\nnhAkYRGc3gWZDUn1iqKKlFgCSpbt9fSnNAo/j+2cUFLj+CUugI1h3run6df1\n8YV19zw3x/mHd9ENY35zUkdWwJgF4pxdDzM5lmScgDtFuXF0ySdpsLurMojN\n5lGhG+wpZrPHHrkiEJL6VneNiN1+ITdCUhL4CjnxezwRasmpU5Jjm2ekvC+n\n/McI+h8Du4J1ar4flMcJ+awDMNKaxNciA53N1LmmkBSPbHzUMcgKSM6mA0FQ\nUzY0FxBefeMmVL9fDzhwwG5iiM71HxnBDb25DfwjYzzGgvOziFdfZzNLTxfq\nUtY+idIrL0rnGBgK1OdBvqO+m+KZky4AyLkcWXKOYrE7pf1dhzRiPWPdFfDF\n+Trnu7igUVUt0RXMijuCEhF6lbgmrO/M91P7PBCPgAnI/kQQ0j2AlRUPWSep\n9eFE\r\n=CcBo\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is modeled after the browser's\n`<input type=\"range\">` element.\n\nSliders follow accessibility best practices per the [WAI-ARIA spec](https://www.w3.org/TR/wai-aria-practices/#slider)\nand are fully RTL-aware.\n\n## Contents\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\"\n       aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   `data-step` attribute on the root element. This will be the step size for\n    value quantization. If not set, the default is 1.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"20\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `tabindex=\"-1\"` attribute on the thumb(s)\n*   `aria-disabled=\"true\"` on the thumb(s)\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"-1\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\" aria-disabled=\"true\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the thumb element's `aria-valuemin`,\n`aria-valuemax`, and `aria-valuenow` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"75\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"e37611a41628785b7c1266cd53abdd9da0208c00","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.22.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.f041a48c9.0","@material/rtl":"8.0.0-canary.f041a48c9.0","@material/base":"8.0.0-canary.f041a48c9.0","@material/theme":"8.0.0-canary.f041a48c9.0","@material/ripple":"8.0.0-canary.f041a48c9.0","@material/animation":"8.0.0-canary.f041a48c9.0","@material/elevation":"8.0.0-canary.f041a48c9.0","@material/typography":"8.0.0-canary.f041a48c9.0","@material/feature-targeting":"8.0.0-canary.f041a48c9.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_8.0.0-canary.f041a48c9.0_1596149996134_0.30848952826973863","host":"s3://npm-registry-packages"}},"8.0.0-canary.fbb1381e1.0":{"name":"@material/slider","version":"8.0.0-canary.fbb1381e1.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@8.0.0-canary.fbb1381e1.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"6c17d7015038dc60b46581cf1ec3c9622d3758ed","tarball":"https://registry.npmjs.org/@material/slider/-/slider-8.0.0-canary.fbb1381e1.0.tgz","fileCount":38,"integrity":"sha512-qscdx680CYW68t/camgfT3DsrVf2OEEJzj360s+e4Xyxv/Nr8GpRn3+5zLBRK05SYHMFLZR2/V8znZOJ6GOcSg==","signatures":[{"sig":"MEQCIBTdfYoDrJrszb1uifDciA6BiqIpAp4Z0CCUJzDbJKF4AiA9gI6VMVGg16AxBwS7Juwdq40AiiAs3y6EgPbNYDGbuQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":725958,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfJD3WCRA9TVsSAnZWagAACrsP/1lZTvGPE27kp3kKruev\n9FMNXHg10R6MH/Dxd6MqVcDo6MKxS6nJ/f8UCgyoqySOenysPdl3yxCzh5jl\nSsnWg9Vu5ZScdDNNviTgkdUZbdBarxwko8xEYUI55GrjZWygtkfx8ISInfqn\nLzCY1n8+au5itJTvCeoPLoQwxQ4jgG6/6uJiC1R9uxKvYWm8O1s+lwZ5nxxv\nP2YQkXXGpl6uSsfxR2DV5C17jvCY51hAy0Df6rMwuCGycupr+DgJs3nu5SLG\n3A2UpYLvRLXiq35Hz/EI6lfZB5qagdtaRDXkcYc4OBVJ/rg8RR29kaJLaPHv\nw0YFZ7yZKuCjFbiGu59BVJqXeoP/DazYyY5z1jAQgu8gzZ7TIpP+Q11MtIuW\n+8ycQF114IHFCrQahfXCpXTEYWtGyzeI7BskCbC9JWUDp6SkfK+qA8d5fg2K\nMvdw2Ct5THGDLDXHpckWC0Cpcko64F6lp+o1Nw3Z6xvg32Yo6JrnfsRDSKtl\n0QUa1GuKRDyPuzSt8wu7sbYl7QSyHwf1YFUawizgv7B94NaDmElxIdOMzo29\nFsIqo2pffmVSVTLu6U34lkG0TkbA0LMhTlINyyJmm/p8WIl+QDJN24pFuwfS\n/vTBlSkrBY6my29CI8YcS5gxq4T55ydd2ENZyuB98SfLepsutLuuqILuLq2s\nT/78\r\n=HgP0\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is modeled after the browser's\n`<input type=\"range\">` element.\n\nSliders follow accessibility best practices per the [WAI-ARIA spec](https://www.w3.org/TR/wai-aria-practices/#slider)\nand are fully RTL-aware.\n\n## Contents\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\"\n       aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   `data-step` attribute on the root element. This will be the step size for\n    value quantization. If not set, the default is 1.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"20\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `tabindex=\"-1\"` attribute on the thumb(s)\n*   `aria-disabled=\"true\"` on the thumb(s)\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"-1\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\" aria-disabled=\"true\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the thumb element's `aria-valuemin`,\n`aria-valuemax`, and `aria-valuenow` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"75\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"7c42a890f9b5f1bce3c7986f37f806066e6e30bc","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.22.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.fbb1381e1.0","@material/rtl":"8.0.0-canary.fbb1381e1.0","@material/base":"8.0.0-canary.fbb1381e1.0","@material/theme":"8.0.0-canary.fbb1381e1.0","@material/ripple":"8.0.0-canary.fbb1381e1.0","@material/animation":"8.0.0-canary.fbb1381e1.0","@material/elevation":"8.0.0-canary.fbb1381e1.0","@material/typography":"8.0.0-canary.fbb1381e1.0","@material/feature-targeting":"8.0.0-canary.fbb1381e1.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_8.0.0-canary.fbb1381e1.0_1596210645685_0.38358655645171935","host":"s3://npm-registry-packages"}},"8.0.0-canary.7f61d5785.0":{"name":"@material/slider","version":"8.0.0-canary.7f61d5785.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@8.0.0-canary.7f61d5785.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"97dc649fd01e45c4a972a7c416fada37490eeca6","tarball":"https://registry.npmjs.org/@material/slider/-/slider-8.0.0-canary.7f61d5785.0.tgz","fileCount":38,"integrity":"sha512-b4rTov50UCwgFcqrzV/HMG2QWztWGOQlu1dSwqcP45JWYX82Xzv6E604lCiYkwd+z+hwGgdQD2oI9QE+OEDGsA==","signatures":[{"sig":"MEUCIQCsSh7qu0gGw0LjdfgLo8sZAqnOUM/NA9GJfASdNn9LrQIgHMH6j4Dw5L4H9may8omEW995k60V4QpNR+efbXlQ4p8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":725958,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfJFOJCRA9TVsSAnZWagAACfIP/1RxVZ9NujQb7tGG0D83\n/i+Wyks2RMdlOZU/v1PTgTTwkVgwDfnMA4CZVG9+XKxdmZg7FzhSnckj0z5n\nie/huy7oGx90tnC45odMl4DfzI0fMGPYuiPow2lmwRqPthirT4YUrxqGuMEF\niSnbFUkIfIXueJMhw9puiGfXIIILetpmgaubhE/GwKqewqdcO3dN/8PTV6ck\ns7z7lMRxy9yb/HLsdBC55LTLYKdUvEL+OmknnMNarMydabIDBeySGQ25D0di\nPqAt0DWdM38D13gkVwlLjGRz33jCTdFk6+Vgms2XCIzif9lhT0+OuQ0OUavg\nB56abuT0Tve6HWA7TM7Na53zqrrsmJ/vKJ8JEA43MV9WETaB8vezVrklN9hB\nvTDeviD6dKiQySfazVec29hcWW3G34k8LtFpGTX48E/ALI2bw4G1ZPp7j9Pa\nd9rxjepYsIn2l+XssotPXptVb+P9wx4eSctHuYAT/zjRhTwUNwNUYKAZrkWL\nB1xXIeuD8cjV1IJRyNjpWGju0gwb5wGmHQ7doFEapsVWZ/OdX8rI7VTK+NSf\nf8XhIqG3lM31g0IR/WnlBI75epR54lipF4RaYZ81jMnUmNQG1vP8dIwhV3Re\nYGW6+6gvxHExou3ER9s2QRvkJO9JwWuuo/Mm43xBT404eeKCRO3TvV00pw36\n2XUl\r\n=PBVa\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is modeled after the browser's\n`<input type=\"range\">` element.\n\nSliders follow accessibility best practices per the [WAI-ARIA spec](https://www.w3.org/TR/wai-aria-practices/#slider)\nand are fully RTL-aware.\n\n## Contents\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\"\n       aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   `data-step` attribute on the root element. This will be the step size for\n    value quantization. If not set, the default is 1.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"20\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `tabindex=\"-1\"` attribute on the thumb(s)\n*   `aria-disabled=\"true\"` on the thumb(s)\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"-1\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\" aria-disabled=\"true\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the thumb element's `aria-valuemin`,\n`aria-valuemax`, and `aria-valuenow` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"75\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"beb77eaf7ccf3f03c6d830f96485010ea9e3d47d","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.22.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.7f61d5785.0","@material/rtl":"8.0.0-canary.7f61d5785.0","@material/base":"8.0.0-canary.7f61d5785.0","@material/theme":"8.0.0-canary.7f61d5785.0","@material/ripple":"8.0.0-canary.7f61d5785.0","@material/animation":"8.0.0-canary.7f61d5785.0","@material/elevation":"8.0.0-canary.7f61d5785.0","@material/typography":"8.0.0-canary.7f61d5785.0","@material/feature-targeting":"8.0.0-canary.7f61d5785.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_8.0.0-canary.7f61d5785.0_1596216200754_0.7915239647464762","host":"s3://npm-registry-packages"}},"8.0.0-canary.e1bc84d10.0":{"name":"@material/slider","version":"8.0.0-canary.e1bc84d10.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@8.0.0-canary.e1bc84d10.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"474fa0e725f2c8ea29f5f474bcb1579a92ca1afa","tarball":"https://registry.npmjs.org/@material/slider/-/slider-8.0.0-canary.e1bc84d10.0.tgz","fileCount":38,"integrity":"sha512-ynt2KlMjUIvEpSZ7WWnB/SYR+eq+WCgVVItjgzUi9xOftE4luvonW+dbLwLDmdhIPXbYRVNodWZQFD8x7lpEEA==","signatures":[{"sig":"MEYCIQDUNKHWHpjbjyt9WAbVmYT0haLZqWhi/PVrVYLn8OhoyAIhAP0vaQYLdtsNBdPtaN/JRpGALNGrng1FEEYM9y5DNUEL","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":725958,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfKE6nCRA9TVsSAnZWagAAr1oP/07QH8o5LynIF6Q4LCo1\nqDvnVMmzV8VTFmJ6UO6+G4u5W0GZ35+9eARbqHdGhZ3T2XEn15Taa8BA2AmP\n5OOTooFWHh8K1tXbdnu+UfIAUjV9at1+1pMJXCt6oyKVNnIgsImMdjQiiMs7\nCKy1d/usYgjWq+TarTqhS4gfJEYl6vj+K5+LKkadDBSiNmUIGjg0MzkdRjXx\ndjtKcuJpxXau4qdlkvOQCHRAYfJTP0ZWJrSm1LH/HBFrQv5zz2fD38urh9fU\nGNVtV3m6iD9eqkrIHmqY4Ny78ZMji9Qschl8doAs72LEKGyW1Dput/D6JIeP\nA6qx++Udg6KKXO37TnDyMxrH7Tgl4cEkPZ9MLE0Q7Qr7xAJ1ntajiPGfWgnZ\nd0zpEzE/bPi/lOT+dIuMIoOnd1T38qNYg0GqfGvuW+BWRWdDBVzmlmOonXt+\nYZNq8BkitmgqzCajQXNPMjdvK1g37ihi9tI3digL/XBHpRrEOHBB5gKcSB8Y\nxNi8u6uVK7b9MvIoNq7mzZex6zHGY/sUbHL5ceXYarCKX9ABrKDUbhdO5Tpt\nOlbkjUBZmY2cqmuyF8fj32pcf4zkSKsbZg6g2FA6IEILkgLKQnGGODiXwrUH\n58XIAkDmWHsMzYZTciQcYor2j8Wfo52NUGTWgpuIFLy8NKf3iZdoZygw0lYj\nKlF0\r\n=9fIk\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is modeled after the browser's\n`<input type=\"range\">` element.\n\nSliders follow accessibility best practices per the [WAI-ARIA spec](https://www.w3.org/TR/wai-aria-practices/#slider)\nand are fully RTL-aware.\n\n## Contents\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\"\n       aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   `data-step` attribute on the root element. This will be the step size for\n    value quantization. If not set, the default is 1.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"20\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `tabindex=\"-1\"` attribute on the thumb(s)\n*   `aria-disabled=\"true\"` on the thumb(s)\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"-1\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\" aria-disabled=\"true\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the thumb element's `aria-valuemin`,\n`aria-valuemax`, and `aria-valuenow` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"75\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"4752dcadba6adfeb006ee3689e295db016f4bea3","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.22.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.e1bc84d10.0","@material/rtl":"8.0.0-canary.e1bc84d10.0","@material/base":"8.0.0-canary.e1bc84d10.0","@material/theme":"8.0.0-canary.e1bc84d10.0","@material/ripple":"8.0.0-canary.e1bc84d10.0","@material/animation":"8.0.0-canary.e1bc84d10.0","@material/elevation":"8.0.0-canary.e1bc84d10.0","@material/typography":"8.0.0-canary.e1bc84d10.0","@material/feature-targeting":"8.0.0-canary.e1bc84d10.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_8.0.0-canary.e1bc84d10.0_1596477095035_0.8529497346872126","host":"s3://npm-registry-packages"}},"8.0.0-canary.096a7a066.0":{"name":"@material/slider","version":"8.0.0-canary.096a7a066.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@8.0.0-canary.096a7a066.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"67d6517f4d261ff931982d81caf0977a41023121","tarball":"https://registry.npmjs.org/@material/slider/-/slider-8.0.0-canary.096a7a066.0.tgz","fileCount":38,"integrity":"sha512-9vEtO1BWh5WqgYCvFleLgKMQlhoQmNBOZf3qQsq8Vos+rKGPVM7iIn5bdqfjP0fp3JDPdXEr+Mgoi9NfGMtHzQ==","signatures":[{"sig":"MEUCIG5RS+zVfq5Z085cgwrfsq/70f/By+vZqZgXuyxX9ClBAiEAnyLs+7QZZVqC2eg46oQtSigVohrcGHGJpg3qmH5Tiqc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":725958,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfKE85CRA9TVsSAnZWagAAhO8P/3lH9VhyaNsW/P2lVzF+\nKERAKz5D4mfFaK9+/WMLnIt/E5SEkaJHhioyaE0UQFz7+Xl2AKq3/zbYuEMu\n1syGe4QlwRvhpSAE/FG1LkJKlSsrQs+wXJjMLjyaYcwQmMMk4iPO/JR1ogQN\nYL6kT6rVHAkPc8FNVMotli1CwaHxBuDom9CN+PtHhRn2hjfumDSX3VPo79jB\nL6gf9h+iKg7eFGt86wythe4IcToE/puLPy3OqGWI/CeV5z+TuYCMijKpGOyL\n4uF4jojDTGUQQhPOtqLksFMNW8biI7UnmavBzZtq1GbSObJrGfDBDtv8AARV\nHnA7j0nfDkaIhancOMQLsWmmv7hsoohQ4zvfmBp1Mv9NFcZtxPzf67rpMCpX\n4DXCYbxqw3Q+jfsxbaYTe6iPmYVJD+ov/k5YonNthkXKPBJOI2MjKKuScX5T\nN4cByGnpq4kWghFWvPBp4Oft9gycQqnh6UAQy6ko1zhGKZ8hKDFabp9I0zBF\nbRGulEBk2tUPjP6ksCi+abwNmRunrC0zm6WPHkUvACGVvf1jDxMlaIQtgH4r\nl7fzO8+jsPDbcrdDSIWLWSs/Ex2kcKVvrGX9+YRlIjdFIATJsKP4w1cto1xT\nklky/eADJlRdloJ/vVAeuXBR/z/D/woVGFj+BGx4PN85Vh4Rdxq/a8BdZfEJ\n+yXi\r\n=oMnw\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is modeled after the browser's\n`<input type=\"range\">` element.\n\nSliders follow accessibility best practices per the [WAI-ARIA spec](https://www.w3.org/TR/wai-aria-practices/#slider)\nand are fully RTL-aware.\n\n## Contents\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\"\n       aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   `data-step` attribute on the root element. This will be the step size for\n    value quantization. If not set, the default is 1.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"20\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `tabindex=\"-1\"` attribute on the thumb(s)\n*   `aria-disabled=\"true\"` on the thumb(s)\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"-1\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\" aria-disabled=\"true\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the thumb element's `aria-valuemin`,\n`aria-valuemax`, and `aria-valuenow` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"75\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"c1f4491c464cef40f62d03f687af7b443805fb7e","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.22.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.096a7a066.0","@material/rtl":"8.0.0-canary.096a7a066.0","@material/base":"8.0.0-canary.096a7a066.0","@material/theme":"8.0.0-canary.096a7a066.0","@material/ripple":"8.0.0-canary.096a7a066.0","@material/animation":"8.0.0-canary.096a7a066.0","@material/elevation":"8.0.0-canary.096a7a066.0","@material/typography":"8.0.0-canary.096a7a066.0","@material/feature-targeting":"8.0.0-canary.096a7a066.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_8.0.0-canary.096a7a066.0_1596477240861_0.6059476513683966","host":"s3://npm-registry-packages"}},"8.0.0-canary.aa3a3e5a4.0":{"name":"@material/slider","version":"8.0.0-canary.aa3a3e5a4.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@8.0.0-canary.aa3a3e5a4.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"aa80695cfe62b1858f082c6fe30eaf3745789731","tarball":"https://registry.npmjs.org/@material/slider/-/slider-8.0.0-canary.aa3a3e5a4.0.tgz","fileCount":38,"integrity":"sha512-+WeAY08xM8fZ5Mk97TX/UnE62ne34hk3OP931IHiHbk8PGdTA4/bv0PPyUdmBdLBX4I6UVFIndAWy86/Fw+h5g==","signatures":[{"sig":"MEQCICVrph+De460G6b5Fm1LixZmLmVr50BMOEY7HPV/q/EdAiAg8NADtBTJmGwYcxEcyLD8FdH71zWZHOd67Az63A0mdA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":725958,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfKE9aCRA9TVsSAnZWagAAbGsP+wXZaQaegN/7D80si+4B\nV1iG6wR+Dxf+KQDyTW6OJw99CvWwyxKDVlLC6Dt2NBOwxhps+YuIh58gehWd\np8yByuTWqg6RnPoAZ3AbQ3Tz/rkFG1HQO+o3g85bUlUl2O5TbE40cH0HjNE9\nxG0ygFPTh25lpdHppOkF9WnlW/Isc2pyXm49Vqdtp1Zygkhx0+rgLW11+AgW\nLDBUr3JsrzIBBT9rj/zjUVCeH1TdbugAyLQeBMNb+7PUB59rc76XKK6PUv4G\n+YNaZSSDgcaYN1EBj7Dxiu0QukoAdl+qNnPoYIeeb2bDYIqZgbfNPWfD5ac/\nRIWSdp4D+8UP/Wz/cMFdHchs2DRdtb6/k7FJHRdc82ee0vb05lVdaS/rnGrZ\nJqkq3Vkk+PvDlf8hKmcU8kaHQUCKS2MGd+oM0q9Mw3rzAZt4+SG7eGQ5BGKs\n7B9LhjaAHFUxLaL6e4J0d9foS4Sg/wod4a4VFxbmHyZmRQelX3lO+b3uOAo5\n7T7XHHB4MjvKnc46SxioMoaSwHQ0Hwi5J+8ClQVDqjmJrayTWw+4JERdT4Ky\nhMO46veuQTMoFvAZR0FUKiRoSGs16P5oIiNYx/FBLbUL79PYC9V/ePdAyXOA\nJel2PWjYkVynhSoKzoflbKjAbBGvldQujvwfiA6aLvdEQzjk7Iy55AI6r2SH\noe0K\r\n=K2M9\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is modeled after the browser's\n`<input type=\"range\">` element.\n\nSliders follow accessibility best practices per the [WAI-ARIA spec](https://www.w3.org/TR/wai-aria-practices/#slider)\nand are fully RTL-aware.\n\n## Contents\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\"\n       aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   `data-step` attribute on the root element. This will be the step size for\n    value quantization. If not set, the default is 1.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"20\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `tabindex=\"-1\"` attribute on the thumb(s)\n*   `aria-disabled=\"true\"` on the thumb(s)\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"-1\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\" aria-disabled=\"true\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the thumb element's `aria-valuemin`,\n`aria-valuemax`, and `aria-valuenow` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"75\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"8e25515e9c171e19310cbb58630a760408b78c80","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.22.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.aa3a3e5a4.0","@material/rtl":"8.0.0-canary.aa3a3e5a4.0","@material/base":"8.0.0-canary.aa3a3e5a4.0","@material/theme":"8.0.0-canary.aa3a3e5a4.0","@material/ripple":"8.0.0-canary.aa3a3e5a4.0","@material/animation":"8.0.0-canary.aa3a3e5a4.0","@material/elevation":"8.0.0-canary.aa3a3e5a4.0","@material/typography":"8.0.0-canary.aa3a3e5a4.0","@material/feature-targeting":"8.0.0-canary.aa3a3e5a4.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_8.0.0-canary.aa3a3e5a4.0_1596477273960_0.3153062036225225","host":"s3://npm-registry-packages"}},"8.0.0-canary.5903d39af.0":{"name":"@material/slider","version":"8.0.0-canary.5903d39af.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@8.0.0-canary.5903d39af.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"5dd0d5821e4aaa6a215148e767932bf250ea9b71","tarball":"https://registry.npmjs.org/@material/slider/-/slider-8.0.0-canary.5903d39af.0.tgz","fileCount":38,"integrity":"sha512-nYbxa2Fkz9HaWcB+HxravUtEihMehAfap913IZopYJU27muJoyxWaHpzyDDl+VZOf8OarFDaCycoEFy1V4Qm1A==","signatures":[{"sig":"MEYCIQDsXkBbqC0lGQAr9heAvX2dqEZfgIqHN7451iBpJSyXPgIhALKwvT/ckb4KOEKrnixAmrY5g+5hzS3wr3VoTIKu8Y8N","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":725958,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfKE9wCRA9TVsSAnZWagAAAxwQAJAnyc+w54v0DOUv9Kre\nOQhDDu/E4dC2O+IeFfiCDcyNilpa3xHBl8vuBfbbuOCMkS93v8uCcmSYZ18L\ny7Nvi9YNnCQXWNWMPJAgpkLcsoPMUwYZM6diZ2Oyrt8SruoJ6gex12b4G6hS\nX+wzDL+CZA87qU3EqGZeA/vygwIQ6eEB1QOTZjOsegct1ehDUx1ikpNwWojM\nX4e2QlZU9C28bGou0m6oaHqJEJR3kByelXMxjD/0fZGrFIJMhutw7cltKxD+\nbz/rPQYQlEbpJ2jEB25vR8Fd9/cKhrEJWqeROoXONMxrp7rFpKSibggE5nzY\nkSkMfesynPLhMWKZlcuAs8qaOUGHW7s7educdHSd0UbJNQ6twkdvzOrSYgag\nkbC7gWxQw1vkmWJ+Mm1pVxoXkEnEY7mjRTPHNGd1Y6preTiEypUHUsTcvpX4\n0Q+aXy6TJYCBvxd3n+HQ+a2JMgJgxNruPmxXQ69SJZ8CdYAsnrfoM8ob64es\nhtYsM1JIJrUlMf52lRquCA23vjV89JqLzitUhnbhlTDRawTH6GcpqwFAdYed\n4aNE9pZu5m0WY71rSUrfXiigzSvAP32h6v5Hq+qq5gq2EqGvPM6H/n/1VJ5N\nW0+Ip1rpb5GGZOQjYwFtx8k6hCRwkePwEKPkUPNTPhy6uRe8oOLQioc6vqsG\nHIyw\r\n=ZX8y\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is modeled after the browser's\n`<input type=\"range\">` element.\n\nSliders follow accessibility best practices per the [WAI-ARIA spec](https://www.w3.org/TR/wai-aria-practices/#slider)\nand are fully RTL-aware.\n\n## Contents\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\"\n       aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   `data-step` attribute on the root element. This will be the step size for\n    value quantization. If not set, the default is 1.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"20\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `tabindex=\"-1\"` attribute on the thumb(s)\n*   `aria-disabled=\"true\"` on the thumb(s)\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"-1\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\" aria-disabled=\"true\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the thumb element's `aria-valuemin`,\n`aria-valuemax`, and `aria-valuenow` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"75\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"8a4f2eea8ac8483e7e0a1c93b141ea9dfaebaf4f","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.22.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.5903d39af.0","@material/rtl":"8.0.0-canary.5903d39af.0","@material/base":"8.0.0-canary.5903d39af.0","@material/theme":"8.0.0-canary.5903d39af.0","@material/ripple":"8.0.0-canary.5903d39af.0","@material/animation":"8.0.0-canary.5903d39af.0","@material/elevation":"8.0.0-canary.5903d39af.0","@material/typography":"8.0.0-canary.5903d39af.0","@material/feature-targeting":"8.0.0-canary.5903d39af.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_8.0.0-canary.5903d39af.0_1596477295869_0.7866434877881552","host":"s3://npm-registry-packages"}},"8.0.0-canary.72258f898.0":{"name":"@material/slider","version":"8.0.0-canary.72258f898.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@8.0.0-canary.72258f898.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"757eb3a22dcc643f7798a2204da80861c08eb3cb","tarball":"https://registry.npmjs.org/@material/slider/-/slider-8.0.0-canary.72258f898.0.tgz","fileCount":38,"integrity":"sha512-ap0VmLoNjBMLHJU7/alcYElgPTNVUO4o0ZJw7wbWqWJ9no2vnfAoJqdssT+2UTeN3ro2uNKxtw9W6Oj1MQuK/g==","signatures":[{"sig":"MEUCIFokmq8Xdze37jCNDfzrvC41iSosOiA4yQv+EZVpig9eAiEAx+Pl1+hZqZ+wWIpxcIIYLoxs5grb0URNSbXrlKPvJJw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":725958,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfKLc0CRA9TVsSAnZWagAAC3wQAIJe58cUHKWjLYhD0aXB\nIGqtQ+l6Lvmhl1iVvwt71f8wbGsfqfZmU6MUK7H2wF2zVUCmRvgYJcaMNr1m\nW3OZPAcVmlzm5Byp5tnbhkO3IsODbalHNoYEaK9z6K0BgFLx4A/K91ECKSrZ\nxuj4vVd6nWjobVmWx+22kifauOl2vTuk3HiYz9ENLJBCIElXfnCP/d41N/5T\n182loUQw0qfZsOtmQjdJ6GVV9ROAwFUvlZCYDzJCujBVudnIxLMqCIjgzqg5\nH5PBDXX6hP/a/hLIcArtFYzVh3DSpWyeDpU7OSr3Fkbm67++bmqxlRtKYUQX\npqH7U1VU9BCwhYm7dEfvlXturfybI9KrqZXUW/qJYnGma/GyTp3qQ4IIN99V\nh1fV2bDpYt/pd1Va9BY3e6LtehnZHbwYejgaA50Ot/mcGmh6roKeDeciG5QL\nX4+wUFKV0PluMEm0X9Ualg7EKpykZ3DUpeLNVNL3kiFKlFbctft2f0PGQA/N\ntWjwr0S8WK3cYlHwz1LUUvCz0ZyG9F8y9JLiVicWgII/YmTgawXyBVAcC3GF\n8MwO6A6CbpkHqij3EHCIgqhJgbrZaVOaSj03SXfQSgDXsVjBW6S2G+ol7cf6\nN0qsHqwOYpzB7DDc8fZhXbBOz1MBqcJRzi9dEQL/DhVCLQnRQ87Szqjx8oWo\noh3l\r\n=FZO1\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is modeled after the browser's\n`<input type=\"range\">` element.\n\nSliders follow accessibility best practices per the [WAI-ARIA spec](https://www.w3.org/TR/wai-aria-practices/#slider)\nand are fully RTL-aware.\n\n## Contents\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\"\n       aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   `data-step` attribute on the root element. This will be the step size for\n    value quantization. If not set, the default is 1.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"20\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `tabindex=\"-1\"` attribute on the thumb(s)\n*   `aria-disabled=\"true\"` on the thumb(s)\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"-1\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\" aria-disabled=\"true\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the thumb element's `aria-valuemin`,\n`aria-valuemax`, and `aria-valuenow` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"75\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"ff2c64799ee2d684ba36b9cebd15fbe0d0ed17df","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.22.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.72258f898.0","@material/rtl":"8.0.0-canary.72258f898.0","@material/base":"8.0.0-canary.72258f898.0","@material/theme":"8.0.0-canary.72258f898.0","@material/ripple":"8.0.0-canary.72258f898.0","@material/animation":"8.0.0-canary.72258f898.0","@material/elevation":"8.0.0-canary.72258f898.0","@material/typography":"8.0.0-canary.72258f898.0","@material/feature-targeting":"8.0.0-canary.72258f898.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_8.0.0-canary.72258f898.0_1596503859632_0.05388054344857052","host":"s3://npm-registry-packages"}},"8.0.0-canary.1b44b43c8.0":{"name":"@material/slider","version":"8.0.0-canary.1b44b43c8.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@8.0.0-canary.1b44b43c8.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"0d15b132337d42d0c0ddba9235973ee6b1927463","tarball":"https://registry.npmjs.org/@material/slider/-/slider-8.0.0-canary.1b44b43c8.0.tgz","fileCount":38,"integrity":"sha512-CIHaxvISL7nq315AZIOVYj+Iqw+oAnwpqFcVKTNekQBINKWhE7h7x/74CJEjm4N6HMECiILtIaURZlefsoQMPg==","signatures":[{"sig":"MEUCIQCJ7lNlwKjfnaQrs2hgdi9QI2LXtAnveb2Di/UEI4bZjAIgfR1L4JYIxHn6fZGsMsA6sEOtN4lFFv+qTJFoqT0O83s=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":725958,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfKZFlCRA9TVsSAnZWagAAxhUP/138PZqdKoVf8tJ/5dyK\nillX42KUqS/UuoNdvZhNXenz6FisaVJP2G8h+QNEtQhDwXNnQ7cNkxlcfMtf\nvPWh3qxKcg2kzgEv91s4wY8BUiPLI90n2GXoq7WEghrutnq+QxE6v9x6paI9\nr3r+Pd5kGh8nSkqvPA9GcOtkEOIOW7AvT6ADQmskWCHrPbbpjY3XxI/Dh0Z0\niMpVQsVISle9Lu2Bfd63qgmEnA16vPh74/TwvqB9zOri0K7O/u1WPtT4ki61\nKFBYPPx/dVFJxKl+3KQ7JM1kWOZWcy58QaQCv4lMrvuCQ9hAOPegGLnZgNDb\ne9nKWoUKN1hbc3ML6zEIZ7vkVp79/5SpCj7U8XiyewF27vKqETW8yrSeJwkl\nu680i/wwCkHAcD5627BtIy0BSNPfFwjFtxR52ViDo9BBGEJ5ESduwOT6Hzjd\nyScuijILIoVCc8XS2UVgRcvdGdtQFusINM2PckV/hwWqFmYnRJ8q5v7e35Bc\nEd8VRVOR88OQNlYpQvcqXGSgOvuEq24sLyf34VV9QL7UGMuauAKr98+wFan/\nEjMsqgBQF/3IC+vn5zbdq4yz/0MxuJCMRsO9PG3xm5nm0ZTzEetiSrWlfIaH\nLswW6FRvE2CFWd6HLh1JGwnKvr+j1w7g8+RkDj8Ia7k8u7O/diV8ZDzik+mZ\nL3lT\r\n=S5Ux\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is modeled after the browser's\n`<input type=\"range\">` element.\n\nSliders follow accessibility best practices per the [WAI-ARIA spec](https://www.w3.org/TR/wai-aria-practices/#slider)\nand are fully RTL-aware.\n\n## Contents\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\"\n       aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   `data-step` attribute on the root element. This will be the step size for\n    value quantization. If not set, the default is 1.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"20\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `tabindex=\"-1\"` attribute on the thumb(s)\n*   `aria-disabled=\"true\"` on the thumb(s)\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"-1\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\" aria-disabled=\"true\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the thumb element's `aria-valuemin`,\n`aria-valuemax`, and `aria-valuenow` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"75\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"69ee70c646249b45b57e59e958f1ca6d8332dec7","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.22.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.1b44b43c8.0","@material/rtl":"8.0.0-canary.1b44b43c8.0","@material/base":"8.0.0-canary.1b44b43c8.0","@material/theme":"8.0.0-canary.1b44b43c8.0","@material/ripple":"8.0.0-canary.1b44b43c8.0","@material/animation":"8.0.0-canary.1b44b43c8.0","@material/elevation":"8.0.0-canary.1b44b43c8.0","@material/typography":"8.0.0-canary.1b44b43c8.0","@material/feature-targeting":"8.0.0-canary.1b44b43c8.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_8.0.0-canary.1b44b43c8.0_1596559716055_0.6091793735776236","host":"s3://npm-registry-packages"}},"8.0.0-canary.e9d2e2f96.0":{"name":"@material/slider","version":"8.0.0-canary.e9d2e2f96.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@8.0.0-canary.e9d2e2f96.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"4c9c236ef2319042f2ebe73876ec72c81a4e204a","tarball":"https://registry.npmjs.org/@material/slider/-/slider-8.0.0-canary.e9d2e2f96.0.tgz","fileCount":38,"integrity":"sha512-G2WDZAWDVg4t24d1GO1bjTXh23qtFixc2cXIm2JmjBVAcxSt94PcxeTfvK/PvV9AZmF3hVKOTAYmcMr4Tj2eYg==","signatures":[{"sig":"MEYCIQDwHVXU6tv/IO+dI6G47Ky/0rNKsCNS3yPmD7F0udOG0AIhAI5WoxkhfOrfcM64l+GINOAchPWZzAuIyyBaadB0iPls","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":725958,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfKcP/CRA9TVsSAnZWagAAyIoP/AjTowVInDcBTrIg0gBr\nQ42K+vEePF/zc0zR+PC4L13oewyGX/odf/K6XNbw2yNMXIoDq8kWZG7KpHso\nBCvr4WtM8n0Mqkm7eYqC/aLVWqajhaNDNPoD40PzAKM6Yu4qeeV2C5BDyoEz\nu3I8R+AtJfYszLsx/GqPloe2DpwO0ngFpwHpCAOuSNzcJRZkBeI45jP3SlP2\n4lZY/Qj+iNXohFpHy24hlY2AFtVtbjEKISOrckJuPdwBWoN5C3p6j/4SaJXp\nt7xRh1TMaWoGRij20BUgTrRLkNSobEi9f5UuQrJJqDHvMtfmadXhsH3SDCSy\noDCdEhekBffK5wYPXQNhrIgb+sYlqYbcRlajT3fExqC7CGsDSJ3JM1VCAmDM\nWcaZyBjlPLcEYL7vMkPLZhbLKS4m4pRVVIdMATYbvela6hjPaRcE4uEAE4Sa\nCb/mDj6MDsuxnyO8bZgPhXrj7mETSwg9kI+C/Mnloy63kV8bu4ZYnA7Vsk8q\nrWzgnQYx29lI9fH1qVGdhMDE4Osq3idFXTYtCUI51vSZI7/lqpDxb+YIxez5\nLZRMppvxrjYtE1yAPOmdL2QDtlA5Q5zPfeY/fAB0mjZ/k/cWM2b4YOiihYEM\nq8FXaihadcKpqeDsoRTzIjybvX+9WlzZLs3K8uGG5w6Z1aeKbatpUklEt6Ky\njEUg\r\n=2z5P\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is modeled after the browser's\n`<input type=\"range\">` element.\n\nSliders follow accessibility best practices per the [WAI-ARIA spec](https://www.w3.org/TR/wai-aria-practices/#slider)\nand are fully RTL-aware.\n\n## Contents\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\"\n       aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   `data-step` attribute on the root element. This will be the step size for\n    value quantization. If not set, the default is 1.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"20\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `tabindex=\"-1\"` attribute on the thumb(s)\n*   `aria-disabled=\"true\"` on the thumb(s)\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"-1\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\" aria-disabled=\"true\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the thumb element's `aria-valuemin`,\n`aria-valuemax`, and `aria-valuenow` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"75\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"f6bf51788bc1f39067fcceced79dcc12b2c59caa","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.22.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.e9d2e2f96.0","@material/rtl":"8.0.0-canary.e9d2e2f96.0","@material/base":"8.0.0-canary.e9d2e2f96.0","@material/theme":"8.0.0-canary.e9d2e2f96.0","@material/ripple":"8.0.0-canary.e9d2e2f96.0","@material/animation":"8.0.0-canary.e9d2e2f96.0","@material/elevation":"8.0.0-canary.e9d2e2f96.0","@material/typography":"8.0.0-canary.e9d2e2f96.0","@material/feature-targeting":"8.0.0-canary.e9d2e2f96.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_8.0.0-canary.e9d2e2f96.0_1596572670709_0.5941522173044378","host":"s3://npm-registry-packages"}},"8.0.0-canary.b9dff0a19.0":{"name":"@material/slider","version":"8.0.0-canary.b9dff0a19.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@8.0.0-canary.b9dff0a19.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"aebdfebec6d2bda62deebf54fe67faf7d63a62a7","tarball":"https://registry.npmjs.org/@material/slider/-/slider-8.0.0-canary.b9dff0a19.0.tgz","fileCount":38,"integrity":"sha512-lWAfK/d7Tbze5I1l+/md3I61+ABiM7Awkk7ksNfd/rMIO9b0SMNr2nsXHzmcKlRgizCJZo3kH7uK4mnapbDCIw==","signatures":[{"sig":"MEYCIQDxED7vNFEsxazDkbezDBCMVIWV5/ds8kP60LjXrIZPoAIhAKPyQfV6ZSP2WBRJfArXTqtjAn3Yv0HJv6RF7CdG4Oqx","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":725958,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfKiw0CRA9TVsSAnZWagAAmgYQAIP6uqD5NeBOvNr2sY1r\ncUhWfC8Ap6hvBOLAhXkWTEXItwCnHfq2kItkrXNrjp7BrbtUHIiesqIf9rpi\nU3O0gZhc+uy7JyriydqtaGyuXxrVTUkwx8RMVS9tWaq6M4x/DjKfgkT8Psan\npOLohlSc1nSrUWmqdNy6Do5isYm7w9/uyYvspIWsYr0hJKwlTFtAupe1pupg\n5lazEjoMRFCEVTCTlVr6eTzt4Y8fBf3OPJVnruyFsQnAmZ+WASVMwduUB17K\ngdeZG/1dalKxwFXDad2CD+nVWa+Pf4O+0uPZYics2LoLTpdA3LDM9ffn3yHB\nnnmNyDlLJgJU3ggWx9uXhtgjFb42NEmgjzlDI6YO198xjcY7oq2gLXsDwE7O\naLtoRJoNifamOChbd2QvnF8C8csL1PZYKgh5LsmP0BNCzTEYxgtl7KxedCHG\nCVI7fg5Nd53C6P4TP++KmkZqDhI0+HSzzox6ogifz5rOCGwBM/lkTjEYBXIv\nD0SdpBWd4+MF9y2CyIRAhl9MD3p3/mv2MIR4NyDPAPAkz6e3IaP7o5UhdqRv\nBBCUb2WvIkxDwKPpZMscWmGFgBqb8QBIKeEuhTdj5j5Cc/ACEHJFnkRy8d4P\n6puQUs8wO/RhNrp3ycIvBa9pJL5xmr+7NTs4RzFYeS6tgO1suPQ9R+yxyX1/\ncmBT\r\n=MIt5\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is modeled after the browser's\n`<input type=\"range\">` element.\n\nSliders follow accessibility best practices per the [WAI-ARIA spec](https://www.w3.org/TR/wai-aria-practices/#slider)\nand are fully RTL-aware.\n\n## Contents\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\"\n       aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   `data-step` attribute on the root element. This will be the step size for\n    value quantization. If not set, the default is 1.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"20\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `tabindex=\"-1\"` attribute on the thumb(s)\n*   `aria-disabled=\"true\"` on the thumb(s)\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"-1\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\" aria-disabled=\"true\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the thumb element's `aria-valuemin`,\n`aria-valuemax`, and `aria-valuenow` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"75\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"dec2f9fa4c83e98bee860646fc2a65b134a7900d","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.22.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.b9dff0a19.0","@material/rtl":"8.0.0-canary.b9dff0a19.0","@material/base":"8.0.0-canary.b9dff0a19.0","@material/theme":"8.0.0-canary.b9dff0a19.0","@material/ripple":"8.0.0-canary.b9dff0a19.0","@material/animation":"8.0.0-canary.b9dff0a19.0","@material/elevation":"8.0.0-canary.b9dff0a19.0","@material/typography":"8.0.0-canary.b9dff0a19.0","@material/feature-targeting":"8.0.0-canary.b9dff0a19.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_8.0.0-canary.b9dff0a19.0_1596599348164_0.4452407667704803","host":"s3://npm-registry-packages"}},"8.0.0-canary.2bd09a706.0":{"name":"@material/slider","version":"8.0.0-canary.2bd09a706.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@8.0.0-canary.2bd09a706.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"0cf799d5066349595675a3bea42f338b018f80bb","tarball":"https://registry.npmjs.org/@material/slider/-/slider-8.0.0-canary.2bd09a706.0.tgz","fileCount":38,"integrity":"sha512-ItDjHN8Ci+0s2gN0DDgtKY0IzxJ4j3ohq9rtikCuH7g2CZXViXcKP5F4sAmoO9/5511Me3++3T6hK10KhlOCDA==","signatures":[{"sig":"MEUCIELkJy9y2fOwuA04QZbKsP7Jy2QUZJrJaEAzJV4XtdD7AiEArTY9wNItqO74NaSdwjQ8qPCLDrKskd4kOPKhnr1HYpA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":725958,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfKi1rCRA9TVsSAnZWagAAUtEP/jKVjNgrWAKzw1jSyx5W\no10lvcjIwTFmgYiX0qHEjfdLcfWEP3aVUK/TfvZfW9bchF4j4YKYjMCeC1j6\nq/BFSjZQi3JXLCdKQ08fslbRN3hXg8NO7ps45I+moWWnAmPbaXYPwyqLkW/E\nQdd+oUsWHE1GY55GrE9aGUra128BsO2qTYt9WmkKZmoVHc4yUI7N0u0r6h2G\npwSQxQBqF1AY7mVslEHryeupWkeevnXcXoNUV0gBGgs9Cfv8gFi3LAtOhZl6\nPQT4N8YH+OgLoxh7cPSCqNcTd/FUSbtJ7ZDeiihB5XJ+myMAlnRtW5wS9s6H\n2/dpNQt7HyVuqchWsGRN71pZjxTFx5M5jZnLSPIR0cKI/+bEaqWNX5Ypea2k\nE1/fYYRT3lLOEOiqCeyeJI7hnc7tl6KhO717+ylTEbtPpWu1BrdNOViKYIBQ\n6vRfobgSsHd/qKiaDfl1b1TkgdVmwNObhapVKV7UjJyJuOBAmgjMfPBBQLS6\nnqPqhDOuZeVsl0N4FdcSxyK1hWYe+SJs0Yk2FNl0Nf/zAmCmon3zAp7ovPAC\np0AfxgnliMomFfIacRpK5LNbpuh/F/tHA2nukVxoID/Zs7VcafYiM3sXdhrP\nSerqC9DJ9a2SRbApv6V/CtkvTbxBEU/ikrVb6NSr1qF5FU4PM/8jgc+Ft6+4\nn04V\r\n=2t1/\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is modeled after the browser's\n`<input type=\"range\">` element.\n\nSliders follow accessibility best practices per the [WAI-ARIA spec](https://www.w3.org/TR/wai-aria-practices/#slider)\nand are fully RTL-aware.\n\n## Contents\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\"\n       aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   `data-step` attribute on the root element. This will be the step size for\n    value quantization. If not set, the default is 1.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"20\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `tabindex=\"-1\"` attribute on the thumb(s)\n*   `aria-disabled=\"true\"` on the thumb(s)\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"-1\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\" aria-disabled=\"true\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the thumb element's `aria-valuemin`,\n`aria-valuemax`, and `aria-valuenow` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"75\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"c8b061f3fa8ffaf5214e79fe44f6c575216a1808","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.22.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.2bd09a706.0","@material/rtl":"8.0.0-canary.2bd09a706.0","@material/base":"8.0.0-canary.2bd09a706.0","@material/theme":"8.0.0-canary.2bd09a706.0","@material/ripple":"8.0.0-canary.2bd09a706.0","@material/animation":"8.0.0-canary.2bd09a706.0","@material/elevation":"8.0.0-canary.2bd09a706.0","@material/typography":"8.0.0-canary.2bd09a706.0","@material/feature-targeting":"8.0.0-canary.2bd09a706.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_8.0.0-canary.2bd09a706.0_1596599658857_0.9700726770116677","host":"s3://npm-registry-packages"}},"8.0.0-canary.e0560522f.0":{"name":"@material/slider","version":"8.0.0-canary.e0560522f.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@8.0.0-canary.e0560522f.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"9488072728f94f08cf9578898e103a0cb63f2834","tarball":"https://registry.npmjs.org/@material/slider/-/slider-8.0.0-canary.e0560522f.0.tgz","fileCount":38,"integrity":"sha512-+8aZEYhmmQjhnh9ewUyPzShMbSn5nEoUeq5HNhAAml2ptQ2CwshcmTm8Pc/UVKTM2j6ivdQVFZ9iVUR8XupINw==","signatures":[{"sig":"MEUCIDfpM4SvTptGT2w2klquTo4rdh1RiMCEvptAUf28TFgvAiEAki63MHoD46CPaFP7qNEqlKwlgyLY5HbalMiW3a5xzSQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":725958,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfKupSCRA9TVsSAnZWagAAK3AQAKHOiCQ3ZdCR+ZSOibEO\n96bcASQ44Caf/vnMIbzQNRfRFF639n0zcPv4HLuGZYks/zLnM6xsc1N18nJG\n6RN/Nh0ECUhFlU23RiREwlP6wewJdYA8O+U2UaoxLyhWMV/E7aFeeZNizaod\nDsBnsQresc02AnZIoFedeXk8e/H97QBPjscLnV5SNRX2/iv2nwO+2JSr1tWC\nrnDH28+MXghxc0/dTIXGVfffb4TyHFggaZz2l5xkg+64hPRreW/8BsR8rI6I\n5Um+/AV2zNLcDd77OJyKK8EG9nwYopIquROOnjFLiDdbyAWxOgdFPjoZopuP\n9l9pjNix/n1USI68Q1ShSoINSP1HcDwHiuVtcNNto6I6REwlWXpPXSYf0Nwc\nxFRNHrkN7jIEeLvoz5NluSR5yT1KP09R9Fe5EY47jin+eUF0wHvNVgp9gkli\nYv8s0O1n3PlbR0d2rODuSbab3aQZcqEG3q7mPbRlQmtFwQtuBvBnvysegwHq\nIS9fS45l9iYD+29NDXrh9U5X8f8jyo8XlwvwCxboXUqwLW9ZlIJDE8cthYL2\n9Wf6vlTvMilPANqtBBRsgt5Jzrr72QnYRumpjMPF7EO1F8WLX3bJ/08QO7ST\ns8Q6+WM67bpZCQfLxyENY73ucs/WXeKBTobjAKrMj78rDjKV2nSWLniiGnCx\nZVEN\r\n=Kb7e\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is modeled after the browser's\n`<input type=\"range\">` element.\n\nSliders follow accessibility best practices per the [WAI-ARIA spec](https://www.w3.org/TR/wai-aria-practices/#slider)\nand are fully RTL-aware.\n\n## Contents\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\"\n       aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   `data-step` attribute on the root element. This will be the step size for\n    value quantization. If not set, the default is 1.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"20\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `tabindex=\"-1\"` attribute on the thumb(s)\n*   `aria-disabled=\"true\"` on the thumb(s)\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"-1\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\" aria-disabled=\"true\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the thumb element's `aria-valuemin`,\n`aria-valuemax`, and `aria-valuenow` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"75\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"f4f71f168da3435c5dd1bb74e7ae0c54fcc45746","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.22.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.e0560522f.0","@material/rtl":"8.0.0-canary.e0560522f.0","@material/base":"8.0.0-canary.e0560522f.0","@material/theme":"8.0.0-canary.e0560522f.0","@material/ripple":"8.0.0-canary.e0560522f.0","@material/animation":"8.0.0-canary.e0560522f.0","@material/elevation":"8.0.0-canary.e0560522f.0","@material/typography":"8.0.0-canary.e0560522f.0","@material/feature-targeting":"8.0.0-canary.e0560522f.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_8.0.0-canary.e0560522f.0_1596648017901_0.6033891604544239","host":"s3://npm-registry-packages"}},"8.0.0-canary.08ca4d0ec.0":{"name":"@material/slider","version":"8.0.0-canary.08ca4d0ec.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@8.0.0-canary.08ca4d0ec.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"d45bff5f7e19152ca64d417e1f23d97d64a2b89f","tarball":"https://registry.npmjs.org/@material/slider/-/slider-8.0.0-canary.08ca4d0ec.0.tgz","fileCount":38,"integrity":"sha512-PMbLhECgFkFALIL3J8/dhPOehAxVfk9pl+sr7lncac4zNYEfmgDNc/xcDZ8RQxjSLKUX3hBj3xAhE2kStSOpsQ==","signatures":[{"sig":"MEUCIG5etl1YQMXcKO98s34zT2rMpiqafOrzM/vTEybX4fxTAiEAwxntAOxJGN8dQW0hdVQTanh6BM3r559HfYOMRNMQ/24=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":735225,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfKu7fCRA9TVsSAnZWagAAiPEP/0UYHc7Zboz3HpOSDRzE\ny9z4r/ZcsvLDVcPW8M9EOi+pK4WP7FqBmDAulkb9qM8GMelrG8aA0FrXf3Ud\nMcnID6fMBdWxysiZTxIcMtbbylw8aXSrca/auvZ2RR+y6Tr9kxVijGsF4Coh\ne3fBuwr2oiygSWoO3K0yBVb3ZPiaGhPx4Jio8TAICjC+J+xsSMsweJc8vDV7\nmRAUgRoE0SzqeK0As95HgBkboDdiL9IpafRRAZPgNrbQ1uWnyOXJAQF+aWA0\nmH5CyxxkgrN90p1y6qtD6ltxZg05hdjOKfcKRmUzNCMy9GKOSLLBxvdMbWwh\n5qd7ctzDK8q2g6deAqJ+5xIwBJFqTVvJF7ygU//SAsgY2jyoBFQo3cR1S0jE\nZVMn7QILDPNPpFGiv8pkcENEz4nHyZFd5c8z6VQrsCx0Mh2V2I5wylESuYrM\nCYVtkIArI3ksAosXepqvtnj4QfrPT3RVgS7Tj0tWz6C6o3hE/suj6xov2eOc\nEHvIp6IGrWvp9y5MX4pdJ9YOxdYL+c3zvYJWfP6IK8p0w5fap9my4A2p4JTD\nUQWdmWHtlcdJuQm98h34L0Yv7UrhoHPgbqN2nJIqzZ72n1FC/4upkJaZi3KX\n+uE7Nu9z0GwLJSpvTXSLQxawWPPGEYnS44jr4OPZwbEB4pOrLpoMKwijk6sJ\nelRD\r\n=AyGk\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is modeled after the browser's\n`<input type=\"range\">` element.\n\nSliders follow accessibility best practices per the [WAI-ARIA spec](https://www.w3.org/TR/wai-aria-practices/#slider)\nand are fully RTL-aware.\n\n## Contents\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\"\n       aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   `data-step` attribute on the root element. This will be the step size for\n    value quantization. If not set, the default is 1.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"20\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `tabindex=\"-1\"` attribute on the thumb(s)\n*   `aria-disabled=\"true\"` on the thumb(s)\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"-1\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\" aria-disabled=\"true\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the thumb element's `aria-valuemin`,\n`aria-valuemax`, and `aria-valuenow` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"75\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"e525a44ae67401224e06885b43f10017ae70f9af","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.22.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.08ca4d0ec.0","@material/rtl":"8.0.0-canary.08ca4d0ec.0","@material/base":"8.0.0-canary.08ca4d0ec.0","@material/theme":"8.0.0-canary.08ca4d0ec.0","@material/ripple":"8.0.0-canary.08ca4d0ec.0","@material/animation":"8.0.0-canary.08ca4d0ec.0","@material/elevation":"8.0.0-canary.08ca4d0ec.0","@material/typography":"8.0.0-canary.08ca4d0ec.0","@material/feature-targeting":"8.0.0-canary.08ca4d0ec.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_8.0.0-canary.08ca4d0ec.0_1596649183114_0.8005589873178334","host":"s3://npm-registry-packages"}},"8.0.0-canary.08090126b.0":{"name":"@material/slider","version":"8.0.0-canary.08090126b.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@8.0.0-canary.08090126b.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"4e042b2602aa33920134d204619d710196849bc8","tarball":"https://registry.npmjs.org/@material/slider/-/slider-8.0.0-canary.08090126b.0.tgz","fileCount":38,"integrity":"sha512-WjK/+jwaXcsVJ+JrwZ/6wqyDBzWOriH/ZEbs6d3GEKO4tboxI9X74jC+9iALNpRilYs8Wp34CoQqKVyR+ce2Vg==","signatures":[{"sig":"MEQCIHCgUEN4s8wsLFZOgQF+l1YWypD/a1M2buvtcXVjYduEAiBlhHB9G8grKh7xFmg2aALCt3eyBq+siF7yvMZAgn0hbw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":735225,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfLFroCRA9TVsSAnZWagAAdAAQAJdRMphlXb6es2W+7jiR\nJwg58VMnV4/tA8wZnAIB3V6gOZRYnXFVlDzXO+nDTFvocb+FvibH0uxZI8PO\nffvymiIkQKcjnDvCPzjOCxgRkp83HWTICu9FNn9rrPL6hH5ycAb0BukF7j4y\nZscl0D0jOrwcoB+I5/Lm2QspiI3kLfHlJ2E3p5OlkuYeO/GVa4iGGauSl11f\n5ACC0dez+z1tFVkamMsB4TRhLfQ9goazBjX9cCdCeAkZCWlJ9dFPJGrPhN3c\n6JrFVwk/L1pA4gtI9S9K+tT8zVFItyghLRv3Gpgo6Nf1pgQdfVWNQTOlNfmH\nAeX7GazMOwZH2NyeWwdCTjX+hxemXhVztBuZSUweg34Aq4QaEv0EANvdt/3/\nI9P5fGojtP6ZnRFRTUs4tYz9JrMykpkeq6QS9digWW9kF7Ztl04+Z2KCXrA3\nlyFwf3C+fVkVRSdCuEodqvQLaMJKNyrq9aJjHAlzLmmhv2pSX9glHl+K+KFh\n1YlEY6dxyLSH8fCfkpbu8eSwgU9/rnCdlC45pCewZ1d6COuMUBJYm1WdfiuR\noy/hJszAt8uYfro98nikF8M8XiZP7/ycCQvGDpKDF+w1slTRd6MQCw3eAGzg\nh95GK6WJ9GzmXycmQh69DdzRMIH059ht4i/SMZAV0sSSSkkmoz0rTTkbjRge\nVl0b\r\n=3eXR\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is modeled after the browser's\n`<input type=\"range\">` element.\n\nSliders follow accessibility best practices per the [WAI-ARIA spec](https://www.w3.org/TR/wai-aria-practices/#slider)\nand are fully RTL-aware.\n\n## Contents\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\"\n       aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   `data-step` attribute on the root element. This will be the step size for\n    value quantization. If not set, the default is 1.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"20\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `tabindex=\"-1\"` attribute on the thumb(s)\n*   `aria-disabled=\"true\"` on the thumb(s)\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"-1\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\" aria-disabled=\"true\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the thumb element's `aria-valuemin`,\n`aria-valuemax`, and `aria-valuenow` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"75\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"92703c0a9dad96887725176e28a4ac83640a3b34","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.22.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.08090126b.0","@material/rtl":"8.0.0-canary.08090126b.0","@material/base":"8.0.0-canary.08090126b.0","@material/theme":"8.0.0-canary.08090126b.0","@material/ripple":"8.0.0-canary.08090126b.0","@material/animation":"8.0.0-canary.08090126b.0","@material/elevation":"8.0.0-canary.08090126b.0","@material/typography":"8.0.0-canary.08090126b.0","@material/feature-targeting":"8.0.0-canary.08090126b.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_8.0.0-canary.08090126b.0_1596742376469_0.06893051337776757","host":"s3://npm-registry-packages"}},"8.0.0-canary.e8bf5b2ac.0":{"name":"@material/slider","version":"8.0.0-canary.e8bf5b2ac.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@8.0.0-canary.e8bf5b2ac.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"265c59d8c954c85e81ee512af91ffe5db43cce82","tarball":"https://registry.npmjs.org/@material/slider/-/slider-8.0.0-canary.e8bf5b2ac.0.tgz","fileCount":38,"integrity":"sha512-XQD4tk7HVZ3XnwMw2LT5jSn8sYlS/OiOkrTZfa4GkB/BQRe0w/Ym4CFZeKI0xMuRSXBMi8aOawBtgiy6qAhXRQ==","signatures":[{"sig":"MEQCIC03EyZda8zSyjBfZzJg7E1Pj80ea11Biod2B2ml5I2QAiAArepVi+J3sLg8iJGY8gk9pCepYKkBMpurUWQDKQWnLQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":735225,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfLHsaCRA9TVsSAnZWagAA6GoP/jcaPA367eO02jotjfzJ\nYOQfcj8LO3zozzE+f4Zl/u02bCoxv2AK7/Bm3KLColmyHAMgwPlg6FaIVhQo\naM8caAXxtaxpdViBW1jOQpVn43Qqmo3n3BMvUpQdAkbil7BcxSs2P1k51H9O\nChwg2JCmF4kk3Tcha56mRuNQnJLBVdbp8tM6+yVLiFgMdPlsvpARju9XPfcY\nDWPoEEMDTCF1qwxSCQPsubVEH1RGmpqvoXI2UtqpJiDFqn3TUYXCJdfR0OcC\nu4HDg3EG2FP46nz81s18zw8BMT7o2dwBE1Y8RSazz9ZeXbRvBIzGUw/r5y49\nD9S504MoBU8wcdoOQMAlyEiOUlSUGDj9ms5yeeqgr8dQljItvSqkK7uft341\nc+CKYxeWnlkzkKZqIkwIE+NTo1UxSgCrBECgHw9S8l81MUXBkeDCuy4PrQWj\ntmMwJPFynfovouvNmTaFGpKI5Fn+5PkNw0VSfgk28g74F9YG4ySDyOVCeD45\nHcsYz9E8NKRzNgY8VJmHs064174LRKSW9KotIMiD1+ROBVqahyar9VSlN9wi\nPUJpBm59f0r/Dzhq8El6w33QdR7G8FHS0e7e9t41qYU5TtYHz0Jp0aA9TeeS\nHU6L2vnT5QFbZr0Tnx/Rm3cD2ugR9Ui1bEcQgWDrww5NgW2yWXfMqZJ2txc2\nmIr7\r\n=o5ag\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is modeled after the browser's\n`<input type=\"range\">` element.\n\nSliders follow accessibility best practices per the [WAI-ARIA spec](https://www.w3.org/TR/wai-aria-practices/#slider)\nand are fully RTL-aware.\n\n## Contents\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\"\n       aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   `data-step` attribute on the root element. This will be the step size for\n    value quantization. If not set, the default is 1.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"20\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `tabindex=\"-1\"` attribute on the thumb(s)\n*   `aria-disabled=\"true\"` on the thumb(s)\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"-1\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\" aria-disabled=\"true\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the thumb element's `aria-valuemin`,\n`aria-valuemax`, and `aria-valuenow` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"75\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"d5fe47cd91dcff7cada8ca9b587eb8a924a211d3","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.22.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.e8bf5b2ac.0","@material/rtl":"8.0.0-canary.e8bf5b2ac.0","@material/base":"8.0.0-canary.e8bf5b2ac.0","@material/theme":"8.0.0-canary.e8bf5b2ac.0","@material/ripple":"8.0.0-canary.e8bf5b2ac.0","@material/animation":"8.0.0-canary.e8bf5b2ac.0","@material/elevation":"8.0.0-canary.e8bf5b2ac.0","@material/typography":"8.0.0-canary.e8bf5b2ac.0","@material/feature-targeting":"8.0.0-canary.e8bf5b2ac.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_8.0.0-canary.e8bf5b2ac.0_1596750618204_0.04868353898637512","host":"s3://npm-registry-packages"}},"8.0.0-canary.e3b746208.0":{"name":"@material/slider","version":"8.0.0-canary.e3b746208.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@8.0.0-canary.e3b746208.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"7afb0811903fecf55a70a66169941c535642a2f0","tarball":"https://registry.npmjs.org/@material/slider/-/slider-8.0.0-canary.e3b746208.0.tgz","fileCount":38,"integrity":"sha512-IDthpDZ3rEBB20mf+FLzjZX5j+TvRDs7m3Lxa4sQPZMh2sjraenPU2YdirWgr4692dAo389SQ4fxYeW90KsoJg==","signatures":[{"sig":"MEUCIBcc7XluDFLi2G7QioaIZp63z7Je/44kI1hBPjOD5GB2AiEA/nO041FV05a72D6IBTUbpymsRgOXJxC5LvcZNIgMq4E=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":735225,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfLIO4CRA9TVsSAnZWagAArH0P/3vP3j5sUazpGku21nad\nzvW2lgQp5onr1nAKSDkYAzmgXVFXgw8w2K7jhGUMEoZukb0dM3tuJUknd+xE\nfngSY671WW5/7MdqezNg0QV/0LMcsOZZ1QUHlWaBHgbDwTMOPDNess+gzxW7\n/NCXp/c17TbCbzwSV/Nl1TKw5G3uSFQc2vSCoXdhN7NxuWwudhEuWliHTbEa\nLAtzfOFZau59gdMCm053r8ezvjwL+I4SrHtM2NNgRx9BHlCS1Pz+2hOQOq/D\n0uuXWyGd3B2ga2bXGRZ6YGezxe0nECe2ToxLGRcvtNp7RTDg2i47rhcE4Bv4\n4ixp6cg4U93Qp6JwKis8R9WVpLzVDRj12tMv5nNJPdPs0S3rABnJd3YJ5d4F\nk2RuXOFqsF0urPmMXSSE0qlkmuV9nBcbUaLXVNnPpLSTczzuWVU9q+diBBzL\n6tA9RelJz0L/ZgYDgYcLYEZsD+UE2oCRU/TfriMr9InHb6zi48Cvp8LWM1gn\ny7KEjj0sU08ZIjSRA1hfcPNcDz4ICypQ4/G2pA7s4Z1UfidzO4cDUpOAp3mJ\nta3K/yfXxgVQkob49w+A3BvGLzNYU/9WCd0Q7gbVWZLBB8betP/YYOyDBHTv\nhVJzgc6UhdQDCDo5K7Gg2u0SARIUgzxvABSyM6JNgFB7/lZD3UsrXw2DsJ/h\noWl9\r\n=MQOB\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is modeled after the browser's\n`<input type=\"range\">` element.\n\nSliders follow accessibility best practices per the [WAI-ARIA spec](https://www.w3.org/TR/wai-aria-practices/#slider)\nand are fully RTL-aware.\n\n## Contents\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\"\n       aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   `data-step` attribute on the root element. This will be the step size for\n    value quantization. If not set, the default is 1.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"20\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `tabindex=\"-1\"` attribute on the thumb(s)\n*   `aria-disabled=\"true\"` on the thumb(s)\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"-1\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\" aria-disabled=\"true\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the thumb element's `aria-valuemin`,\n`aria-valuemax`, and `aria-valuenow` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"75\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"565f03445fdfa2cc653bce8f5c730176a406e5d5","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.22.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.e3b746208.0","@material/rtl":"8.0.0-canary.e3b746208.0","@material/base":"8.0.0-canary.e3b746208.0","@material/theme":"8.0.0-canary.e3b746208.0","@material/ripple":"8.0.0-canary.e3b746208.0","@material/animation":"8.0.0-canary.e3b746208.0","@material/elevation":"8.0.0-canary.e3b746208.0","@material/typography":"8.0.0-canary.e3b746208.0","@material/feature-targeting":"8.0.0-canary.e3b746208.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_8.0.0-canary.e3b746208.0_1596752824276_0.6477306541399415","host":"s3://npm-registry-packages"}},"8.0.0-canary.96a640534.0":{"name":"@material/slider","version":"8.0.0-canary.96a640534.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@8.0.0-canary.96a640534.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"90420c00a389cb2eab0185eb00cf731ada8d472e","tarball":"https://registry.npmjs.org/@material/slider/-/slider-8.0.0-canary.96a640534.0.tgz","fileCount":38,"integrity":"sha512-qFYNJNEd6rW3RqAORI6dBkEhASa4gkEnSKu4rdZtkCAIpg7X1KLvnDbLbtA5OSqfCiAOhlOztvXu7g/MEnoN5A==","signatures":[{"sig":"MEYCIQCRtx8oLaWKwMFA+6aUtLy5ZSXrFz2xVubewp9vgPpU6AIhAM6wt9LuBn41u9ZKgqlMbLuZxD6LUIx3mJAx17UI7HSS","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":717293,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfLIcsCRA9TVsSAnZWagAAU6MP/RuxlJzRIHpCp2hZX5L+\nnp2zP2PALx9PrPfU1thaQOQ2l/5z3U8eNDl0hgU5r8LjFWvhCjBjX0CsF7cV\nMFBgCD1imCZ8SzRwVu/CbYs5bwVMrmsKit/0WqeRG6hkbDyIUq+rqDyyiyBX\nQVzplMSMGOfXg8gnfrZPQX0krg+Ungj19l8eEGnWIknbbQVm4eqzDo3WXYpl\nLuG+XJIfJ/CtIjvhEw/47hY8k6IrzMNx3pf42F5yMdfKwKINHtRvClEAdvXT\noJmChrHjco5aSD/BaVZqDF406V7xzIXc0PNzw4FDRP5Z1owKTxagKR+YOY5r\ngo0eZBB2LcsNkBjjh4PHBb79GNF+cSix6z/+ydndLnOcohi2vv9ias7rz5Eg\nORwuaWzQ+HuSg++ycRhqb7hkD7+ONRVKCJooDMx4s8zzxha1GulWQSnIx0rn\naJ8SSrHpwY3LiXE21AVcyGrU3AZsOoRhCzPQRKXwaPaxHhFUVGcS0TVa7gkw\n4x77kjIdy+BOEvPnjWdg9RVXBiaewEurKWEqe1VxMnKaCYFBO091TxRvunIN\nDu7WWkwhKpII4j8IuvSzZxciDdAH+14CN/LdwPHHalOBhOZ1ixTY/nQ8cYLu\nn3WSz1Nty+IcFcd+6pRevJanyY8mxxXyzJCxD+rpMiIqP00ArpnHU3Ht5GWp\nd+cN\r\n=vCC7\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is modeled after the browser's\n`<input type=\"range\">` element.\n\nSliders follow accessibility best practices per the [WAI-ARIA spec](https://www.w3.org/TR/wai-aria-practices/#slider)\nand are fully RTL-aware.\n\n## Contents\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\"\n       aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   `data-step` attribute on the root element. This will be the step size for\n    value quantization. If not set, the default is 1.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"20\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `tabindex=\"-1\"` attribute on the thumb(s)\n*   `aria-disabled=\"true\"` on the thumb(s)\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"-1\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\" aria-disabled=\"true\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the thumb element's `aria-valuemin`,\n`aria-valuemax`, and `aria-valuenow` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"75\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"3363a6ead1437d646dec8eb21cb2d5c5323e8986","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.22.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.96a640534.0","@material/rtl":"8.0.0-canary.96a640534.0","@material/base":"8.0.0-canary.96a640534.0","@material/theme":"8.0.0-canary.96a640534.0","@material/ripple":"8.0.0-canary.96a640534.0","@material/animation":"8.0.0-canary.96a640534.0","@material/elevation":"8.0.0-canary.96a640534.0","@material/typography":"8.0.0-canary.96a640534.0","@material/feature-targeting":"8.0.0-canary.96a640534.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_8.0.0-canary.96a640534.0_1596753707602_0.342225154222366","host":"s3://npm-registry-packages"}},"8.0.0-canary.9f9aac825.0":{"name":"@material/slider","version":"8.0.0-canary.9f9aac825.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@8.0.0-canary.9f9aac825.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"cc99d40b87ea68c68b3a88232524b7ecee175678","tarball":"https://registry.npmjs.org/@material/slider/-/slider-8.0.0-canary.9f9aac825.0.tgz","fileCount":38,"integrity":"sha512-oG04KkC0sooleZZlk3TMOSIPZ8/h64jDHp2mcRrTY7oZ+TCVC1bAmuYDgwWgRWyLohtk904gh4oYeWEXcU/zNg==","signatures":[{"sig":"MEUCIQDop2SuFY0StN/lh24e2M4K13ImcsSsMm6750jUqZQPYQIgeuhSuETBRxx9cQAYB1PsTUzsYNAwT1L2YWG+vtPNqYE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":717293,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfLb7cCRA9TVsSAnZWagAAUWwP/AvTHjxCd44WHYTG9kzb\nXNJhsCN/GX0wu3zvt8pJL96lezmUfnuJq4zi7BlnvX8G6+xuc6GbOCR8bx3m\nTRvNxiPmoj/NymswfXKY8kn+1PpikthnzH2mgsEqB8WDXsR1RSa3+ype0juJ\nQseuTO82C737+h1i/iSt9djqJjG4PtX6y9LJxDdz5KrHkrlfU8VZ86Wb5wkY\ntz/POjPrndmPJLF2E/mdECRl3RRgZ3eu6d12drROVQLJhWL05W1w+cmgAyz+\n2A8SG/RTt7b7FoKezIS+Ft64UEXKDNWBD5FPOqxwK/hL5PzVudLFNYHvIHGu\nPGHCu85bMKBy/FXCn6VDcRJv2DLDW10gqMC51vIsehA4rrJVQBhx8wa0XuxN\nqXg1PGWcjG3+fejBS5bJ2MNQGkcP1KTCVzzcih4LJh8RG+M/tjw5bNoHP7r6\nWJoJra27qfMHJc/Wp/MjuGkVDgCx3XHLlZMP/sSsr97VYMaEdDHdQEHDK0YC\nEqtROk4IwxpclXbfPKNvcypNfLQdrlghfLyFPlO/WkJdlmkRM6LaAebHDYT5\nQgKmflsq7p2nCiue6yc09jU4sQXNiuy47JSGD10cBhkL9Soqel+ZuyFToYLl\n2Su1nc4KCf9QzLkihNu3uvX9A5uqO4sAk8tyCE8sM4Cmio44MuHZbgrjSNkD\npzSK\r\n=Uqbk\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is modeled after the browser's\n`<input type=\"range\">` element.\n\nSliders follow accessibility best practices per the [WAI-ARIA spec](https://www.w3.org/TR/wai-aria-practices/#slider)\nand are fully RTL-aware.\n\n## Contents\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\"\n       aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   `data-step` attribute on the root element. This will be the step size for\n    value quantization. If not set, the default is 1.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"20\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `tabindex=\"-1\"` attribute on the thumb(s)\n*   `aria-disabled=\"true\"` on the thumb(s)\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"-1\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\" aria-disabled=\"true\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the thumb element's `aria-valuemin`,\n`aria-valuemax`, and `aria-valuenow` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"75\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"b417a722353dd60a63448761d24a06d325b83f7c","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.22.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.9f9aac825.0","@material/rtl":"8.0.0-canary.9f9aac825.0","@material/base":"8.0.0-canary.9f9aac825.0","@material/theme":"8.0.0-canary.9f9aac825.0","@material/ripple":"8.0.0-canary.9f9aac825.0","@material/animation":"8.0.0-canary.9f9aac825.0","@material/elevation":"8.0.0-canary.9f9aac825.0","@material/typography":"8.0.0-canary.9f9aac825.0","@material/feature-targeting":"8.0.0-canary.9f9aac825.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_8.0.0-canary.9f9aac825.0_1596833499893_0.7641493904380983","host":"s3://npm-registry-packages"}},"8.0.0-canary.fc65fd00b.0":{"name":"@material/slider","version":"8.0.0-canary.fc65fd00b.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@8.0.0-canary.fc65fd00b.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"bd9dfe8658ac699479b80ed94b1e3f048e3e73e5","tarball":"https://registry.npmjs.org/@material/slider/-/slider-8.0.0-canary.fc65fd00b.0.tgz","fileCount":38,"integrity":"sha512-FL4QCCv2p9+E4TKQ0UbN638A6hnOrW+3d1OfGQZOqMsvKzvuIGrluKM36lKNJ5jTNhi1bYOoz/7HGBKyX6A/Bw==","signatures":[{"sig":"MEQCIHUUqtEmZEYVGg6q+tG8DltBOaDjHpITlSMlJT95pn0bAiBOSxqJTrd4mI52iKTitZsN0xia2zXdHmWUOSK8NDzEYQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":717293,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfMWXKCRA9TVsSAnZWagAAfZcP/RasZl4au4CF9sLEoHQP\nXmaZQ27YQNELdtZGjhKtu8qhSKI2h/WUfeXE4a7cW5JAPjg+Z2j7z4D0N4pn\nSTPJLeNPETEk1AM4dTEyQoU7a7VNjHEXHa0jII5/lt8Wcqzi8I1Nmc54aA4D\nmYTLYJ2gOszS/ReNdrMtuWR6wWI/acxlOoNxgprHbmKMyLD4IpEOKxdLgnPw\nUKPB4qqtbGb8CqR9eB1++eLX1W5oAi2LgvrqufnCZaiTXoY27SZR1I1cF9B9\nTKmtqTaLhbj0Qpx9600yOgBLcmsT6DQP9sxXOifyEkwZJ589nSp9Zr8stcP6\nbS7hWi8UpX8ZexrgS+IQHVCiFC9a6zmQNp8ZiK04Nz2TnQj/uOJX8tgW1ucn\nFF8BIlXHSJ5JE0imTZWGU6j5NP1bHDu28cXnho+XgTruEQY/caBI2tcjRI3Z\nWPP2zVfELqySDz2ZFSPUvMetOTgR/SXzRZKHejdfbmk/hAn890nWD5B+UPhs\nVcx74ecNZ4+mxgQ+iT+zDbHwwCJeMhrCZhZyV6i/TX+6kQE9Iac6fNTAACth\n8rTCCFCAGy4iUSaG+1Ic4GvmXvdQhmcXqtxdDuBu1l13T6yqDNezmZVnp/k+\n2Ugz4JbgLv032MHLdsOFSP7dqMwzVUvNHQsJaZ+S3sN9d7O4bMeXw114PAWB\n0pcv\r\n=pk5Z\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is modeled after the browser's\n`<input type=\"range\">` element.\n\nSliders follow accessibility best practices per the [WAI-ARIA spec](https://www.w3.org/TR/wai-aria-practices/#slider)\nand are fully RTL-aware.\n\n## Contents\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\"\n       aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   `data-step` attribute on the root element. This will be the step size for\n    value quantization. If not set, the default is 1.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"20\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `tabindex=\"-1\"` attribute on the thumb(s)\n*   `aria-disabled=\"true\"` on the thumb(s)\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"-1\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\" aria-disabled=\"true\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the thumb element's `aria-valuemin`,\n`aria-valuemax`, and `aria-valuenow` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"75\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"fa39d9d1e753796086537bc71b6fa2d2aa21a3c5","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.22.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.fc65fd00b.0","@material/rtl":"8.0.0-canary.fc65fd00b.0","@material/base":"8.0.0-canary.fc65fd00b.0","@material/theme":"8.0.0-canary.fc65fd00b.0","@material/ripple":"8.0.0-canary.fc65fd00b.0","@material/animation":"8.0.0-canary.fc65fd00b.0","@material/elevation":"8.0.0-canary.fc65fd00b.0","@material/typography":"8.0.0-canary.fc65fd00b.0","@material/feature-targeting":"8.0.0-canary.fc65fd00b.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_8.0.0-canary.fc65fd00b.0_1597072842100_0.21207672903360497","host":"s3://npm-registry-packages"}},"8.0.0-canary.02e372c5f.0":{"name":"@material/slider","version":"8.0.0-canary.02e372c5f.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@8.0.0-canary.02e372c5f.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"8f649c22b587bf3fb3513dc04e9f44273f5ae979","tarball":"https://registry.npmjs.org/@material/slider/-/slider-8.0.0-canary.02e372c5f.0.tgz","fileCount":38,"integrity":"sha512-ztD7489js+Q5/Qems4XZITNGaCS8M+fDlk76VpdJyTs/CFX5/2HWsATOv6arydc90RdlUI7arK86MbjJSJ57hg==","signatures":[{"sig":"MEQCIGYf1WDD80ZVRmh3lVoDPNbkIRojlCCGs95/aDYq+ygTAiBnU3/DxRVQttF374hZ7Lp3pAUYT7Q8ydet5W/TFwkTjQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":717293,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfMWxnCRA9TVsSAnZWagAA0JoP/RFDbQiPS7RCjRhO8+kY\nV7YJcoK9lQu8YfDrm1mKks4cbjF/EXO3Pv0/isCUJqO4mJSTyOiKf/jGuiva\nJEV7croo7iCHfwR5n2tbOjeebz2COfD09dqQk+bLu/H9eYrCzpxatg2FAUxj\nwHEL93NvqRqYV//0FYsbF6wmJRRByqpxdAzo6TByphN6YsjUBf/2mEqh71ZK\nj0YZB3YMncQLIRwk/NXzZEoPj4pPskeQi3R4sHIGJi/VEX47dNGhKNcM8Mx6\n79UjAEkb0er+KhqV/VlETpV/V1F6ktSJxwamO901+de52OzCpX6KP4wHAalP\nIYld1457VoZHNEy6DBrZbYT1h4gcAYlLghP7GJHwv3dOP/u5/cR3sPdkk5wd\n45VRmAVTMb5fck88BbzUXTg1KjJSKLNNzGcFdGUtWMA4A8KfCp///XVIhxsm\n0vuLCBTOi2nEqpMi6VH52C+QxUDLoxHrRwod7mH48NFYm55GWnMMrwnRt4SH\n9nE1dJmj6KyX27OOkCfnbXAH6ZJ0NzjT01/KwqbrnBoiZs6Gniv8Yiw3xgNV\nwoG62NcNFA7nThr24p+YY4LmZG+s2AW9x6Hw4FeI/io6eRqXx7RWy8daZtOq\n+x8nCUjAZ35qsJWz04kSYphoHe8OI67oIsfFgJWDCwJT5RDT/rnqr0o4pSSv\nmBWk\r\n=JR++\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is modeled after the browser's\n`<input type=\"range\">` element.\n\nSliders follow accessibility best practices per the [WAI-ARIA spec](https://www.w3.org/TR/wai-aria-practices/#slider)\nand are fully RTL-aware.\n\n## Contents\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\"\n       aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   `data-step` attribute on the root element. This will be the step size for\n    value quantization. If not set, the default is 1.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"20\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `tabindex=\"-1\"` attribute on the thumb(s)\n*   `aria-disabled=\"true\"` on the thumb(s)\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"-1\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\" aria-disabled=\"true\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the thumb element's `aria-valuemin`,\n`aria-valuemax`, and `aria-valuenow` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"75\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"b765f8699fe12742bc2032a8df7cc23807ec94b9","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.22.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.02e372c5f.0","@material/rtl":"8.0.0-canary.02e372c5f.0","@material/base":"8.0.0-canary.02e372c5f.0","@material/theme":"8.0.0-canary.02e372c5f.0","@material/ripple":"8.0.0-canary.02e372c5f.0","@material/animation":"8.0.0-canary.02e372c5f.0","@material/elevation":"8.0.0-canary.02e372c5f.0","@material/typography":"8.0.0-canary.02e372c5f.0","@material/feature-targeting":"8.0.0-canary.02e372c5f.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_8.0.0-canary.02e372c5f.0_1597074535023_0.6087441438631225","host":"s3://npm-registry-packages"}},"8.0.0-canary.66669e3b6.0":{"name":"@material/slider","version":"8.0.0-canary.66669e3b6.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@8.0.0-canary.66669e3b6.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"b022cd1f66ac69236b07bdd660206b0198bada4b","tarball":"https://registry.npmjs.org/@material/slider/-/slider-8.0.0-canary.66669e3b6.0.tgz","fileCount":38,"integrity":"sha512-nKDURnin316wytXZN/ZUnrAdnKu3wEXPuPxH4bFNFIIiepRSK5ITcIVhrM4VWe9hS0g8NQHKOPYT2Ns9u3JRCg==","signatures":[{"sig":"MEYCIQDpekAgp+RPFPPIhA7obN9RnJQhFmmv8JW4Q8eD1yFIjgIhAO8ZkCs4VMu4sd196Ok9IKTm6zPILLVwcGny0oC5kcmu","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":717293,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfMW1WCRA9TVsSAnZWagAADs0QAIX0KYyN61i5HR36TLjx\nfyF6BvYHIeMnhuQYx9jBK6w4s4jRSiUTt/8Eh9NzTABtni4UbulvI9/23u94\n3GUr9mEppO8A6KbE+dm30eIPg6/KxRiAHUS8mmjX7pcJG3TWJioYB38n6A9O\nh+2qcakcfjYfp/uZcH7n3MkgcoJvhXIIXwsb9MlBUcWrqJ4UJGt1V/ez2qVU\nChG4pcJ/pOZVLOwmltobC5NEE/Dy3Njp23jljvni4LQ/9LXD/Rul7QArjEom\n59wna73pVp8NjiYecFbHTGqDtxpxHOYLVk4JDhEivvyIfDxyys8rFHH5oRdc\nDKTaCnOfOALKZQxxPsNfNbhI9iDKFq5/KNwOFA+9JJWCGfm5Mm4mQoZ3tL4T\n/5xOfSqYJrWNyCYnKk+AQs43nG5Y4VhsQ9Dlz7kE3rQNmaxab6mvWHK+HAtG\nfjaFZhErn6bnpNWrNaHIzk0pA/bRKAEVVBGNDaAK0+3NO4tUXvQ41h+cVDeq\n/boPFDgCgrQjC2xj/MdRWdDjabGrDhEdFD1lc/caf3o9xw5yfQB7TOcVuXau\nqI1pO9u/6au1lSpriWUI0i7B8PsKBpwQpwcjQ7mYi6DLfmBg7sWJC1qOgRP7\nryZwAHSRCQMaNxaXcUQoLNISXWVBkgSceNf0K8940OhLwjja8F6tiwDyMn99\nJvo1\r\n=xQx1\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is modeled after the browser's\n`<input type=\"range\">` element.\n\nSliders follow accessibility best practices per the [WAI-ARIA spec](https://www.w3.org/TR/wai-aria-practices/#slider)\nand are fully RTL-aware.\n\n## Contents\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\"\n       aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   `data-step` attribute on the root element. This will be the step size for\n    value quantization. If not set, the default is 1.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"20\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `tabindex=\"-1\"` attribute on the thumb(s)\n*   `aria-disabled=\"true\"` on the thumb(s)\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"-1\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\" aria-disabled=\"true\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the thumb element's `aria-valuemin`,\n`aria-valuemax`, and `aria-valuenow` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"75\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"96a6a7d492075777ad5f7692328b3bd50153bd16","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.22.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.66669e3b6.0","@material/rtl":"8.0.0-canary.66669e3b6.0","@material/base":"8.0.0-canary.66669e3b6.0","@material/theme":"8.0.0-canary.66669e3b6.0","@material/ripple":"8.0.0-canary.66669e3b6.0","@material/animation":"8.0.0-canary.66669e3b6.0","@material/elevation":"8.0.0-canary.66669e3b6.0","@material/typography":"8.0.0-canary.66669e3b6.0","@material/feature-targeting":"8.0.0-canary.66669e3b6.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_8.0.0-canary.66669e3b6.0_1597074774190_0.7895496190015254","host":"s3://npm-registry-packages"}},"8.0.0-canary.6d1ea9761.0":{"name":"@material/slider","version":"8.0.0-canary.6d1ea9761.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@8.0.0-canary.6d1ea9761.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"59a4fa7bc6a8a4d943cfefa929c58563cf3bd2a3","tarball":"https://registry.npmjs.org/@material/slider/-/slider-8.0.0-canary.6d1ea9761.0.tgz","fileCount":38,"integrity":"sha512-Eqqr4/OMcquJ3/oQ7vF8zrkkYd8jYSgq+cq1/4hwDfdVh79mNqpUqEOS0PBBABOcRN/tPGtdxgpWr/lLDMnJXQ==","signatures":[{"sig":"MEUCIQCMOHOyJ+TJiKf4K8B78uEWTTQ6t9NlnCEp7H71TCvoXAIgXUGDQV53/S8z9YFqxkZlv8fkNS3TXROT42ZoufsfyTk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":717295,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfMquuCRA9TVsSAnZWagAAR0UQAKOqkI/tsjXwME6kDR81\nAvbAOhgePsNTr1xBwcBGbpTistsA09L4Q7TeaNKhZp7krqZcS9sJFMQipB1Q\nNnQ9i/gRVG3Fz9Una+whB5Yk3geEbdnKAY12sH5KfAkyuxI4k+cbPbRZG+Ck\nEg4JT8LjXXrWSvFfzH/uY0s5oztEdQiSdefv/ufYWewupFR3jhbK3hFsYTnt\n3RwxyIuUS3PcGQZLpS0t7GSlQWzdzZBNWmy+kSmwDKLF1hWW1I3yDfgEkbin\nouWJYbwPma+3vNyWBnBXWeWhZ6xS2t+YfLsmSK2cX3c/yygJHsr77uErC8El\nPEqORVqubZe7HdjSwPzs28t/ey+ulDPWBjUiXFEQwaA1RyN9oGfvYvj8VVtP\n76hsq/EkxniN3BwU3oG/NZe0mtdhxxolVHV4N1FLl8kFWsMmfigKhwGnpEBN\n8au06NkSMUXIYYiXROBlTi2KKBHgadlXK157apbOV+pGHmsfA4PFdp9aJLov\nd7vhQLKW3idYRG5bmzsXncOS6li/A1m+5GHp0KmwsC2Oof54ubtPYJmrURdt\n73ElGmlnssCTOKWarBsl0I40iaMErS2jQh1X/kClX+OmGDncQnSlgBrmsCQ8\nOeof8yQgJJM8FiUjAFo1DPKqWxoUKT3PrFZCBMCzMVD9RbT4vxan4fSRFAqa\ny0CZ\r\n=3Rni\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is modeled after the browser's\n`<input type=\"range\">` element.\n\nSliders follow accessibility best practices per the [WAI-ARIA spec](https://www.w3.org/TR/wai-aria-practices/#slider)\nand are fully RTL-aware.\n\n## Contents\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\"\n       aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   `data-step` attribute on the root element. This will be the step size for\n    value quantization. If not set, the default is 1.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"20\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `tabindex=\"-1\"` attribute on the thumb(s)\n*   `aria-disabled=\"true\"` on the thumb(s)\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"-1\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\" aria-disabled=\"true\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the thumb element's `aria-valuemin`,\n`aria-valuemax`, and `aria-valuenow` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"75\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"2539ff1cdb03aaa0365880e59b2705e6f6ff4229","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.22.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.6d1ea9761.0","@material/rtl":"8.0.0-canary.6d1ea9761.0","@material/base":"8.0.0-canary.6d1ea9761.0","@material/theme":"8.0.0-canary.6d1ea9761.0","@material/ripple":"8.0.0-canary.6d1ea9761.0","@material/animation":"8.0.0-canary.6d1ea9761.0","@material/elevation":"8.0.0-canary.6d1ea9761.0","@material/typography":"8.0.0-canary.6d1ea9761.0","@material/feature-targeting":"8.0.0-canary.6d1ea9761.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_8.0.0-canary.6d1ea9761.0_1597156269934_0.1578701123541375","host":"s3://npm-registry-packages"}},"8.0.0-canary.79414bf9f.0":{"name":"@material/slider","version":"8.0.0-canary.79414bf9f.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@8.0.0-canary.79414bf9f.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"5e529e1592b2cda0b6fd62b803af59b02b232f93","tarball":"https://registry.npmjs.org/@material/slider/-/slider-8.0.0-canary.79414bf9f.0.tgz","fileCount":38,"integrity":"sha512-aFBIL+cf+FPi5doLPdvwujoNvbaZ5KomP/W7KS/C4CYKSdJiFGxhM3d0EPHRJdiuvd798yhUgZNxVu/UF3M4/Q==","signatures":[{"sig":"MEYCIQCI5aMlIcQXNGt8HzqrwCdMZpjcZfoUGC5kNpLtLilydwIhAKlKIpM4xHu9aIBl/oYVMPYjoP2m12ToHR3PcLgidC86","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":718927,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfMus1CRA9TVsSAnZWagAA41MP/A3orFispGRvq/QXyQbD\n3g5WLRG4qTbhRq9MyAPO+H5yiteMnCgmnbOGr3llD/+4HLexFDTboxlPeVDx\nniEnZS8CLJoFzjI9dO7DQKC0cAGOE1DDnqyxolH9vElcxJAFgdYBeVbDrRJU\n3CoNrQr+RWyzcKR00AuYvmGMN2pBNqUnfgYEtfKowcbdmAEjn2WcXA0MyFOH\nJHhGpAU1yZ8rIP32icm/q88LOjjytUdd9YeYx969Y9kRn39+oHiSbw9zrmwC\n6/InqOuCkePm9t1BDQPTcDoNHEW4m79iRXcx2fY5YjEQVb5NCnIXqm0hWhV4\nSCGnbqlRIKZagC9wPG5xPFOyTSm5n1vzWx1oUzLu2QjZ9uLtnq/H0AoJ30xY\nUzd1FzyACEqMDrkfyzMP3znqSBxXLmEEw0LV3j747cyT60jk7b8irHuA96Di\n16FMIZX224PKedWGgpytlQy2NqxdYrElmSB95Opi1D3QK62hFjbQdCVzBtXp\nmiF/SZKsbd/0Byfdn30HIFuvgZov+2yoxR+3SJt4TV6sccUqKebuZHxvFeNG\nTcQHEQcNoWntiDmMXoYFi6AuXjQoh6s3nfH8vvT49nfOVzpQW9/EfNzb1on1\n2XqT7ePjyVe15twoK8niSai1rsQLGz+wJzEDU4c3bDWWXe8i9uOoGdkWfiz2\nwqPw\r\n=JE+o\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is modeled after the browser's\n`<input type=\"range\">` element.\n\nSliders follow accessibility best practices per the [WAI-ARIA spec](https://www.w3.org/TR/wai-aria-practices/#slider)\nand are fully RTL-aware.\n\n## Contents\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\"\n       aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   `data-step` attribute on the root element. This will be the step size for\n    value quantization. If not set, the default is 1.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"20\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `tabindex=\"-1\"` attribute on the thumb(s)\n*   `aria-disabled=\"true\"` on the thumb(s)\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"-1\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\" aria-disabled=\"true\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the thumb element's `aria-valuemin`,\n`aria-valuemax`, and `aria-valuenow` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"75\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"3101c6ef84c1ef8d9afdb44b6b6b3067c2f5723c","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.22.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.79414bf9f.0","@material/rtl":"8.0.0-canary.79414bf9f.0","@material/base":"8.0.0-canary.79414bf9f.0","@material/theme":"8.0.0-canary.79414bf9f.0","@material/ripple":"8.0.0-canary.79414bf9f.0","@material/animation":"8.0.0-canary.79414bf9f.0","@material/elevation":"8.0.0-canary.79414bf9f.0","@material/typography":"8.0.0-canary.79414bf9f.0","@material/feature-targeting":"8.0.0-canary.79414bf9f.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_8.0.0-canary.79414bf9f.0_1597172532857_0.5580908187381193","host":"s3://npm-registry-packages"}},"8.0.0-canary.85a5272df.0":{"name":"@material/slider","version":"8.0.0-canary.85a5272df.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@8.0.0-canary.85a5272df.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"0f0b536b420d376a099658f7c098e523bffc1744","tarball":"https://registry.npmjs.org/@material/slider/-/slider-8.0.0-canary.85a5272df.0.tgz","fileCount":38,"integrity":"sha512-Nkjazet0F7ssllYykNBk3yWGnWpX/tgtd7AxNUlVZ/Py/ac1RWRPin1p5Zyz7AHZyExBS34VljTyIEy7DGH+FQ==","signatures":[{"sig":"MEYCIQCLCfgPfjC7682/yKf/4kj3KrON2KsyHZasqJl3PiQekwIhALAS42mIJW09z12zoF621PJTk2ikMpL8hExxu1oJdvKW","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":719597,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfMvq/CRA9TVsSAnZWagAAIxUP+QA9lQsDGgf5P+PdwA+R\nyz2rXTlxOjK7PIU1NZ7B2lra4gEHFwyb3STKvmSqAuYSrUY0VjqisMS532R0\nIJJDWhD1Ie+OsBwHS+gAN2uOwRZlujt4XphGY+tDBNB3jv05z7pC/VP3h/UQ\nmVVsZNeQxRQK9q00uP/1EKhe3Mp786gNVGyxMdiBFGHsOtdhwqZQngx6lgT4\nRuIn6IMOoAj6TEc468UClfLhj1YjQdrbRuyPq/k9ASzgd7cCr9p0ZlZbbIYN\n4zZ4M7NmhRhD093pdY7RFonuieXbm6ELcP7VI3YGjsDlGV56tXZ0stkl/50t\nEsrOf2EqXva5Yh+twElwu55i/+iQkuu8LbA5f3siKKSwXFlhKK/21Nl5DWnz\nFiYNfa6j899cOOYKoqid/9GsTsaWopbd4NOAuxeX2uB1vUFU4FT0Pcu1yIgf\nI6wPO26ZdO74BUj/BJtulrmsuPFPoFa1sH+bul/l1mo9L7s2XiymJ81O12U9\nDUe7NKqe5ySe5PQVN3MH6c+4l7HleCzNZPwwBAGr+AXCQ2dfDbO3QZC1dhy9\nRTdGmmT5cskAGBQJRsRYmG90xBUkL6/OG66QomOnYTnXJ3t7VihiCavS5XNo\n4T/cwtAFwTIYu5o7nEyo7Jp1KoUvRfOBjhryXp71E2fT/WfoA8SfxbCIWsKL\ntDet\r\n=kzqX\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is modeled after the browser's\n`<input type=\"range\">` element.\n\nSliders follow accessibility best practices per the [WAI-ARIA spec](https://www.w3.org/TR/wai-aria-practices/#slider)\nand are fully RTL-aware.\n\n## Contents\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\"\n       aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   `data-step` attribute on the root element. This will be the step size for\n    value quantization. If not set, the default is 1.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"20\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `tabindex=\"-1\"` attribute on the thumb(s)\n*   `aria-disabled=\"true\"` on the thumb(s)\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"-1\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\" aria-disabled=\"true\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the thumb element's `aria-valuemin`,\n`aria-valuemax`, and `aria-valuenow` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"75\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"070016d39c8d62feb1148d71182053d37bc35fc6","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.22.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.85a5272df.0","@material/rtl":"8.0.0-canary.85a5272df.0","@material/base":"8.0.0-canary.85a5272df.0","@material/theme":"8.0.0-canary.85a5272df.0","@material/ripple":"8.0.0-canary.85a5272df.0","@material/animation":"8.0.0-canary.85a5272df.0","@material/elevation":"8.0.0-canary.85a5272df.0","@material/typography":"8.0.0-canary.85a5272df.0","@material/feature-targeting":"8.0.0-canary.85a5272df.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_8.0.0-canary.85a5272df.0_1597176511155_0.8264676699786542","host":"s3://npm-registry-packages"}},"8.0.0-canary.fda053eb8.0":{"name":"@material/slider","version":"8.0.0-canary.fda053eb8.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@8.0.0-canary.fda053eb8.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"f39a47e3a926223c6761b4bce5832a99e679a925","tarball":"https://registry.npmjs.org/@material/slider/-/slider-8.0.0-canary.fda053eb8.0.tgz","fileCount":38,"integrity":"sha512-MPm+KkWdss8FNhHq5uVhZUQ7oFS+ZbrVS+QQ4Xe3Cjd+LzfKdHWa1KB1yPFRfg28bqEYLdXwky5v77x2wNOgjw==","signatures":[{"sig":"MEUCID+f9W+S+HFbTvzCOsiDlAvVAGDg/pPS6twsQVBLdg6VAiEA0THmJ76jmPGo3unAFlw5UBFKFQjVQUczHCx+aM7Eevo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":719597,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfNEtOCRA9TVsSAnZWagAAWRMQAI7l99O4lmeDcVpWNfgu\nvKdElsVD9jRgeU0bL6E/zDEHIAMmqdZDSTGnZ4WpIEOyljfikAeCAazHw9x2\n0a7H2GfkFGDzOXrNnCKkOivWcXqRARJHbpa5r2JpWDWHpdd3sxAaZMXWy4EG\nFpQKAKtAL+gP7S3Yr3EHVSr95fP0orJuD9pzu+8E4WFw3hn0VbJrg+NESqKt\nZcnva352Ozixfb0sFfrN+zTPR/pvroG3upWFPB/8uD9dXaV0VLKlTkqYJgzm\nvYrDAiimdkp/V+Tn9dHrt0wDaPcO6k97FCW3jlFfb26iGsS5gTDe+ZFy/iww\nWtiQ0BFLu/og1Rhmx//hMA91TfvZVA2veWoWf+MkWaBkIZAbg5/CPuVBT9VD\naE143D+80LQVPweQPTpjzFUJ16dL5J9d4pzvmkf4zdU+xSm5yQAxoLUQYbTK\nCflTwAfz9ar/Dzn+UwQRQkD0RFkVPjK2UAFmVtu2/DUYxu6WPeLKK/kX09ks\nXE0vKD2DOEBxH7V/MMMqU+90T5UgZrAFV5eD1342EyD0xJUMLWmbE4yrXn/2\nrEdnnx2tGcViBLGNCRWxScHvxJ2FKgDeJVpi3lvzRhA+BRTwYu/n+suJRb3p\n4unNKbCFRYSWinoCLOwiIdSdCKMLCMEXQWQ/9ahLfiXUvdZnV/M/mg5wMJie\nF2xW\r\n=cx7E\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is modeled after the browser's\n`<input type=\"range\">` element.\n\nSliders follow accessibility best practices per the [WAI-ARIA spec](https://www.w3.org/TR/wai-aria-practices/#slider)\nand are fully RTL-aware.\n\n## Contents\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\"\n       aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   `data-step` attribute on the root element. This will be the step size for\n    value quantization. If not set, the default is 1.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"20\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `tabindex=\"-1\"` attribute on the thumb(s)\n*   `aria-disabled=\"true\"` on the thumb(s)\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"-1\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\" aria-disabled=\"true\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the thumb element's `aria-valuemin`,\n`aria-valuemax`, and `aria-valuenow` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"75\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"b92b594784940e2fbd248c33d60198f7f2e0ff71","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.22.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.fda053eb8.0","@material/rtl":"8.0.0-canary.fda053eb8.0","@material/base":"8.0.0-canary.fda053eb8.0","@material/theme":"8.0.0-canary.fda053eb8.0","@material/ripple":"8.0.0-canary.fda053eb8.0","@material/animation":"8.0.0-canary.fda053eb8.0","@material/elevation":"8.0.0-canary.fda053eb8.0","@material/typography":"8.0.0-canary.fda053eb8.0","@material/feature-targeting":"8.0.0-canary.fda053eb8.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_8.0.0-canary.fda053eb8.0_1597262669716_0.40098267915521935","host":"s3://npm-registry-packages"}},"8.0.0-canary.760873445.0":{"name":"@material/slider","version":"8.0.0-canary.760873445.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@8.0.0-canary.760873445.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"4dd8a91b9ba791078435c73837595ac0bd606425","tarball":"https://registry.npmjs.org/@material/slider/-/slider-8.0.0-canary.760873445.0.tgz","fileCount":38,"integrity":"sha512-Bp3zZCpmjFAHsTCJcl7HvVE15mH72QuT4CGTyVblzBNdYHSWumB6wdAAonDgewzbxn6K/m2FxFskOjxlykq3Vw==","signatures":[{"sig":"MEYCIQDfGCTApcfM4jq9oQ7J2uaNEWih7CN5GfHcQ3sCmhY9mAIhANi0VWLm2S9gbyeI1nq7FhlYC64FihDIBHAta85On65M","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":719847,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfNGKGCRA9TVsSAnZWagAACuYQAJT/WYQ5es4in7T+W834\nSSY36y+oh0zeQ3LUsYQcOkXh40k4aw32plwANF4aa6Jz7rX0uWUpCqgKPo7N\ns558YKF9KSlvhIBXukQMaHPggOfcdc93+OFZbWqHw30oXq3SlFbVs1z4sPEa\n6Y0tBkjv9qannsjPi1OOlJTE63QancTOL7a343op4cGODeCyl3/XMqon8ZKo\nUA1Mep6UeO1eQWGECUXf8njYg2aTxNrZxK1JhBFpIY0V5A5P5LEa0WAbK9HJ\nEDsNrF79DUPa70CVJKVeIe9b3iYHycnup7s1N4R2QGow3sAjPQeL/tF3a3Pj\nz1Ipf8Ezrh96x7/7zm7y6/L+ACEVt+KVHJZYPWKNI+oKmHFNs/EZk1DIlGyn\nglaiJCriCy5LxHR/93kdBBbaTfXYSPBzuSS4B97C8RPdJN0CHZKw2luPmW4B\ntZBip8GgJt0FS7S0aM82t3zBJqDhHI0uNftt8eeVa2bXjdMo4+X/IInjopwm\nsD067LGQnDN+0j7+yVhnBTNwE5VBc3pJynJhboA0y44izxuBtKudwowIBwYg\ncAKCp3Nzq87RJzLAZMRELhWY8mWt8pS+lNHDlsy+i3wylG4F5jXYye6QksE7\nxql1jXKBBjmCXBmbNpegiUqQc0AVvsB0dxUe248zPQGsMmCz39rXhlqK63OR\njKFS\r\n=RS9e\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is modeled after the browser's\n`<input type=\"range\">` element.\n\nSliders follow accessibility best practices per the [WAI-ARIA spec](https://www.w3.org/TR/wai-aria-practices/#slider)\nand are fully RTL-aware.\n\n## Contents\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\"\n       aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   `data-step` attribute on the root element. This will be the step size for\n    value quantization. If not set, the default is 1.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"20\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `tabindex=\"-1\"` attribute on the thumb(s)\n*   `aria-disabled=\"true\"` on the thumb(s)\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"-1\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\" aria-disabled=\"true\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the thumb element's `aria-valuemin`,\n`aria-valuemax`, and `aria-valuenow` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"75\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"a830629b92051950e9e15bdd288ad87238b7103e","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.22.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.760873445.0","@material/rtl":"8.0.0-canary.760873445.0","@material/base":"8.0.0-canary.760873445.0","@material/theme":"8.0.0-canary.760873445.0","@material/ripple":"8.0.0-canary.760873445.0","@material/animation":"8.0.0-canary.760873445.0","@material/elevation":"8.0.0-canary.760873445.0","@material/typography":"8.0.0-canary.760873445.0","@material/feature-targeting":"8.0.0-canary.760873445.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_8.0.0-canary.760873445.0_1597268613833_0.7290615651851566","host":"s3://npm-registry-packages"}},"8.0.0-canary.2f4711a30.0":{"name":"@material/slider","version":"8.0.0-canary.2f4711a30.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@8.0.0-canary.2f4711a30.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"9131f697692597defb42f5bd7717235367fb5a03","tarball":"https://registry.npmjs.org/@material/slider/-/slider-8.0.0-canary.2f4711a30.0.tgz","fileCount":38,"integrity":"sha512-MxtyVExqpTrGJc+rq2EHZcOzQlvXcJhJikoJhtcGlXfReiXLIoqwKTHWhHLNs5xSF39r7gvjQ3sI3iOE688E4Q==","signatures":[{"sig":"MEYCIQDkPcj2Fwy4dIGINoUWimg29NSKjYmbS/pCCMhqP5eoWQIhAK2KyAAPKmH837On46Xc060XxsMnY9r1WUrpYPeavq8z","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":719847,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfNGTdCRA9TVsSAnZWagAAlHEQAKTTHAHETpoN2eC/PQKX\n67+rRAB+OgrdwqY3oIQkUsxPIbJRffbKZAm2FeThqSlany7ZNvbsItsrwQkY\nJxN6Sqy48cgbDCxnuliUYBgZdJjsSroZ/sozrknQYiO5ADQC79uvraTHyTUP\nDfVDilIoXxkmNPuuFcjGpemP2GSBlR3kBwjWIAxX2DsQYy5da/6RTqlsj4+w\nTdSBOoIghTfmYG9+WQG0DladSv0TKBG8XLsGiboTs5xtoTvdVZerVxT65Vf0\nZ0dP8yF2xZb4hWZ1nXYdjafTe0/OCwj7IbCHK3LNHUnEH3zgRq/3rsuZ7taa\nJqADg2raRSZBzhxr8PZ/r18jW+e6skUTTtIFxZKcZSqn3+h3b9ap1qm3RG3+\nlGW5FAb+KQImPWFvQZjuN7E9ADM4xfV5ve6iuSPOmBlP46+GUm2RbOCZ3dfY\nWDERDx51oxyMbHLd9wgUxrOvobY5ZOXhKwQhSF2EFLnNrzrSKFStZeueUqp8\nCYQR69wHPf+nX4nltCbuc9Go1vtXrrDc+WeFtC40NYXcDLER/hgNbQCfDbSf\nbi7KD5RVgHtNdYgHs8bSU6rKxkCgljsfrDBViAdddQ9M24AfLOA9KdfkZvOC\n1alnxR5X0VjK6iyWouykWREDVrppk+V2wwNQrZGafPArv1aU6Sq3jxPHsN/T\nbthm\r\n=by1S\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is modeled after the browser's\n`<input type=\"range\">` element.\n\nSliders follow accessibility best practices per the [WAI-ARIA spec](https://www.w3.org/TR/wai-aria-practices/#slider)\nand are fully RTL-aware.\n\n## Contents\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\"\n       aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   `data-step` attribute on the root element. This will be the step size for\n    value quantization. If not set, the default is 1.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"20\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `tabindex=\"-1\"` attribute on the thumb(s)\n*   `aria-disabled=\"true\"` on the thumb(s)\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"-1\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\" aria-disabled=\"true\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the thumb element's `aria-valuemin`,\n`aria-valuemax`, and `aria-valuenow` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"75\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"1347e5c15ba848f3525dcbd08fd0b11061e94116","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.22.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.2f4711a30.0","@material/rtl":"8.0.0-canary.2f4711a30.0","@material/base":"8.0.0-canary.2f4711a30.0","@material/theme":"8.0.0-canary.2f4711a30.0","@material/ripple":"8.0.0-canary.2f4711a30.0","@material/animation":"8.0.0-canary.2f4711a30.0","@material/elevation":"8.0.0-canary.2f4711a30.0","@material/typography":"8.0.0-canary.2f4711a30.0","@material/feature-targeting":"8.0.0-canary.2f4711a30.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_8.0.0-canary.2f4711a30.0_1597269212738_0.07353235633777477","host":"s3://npm-registry-packages"}},"8.0.0-canary.2d72f3659.0":{"name":"@material/slider","version":"8.0.0-canary.2d72f3659.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@8.0.0-canary.2d72f3659.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"be8e75f638a16b5bd90f3dd817ab9a236147534f","tarball":"https://registry.npmjs.org/@material/slider/-/slider-8.0.0-canary.2d72f3659.0.tgz","fileCount":38,"integrity":"sha512-Soq18501TZKrPSCGDa0TVvwr1KXRG/AQAFJOShaM2Ka3EWQ7qv0ySq0+QVDwF0cgtfRjWD/HZGq0XO6yRi7ulQ==","signatures":[{"sig":"MEUCICbGKSH28mOk4LN9zZeJ8H4pZDo8jGLHtZcK8RVIOSU8AiEA96KsWDSnsiAxg1qw02pg4aDDJPj3pr1veJciCETCbFM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":719847,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfNGaeCRA9TVsSAnZWagAAiwgQAIwpAyqP1vcz9MSqkvih\nnPAf1TbRtes4/H6fZUAHRZSCAcwiDpERxbNGZn49ACiDSy2Uu73MraEkaK8H\naEJGzqUc43v+5qYWqjz0psenenFfLRjkdZcgmyLdMiYO5kaUghzgqPoBqyJo\nbA+2tl0aygejctNxa65Rjt3nMTncjkMRdlQOYepYjG8OX6Ww+KLQozVfZkL2\nToiipU6/TDnBQODWdR3J0DQ6IySVvawb/MSd/G/NNTI0e/jepWQO3NifXgxq\n0dTjzXwKQKhIJOlbBE8avB8Ey+pMFXUndEP7FrNzDf/n7Dvpbgo5oOdsP3bL\nP9VILCLlU/k0PDl/5FvnlCs4qEgmlx5g4UezDC2f1xNi8iojkOysHdoG/uTj\nospqITjK0zFjzJxeab+IHY0sXBoTtejpxv1gYHyIKx1ekKm+YZYLukXRa6N1\nNemKW+wZrFTYgOrs0y8CvIbwpGvSZv6fgviaPgokCObSIpxr/yF3sogTZRab\naRuB5mUu6IG1kt+NNnvSm1PHUBEtVpAUHVNwrpBPSfUF6fSkl3OlN12tGSXF\nYaNwcXeiDLIRIsUtaJVAuwGYupm5lqt0lAnjjgvvE20BdZmkjg+S+aX1vpvK\noJyl7560SIvnRQhHOW+WBpIFz4nFBzDpjUZryvdMZZIAHZXaXpvks8+g/Ugt\n37wx\r\n=XBxL\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is modeled after the browser's\n`<input type=\"range\">` element.\n\nSliders follow accessibility best practices per the [WAI-ARIA spec](https://www.w3.org/TR/wai-aria-practices/#slider)\nand are fully RTL-aware.\n\n## Contents\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\"\n       aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   `data-step` attribute on the root element. This will be the step size for\n    value quantization. If not set, the default is 1.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"20\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `tabindex=\"-1\"` attribute on the thumb(s)\n*   `aria-disabled=\"true\"` on the thumb(s)\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"-1\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\" aria-disabled=\"true\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the thumb element's `aria-valuemin`,\n`aria-valuemax`, and `aria-valuenow` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"75\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"de40c24a4d850a3bd4269dcebba821d972e01c19","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.22.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.2d72f3659.0","@material/rtl":"8.0.0-canary.2d72f3659.0","@material/base":"8.0.0-canary.2d72f3659.0","@material/theme":"8.0.0-canary.2d72f3659.0","@material/ripple":"8.0.0-canary.2d72f3659.0","@material/animation":"8.0.0-canary.2d72f3659.0","@material/elevation":"8.0.0-canary.2d72f3659.0","@material/typography":"8.0.0-canary.2d72f3659.0","@material/feature-targeting":"8.0.0-canary.2d72f3659.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_8.0.0-canary.2d72f3659.0_1597269661456_0.627242429920726","host":"s3://npm-registry-packages"}},"8.0.0-canary.1fee70a5e.0":{"name":"@material/slider","version":"8.0.0-canary.1fee70a5e.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@8.0.0-canary.1fee70a5e.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"45a6442a3323b39b9f119d3f4f6d7dafed653d7a","tarball":"https://registry.npmjs.org/@material/slider/-/slider-8.0.0-canary.1fee70a5e.0.tgz","fileCount":38,"integrity":"sha512-LujU6GYS3ArJDWdPQ9otG4d2w2LGZFJE7hnGUvwo/8FUG8UkFopji+i+Qlys+qggiloOmvOWH4tC3y/IEgycZw==","signatures":[{"sig":"MEUCIFMFYUnuIrvIxLIFnt3movee/I44SIGIufQLk9FSf8xPAiEA2KhChkQ5mHP/LpEsl9VNichzmgEoq4etLpEvTIaVyYI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":719847,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfNHs9CRA9TVsSAnZWagAA+0EP/3pKn8Z5CkIJWwVIpMx6\nNJ/1IAjmicZnU8pvAfZv8PtKihw22wD9tmVxBs7bFB3C38SMxvSgcRr6/xuf\nu9i+XEnT45BPMnLfCJXjPxox3Ba4yfbCnui0TG8umTMB56Q4B//Lg80y36gM\nkY0igTUk4haEKqj0IaFJbh6FWjKxtbZN3AwQG9Lx8OP9lyIIWdVppzql1aNR\nWsADtXKOIzY9lv4GuGyCMd0aP7vGXnmk7ZEv3HH3Y+laOTqtdnnTLtls/ci7\nRFxevrXOk5VbY4iTEByfSLade2l7lfiJnd9Ifpt7FUIQni/I5guS9iqCxFqs\nj5HllpUwIl3NNj/ROov5MDWSMGdjNwkxHxtmFF5idSQrJj02OxDkAsHOWHi0\nWE6KwcNDDZeddmnT0SzTdrSEAnj6tPy0Tak/vK9sINJFzwJZgUhhnSXudVLB\nDObS0NyFKcEzZzifJDU66V4CiDhCZqeuVJcmnnHQ9AGGYIQNptlx4SaXbI5+\ndbsMh1BX8ZKjLJwnhM5tLWsU2h5Vm3CXNM6MeSfAATujo1dGPpmQQv64k8DK\n0bYCFzcSCHaGAJUNJRssyVKcPrEv2Kq1h0Z4EDSuegyjuokopp9KcqdH/2fd\nn5tspXfmxEvisQ+JON9oZvDLsdVLd3agvGSl0mOyCCOH5Nt5f79N8QnIZZ2/\nriMB\r\n=St3r\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is modeled after the browser's\n`<input type=\"range\">` element.\n\nSliders follow accessibility best practices per the [WAI-ARIA spec](https://www.w3.org/TR/wai-aria-practices/#slider)\nand are fully RTL-aware.\n\n## Contents\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\"\n       aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   `data-step` attribute on the root element. This will be the step size for\n    value quantization. If not set, the default is 1.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"20\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `tabindex=\"-1\"` attribute on the thumb(s)\n*   `aria-disabled=\"true\"` on the thumb(s)\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"-1\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\" aria-disabled=\"true\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the thumb element's `aria-valuemin`,\n`aria-valuemax`, and `aria-valuenow` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"75\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"2e5eed4b73395e9cae47d93ed6f34f0dc0467c28","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.22.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.1fee70a5e.0","@material/rtl":"8.0.0-canary.1fee70a5e.0","@material/base":"8.0.0-canary.1fee70a5e.0","@material/theme":"8.0.0-canary.1fee70a5e.0","@material/ripple":"8.0.0-canary.1fee70a5e.0","@material/animation":"8.0.0-canary.1fee70a5e.0","@material/elevation":"8.0.0-canary.1fee70a5e.0","@material/typography":"8.0.0-canary.1fee70a5e.0","@material/feature-targeting":"8.0.0-canary.1fee70a5e.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_8.0.0-canary.1fee70a5e.0_1597274940398_0.7910069022036985","host":"s3://npm-registry-packages"}},"8.0.0-canary.023f3fa34.0":{"name":"@material/slider","version":"8.0.0-canary.023f3fa34.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@8.0.0-canary.023f3fa34.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"5060a52ab199250dbb38f4c72d253e25a9f068d8","tarball":"https://registry.npmjs.org/@material/slider/-/slider-8.0.0-canary.023f3fa34.0.tgz","fileCount":38,"integrity":"sha512-favFKHOLXHysLtZlNzYIVmst8jONaS0LnFPg2SQHxgDw7nZxgZFWntnriU7K7gKOYZWzQIlORZMHd1M7ESP6Vw==","signatures":[{"sig":"MEUCIHVH3UP5r3aY6VelBbYMsL8X6X010fgZLoll7v6n758LAiEA3KuaBpZLo3Xy3mGc+1I8aecyLZlp17EmjC+NMhxRP/E=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":719847,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfNJOLCRA9TVsSAnZWagAAwhoP/0FraZ7G1SLl6wBeqzFh\nzycY9VYOqI+1Hwf52RNG6Z960H0D4A6HZcpkRfeqE1WPJMgeiZH9VIzYn0xO\nzSgHjKWeZXLNPAt7oPNCvK0XQVtvSXqaUmPiEwWNQi4wLxk51D13txb0waKX\n86NSsUZr2CuO0Vp6kwyVIwXRdVqKwvrJG1M9mZixFIxgCi7uy4zj+VhKoPNT\ngrS3ISvzYH6rHEvon6mW8qO5VbvDJlx+nwf76jHJ5J1QegZ4bp2Eo5Ws6KWB\nBppsNV+DFxEncg2oEQJsejxzPC/Afpg7H1vKtzY4UAY1wa4my2iq474IvLJl\nV1+A5KAi3tIvwGf6iqzt8v4wecv6sbIbva3OpZ3Cq9uHVbVxQEjPWiek2Wwt\nhGOkSEeL8IsSTgZfIIu3kb7xoej/TC5Q1ysLH3hrIwgbwdTgZpA+E66iyf4w\nvS7FJvOgswu3Eb5eLPmUipc9Ityq+bIfZ1ANE+33YT7uCjnYvFs6TS623WB+\n1Bn+QJmYvB/KSt2EC/rwr57AZtRdbNg/Y1qtg7BOLTBCkBITdFD2CmTlCpe2\niYPWOZ8RUke0CV/Nkh8kMMipQsJ8ee280PZGZl03w11g+s5dF0AjEQrymyEz\nljmcLUU84oMMBxqVSm2LeXlvaeRVcWSiYiA2bTHoPP3Lqghxcuki1DRkNpef\nJasK\r\n=49/K\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is modeled after the browser's\n`<input type=\"range\">` element.\n\nSliders follow accessibility best practices per the [WAI-ARIA spec](https://www.w3.org/TR/wai-aria-practices/#slider)\nand are fully RTL-aware.\n\n## Contents\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\"\n       aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   `data-step` attribute on the root element. This will be the step size for\n    value quantization. If not set, the default is 1.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"20\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `tabindex=\"-1\"` attribute on the thumb(s)\n*   `aria-disabled=\"true\"` on the thumb(s)\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"-1\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\" aria-disabled=\"true\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the thumb element's `aria-valuemin`,\n`aria-valuemax`, and `aria-valuenow` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"75\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"1a6538d0b407fd8e7a7de8e39b4ed51bcefc560c","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.22.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.023f3fa34.0","@material/rtl":"8.0.0-canary.023f3fa34.0","@material/base":"8.0.0-canary.023f3fa34.0","@material/theme":"8.0.0-canary.023f3fa34.0","@material/ripple":"8.0.0-canary.023f3fa34.0","@material/animation":"8.0.0-canary.023f3fa34.0","@material/elevation":"8.0.0-canary.023f3fa34.0","@material/typography":"8.0.0-canary.023f3fa34.0","@material/feature-targeting":"8.0.0-canary.023f3fa34.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_8.0.0-canary.023f3fa34.0_1597281163061_0.7902861294126329","host":"s3://npm-registry-packages"}},"8.0.0-canary.80f3a9e5d.0":{"name":"@material/slider","version":"8.0.0-canary.80f3a9e5d.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@8.0.0-canary.80f3a9e5d.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"cc44e2960961373d734274c673b8a34e807c868f","tarball":"https://registry.npmjs.org/@material/slider/-/slider-8.0.0-canary.80f3a9e5d.0.tgz","fileCount":38,"integrity":"sha512-XiJ0BmdYhRVXnnjEMUhxfY/Lt6DFOWtwfaUjoYcpGyZBAcooOseUaPEQFgtJTH9o9T92I896i8oQFhngRcQKpQ==","signatures":[{"sig":"MEYCIQCN/i9HBaD482J3fZ55os+frv3X9R/drChv3Gur9xlY8wIhAIr88YzB455tsJKgYC3R9WoGet9TFajtaAW/0HqrdUg8","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":719847,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfNJdxCRA9TVsSAnZWagAA6WcP/jNZP+yNMxZo6+WcwD8S\nJ59nTcGLLOrc3QvLxLTPfhbylVzxBtFH+FBZvyWQgBxvQffb3pSs1FjPe1Uz\npzbTd564wv4RmejPRI8nrrfg5BHEV7fnPPL6xuaXCFNW8r7u+Y59EjLu0vhF\nVDrR7qy0tKhpspRdc0p/9ooWMQcYj2jo/Kr8eBPLQw/IvOauKh3Iz4dERcX6\nUJaY/l3UgedWzoNka1/qrwHqsE9fd1fZD8aW3NK0an5a/3YaBiPK9h824TKN\ny4oposSQJNzk95KbqDPIhVWGqm5UCFcB+Z9DNuJOotVPq9uf3V2IB9dMcVGJ\n4pF9M4RKkqPhTS6J7ncgm2F+IAjE1j/eXFc7uxtZt+lUfsyJhZKKNaAq6V+H\nz/O0t5mhHoipgtFhrNlwMpKMnGLeE/99MVj7xMINdKXxrDpotU61Gm6JR1Wk\n1mXzLhhoT20woErFgcCrvt8JbVLyAPvftBW9nRYTAgRiT1FQjEuctNzqZM5M\nPGabl203mtTG4AlhyZEOBQzLpVMM3pa2vG+obwQmVtAJRNg57zPbK4kboMAf\nAg/W3pewaNE10vzSP2aoqrg8QOEKk1KADqtLA87L0q6XWfKtBWVbZr3nF177\nRyQJnPmctVQnWVQuqpCcstg7WSUniMLKLW3+gWaO3GMPrytcsXWCGi6qDTMM\nq8ri\r\n=V5ER\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is modeled after the browser's\n`<input type=\"range\">` element.\n\nSliders follow accessibility best practices per the [WAI-ARIA spec](https://www.w3.org/TR/wai-aria-practices/#slider)\nand are fully RTL-aware.\n\n## Contents\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\"\n       aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   `data-step` attribute on the root element. This will be the step size for\n    value quantization. If not set, the default is 1.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"20\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `tabindex=\"-1\"` attribute on the thumb(s)\n*   `aria-disabled=\"true\"` on the thumb(s)\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"-1\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\" aria-disabled=\"true\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the thumb element's `aria-valuemin`,\n`aria-valuemax`, and `aria-valuenow` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"75\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"e47018f239b51581a67186dcbea3f4167f5ea3f2","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.22.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.80f3a9e5d.0","@material/rtl":"8.0.0-canary.80f3a9e5d.0","@material/base":"8.0.0-canary.80f3a9e5d.0","@material/theme":"8.0.0-canary.80f3a9e5d.0","@material/ripple":"8.0.0-canary.80f3a9e5d.0","@material/animation":"8.0.0-canary.80f3a9e5d.0","@material/elevation":"8.0.0-canary.80f3a9e5d.0","@material/typography":"8.0.0-canary.80f3a9e5d.0","@material/feature-targeting":"8.0.0-canary.80f3a9e5d.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_8.0.0-canary.80f3a9e5d.0_1597282161068_0.510873821435126","host":"s3://npm-registry-packages"}},"8.0.0-canary.a1dcfe97c.0":{"name":"@material/slider","version":"8.0.0-canary.a1dcfe97c.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@8.0.0-canary.a1dcfe97c.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"95ffda4dca24d9613d226e223fa98ff969e7f36e","tarball":"https://registry.npmjs.org/@material/slider/-/slider-8.0.0-canary.a1dcfe97c.0.tgz","fileCount":38,"integrity":"sha512-P1scNsEp+VlPnUj1K62bH01wiSYx2z/lE0wWf0Hn8C5wjesnz3YCpvx76veN5wZnJv6SWCVDoqfKkzFxzzLdUw==","signatures":[{"sig":"MEQCIDwbC+HozEcuqwj4esD/jZk1e73Dg3HThK+Or0rGcV25AiBik43PjKDEAYFy6CRSZE1fUX1nz34orREw3qUrmmQbYg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":719847,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfNP7FCRA9TVsSAnZWagAA8pkP/iX9GCVU/Ip5H/+Busfv\nP3i2ZbOoy4M7ooMGoADeupaCiJq9vb+5u7TxoYafeRq+CmPGXa44aOPXa82b\nRABF3hzFbW4MFLoSa4MQWpLhoqkv+hxHvzBv649lCD48/jLEPsujJGpUy3Fr\nLqznpCHOK22t8z4NUOSaoq1rqDnP+q1wOZuvY4TgYw8DgjG5guf3EFugZXwy\ndadZ6ahi6g3yeassXOV4RCfuQE44JnjLXOg59cSkvYfD7t85q/UExFBOy+K3\nyL9Q4qcoZpmJHS+ERowBivOt0HGrS+qgdQnTHCQLhf5TtIrCnJA+kJoKOjIY\nqD3SDDa65YR3VquJ9qU0+EdedG/ODtkR8bUUX0ljMne23d6YIk8CFOg1MZ+S\nnFjQto3biVqe1Cqe6+grK60Jl+N+XqMcO6zEy3h9EHDM/XBPIqVXl26ByTV4\nIwsqhhik3klnM1RihBmLVYRfoGEZE/gOVp1AxESJZHN2o0Y1tp6wfHYK658O\n7MGUwmWIZcZ3X7s8gCduZTRiQ/FqK0sO2K22GX6qjeRxdVHJvMl07ENuF5F0\nV4z7mRRb5+6uoFF6FVcc4/yglG4ohQi6cmMIRdErz9ybeFNO+IR8ApZ5ZucM\nBD2XYC2W3fanxE5lrwA/1XkwGWBMu9OJA0yTlP4m3mPzkfSwvRrCnd9dU0ny\nJdud\r\n=4961\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is modeled after the browser's\n`<input type=\"range\">` element.\n\nSliders follow accessibility best practices per the [WAI-ARIA spec](https://www.w3.org/TR/wai-aria-practices/#slider)\nand are fully RTL-aware.\n\n## Contents\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\"\n       aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   `data-step` attribute on the root element. This will be the step size for\n    value quantization. If not set, the default is 1.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"20\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `tabindex=\"-1\"` attribute on the thumb(s)\n*   `aria-disabled=\"true\"` on the thumb(s)\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"-1\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\" aria-disabled=\"true\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the thumb element's `aria-valuemin`,\n`aria-valuemax`, and `aria-valuenow` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"75\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"8ec1483dd23463f0239974be9a65ec22a6b54715","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.22.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.a1dcfe97c.0","@material/rtl":"8.0.0-canary.a1dcfe97c.0","@material/base":"8.0.0-canary.a1dcfe97c.0","@material/theme":"8.0.0-canary.a1dcfe97c.0","@material/ripple":"8.0.0-canary.a1dcfe97c.0","@material/animation":"8.0.0-canary.a1dcfe97c.0","@material/elevation":"8.0.0-canary.a1dcfe97c.0","@material/typography":"8.0.0-canary.a1dcfe97c.0","@material/feature-targeting":"8.0.0-canary.a1dcfe97c.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_8.0.0-canary.a1dcfe97c.0_1597308613167_0.18407306232771603","host":"s3://npm-registry-packages"}},"8.0.0-canary.af332d5be.0":{"name":"@material/slider","version":"8.0.0-canary.af332d5be.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@8.0.0-canary.af332d5be.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"7c6946a98d7e5306e61cb207596bc330e034f577","tarball":"https://registry.npmjs.org/@material/slider/-/slider-8.0.0-canary.af332d5be.0.tgz","fileCount":38,"integrity":"sha512-WwE8G4JHPylzeQwAOH/xLtSvPki0zBj4iNAYUvrlM+ZepIlin5IMiQ8rx5XWq+zNStvBvAnOjvLlBnEU4plrbw==","signatures":[{"sig":"MEUCID/mFEwVsZXgFJNXKDxcOwCvlNPY14RMHZaHoo6PD5egAiEA/aY6EpLILB3qSGRQXuLPsUcK3sQO6ng1c4AWhpT+728=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":719866,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfNa35CRA9TVsSAnZWagAAjJEP/2GDnXgtcMLansaJU7BU\nUmXf1trR4bH/070xDFPaPxq7MsPYgAd9AuNkmE0wqHgxbPAFzdYap4lKAElC\nkAGIwU26fbtYrcl63bq9YZOFlMkj+EGwly6Xk5mdExDeNNNaEQEihEVLEry+\n9l1xBOs2yO0VIo53jG0pkoJAar9vwcB6/V3yc5nwMUGRKehSbr0/EZM+HuMx\n4CTNGJEc+MI1SOoOtTajIrl8NLiWB6610HyE77c0v+xQWqQSV/lTOAmRALto\nKWX2JgQRBPew4MrOqpY1m5t/+Ek6f7pvoaS3Fl3a86mROY6XRbAW9453Qgka\nHr7cPLTOjE2GllF4RJjdxrV2tYfDPX+Htbkis17foK1LOVXwud9lRdHFJ1vw\nRLimLZqV2WC9ctpv8Fh2hCOJkimm2TpbWNWk5p4EF8vY4EAduif5z9u9NkYB\n2XxaHqhzZZUgwdwIOIO1tDiEMh0jhcgQkvuyYQxtOIcKMT0+7Z79XbWOIQaI\nxBLq0+PNzS7yXR/sqC+DJEmlcFaWmMX6uCx7cRGyxhp++9NlqVrKql1lFo6r\n0fqy6UdOuCp85UqDo1Y6X7zyOKxC8zlNX2NLfEvoaeDmI1wpehu3ToIBBw1N\nEdkCmbfYtQJem9N56492svm/1b5T9EM2QchRiI/E45xBU3E549tDCsJCqL1L\nZsdJ\r\n=s51s\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is modeled after the browser's\n`<input type=\"range\">` element.\n\nSliders follow accessibility best practices per the [WAI-ARIA spec](https://www.w3.org/TR/wai-aria-practices/#slider)\nand are fully RTL-aware.\n\n## Contents\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\"\n       aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   `data-step` attribute on the root element. This will be the step size for\n    value quantization. If not set, the default is 1.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"20\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `tabindex=\"-1\"` attribute on the thumb(s)\n*   `aria-disabled=\"true\"` on the thumb(s)\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"-1\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\" aria-disabled=\"true\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the thumb element's `aria-valuemin`,\n`aria-valuemax`, and `aria-valuenow` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"75\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"ecb675d071cb76738aea95a2d43ef88a134275be","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.22.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.af332d5be.0","@material/rtl":"8.0.0-canary.af332d5be.0","@material/base":"8.0.0-canary.af332d5be.0","@material/theme":"8.0.0-canary.af332d5be.0","@material/ripple":"8.0.0-canary.af332d5be.0","@material/animation":"8.0.0-canary.af332d5be.0","@material/elevation":"8.0.0-canary.af332d5be.0","@material/typography":"8.0.0-canary.af332d5be.0","@material/feature-targeting":"8.0.0-canary.af332d5be.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_8.0.0-canary.af332d5be.0_1597353464065_0.9548651799380843","host":"s3://npm-registry-packages"}},"8.0.0-canary.7dd4567c4.0":{"name":"@material/slider","version":"8.0.0-canary.7dd4567c4.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@8.0.0-canary.7dd4567c4.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"fddfc22133341031a31cfb3f81eeb1ef94a26b4c","tarball":"https://registry.npmjs.org/@material/slider/-/slider-8.0.0-canary.7dd4567c4.0.tgz","fileCount":38,"integrity":"sha512-HFhrwu3KmOiCGL1TbnGAb+pVOe8Ygu+6nYRKxsJLwe5xppOmp0/hC0sQ+CUbxStjgla45h1hEOvjz5qj5TPf/A==","signatures":[{"sig":"MEYCIQCT0gv0fnzdvXfvYKV3l/tz0e7IOqeJuIXYnpbr7tfPbAIhALaPhjT6T8cto5xyKwQ5lbF2U3thPWxi7L7aTCEh5RVi","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":719866,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfNeAICRA9TVsSAnZWagAAZ4IP/1zfmS7nyh2KjkOTnHwe\nehFfRBdEw9sResKFRqmuvDFfwYd9ZbdDjX49JaeYLKRD8XGQ1/1L17hhgO3n\nmw2h5HGD5wThYmL25UblsxC46uITqCnN3QtoL7iHpE0AxAfCX9XXNSlxN1mO\n6GlvMK+dEXFbfHZIMASWDvAUZe+fein331LUFnl+mH0hdS41Vygu/vTj/DoJ\nrenHY7yIWlnUPVq6jalaeq4w7q4j1xr+L/DUnNsjhx25EYtiSt4eZudUw3OM\nNOYihhoBi9q1TT15D5kyYe62neVqw5OSFpMvo5tok98wgQ/uflT61xYRYRab\nYnZ2UtSVX/mCXArKl4yV+2HFDjnlCwjPO+7zVzmXWxrpkgEvpQTQZnG1IiNF\nRblCF+E55KACt7g9sWyFcQ3lTRsafM6+sjlvqIU2V3C1XkQxuG4FrfiWyEb+\nnq2knNXRJEIndlHL8VRqqVDLnn3hqu70ZLM37dNT9lqXoB57Z5UyXR5NyYwl\nwF0Y9uFGR0eMSAolLkbnlbzsWV53pAj0JSJY38+7gQ2rUPDPC4npxTxaDLMk\nuarw18GjFssz6sAm3Y3y1ttcjD91+Pi8ldn5K2pRDbvto/rxAQfVEHco745S\nc/kPtJ/xzcaC4nPuHwxl9Dj24j1oXreIQOuVZksLugXd0KGhJYhanD8g5+Rj\nva3D\r\n=iM/F\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is modeled after the browser's\n`<input type=\"range\">` element.\n\nSliders follow accessibility best practices per the [WAI-ARIA spec](https://www.w3.org/TR/wai-aria-practices/#slider)\nand are fully RTL-aware.\n\n## Contents\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\"\n       aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   `data-step` attribute on the root element. This will be the step size for\n    value quantization. If not set, the default is 1.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"20\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `tabindex=\"-1\"` attribute on the thumb(s)\n*   `aria-disabled=\"true\"` on the thumb(s)\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"-1\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\" aria-disabled=\"true\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the thumb element's `aria-valuemin`,\n`aria-valuemax`, and `aria-valuenow` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"75\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"515ae143d426f0329f0a745e0ad35113761376e1","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.22.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.7dd4567c4.0","@material/rtl":"8.0.0-canary.7dd4567c4.0","@material/base":"8.0.0-canary.7dd4567c4.0","@material/theme":"8.0.0-canary.7dd4567c4.0","@material/ripple":"8.0.0-canary.7dd4567c4.0","@material/animation":"8.0.0-canary.7dd4567c4.0","@material/elevation":"8.0.0-canary.7dd4567c4.0","@material/typography":"8.0.0-canary.7dd4567c4.0","@material/feature-targeting":"8.0.0-canary.7dd4567c4.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_8.0.0-canary.7dd4567c4.0_1597366279646_0.49939921055685077","host":"s3://npm-registry-packages"}},"8.0.0-canary.ff870005a.0":{"name":"@material/slider","version":"8.0.0-canary.ff870005a.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@8.0.0-canary.ff870005a.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"ddc827f452d1e1dd87f4d85630af052b3de80905","tarball":"https://registry.npmjs.org/@material/slider/-/slider-8.0.0-canary.ff870005a.0.tgz","fileCount":38,"integrity":"sha512-x3gGtGRHQnlizHecOgVdiMoWzINSTLcV3TBDlWbravZcpTQQ1Fo0rzdr2dJxVHb7nmhBEhQiVpPqD1sizb3mAQ==","signatures":[{"sig":"MEQCIHKbGku65rL8GVra2ELaCy9msAIIowZ5A6POHmjUxsrgAiBiQ8rU9o5+ukU/MBSpyVodHOQsPe0DHFah7gGpw8RX2Q==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":719866,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfNeXuCRA9TVsSAnZWagAAkWgP/RdzWeqsAl4vlauX2FU6\nh0hz4Jrt1YL8F2+Qc8JFrj/9x3ogZTfPKqwsZRL5yxoH3NcTkeokENzy/CHb\nh0aJZVT1TibdBrmivNJjLewMcXwNt1b5ozzQ/w3gJ0qjYkgaCItrj8o1d1xd\n2wqJDEeNwTUta4g2jTHDt+hjc1V1M3lwyx5/sY0Ebz3D6JnGjYbSCAOMAwL9\n3VPrFiVVvkIWKTz4U980vlDHSQrkX4R7JnaUqE96JGpOD4boJwQZxkP/FQx6\nxeSw4V6eEcEPpDr51TXaIYWGI8nvgNofMMqghJXvMHNZRRgAg0IHri7zatEt\n1gtYhJfH5qABaq5N1HkqO/NZv4g5oXJy2JVG0alTffPdpSSLbbQC/FlLPLAu\nZZthAvMrcr8SFlz5NstgZT/eGb1dfzJSlXOsYHbKMXHOBxRSVCK4UOVCzeSb\nFaHlAk6hAFIC2geAP5eOrnJduE/jua0qaoRQZQskEY35NtJ/Q4XdhD8PtK1Z\n1u7ihYoGXcsCu+QClyxultRnJe8UFPNh0O6+kO20dCYokQE5VqDXsO+PCz3z\nSmRBvMcyZ6aiWL9npbwyxnSQqhiFjrSB3sQvQxBX1nEpbQ0ZYoIc2QnoBw/J\nZXOJfatmIq3iXrUuZQ1R/xaI0a1jWLp5I+D+FUTJH1n/gqjpgieIwOZ2oJ6C\nYHSy\r\n=V+Az\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is modeled after the browser's\n`<input type=\"range\">` element.\n\nSliders follow accessibility best practices per the [WAI-ARIA spec](https://www.w3.org/TR/wai-aria-practices/#slider)\nand are fully RTL-aware.\n\n## Contents\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\"\n       aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   `data-step` attribute on the root element. This will be the step size for\n    value quantization. If not set, the default is 1.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"20\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `tabindex=\"-1\"` attribute on the thumb(s)\n*   `aria-disabled=\"true\"` on the thumb(s)\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"-1\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\" aria-disabled=\"true\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the thumb element's `aria-valuemin`,\n`aria-valuemax`, and `aria-valuenow` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"75\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"885c1d5e1cf217db1bcb8176917a25d6c74575a5","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.22.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.ff870005a.0","@material/rtl":"8.0.0-canary.ff870005a.0","@material/base":"8.0.0-canary.ff870005a.0","@material/theme":"8.0.0-canary.ff870005a.0","@material/ripple":"8.0.0-canary.ff870005a.0","@material/animation":"8.0.0-canary.ff870005a.0","@material/elevation":"8.0.0-canary.ff870005a.0","@material/typography":"8.0.0-canary.ff870005a.0","@material/feature-targeting":"8.0.0-canary.ff870005a.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_8.0.0-canary.ff870005a.0_1597367790262_0.89801575372495","host":"s3://npm-registry-packages"}},"8.0.0-canary.150f427a0.0":{"name":"@material/slider","version":"8.0.0-canary.150f427a0.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@8.0.0-canary.150f427a0.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"e44532f9957181cccd4649938181ddaaff24f136","tarball":"https://registry.npmjs.org/@material/slider/-/slider-8.0.0-canary.150f427a0.0.tgz","fileCount":38,"integrity":"sha512-wngojVaX5U+kje1vPcZI1RXdyQNU2YaZKmWAY4v68XK3K8ddlatVR5fCy7sd/Gg1RPE65yDvlQ7g88B9oDYcMQ==","signatures":[{"sig":"MEYCIQCfFYfcQxLfEpu7Hpr/TYiuHDembOYHmIqZvQmeM9HSjgIhAP7pCoBpH6RRc2RqFxw5AiPGXDeE+d8CjhBYdyYijoCO","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":719866,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfNpHfCRA9TVsSAnZWagAAla0P/2G0CKNsT5/4JdahpVPP\nEaMwshuNtWTeuiIeC1PlRwaeZLSi0ut7V/YwV0nKJVnGUK2OB7lOxzJB42CE\nk0L7fkiMxCASg493Wf3yuQWw5NfF2CJGTkh+djO8q1RJUiV02BobSPnrQRqZ\nMd2ZTks4aUTRgj7alLSmx2Bvn+JhIJJhlUiD9fUaglVtdYQ9hfIz9EsU2GXJ\nTIJUIyfXw3C8937RmTh0qVy13HGg0hy0vdyC1DQnmAJKnMY3ildreXot+tPq\nyZCE721QgAH78abUpsDJA4E68+y9B96a6l2IcqcERMqMMvuWD2HulavfSLwF\nsdEgve3RsUsqqEFk9PNd3ZUdgYGpPbskEaT0WI8mcovTWNqTusY6TZAX59e1\nv5DtEHOU4KH2/bvDaMVSFzep1Xa2EaZZ1G5OrJF1nve28qCoa1wMwmBOgcXG\nvtm6Y4yyZQ9oVc+TyE5U/mT99cNi8DUaDJFaHw+SMdrAVxH9LFho8SdPC10n\ncAj6N8/LVWb4qYfXW3jyDIruCCO8lVFSBXF4FQkf86CiSq0p+iRm2h7C4gaF\nzJbHyGZtZ77cOjvfcrYuXpJ0cbnpe+iRv0dNW75iZVQ5fnEIf5fqL667Xh75\nEbPFpO5ZitdHFvKf4iSsz3KGD6pqSgsb106B68XAiYsrMqrQQGZnjr8uiK2p\npx2I\r\n=7As1\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is modeled after the browser's\n`<input type=\"range\">` element.\n\nSliders follow accessibility best practices per the [WAI-ARIA spec](https://www.w3.org/TR/wai-aria-practices/#slider)\nand are fully RTL-aware.\n\n## Contents\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\"\n       aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   `data-step` attribute on the root element. This will be the step size for\n    value quantization. If not set, the default is 1.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"20\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `tabindex=\"-1\"` attribute on the thumb(s)\n*   `aria-disabled=\"true\"` on the thumb(s)\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"-1\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\" aria-disabled=\"true\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the thumb element's `aria-valuemin`,\n`aria-valuemax`, and `aria-valuenow` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"75\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"9250d38c39aaaa2210225133bd9fa4da3739df3e","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.22.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.150f427a0.0","@material/rtl":"8.0.0-canary.150f427a0.0","@material/base":"8.0.0-canary.150f427a0.0","@material/theme":"8.0.0-canary.150f427a0.0","@material/ripple":"8.0.0-canary.150f427a0.0","@material/animation":"8.0.0-canary.150f427a0.0","@material/elevation":"8.0.0-canary.150f427a0.0","@material/typography":"8.0.0-canary.150f427a0.0","@material/feature-targeting":"8.0.0-canary.150f427a0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_8.0.0-canary.150f427a0.0_1597411807293_0.4276897493279057","host":"s3://npm-registry-packages"}},"8.0.0-canary.bcc58290a.0":{"name":"@material/slider","version":"8.0.0-canary.bcc58290a.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@8.0.0-canary.bcc58290a.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"1d9d4e2c8e39cd8c27f563d7ecb60da4f64225de","tarball":"https://registry.npmjs.org/@material/slider/-/slider-8.0.0-canary.bcc58290a.0.tgz","fileCount":38,"integrity":"sha512-ZuuDd55OZ4ek+D22CFFNFpIVyYwAogRtDa8TH4i7jBuHJuPYwhfVRqdiuh4gOyMqpXOchw41OnQ73OtSr1s9CA==","signatures":[{"sig":"MEUCIQC6yd3hTrOf3jEmNlHPmbyKWRFa0BHNR+SFNfxChKdbaAIgC04SI9ZHIoFja7eaQVKnRWpssV3dZE2+J/coBheyILE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":719866,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfNxzICRA9TVsSAnZWagAAnxgP/0GpQp5j16d4K0YM7IFL\nkOWoMgi/+i/1QyQZukvd09J0vUOInfv/ouXowQnN2FCm3JuXng/lF8RQsgWG\nyJtyLjVIYhrn8DIPNeTLIMp3DqiQs1X5fPSPEaK0R1i287peU0eg3lbkAp6h\nbHrxSFOGuQptTiA7gtRGe6KrFBZOTk23JzHw5hrIuzJtihrQVqZTXquJ3Emg\nJ7cTbtiX7EUk0bI3bn7VZId7RhSF7Cq76zLHrekHhQYRizm1hUecqtcT03EU\nVcXsHaTyQ6k26uEtvI+Sv8eNGrRRqdbIXkAZcFomA7WGm7xnhadAquBaR3nu\n5tyTCKoBP6CcBNKWX9fOZzd8ENUzbmyq2gmv5E5Ubik71oGa+QHKV3OtDqEc\nxLcmBk5zvNXCZCf42deZgD7IB2tzTXrnCo+MeKXo3NbWAGGEfv3tbaFk6Du9\nP85KlN0s6e5pLojm0T5XLTUbYLBkcTgpuk9N/h5nZQ8vRx/mqadejWAUEOa8\nPEWaRkXu/UWehLD8uoIRwGuf6lYcVdLYDLITVpJ12XkYDDEZ4xTQSiRuWGGS\nzJwigN5I/goZ4eU5/QuaQLU39woeScySEOwslq7eYp3EqUd6EcphrMWnq+Md\nvcQ37vFx42aVSy5MX8gyxZat4CvEm13Sxqp7DWiUBgh0UHkxZ4fU3kIkOUhc\n+ZG8\r\n=vVRn\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is modeled after the browser's\n`<input type=\"range\">` element.\n\nSliders follow accessibility best practices per the [WAI-ARIA spec](https://www.w3.org/TR/wai-aria-practices/#slider)\nand are fully RTL-aware.\n\n## Contents\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\"\n       aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   `data-step` attribute on the root element. This will be the step size for\n    value quantization. If not set, the default is 1.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"20\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `tabindex=\"-1\"` attribute on the thumb(s)\n*   `aria-disabled=\"true\"` on the thumb(s)\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"-1\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\" aria-disabled=\"true\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the thumb element's `aria-valuemin`,\n`aria-valuemax`, and `aria-valuenow` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"75\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"ba12c8e781c26c6169e16b167798237b5ededb54","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.22.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.bcc58290a.0","@material/rtl":"8.0.0-canary.bcc58290a.0","@material/base":"8.0.0-canary.bcc58290a.0","@material/theme":"8.0.0-canary.bcc58290a.0","@material/ripple":"8.0.0-canary.bcc58290a.0","@material/animation":"8.0.0-canary.bcc58290a.0","@material/elevation":"8.0.0-canary.bcc58290a.0","@material/typography":"8.0.0-canary.bcc58290a.0","@material/feature-targeting":"8.0.0-canary.bcc58290a.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_8.0.0-canary.bcc58290a.0_1597447368245_0.8354559846444747","host":"s3://npm-registry-packages"}},"8.0.0-canary.4f55400bb.0":{"name":"@material/slider","version":"8.0.0-canary.4f55400bb.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@8.0.0-canary.4f55400bb.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"3794a68d2d9f3f1ab7bc5220e1d3a1d93b13a8e1","tarball":"https://registry.npmjs.org/@material/slider/-/slider-8.0.0-canary.4f55400bb.0.tgz","fileCount":38,"integrity":"sha512-yrghXO8Im8QnRTgE/73F1eDSv/4qolA6rLs5GcN8MULbNCpENSQ+7C+PqlLGKrmXduC3kghaR7skWakyR4MHgg==","signatures":[{"sig":"MEQCIG6Y0WR0851PPz3GoMclCEGRkx/7NOAgz8S6faE4gvngAiAC33j1Vzk7YMOLTLQGCuQj+GrZDH+h4gJX4wOs07R+Lw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":719866,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfOrKVCRA9TVsSAnZWagAAIJgP/0+rnvp9Sp9v8e1/e/mP\n+US6vGVQiMKqOl/CYB4Po4T3eb0Epk3zvmJDiiohQ20Pus162zMUrJrXxT1K\n/nHV7C/X/XvVXDTKpPhWmKm8XpklLMbzMrBuB8lAx+eu74Kl07oSqQHUZNxz\nG+U2QdkGgXD1Yr692j6T+XsjlMeHu/uBz2G8x7YkyScmFyGYAbXwulEgOBcr\nrfTlch5rriSYfkWbb5VxlLBl/bPhbzSNnTfH+ZhmdEgcg6GqYuABjrJbEhyZ\nqcUOrrIigIdtxfPw5juzyJo6xyOfiT9Din6SSwXFLzvJ54XqQTEKJ+Hl39Qv\nK9c3mCEo4HDsahC1WCSmswZjPlOCm4PCQH+pzbTyH8peA6XU2/+LY07aGwhS\nYeBEsbJNE/kz0T4uzmeU5+lXx5x6jpgf+cMzcIwbJT7MthKaklQ6VYu4nDmM\nWwcXU0T7PIaOhMKTWU+PG8aPTLUUuGDsNhcKPrgxC8USL++zkBgNHYT0IwYE\nIq/4AsLhqX4KrF6luBq5XjNnGbCOr4YlhXXqQhTjJusewPraxEgCic630jcW\nrdy66oD0F2lqD6RHM6DW4DK//QiMyaMueDkParxvHxaQWzje9mYvyt2DQayz\nKneHoChyWUvwSJsyiJNsiTkmoXT0EC3CwwNcmjEo63m03wg6v9C46sUNIeoU\nw2NJ\r\n=Ttyd\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is modeled after the browser's\n`<input type=\"range\">` element.\n\nSliders follow accessibility best practices per the [WAI-ARIA spec](https://www.w3.org/TR/wai-aria-practices/#slider)\nand are fully RTL-aware.\n\n## Contents\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\"\n       aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   `data-step` attribute on the root element. This will be the step size for\n    value quantization. If not set, the default is 1.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"20\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `tabindex=\"-1\"` attribute on the thumb(s)\n*   `aria-disabled=\"true\"` on the thumb(s)\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"-1\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\" aria-disabled=\"true\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the thumb element's `aria-valuemin`,\n`aria-valuemax`, and `aria-valuenow` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"75\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"a9eebd86aa2e631b994a71291827e602b842dc36","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.22.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.4f55400bb.0","@material/rtl":"8.0.0-canary.4f55400bb.0","@material/base":"8.0.0-canary.4f55400bb.0","@material/theme":"8.0.0-canary.4f55400bb.0","@material/ripple":"8.0.0-canary.4f55400bb.0","@material/animation":"8.0.0-canary.4f55400bb.0","@material/elevation":"8.0.0-canary.4f55400bb.0","@material/typography":"8.0.0-canary.4f55400bb.0","@material/feature-targeting":"8.0.0-canary.4f55400bb.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_8.0.0-canary.4f55400bb.0_1597682324768_0.2587996948179623","host":"s3://npm-registry-packages"}},"8.0.0-canary.000d64815.0":{"name":"@material/slider","version":"8.0.0-canary.000d64815.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@8.0.0-canary.000d64815.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"92c33a79e71200954ca6ff5ec10b10efda7167b3","tarball":"https://registry.npmjs.org/@material/slider/-/slider-8.0.0-canary.000d64815.0.tgz","fileCount":38,"integrity":"sha512-zFPQCKTlVlPHpC5jr1L2VSr+o7FLXPolBtLnFc551UqtoMknLc+ADGyT5ZuWINunm1jrL6gKgl6dh41iKg+pnQ==","signatures":[{"sig":"MEUCIFeDUAZQJd7Ch5veweP6ufbv1FP5Ru/Guv1p+uu+hDCeAiEA8aBq1URaEQiOKO+1CpyWBCK709LPni8I9j0HqFitf4g=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":719866,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfOrimCRA9TVsSAnZWagAAtWEQAKH4S63xBVNCnNz8cgBQ\nqDpdtkhr/HWDFO0wOv05OmZETdjv2USFKd/wzdG6n0CgtDnJknd56FzMEzP9\nbwTRcD3YuUflWas4WH/jVVJToqf8jVQoibAmZvj6I5OaKSEHuaTxX6nbclmR\nBx8AQJFXwAC2qKAowT3cE6Nbuc2UwFsa/0GrH6CMewFdSn+IDwMiKGIS4yBe\nYYiPZ+7DknBbGyBENM/KHSsCzvbjvx5ZIPm/PVLuwSR99YCqhndXj88Yc8BF\n9YhjqfJky8uSl42MnTGRI19y0Z4NiIw4TghmKGDObpEcMh/EbpkOBYem2YGe\njFAdMlGfDnBsjLks3ahp9eN+6OpKSAytc6b2THj+RuBu9dftlHpeKnfd1Xoz\nkR6ZjmGwmjNpiMyndm0sUHWGS6vlSvHNpw6yf3EjTWfjaOcxW7BvsczUjkeC\nc4P2M62VQwk5Duas/y5K7iHcGwYRruuaqrcTfji4OYQKifl15A7zibrd9EXS\ndJ7/9Bx/oz3grIlKS39anBHL02apw7afXOIN6/v0Jf+bjEAnl/Z3kwy5jAul\nkQzuMovKRpQL23EQKWDB0LWcMPKKJRm2/bok2RVQtpL2KRFqC33ivCPq3Bsm\nm1sQt+uhHISbbXV0svV8Isd6VKMT7f6PxJ/wOn+2qQpuyqc4qhWGjMJ9sK47\nGSEG\r\n=qhi7\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is modeled after the browser's\n`<input type=\"range\">` element.\n\nSliders follow accessibility best practices per the [WAI-ARIA spec](https://www.w3.org/TR/wai-aria-practices/#slider)\nand are fully RTL-aware.\n\n## Contents\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\"\n       aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   `data-step` attribute on the root element. This will be the step size for\n    value quantization. If not set, the default is 1.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"20\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `tabindex=\"-1\"` attribute on the thumb(s)\n*   `aria-disabled=\"true\"` on the thumb(s)\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"-1\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\" aria-disabled=\"true\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the thumb element's `aria-valuemin`,\n`aria-valuemax`, and `aria-valuenow` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"75\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"c8a69943d64e6f468c2edeaf1fc6204d372a9fed","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.22.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.000d64815.0","@material/rtl":"8.0.0-canary.000d64815.0","@material/base":"8.0.0-canary.000d64815.0","@material/theme":"8.0.0-canary.000d64815.0","@material/ripple":"8.0.0-canary.000d64815.0","@material/animation":"8.0.0-canary.000d64815.0","@material/elevation":"8.0.0-canary.000d64815.0","@material/typography":"8.0.0-canary.000d64815.0","@material/feature-targeting":"8.0.0-canary.000d64815.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_8.0.0-canary.000d64815.0_1597683877492_0.3709749132041187","host":"s3://npm-registry-packages"}},"8.0.0-canary.defa599a8.0":{"name":"@material/slider","version":"8.0.0-canary.defa599a8.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@8.0.0-canary.defa599a8.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"2e29c9806198a7729a690fd9c925e59d217276a3","tarball":"https://registry.npmjs.org/@material/slider/-/slider-8.0.0-canary.defa599a8.0.tgz","fileCount":38,"integrity":"sha512-bCBk9UDigowc401tTmg0qeu5i3G09dvMZHXMI9Ah2+5bwrD8jxU3ldJyIbJBDRhI4WJBbyLzJ/TtBkWF6gpXlQ==","signatures":[{"sig":"MEUCIB/scZDwCp+NEsr/1nwsAq0m00oTWZFQxKiX2uoarZt4AiEAwzhE9XO5B4Y64SWvko6kQICz+0VEGDsSKybxy38InFo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":719866,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfOulJCRA9TVsSAnZWagAAM44P/2EJkrfyaWX9WCsSwRpq\nqgyQKRZQ0yV0boiWODf/Zg+DXdyEHxLBMNHGrqCk0JQpMde9PeNi7zYPryhv\n7ZuTL3JFDS8yXRiil+Nwu+G8MMKLqnQyXFWhmeb8M7j+TqqOb0rVyuSO80kt\nrL60EF3VxmXzkMHjDmNuvoaMFq8bGcMN9UjFVmN+bxzrWWF9GnwoGZQEb6Z+\nbIgARd1JAUNOK0FB3AglLWN1/avr3Lwjz3NkdEku1ihbMVSZUEKE1lYyx0N2\nFUw3GZ+Yh83xTE25rcRMnULYNZz7HxR4ezlwdrrv1l6eg0wBbkIZnyKKUjf9\nQqQH0sITWsPJmBazE+jmiaXkHdaSwj1pXyQeEeFpR7N8bse2RiwumVDHTFCG\nGmDtR3OjhqgkLDPWGZ0vw/7kzjxem0qkRKyMh2lVby7v2dmJQWRg/Me2K/qs\nqGMJznucsioDnXme2GTs/M+yqy+J9q+c+inidCnyIuNdfSKeErO0Yyn/UFd/\nFfplrn38Evb5xKniRH0JXoRbVCZZe+2ZiKomk+nWOiXG84zInOarjxXl9FoT\nF4PyVihRTsSX8QxMkgEAB0gHHTbcdFflMAkPSsG4ZJWEkbrC+4WLx30H19HB\ne1YkAzSL+iuX1thpp7cGLM1pLSiP1jcuMLoNSP5VR3praXoOnILtncisFKvP\naZR+\r\n=NoIR\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is modeled after the browser's\n`<input type=\"range\">` element.\n\nSliders follow accessibility best practices per the [WAI-ARIA spec](https://www.w3.org/TR/wai-aria-practices/#slider)\nand are fully RTL-aware.\n\n## Contents\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\"\n       aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   `data-step` attribute on the root element. This will be the step size for\n    value quantization. If not set, the default is 1.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"20\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `tabindex=\"-1\"` attribute on the thumb(s)\n*   `aria-disabled=\"true\"` on the thumb(s)\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"-1\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\" aria-disabled=\"true\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the thumb element's `aria-valuemin`,\n`aria-valuemax`, and `aria-valuenow` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"75\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"d3ddc8cf9af988fc4a02f26feee3e4ca0184dbec","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.22.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.defa599a8.0","@material/rtl":"8.0.0-canary.defa599a8.0","@material/base":"8.0.0-canary.defa599a8.0","@material/theme":"8.0.0-canary.defa599a8.0","@material/ripple":"8.0.0-canary.defa599a8.0","@material/animation":"8.0.0-canary.defa599a8.0","@material/elevation":"8.0.0-canary.defa599a8.0","@material/typography":"8.0.0-canary.defa599a8.0","@material/feature-targeting":"8.0.0-canary.defa599a8.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_8.0.0-canary.defa599a8.0_1597696328427_0.9067558389015153","host":"s3://npm-registry-packages"}},"8.0.0-canary.66b8ed7e6.0":{"name":"@material/slider","version":"8.0.0-canary.66b8ed7e6.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@8.0.0-canary.66b8ed7e6.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"0578b015315558946903ed840b440db7a2b5bce6","tarball":"https://registry.npmjs.org/@material/slider/-/slider-8.0.0-canary.66b8ed7e6.0.tgz","fileCount":38,"integrity":"sha512-BkkSp6sxaIExOwxtuflvmivjbOEvXuevRS9Gcfzp3uVL0ldzzJwYIHTkzSq+23JCEU8KcdLSUydpja/AhFdTIw==","signatures":[{"sig":"MEQCIFO/eVMbj68ReaFJKBB0wfDm80VFPThEZTKhu3zrpGeOAiBHRG9OyqWchW5t1nvzz7OOlHW+89sfA7+hXh9V6bPrQA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":719866,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfPB/VCRA9TVsSAnZWagAAekgP/263S52VOrbyh2pH3mSr\n2262eryk3ge5jIATjT7Fbpe3wEGhaiLAHPMVPEPLy91UzqqRQErOFe7NzXvH\nGfvV7muHdj6A1RpmGk1+W+JO4+RElD1x94krlQdYLnjZ9OxcRYK+jONfNfVG\nc2m+W/PPxDhMjGy5TP9ov4TJFcG1LwoP1xzYkOK3A1VAD64BK4uJhtmPrVUX\nYKoAv5WVIDNKZU5GfPrd9r5eZkgzUB2Vn6DKf5BnIh0NGWiVFdJpgdcbXJ1w\nrp9K5K8xUJRY23McX6zaAnuUPmcPkwz3FTTdFwyZvtZnHmMYbMDc/6AsSK5C\n3aviDlzP/COVGdU4YBJX5NUU2RpbJnEH90epF8wAvasR5esZKiq4fkL7Nqpd\nrjOS/aiD7UiJDLen9JRZ8li1qTQurUQHJIJNySA0Znzfbr7U64/kDlpmDQfu\n+dOICUWIfdbVKHPl1/aCHdSFqjTYOY3Jpy1QWKNacRSCx6tHIFbnLV+MEOFn\nawtQDprqtmUn0KxGyFbYjpxFngTDAXT3iANW0S4HSUenZ6Wn8tbAqz3JxyqY\nz6dZxwT1+fdIyaIiGH4nIaXJdDqMFvWVTEa4tbrtElerZ8xGjrFplSsuLXql\nbX37JMlCx+gVygcKI5JwopZp0F3MJtBRUFR4vq7CgywyG9OiLt4pEeTNs6g5\nTMn8\r\n=rke6\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is modeled after the browser's\n`<input type=\"range\">` element.\n\nSliders follow accessibility best practices per the [WAI-ARIA spec](https://www.w3.org/TR/wai-aria-practices/#slider)\nand are fully RTL-aware.\n\n## Contents\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\"\n       aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   `data-step` attribute on the root element. This will be the step size for\n    value quantization. If not set, the default is 1.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"20\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `tabindex=\"-1\"` attribute on the thumb(s)\n*   `aria-disabled=\"true\"` on the thumb(s)\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"-1\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\" aria-disabled=\"true\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the thumb element's `aria-valuemin`,\n`aria-valuemax`, and `aria-valuenow` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"75\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n    <div class=\"mdc-slider__track--inactive\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"c23c9dce18363cb6806c169d5a516da2a0fcf89f","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.22.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.66b8ed7e6.0","@material/rtl":"8.0.0-canary.66b8ed7e6.0","@material/base":"8.0.0-canary.66b8ed7e6.0","@material/theme":"8.0.0-canary.66b8ed7e6.0","@material/ripple":"8.0.0-canary.66b8ed7e6.0","@material/animation":"8.0.0-canary.66b8ed7e6.0","@material/elevation":"8.0.0-canary.66b8ed7e6.0","@material/typography":"8.0.0-canary.66b8ed7e6.0","@material/feature-targeting":"8.0.0-canary.66b8ed7e6.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_8.0.0-canary.66b8ed7e6.0_1597775828742_0.579924229611894","host":"s3://npm-registry-packages"}},"8.0.0-canary.e2b1033df.0":{"name":"@material/slider","version":"8.0.0-canary.e2b1033df.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@8.0.0-canary.e2b1033df.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"c50960519302c24e6513cacf6cdfb694ae1903f1","tarball":"https://registry.npmjs.org/@material/slider/-/slider-8.0.0-canary.e2b1033df.0.tgz","fileCount":38,"integrity":"sha512-P2KTwaA7vBDQYaI4zO2jyEMs8CLN/OkcLnHJaBuimhMmf3GEry1ROJO1o1Z7WOScAirbCDbjGlun66+JDKrv5A==","signatures":[{"sig":"MEYCIQCgg+wiUUGvFQC+YJ+TucP7u6vgrzeLDbNQBUqUKJHEugIhAPijTHk5i1ugqpKm36PNhe909Mm3vS/3TV+y5L4zU9ln","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":720116,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfPXKKCRA9TVsSAnZWagAARysP/i+bxIEuS2qKS4YG926m\nJT17u5VXectkGwK8ENoW1bBN6OTXyKmPdCwyYnHKfm4GtfLVuKUQOAdMxi9p\nMsdj2RR2PILogX9EE1SIPLkSo3J12kgSZl/eVR2b6l1Jg/rh2HwZXUlAs6k7\nMc4FqDkyuUsbHX62wU38sqyAyW4xM/X4PR8nK6Jum84/QvXFuL+DhgUIb5L3\nOoQmPzSO4S9SizWYT1oPAds1g8nkm1UzWTL/2QeJ6G4dSSEYAdJrwQBkZsmR\nGPRr3nNJ0N0pLKfgpnvvjc7dC2GXameA/pwD2wtZRqoIhtTAdwMWi+EKvj7X\nu4211BIFKwxaubAmLgnivk6ZQ7wdRuJFS0/lGmJYZKW/asYPPYe9xUCVzBBD\n0kMUxKT8NEbmwiFvwvTydRHAEGGg26yWi1l7xYVKCxkkHN2KsjFWwIfzNW94\n7157bSyyAB0j6fXeZTJ3GdlkJwjinlAJdgnufMRrk1YZ5sf1E9xayekX/Lie\nZY0qyXWorI/v9eMmUtP+L7u0E5TIQw+W0fYoYR3DsbPZUX50yu3osQxTReBK\n6yYr46ftSw7foNqP6XoQr1jsUEnS3FIZXoX2+z+PBosW5UUuPj2RbTvejIL/\nJIiEfhqdN4wy9cFweymfok4u0UCJFhK2T43v2mSNfOI5w1Y+IBczMIujwizS\nSR+D\r\n=TkEw\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is modeled after the browser's\n`<input type=\"range\">` element.\n\nSliders follow accessibility best practices per the [WAI-ARIA spec](https://www.w3.org/TR/wai-aria-practices/#slider)\nand are fully RTL-aware.\n\n## Contents\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\"\n       aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   `data-step` attribute on the root element. This will be the step size for\n    value quantization. If not set, the default is 1.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"20\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `tabindex=\"-1\"` attribute on the thumb(s)\n*   `aria-disabled=\"true\"` on the thumb(s)\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"-1\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\" aria-disabled=\"true\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the thumb element's `aria-valuemin`,\n`aria-valuemax`, and `aria-valuenow` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"75\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"763ba6b73959bf0639ed8d0c9656a53b18e30c1c","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.22.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.e2b1033df.0","@material/rtl":"8.0.0-canary.e2b1033df.0","@material/base":"8.0.0-canary.e2b1033df.0","@material/theme":"8.0.0-canary.e2b1033df.0","@material/ripple":"8.0.0-canary.e2b1033df.0","@material/animation":"8.0.0-canary.e2b1033df.0","@material/elevation":"8.0.0-canary.e2b1033df.0","@material/typography":"8.0.0-canary.e2b1033df.0","@material/feature-targeting":"8.0.0-canary.e2b1033df.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_8.0.0-canary.e2b1033df.0_1597862538017_0.6595355323107321","host":"s3://npm-registry-packages"}},"8.0.0-canary.2e8c3dd2e.0":{"name":"@material/slider","version":"8.0.0-canary.2e8c3dd2e.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@8.0.0-canary.2e8c3dd2e.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"e7d18449f328824f09c856caa3a660e3a2d159ae","tarball":"https://registry.npmjs.org/@material/slider/-/slider-8.0.0-canary.2e8c3dd2e.0.tgz","fileCount":38,"integrity":"sha512-Vpe6AtDUNGmLfVIq8iER0Cou2hj0ABYHTNIFqKC1kL+KdFQPCyc1L0UW4DVtBu2A8xa4y7Pe3XChWL43ixtKmg==","signatures":[{"sig":"MEUCIQCDxi76G3MxGr4Aij2vOQChP25QXDHzrUjEMoxq4ALZywIgHEiBBpMIvz20Iw6WgVAerWcCHSobqNZzLD8i2TOeI+g=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":720116,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfPXxeCRA9TVsSAnZWagAAwnYP/jGPARhCPwAeIUu9Q9yO\npZ7oWpZ6s7Ago3+1WNwbuBG8eQgZMEAJlDyLTjxULB0fcQmAX08ZEa2xpAcD\n98cvGBTcoQSH2xLmanbt9LsYN1YnwOP1fCWxIVi7NbWKRaPFNstaRpdV//Hx\n7Zf9J3ryMWFf/okPJZvQArXoCH+5FMVU2L9nyIx66jNdNiFevF6vfG7H1REI\nejRzcd3p73F2vyX+nfRaSDClwFinXeJnCV2/XTGHklALEyS2nttvl4rh9h+F\nYBbxcfP1ILLk9mnkyvKFzcF0GLNOmnnLwSv8dWcaB4f3Z6He3Kj2rHE+SY+Q\nbgZk1H0+If8s5wGFssLh0GfK6y57vAHr8mJB4yGtSr3pTJ9+chZmG3d/lrmk\nk0S/wxgL9/dYxU63+3APMzQS8ttXvBCb9eSNy+KapJOzZ/mAkUkyogN459Y6\n6/or1p0uVgHeG1c1YJpimOrIy+hwCXA6kZwNLSGXbbhQ4Bnbu4UfvMnAylSS\nLSbZV786yjIBUeFTAkhn7nuOSl7f8BPV6qQV50/RDmNoEZToOrQdXN+vTBc/\n+Vj8vlNsHP5mFfec3qFr08B+p7WD9zEjkiwmCcDvYoJCdiEl2PYhuP8piRJf\n2DDAr+e+Y4qFedjtxKlETccNaLaEZoDPwkX+m927MZHK51eFiwsjpP9w3lax\nGMcI\r\n=Jmpp\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is modeled after the browser's\n`<input type=\"range\">` element.\n\nSliders follow accessibility best practices per the [WAI-ARIA spec](https://www.w3.org/TR/wai-aria-practices/#slider)\nand are fully RTL-aware.\n\n## Contents\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\"\n       aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   `data-step` attribute on the root element. This will be the step size for\n    value quantization. If not set, the default is 1.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"20\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `tabindex=\"-1\"` attribute on the thumb(s)\n*   `aria-disabled=\"true\"` on the thumb(s)\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"-1\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\" aria-disabled=\"true\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the thumb element's `aria-valuemin`,\n`aria-valuemax`, and `aria-valuenow` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"75\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"237ca1e061b4efa53d623ea5dc9c9d670d5c9da0","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.22.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.2e8c3dd2e.0","@material/rtl":"8.0.0-canary.2e8c3dd2e.0","@material/base":"8.0.0-canary.2e8c3dd2e.0","@material/theme":"8.0.0-canary.2e8c3dd2e.0","@material/ripple":"8.0.0-canary.2e8c3dd2e.0","@material/animation":"8.0.0-canary.2e8c3dd2e.0","@material/elevation":"8.0.0-canary.2e8c3dd2e.0","@material/typography":"8.0.0-canary.2e8c3dd2e.0","@material/feature-targeting":"8.0.0-canary.2e8c3dd2e.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_8.0.0-canary.2e8c3dd2e.0_1597865053708_0.4707591013398944","host":"s3://npm-registry-packages"}},"8.0.0-canary.b2e80a5d9.0":{"name":"@material/slider","version":"8.0.0-canary.b2e80a5d9.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@8.0.0-canary.b2e80a5d9.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"9e1d91d98f30b882d5c8c5911a18d435e356614b","tarball":"https://registry.npmjs.org/@material/slider/-/slider-8.0.0-canary.b2e80a5d9.0.tgz","fileCount":38,"integrity":"sha512-JHc0Kcc4wZSHvSPtvUzbgg2VDLsFAjsCzo/LYwkfpGUSSop1n6YRl5CQmDkmBS3JBqzJMUkq62flO9qDf5AATA==","signatures":[{"sig":"MEUCIQDI8euP3wFeVmyfj1V9D2gnb7RtIFT7mGk5WtljDX9jpAIgNeS4+JoE9Eyc3msaQNOugw2TXs0cG56XJIhdtq8zGHs=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":720116,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfPaXgCRA9TVsSAnZWagAAkuAP/2Qlb3cZw1yCjm6Uf0F7\nnSYIVqv6NexUwZxvSTqXWtTHUAmq5nRU7dmdCcz+USuhJ2VuMD1zhpVeUVYC\nYNMG7d6yZg6nJ1+3sfe4zAXYqJmIWZXKhN29D2W03+leS+8nYeufFzxxrqRY\ntXLPxiuz1wO5usuxSqNGeUlxE+sHpProS25UdJ3lFn4PtDoCkttfCB5kKKyo\ndeBTzu8kTywIUzl2jzcSONk2BjCb93PKZ5/gEPTcJYvlzBCJtRHtIl2dZ5iQ\nW/kprAoWB3ZWfeOuYJ0OisGXexPt3CcfBSdfn80KW5JPPkSfbu05E6qR2sN+\n6yESmr+be/dODqA2UUgv4nlQYA4yhQALS8tBKyQr4aH7uNu0z+anr8T7KXuy\nsDruyoCbMWmlgr6LW66kNlU+fr9ktAZnUepdxY2VCvSX5eV4U+KMhkrGhVML\nII1pyDnv6w1QVBZv+XdEbvU4IX03UPU6sHzPwuIcmqRloLn+Z4JNRAoMrwAp\nYgjIf/IMN0q4vUgedy8RdK/KKMr6OFMU+dfx6KxaMmX+lD0sHjMf3k0YtAXq\n08FgVlHhwl/23CELVRT+rYUu5kdP72BDl0sleA/EOzPJ/sEBVL3sShsp/dh5\nQFMPBvcaenG0yGwv2kBWJzPWwr+jFuNUyuKH/rzqX/0Q9suPRq/CdCfnriVK\neRQg\r\n=+Qr6\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is modeled after the browser's\n`<input type=\"range\">` element.\n\nSliders follow accessibility best practices per the [WAI-ARIA spec](https://www.w3.org/TR/wai-aria-practices/#slider)\nand are fully RTL-aware.\n\n## Contents\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\"\n       aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   `data-step` attribute on the root element. This will be the step size for\n    value quantization. If not set, the default is 1.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"20\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `tabindex=\"-1\"` attribute on the thumb(s)\n*   `aria-disabled=\"true\"` on the thumb(s)\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"-1\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\" aria-disabled=\"true\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the thumb element's `aria-valuemin`,\n`aria-valuemax`, and `aria-valuenow` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"75\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"84085f6b072572fb6b09623a5f0b35bb95db6fca","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.22.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.b2e80a5d9.0","@material/rtl":"8.0.0-canary.b2e80a5d9.0","@material/base":"8.0.0-canary.b2e80a5d9.0","@material/theme":"8.0.0-canary.b2e80a5d9.0","@material/ripple":"8.0.0-canary.b2e80a5d9.0","@material/animation":"8.0.0-canary.b2e80a5d9.0","@material/elevation":"8.0.0-canary.b2e80a5d9.0","@material/typography":"8.0.0-canary.b2e80a5d9.0","@material/feature-targeting":"8.0.0-canary.b2e80a5d9.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_8.0.0-canary.b2e80a5d9.0_1597875679685_0.964341126646584","host":"s3://npm-registry-packages"}},"8.0.0-canary.ff88df637.0":{"name":"@material/slider","version":"8.0.0-canary.ff88df637.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@8.0.0-canary.ff88df637.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"b390221443658fc8944173f7ce5e06298bd42419","tarball":"https://registry.npmjs.org/@material/slider/-/slider-8.0.0-canary.ff88df637.0.tgz","fileCount":38,"integrity":"sha512-QS7Kd7po3c0+OXAjPhtl1XoQh6yukFgMUMfDik+xjaiTs8A6vPkPYcZMtHMAJuOCLgJ7UwqordIsKLw8nfXGiQ==","signatures":[{"sig":"MEQCIGIhuSr8KNqqpmtsjeEnJ5KxoAS1hsLmfiOknxjyirOiAiBIUYDNEAfx8xGJJBEZdC7mKpYgjXjTaY4w4PXkQilPFA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":720116,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfPaiuCRA9TVsSAnZWagAAuH4QAI5jPQd52QYdp5GQ3eNk\nPScmcust2uyXXYUQfGy0kLThMiiYZ9b/bHrdEocmg3jLWZGmrVWfKCi8iK1Z\n01oXdvMUa2NyZjHHBuzS15PpCxzLQY5yHhphixBhawW2WtOxhHNNi9qeQ9bX\nG/3zTk9SbphnE+Z2r0awU9/VYM1/prSwOYUmBgsBhOxqAMIXbDDn75mjQ/lM\n6wqIDijty00eTb2J3g/Xv7ZKNfl/TfRpu1de+HriIb6RNrDssoKSCujNv4hd\nCgvnW4wQtbJNAOzYsMcsdtG/M/BKHjzV3h4pwoJpyAmLoNj2dcDiNirdRuS1\nnxJjlUJLgyra/q3/BN/5ZVYmeHEfvjToJsDrHS+LHM3rZSrabjFoKncU+HLj\nZdk275QKdYT/fhZ0unQOcBUQk9mTzW6xcbb5MY2ZdLkNk99Mj1Lif3P+n+Vz\ncgGt8HRoxNqJoZlf9FFa5f9+JSFxLotxVyjS0EU8JqJLe2rbHh/J5Lt8N8Fn\ns3/9C4N4wz67pdOnoyuKC2YI1fd4aoiiAUZZ2nF8IyLj1X1Cd7ZCaCD4tWhi\nralFzw9Ml04SmvEfYeMJUhQizXMTB58tugw3Qq6pkR1lZ32gIFy+E8UR/cEH\nuHXSwhpnUqNFMoIGDPYtN/a6SCXnGIpbbP5q7HptH+etIO/ts+SYHIdDi1mz\nWtEv\r\n=sDfM\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is modeled after the browser's\n`<input type=\"range\">` element.\n\nSliders follow accessibility best practices per the [WAI-ARIA spec](https://www.w3.org/TR/wai-aria-practices/#slider)\nand are fully RTL-aware.\n\n## Contents\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\"\n       aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   `data-step` attribute on the root element. This will be the step size for\n    value quantization. If not set, the default is 1.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"20\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `tabindex=\"-1\"` attribute on the thumb(s)\n*   `aria-disabled=\"true\"` on the thumb(s)\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"-1\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\" aria-disabled=\"true\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the thumb element's `aria-valuemin`,\n`aria-valuemax`, and `aria-valuenow` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"75\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"36ba8daf061692c2f915513485e71707d8eae239","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.22.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.ff88df637.0","@material/rtl":"8.0.0-canary.ff88df637.0","@material/base":"8.0.0-canary.ff88df637.0","@material/theme":"8.0.0-canary.ff88df637.0","@material/ripple":"8.0.0-canary.ff88df637.0","@material/animation":"8.0.0-canary.ff88df637.0","@material/elevation":"8.0.0-canary.ff88df637.0","@material/typography":"8.0.0-canary.ff88df637.0","@material/feature-targeting":"8.0.0-canary.ff88df637.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_8.0.0-canary.ff88df637.0_1597876397795_0.5900604806472582","host":"s3://npm-registry-packages"}},"8.0.0-canary.32fb314cd.0":{"name":"@material/slider","version":"8.0.0-canary.32fb314cd.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@8.0.0-canary.32fb314cd.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"a64e29b08a0316fa8afa0b9f820d8a2f0d655632","tarball":"https://registry.npmjs.org/@material/slider/-/slider-8.0.0-canary.32fb314cd.0.tgz","fileCount":38,"integrity":"sha512-gwK8yW4wbLyp/hC6Lcofbxosi19nDbYYKdMhE647v0CXCgJr/MNHuyWoB/GzBcYoTKM4E0gIs1Jo3khRDpwuRQ==","signatures":[{"sig":"MEUCIFvjwdaA/13p5CO77r/FQAzyZxlMygbfNHTadEKj9OfbAiEA4pYxftjNv3FjYj32abukgBwVjCpDxy45RfxHF6jOqcA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":720116,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfPlKICRA9TVsSAnZWagAAD84P/ilmff7OTHpSBitCKZ/n\n0DyxYncyk0iLfKuuUkFsfrWb39J+XFQC/khwCqtpKjVX4CLenyzVJy4sdYIN\nFJP6ADHuH6rOfYeFV72CydZw2zxaQ/DQKEmOTJHuwq9eylSfvkFfzi8rxIdp\nDT6eJ6sGSE9Yd6Qk5kGxU2HSlg7E1gceSd7P/s5Ib+TRm2uzVOGnaV5ogpVB\n5PoqzyWBdVgNCT8r7a42fuDyWAxDmJOR7Xy9oTNqiXqhsnKaSBmcDktifp9d\ngz/qF7bE+AzG91eW41qiSnIU7IG+qjdf2X9vBlFTqRkokK0xOcgotCOfdyH+\nZrnvCwFST3xbvh4sQlIXRFcmXDhL1eDh5zJFvHyvOh3rHgaCK9Vu2eQVJVu3\nsQ9+oI17/5nLWiPPTd0MtjoB87hxbKKTLrXSe+5VCRHluz3dQb1AKUiYk2tJ\nOW/UQNDdrvABIlrEFaMQqFtr9LyQ10rAbK9GFQ5lyk8R1wI9c0zD/LHy/S6h\n+Xy0h6iGqRTXK6YxsoSa3yoB2NKgxysxU9klmSn3b8mHaia4Y/yb52EMkk92\nd0rfPM9soqxf5p0KRRn9+eUZZN51wb4hd0En2pIixV7OK3sydfiCdhNGJ+fA\nQVlFvAJy4a1YVJ0UFMGWiBSm1h37/4UHc3y9iADCmQFy7BPqnIBojgq1SybI\ng7uL\r\n=Cp87\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is modeled after the browser's\n`<input type=\"range\">` element.\n\nSliders follow accessibility best practices per the [WAI-ARIA spec](https://www.w3.org/TR/wai-aria-practices/#slider)\nand are fully RTL-aware.\n\n## Contents\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\"\n       aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   `data-step` attribute on the root element. This will be the step size for\n    value quantization. If not set, the default is 1.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"20\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `tabindex=\"-1\"` attribute on the thumb(s)\n*   `aria-disabled=\"true\"` on the thumb(s)\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"-1\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\" aria-disabled=\"true\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the thumb element's `aria-valuemin`,\n`aria-valuemax`, and `aria-valuenow` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"75\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"61108ecdbe311b101b1b87763e8f3283dbb9dd50","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.22.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.32fb314cd.0","@material/rtl":"8.0.0-canary.32fb314cd.0","@material/base":"8.0.0-canary.32fb314cd.0","@material/theme":"8.0.0-canary.32fb314cd.0","@material/ripple":"8.0.0-canary.32fb314cd.0","@material/animation":"8.0.0-canary.32fb314cd.0","@material/elevation":"8.0.0-canary.32fb314cd.0","@material/typography":"8.0.0-canary.32fb314cd.0","@material/feature-targeting":"8.0.0-canary.32fb314cd.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_8.0.0-canary.32fb314cd.0_1597919879603_0.6328877887029982","host":"s3://npm-registry-packages"}},"8.0.0-canary.546277d32.0":{"name":"@material/slider","version":"8.0.0-canary.546277d32.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@8.0.0-canary.546277d32.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"124248d28f9eb7959f066cedb400328dd647ad88","tarball":"https://registry.npmjs.org/@material/slider/-/slider-8.0.0-canary.546277d32.0.tgz","fileCount":38,"integrity":"sha512-1nMCWQ4GJDYACEhcHOVthkHjhKY/PhgRtX9ragbN/UH0lk/Acv70sNAyDSuVQSYt9AdkIuzOHmEMbd7kRA6wsw==","signatures":[{"sig":"MEQCIAv8wt0dHY6G5+wCcQUXY9yrZCjCJY6Y00MysBoTCT6sAiAeyIRprTo+LNQwgxHwsJKqeZ1gpLGzMPICo/qy7hs+cA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":720116,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfPqgyCRA9TVsSAnZWagAAr/QQAIUQyDe60yfUG7aAFiCF\nQEhwj5an+QchHLbDyAkSu2pBW7gIJNQJwNdfzFAKFUDvfaLdiYaq3sWQg9Kw\nuzp0imh/rEqjbZQgvUhZl0pNXi8pMkj3Gor1af4pqtNtQwBYrpdDG3UMmM14\n55IFgvDEdm233pUyhNBt7DH27ob2lLMMlxHDM/JVsRC5mJOe86WfTQ3vDZw6\nRQTrU6POa+5NCsZNnS/WqDr7LXWMrCpn3P01dXE//HSPDm53Yv2jkOty9qWX\nTnnDcxab3amXMhpBm49iqu++fhvPGQXp/GWHtoQncNX6SL6G6wtn0I1FVCMq\nmg7jNqScQPZU/NA1YS1isoLtqnI8Ei362blLeMOqB7+4N/NwfNXF4sy0+YSt\nVlEXsi0LGY0vEHVnm+3m9Ve9L4H9DVu/H/W43wXTtab6skrD7R6QohfrzpNd\nAHeNL2Yobbpg/dt8eXOkuyfHLI/F8EBTxp3WOelfDEQfRoXoYCNNcI4l9YYK\ncl0Dtg7FpjlnH9wTHm/BtVDFdk6VY4iZ/OESUefLbAYoLQyJghmhPQmr1myC\n1Dmqz8GAynIYKBgl1YuIv9xIaJkJZrX+krpqjJR0/9B0O6emDWOi8YMvINQE\nCdLr5b3ghf+yCybzaTtqWdkQuo1K8zIExRsrm1R/ymw4Lvij19CUCwaYoMY8\nXG4i\r\n=RZgq\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is modeled after the browser's\n`<input type=\"range\">` element.\n\nSliders follow accessibility best practices per the [WAI-ARIA spec](https://www.w3.org/TR/wai-aria-practices/#slider)\nand are fully RTL-aware.\n\n## Contents\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\"\n       aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   `data-step` attribute on the root element. This will be the step size for\n    value quantization. If not set, the default is 1.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"20\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `tabindex=\"-1\"` attribute on the thumb(s)\n*   `aria-disabled=\"true\"` on the thumb(s)\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"-1\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\" aria-disabled=\"true\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the thumb element's `aria-valuemin`,\n`aria-valuemax`, and `aria-valuenow` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"75\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"1d97622107fec59bf3261ad4f1f3bbe21fb1ff62","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.22.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.546277d32.0","@material/rtl":"8.0.0-canary.546277d32.0","@material/base":"8.0.0-canary.546277d32.0","@material/theme":"8.0.0-canary.546277d32.0","@material/ripple":"8.0.0-canary.546277d32.0","@material/animation":"8.0.0-canary.546277d32.0","@material/elevation":"8.0.0-canary.546277d32.0","@material/typography":"8.0.0-canary.546277d32.0","@material/feature-targeting":"8.0.0-canary.546277d32.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_8.0.0-canary.546277d32.0_1597941810047_0.6344649334678514","host":"s3://npm-registry-packages"}},"8.0.0-canary.da72839f4.0":{"name":"@material/slider","version":"8.0.0-canary.da72839f4.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@8.0.0-canary.da72839f4.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"9c699d80632f113567df837faaaea1f078a23703","tarball":"https://registry.npmjs.org/@material/slider/-/slider-8.0.0-canary.da72839f4.0.tgz","fileCount":38,"integrity":"sha512-qTIcclauRLVmjfjgEBh74SCqYtA8T/0EVtmTCj13Fvl4W8ZqFzxzrzLbs8ZcD7HmtBF0WE3IRPhZ0d1thl46Kw==","signatures":[{"sig":"MEQCIBHAYAFC2eGF20T1VdyNVnBW6fsWUH/q7z2uTRsRTV1eAiAnm3A6ZHhO8vwoV8/up7BqtlYg2u3VYvR/vuPzLzkN0Q==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":720116,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfProwCRA9TVsSAnZWagAA/1sP+gPsvTLSdtEzfFp/yTxJ\nm4pIF7KuN5CTWHUcPQFgm1I8B8nWanskgFV8D/uYlwEcEPg+zdqdoBy13ilZ\nFpfrnYDSQgKNmnVaZjzKFqlI/M7UYJvXMCtWZwJUlsssQIqhDI/287WV2iMZ\nrfGBSC56ZOiP+PlLGHlo28AS5DHNhLJ4SJuqKegeaa0chHVFfyEoG78MN0Gc\nGcauNfQi1FfwBJZtcOScHuQ1aV8XOne94WNM0KQXBidwDIWjwcimAhgI7hmJ\nEooy9//+mvCdNeP4ct+As/mHFjbZoEac2i5jL8ARX0t9PbERs1fzRfDDkyDz\nrGgQRT/d8laIEAsqcpGgZfUsgv7cwOR3d/0Akiz5zpUp4HHCEGPy2SWAYlHa\nPWgcnGCkTPT8S+gHJdadjUPGOCXgoNc3N+B6GNCT5Tv3hd5zOD7RiSPfkyVq\nfQQPE6W7nZeN2CZLebJhjCo2ihR0GgVPfPHV/jHlK+SOtLArIe8zFKpLZk7h\npTnbItcKvEm7KUrgN9voiY6rVqcsP8f9yuqArECDIaPqMMJcOi+M147PKFNJ\n2ZJH3bgVG4pKwJdCB66oxGnKx+pSaHqVNZb0OEN/FE64QhEkUUKDVJMNLyL7\nanDc5rHcknNhbyNth6XMOlmTlBGleWwsbfWLilxkiJkBkYgDKay3ligjZPAG\nkVHl\r\n=CPC4\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is modeled after the browser's\n`<input type=\"range\">` element.\n\nSliders follow accessibility best practices per the [WAI-ARIA spec](https://www.w3.org/TR/wai-aria-practices/#slider)\nand are fully RTL-aware.\n\n## Contents\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\"\n       aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   `data-step` attribute on the root element. This will be the step size for\n    value quantization. If not set, the default is 1.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"20\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `tabindex=\"-1\"` attribute on the thumb(s)\n*   `aria-disabled=\"true\"` on the thumb(s)\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"-1\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\" aria-disabled=\"true\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the thumb element's `aria-valuemin`,\n`aria-valuemax`, and `aria-valuenow` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"75\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"1b42b69de51cf24aa95c09d0e08ae1e644c71335","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.22.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.da72839f4.0","@material/rtl":"8.0.0-canary.da72839f4.0","@material/base":"8.0.0-canary.da72839f4.0","@material/theme":"8.0.0-canary.da72839f4.0","@material/ripple":"8.0.0-canary.da72839f4.0","@material/animation":"8.0.0-canary.da72839f4.0","@material/elevation":"8.0.0-canary.da72839f4.0","@material/typography":"8.0.0-canary.da72839f4.0","@material/feature-targeting":"8.0.0-canary.da72839f4.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_8.0.0-canary.da72839f4.0_1597946415242_0.5171830917436124","host":"s3://npm-registry-packages"}},"8.0.0-canary.346069ccb.0":{"name":"@material/slider","version":"8.0.0-canary.346069ccb.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@8.0.0-canary.346069ccb.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"5e66ecfec2d89019f1b9a6d6fedb2d8c01ad2d17","tarball":"https://registry.npmjs.org/@material/slider/-/slider-8.0.0-canary.346069ccb.0.tgz","fileCount":38,"integrity":"sha512-b5jGWzi91WLEk5TwpRs3YTwNotBMMM+ni2YxtGe518UuAw3BsZekvW9YnLqWIQRtQElIbx5QYLsd75ev5rDZkA==","signatures":[{"sig":"MEYCIQDzZHVH/S4R8PjoOxu5GMTJG5wtjlynKHyy85Mn7UsUdwIhAOnXkF81Wb64vozdkLie2RaMjLtG+UmJxXDmcsqaA+MT","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":720116,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfPr6GCRA9TVsSAnZWagAAf7AQAJEwsiaJGhQMc1F+IztB\n9zpMtQ3is788cldv+azqePdxr4B4Z5gYZBaZicoIlsfxZnhDAfBz0ZcJqlGy\nX2pt2OoDjhForZsWeG5YeQPj3neT5h/LkFAXwQh/7RFuIfMfiTn0tKQxAh6n\n+PIZWMs8QGvQH4GFejRsEfZUEwXLDsdBiX3b3j+N09zaAFMbIH4Vd0MdCyJB\nTUixpYoCOmLxGe1CIvmchMNa8rMpc7m5sivCxu0xAvawpoO8cXt2BuEATDRa\nqB1XPJFso6BMxgjqBpWXoxf6bM0tIJxL3U+EpVy0/NBknU3tKPMho4sI471P\nHSZofCL2EGkwCx/G1Usfmrf/W3/hLM0Cxx1p41fS4y3ZepO9Qm5K8NTOm6tm\naoLcjWcUy7Q2nxw7MszJ5KRJFNH//bau5+OaHNqCEumdhouXdisTy/u+u/tT\nCBqedfsVjhrdg04BS7D1eoxXREQLfTuET02LsrXhGda4WHsrqWgQiyQ/NezI\n9U6yvMfwCvzPyHuFLSGdG8dCa/zYVOl9kS9pnjoZ2TGa4mc/VWui7I7QBkPO\nAjsDuVNxGfi46SzEaGFdCFhisVY2UlzLaJJvmMi/Y9oPmKPyTEMPXZiixZVS\n3P6lGB8v41/T5IY0ydWe+hQGVBQ4umhntggkfDUezDwspw3k0IGKP6vRZUhM\n4N/m\r\n=j/Ip\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is modeled after the browser's\n`<input type=\"range\">` element.\n\nSliders follow accessibility best practices per the [WAI-ARIA spec](https://www.w3.org/TR/wai-aria-practices/#slider)\nand are fully RTL-aware.\n\n## Contents\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\"\n       aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   `data-step` attribute on the root element. This will be the step size for\n    value quantization. If not set, the default is 1.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"20\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `tabindex=\"-1\"` attribute on the thumb(s)\n*   `aria-disabled=\"true\"` on the thumb(s)\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"-1\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\" aria-disabled=\"true\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the thumb element's `aria-valuemin`,\n`aria-valuemax`, and `aria-valuenow` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"75\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"cf298389e23ace16c7e4682ded1e492e489011be","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.22.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.346069ccb.0","@material/rtl":"8.0.0-canary.346069ccb.0","@material/base":"8.0.0-canary.346069ccb.0","@material/theme":"8.0.0-canary.346069ccb.0","@material/ripple":"8.0.0-canary.346069ccb.0","@material/animation":"8.0.0-canary.346069ccb.0","@material/elevation":"8.0.0-canary.346069ccb.0","@material/typography":"8.0.0-canary.346069ccb.0","@material/feature-targeting":"8.0.0-canary.346069ccb.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_8.0.0-canary.346069ccb.0_1597947525934_0.6327597077949942","host":"s3://npm-registry-packages"}},"8.0.0-canary.e27c5802f.0":{"name":"@material/slider","version":"8.0.0-canary.e27c5802f.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@8.0.0-canary.e27c5802f.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"ff6dfe4f065f1d1afd347b8ee31bfbc9c7896cc0","tarball":"https://registry.npmjs.org/@material/slider/-/slider-8.0.0-canary.e27c5802f.0.tgz","fileCount":38,"integrity":"sha512-EeQ06jqgyYPZ5lwb/DN9BoADcCYSF8FYjVIP6FMCaCBFDXK1iXPi78wtlIu3VEM6KmCci7DNRNqjyKHOZljSsw==","signatures":[{"sig":"MEUCIEG4mvdyggltbbSrfRPafQNi3hzAj1dEsvNXTY2EUNuqAiEAjijMoIMwOpaaIfhf9JjqeWY2+Byiu//xagmo3ZRJyNE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":720116,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfPsvPCRA9TVsSAnZWagAAgp8P/jY00UxFxulPqEiTvxyi\ngjUPqjxKiQ+6OMJz53BAPwug+hD/sFNYvzIIW3jfhbpZ6iOk5wgWgGrTXLHS\nuZAVqvgNQcXnM1aYqL+kLT8UwqpufNa2dKVhqYyB1P3MgmjYdy3+f5JyFEOP\nWmhXMKwmRVD8VDGzLa2gImFJ3fIKncFFlEbjhDr45BJk5VTHQv2TFnyyjnhB\n5nlmNfLQqMchgOg6zijHMM+QdwrJQ+tr+H4oCOo8l40RYzfId8KLbhcloUGp\nrDQrSoMy5/PQ+lceq5mhc56u9xcgmoTzZOP+T0iYYAuT9Lz+Ook490+zDgga\nh2ByFcHsCE9cGwNYpdVL1XEhafNFpQCrFh+3orBIQoAfIu4CdJkoJ/QQU6me\n0G7pYFhin52KQbhwvpDB/E5f3LIMDNgHk/E+JGoNOXozqbeo1gWxdrJX3DNm\n1Al++m/QMjp9wsS9/6I6YIxcgjSNANU3Xep2A1XjMl7YRs2H+qLaf5mAyJ2v\n32oUolnM6RlodhacY5SIlxSGx9XgIF3qJ2h3u+rjwFDJRvPQHWdieSh893sU\nEC0AyNjUnXbzXndHlS6Agq2Dpaf0U6sRDyVucZ7MnZ+eFkLZiSisuR5nO1qr\n4K9tjlNvVqdnzLG94mz6NNOQriOpde3t9UhRR/dIZusnSdMWo6wCke35aoM4\nA8Fp\r\n=OlZa\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is modeled after the browser's\n`<input type=\"range\">` element.\n\nSliders follow accessibility best practices per the [WAI-ARIA spec](https://www.w3.org/TR/wai-aria-practices/#slider)\nand are fully RTL-aware.\n\n## Contents\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\"\n       aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   `data-step` attribute on the root element. This will be the step size for\n    value quantization. If not set, the default is 1.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"20\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `tabindex=\"-1\"` attribute on the thumb(s)\n*   `aria-disabled=\"true\"` on the thumb(s)\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"-1\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\" aria-disabled=\"true\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the thumb element's `aria-valuemin`,\n`aria-valuemax`, and `aria-valuenow` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"75\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"2c9246ec446246e8fcad54982848f7cd5839f69f","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.22.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.e27c5802f.0","@material/rtl":"8.0.0-canary.e27c5802f.0","@material/base":"8.0.0-canary.e27c5802f.0","@material/theme":"8.0.0-canary.e27c5802f.0","@material/ripple":"8.0.0-canary.e27c5802f.0","@material/animation":"8.0.0-canary.e27c5802f.0","@material/elevation":"8.0.0-canary.e27c5802f.0","@material/typography":"8.0.0-canary.e27c5802f.0","@material/feature-targeting":"8.0.0-canary.e27c5802f.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_8.0.0-canary.e27c5802f.0_1597950926873_0.9081406388164754","host":"s3://npm-registry-packages"}},"8.0.0-canary.f4532b9c8.0":{"name":"@material/slider","version":"8.0.0-canary.f4532b9c8.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@8.0.0-canary.f4532b9c8.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"3fa8a5b02d693ea62eab5d003c6713889b2d8056","tarball":"https://registry.npmjs.org/@material/slider/-/slider-8.0.0-canary.f4532b9c8.0.tgz","fileCount":38,"integrity":"sha512-Yxoh3fLc7eUGtxPP4SUZfgzlsFknYCdrkl9Z5Wgc5uUFV5Y7lbCr54pZI78muCDlGJm8488RoIjnsCvf2kzhLQ==","signatures":[{"sig":"MEYCIQD2WUZ6NoK57qEX8MmNhntkMJIl0Ft07q11TvKq45GtLQIhAJVfoYyfQQi5Wm91NTKk7buu7qWfxixe9cE2Z4TKVGwV","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":731552,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfPtXLCRA9TVsSAnZWagAAs9QP/1qUYSDsJVC1zeJTJwHr\nFwK4akhvJPX12xyErvDInXqMvL/NlhSrHDcIegACVNIqkp5/ufBIVxrCe9UZ\nQZ2mAS5mnOln2O7PM5gsy6DR4aRIaYlp1lG7YTe2b0FH2hm4ioAUJ+bz8jmM\nrUA169Z2Fh4TguVJJ5y8sezDI+YmrH0qw2kT/ougu82wEl/JbpT2pnpG/S7b\n2Nf/d5vOnWl2Hw5FVRFxi4I0x9nd0QWfhGXJ5WGltMIrFUApitvd1jTLldph\naYMbNTLSHYnZzi/KRAEaw9z0usaEUpBVZMKFDRw8NNXHqa0On6NYDvnfpOdJ\nXGe3psERjLcqrmhrAIfr+T1G5tZD/+HksRyTlp0ESwamDMtXxG4MmZB6GcVy\nhbGD4rCqgiQQ3JRKLbgxyabkwTxkkebQ/L9sTs8lX6E9TVSu4a7NOqneuAdt\nvuBjvcg9qS8snefBoaMxH8qn/UMDwYSBtjXkBYlmF8FCgVUF0Di3btnQ1pOe\nZ5eLmzvylmpcO0//JcPHMnxER7HQuUnafAdNcnuppI/aFPwDY9q9CFpciSFU\n5qr4LDiJND7hRZgsUHwjjFWFoxDIpMwB6wnlCAAk9U3uQyNGfvoG8TAkphUW\nSVKYJ/9s/bCyNqGQ/HEdhGJ+oDOYaTmpSO7B8AmhciM20DR8qxQT9MiqUogd\nKWx0\r\n=rGfn\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is modeled after the browser's\n`<input type=\"range\">` element.\n\nSliders follow accessibility best practices per the [WAI-ARIA spec](https://www.w3.org/TR/wai-aria-practices/#slider)\nand are fully RTL-aware.\n\n## Contents\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\"\n       aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   `data-step` attribute on the root element. This will be the step size for\n    value quantization. If not set, the default is 1.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"20\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `tabindex=\"-1\"` attribute on the thumb(s)\n*   `aria-disabled=\"true\"` on the thumb(s)\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"-1\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\" aria-disabled=\"true\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the thumb element's `aria-valuemin`,\n`aria-valuemax`, and `aria-valuenow` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"75\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"be56493a06963f21f1f5343fc6db3accdc74216d","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.22.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.f4532b9c8.0","@material/rtl":"8.0.0-canary.f4532b9c8.0","@material/base":"8.0.0-canary.f4532b9c8.0","@material/theme":"8.0.0-canary.f4532b9c8.0","@material/ripple":"8.0.0-canary.f4532b9c8.0","@material/animation":"8.0.0-canary.f4532b9c8.0","@material/elevation":"8.0.0-canary.f4532b9c8.0","@material/typography":"8.0.0-canary.f4532b9c8.0","@material/feature-targeting":"8.0.0-canary.f4532b9c8.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_8.0.0-canary.f4532b9c8.0_1597953483275_0.5245104557778875","host":"s3://npm-registry-packages"}},"8.0.0-canary.fbf73c2a6.0":{"name":"@material/slider","version":"8.0.0-canary.fbf73c2a6.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@8.0.0-canary.fbf73c2a6.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"d0431942ed6019ba0340218dc09de03348132d1f","tarball":"https://registry.npmjs.org/@material/slider/-/slider-8.0.0-canary.fbf73c2a6.0.tgz","fileCount":38,"integrity":"sha512-Y9iF4gfXOF/w5obIxtsUVQQ+0KWmJ6rvhDP3fZb+p86fgOSzYtqe9N8pkwEPq6zDGpOEYPHZmwx+XMtWbxo3aA==","signatures":[{"sig":"MEUCIQDmM4bu5tQSHjqnnXjuV5eH/mMP6qK/81mwJT1JKZw9IQIgGd2dhYw/t7Q5SiVmsrJx7elZKmaCuvIZBh1PAnqyKPs=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":733328,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfPuXoCRA9TVsSAnZWagAA5JwP/3ilI+YGd28QBmWrWq5S\nO1VHbbZS05ZuNEVxU2ICmUvchnhxs0tcFv0DeRiXZHxJJhVAbxNS+rDS5qBf\ncA9iLeHsO5wTrs8L7R4kjt4EWYLJ2/euXqhbkaEgjDKMcuvlmJxGMNA1K1T8\nFXnw2Xj+CKd1dOSDq7eqDIAUz9gYhQIlz8czFlNmZbmlRYQC3cA3v/JCFrro\ni/VNkFQwuHmaOUOPT9L/v6hEj8ALTU2Fq/n7xy8BKux9wiv0MOjSD21BzjFn\nEvtu9LvBd8k1xHHHRlWQ6+exlgdFe6hewZo5YNalXurNQLtbhzdscTKAX18U\nlpxS/kzQZvsXtaCmdVsWOPKNHj5epCAqYbkSJr/+voPdkKoNOzkD1NiP4x7/\n9zRtMRSQ5/sHj2k5W6Xc6LuoXSNLjQQVqpAvMt3j+vZnNPv7cV860PR5CA1J\nPqceQVoq4bcE6Y/CR579gN3mE2GG2Ggkkbsp+/PaGsEvCC8ImYlQDgbXFkSK\nawHX9T3ArklWvvF6fZwfQ/X2PE9SQAAlTLofr5ObU4ZZ3oQb3OFgus3ZmK9Y\nMiwrDokPu7OD8Tvb3kDtRe8w+Oab4NQnKelI41FV0+rDe6dqlkglBO8DNbmg\nhLRgzBxJxa04QpUZa4LTk2Gh0mizoL7I7/fMHn0X9cotV4wFXDZASg/+S0iJ\nMEug\r\n=vWWi\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is modeled after the browser's\n`<input type=\"range\">` element.\n\nSliders follow accessibility best practices per the [WAI-ARIA spec](https://www.w3.org/TR/wai-aria-practices/#slider)\nand are fully RTL-aware.\n\n## Contents\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\"\n       aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   `data-step` attribute on the root element. This will be the step size for\n    value quantization. If not set, the default is 1.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"20\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `tabindex=\"-1\"` attribute on the thumb(s)\n*   `aria-disabled=\"true\"` on the thumb(s)\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"-1\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\" aria-disabled=\"true\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the thumb element's `aria-valuemin`,\n`aria-valuemax`, and `aria-valuenow` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"75\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"64db59647b6d726098d0871993ac5c563d92be26","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.22.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.fbf73c2a6.0","@material/rtl":"8.0.0-canary.fbf73c2a6.0","@material/base":"8.0.0-canary.fbf73c2a6.0","@material/theme":"8.0.0-canary.fbf73c2a6.0","@material/ripple":"8.0.0-canary.fbf73c2a6.0","@material/animation":"8.0.0-canary.fbf73c2a6.0","@material/elevation":"8.0.0-canary.fbf73c2a6.0","@material/typography":"8.0.0-canary.fbf73c2a6.0","@material/feature-targeting":"8.0.0-canary.fbf73c2a6.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_8.0.0-canary.fbf73c2a6.0_1597957606653_0.3408190899213841","host":"s3://npm-registry-packages"}},"8.0.0-canary.cf800124f.0":{"name":"@material/slider","version":"8.0.0-canary.cf800124f.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@8.0.0-canary.cf800124f.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"0d47cb84a578102e3a22cda6f83335ae503e8e73","tarball":"https://registry.npmjs.org/@material/slider/-/slider-8.0.0-canary.cf800124f.0.tgz","fileCount":38,"integrity":"sha512-vKvvEqijmEzwLJ63BDehe22DCm/bdAPbrsIu3FgTKS5No4sE3z33PZwb21r81hdMj2M12CfaXKB6f1AvHpkWmA==","signatures":[{"sig":"MEUCIQC18poTk6OAiNtDvx/Hl5kG5aARprzTJnGDEPhG/0FwrAIgDr6B86q/xG2tOb6Q590BvhKrX9a/UV7yMdG8xocwXlE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":731552,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfPvC2CRA9TVsSAnZWagAAQKAP/0ZfAY+IywOZoyjizoTj\nG0c/u1kRQPJOOS+9JCkv76HtsSSR4hgmlitUVIZP/AUK6+orJPbAileAn+E/\nBVJ+tjHflZDW979pC1meEp04tbdsa4Mfil5ByjumEuT0OK5SRpcDZD/bNkoq\npF6pW3lp+r4hh0LIzUXRn/sD3ZuuDo7eUItjMQ8o3658yWqB4BXNWq6SFNia\nufkocwxhpDFxqqgKGZi3VElb3O1OJodw74imX6Z3BhWGQV54BOnfhQ/ukRmj\nX5FZFIoFNbdfm36Mul9ABD+0PVn3crb4pWK9SEvkkpOwfHyyIj7AMP9uojXW\nEVVHkcK0umDpKbnqdqOW7L9xxE/3dR211ep6yjSN3z1UtsG15vHZopSboKYu\nHTTicYD1+W7rb3oHdAeOQ56CQcZSNSsZR3FjhK839C7TcT1YTjopdor4preW\ncSssg5Z9wS0D+hz2mHikkQSycVAM2VL2xm4OFPmahMXV9b5z8vbUGNpqsap2\nNk2tsGa5DCtkp6iL2RnmtVAqb/Be0NL0p6HjMs0pYw5yECf5AB7FxNxkAlG9\nULEdv8NqXRgK71AE9kAhXzuV+p7XJ4VGLkw0r7hW4juoFbm+9a0K4jY/FDNu\nMUhXsvl+zOxOeFTiO476mmCX5UTNndTLa98hJRdAB3saauYfcS1t6N+bo0ax\n+mYt\r\n=Svv4\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is modeled after the browser's\n`<input type=\"range\">` element.\n\nSliders follow accessibility best practices per the [WAI-ARIA spec](https://www.w3.org/TR/wai-aria-practices/#slider)\nand are fully RTL-aware.\n\n## Contents\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\"\n       aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   `data-step` attribute on the root element. This will be the step size for\n    value quantization. If not set, the default is 1.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"20\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `tabindex=\"-1\"` attribute on the thumb(s)\n*   `aria-disabled=\"true\"` on the thumb(s)\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"-1\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\" aria-disabled=\"true\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the thumb element's `aria-valuemin`,\n`aria-valuemax`, and `aria-valuenow` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"75\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"b15bab8ce97a47831c29a3b0acf1c34e0533b8e5","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.22.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.cf800124f.0","@material/rtl":"8.0.0-canary.cf800124f.0","@material/base":"8.0.0-canary.cf800124f.0","@material/theme":"8.0.0-canary.cf800124f.0","@material/ripple":"8.0.0-canary.cf800124f.0","@material/animation":"8.0.0-canary.cf800124f.0","@material/elevation":"8.0.0-canary.cf800124f.0","@material/typography":"8.0.0-canary.cf800124f.0","@material/feature-targeting":"8.0.0-canary.cf800124f.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_8.0.0-canary.cf800124f.0_1597960374238_0.1798822980316872","host":"s3://npm-registry-packages"}},"8.0.0-canary.95e4eeea7.0":{"name":"@material/slider","version":"8.0.0-canary.95e4eeea7.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@8.0.0-canary.95e4eeea7.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"c52a8adac37c9c43996cc44e185d3ae620f56310","tarball":"https://registry.npmjs.org/@material/slider/-/slider-8.0.0-canary.95e4eeea7.0.tgz","fileCount":38,"integrity":"sha512-ix9iK0rUGI8wzJAI09P+Zvx49DvXugE1xChk8F+TsqF+6JRIzD5TgMA4yHQ9VDnm2fskUXAoq9VsVMR9qd5XWA==","signatures":[{"sig":"MEYCIQDfa21ogIydncFa5+DMfY14Q4ZBC98s2Y+4fgxq8NRT+gIhAI9A/yxCWXlgJZNGBw76sZKdiwAygbS7BIOGDC12ygwL","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":731552,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfPwdGCRA9TVsSAnZWagAA+UQP/jkW2R8+cLUkJjSWsTbL\nOsiLO00Y/w6cgz1i0LMf6bm6RlKQi6awKE0vZOVAsQEF0vRPIYnVi71CY+GY\npugHDpAKnJBZDda5y3lCjVN7ak8emADSYLOCdqmH3XtOMnNoflXWu5g93bHL\nddHwsZFS/IhfoeM7+M4sCIP/cLppVauTCVHuD4UteEht75Z8lq7vJoemyXrV\n9LQl/QXw3So3pr9DveZ71AHHl66gHJIHttBVGbHPeUZ++nFmk3WTxaEBmQYR\nkAKRS5/UsG0RyvdWiKaNXWhsDzfm+EKWYyMPpkxOq6Cbj0dNxPOozTdYrl1a\n68yWPYzMIwZvswWiFwahYQOYrhTS45C0s+0h5aMqPpC8ifZ2BkJw8J+xACa6\ngOAi+CnOvIZ4T7Ugc+N9Q4bWtmxHnSX6JgelnWDrdQxUvW+qPj3LnblN2q71\nZc5iD+8HO6loxaja2Q/mKPM0EqbbjJ8EUf9dX9S+Pv7PFEujCf103qWzcAz6\niHli8jECSsILW9xwAHXmDQcnB7Rr33CcUracirVe2EJMGs+9tCla3zKAsWn2\noIuWfZQNB51193UwFp9k6RMiDTG3s9XebEwC7BXy0U0Grg1SZrqBO/YL+fxK\n+SU/Fi9OPtD9aPxwMsfws66c1KKH93FpdYzsl77IBe9yQeNoAUz8uSTDSGaH\nVxyq\r\n=oMSH\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is modeled after the browser's\n`<input type=\"range\">` element.\n\nSliders follow accessibility best practices per the [WAI-ARIA spec](https://www.w3.org/TR/wai-aria-practices/#slider)\nand are fully RTL-aware.\n\n## Contents\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\"\n       aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   `data-step` attribute on the root element. This will be the step size for\n    value quantization. If not set, the default is 1.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"20\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `tabindex=\"-1\"` attribute on the thumb(s)\n*   `aria-disabled=\"true\"` on the thumb(s)\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"-1\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\" aria-disabled=\"true\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the thumb element's `aria-valuemin`,\n`aria-valuemax`, and `aria-valuenow` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"75\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"be1ca8dd4a02de91f796aff6f2a9fa745f02df13","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.22.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.95e4eeea7.0","@material/rtl":"8.0.0-canary.95e4eeea7.0","@material/base":"8.0.0-canary.95e4eeea7.0","@material/theme":"8.0.0-canary.95e4eeea7.0","@material/ripple":"8.0.0-canary.95e4eeea7.0","@material/animation":"8.0.0-canary.95e4eeea7.0","@material/elevation":"8.0.0-canary.95e4eeea7.0","@material/typography":"8.0.0-canary.95e4eeea7.0","@material/feature-targeting":"8.0.0-canary.95e4eeea7.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_8.0.0-canary.95e4eeea7.0_1597966150337_0.8692801385354345","host":"s3://npm-registry-packages"}},"8.0.0-canary.91ab1c62a.0":{"name":"@material/slider","version":"8.0.0-canary.91ab1c62a.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@8.0.0-canary.91ab1c62a.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"92e78b3a38ed46995a9b31e040269cfd344f3dbd","tarball":"https://registry.npmjs.org/@material/slider/-/slider-8.0.0-canary.91ab1c62a.0.tgz","fileCount":38,"integrity":"sha512-16QxU9bg94s8OW3g8G27r1jSWz0Aju8DvIS83dktwAydhnMmo8UNx/yvQ9s1mhHpcFKHRlIdMCy0UGjyUgZ/lQ==","signatures":[{"sig":"MEYCIQCssL6yH1N1+cWvu9L/fvKwDGWBVYFhz7AVJWUgpxuWwgIhAPlNFctn3qwqY0EVjpSrdFSe+uN3xquS9S7rZPTCPu/S","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":731552,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfP+RECRA9TVsSAnZWagAAggUP/RqDNZ7D0zL38FZDny6v\n3ux/6zugTHd+5ZGoQm1htZD3M8+4lErOgrbD9AC7WcofznzGvfxpIvp/BFqJ\nM1BBK8jIbINmIuuflaTlusyCZhy2FU4/XidkooG5duO9OE+4sJTw35CHAbAD\n3rFNIkLcmvP89WA5t/npfddx+gV+BNq+WKlZaad5mZKIRESWlKd6y5rHVZCw\nyaPitJWw3j8QluANGTSPw4ErLBEJrvpZ6KBHsd+UTNbm4pQ/johVzp+XiaaH\nUbb+1rewk+R7NAX/nsZGzW0zg2gVlD4mYeZ5pefbZnVVh8JrLDpS/uLuYuFl\nAYHJixiwQxBvzFscXcxhm/wmLwcISDrYzHtPlTflEdNKr9o4diNktiwL5Z87\nRlgYPHeuLPKN7Oz8F5docbcegwE87P8h5ltVXX9YgyOOsXknoAs+6i+uZSbv\n0MKEkePP25MF7iO0Pappf+vwqSkoh6gT51gIxZad4ipp1fHeJ9CwUE+YhRm0\n5zwHOPyEe0e2/HJZzIT1Z5fC8ZRHlzPKKp2L7+nu1Qi9Irq8mTDF+ZhSugQS\nyox20guteJfEiqd3vaHoRQoYFsILRUt6mtgmIb3OfC2vaDn6H97UNQGuNJqI\nqGRN4EwNj98+yK1lhqVE1ALptWLuqdcFpWUq8sniMOQ3Brhyt1XPCrD3yKAz\n9ltF\r\n=5suD\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is modeled after the browser's\n`<input type=\"range\">` element.\n\nSliders follow accessibility best practices per the [WAI-ARIA spec](https://www.w3.org/TR/wai-aria-practices/#slider)\nand are fully RTL-aware.\n\n## Contents\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\"\n       aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   `data-step` attribute on the root element. This will be the step size for\n    value quantization. If not set, the default is 1.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"20\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `tabindex=\"-1\"` attribute on the thumb(s)\n*   `aria-disabled=\"true\"` on the thumb(s)\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"-1\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\" aria-disabled=\"true\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the thumb element's `aria-valuemin`,\n`aria-valuemax`, and `aria-valuenow` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"75\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"389b1e8f2b60ae90730087557ec80e133f0e0129","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.22.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.91ab1c62a.0","@material/rtl":"8.0.0-canary.91ab1c62a.0","@material/base":"8.0.0-canary.91ab1c62a.0","@material/theme":"8.0.0-canary.91ab1c62a.0","@material/ripple":"8.0.0-canary.91ab1c62a.0","@material/animation":"8.0.0-canary.91ab1c62a.0","@material/elevation":"8.0.0-canary.91ab1c62a.0","@material/typography":"8.0.0-canary.91ab1c62a.0","@material/feature-targeting":"8.0.0-canary.91ab1c62a.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_8.0.0-canary.91ab1c62a.0_1598022724415_0.6350364866749914","host":"s3://npm-registry-packages"}},"8.0.0-canary.58eaa9f02.0":{"name":"@material/slider","version":"8.0.0-canary.58eaa9f02.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@8.0.0-canary.58eaa9f02.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"5eb50d21799fe77dcb27d242ebbc81b4fe53c427","tarball":"https://registry.npmjs.org/@material/slider/-/slider-8.0.0-canary.58eaa9f02.0.tgz","fileCount":38,"integrity":"sha512-aN1mA1OraGQaATXSztkhVdGvzhTc27OsYjOAvXbBOzKV8UOZa9AmEaIX/rn+QDA9HNEcAgCsN8glWkKPBOr4Ug==","signatures":[{"sig":"MEUCIQCP8XNScako+2o4GhyE+GWvZ2iDBjigDZeqPulAOWVokQIgehhOIHIaB2BFO74ZxkwFD3NN7iKY8bjzFA+7JZg11zg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":733328,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfQCfpCRA9TVsSAnZWagAA/RkP/2EKbnVdJqtmtFZKYKXH\n90oTVsc/f4HtYcf9kwswXEJ51gLIrEu/qfJWteeQH/osk4ACaVuYMKI5x14y\nUvY1VEG9OnLake+Q3TRdHtxsERYVGGJbvQmtypj6D9zPmxmk04YkBYt6YUmL\n8VOPHiJNRb3kMZgFdWF7GR6RlDzNgbaXO5uqGP7lITSFFJVQjkXq49MH3p2q\nfZHLgBNH+PgEg91kLdqyFusFG6QZwQkdWg38LXxQOXObQmbVDhyFtXG0Osjq\nACoTfwly22GJ64xOjSxMEhuSTYFVJW005aBseyxmllrqhniZezW1nePIGYTI\nog5vyUiPjL3c6BwX1074MaFAtKYHhNxwXEsn+KL+IdaiWLMra89eyO8JTOPa\nz0AFFMvPL3Vz0xVfgzkMp9Tgu/+hwKYjdLsqfS/b5VK+YskexZ6z5CYeKCX4\nqsisIAFjhRCXKT749Z55QxVQd6R+q4CSi4d/TR3i1mRKnZ8hVSLg6lUVUVmn\nmGpeBurnVgQZikBnxGMWnZKU+Zq+qNUaWKMTKV2goxnLXnTaQ8KscQqR2QJR\nel58eecf7846jZie4RpLMXt7eiZJI9Kxeu9+0eZGjVCnw2HgtPzdcqRHzxw+\nJLPyONRYBAG2ob8geqWbRfmUG78yBwUUXH4Hwd+cd0zGZEQObn/rVKmfby3W\nL/mA\r\n=hmVS\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is modeled after the browser's\n`<input type=\"range\">` element.\n\nSliders follow accessibility best practices per the [WAI-ARIA spec](https://www.w3.org/TR/wai-aria-practices/#slider)\nand are fully RTL-aware.\n\n## Contents\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\"\n       aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   `data-step` attribute on the root element. This will be the step size for\n    value quantization. If not set, the default is 1.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"20\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `tabindex=\"-1\"` attribute on the thumb(s)\n*   `aria-disabled=\"true\"` on the thumb(s)\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"-1\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\" aria-disabled=\"true\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the thumb element's `aria-valuemin`,\n`aria-valuemax`, and `aria-valuenow` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"75\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"9f3944d638392fa39379eeb30bd7348c9578f67b","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.22.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.58eaa9f02.0","@material/rtl":"8.0.0-canary.58eaa9f02.0","@material/base":"8.0.0-canary.58eaa9f02.0","@material/theme":"8.0.0-canary.58eaa9f02.0","@material/ripple":"8.0.0-canary.58eaa9f02.0","@material/animation":"8.0.0-canary.58eaa9f02.0","@material/elevation":"8.0.0-canary.58eaa9f02.0","@material/typography":"8.0.0-canary.58eaa9f02.0","@material/feature-targeting":"8.0.0-canary.58eaa9f02.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_8.0.0-canary.58eaa9f02.0_1598040041229_0.792532893531537","host":"s3://npm-registry-packages"}},"8.0.0-canary.238216fc4.0":{"name":"@material/slider","version":"8.0.0-canary.238216fc4.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@8.0.0-canary.238216fc4.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"44d18e11fc9dd620312f728cc4bfb3074a02384e","tarball":"https://registry.npmjs.org/@material/slider/-/slider-8.0.0-canary.238216fc4.0.tgz","fileCount":38,"integrity":"sha512-UuwcZVtZu13St6TQBKr6xn+Zc7wEhwgiqkNMfTqtfegVfDlWFW+4cDKesbftLMBhZAu+wAx/E104x6UFREtl1A==","signatures":[{"sig":"MEQCIEGYydjKP6PbP4lQ5xbQxmvSvJSYEZj++XR0m4V+JYiVAiAGUPP/Mi/m+ZRXTsqhkX+899DYLkaO/EjTD1Y2n9HO5A==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":735005,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfQ9+WCRA9TVsSAnZWagAA3lQP/RN2FPHzSn9b4D282B0h\nFkZFOxXimKyi4kVuCg4CYpy1i/1IJjjDAxurR7rPQUqq319/ClVE5kxw99Pk\n+FYwn6E06oV2m+dZcN0bYaRK/Qwm/0xQWssZ9K+nm2BzlsVXVS7euzhLT38i\nZOOYv2u84j7SW0SNqkQ2m6FkR6W1T167JzxG2R11OOBZm/otjC9NOGEwag2I\nqkrpRfAz/XEzLDaL7iNIFvgeXn82TewSqr+fjfWZi4qua0bsSbKShrsqZcnu\nGxEYd/RNjdRL9aDcHOXYHO6Crfn4GRGZlYlw7juP5Y6keRQNv0HFw8kCMiYC\n+qlMlOtf9UyLj3JwT0F77Y8ilklp9jOyE+vYFwkbpM02txaXJW7DDqKw54pN\n+DNPKJhP++u6H3d+Cc9JJ7MJFSUtx5Vj4Gwax6pyWnV+NThNz8Uikim/L+at\n1N8JFEkVfs1x5SMFU2BK7mYAlKXZgyj5J2zvNq1nfVKw6BYuMKyCasqvX7AZ\nsBoTkKgNGOkGsRB69I7sczbWfpMozOhw84t8rR4zcuIl9aCXVWqRs4/SfSHg\n7BYwapU+8kh6Ipt7/uwmowxgGmdmXaLwOibnRh43g61/2QvqDideRQ2C179h\nj4P7Elqcao97KrDEAeDC4mj76wowuH9JfM9eStu2NluVJZWo9/l4OPIGZAjW\neEKt\r\n=QX+F\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is modeled after the browser's\n`<input type=\"range\">` element.\n\nSliders follow accessibility best practices per the [WAI-ARIA spec](https://www.w3.org/TR/wai-aria-practices/#slider)\nand are fully RTL-aware.\n\n## Contents\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\"\n       aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   `data-step` attribute on the root element. This will be the step size for\n    value quantization. If not set, the default is 1.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"20\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `tabindex=\"-1\"` attribute on the thumb(s)\n*   `aria-disabled=\"true\"` on the thumb(s)\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"-1\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\" aria-disabled=\"true\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the thumb element's `aria-valuemin`,\n`aria-valuemax`, and `aria-valuenow` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"75\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"e224b287e176f866661b15e2ee791e17fcc44aa3","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.22.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.238216fc4.0","@material/rtl":"8.0.0-canary.238216fc4.0","@material/base":"8.0.0-canary.238216fc4.0","@material/theme":"8.0.0-canary.238216fc4.0","@material/ripple":"8.0.0-canary.238216fc4.0","@material/animation":"8.0.0-canary.238216fc4.0","@material/elevation":"8.0.0-canary.238216fc4.0","@material/typography":"8.0.0-canary.238216fc4.0","@material/feature-targeting":"8.0.0-canary.238216fc4.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_8.0.0-canary.238216fc4.0_1598283670274_0.7641640584009648","host":"s3://npm-registry-packages"}},"8.0.0-canary.a1c65593d.0":{"name":"@material/slider","version":"8.0.0-canary.a1c65593d.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@8.0.0-canary.a1c65593d.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"a3bf49a2cefed0eeded8b8aad565dddb864f3d06","tarball":"https://registry.npmjs.org/@material/slider/-/slider-8.0.0-canary.a1c65593d.0.tgz","fileCount":38,"integrity":"sha512-o1ndVTcFC2Y2IWZZ6lJp6P5pUDz5GZwS1rKORa+Ytf3efBwkRPhs90HHJs1MKdnzAIR0vup1jZdRgFfxNUfZ1A==","signatures":[{"sig":"MEUCIQD7W8W42TCqNt+e0K7GUw+wKsbdC9xmeYI6v+y+WtfAgQIgMtR1V73/gnQOLBUFm3NO2jq742YCgj712z3DpOp+1AM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":735005,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfRH+pCRA9TVsSAnZWagAAfvEP/juxYT/V53dsogmP8ysU\nD+ZJyxrtdzrqjv6T87hlA4hvQd20xGb9wOT4IB6wMS6vs88HMyWZJfa1cBkX\nnnHt6ER1W/b2FLzWHBYtcSJ1GPj7cPl+WE5xc3o0TlFJUAQk+B384EH2ZtYG\nMY42WMFg2RFg+9OiPCF6JeN6efRLrrDuGNPwI+N8WZBzJa1Ggs1p2MCc6qKP\nG5qwhxdy8tlIU7qer/6qcCY/MASzTlffcyZD/jAOioE/GhT67WqAztXjwz0J\nsBgueM2ju81H3WIt2F+C/UEUMvMzeP8wmij+mazpfadYrIHP/Z/xLIHK58nh\neSzOOD4+IO9I7R2LWbxyazVia+Wx/DmVrA/JebdLecEoBqn1O+sq/6Hy5I1+\nsocc2GMMxTOsKDe5Q++iSsFHx5dEcxHn3piB1/7t/LMg53k+PeDQddUNo9p0\nOj4yR5QIAIFS0lbVm9fsCTCZu8S+LN4gGqz+7TRvqEodi5820JyjbXjBujWb\nMGvxUEtPg/8vZWXSVjqFuF6RiRjmXFtWmKHXSKUi0HXbURZ9JwOCxCECDQbG\nx6xNNPDym5qRPki1pYBRldu3Gf0aVfgnjx/RoMaFO4u5lwz5+Ig+3x9QLGtq\ncduOh/MHuJM5rzc6qWJGxsm2aBwbb7XuTAayE6ixwV1FNCj/V4W6H5CUMt65\nhXpe\r\n=NLzY\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is modeled after the browser's\n`<input type=\"range\">` element.\n\nSliders follow accessibility best practices per the [WAI-ARIA spec](https://www.w3.org/TR/wai-aria-practices/#slider)\nand are fully RTL-aware.\n\n## Contents\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\"\n       aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   `data-step` attribute on the root element. This will be the step size for\n    value quantization. If not set, the default is 1.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"20\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `tabindex=\"-1\"` attribute on the thumb(s)\n*   `aria-disabled=\"true\"` on the thumb(s)\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"-1\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\" aria-disabled=\"true\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the thumb element's `aria-valuemin`,\n`aria-valuemax`, and `aria-valuenow` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"75\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"71fc6b5e7b16ba7f6d37b724ad4982780c9c9932","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.22.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.a1c65593d.0","@material/rtl":"8.0.0-canary.a1c65593d.0","@material/base":"8.0.0-canary.a1c65593d.0","@material/theme":"8.0.0-canary.a1c65593d.0","@material/ripple":"8.0.0-canary.a1c65593d.0","@material/animation":"8.0.0-canary.a1c65593d.0","@material/elevation":"8.0.0-canary.a1c65593d.0","@material/typography":"8.0.0-canary.a1c65593d.0","@material/feature-targeting":"8.0.0-canary.a1c65593d.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_8.0.0-canary.a1c65593d.0_1598324649225_0.12339201368858","host":"s3://npm-registry-packages"}},"8.0.0-canary.708cc09c4.0":{"name":"@material/slider","version":"8.0.0-canary.708cc09c4.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@8.0.0-canary.708cc09c4.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"274a2928c2a473add3654c1fd5aec4f83d4402d1","tarball":"https://registry.npmjs.org/@material/slider/-/slider-8.0.0-canary.708cc09c4.0.tgz","fileCount":38,"integrity":"sha512-WpFGEQd4a10knhcMmNkEJxd0n800JBB0LOkEsUCKUkxciuA6H3ZbBolMRT7XpbDg7mkD16hWXvmqcezL/ORT3Q==","signatures":[{"sig":"MEUCIQCyquCHWiKddw5Y4WVYOA4pJA9UUGZCOV8vS4MqLZccXgIgSpwU7xZnSDXzilNtRAhdjBqkVxvjj0tnlPkB22cc0x4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":735005,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfRTS7CRA9TVsSAnZWagAAZ5AP/ApWREsVULZy73BY8vZe\no8Kc58MfnYgNoML89E+N0MWnYzce/duonV2P+o6MLwh8MAlvwi/ueAkYF3eB\nxbflmkqdQrItXLztjpqCm5EH67fflWCMSgUfHZl6aobGrxZWYhuoD4pDsVS1\nlatYyWo2Zo6ZaHIE9WuyVu3UhcO+jAAtkr3iM1b98p2oqSBeVMxaYssnItDA\nal02CDPUb1srvrW9/3AO5844zJ8JHogYUvoxM4pf9o47Vbsa8ORlZhSdDxei\ncbKg4jL/xCDNfMbUn5dWVjKfd0B4tSp2ZrZZZwOsFJ7qM8Tz2AwtTTd3dAgC\nvvOe1U+r4layiq+X3H/EUpHh1dQdHGDfyI4NniBocSwl1GGqY8Y/M31SYHVs\nfyc9FUz0+NwddsEOtNDbamTIAf+OSacHAF5yV7t6XvE+Vuw+YujV7NiDHYMM\n14EeP1CUoyX1I9AcJVTTazLqs3j4pVIJBhBK8ESMQbtXgC8/gbp/c3iNfYA7\nnt9NrSty4OywQ4yaI9sBs1DVoNL3FXedp7PM7hes/QdX2CNU1bkBIwveb+Yv\nGRrpgB0HlVM72VyhLjdr5j8cUpqP5LNsasV6vCwEbaA4GyFAxdohFCGsx9NN\nFU7XeTCKNq6yofksLRSLUPruXBdPvJBvfdYms/7YHVLefmKo2C2W+OqliVta\nSiMo\r\n=RLX7\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is modeled after the browser's\n`<input type=\"range\">` element.\n\nSliders follow accessibility best practices per the [WAI-ARIA spec](https://www.w3.org/TR/wai-aria-practices/#slider)\nand are fully RTL-aware.\n\n## Contents\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\"\n       aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   `data-step` attribute on the root element. This will be the step size for\n    value quantization. If not set, the default is 1.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"20\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `tabindex=\"-1\"` attribute on the thumb(s)\n*   `aria-disabled=\"true\"` on the thumb(s)\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"-1\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\" aria-disabled=\"true\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the thumb element's `aria-valuemin`,\n`aria-valuemax`, and `aria-valuenow` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"75\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"41353a40a8a6a80ac6438fa702cff9ca690b897e","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.22.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.708cc09c4.0","@material/rtl":"8.0.0-canary.708cc09c4.0","@material/base":"8.0.0-canary.708cc09c4.0","@material/theme":"8.0.0-canary.708cc09c4.0","@material/ripple":"8.0.0-canary.708cc09c4.0","@material/animation":"8.0.0-canary.708cc09c4.0","@material/elevation":"8.0.0-canary.708cc09c4.0","@material/typography":"8.0.0-canary.708cc09c4.0","@material/feature-targeting":"8.0.0-canary.708cc09c4.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_8.0.0-canary.708cc09c4.0_1598371003310_0.7568337714353368","host":"s3://npm-registry-packages"}},"8.0.0-canary.19bea2ad3.0":{"name":"@material/slider","version":"8.0.0-canary.19bea2ad3.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@8.0.0-canary.19bea2ad3.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"68aec7995807ca14da3db443d096cf64b2b377fa","tarball":"https://registry.npmjs.org/@material/slider/-/slider-8.0.0-canary.19bea2ad3.0.tgz","fileCount":38,"integrity":"sha512-Ef34wVnvj7nLPKtafRLmoT4NMWxORfaISkfNAL6UnlWWBhPyU/3WdmeR/YuViX357vPbGyK4q5U2ep/wtEsRXQ==","signatures":[{"sig":"MEUCIQDpb3K7jquRrd87MLH4WLv3+j23CI6mYE8DZ8KN9H75rAIgQ6Pcd5JPwSWuIXrdiOsS17/4kRysOxvyXJetFzBFkrQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":735005,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfRq7FCRA9TVsSAnZWagAAqk8P/iYX7IVWcGtHJxmlOwL7\nefXM3npYLH4jDyvcoUYkqJ/DnGXq4FksCVm6uK0SnbztcKCRcJtHzB0tks8K\nA1NME2hKZ3Nwe4OCRewwY60aqwfeU1r9fvHglI+lkWc7OinASGIWG7Tpnk/g\nPUtgama1zC8faxQVH90ZZnXFjlpy+eskAFOJYmOhjbZV+QQZPvBrNl3B+hOM\n42Hca/buUFOXKZoPgDv2ZM+xn5Oc7tMUHzTT/ShmZNv4uuodWpznyMij97DZ\n1YL+Edt16eUcdkNFk8p2XSnuMkGbJcVTpual5AHcE2tuS/3Ir1e3ZfnPb0aI\nlry6eHSRxmQ6KBmBOIOVn6U6enDd4oPZwQSp3nx3okn/fkfEw63nibpqFTla\nyLnilPHYtYHs9t20WT1UGtfkwa2y5n6H7VUFycuYYyLyN0eOs+kQvNXT2CXA\noFv+OnRGdovJ9IteNZC7H+6+dlnNLFcwHlnhxpeCdn74HEfUFd/WkQCZWsmL\ncW4+/D8HnPBdbFvGtwB6hYqiqHEtFFWpeEXOjf8JO/M1ceVoSQMpOPrZxiSJ\nJcBlDJ2lgIKT+8kTRQwP5Y5tCOOX1/ybyUg9eb9JqLrnisEKGpC8lkYA+PMx\nyb9bdObZ/PSO/9wyKZAgyR/3TWSJ9Aj1lW9r7aGpYzGC/pVTtdsvDnqdbLG9\nmlR8\r\n=3S5K\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is modeled after the browser's\n`<input type=\"range\">` element.\n\nSliders follow accessibility best practices per the [WAI-ARIA spec](https://www.w3.org/TR/wai-aria-practices/#slider)\nand are fully RTL-aware.\n\n## Contents\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\"\n       aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   `data-step` attribute on the root element. This will be the step size for\n    value quantization. If not set, the default is 1.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"20\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `tabindex=\"-1\"` attribute on the thumb(s)\n*   `aria-disabled=\"true\"` on the thumb(s)\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"-1\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\" aria-disabled=\"true\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the thumb element's `aria-valuemin`,\n`aria-valuemax`, and `aria-valuenow` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"75\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"4f1ed83b6a09dd3e7d24508d420cd99be9dd3893","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.22.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.19bea2ad3.0","@material/rtl":"8.0.0-canary.19bea2ad3.0","@material/base":"8.0.0-canary.19bea2ad3.0","@material/theme":"8.0.0-canary.19bea2ad3.0","@material/ripple":"8.0.0-canary.19bea2ad3.0","@material/animation":"8.0.0-canary.19bea2ad3.0","@material/elevation":"8.0.0-canary.19bea2ad3.0","@material/typography":"8.0.0-canary.19bea2ad3.0","@material/feature-targeting":"8.0.0-canary.19bea2ad3.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_8.0.0-canary.19bea2ad3.0_1598467781452_0.2552492334207901","host":"s3://npm-registry-packages"}},"8.0.0-canary.911014711.0":{"name":"@material/slider","version":"8.0.0-canary.911014711.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@8.0.0-canary.911014711.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"eb0010ab879d635bd9f7e68efc166a4f0e80f174","tarball":"https://registry.npmjs.org/@material/slider/-/slider-8.0.0-canary.911014711.0.tgz","fileCount":38,"integrity":"sha512-0OpBqxK8l8csJ/th3ejTaqUlENtMzdEJ3sAHu5TE5KbULhs2vExyVHMXwL93hzKWCItbnd93Pmyl25cdhZpjXw==","signatures":[{"sig":"MEUCIHjZJuWFM0JrfU4+kP50L2mfJHCp/oVpKEGoR9pdy/x4AiEA5TWVNRbRAtSJzLq7xxzQUAdoR9wp+kFMn41H4hSXrGc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":748665,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfR9p2CRA9TVsSAnZWagAAmuoP+wQndWUHe9l1WYZpLLnf\nwx4SjPmx/ZzcwvY7Xrh2VYWsy6Yarr+A59pINPZz/ybt/USfjdaM9M9js/GA\nAcw+C43aZGn8kMoTMEPsq4TUhQFQCfkvQrToSg3EK45Seu5/5yATJX5NoycD\noDrwVWB64YhE9eslYXvl9FKhNb/3GozMadSFxrdSUEl3ab8mCWnRkcB72PQY\n/Oa66T3NOpvCdhf2gdDKDljADreZVt7wkFjZ9aBisDy1B60s/V/SdosN9VgY\ness7zZhRB1Le2y5Z3i+WRrKNfCC5YB81R2KgOj/aiDwFVG4kGHdsvl8DqhM7\nOQAjYYmVgRqdc2soLYKM0eFhGp5K/gs2QrDg04gEZCEAdFL1geefExSLUjTR\nHqdZj4ofBfh1Fp5sNHf9S2VctQ6hLW2HuxQpXYwrG8kRF6Ff0oyczkNj50I0\nFZQHLKEFVPpKRX52w4tRsM68CQ45ekTu/ASiFMCiOOjP76vhu+tUdxbXWYuD\nWCOa51RumW0fFjC99Wu8rNRtwOFns6sOITWEfKJtq955wAAzZ996sBHgMeNu\nQIxLsmeOwIwHIDwAoH6faXKIciC1ykXfY/j9PxJV8sGtv7U+Zg95WpfU8kM/\n+raPnkMXQ77eOjLjAg/tdTxBkz8IHoOdA+yD2QTWHzMM7pox3ZTfbxo4tLb3\nHesE\r\n=8xGr\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is modeled after the browser's\n`<input type=\"range\">` element.\n\nSliders follow accessibility best practices per the [WAI-ARIA spec](https://www.w3.org/TR/wai-aria-practices/#slider)\nand are fully RTL-aware.\n\n## Contents\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\"\n       aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   `data-step` attribute on the root element. This will be the step size for\n    value quantization. If not set, the default is 1.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"20\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `tabindex=\"-1\"` attribute on the thumb(s)\n*   `aria-disabled=\"true\"` on the thumb(s)\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"-1\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\" aria-disabled=\"true\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the thumb element's `aria-valuemin`,\n`aria-valuemax`, and `aria-valuenow` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"75\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"e0563b839594887804244d231bec5f415812fc4c","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.22.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.911014711.0","@material/rtl":"8.0.0-canary.911014711.0","@material/base":"8.0.0-canary.911014711.0","@material/theme":"8.0.0-canary.911014711.0","@material/ripple":"8.0.0-canary.911014711.0","@material/animation":"8.0.0-canary.911014711.0","@material/elevation":"8.0.0-canary.911014711.0","@material/typography":"8.0.0-canary.911014711.0","@material/feature-targeting":"8.0.0-canary.911014711.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_8.0.0-canary.911014711.0_1598544502436_0.21910536126736546","host":"s3://npm-registry-packages"}},"8.0.0-canary.d3387f54c.0":{"name":"@material/slider","version":"8.0.0-canary.d3387f54c.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@8.0.0-canary.d3387f54c.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"31e98ce90cbe4d6c20643f4a9600cf06d49d50e4","tarball":"https://registry.npmjs.org/@material/slider/-/slider-8.0.0-canary.d3387f54c.0.tgz","fileCount":38,"integrity":"sha512-QrQ8BBNePetv2JYK+N2u+rHXFuVUeBrwoAi++3YEz64UndDNKY7e9R61A6DIwZNeTOYvvB1JfkffSvQeD3Z4Bg==","signatures":[{"sig":"MEQCIGZyXHZN+RnZcRjhUdZZWwYPYzK5jOxgoi5hRk36lFNgAiAspzGGT3NibzlW3B+BTu9YlriyPQ941in0Ch2XRFmyVA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":748665,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfUVhZCRA9TVsSAnZWagAA1PgP/0F5md0ctmmZibXdNPSP\nIEa0hzntwpMXuI5TyPxKzhPu8B2vn928fcBc+3w1l5coG+dCLAOEnTPN8SFr\nQx+tLW5dyz772tzp5qE51CD7RM5I5OzH+pKO+qRVFFetusSlGh2OWzEyT/Ke\nzjXfCt6gXSlvVRk312SimovZPZcAnReDRpWgvF392NzD4KfLr9ZcYZL5g9Jk\n1JkUCLAhcfBM22ju01xVugj/XmP1Euhgt2g8+UR7hKWM98eDou5MqPqTXQqs\nY9WKZ0Wocc68L3EkypCblGYgAxVcUJq9wcopQiAm3d0nMkPOX5dXf0Xkcy8o\nl2WlZ6DbeBwWTNzrF5+drP4OkC0PoR2z3rDoTE2aZT5XrtfTzehvvBU5w7Tz\nENt/l/lWMtjHkdqMQM3SPw3fyA/+nV2dXj6b7iRYAjkVD4kfvNyPBndHC+ev\nEuQGRinR6izpgI4Sw9Ejc80LBycHNYxCUcVnqg9puasuABsnGT4Zfsh33naL\nXMiO+b06R8N4Euf0Tjnb8FfIxGROMZeWvmHumVUjoMa+oj/4R+vBkTC/igKW\nQZtwYVGPonXnyRkI4Hw41lm6e122nW7WxumOaF2Z+vbL9em6h0q8DsN+IIj/\neP1jCTRO7Nn7pViLJXmInhe3d5nEeV0PNGyDjRUv0JFJsEqEC7OtXI4kon20\nNa1m\r\n=BD7Q\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is modeled after the browser's\n`<input type=\"range\">` element.\n\nSliders follow accessibility best practices per the [WAI-ARIA spec](https://www.w3.org/TR/wai-aria-practices/#slider)\nand are fully RTL-aware.\n\n## Contents\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\"\n       aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   `data-step` attribute on the root element. This will be the step size for\n    value quantization. If not set, the default is 1.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"20\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `tabindex=\"-1\"` attribute on the thumb(s)\n*   `aria-disabled=\"true\"` on the thumb(s)\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"-1\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\" aria-disabled=\"true\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the thumb element's `aria-valuemin`,\n`aria-valuemax`, and `aria-valuenow` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"75\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"b8c159d735641688e2fc1631ac7a98134ac5fbc4","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.22.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.d3387f54c.0","@material/rtl":"8.0.0-canary.d3387f54c.0","@material/base":"8.0.0-canary.d3387f54c.0","@material/theme":"8.0.0-canary.d3387f54c.0","@material/ripple":"8.0.0-canary.d3387f54c.0","@material/animation":"8.0.0-canary.d3387f54c.0","@material/elevation":"8.0.0-canary.d3387f54c.0","@material/typography":"8.0.0-canary.d3387f54c.0","@material/feature-targeting":"8.0.0-canary.d3387f54c.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_8.0.0-canary.d3387f54c.0_1599166553445_0.6644068911029559","host":"s3://npm-registry-packages"}},"8.0.0-canary.2ccf996cc.0":{"name":"@material/slider","version":"8.0.0-canary.2ccf996cc.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@8.0.0-canary.2ccf996cc.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"a6126dadefdd7957bee281b1a65c68335cdc57c1","tarball":"https://registry.npmjs.org/@material/slider/-/slider-8.0.0-canary.2ccf996cc.0.tgz","fileCount":38,"integrity":"sha512-lPx2RMnAtRbr4V+pJD2dHnew8rQant26hxy45rT3CIow/pbctHnDOObSv7vIZnz+5JUdwjNoZqZpRMhGvHcXFQ==","signatures":[{"sig":"MEUCIQCX1ZQgAErQSrmC+XuI2rZm8iF8x/aTxpGE4kzPJj4xpAIgd8b+qMddcA0DtiJRkfY3CT/vSfBBtf92aqHJFAhBPCA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":748665,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfUVhqCRA9TVsSAnZWagAAkzMQAIm53G/Bqw7L0zX48oTe\n+cXS/rZUEvfinB7KdUxqgrVYlBBVmzobYid/qNjMiQ0f6nAv2IXfCarwp7kQ\nfnF4cV3Y2iCyLKuZZzUsIH+nqM2LOiH4xE29RZv1Ux8vBbryyD2Q7XjcKpMt\nKEvJd5nrbKtHDWZpUvFz2SEJX9fH2wav96O7yZ4tQT5SWJRKjExD9M5Q8LFW\n77P5CrY7by5RUbeXI0mtwkdytXII7gV8Nn2yzvWKdx+12DM0/c6q9P0xrzoX\nGdMUtj1hvE3ImiDlo7B8ddhD26O8WDyHGtwjHk9RAxJWQtG9lXJokIvw6oES\nC7/rmluGv8ZzBbZst9tWSRA/YsZkdL2Tel8JEWrSdoclQNhW2xVe5xIIbeGK\noVRxtVDVu278KhQzrEOzKqNBWuJPX42PVrBnvnAMdTl8ogBA9FGFhlnBxRj5\n3WQJyg7YLcLVMXD5TQVbaULNLNYUqjJAaa/LhPtJziZA0Lh20YAoli1fgBlw\nfMYfHs+sxg8X0L1Rl6wcTKkxknJMVi8zsvY5qFEodajLGXqzJH8Q9ZcW2DXC\n6kr8DeSJgVGNKnCm1Lo1rHuybMXe0pA4+GPXxjCM0/kVoWWlNEFodqnaNDR5\nO78T3RXyQ1+OpkeA2ZmmX8JfhRoDNFjoI6m1qz0xGgp76Tf0rq+EkHczwugF\nhXH2\r\n=8t29\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is modeled after the browser's\n`<input type=\"range\">` element.\n\nSliders follow accessibility best practices per the [WAI-ARIA spec](https://www.w3.org/TR/wai-aria-practices/#slider)\nand are fully RTL-aware.\n\n## Contents\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\"\n       aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   `data-step` attribute on the root element. This will be the step size for\n    value quantization. If not set, the default is 1.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"20\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `tabindex=\"-1\"` attribute on the thumb(s)\n*   `aria-disabled=\"true\"` on the thumb(s)\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"-1\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\" aria-disabled=\"true\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the thumb element's `aria-valuemin`,\n`aria-valuemax`, and `aria-valuenow` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"75\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"b295adf5299f65a654963fa774da90dad3e39244","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.22.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.2ccf996cc.0","@material/rtl":"8.0.0-canary.2ccf996cc.0","@material/base":"8.0.0-canary.2ccf996cc.0","@material/theme":"8.0.0-canary.2ccf996cc.0","@material/ripple":"8.0.0-canary.2ccf996cc.0","@material/animation":"8.0.0-canary.2ccf996cc.0","@material/elevation":"8.0.0-canary.2ccf996cc.0","@material/typography":"8.0.0-canary.2ccf996cc.0","@material/feature-targeting":"8.0.0-canary.2ccf996cc.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_8.0.0-canary.2ccf996cc.0_1599166569915_0.598233520532532","host":"s3://npm-registry-packages"}},"8.0.0-canary.744bfe5d8.0":{"name":"@material/slider","version":"8.0.0-canary.744bfe5d8.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@8.0.0-canary.744bfe5d8.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"486cff3ff9aebd277326035c83f2e9c56b405cc5","tarball":"https://registry.npmjs.org/@material/slider/-/slider-8.0.0-canary.744bfe5d8.0.tgz","fileCount":38,"integrity":"sha512-unz9dTHyefMXMz98oMCZwyvJcZwSwdjcIc1ZOpZnSNwuMJYqNwfT2cXkHq9OEeYIhORMRDtJeixTO9kCAb8FwQ==","signatures":[{"sig":"MEYCIQCFwZ+hhzMbYW2BiaIpnxDW4HwhJ5AsaXboGDRt24GaqAIhALcNLeGdwdKmkdtGmQkrp+gH6jM72d1xTfl6rA3qQhaN","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":748665,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfUViVCRA9TVsSAnZWagAAjDgP/1zCvEQJ6l2k9vdIxrBw\n56WCYGuIFraHA0Q00RiDkKSFeLj7tFoZ8BlIs+SXDNGlYKUvT6aBo45xSw9O\n9ifa1zzrJJNzD1HT4e0C0tJqQ7BjzW0J1Bp9DIUvpzqEMJlk1gFj7VunFysp\neipKR3CeKPLICMF4MRqwiJZGxmudDFvLyng4K10q1g1xqbSAcHasSsVmrmHZ\n7f5YnRb0WcdViwBSXN0qh0jcJplCBFgwGplKjMGiUGlF+15ZJjvTFMl5z1QH\nQ/TV2YFAR+8ALfbEQH7xyp/HCoREvopAf5kMOP1QQqKZpEX4RDVe2jped1lm\nlFzTXgAzdhB3aX80f1jgPBVIlJj8/nBM8ChFoIKj+Jh3zT4qseMyOObT3N1O\n2Dd+2pzOK0B+miG8zQZ2guPBYiEtWSanquJP4TEM+r2Si7n8vuhaWCNUMCG4\nyjHJSZ+g0T59I6ZSyGUPPe5JKaKk9TzA7cBXKAqntLp1yAaCWLFahP6aMEwf\n6Aj+g1mz6/VVb8dCdxBzZQzv97i3ggtr+NuwXpq1LSpoN26BlWAGAKT7Lveh\nn8mVSqP1CB3d8mMm2atACbcDid+IHYi1GlV1+h9iSI80f6tjWxIWS3pvjEd9\nhMCUqkM9SCnHt/W4xG5UR19UbUghS8OJXhXVvzfsu/MQ8IJ2/Jw3AHY1IwmI\ngp1x\r\n=ky2B\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is modeled after the browser's\n`<input type=\"range\">` element.\n\nSliders follow accessibility best practices per the [WAI-ARIA spec](https://www.w3.org/TR/wai-aria-practices/#slider)\nand are fully RTL-aware.\n\n## Contents\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\"\n       aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   `data-step` attribute on the root element. This will be the step size for\n    value quantization. If not set, the default is 1.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"20\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `tabindex=\"-1\"` attribute on the thumb(s)\n*   `aria-disabled=\"true\"` on the thumb(s)\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"-1\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\" aria-disabled=\"true\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the thumb element's `aria-valuemin`,\n`aria-valuemax`, and `aria-valuenow` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"75\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"e8e9d5605e05fdd50b88c6ce659dc2ddd8ba768d","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.22.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.744bfe5d8.0","@material/rtl":"8.0.0-canary.744bfe5d8.0","@material/base":"8.0.0-canary.744bfe5d8.0","@material/theme":"8.0.0-canary.744bfe5d8.0","@material/ripple":"8.0.0-canary.744bfe5d8.0","@material/animation":"8.0.0-canary.744bfe5d8.0","@material/elevation":"8.0.0-canary.744bfe5d8.0","@material/typography":"8.0.0-canary.744bfe5d8.0","@material/feature-targeting":"8.0.0-canary.744bfe5d8.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_8.0.0-canary.744bfe5d8.0_1599166612711_0.8822318153457764","host":"s3://npm-registry-packages"}},"8.0.0-canary.78da96eaf.0":{"name":"@material/slider","version":"8.0.0-canary.78da96eaf.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@8.0.0-canary.78da96eaf.0","maintainers":[{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"23dcbbcef42e46fdfb579ac09effb3b69068da74","tarball":"https://registry.npmjs.org/@material/slider/-/slider-8.0.0-canary.78da96eaf.0.tgz","fileCount":38,"integrity":"sha512-Gj7yFspk/vQ8tyOyw4r4v71pZUuoMfpDpWd5IsKhv/c9CsAutd0Ml9bTCUI+JEqCG9T9J/s1jQfbXH9aKK2obQ==","signatures":[{"sig":"MEQCIBiuCtBBzYVqJe8HzcfP+W2rRM4YP4yudKDPdHGRuWcNAiAsEtcWrziPsVStsRn2JuoJWVFxsYSQsiL8s9Z4N9ggRg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":748665,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfV9fGCRA9TVsSAnZWagAA+XwP/jUtyysRl8mcFLSDp7dg\nHCbsWEzP8F+e336FM1ts2deP0kFGoT5ogl9CjEB2fG2+GHj3ThuUTDs6yhUM\nsFYnCZdCKkJj+ZAaRQ1+4TJoyh3cHuhh2CrJQpdENxrGE+ujc3YACSL0EmKK\n5mnaKPV06VstcYX6f72lUa2+MVUtr/gYmMi1QLsl8JUC1vRJKTixOfymFbOw\nZsA/8hZrTEOe9FXfjgVj0iHBaCDQr72oDUfcsu8SJoOzZN9it2WiigShFmow\nZ2PpENjbk3XcWmgaf7Lc1damrh719tosI7vhleHCuqcPvEzgoPW15ZfSlv/G\nzOaon7gPd2N2ZGAg3xKgxpUoNeNGV2Vt4tCWbSsrxi+zYjZqLs46C4So2TZN\nX066+jEeIW/LrEat++7eEUUyYuKouYd/w9dziUPMGFf91b57+j9GQKOzHIeR\n+CR/MWqtipspw8ABCHTQkQSCedwhzt3eFFpl2ptRqD9DID9zT1wFDRlO6iU8\nFjvKEw0RvDCSNz0Kj3fZbEJQjJHhxyKEXsiHXz+nngyQp8oZ8ywdIUnSSpCz\nXs/o4gxTXZdtwTga6SevGz/37fria4oBxM3iE0Vb63L+5nFqJzxgtfMDHkpv\ni8EB3v1vJ/x8T6nz/lmzkXNrjKMghAoiy2vV+2NIlwKlPW/4gMX0cpQvmrtk\n8ULp\r\n=HLZm\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is modeled after the browser's\n`<input type=\"range\">` element.\n\nSliders follow accessibility best practices per the [WAI-ARIA spec](https://www.w3.org/TR/wai-aria-practices/#slider)\nand are fully RTL-aware.\n\n## Contents\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\"\n       aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   `data-step` attribute on the root element. This will be the step size for\n    value quantization. If not set, the default is 1.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"20\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `tabindex=\"-1\"` attribute on the thumb(s)\n*   `aria-disabled=\"true\"` on the thumb(s)\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"-1\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\" aria-disabled=\"true\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the thumb element's `aria-valuemin`,\n`aria-valuemax`, and `aria-valuenow` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"75\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"e9750a8b0ebee9367eee7e514953a1b1ac6fef7f","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.22.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.78da96eaf.0","@material/rtl":"8.0.0-canary.78da96eaf.0","@material/base":"8.0.0-canary.78da96eaf.0","@material/theme":"8.0.0-canary.78da96eaf.0","@material/ripple":"8.0.0-canary.78da96eaf.0","@material/animation":"8.0.0-canary.78da96eaf.0","@material/elevation":"8.0.0-canary.78da96eaf.0","@material/typography":"8.0.0-canary.78da96eaf.0","@material/feature-targeting":"8.0.0-canary.78da96eaf.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_8.0.0-canary.78da96eaf.0_1599592389724_0.8129806826814863","host":"s3://npm-registry-packages"}},"8.0.0-canary.b0ed593cc.0":{"name":"@material/slider","version":"8.0.0-canary.b0ed593cc.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@8.0.0-canary.b0ed593cc.0","maintainers":[{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"c513d93d6f72e5d50e35505f3a67b56a50f68e16","tarball":"https://registry.npmjs.org/@material/slider/-/slider-8.0.0-canary.b0ed593cc.0.tgz","fileCount":38,"integrity":"sha512-1rEhqTNY9kFQeF7i2YWVIhIHYMJW0+qoks310oHxKyNKDRgQomph69ZyPqQ4Xmilc5waaetR/uRWihClVOgiDA==","signatures":[{"sig":"MEYCIQD0TOflFs0KDQqQpNoU0J+Dy+elFjCrINMWvg00+TLW2AIhAIqBO5CR5/LJC2v2cA5iAWTCaxHUvBJw+HViTAfMisxC","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":748665,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfWHM0CRA9TVsSAnZWagAAXj0P/2+o1XJCBSwxh8kpGC9t\ngGtzQ4deAjm1HptQ91MnsgItEe7rRDqeFBTGiAfFHlsu1w9NY1OxgTu3Ha9t\np/PiyZH9lnoIzJc4GBt7ajTlTPbxXUBE92ybKNVRW/4bEsji4T3Npu1RZeWi\nL8LX45sqNlSYO0cEf+OSPMt4OkLH44k8vE03CKfVu/kzW9Jx3HrKC/jteUrJ\nUjj7WAlWSAQXwnKdhBMS4kwhTadwRG0aJ7jhfJq8gXwgJV4ZLs1HXoq8mGwz\nqWHZLPztRGY3iuYVZ5KhDob6nuDnorK4oX/y8iYJXKdTDDOc3nCO4Cug9vOS\nT/BH2RaRFwAENByxzfAN46qVGVeWDb74l7OeyEHxvhdazPX4BnsJauktKjHV\nZOM8SfNPTGDaKpO6pK5Ua+V6Zwcizhu2tjuOf6/x9PIasFnh35wOVqqMRkE0\nWQFBSeRLy6h4RT0lvkdKrG6eJkZ1gFyP9qe6ZP2c9htNbQ11zsaL6rCH2zEr\nC7Qr3beQD6LhDsZIXU1AySK8XdE/5S4KxBUxCsAEtM3E+71KEDUA/ybq5z7N\nIxI9Z2tv0YdFVAtFxEPKejjzZW5KnkvUJbuWdFpsEef5Vynra3b1JkpDaW4i\n6IBu5q5oOvU5IEf9Hx6hLJbjArz4+fNFP+fY+AKPmQ4H8uEUkPa6zQn8LpHW\ngzEc\r\n=xPm1\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is modeled after the browser's\n`<input type=\"range\">` element.\n\nSliders follow accessibility best practices per the [WAI-ARIA spec](https://www.w3.org/TR/wai-aria-practices/#slider)\nand are fully RTL-aware.\n\n## Contents\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\"\n       aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   `data-step` attribute on the root element. This will be the step size for\n    value quantization. If not set, the default is 1.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"20\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `tabindex=\"-1\"` attribute on the thumb(s)\n*   `aria-disabled=\"true\"` on the thumb(s)\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"-1\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\" aria-disabled=\"true\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the thumb element's `aria-valuemin`,\n`aria-valuemax`, and `aria-valuenow` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"75\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"d4dd3b56db446c52c35f891f9a19896a2b762f0b","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.22.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.b0ed593cc.0","@material/rtl":"8.0.0-canary.b0ed593cc.0","@material/base":"8.0.0-canary.b0ed593cc.0","@material/theme":"8.0.0-canary.b0ed593cc.0","@material/ripple":"8.0.0-canary.b0ed593cc.0","@material/animation":"8.0.0-canary.b0ed593cc.0","@material/elevation":"8.0.0-canary.b0ed593cc.0","@material/typography":"8.0.0-canary.b0ed593cc.0","@material/feature-targeting":"8.0.0-canary.b0ed593cc.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_8.0.0-canary.b0ed593cc.0_1599632180363_0.7304497177990692","host":"s3://npm-registry-packages"}},"8.0.0-canary.85a1fa9ea.0":{"name":"@material/slider","version":"8.0.0-canary.85a1fa9ea.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@8.0.0-canary.85a1fa9ea.0","maintainers":[{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"61895afbca0c26968582996c85b5ed1b4678af90","tarball":"https://registry.npmjs.org/@material/slider/-/slider-8.0.0-canary.85a1fa9ea.0.tgz","fileCount":38,"integrity":"sha512-60pStk2mkuFU9gYR/bA+1nRQZ+qM2U/ZOlkNO0lhyWUwx2USixgUBX3WIg9YNcUoGLWljp2tDtWIkBGTmsKNQg==","signatures":[{"sig":"MEYCIQDYzbbk8HuWtWtJXN1/mOSl3RKx/UwqYoVnwN4cu4kOuQIhAIRYAJUrQI6ryqeqWMmT7NPb5RcvznG89S3uog6WIa68","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":753224,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfWpZcCRA9TVsSAnZWagAAdWEP/j8gXngSY4ZsEXsO+IC4\nUKlxAEaEeafq54hrcQVjd8eezN4AsJhTfvmGLvSPl34uKts6MnxrhRncEme1\nAFm4T/tLoPKRrTzTtRF8BCEPmJXiabW49UiRcV1ZrTNvShS0xh49/KZuvjDd\nW2iETKUC2nXLAeR0dg+qertW+SfX/LzOf2pSrlXK8WMrbSOp4E9md+lQ9ILb\nLDaO5xTFgaSAchIit1Ik9LpeuduLQYD1ZcGCXJnTNYTo4TFuaXR61ay98qZU\nt0UTijWwN0iNrhSJm0JLTN9913dkM3D9Jgg67ydZXcTf0mgWyJN29ZLKXKGy\nWofrpQKXMDLxvbTZMyNU4+epf62jpIZST3Sqv+lfflsGTZjdYg1g+AQPnJeD\nT13gmex8tT4IxkK0I/bPrwRGLcqAiqa3uqOFOS/jZjk5VBuEi7RVg+b9g8cT\nm1luluCbGGe2JGrg0fTpTzoqqvQiYSqHE6K/O6br2JyUcR1GmvcpqIBMDdNd\nGm2Mu6UkkS0g1AAQw4HDU5EgxRi7EPZqXH52YtOp1g8Zj2ewbv2nlSWpp2ru\n5ABr1Q4oLYxD3y2QMd05lQkka90DQv0awNGCcNoUlukWUruEnP8yD+bP1Xi1\nLUpYU4eJnsCGaweLNdawsA87nv3UsXsXgMC6DvLKcC2I4sojY9Zv9M/IL8rD\nXrTv\r\n=4qJ+\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is modeled after the browser's\n`<input type=\"range\">` element.\n\nSliders follow accessibility best practices per the [WAI-ARIA spec](https://www.w3.org/TR/wai-aria-practices/#slider)\nand are fully RTL-aware.\n\n## Contents\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\"\n       aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   `data-step` attribute on the root element. This will be the step size for\n    value quantization. If not set, the default is 1.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"20\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `tabindex=\"-1\"` attribute on the thumb(s)\n*   `aria-disabled=\"true\"` on the thumb(s)\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"-1\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\" aria-disabled=\"true\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the thumb element's `aria-valuemin`,\n`aria-valuemax`, and `aria-valuenow` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"75\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"96441cf0eac61122c48c43aebac2e249d5bf492d","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.22.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.85a1fa9ea.0","@material/rtl":"8.0.0-canary.85a1fa9ea.0","@material/base":"8.0.0-canary.85a1fa9ea.0","@material/theme":"8.0.0-canary.85a1fa9ea.0","@material/ripple":"8.0.0-canary.85a1fa9ea.0","@material/animation":"8.0.0-canary.85a1fa9ea.0","@material/elevation":"8.0.0-canary.85a1fa9ea.0","@material/typography":"8.0.0-canary.85a1fa9ea.0","@material/feature-targeting":"8.0.0-canary.85a1fa9ea.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_8.0.0-canary.85a1fa9ea.0_1599772252075_0.5749332981294952","host":"s3://npm-registry-packages"}},"8.0.0-canary.0bc41a9c7.0":{"name":"@material/slider","version":"8.0.0-canary.0bc41a9c7.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@8.0.0-canary.0bc41a9c7.0","maintainers":[{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"7c706b9c03d31dfb92a3551b36ec8f6052b535c3","tarball":"https://registry.npmjs.org/@material/slider/-/slider-8.0.0-canary.0bc41a9c7.0.tgz","fileCount":38,"integrity":"sha512-9I5IYcCMJu+dqn/HRhDJaTbBZ/rMwK7HX5gSF5giUoJKTipgqDUGXzkX2abg3Cu+t7AMhNdrj5J+aTM5j863Qg==","signatures":[{"sig":"MEUCIGs3nq5X32jS6LaREHaxFdYbO79IyDUPOLelTdsurqJIAiEA6RDUIMBR5o64kBMBt5L5Zmp3/enRjOHAILAF7V//NiE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":753224,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfW7jOCRA9TVsSAnZWagAA3moP/jsDUGDCZ56m5sTbIuU0\n6TNNE8cef4JuXoWB7KLKRaykhhkczo3kopyuxC0w1OuXlATBuAvn5ojavYL0\nAfxh0kEe5NWfodtkvo8J9uCZ7YPbNdWvYgobsL44e567V27yEdmL7zr67BEg\nD4gb8+2IcXi5fv0QX8xG4QsNfoX2AsJHJtmCUk2qwsw4PmzkmHHlGd4akBvX\nF5MXFPEAgG7i8cA7AS5XDQMcsCi9xTiwioEdLnWCTCPut0CIusGeX+Iq/GBg\ns/3OiixZ6RcQs3TJPmCKPcTqtVZy7tr2WeI1Vhl4FHx2R5uFSa59/3agHovf\nCPRmfhmYh8SUDlUHM1qYUtVKS4PRH+sTmJr0uFHEF8eeq9Q2NY7JP0RsGzwG\nFcHkcg+ngEEp5ZUhKI1r9dFL9p1qJ8+Epg+Iv+T7fS/qrj39VZJb56ubmreb\nsA5N5MZ9gmjI/lW+YWLHeq+r749QPwBxZP34ay6c6jE5rf05ohZbt939CJB3\nwxQSMS5lD0irJobbQ1rs5mnEI2T0Js6+HsYC/JJ7HuJYyXZXvDhsd2uEoM7W\nIXAAVJoZwrZEst1fOGv0jpTP/pOQPPE0oIjhl/O3riRRV0JqAZV71SUd7g5n\n4rYsFuvIZ8pji7Egh7J9uomYaouHe9lDRqp/rDhZPnh4Y6/6l2L52fJcAv1Y\n0Scj\r\n=7iPq\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is modeled after the browser's\n`<input type=\"range\">` element.\n\nSliders follow accessibility best practices per the [WAI-ARIA spec](https://www.w3.org/TR/wai-aria-practices/#slider)\nand are fully RTL-aware.\n\n## Contents\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\"\n       aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   `data-step` attribute on the root element. This will be the step size for\n    value quantization. If not set, the default is 1.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"20\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `tabindex=\"-1\"` attribute on the thumb(s)\n*   `aria-disabled=\"true\"` on the thumb(s)\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"-1\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\" aria-disabled=\"true\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the thumb element's `aria-valuemin`,\n`aria-valuemax`, and `aria-valuenow` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"75\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"f9e2c4fbe617a115d220d49782884d15a0d9ff51","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.22.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.0bc41a9c7.0","@material/rtl":"8.0.0-canary.0bc41a9c7.0","@material/base":"8.0.0-canary.0bc41a9c7.0","@material/theme":"8.0.0-canary.0bc41a9c7.0","@material/ripple":"8.0.0-canary.0bc41a9c7.0","@material/animation":"8.0.0-canary.0bc41a9c7.0","@material/elevation":"8.0.0-canary.0bc41a9c7.0","@material/typography":"8.0.0-canary.0bc41a9c7.0","@material/feature-targeting":"8.0.0-canary.0bc41a9c7.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_8.0.0-canary.0bc41a9c7.0_1599846605522_0.3003390765476357","host":"s3://npm-registry-packages"}},"8.0.0-canary.fc0eb5013.0":{"name":"@material/slider","version":"8.0.0-canary.fc0eb5013.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@8.0.0-canary.fc0eb5013.0","maintainers":[{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"65c77b9e019d4c5aea6cd6f790b3ff65139457ef","tarball":"https://registry.npmjs.org/@material/slider/-/slider-8.0.0-canary.fc0eb5013.0.tgz","fileCount":38,"integrity":"sha512-oLba276+1S+10KB2OppQ5urI+VNVc8IDCfl4mTOy6eR7PQumklgKZqhCJu638z9EFJ/+ejVO0EiM2pcuO4icwQ==","signatures":[{"sig":"MEQCIAPGHew8KhzOMx3FY+qy0qwGuHATt16OppEHehvpjofYAiA+5Xa8zybm8M7JK1VwKTMwfx6HLcpsoNe7Zy6jaJzHfw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":753224,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfW9ZMCRA9TVsSAnZWagAAEPoP/RkgenOeMqmOvHWR9rFT\n4SlFmVXq/OU3YBF0mt94MDw2VmWWMVxTG3kmcZnfimtGiDz1ZnE2VoxFFqKK\nC4yPmILzqoII1pPrcgoGMrCYGK4wac7Ntz5i8SWqVd7hsusB4Lz/8i8zBfzC\nu7EjwdW1MSFZs5eB5f8ClrJwHj3NDEIs3eH6r7a4VmcTMGXW1ohbJT2/sjG9\n2ZaYo5myJQYvWIUj8/SzXrpeW0dnuhbfbMVCjkyoqQlj0ODPNGrK8oAz9Njh\nzOfWPzUBuncNwtbpeDe/+JL+Rh1GJuPjaaWvX+rawTL5bp6pzJ4FW+nwTtkW\nQo2OW/FNp5gwdkR5T9E/MzN5sebrHB0pnGshDzDHrnlnMQA+mC6rvCOu2GNy\nwSuk6mtBBnNJes5ulH2SLhFrGxvIh5laSZTPcyt3pShl7zZv2i32pr/Dq1D7\nuFw6ex00OyxqC02Lcz+t3trUSkVD5eGia6Dl+PtbhyzRrd7FkkydrS/7R3C/\n7Ulx8D1fpbRqhmyOM/lPkKa7kkCyK26S9K7/iGu3qOiFSq3jhG33qKqAZZFA\nR6BiS9qgC8JhPYD5jWh1SokijUfkPqM0TfSUHW14s53ozrWm7h+EdPvIlX1Q\nziltXWp6p7ZInKWG7Y054ST+DvH8u/PkfNLMrwrV35s2QrFoWZTuIWyuvBrl\nbLjn\r\n=fWDw\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is modeled after the browser's\n`<input type=\"range\">` element.\n\nSliders follow accessibility best practices per the [WAI-ARIA spec](https://www.w3.org/TR/wai-aria-practices/#slider)\nand are fully RTL-aware.\n\n## Contents\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\"\n       aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   `data-step` attribute on the root element. This will be the step size for\n    value quantization. If not set, the default is 1.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"20\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `tabindex=\"-1\"` attribute on the thumb(s)\n*   `aria-disabled=\"true\"` on the thumb(s)\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"-1\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\" aria-disabled=\"true\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the thumb element's `aria-valuemin`,\n`aria-valuemax`, and `aria-valuenow` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"75\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"c6572140acfb45fa86b79570328d75e3869c40ef","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.22.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.fc0eb5013.0","@material/rtl":"8.0.0-canary.fc0eb5013.0","@material/base":"8.0.0-canary.fc0eb5013.0","@material/theme":"8.0.0-canary.fc0eb5013.0","@material/ripple":"8.0.0-canary.fc0eb5013.0","@material/animation":"8.0.0-canary.fc0eb5013.0","@material/elevation":"8.0.0-canary.fc0eb5013.0","@material/typography":"8.0.0-canary.fc0eb5013.0","@material/feature-targeting":"8.0.0-canary.fc0eb5013.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_8.0.0-canary.fc0eb5013.0_1599854155706_0.06322209417494484","host":"s3://npm-registry-packages"}},"8.0.0-canary.319bf66de.0":{"name":"@material/slider","version":"8.0.0-canary.319bf66de.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@8.0.0-canary.319bf66de.0","maintainers":[{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"9832b8df49b9a54442e6a2cb2074216f6e65d154","tarball":"https://registry.npmjs.org/@material/slider/-/slider-8.0.0-canary.319bf66de.0.tgz","fileCount":38,"integrity":"sha512-glycy1ovaDAMC/6o9FBIv0cd+A4sdDc6POB16BY9vYSu5KRqjQ5lZ2KttAMFKWJ34jijHDSTtBP9cy+1xpPH4w==","signatures":[{"sig":"MEQCICh+eTQsRX14HEymCCWyCAaZ8btUibaY0ZSnCX+pKXHmAiBeF1sgOMtvqu+KDeEeN0SSsyasXi5YJ0yKc0obyF/D5g==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":753224,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfXAPpCRA9TVsSAnZWagAAPuoP/07F9MCGeDjpy7AR/Y5l\nNosHCSvmovQEuphSEXzYVA1phISJXZuiVxm1NN/CAwZtabvMTGo3wq8H/hWB\nKcmn5YcKE4FzzoEto98LXDTqtvbpnLBgd8qP6rQiBYt/aDU0IDASrxaP7LMh\nJD6UcXtZ1uYFGzha9hCu0PkukiAULDsp8/hQAXNVl/6uDv4NEdBgl1Z1qhpH\n+cjxfByXyqIfwCBJ+kgnOfR0yXDMjgKO15D8JR8gYLsm4iHCtPKifq/h46oB\nCKcKK/RUqDTAZ+6A9CSF6mhjEsBQVWUqHxt2XqmdMmC4TuElsZd0yQDcJfOm\naa7XKozOB8TMW/NK7TecUcf25cYDWXXS3HLojnQ8gPYwFYI/OYcaGAJwqKmA\nbTwYxWHKV1p1qtgdOPkFeJ3VxI86W/RoxxKqIhPGBkoo8HCvQ0LHF7qntKFP\nT7rKQekvY4NVAM/PwKum7VtZV0cFrr1vBmL5Rb78mIhkb+JWyYDaM46GPpom\noq5MoMAHhzAH1raLhH6biRu2JT8JrUjS7jizteRHSaoiW3u/MDUGWqnN4tnp\nkqhkJWNlhoHoQac/f3wy72/cNL66hvBe4iwv87ZDfB2ALVMQTpviDJCQ2j/P\nFMkJXZ/66lc9WtrJm/yzfxbWuPySx8/fLcYgPXZ1wkUThXu8ECpPiVshQEgJ\nzQj1\r\n=5SgY\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is modeled after the browser's\n`<input type=\"range\">` element.\n\nSliders follow accessibility best practices per the [WAI-ARIA spec](https://www.w3.org/TR/wai-aria-practices/#slider)\nand are fully RTL-aware.\n\n## Contents\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\"\n       aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   `data-step` attribute on the root element. This will be the step size for\n    value quantization. If not set, the default is 1.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"20\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `tabindex=\"-1\"` attribute on the thumb(s)\n*   `aria-disabled=\"true\"` on the thumb(s)\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"-1\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\" aria-disabled=\"true\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the thumb element's `aria-valuemin`,\n`aria-valuemax`, and `aria-valuenow` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"75\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"ba4054064292bafde40e53fcc87405c8dcad24b2","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.22.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.319bf66de.0","@material/rtl":"8.0.0-canary.319bf66de.0","@material/base":"8.0.0-canary.319bf66de.0","@material/theme":"8.0.0-canary.319bf66de.0","@material/ripple":"8.0.0-canary.319bf66de.0","@material/animation":"8.0.0-canary.319bf66de.0","@material/elevation":"8.0.0-canary.319bf66de.0","@material/typography":"8.0.0-canary.319bf66de.0","@material/feature-targeting":"8.0.0-canary.319bf66de.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_8.0.0-canary.319bf66de.0_1599865832664_0.844044898718221","host":"s3://npm-registry-packages"}},"8.0.0-canary.5bfc305ec.0":{"name":"@material/slider","version":"8.0.0-canary.5bfc305ec.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@8.0.0-canary.5bfc305ec.0","maintainers":[{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"2c6d3f70f091ba559a9feb706436a6907c863dde","tarball":"https://registry.npmjs.org/@material/slider/-/slider-8.0.0-canary.5bfc305ec.0.tgz","fileCount":38,"integrity":"sha512-Wrs7MeSvjnIDmm8vBcDCSUlX9ppU5ef0G8Oezd3AUni88AYqEx0cGgFDaTM4LqE/wWshJ9cRjmv4R7luQbz+5w==","signatures":[{"sig":"MEQCIBGnjpn6q9SyhFoIP9di74G91t52e/1uvvCt2yEVie30AiApRXOqQ6Rozgpep4eFlavggRHFV4U1rxKM0Yeb7A7GPQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":753224,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfXqSSCRA9TVsSAnZWagAAtZEP/ibQDhIU7IX1Tmfbq9MU\nLzp7+01/iv0zYVQpXUF4s7J/gbkg4l0DRAhwg9T7GVeGAWyHYmy/KTdLWOHP\n510+5sLSyAkCr7bIwSguF1sM6DBROV2nPQH1QIMGJomT3HVHzGWQClJT3fh0\nMuLovMONejE7R3+BoIQ0vYWkpQrpsFJdbfO3Z85LNZ6WZGClzk4zgCJMu3WD\npZUhwPtgJnTI8wl6KO9V3LvtgMCTcWCu71SGUuucRHQ2eogH3jh1f5qWYQex\nLXWVr+C2VOovUVV7y/AnMlC+L28T3N5+6MsP1zTm4p9ZkbMZ742ofupDRIZj\nxvqOjcBdcRs1Zyl+a0xgAoleor72WqqKpfciYh+4IAN0jVcYP2C9OYj6qpAi\nxcuzi2nP85HMc9JjLmN8jk6dJOhOOrlgwIrI1b5rKG+OC0yp8HRLdh4b2o4I\nHX0s+0eZREJZAnOEznW+wRq+j/YzA82+KmVoTkNNZaYVc53cgT95WXkRbocp\n5NPb1OWAAmq/CwACccUXYFi5+eHe0nTfDYstgUmi8Q0fY0g8Ufw6HhVmNPON\n9O1mobaQPcYcAJmf9CG35ht219o80sURh5/Qnw2sbrXdQ2fQyZlNYjXd82Q6\nbXT+Kp6ZkN+MZEVOJ+wMFqmzSA49Iqh/NUSXAB747QPdv20hfLreo/iJNLu2\nY/B3\r\n=1hAb\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is modeled after the browser's\n`<input type=\"range\">` element.\n\nSliders follow accessibility best practices per the [WAI-ARIA spec](https://www.w3.org/TR/wai-aria-practices/#slider)\nand are fully RTL-aware.\n\n## Contents\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\"\n       aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   `data-step` attribute on the root element. This will be the step size for\n    value quantization. If not set, the default is 1.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"20\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `tabindex=\"-1\"` attribute on the thumb(s)\n*   `aria-disabled=\"true\"` on the thumb(s)\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"-1\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\" aria-disabled=\"true\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the thumb element's `aria-valuemin`,\n`aria-valuemax`, and `aria-valuenow` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"75\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"96c0c187c7fa544c1f5303e96ba3e85cba86e5c2","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.22.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.5bfc305ec.0","@material/rtl":"8.0.0-canary.5bfc305ec.0","@material/base":"8.0.0-canary.5bfc305ec.0","@material/theme":"8.0.0-canary.5bfc305ec.0","@material/ripple":"8.0.0-canary.5bfc305ec.0","@material/animation":"8.0.0-canary.5bfc305ec.0","@material/elevation":"8.0.0-canary.5bfc305ec.0","@material/typography":"8.0.0-canary.5bfc305ec.0","@material/feature-targeting":"8.0.0-canary.5bfc305ec.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_8.0.0-canary.5bfc305ec.0_1600038033595_0.3910138897093052","host":"s3://npm-registry-packages"}},"8.0.0-canary.83d83f131.0":{"name":"@material/slider","version":"8.0.0-canary.83d83f131.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@8.0.0-canary.83d83f131.0","maintainers":[{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"88842f7b5e6c5313628cb8ca47dc49dcfb5a36d4","tarball":"https://registry.npmjs.org/@material/slider/-/slider-8.0.0-canary.83d83f131.0.tgz","fileCount":38,"integrity":"sha512-SIxcdOspwCXRwKvXwl2S/B9PRqLccuJ58sV/36tY2RnxGi4U9ZGViuQYmqJFKV4pIfsbqnuUKi23j5iasXcRXA==","signatures":[{"sig":"MEQCIC/Opeyqsuo2mkEyHvwrRrxgPUhN//c21GNdAqFLlwPGAiAZJSKQl/9L7Ib/WLoPFreWOeRR6TJJW+XxWF2ttFiu8A==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":753224,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfXro+CRA9TVsSAnZWagAAOOgQAKBQicIyvkSiuQ5all1s\nKYaoC1l4yAAroeduc6VAYI92MrnFhYik2MEdGfqWjKeXgEbqD+deUdgTumcS\n3AL7IVeLrK543WPOhoHE89nGmlh9jrMfU9Tj/cyukXP7bRBylXVvm0SQm0L0\nLefPRvT4DgXWQMzJMPeFSzoRmcKOMHZqvFVtd7BzafMZU9dRZP/whaNhxU59\nCtStN3VCsdgh9XdZhw2cOM9KffFZCG1rAjT1AYb2J6BGLDCCSjuiGOwk1t+d\nmHsleZT9sLKEVkn/DINZ00tKHADPgCGkBbL8kj/+01X2XNXs/5X3VgVJuvPL\nM0wIkPaKGIrxl5f4K/JSZwadNjs7XZauX265Dt3gYVgG9wW3BjY0no3lsM/h\nctWX6jSdnvMUZjGuCfXcFM2QuH4HB7ndvFOpubOjSMgJvXrl0y5hTsWP0Vqf\nzqt2TorlP/0WES2a8zXkVWmWpZrPPq4jD+ZyL1NESiHLbQIhmNNRIsYPxUfY\n8sxwqVm3ACCi8Q68Rcr+OerTEIufB2g2doaCrl5WslBgBGCjjXfu2jzdCGgn\nBHvUIqTwMAQtdWwCn5P5jD92IzK3JVikBvVeCMuVG06FNuyhc9L+R3c+qaaU\nD4JsFUlsduaJ9GlFm65wyMn8CaxYVfrQIzol/mxdIKVKJVFK6klvcAk05Z0Y\n4kHn\r\n=W5Bm\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is modeled after the browser's\n`<input type=\"range\">` element.\n\nSliders follow accessibility best practices per the [WAI-ARIA spec](https://www.w3.org/TR/wai-aria-practices/#slider)\nand are fully RTL-aware.\n\n## Contents\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\"\n       aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   `data-step` attribute on the root element. This will be the step size for\n    value quantization. If not set, the default is 1.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"20\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `tabindex=\"-1\"` attribute on the thumb(s)\n*   `aria-disabled=\"true\"` on the thumb(s)\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"-1\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\" aria-disabled=\"true\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the thumb element's `aria-valuemin`,\n`aria-valuemax`, and `aria-valuenow` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"75\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"520e8b604c3cd3e7ce96b30f4315d576bcdad3e5","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.22.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.83d83f131.0","@material/rtl":"8.0.0-canary.83d83f131.0","@material/base":"8.0.0-canary.83d83f131.0","@material/theme":"8.0.0-canary.83d83f131.0","@material/ripple":"8.0.0-canary.83d83f131.0","@material/animation":"8.0.0-canary.83d83f131.0","@material/elevation":"8.0.0-canary.83d83f131.0","@material/typography":"8.0.0-canary.83d83f131.0","@material/feature-targeting":"8.0.0-canary.83d83f131.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_8.0.0-canary.83d83f131.0_1600043581863_0.12892528122396163","host":"s3://npm-registry-packages"}},"8.0.0-canary.40d8e4726.0":{"name":"@material/slider","version":"8.0.0-canary.40d8e4726.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@8.0.0-canary.40d8e4726.0","maintainers":[{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"1b70328d6c45483187c3b8e4a8439c8680df4569","tarball":"https://registry.npmjs.org/@material/slider/-/slider-8.0.0-canary.40d8e4726.0.tgz","fileCount":38,"integrity":"sha512-chVsvWqAYLjq8sx/aPbB1XSg+si7vYtD86aSH2PXjceukR7czVlHbvtS8ehFfbdEcxh3j/y+9qcrv7EVHXEj9w==","signatures":[{"sig":"MEUCIQCYWBAEfZpPuAmEGL0Y9ltJ7GE0BEWdN59dsyTzjkqm7QIgHrGqJj6zM4YnI0ffkAuYg+YD0S3a3ERXzy6V8u9XTu0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":753224,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfX/0SCRA9TVsSAnZWagAASVUP/A2DulBAxWXnAUcjo0/I\nuzq9BFvCmZVJQgXOzYOqUj4X+V1XNu6nxl40NcLIhOYNGOVcC20ph25/9YlY\noGdna+pz1J7nwTi4Oa0h8R5xxF1C47yFi5UlsGcFJguTYwicVnqTluO8Bre1\nfbiSPCpAK8byDrR5j6+E9HwHHva+h/cB/qIgZAXtAFJT8O69uy3v/QccC1I4\nRyGYLbzZYHzktHSmd34fyH66eTbYz0CPUisJHpTyCaxajKBMhyTvwtuzl5Zm\nTnXWEQzwpUbJ3/DSgPHs6CdU5aUv3eb8pP6GP7NCICJtGrAZizPfn83Lieax\ndCmZ8o2lm2tVK+vtGzj0oMr0UU6gCizcxD6jRnwAylQ9ItgpNATwtUVZVIEC\ng1DbbfKr4D1EpR4IShWGlY0dDmI2U+QqVFNqJlPCQc0BNPIFqF/Ap+Ms1lwv\nuinRnTfEuVCaEYJSsSv4nEgHR5pd27QX7Fylm9mlCID/9YTI19/Pd12Vmrr4\n+R0Kjs3wkA2m3kHSRPaYqtGAAJD4ZD/vo8dMJcIo1t0Sj5plfxS1cegOfuIN\npI6S4q8aCbOk1U+XO3YcQNGZsbplZWjawzrlXQCL9CW6kJ2o1K+XgcLpc7CH\nXMMF7EuKH1/Lj3q+OOA9C3ealkp8EwO+jlHrtxiQ8K1kwhl3G4Qt860yK8Ga\nsjQ+\r\n=jyrK\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is modeled after the browser's\n`<input type=\"range\">` element.\n\nSliders follow accessibility best practices per the [WAI-ARIA spec](https://www.w3.org/TR/wai-aria-practices/#slider)\nand are fully RTL-aware.\n\n## Contents\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\"\n       aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   `data-step` attribute on the root element. This will be the step size for\n    value quantization. If not set, the default is 1.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"20\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `tabindex=\"-1\"` attribute on the thumb(s)\n*   `aria-disabled=\"true\"` on the thumb(s)\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"-1\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\" aria-disabled=\"true\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the thumb element's `aria-valuemin`,\n`aria-valuemax`, and `aria-valuenow` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"75\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"ba2736b8bb826dac383c6f8f237a6584247d5198","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.22.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.40d8e4726.0","@material/rtl":"8.0.0-canary.40d8e4726.0","@material/base":"8.0.0-canary.40d8e4726.0","@material/theme":"8.0.0-canary.40d8e4726.0","@material/ripple":"8.0.0-canary.40d8e4726.0","@material/animation":"8.0.0-canary.40d8e4726.0","@material/elevation":"8.0.0-canary.40d8e4726.0","@material/typography":"8.0.0-canary.40d8e4726.0","@material/feature-targeting":"8.0.0-canary.40d8e4726.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_8.0.0-canary.40d8e4726.0_1600126226076_0.36541399022930343","host":"s3://npm-registry-packages"}},"8.0.0-canary.c25d70a31.0":{"name":"@material/slider","version":"8.0.0-canary.c25d70a31.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@8.0.0-canary.c25d70a31.0","maintainers":[{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"f0223f55c92e689e5e6d4901a7caef0d5071b510","tarball":"https://registry.npmjs.org/@material/slider/-/slider-8.0.0-canary.c25d70a31.0.tgz","fileCount":38,"integrity":"sha512-zU9rxQ93ITtQ+umt0UxGiTcv5G89rRo6ZlvFFMlUAWwiEupbPmw4mSBB0xvt0gzo9p4DywssZa7ylJ0LkZ+zNg==","signatures":[{"sig":"MEUCIHPmuOjhyyvBmHcmLwY7xzJu1OwVBcMkfHhwgNSbvvFfAiEAjABLlasF/+hBpsJt6SyN4qZ6R0+kp3FLGY+Sc/Ck+nY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":753224,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfYCcKCRA9TVsSAnZWagAAGF4P/1kbGk9VIrWSESZqPwea\neOEtAtV5aC3AZGzx8qwa2F12jvVo4I0Di7lfCteeuoeUmm8Loza9J51PXf/x\nkPs+UXmBVjqygHBvIYw3rkkHJLABgNlP5O1NDfgslDKDwH5sMa8YMk0YAFTc\nL64NGAxHuPx1Ovse3mE6NTfMYaGYtfYueWEerZq0scRmcxOxD0uNoAQnEwHr\nOTxyegU/kAQ6kTJmrCCbqHSTXEbV6AsK2Wssaha9qVIrvESJxiIJEmHHmlt/\nAFomo/DhtREfpxh1Fq1PrZvIEausW0Q42s27ND96W8yiqxxx3HJRoWCDZMcm\nMWYeyF21+HDjdpOqGsXTjZ11YQhtOAS0Rmy1Mb0lfzkZD1L03hgvgalY2W/j\nsv2iIQi/CGoxoCtj35NWes2MSWYHI5t5NCuQgLsruoHoDEQK7zLWreDiLP0g\n4Ep82LncMTJpS0ZS5R8jb7KS6e4QsJ3VLARXpfEjpORqohU20Q4AbcB8pdHL\nH9Im3hhOZQ+UQknTxdEgLRnXffE+1C+sRPWsMkwSykqPGM5QuVFrm0lV/+W9\nWFpYxAoD/RdSpCEJpHSXiaBcMdQgbLLT90fYfK7w6uBjnLmdFsFhxr/xBzo9\n95l7iBsEtrtcPH3Q3I3jUAv+R8l3L9yS7c5Xa+JL7pcD0trHuCji5ea6I44Q\nz3F3\r\n=Hy6p\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is modeled after the browser's\n`<input type=\"range\">` element.\n\nSliders follow accessibility best practices per the [WAI-ARIA spec](https://www.w3.org/TR/wai-aria-practices/#slider)\nand are fully RTL-aware.\n\n## Contents\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\"\n       aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   `data-step` attribute on the root element. This will be the step size for\n    value quantization. If not set, the default is 1.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"20\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `tabindex=\"-1\"` attribute on the thumb(s)\n*   `aria-disabled=\"true\"` on the thumb(s)\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"-1\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\" aria-disabled=\"true\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the thumb element's `aria-valuemin`,\n`aria-valuemax`, and `aria-valuenow` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"75\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"23adc9426ee1c32d146e601987be4165e56c7934","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.22.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.c25d70a31.0","@material/rtl":"8.0.0-canary.c25d70a31.0","@material/base":"8.0.0-canary.c25d70a31.0","@material/theme":"8.0.0-canary.c25d70a31.0","@material/ripple":"8.0.0-canary.c25d70a31.0","@material/animation":"8.0.0-canary.c25d70a31.0","@material/elevation":"8.0.0-canary.c25d70a31.0","@material/typography":"8.0.0-canary.c25d70a31.0","@material/feature-targeting":"8.0.0-canary.c25d70a31.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_8.0.0-canary.c25d70a31.0_1600136969773_0.24505949169702834","host":"s3://npm-registry-packages"}},"8.0.0-canary.d52b165b5.0":{"name":"@material/slider","version":"8.0.0-canary.d52b165b5.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@8.0.0-canary.d52b165b5.0","maintainers":[{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"093710011d12f364d659f0456e778d2de234d5e5","tarball":"https://registry.npmjs.org/@material/slider/-/slider-8.0.0-canary.d52b165b5.0.tgz","fileCount":38,"integrity":"sha512-k9WKFoUE/cyaSB+466xGywaSXJNB39dev9n46cp3a1fhZA+rLSgn3NmXdeZfutPwa/4fHRkkpuGN5gXTtygDZQ==","signatures":[{"sig":"MEUCIQCM3scH22HwQIz079YW1kHesRJ3Zk2J90r3e2zjR4M3sgIgcnsd7v4crtKK3V0rE7qXnUwnxtx2vBI5WyWulTghJqA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":763028,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfYNW0CRA9TVsSAnZWagAAn6AQAJrG9o12EsMWkN4Qmgjl\nbNmMV4DRhgvQHcwN4zqkm+r3qI0iBHSFSD4+0qs5f4wbE7ZD/awxjVpx2lfL\nE+yqKpqy+GChwEPssQuNnw428lLkW+bji29QhWU6Qm0IJqZKHxlOLrEr6C37\nfceMLAyPd/XOSbNtfigI2ABOnYmL1dhIXk6K4Nv2jCzJkK3vdJKUNsATD9IB\nPfhUIDs/CNIuFlva/qbNwI92cvU4aJ8i2nXDUrgC1CvAnTpwJBtsL1OTwkDy\n2l8IfYHel2kjTbo5/nSaT3otzBVw1RrR2TSedRoRv+HjNqkU2V0upebmrjkt\naPg2A2LhshHb121MNUe3QkfwHB2nEgZ0DidYriP2CZ6Dbnztj2aRqonAAhaf\nfGtjLNqTVYo0b1Ua20hjSS2Lt79OrVnYi5UeCQJLbsU16AC6HJ6ef+OzHrMa\n8tuScRKBq3sr387enznpq8sP/pNHVrrBP/JPniZMGqVKUIoYryT4vO+EYiOy\n1GgA93cC1kWpm81f4Tl6leuqSibmNw1NiWtoik6FRRbzstcapSLXTZxX4hyV\nMTzI7W4CMoRFBID0s/7DWup1kBAqc4fkPeM/LzrhAo6oLRCxnwfR2Qt7F9WI\n3bnF9Up15NRm+UydUTtL/11qSO0GplCqfG28TlgQhtSjl5y4Pi3gELiiyZzt\nkX3X\r\n=VtAr\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is modeled after the browser's\n`<input type=\"range\">` element.\n\nSliders follow accessibility best practices per the [WAI-ARIA spec](https://www.w3.org/TR/wai-aria-practices/#slider)\nand are fully RTL-aware.\n\n## Contents\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\"\n       aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   `data-step` attribute on the root element. This will be the step size for\n    value quantization. If not set, the default is 1.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"20\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `tabindex=\"-1\"` attribute on the thumb(s)\n*   `aria-disabled=\"true\"` on the thumb(s)\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"-1\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\" aria-disabled=\"true\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the thumb element's `aria-valuemin`,\n`aria-valuemax`, and `aria-valuenow` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"75\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"19ac3399f14583da3b2ca5e37a0ce783539066ba","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.22.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.d52b165b5.0","@material/rtl":"8.0.0-canary.d52b165b5.0","@material/base":"8.0.0-canary.d52b165b5.0","@material/theme":"8.0.0-canary.d52b165b5.0","@material/ripple":"8.0.0-canary.d52b165b5.0","@material/animation":"8.0.0-canary.d52b165b5.0","@material/elevation":"8.0.0-canary.d52b165b5.0","@material/typography":"8.0.0-canary.d52b165b5.0","@material/feature-targeting":"8.0.0-canary.d52b165b5.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_8.0.0-canary.d52b165b5.0_1600181684009_0.7744519562945811","host":"s3://npm-registry-packages"}},"8.0.0-canary.a831d4799.0":{"name":"@material/slider","version":"8.0.0-canary.a831d4799.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@8.0.0-canary.a831d4799.0","maintainers":[{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"b658b10803ed08e4b524a87d6e050bbff3fc23da","tarball":"https://registry.npmjs.org/@material/slider/-/slider-8.0.0-canary.a831d4799.0.tgz","fileCount":38,"integrity":"sha512-7DB++WAa/VR1Nj9CsBZiZVvP9pTxWD4/OUfsR69ogVYcCvV+nCAUgfTN1HMOH2IJoaNrSqYX+yu63daRVm0B6A==","signatures":[{"sig":"MEYCIQCVF+5brNE2O8lYkJ8ZhuEoFNTFujEoVtBEGB8h5KEE7AIhAPzyaUGBvAmQn5NhiYTnBIP3B+7uZR4UbkLbCDwZBC9C","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":763028,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfYP9OCRA9TVsSAnZWagAAG6YP/0guHhSajSCZJc7MlkGN\n7XFfCLe2+xFgBmyP0SFZXcec+D+Y0TryAxQZ8Cadq6JzlOkaPWBcrgPg93M9\nR/ckdCkf/vN2aC54F1USQvK1CTBqvfbfS8jPJRcz2cJ09zjrF2tAkXXSEqUO\n90x4YRj/Yrq1TSgF0PdV1NR6N9BPST8GDK23vp99tTemi0X9LpEGHeFv+RZ/\nytKn3AVA2vudNCe3Ne80GQOM5DGm2vX4zbdZIvdaT68Stbs+z5itHHwVRDK/\nC1syO/eKsdHW39iPQCtTtHa2BOe8qrNfmC3ZDV5YfjFoSrvoyeL3tAllnr3t\nZThEDEF3ql0uTsHmRcjKmQ71EIZBjO156Y+1qnVa2HJHBCK7TLJcHHj+S9BD\nYH5U13LEg+Osg/CTN88wkfjIk3Ix8WHs9HRvTF/NEtJKGC5j7Gou5RO02cyD\nEweRnkcFehphnVj1RI/ExEktXdZEIkifaeOqus8cW/IwKRJkcMjJOeKyqjW3\nj/bYhyS+laAaqfSJIx3K+Pfw7gR9AwbqBs0tJ8bjw8I74ZXcIKMXRXm1Hlv+\nG/Dogr5w/kIrz/T7Fwipxavm83K6USYpT2pQojllJnWq3Qu9dDnljUN6GmZr\nojuDHkeTaYXYXv9IQ1LbL43tIAw9gWBUPgsNAattTVG/70sqKEnPdylorpKI\nHqsB\r\n=iIsk\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is modeled after the browser's\n`<input type=\"range\">` element.\n\nSliders follow accessibility best practices per the [WAI-ARIA spec](https://www.w3.org/TR/wai-aria-practices/#slider)\nand are fully RTL-aware.\n\n## Contents\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\"\n       aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   `data-step` attribute on the root element. This will be the step size for\n    value quantization. If not set, the default is 1.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"20\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `tabindex=\"-1\"` attribute on the thumb(s)\n*   `aria-disabled=\"true\"` on the thumb(s)\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"-1\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\" aria-disabled=\"true\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the thumb element's `aria-valuemin`,\n`aria-valuemax`, and `aria-valuenow` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"75\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"fa7f461e7963e1bdb73e7811d2f70b0a07acba16","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.22.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.a831d4799.0","@material/rtl":"8.0.0-canary.a831d4799.0","@material/base":"8.0.0-canary.a831d4799.0","@material/theme":"8.0.0-canary.a831d4799.0","@material/ripple":"8.0.0-canary.a831d4799.0","@material/animation":"8.0.0-canary.a831d4799.0","@material/elevation":"8.0.0-canary.a831d4799.0","@material/typography":"8.0.0-canary.a831d4799.0","@material/feature-targeting":"8.0.0-canary.a831d4799.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_8.0.0-canary.a831d4799.0_1600192333528_0.7357624814885599","host":"s3://npm-registry-packages"}},"8.0.0-canary.a306aa488.0":{"name":"@material/slider","version":"8.0.0-canary.a306aa488.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@8.0.0-canary.a306aa488.0","maintainers":[{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"b671105fc3f16512ae0397ab016213d0beb28a33","tarball":"https://registry.npmjs.org/@material/slider/-/slider-8.0.0-canary.a306aa488.0.tgz","fileCount":38,"integrity":"sha512-l9kTxNFAqGAB7FPoGxUkMJGM3VGIJz+flCT+5VghI1svRsB80PteeZJBs1eS2V4xIwKXr2pA9h1294Osy9NJRg==","signatures":[{"sig":"MEUCIGGOGrzXqKffFam2LHr5s/4ewQSloBRJTiacpJ7hm6TvAiEAlcunGtbsMRAeES5mTk+m7fLjos9Fhp7cUGYyCdaYEsQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":763433,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfYrTdCRA9TVsSAnZWagAAtNUP/1GrWW5bpHoqQ/LEmbpq\nAgxkSTKL5lOprWJx3+S50iw+bfnlnBuDhtGiuZ96spo79Ykx5HI76OyZWEnq\nhhaldn0JYWwhf3Zox7M1noqafvBH4JaNg4Z89vTo11m9QwNWZ9Rom5Q5PU1R\nSZKmBtyscZpTeOK2YAnmVy3OFcFh7nLiUNGnGhio27dzZVn0kjCUwmsY8BHV\nyQt4NvhVWOr/cNVB02XhjQwaTj52Ez0EcaDI6hJDL/z1snBUpKSLVSIV1PB3\nsfiyZ+1Ux3PPD2Z/aoN/xcQvhP4ZlPmmzB3SOs+ugh0oFpzLRXC3N1Mkuw5r\nXYqkoIwZWDeWWkkCd1qM8D/iKTDH1xp37vFUmJ2aRZHED3cbDL93QZrjUwTx\nLVdhzwBXdF2nqBKYw5gEa4y2VAzxuskNupKc1kYCURyvkz/bTNiee2eJR0Zf\nzgEkdfO5yL2+e0vGXljKPn7KDh5JIcXVBt4AI6fYwt1pRfjmyYSJ72vu7xCm\ncGR4p72g2AgSyZ8+38RxIbqAuOzLYTlH2YWK0zV1iadJ665wtSkg+VZ6QY7D\nlhTrEIH19Wcp5wShg3ynaLCUvRlsChrkYfljxeo4OG1lCQul0lGkKewqOezg\n+oPr0lpWJtp/m4qVXEpnU1Nui8v7ld2Xu/jUApuNfCngF5V38js2boYKEw5m\nvWL2\r\n=Zwtd\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is modeled after the browser's\n`<input type=\"range\">` element.\n\nSliders follow accessibility best practices per the [WAI-ARIA spec](https://www.w3.org/TR/wai-aria-practices/#slider)\nand are fully RTL-aware.\n\n## Contents\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Continuous slider demo\" aria-valuemin=\"0\"\n       aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Continuous range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Continuous range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   `data-step` attribute on the root element. This will be the step size for\n    value quantization. If not set, the default is 1.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete slider with tick marks demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"20\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `tabindex=\"-1\"` attribute on the thumb(s)\n*   `aria-disabled=\"true\"` on the thumb(s)\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"-1\" aria-label=\"Disabled slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\" aria-disabled=\"true\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the thumb element's `aria-valuemin`,\n`aria-valuemax`, and `aria-valuenow` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"75\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"c6addec60d43eb106ac774211ca2af4b04d40f1d","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.22.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.a306aa488.0","@material/rtl":"8.0.0-canary.a306aa488.0","@material/base":"8.0.0-canary.a306aa488.0","@material/theme":"8.0.0-canary.a306aa488.0","@material/ripple":"8.0.0-canary.a306aa488.0","@material/animation":"8.0.0-canary.a306aa488.0","@material/elevation":"8.0.0-canary.a306aa488.0","@material/typography":"8.0.0-canary.a306aa488.0","@material/feature-targeting":"8.0.0-canary.a306aa488.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_8.0.0-canary.a306aa488.0_1600304348954_0.017245748319262955","host":"s3://npm-registry-packages"}},"8.0.0-canary.fd608ff66.0":{"name":"@material/slider","version":"8.0.0-canary.fd608ff66.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@8.0.0-canary.fd608ff66.0","maintainers":[{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"53836a535156a47eceecdde078be454924f6d9fe","tarball":"https://registry.npmjs.org/@material/slider/-/slider-8.0.0-canary.fd608ff66.0.tgz","fileCount":38,"integrity":"sha512-XswL6kDiEKKu7mc7v2HWbzsFcyKgPpI0J9Twh0bzmqaoXEgaW+a3xwE3yQhSzm625Ds2EuEnrBzHLBdHA6hVSQ==","signatures":[{"sig":"MEYCIQCHI28bRtY4REnBy4kzOWudck3692HSX/eriBr2tbEMKAIhAKev0K078eZK+nRPqYkongy5THwUoceR9fb45omEnWlK","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":771191,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfY3H/CRA9TVsSAnZWagAAjC4P/iDinGJ0OE1NrVzO3V5b\naOd1am1+0NjNOC9Jpa10Pv/OzRF7dl6ZFJgeJU+Dch9PrsJneYZImJuudmHE\nJaclmi30dYvvFSkADz74rPBlAGk0BR4nlNJHkzuoSwYbX+306WTJ1LBvx5MY\nzcrC5TYAfMpO0YG+xEgPtE1QP6L3PyA3qpMXBb/tiZSlVP+bantfHJ6urI0I\n3OzsCq7lQdhJl62voGGuWeG6QfcYsQom3wxV0r7a4VZm1G/b3Bwjux6XMjjF\nd5g6x7MT7ko+XjpOooM+0ytj+Iz0IDlK/IRz+VRhfnlkf5K41Rr5s8kPEM9M\nXogg5jqvjgAhNcvDTHROK45fRP+QYEYSRop2bmYd66p1GDrKJB+7Q3gQY5JS\nrK1FaR4RxrXjBJG/ROypUJNJn+IUSMTpz31M5z0Cqbs5D6c+bi/plAIEgBNZ\nN9zi4g0Tzna8bYCPk+sl4zLYxq3S7ElOaijrcNOcHWoBmB6tbE0CE5PFu5BS\nUg3uIqiXV3Vhifd4SsKuU3rEkZm/AViXkYiaGgLsYy0zB7DD4IJHQ0pkWHHZ\nSEEmdNzDSP/zAZb1Ygkc9RslphjvMxlNreyPhFZ1hYUJ2AbIs24apbUE4lAi\ntwJmaK2VtiuNvvb06Co6gOpldqn3Sr0whkJrbwO4/v0sqNUen65QHfnC/la/\nHABx\r\n=r/1+\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is modeled after the browser's\n`<input type=\"range\">` element.\n\nSliders follow accessibility best practices per the [WAI-ARIA spec](https://www.w3.org/TR/wai-aria-practices/#slider)\nand are fully RTL-aware.\n\n## Contents\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders follow the\n[WAI-ARIA guidelines](https://www.w3.org/TR/wai-aria-practices/#slider).\nPer the spec, ensure that the following attributes are added to the\n`mdc-slider__thumb` element(s):\n\n* `role=\"slider\"`\n* `aria-valuenow`: Value representing the current value.\n* `aria-valuemin`: Value representing the minimum allowed value.\n* `aria-valuemax`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value of `aria-valuenow` is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set to a string that makes the slider value\nunderstandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Continuous slider demo\" aria-valuemin=\"0\"\n       aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Continuous range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Continuous range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   `data-step` attribute on the root element. This will be the step size for\n    value quantization. If not set, the default is 1.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete slider with tick marks demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"20\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `tabindex=\"-1\"` attribute on the thumb(s)\n*   `aria-disabled=\"true\"` on the thumb(s)\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"-1\" aria-label=\"Disabled slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\" aria-disabled=\"true\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the thumb element's `aria-valuemin`,\n`aria-valuemax`, and `aria-valuenow` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"75\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string)|null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"03ec88b3967ad97da4309b1dee0b9764edcf89e1","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.22.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.fd608ff66.0","@material/rtl":"8.0.0-canary.fd608ff66.0","@material/base":"8.0.0-canary.fd608ff66.0","@material/theme":"8.0.0-canary.fd608ff66.0","@material/ripple":"8.0.0-canary.fd608ff66.0","@material/animation":"8.0.0-canary.fd608ff66.0","@material/elevation":"8.0.0-canary.fd608ff66.0","@material/typography":"8.0.0-canary.fd608ff66.0","@material/feature-targeting":"8.0.0-canary.fd608ff66.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_8.0.0-canary.fd608ff66.0_1600352766833_0.04029232737244559","host":"s3://npm-registry-packages"}},"8.0.0-canary.3e435ba57.0":{"name":"@material/slider","version":"8.0.0-canary.3e435ba57.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@8.0.0-canary.3e435ba57.0","maintainers":[{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"63ae9060e4d4ee1432b3c03d023853ca3cf855e1","tarball":"https://registry.npmjs.org/@material/slider/-/slider-8.0.0-canary.3e435ba57.0.tgz","fileCount":38,"integrity":"sha512-3WqSTW701SAL9l/cLc7kd81SxgEal8qME/Uo7rn7Do6EHcDXOpW+kISw8LSvIe9eGIUk9N2BU3M2beHAYDE9qA==","signatures":[{"sig":"MEUCIBx67o2xzdg5oY9Iz6+IXopZNU4NrMOfm86b44j1AAGiAiEA/L70bzNINbXP4QQ31s1eEt/31Uj4w8bPe8uQVy/IGW0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":771191,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfY3YKCRA9TVsSAnZWagAAMGEP/ib9h96uv6xiB7lw623S\nnXgm0nEDJ2pMQVZWOgqy8PlQbwuRe2ehsI79XAydfu5HrUtwo20jiOQx/FAF\nzy7acR2yOwkq6LTf9dxDPwsSYP0v2th4oyNOaGTt//i8IpVk+2HWpjLv5osN\nlw/1pipq/uQaSLlw25sOUsmpxnd88hwUnmp9V9YsymNmtqIVsdebQaLcUb+x\n+YkP4o5rW7S+Zz8TxVnMAwISjMxoExqFuLu4L6r+MHDs8FVt7ER3yGG/HtWP\nwGeq4OKrtL905eydryzmZCZ8l9grhb6ugq7D7iPS2dnMwCo/UfBe1uVa9WpM\niALAU2SqS1CcXg1kRsQWgRfi51AQ3HeitJYcjXuPr3wyFZJpqG4Cfa+tBCEd\nE7soEjhLeImaIy0m1aNjnLJI2g6Se2HFQWVjJxIOrPbfNpefXANEvYI50eoY\nxgdQzNaExBuo73dB2MMBvbzcu/7Cr+W7lv3eA6kF6ReWeqK3CC1tocSeGsBq\ntET3++Ce5WgdXnSgjsRGPmIZgaptCC3QKuGn+Tqs2bjBuGBAdGjivlRC5z6H\nJjD4BVJmApqH8dq4Fa2+R7Ipm1k7XZZeeP2KW81ExBAdc/5NMjuZZLw9GJMX\noD82AAKbXGeq1wbguMAG2IaY7iX/Qh+UnGG7a67oTkFXniF299Lw5Flx8e9P\n+n7O\r\n=gOwY\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is modeled after the browser's\n`<input type=\"range\">` element.\n\nSliders follow accessibility best practices per the [WAI-ARIA spec](https://www.w3.org/TR/wai-aria-practices/#slider)\nand are fully RTL-aware.\n\n## Contents\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders follow the\n[WAI-ARIA guidelines](https://www.w3.org/TR/wai-aria-practices/#slider).\nPer the spec, ensure that the following attributes are added to the\n`mdc-slider__thumb` element(s):\n\n* `role=\"slider\"`\n* `aria-valuenow`: Value representing the current value.\n* `aria-valuemin`: Value representing the minimum allowed value.\n* `aria-valuemax`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value of `aria-valuenow` is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set to a string that makes the slider value\nunderstandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Continuous slider demo\" aria-valuemin=\"0\"\n       aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Continuous range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Continuous range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   `data-step` attribute on the root element. This will be the step size for\n    value quantization. If not set, the default is 1.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete slider with tick marks demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"20\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `tabindex=\"-1\"` attribute on the thumb(s)\n*   `aria-disabled=\"true\"` on the thumb(s)\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"-1\" aria-label=\"Disabled slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\" aria-disabled=\"true\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the thumb element's `aria-valuemin`,\n`aria-valuemax`, and `aria-valuenow` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"75\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string)|null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"15ff2ccef4cf94fbadfb06cb750ee6de035cdd19","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.22.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.3e435ba57.0","@material/rtl":"8.0.0-canary.3e435ba57.0","@material/base":"8.0.0-canary.3e435ba57.0","@material/theme":"8.0.0-canary.3e435ba57.0","@material/ripple":"8.0.0-canary.3e435ba57.0","@material/animation":"8.0.0-canary.3e435ba57.0","@material/elevation":"8.0.0-canary.3e435ba57.0","@material/typography":"8.0.0-canary.3e435ba57.0","@material/feature-targeting":"8.0.0-canary.3e435ba57.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_8.0.0-canary.3e435ba57.0_1600353802112_0.39685132832695724","host":"s3://npm-registry-packages"}},"8.0.0-canary.c250ec52a.0":{"name":"@material/slider","version":"8.0.0-canary.c250ec52a.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@8.0.0-canary.c250ec52a.0","maintainers":[{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"d3d4bd15f96392706a8205fd7d720334e7c57d29","tarball":"https://registry.npmjs.org/@material/slider/-/slider-8.0.0-canary.c250ec52a.0.tgz","fileCount":38,"integrity":"sha512-KRCaUJJ1bXBdT6RzSqmUnmRjSOmy4zxlByRpykpl5BJBmSVmiqcA+X4oZx0Yb7Yvt42vJNwFDOAWP6WJt7kiCg==","signatures":[{"sig":"MEYCIQCozvgv5ChyQlSToLiu+mMZVxbrZASXXPy29YzEkolByAIhAMMB8CGD5MeOHDe1Ke1hTpqbslH851Jbty1983qHaSKR","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":771289,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfY8LNCRA9TVsSAnZWagAAncwQAI3QOZ2eErXWLcndNtIv\n8rQ+7LGBncxIDXjDR1lrQVXqMh4THrpm8oG3G1lpdlZ4/5H4t8elw3TFWARv\nhktsijWgDOrR4QWOPp1AFSu4W2oPwFtKSl9RX7J1C7OIWoVIum6LosuC6A17\n8JCnRyyQOkmr6qduXCv/pl9+Y3NgUAlCdZijV7hcDIOkEGVsTBz2O+pP1ii9\nX+yVEAx5vnJHDmbSpCZz24XRT+9wAP8oFwyufFq5BOOY0lUxZJup7gMnEPqo\nYSg7xZRQSkhH36xUygkjQkDOIrxYpvBseFfWdeZHcoPZ8ngvDMErwU8LIBNU\npUvyn1X89ampQcFgsZTGjotdbtmvjQhdhfXnP2Lv88PPZDujVen43JyXl3Et\nO2o1q0QxVdvjMJSOxolGzwfQRo9aKQwDwguzthRLjW5W7P0jTCYQTYe6Gqfo\nr4kgex3hAI+lBWbzOF7LaZJH5+Cpa0HSaCt0jjeSNWf8ZndnVSTStM/bBmYf\n1qKYFknxC8kGSwR1KV76TH5EhqwO+z3W5phWYMBfGmJ1IRXoaN7FuVfycQGW\ncOh4ds8Ix2jWFiPTCxcv8ZyiRv+1sX/oY7CCaLmqPmmADg0V0/W85yNcbRu/\nyIIXiHGM6NsUUaaYo7M5wH5ipKwjzrCM4hCTiJQw37if93DkTxGHv1h0gSpD\n8PK4\r\n=f8Xh\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is modeled after the browser's\n`<input type=\"range\">` element.\n\nSliders follow accessibility best practices per the [WAI-ARIA spec](https://www.w3.org/TR/wai-aria-practices/#slider)\nand are fully RTL-aware.\n\n## Contents\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders follow the\n[WAI-ARIA guidelines](https://www.w3.org/TR/wai-aria-practices/#slider).\nPer the spec, ensure that the following attributes are added to the\n`mdc-slider__thumb` element(s):\n\n* `role=\"slider\"`\n* `aria-valuenow`: Value representing the current value.\n* `aria-valuemin`: Value representing the minimum allowed value.\n* `aria-valuemax`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value of `aria-valuenow` is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set to a string that makes the slider value\nunderstandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Continuous slider demo\" aria-valuemin=\"0\"\n       aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Continuous range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Continuous range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   `data-step` attribute on the root element. This will be the step size for\n    value quantization. If not set, the default is 1.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete slider with tick marks demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"20\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `tabindex=\"-1\"` attribute on the thumb(s)\n*   `aria-disabled=\"true\"` on the thumb(s)\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"-1\" aria-label=\"Disabled slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\" aria-disabled=\"true\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the thumb element's `aria-valuemin`,\n`aria-valuemax`, and `aria-valuenow` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"75\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string)|null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"e214ca7cd3c1a65ab89d2fe2b4fc899aca418adc","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.22.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.c250ec52a.0","@material/rtl":"8.0.0-canary.c250ec52a.0","@material/base":"8.0.0-canary.c250ec52a.0","@material/theme":"8.0.0-canary.c250ec52a.0","@material/ripple":"8.0.0-canary.c250ec52a.0","@material/animation":"8.0.0-canary.c250ec52a.0","@material/elevation":"8.0.0-canary.c250ec52a.0","@material/typography":"8.0.0-canary.c250ec52a.0","@material/feature-targeting":"8.0.0-canary.c250ec52a.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_8.0.0-canary.c250ec52a.0_1600373453265_0.6830138253901372","host":"s3://npm-registry-packages"}},"8.0.0-canary.e34e411b1.0":{"name":"@material/slider","version":"8.0.0-canary.e34e411b1.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@8.0.0-canary.e34e411b1.0","maintainers":[{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"92e78a44bc95db8fdae5f96cb754dc3b3d6ebe27","tarball":"https://registry.npmjs.org/@material/slider/-/slider-8.0.0-canary.e34e411b1.0.tgz","fileCount":38,"integrity":"sha512-uGxyO0dqkiXaBa/ej6Yz2YVQj6SH3+jPrLumkJZ4QM89B0K8NKOP9pibeeo7M7EQXs1vPEhC+1ZWAMazMLkfDg==","signatures":[{"sig":"MEUCIHxb0P0QXMZPTpKvv+PXuiRLEJRviiIz0AlcyCEeTeugAiEApcQYo8l7hLius8goQPNHftI5fJqQttPu+nCL+spkLzQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":771289,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfY8SHCRA9TVsSAnZWagAAgmsP/iG74Z1lVrIaq1pYt/wN\nVqf8Jk4GEKf63C60503qFvStbPvjsE+aynIUPL8bjGkMbOcovR5hu40vGx7Z\nNo0aP9HCKLQ4WTAbi6yJIuyr9xyjyCIjA8+kQOO5+j7A9AOkmC9hYYIfZSEm\nNuLUgo0dyF1GT101K/DuIk+9MadIpDfgxoP5JrkPcUdo4N7LLRvRdZPRRVCi\npzz/+qKB3uuXIIToDPkKfO+l/ivKUcMWGQQ+75ZQMyBxlNCWaHNeFQnfVQUG\n48g9zMjKmQARsW1x0771gVjOIaLIGMfd6PpzEKpLoDwUr4jTj674BuTwdG1G\nvn8m1nO7+ifxxbK5XzEfFq0MqscLlofASTLvBP6Qu1SUCVBPR7GsnQurva0P\nX1w7jkiKCenZagJHrdm7EJceptyESt5kdyjghnFXXsKcFwoEjlo7eMkcJb1K\nEpzI3cVWxPc8R/9CKqJvX/W8FyujhrnfL1jylueQeH0ld4NN6KCS//Ou+lss\n7rZPKtSKgKchgpwCj0cbcaIkVYhhpn3m0nwS0ucK/0M+Uk1Gs0GnF9mncOcB\nLCW83NpmJjW2YqBywEa4To2OwFdWMreL1xmNtBY2C1qfN3LJIqSJt6bYzHSc\nUFSmzrLIVf4WrPDHiQVcFb6nboTVXm5QE7k26dCFMqIFMUvaeQ5CHTeL4Dwl\nV12O\r\n=Pk1/\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is modeled after the browser's\n`<input type=\"range\">` element.\n\nSliders follow accessibility best practices per the [WAI-ARIA spec](https://www.w3.org/TR/wai-aria-practices/#slider)\nand are fully RTL-aware.\n\n## Contents\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders follow the\n[WAI-ARIA guidelines](https://www.w3.org/TR/wai-aria-practices/#slider).\nPer the spec, ensure that the following attributes are added to the\n`mdc-slider__thumb` element(s):\n\n* `role=\"slider\"`\n* `aria-valuenow`: Value representing the current value.\n* `aria-valuemin`: Value representing the minimum allowed value.\n* `aria-valuemax`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value of `aria-valuenow` is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set to a string that makes the slider value\nunderstandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Continuous slider demo\" aria-valuemin=\"0\"\n       aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Continuous range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Continuous range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   `data-step` attribute on the root element. This will be the step size for\n    value quantization. If not set, the default is 1.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete slider with tick marks demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"20\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `tabindex=\"-1\"` attribute on the thumb(s)\n*   `aria-disabled=\"true\"` on the thumb(s)\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"-1\" aria-label=\"Disabled slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\" aria-disabled=\"true\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the thumb element's `aria-valuemin`,\n`aria-valuemax`, and `aria-valuenow` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"75\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string)|null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"460337b237852aa88d59152c38df2b32b73792a0","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.22.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.e34e411b1.0","@material/rtl":"8.0.0-canary.e34e411b1.0","@material/base":"8.0.0-canary.e34e411b1.0","@material/theme":"8.0.0-canary.e34e411b1.0","@material/ripple":"8.0.0-canary.e34e411b1.0","@material/animation":"8.0.0-canary.e34e411b1.0","@material/elevation":"8.0.0-canary.e34e411b1.0","@material/typography":"8.0.0-canary.e34e411b1.0","@material/feature-targeting":"8.0.0-canary.e34e411b1.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_8.0.0-canary.e34e411b1.0_1600373894718_0.49153095252483614","host":"s3://npm-registry-packages"}},"8.0.0-canary.4e9343929.0":{"name":"@material/slider","version":"8.0.0-canary.4e9343929.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@8.0.0-canary.4e9343929.0","maintainers":[{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"7a2e31fbb906bd5401a34e0c64535bbc9bdc47ba","tarball":"https://registry.npmjs.org/@material/slider/-/slider-8.0.0-canary.4e9343929.0.tgz","fileCount":38,"integrity":"sha512-KWrJTJahTdHD5QzY9cW0viGc1mZ+ksS+eK6Yt/tiqxrV7vYcij8Mo3MmMk9Reip5StqK8cOPHxsz89JbpM062Q==","signatures":[{"sig":"MEQCIFMDC4pbV4zMUfP4K44WJ/BA1hVpf7Q6tgKG8yuiYqOJAiAsu0h6ekrv8gGDQLiyK50TXwj77Ph5VrQRqhdIm36f0A==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":771289,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfY8pzCRA9TVsSAnZWagAAauUP/ioGn5ffnA4CiXLcs6NG\n2mTLnemaqftYR4HInpdh4EIzmJyl5Lvx89NvuMc6rX2vfSM78aEpfOOay3js\n/GrX+h9ajaYpRd2QnykutepW8CE8CyS7HX2iMDpez0/Jw4gwtB8NnJwl89gM\nDE4k6WWXYHTO9dVxrnCfkmW5TPsg6/uIqLM+UXB+XW7s6/euKSgqHQGO2zO5\nINWijA1AHjTWQf/qEg+TsayhaWPmdgr4axUPGR8Nfk7gSeIPH9Azgd39DodY\n3y6KAFGTLoMSiAhuBJo56UclBeUqT0p4h6AGcz3BozwrGA3jMd4id58O7qYk\nrHnpPFMziwNkynUFw/dvLfn4U/RNnWCtpq9jBjWQ1dS1E4enC8aCKLdQ/Z2p\nddJe5ACLDKPjjZV0uLVkc/Ilh4jjF3UNDcqvxpseNulq0yQbDQz47OAW4hb7\nxSc9lB3Qrqz4qC55zEtJgYgzAIr+D4hrFrZ7anngih7iX7SQicxrT1/u1ONf\nI0Hmn3kMZntjgJw0VuJ+f3+6Beq5FzNWFnFgHkXdlzaL5pYgX9uW0mr+n98q\nHJiwX6qUgqfnHoJC63Fkm6+m5jX+9nBZTpdGNzYEzUlp9mKt0kZLptwJPvXM\n0ShgMqfQ8OfdxCFyopHNygnBVOZbdRADpOPtGjEYn6+16fZcUKdo13uLbF+j\nJejv\r\n=zBJe\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is modeled after the browser's\n`<input type=\"range\">` element.\n\nSliders follow accessibility best practices per the [WAI-ARIA spec](https://www.w3.org/TR/wai-aria-practices/#slider)\nand are fully RTL-aware.\n\n## Contents\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders follow the\n[WAI-ARIA guidelines](https://www.w3.org/TR/wai-aria-practices/#slider).\nPer the spec, ensure that the following attributes are added to the\n`mdc-slider__thumb` element(s):\n\n* `role=\"slider\"`\n* `aria-valuenow`: Value representing the current value.\n* `aria-valuemin`: Value representing the minimum allowed value.\n* `aria-valuemax`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value of `aria-valuenow` is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set to a string that makes the slider value\nunderstandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Continuous slider demo\" aria-valuemin=\"0\"\n       aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Continuous range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Continuous range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   `data-step` attribute on the root element. This will be the step size for\n    value quantization. If not set, the default is 1.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete slider with tick marks demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"20\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `tabindex=\"-1\"` attribute on the thumb(s)\n*   `aria-disabled=\"true\"` on the thumb(s)\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"-1\" aria-label=\"Disabled slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\" aria-disabled=\"true\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the thumb element's `aria-valuemin`,\n`aria-valuemax`, and `aria-valuenow` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"75\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string)|null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"7bab75a521cc7f81a2f78587d2146ac140e3cfc1","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.22.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.4e9343929.0","@material/rtl":"8.0.0-canary.4e9343929.0","@material/base":"8.0.0-canary.4e9343929.0","@material/theme":"8.0.0-canary.4e9343929.0","@material/ripple":"8.0.0-canary.4e9343929.0","@material/animation":"8.0.0-canary.4e9343929.0","@material/elevation":"8.0.0-canary.4e9343929.0","@material/typography":"8.0.0-canary.4e9343929.0","@material/feature-targeting":"8.0.0-canary.4e9343929.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_8.0.0-canary.4e9343929.0_1600375410688_0.7299304812971104","host":"s3://npm-registry-packages"}},"8.0.0-canary.4e5c350c2.0":{"name":"@material/slider","version":"8.0.0-canary.4e5c350c2.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@8.0.0-canary.4e5c350c2.0","maintainers":[{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"630517088dc5d9dceca0ac926c016e4ef24cc2cc","tarball":"https://registry.npmjs.org/@material/slider/-/slider-8.0.0-canary.4e5c350c2.0.tgz","fileCount":38,"integrity":"sha512-RHc/h9OPqJoG8y3zhXm8505HLsqe7uD8B02s0MpTUt7ohhkW8NBzri7ZCyOyMBLk6EhXJ3HuQV4yKnycacFBLw==","signatures":[{"sig":"MEUCICXPp2b6MpK4eSnGEVr5Sh2FRg+Wm4vJ4FMgcqf8ZR8oAiEAven4N9yhVqn3vv7tx7f1wZxW7J1A/JRXDzoMHnoarn4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":771289,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfaRe3CRA9TVsSAnZWagAAsAAP/1LmA/xKSDucd45DxEz2\nFvpuzO934KPFZb8L9ul4718IeE0tc+V4G1oBpt3WFMlSSaQ0pqCR/DAo9Y9p\nFeL/V76m2rnFFrmtF44cJzKV84410efBygYHKpBZZmZZagSD+HgQxZBiUFA7\nQndMVU0qCjDoKLZNDgJXSZwrx9Lt4aswAY53AbGv+BeTwMSJvrNuie3ZPHiV\nVHvX+04sClwg28HIWbLOKD5RXDtDH4kscJ23Sq4autlc2sx6Avukmvw6w630\nB8R/wMFkVZEOjM+96vTVe38YygsdV6ZTr9ftRhlWygmzaxWEC4rZiybswFsT\n+pPX7GNHbdpGR+gdadUmeendK9EbvRDTM1sOl8H4LBrJImsT4Nn6JZ6Pm+wE\nD4EzLKjnsQA+AtIE7zUbxQL4bsVYnYCnHfS2KR1idNKb0WJuzYdsgVo2oGFs\nX6bMB9Nuoke1YiA391KGsN8Bso8sYXbO+N4nZM3GKRrp9ac9DJvofjISrGMH\ndkwI3+QcuZJ0q7WrJ4JKNpoy4aLRdRBO/ifKKPO60RXzIqgjqvPeYzE3yb0B\nWGw/bBcKRKskF8s0wIfKxUSdiXZl0F/+81rRErOKQsTm8a9u/qMd8vRTaiML\nswBuE0APRET/X2G4n2Ea3Tzm/i9cBV+moj5coq+aJF6q2/yPF/q4hDnVb/8D\nhod+\r\n=SqV0\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is modeled after the browser's\n`<input type=\"range\">` element.\n\nSliders follow accessibility best practices per the [WAI-ARIA spec](https://www.w3.org/TR/wai-aria-practices/#slider)\nand are fully RTL-aware.\n\n## Contents\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders follow the\n[WAI-ARIA guidelines](https://www.w3.org/TR/wai-aria-practices/#slider).\nPer the spec, ensure that the following attributes are added to the\n`mdc-slider__thumb` element(s):\n\n* `role=\"slider\"`\n* `aria-valuenow`: Value representing the current value.\n* `aria-valuemin`: Value representing the minimum allowed value.\n* `aria-valuemax`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value of `aria-valuenow` is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set to a string that makes the slider value\nunderstandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Continuous slider demo\" aria-valuemin=\"0\"\n       aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Continuous range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Continuous range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   `data-step` attribute on the root element. This will be the step size for\n    value quantization. If not set, the default is 1.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete slider with tick marks demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"20\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `tabindex=\"-1\"` attribute on the thumb(s)\n*   `aria-disabled=\"true\"` on the thumb(s)\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"-1\" aria-label=\"Disabled slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\" aria-disabled=\"true\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the thumb element's `aria-valuemin`,\n`aria-valuemax`, and `aria-valuenow` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"75\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string)|null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"c753481bcbad808064a366112868670fca5381f5","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.22.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.4e5c350c2.0","@material/rtl":"8.0.0-canary.4e5c350c2.0","@material/base":"8.0.0-canary.4e5c350c2.0","@material/theme":"8.0.0-canary.4e5c350c2.0","@material/ripple":"8.0.0-canary.4e5c350c2.0","@material/animation":"8.0.0-canary.4e5c350c2.0","@material/elevation":"8.0.0-canary.4e5c350c2.0","@material/typography":"8.0.0-canary.4e5c350c2.0","@material/feature-targeting":"8.0.0-canary.4e5c350c2.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_8.0.0-canary.4e5c350c2.0_1600722871209_0.7532449230245253","host":"s3://npm-registry-packages"}},"8.0.0-canary.16c563ef7.0":{"name":"@material/slider","version":"8.0.0-canary.16c563ef7.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@8.0.0-canary.16c563ef7.0","maintainers":[{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"8cb9edfa416e12e1672bf7eb5620933df40cfa2c","tarball":"https://registry.npmjs.org/@material/slider/-/slider-8.0.0-canary.16c563ef7.0.tgz","fileCount":38,"integrity":"sha512-QUmiMQz9FAPijna/5ES8V3TPamYgSexa+Uy74X3TTLRtx3nUjhOwbJsl7/8Vgn61ZaPd/DUtlCIv8JLS3hiNfQ==","signatures":[{"sig":"MEQCIB4F5JQ1oK2o9EFhVT1U5g/gEdp2/ZunJ0Kt3QkCVgZfAiAXRBAOMXIX4lXlZLDGm5epQUh5Y9H8iyNkbJI15BuWYQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":771402,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfalSgCRA9TVsSAnZWagAA73EP/irAVMUzagS4MoqYV7pH\nvBeFr3fLPSHWTFobCKNbaNHGEij5NLG3ch2Vl5CD7+oOuLxQPpnbnJFF1csk\nGiHPj9fSkJtv1/+Zbz2dRfL73vgkz7ddwyMhhOdgG32f4rlBeWyTU0Cl9COM\nfPzwjmUNwl02rmlRwn4auqJhJfzQ0ccWMdKZ7DfDFnEGs0Y7UX3UpVQycKJm\nU+yJHsNBsrIY0VwZ/nWo8ADa+kSFsj6Ar0fAZFsi56YaoNK4YON6WLoNLN+g\nro1M5lE9bXVWz2eEReY6BhmYZ4xJefEHxQ/e7gic/0Q6rwQkwBhAFsNnV0LU\ndcR51tz2oiVd9pQl0Iga31mlBI6LIfM4asrI/lW1G9H8CXhhHx/PSi01ef2Z\nm7i5gxi7pIiifnTAA66/l/U7UJCcfKTxTo01YMUHHZlHqh1fr9tXTAS3TsIJ\nrWOaoY6qctN5jF7Nhh/uc4yigAdQdWClj1P/TpdxhZTmcP6V6Rz1etTCc0s4\nsrb7PFeD0EQlhKKWN5ZxE4yNwUgfvEjvpfp3uWdDDjMMrmTPDOMjCZV3aXhU\nX2X+m8i1YB0DgWdfCOCpVDvsHoi/0T1cqVqS+6M/IlAUcMa3c+5F6teLoaYt\nbY36YfBXEKN8XUG1O0NKh0Pezn7Q4yffFpOe0UPY4kAXPK8+i8nGNVKLHZab\n39N/\r\n=Y/XL\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is modeled after the browser's\n`<input type=\"range\">` element.\n\nSliders follow accessibility best practices per the [WAI-ARIA spec](https://www.w3.org/TR/wai-aria-practices/#slider)\nand are fully RTL-aware.\n\n## Contents\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders follow the\n[WAI-ARIA guidelines](https://www.w3.org/TR/wai-aria-practices/#slider).\nPer the spec, ensure that the following attributes are added to the\n`mdc-slider__thumb` element(s):\n\n* `role=\"slider\"`\n* `aria-valuenow`: Value representing the current value.\n* `aria-valuemin`: Value representing the minimum allowed value.\n* `aria-valuemax`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value of `aria-valuenow` is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set to a string that makes the slider value\nunderstandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Continuous slider demo\" aria-valuemin=\"0\"\n       aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Continuous range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Continuous range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   `data-step` attribute on the root element. This will be the step size for\n    value quantization. If not set, the default is 1.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete slider with tick marks demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"20\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `tabindex=\"-1\"` attribute on the thumb(s)\n*   `aria-disabled=\"true\"` on the thumb(s)\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"-1\" aria-label=\"Disabled slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\" aria-disabled=\"true\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the thumb element's `aria-valuemin`,\n`aria-valuemax`, and `aria-valuenow` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"75\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string)|null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"e3abdb235aa76184bd5171f68c237f58b8541f7a","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.22.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.16c563ef7.0","@material/rtl":"8.0.0-canary.16c563ef7.0","@material/base":"8.0.0-canary.16c563ef7.0","@material/theme":"8.0.0-canary.16c563ef7.0","@material/ripple":"8.0.0-canary.16c563ef7.0","@material/animation":"8.0.0-canary.16c563ef7.0","@material/elevation":"8.0.0-canary.16c563ef7.0","@material/typography":"8.0.0-canary.16c563ef7.0","@material/feature-targeting":"8.0.0-canary.16c563ef7.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_8.0.0-canary.16c563ef7.0_1600804000278_0.13193693835870035","host":"s3://npm-registry-packages"}},"8.0.0-canary.fd8af3d43.0":{"name":"@material/slider","version":"8.0.0-canary.fd8af3d43.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@8.0.0-canary.fd8af3d43.0","maintainers":[{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"88cbab1ad044e5f81ae28d11e8ce5885783737ba","tarball":"https://registry.npmjs.org/@material/slider/-/slider-8.0.0-canary.fd8af3d43.0.tgz","fileCount":38,"integrity":"sha512-i5NK5dScvv3GoNyfd8B4Ula5SPrB0Ae4MPU4lLDyUrg1700fA/lSmhHx3ht/ken6mpuwoIkKwwkbysvuLe4p6w==","signatures":[{"sig":"MEUCIQD4X2HG0Xk0ptQArrHT7u3D/0pW9EWjl7HyrUpeLCQ1pwIgFmngOcuaCwCrplXUGGDIye+ymJADP+7k3UWQ7ZV+20M=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":771402,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfa6LbCRA9TVsSAnZWagAAuEAP/jfesskt+xsUP74al8ha\nFqg/btz+j0muCUaI94ZlT4Y9mgHMNYQhe6knLWF1fQ2Q8MrYOkbJhAr+JVEG\nvSEYrrDiMiZ3uJlzK/WwlTkwqI1aOUlelvr6BXfx2OJ7uZuYiR7VcuEV/Ybg\nGXuuYLfrr93ZsF1ouwl0sCl5KTUhf4QwlGTecrsZC6yTFxo2YgNf3bYvxh/9\nDAxJCkmfzKscR0IZTwiPEdZwOASOuFXGk4z2FUBG2STk8eTT10uhxyDnqKot\ntbYOzSMabjfYIq6PITUlnzLFmo3lPe5p47TIpAHgBZclb0xoAzZn3yPV+1w5\nDTZ6iWcsDFIzhLaiZzUgazEg6eQjjr26ZDt0FCNEVmMkChhf2vuBTI9lnp6i\n0qxUDyHY+sHubN3rK6F5ODCCYJRylch65iqqdMp6XT227dMNx71MGqJEfHZI\nPM5QBLTrxZFdvhlf2D2Qp7pm4YJqUVbcIEYb3Yf00THe3q1FmiygkPPbtITU\nW5BgB5PdIU0Zw1L1i8hPL+OiiafxUm1KzVwFzlkjSXyZT6KOv6J349jM3+ZE\nYq938trPTHTmJOJz1lQA4LR25GD8KtXMAuX4uU+AlxkBUpG+DUDHEWVKH9Qf\nUX1OeHZCfhq4GtQKiu2jgWlF0Ex2fQu3pcB3Pfp3kXSUlICCTA+zz+6XT952\n9yse\r\n=pEcn\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is modeled after the browser's\n`<input type=\"range\">` element.\n\nSliders follow accessibility best practices per the [WAI-ARIA spec](https://www.w3.org/TR/wai-aria-practices/#slider)\nand are fully RTL-aware.\n\n## Contents\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders follow the\n[WAI-ARIA guidelines](https://www.w3.org/TR/wai-aria-practices/#slider).\nPer the spec, ensure that the following attributes are added to the\n`mdc-slider__thumb` element(s):\n\n* `role=\"slider\"`\n* `aria-valuenow`: Value representing the current value.\n* `aria-valuemin`: Value representing the minimum allowed value.\n* `aria-valuemax`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value of `aria-valuenow` is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set to a string that makes the slider value\nunderstandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Continuous slider demo\" aria-valuemin=\"0\"\n       aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Continuous range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Continuous range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   `data-step` attribute on the root element. This will be the step size for\n    value quantization. If not set, the default is 1.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete slider with tick marks demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"20\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `tabindex=\"-1\"` attribute on the thumb(s)\n*   `aria-disabled=\"true\"` on the thumb(s)\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"-1\" aria-label=\"Disabled slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\" aria-disabled=\"true\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the thumb element's `aria-valuemin`,\n`aria-valuemax`, and `aria-valuenow` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"75\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string)|null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"0f295a5eb9518e726dc271a945985bba278bf9e2","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.22.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.fd8af3d43.0","@material/rtl":"8.0.0-canary.fd8af3d43.0","@material/base":"8.0.0-canary.fd8af3d43.0","@material/theme":"8.0.0-canary.fd8af3d43.0","@material/ripple":"8.0.0-canary.fd8af3d43.0","@material/animation":"8.0.0-canary.fd8af3d43.0","@material/elevation":"8.0.0-canary.fd8af3d43.0","@material/typography":"8.0.0-canary.fd8af3d43.0","@material/feature-targeting":"8.0.0-canary.fd8af3d43.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_8.0.0-canary.fd8af3d43.0_1600889562727_0.12402573288751095","host":"s3://npm-registry-packages"}},"8.0.0-canary.d4cd83a85.0":{"name":"@material/slider","version":"8.0.0-canary.d4cd83a85.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@8.0.0-canary.d4cd83a85.0","maintainers":[{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"0f7d1dd0d273db85044da8cc73d873a712fc9474","tarball":"https://registry.npmjs.org/@material/slider/-/slider-8.0.0-canary.d4cd83a85.0.tgz","fileCount":38,"integrity":"sha512-qOOjUb4TrohvLGhp8/WkH2+VTthVUGB39lbXNHBjva20B1VJExPgIyAJ784IVtucwMppms+8GMRW5v9AoXBbBw==","signatures":[{"sig":"MEUCIHz71xmaFQE6VyPgX959XYGSdyZnIxFWFbazLobpnhpXAiEA0T9WBIjgnPzfqdrGZwnMsjGP/PjYF6xr/HNLRWQAmOo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":771402,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfbTtzCRA9TVsSAnZWagAAOTQP/3ccAb/YPNj5MkMYKvIi\nofywS4QxB0fCqeVFhaQKz4tahd/aQEjKnjZw4Aagq377CkHKifcCIqEuuWAU\n7ruu8qEvX2YdYGND3UH+niAP9ImW4z0YYYVuNvGhANgmSlCAKQRhVSjxVvEF\n/lADRM7RP2Pk8yN0uZOveV3HtG2WNOBdAa89OAksw+3b72DG63fqkktEczw+\nGwfVCuCXoW/8+Puc8CA8bzPcKfohFfu56D2X419k0NbqN4xXqceFpfHx34b8\nPzeSTCOy24pgWt9DNjdbg6kuFmUk3X7nVkM845Kl6oV2RpAllM9sJeI761Ia\nagDAe20h+cB9E2WNooLmLlEcycK+R7C1Iu5/X79ZZLWuVTxbxfAEz66XA1BB\ncM2W1nmN8mbxETndXtHmYpKUxah6A3kJ/1Wvy6CKucLHW2qerQx7w1tfNMYn\nBPm4yR+twLM3nLm+fGisWJ28M+rriuyeeRwrW5KCoFsarb69TZFFv1uChkD+\np2T9tnxAR4r3yUu3kEF8ur38vTTLI6Dr8DrhR/WRKHNwTAe/u5BYOfOjDoF2\nYnLcL4uFzo1icHU58ARbntPwYtuCZUR0Z9vjOmAQ9XBkYbSuiGbcywkCblrQ\nrS+IsvfK3KN8U5Z5KQttAgUEynpXAeIvq800fKAiBXNfBr5wxS6DUEUsz95f\nbveB\r\n=TZ/c\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is modeled after the browser's\n`<input type=\"range\">` element.\n\nSliders follow accessibility best practices per the [WAI-ARIA spec](https://www.w3.org/TR/wai-aria-practices/#slider)\nand are fully RTL-aware.\n\n## Contents\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders follow the\n[WAI-ARIA guidelines](https://www.w3.org/TR/wai-aria-practices/#slider).\nPer the spec, ensure that the following attributes are added to the\n`mdc-slider__thumb` element(s):\n\n* `role=\"slider\"`\n* `aria-valuenow`: Value representing the current value.\n* `aria-valuemin`: Value representing the minimum allowed value.\n* `aria-valuemax`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value of `aria-valuenow` is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set to a string that makes the slider value\nunderstandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Continuous slider demo\" aria-valuemin=\"0\"\n       aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Continuous range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Continuous range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   `data-step` attribute on the root element. This will be the step size for\n    value quantization. If not set, the default is 1.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete slider with tick marks demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"20\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `tabindex=\"-1\"` attribute on the thumb(s)\n*   `aria-disabled=\"true\"` on the thumb(s)\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"-1\" aria-label=\"Disabled slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\" aria-disabled=\"true\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the thumb element's `aria-valuemin`,\n`aria-valuemax`, and `aria-valuenow` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"75\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string)|null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"80cc7639dca83570a37de4bcf4d7501246ee8eee","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.22.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.22.1","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.d4cd83a85.0","@material/rtl":"8.0.0-canary.d4cd83a85.0","@material/base":"8.0.0-canary.d4cd83a85.0","@material/theme":"8.0.0-canary.d4cd83a85.0","@material/ripple":"8.0.0-canary.d4cd83a85.0","@material/animation":"8.0.0-canary.d4cd83a85.0","@material/elevation":"8.0.0-canary.d4cd83a85.0","@material/typography":"8.0.0-canary.d4cd83a85.0","@material/feature-targeting":"8.0.0-canary.d4cd83a85.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_8.0.0-canary.d4cd83a85.0_1600994162455_0.3254843939569716","host":"s3://npm-registry-packages"}},"8.0.0-canary.199aecdfb.0":{"name":"@material/slider","version":"8.0.0-canary.199aecdfb.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@8.0.0-canary.199aecdfb.0","maintainers":[{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"2b488ef8c435331e887a6443f6b96eb864ce643f","tarball":"https://registry.npmjs.org/@material/slider/-/slider-8.0.0-canary.199aecdfb.0.tgz","fileCount":38,"integrity":"sha512-8urGWf0tmW3HOnDTcCRrVBU8sWCd7QmhWOVQcK1UJKLykWfZIcJZpgvWL8K94aOBOFEYBaF0HyIH2Q+JgiZwmw==","signatures":[{"sig":"MEUCIQCyrFvyod/kNeyNXjmb9K9gfnufd0lncfi2wNcl95BJtQIgQgc19nFf2uy1HjWTfx0cHO0H6tK0i9mVJXM9c5qihF0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":771402,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfbhIPCRA9TVsSAnZWagAA2HsP/3KHW9SAL5NlMyQ0lCHc\nPM44/5Bg3NJmPtRI5XwSgmNrDRZYAP8T2AqEbxXngIWvwdxqPqjbgqv8CmxM\nuizycQRLIVUryXXxnTVDeDxunUHrMbmB2B9yOnPvonVX9xQIQ1tzQ8U8Ycix\nk4SsVXVqHoXoSv+71etpIU4Xd/x+6TpfhjCO1xd/pmfs7Cet2okrqtuJhbIf\navhuVb8npf6d741+ayWWyJQpxJ+rjPPB33t4S2HeaW9R1Y42IIiREYOUb5Tm\nmJh05KhHYWTjSTDvhTY6XTBxFYXgIcEko03st79t/piZ07p+A4h1hc2uMZmH\nTjWXPJe6TdEtKPePOXM9E0KqcMbpyC3Cl+23olOrvuzMfS/FVsx8cl5umQF2\nt8uETmBsBIUbLgfdwT6IfowyBgRnxoIho4ARoql3KD27oUqH5QQ01SPOv9rJ\njc448JqO73xhqK1l7hVhyvFLWA/uHfeoezkwUFjczJq1bm4ReD7Di7TK1xPN\nf3TRX5vTynNhuXLPVp0LBoeEV2jvrbt5o5FnyYkDNGCX+JpcSPI5/L9o9Nfs\nAjynXrd2EaVjr7s28NTIOfAzwr58htJlPwk7YVMMMKDyFGV3z3N4othQPlbz\nGNCgg/jXtIfO4OP3W0svp+V8dWQxUvY2EYIcBPjZCjEgbdXdf80K/6GWcHuS\nuExP\r\n=LtIt\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is modeled after the browser's\n`<input type=\"range\">` element.\n\nSliders follow accessibility best practices per the [WAI-ARIA spec](https://www.w3.org/TR/wai-aria-practices/#slider)\nand are fully RTL-aware.\n\n## Contents\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders follow the\n[WAI-ARIA guidelines](https://www.w3.org/TR/wai-aria-practices/#slider).\nPer the spec, ensure that the following attributes are added to the\n`mdc-slider__thumb` element(s):\n\n* `role=\"slider\"`\n* `aria-valuenow`: Value representing the current value.\n* `aria-valuemin`: Value representing the minimum allowed value.\n* `aria-valuemax`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value of `aria-valuenow` is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set to a string that makes the slider value\nunderstandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Continuous slider demo\" aria-valuemin=\"0\"\n       aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Continuous range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Continuous range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   `data-step` attribute on the root element. This will be the step size for\n    value quantization. If not set, the default is 1.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete slider with tick marks demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"20\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `tabindex=\"-1\"` attribute on the thumb(s)\n*   `aria-disabled=\"true\"` on the thumb(s)\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"-1\" aria-label=\"Disabled slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\" aria-disabled=\"true\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the thumb element's `aria-valuemin`,\n`aria-valuemax`, and `aria-valuenow` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"75\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string)|null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"2ced06dc0aac728f58cce508c7393aec959895d6","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.22.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.22.1","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.199aecdfb.0","@material/rtl":"8.0.0-canary.199aecdfb.0","@material/base":"8.0.0-canary.199aecdfb.0","@material/theme":"8.0.0-canary.199aecdfb.0","@material/ripple":"8.0.0-canary.199aecdfb.0","@material/animation":"8.0.0-canary.199aecdfb.0","@material/elevation":"8.0.0-canary.199aecdfb.0","@material/typography":"8.0.0-canary.199aecdfb.0","@material/feature-targeting":"8.0.0-canary.199aecdfb.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_8.0.0-canary.199aecdfb.0_1601049103306_0.3042277801353266","host":"s3://npm-registry-packages"}},"8.0.0-canary.38ef4501f.0":{"name":"@material/slider","version":"8.0.0-canary.38ef4501f.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@8.0.0-canary.38ef4501f.0","maintainers":[{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"c2cd92be31baa3f9677e14d4b2d91e68de14eb39","tarball":"https://registry.npmjs.org/@material/slider/-/slider-8.0.0-canary.38ef4501f.0.tgz","fileCount":38,"integrity":"sha512-SY0zRneaK53SK4qbU7zDCPjClyG1OIgrd0KGn7Qsb+eQAfTet9GGdp9aJ2NE8eLcgzWOHrPO6TgoEbfL6yGp+Q==","signatures":[{"sig":"MEUCICW0B9SxddsAyN9Rn7FzI54KrRc2GpupILKDsAb7gTUyAiEAxpMrFUn1DCa4RQf7faHUAM0WD/p6s6ZqTPwMt0KYwmo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":771402,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfdM13CRA9TVsSAnZWagAAD2AP+QAXYGhEbVUm95Vs8byh\nTB5gSzGSvAj6MBp12NDgjFUrvPDFsDH6YUEDiVLo88zAQlxAHW2rmeupH/GX\nfB//fI7Rl8IwhgdG8qdyjoB+tpXyPfv1SpolRxim/Hzp1bYfcnHmrYlGfB9Z\nCWkPi6LhB+EBre7A48xPyYLmSfGMEawQvXMVKgqPYBWyzv2o9ZcRryCQ2OUm\nUNcDmC2fpFkZ67lf2jhOSk9ICL7QbyzEb4LOgctAC+ZnENgpWg99nOQfFLOz\nU+aevBhUxJZJ60VHAljqtZcLqXgMezTiOCjsOq2lsZQQ8istvYWaCeSs3Puu\nSD5HlxgLav5LSz30UJdGT7QA0KSaxLOQCCnvUadHFgZZFhrTO9A13N174GTS\nkyExNT20jiIsIPo0DGbPDTUE74Nyir5jE1sdETuUXjocaOnnpnak7wVdLpXU\nAhK6aidspv+8Oig6R8wImMSPhS0/RvkRdUhsead/+VBul8HWcPZYvatwjzjP\nE77zVHpESa0+8ZDD+/phbBfBRaJ3yQNWrxb8fTOP3Q1OZms4i/p6l9wdIjWC\n58fnSUjtdRAMzcYZwfNvjpQP2VFdxm5qJ4/sArBmk5Awe1xyQwVbh4cYL31K\nR5DsqO/P4XNH++0okParfHQRPxyIyusYME1C4Y1Wqb3BKIvDRMkfn+THxlsg\n6ObZ\r\n=SnEV\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is modeled after the browser's\n`<input type=\"range\">` element.\n\nSliders follow accessibility best practices per the [WAI-ARIA spec](https://www.w3.org/TR/wai-aria-practices/#slider)\nand are fully RTL-aware.\n\n## Contents\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders follow the\n[WAI-ARIA guidelines](https://www.w3.org/TR/wai-aria-practices/#slider).\nPer the spec, ensure that the following attributes are added to the\n`mdc-slider__thumb` element(s):\n\n* `role=\"slider\"`\n* `aria-valuenow`: Value representing the current value.\n* `aria-valuemin`: Value representing the minimum allowed value.\n* `aria-valuemax`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value of `aria-valuenow` is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set to a string that makes the slider value\nunderstandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Continuous slider demo\" aria-valuemin=\"0\"\n       aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Continuous range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Continuous range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   `data-step` attribute on the root element. This will be the step size for\n    value quantization. If not set, the default is 1.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete slider with tick marks demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"20\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `tabindex=\"-1\"` attribute on the thumb(s)\n*   `aria-disabled=\"true\"` on the thumb(s)\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"-1\" aria-label=\"Disabled slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\" aria-disabled=\"true\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the thumb element's `aria-valuemin`,\n`aria-valuemax`, and `aria-valuenow` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"75\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string)|null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"bace3094edebc680b12a257aebfe6170928076ab","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.22.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.22.1","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.38ef4501f.0","@material/rtl":"8.0.0-canary.38ef4501f.0","@material/base":"8.0.0-canary.38ef4501f.0","@material/theme":"8.0.0-canary.38ef4501f.0","@material/ripple":"8.0.0-canary.38ef4501f.0","@material/animation":"8.0.0-canary.38ef4501f.0","@material/elevation":"8.0.0-canary.38ef4501f.0","@material/typography":"8.0.0-canary.38ef4501f.0","@material/feature-targeting":"8.0.0-canary.38ef4501f.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_8.0.0-canary.38ef4501f.0_1601490294886_0.7702521731462788","host":"s3://npm-registry-packages"}},"8.0.0-canary.774dcfc8e.0":{"name":"@material/slider","version":"8.0.0-canary.774dcfc8e.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@8.0.0-canary.774dcfc8e.0","maintainers":[{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"5b3e9ddae45419e97d43ce190debd902212d2c38","tarball":"https://registry.npmjs.org/@material/slider/-/slider-8.0.0-canary.774dcfc8e.0.tgz","fileCount":38,"integrity":"sha512-SH64OdnOQPPPGZqu1cqInahBPyNL/4XYK0mz8lBFVBBuSTPPu3j6RI+BWYJ8sPD9oboNDD+sEFnd7f3R5rkm4g==","signatures":[{"sig":"MEQCIAgdzk0OMSzSYaW9CNpjjdHCViVoCruDs94nwlIPgIt2AiBSEdIC+FAGwRHip6Af/M7BK9Lhzp0KErw8Cw4SX3Yj5A==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":771402,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfdadZCRA9TVsSAnZWagAAZQgP/3LdWvkNArO3g62lI2Bz\nhWhrUR9TRVEmtWwWke9OGeXnKB+ahg+0BRVaunb5Zj78/GsWK4zxk7v2nwOM\nXMvmN03gUrTNGTihzNYO/EY1dpmUdBAGyx6jhUwVJtv6YkVga4n0cr53MMzE\nrWwxwTpgndF41cyZZjVIQlqW3UmIWEGLj7Xrb9nIChhgVF+emtt8qIbGZDmN\nEJhZtc1ajvQDKOAyNMPpmNRYhysQ2gVLsfqAMmVGuz/MN1DLxTe2C31+7TVN\nGQLWd+aNepHaFtYHF0MZ+B+9hAZ/7cLSDtULIpRGgbJy4Rcd9BwxS9/jLkUe\nAU8UcKFSZtqv8PUdFjP20M458gy3kyhWXO5hs9JqV95Pq7NOiwWD/X+rhEMe\nsDVPalrbwhKEj8gTj+QwClhWnckqDgoc6OrfyH5XAeQB6+YinwBM0IeiK2ak\nBqMk/yHlGqM6JmRf5V3q/GZo1+OcN3GNqAR8UoTGjdvLbbN8we8ia0UB8C9n\n8t0K0pMXUCUrMNJBTnK8SEsJOfBGpcGtUOUKMp3XGMRs8eyCz9vkoL1Yus6b\neyi6RJEDWsArQnivMlnKkcSmetGSGhv10Ph/W3W69lXFV0iFR/hRCKKKi9Xn\nGVlYBJ2X3bufmqY+cMLtrrgvuynP5cbq0Y+T59UxgqEVgtYVFSu9696AMNGF\nt2q3\r\n=iv6i\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is modeled after the browser's\n`<input type=\"range\">` element.\n\nSliders follow accessibility best practices per the [WAI-ARIA spec](https://www.w3.org/TR/wai-aria-practices/#slider)\nand are fully RTL-aware.\n\n## Contents\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders follow the\n[WAI-ARIA guidelines](https://www.w3.org/TR/wai-aria-practices/#slider).\nPer the spec, ensure that the following attributes are added to the\n`mdc-slider__thumb` element(s):\n\n* `role=\"slider\"`\n* `aria-valuenow`: Value representing the current value.\n* `aria-valuemin`: Value representing the minimum allowed value.\n* `aria-valuemax`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value of `aria-valuenow` is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set to a string that makes the slider value\nunderstandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Continuous slider demo\" aria-valuemin=\"0\"\n       aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Continuous range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Continuous range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   `data-step` attribute on the root element. This will be the step size for\n    value quantization. If not set, the default is 1.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete slider with tick marks demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"20\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `tabindex=\"-1\"` attribute on the thumb(s)\n*   `aria-disabled=\"true\"` on the thumb(s)\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"-1\" aria-label=\"Disabled slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\" aria-disabled=\"true\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the thumb element's `aria-valuemin`,\n`aria-valuemax`, and `aria-valuenow` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"75\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string)|null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"6c37b80b059fbd4c815253f3a3868578afcc1afd","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.22.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.22.1","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.774dcfc8e.0","@material/rtl":"8.0.0-canary.774dcfc8e.0","@material/base":"8.0.0-canary.774dcfc8e.0","@material/theme":"8.0.0-canary.774dcfc8e.0","@material/ripple":"8.0.0-canary.774dcfc8e.0","@material/animation":"8.0.0-canary.774dcfc8e.0","@material/elevation":"8.0.0-canary.774dcfc8e.0","@material/typography":"8.0.0-canary.774dcfc8e.0","@material/feature-targeting":"8.0.0-canary.774dcfc8e.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_8.0.0-canary.774dcfc8e.0_1601546072843_0.05497339799552692","host":"s3://npm-registry-packages"}},"8.0.0-canary.0f60323a8.0":{"name":"@material/slider","version":"8.0.0-canary.0f60323a8.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@8.0.0-canary.0f60323a8.0","maintainers":[{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"971146c84047112fa4d1a8b812377d80ef11317b","tarball":"https://registry.npmjs.org/@material/slider/-/slider-8.0.0-canary.0f60323a8.0.tgz","fileCount":38,"integrity":"sha512-1+1CND0N9r5wtqJCotGWaDEx2xeSLaQFDowW3uDvRDq9XVnvAdUKbKXdEAzXynVPNrR53+W610qsd5RXyi0trg==","signatures":[{"sig":"MEUCIBwqjidGS1O8dFLL12VGhB1ftQsNhAuCs9BRdyyX7NGsAiEA4tbaXlnpShs2amBflR6PCP+pyqjaoSXgXN50SE/h5c8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":773581,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJff4BECRA9TVsSAnZWagAAbREP/jkhVjafZzRJ/3240cza\ncCbpr45HYBaqWB3D4YLVIt64F3DJkDEtjMvPRSuRu3XHVx+frJVreMIGfDEw\nwJ13RZgho5nxRC8gGr6yyL94npfmFyutKu5SpmgWHhxlq+B0tVYk6z3Whzeq\n9M/MHo29jbUGeI+srRphfjiwmqfXZQRh9boZLKxnzClblelVaYEKpSYXBbYv\nSoHQzVeafBKra6h5V0/QaMAfTTu6vDzE+2old8WnpZQThgR0s9XiOJaUqQVf\nj9AUWYdROoxFnsga9ifvPVmHBCH14DCSL8F67fNt55/o+LwpQSzdOY1uQKLf\n4ibNifmN8n7Q/rt63R3x3ehi5BAhSXmmTKRHTROfduFiD2KbpjOzN789lxMF\nvp87AWadi35fW0iwH93/CfqEygSfF72EVAPx/S9boLoZCNzgeuq+FQSH9smB\nbijSdqN5sBdaqle2cTq+kXOn4oHfd6qSxaykfFjxUfZMuGbqAMZy19i8bw92\nbQKpvaBGXvgfDwUhmPVfrUY9It5YMiFcfgkulmbDtsvsla5cIiHiIRsmThzJ\nNHZt7dFEYE0bIDk6Lli+k30l+yYTaoq75WvsiDbVhU6LFhcDdZniXSG9qzzv\nNORYCg/f5ri4pQ8Ss8GmQcNcpw1gQPgHXDVhxWOBUaxOgs/zUm593CEBmknp\nNXoH\r\n=iR9i\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is modeled after the browser's\n`<input type=\"range\">` element.\n\nSliders follow accessibility best practices per the [WAI-ARIA spec](https://www.w3.org/TR/wai-aria-practices/#slider)\nand are fully RTL-aware.\n\n## Contents\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders follow the\n[WAI-ARIA guidelines](https://www.w3.org/TR/wai-aria-practices/#slider).\nPer the spec, ensure that the following attributes are added to the\n`mdc-slider__thumb` element(s):\n\n* `role=\"slider\"`\n* `aria-valuenow`: Value representing the current value.\n* `aria-valuemin`: Value representing the minimum allowed value.\n* `aria-valuemax`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value of `aria-valuenow` is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set to a string that makes the slider value\nunderstandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Continuous slider demo\" aria-valuemin=\"0\"\n       aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Continuous range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Continuous range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   `data-step` attribute on the root element. This will be the step size for\n    value quantization. If not set, the default is 1.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete slider with tick marks demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"20\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `tabindex=\"-1\"` attribute on the thumb(s)\n*   `aria-disabled=\"true\"` on the thumb(s)\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"-1\" aria-label=\"Disabled slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\" aria-disabled=\"true\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the thumb element's `aria-valuemin`,\n`aria-valuemax`, and `aria-valuenow` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"75\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string)|null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"edfdb55487a31cd5f5130aad32b3fa8f369e6d0b","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.22.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.22.1","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.0f60323a8.0","@material/rtl":"8.0.0-canary.0f60323a8.0","@material/base":"8.0.0-canary.0f60323a8.0","@material/theme":"8.0.0-canary.0f60323a8.0","@material/ripple":"8.0.0-canary.0f60323a8.0","@material/animation":"8.0.0-canary.0f60323a8.0","@material/elevation":"8.0.0-canary.0f60323a8.0","@material/typography":"8.0.0-canary.0f60323a8.0","@material/feature-targeting":"8.0.0-canary.0f60323a8.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_8.0.0-canary.0f60323a8.0_1602191427717_0.5848215812909883","host":"s3://npm-registry-packages"}},"8.0.0-canary.d71622574.0":{"name":"@material/slider","version":"8.0.0-canary.d71622574.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@8.0.0-canary.d71622574.0","maintainers":[{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"6989262c224dee7af2f09ddcd6f7cb65b3c9318b","tarball":"https://registry.npmjs.org/@material/slider/-/slider-8.0.0-canary.d71622574.0.tgz","fileCount":38,"integrity":"sha512-O1VHY0WKw6sZuhZ3zXrPu7gfqNCD5YEvx4aDS1N6b2eYHIRCteXo8JF8IbQJugKXyZQdQGpH0WXi02e4ETgcMg==","signatures":[{"sig":"MEUCIDCzUj6e6ycTEZ6mzdYS00O3LW9smW9jCnAg0yz3ChQmAiEAny0qLo7p23TkpiFH86LXmUqSgt/kmlSEZ7fPdb9rIRM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":773581,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfgJCOCRA9TVsSAnZWagAAVkYP/0kurtvcnF4T7g0b8hkG\nfOGlgo3FrsmQOqhge552K6F3f9Xlb8G1VZg7sRmc+phnGsWf2TzjplkLHepN\nYtBf2+CZkaPNbOVR9vkbpR+1XMYDiq3UDj1b9rXgM0hnsijem4rcGmRQhuco\nyGZ2wS/zxSPWzVeLSeZkn9nX2oc0vyprbPipFExqdcHDuSn4a9mec/oCzN9F\nFbCMs6pTZJmCQUN4rFD+/WfBFLE0ThJUAvP6HFm6U6cANqEZZUbWf3/V6HjT\nnHq0+RzNcz/IIbrqLD20j/yHNPzB+UeqsonqJuq+lEFotz0SOTHwOjud7/No\noZJ4W0FZqsKH0q8E4VZCI6SFyq+UHM7Ak1nYbwIt3lQkRzUoBCs95+6JWNCP\nScAH1hj75Xu6en93Ac2/FoneQwMuq6yj8/oeJexAiCQTqOrlxTfaesge/046\nL8iUhc/V4dXGjeG7NjCM9ygEwezmRLkn0MjVf2hEAzzEbVwsJ0vDrEYW29uJ\nhJKZ303GKJvfpDL7CADFsEqqCX0hYWRwKgG2rC7YpbSEDRqdGRsPliwrl9Rh\nGvXET1Pr6tKMgwtCunNO55HiecM+gx19MVNMWsHcz9cO6sLxWsMXdnVCqPbs\n0r87NCgT9hif9NuVpKNJivUG8zk49TlT89KawT+WCYeFm2NAMclMUSEY4Fe1\nYXIS\r\n=XIBs\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is modeled after the browser's\n`<input type=\"range\">` element.\n\nSliders follow accessibility best practices per the [WAI-ARIA spec](https://www.w3.org/TR/wai-aria-practices/#slider)\nand are fully RTL-aware.\n\n## Contents\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders follow the\n[WAI-ARIA guidelines](https://www.w3.org/TR/wai-aria-practices/#slider).\nPer the spec, ensure that the following attributes are added to the\n`mdc-slider__thumb` element(s):\n\n* `role=\"slider\"`\n* `aria-valuenow`: Value representing the current value.\n* `aria-valuemin`: Value representing the minimum allowed value.\n* `aria-valuemax`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value of `aria-valuenow` is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set to a string that makes the slider value\nunderstandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Continuous slider demo\" aria-valuemin=\"0\"\n       aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Continuous range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Continuous range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   `data-step` attribute on the root element. This will be the step size for\n    value quantization. If not set, the default is 1.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete slider with tick marks demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"20\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `tabindex=\"-1\"` attribute on the thumb(s)\n*   `aria-disabled=\"true\"` on the thumb(s)\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"-1\" aria-label=\"Disabled slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\" aria-disabled=\"true\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the thumb element's `aria-valuemin`,\n`aria-valuemax`, and `aria-valuenow` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"75\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string)|null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"19a45f4824305f22d61cbf9deea0fef067dea3e6","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.22.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.22.1","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.d71622574.0","@material/rtl":"8.0.0-canary.d71622574.0","@material/base":"8.0.0-canary.d71622574.0","@material/theme":"8.0.0-canary.d71622574.0","@material/ripple":"8.0.0-canary.d71622574.0","@material/animation":"8.0.0-canary.d71622574.0","@material/elevation":"8.0.0-canary.d71622574.0","@material/typography":"8.0.0-canary.d71622574.0","@material/feature-targeting":"8.0.0-canary.d71622574.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_8.0.0-canary.d71622574.0_1602261134414_0.5529764444663929","host":"s3://npm-registry-packages"}},"8.0.0-canary.7a9afaf4b.0":{"name":"@material/slider","version":"8.0.0-canary.7a9afaf4b.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@8.0.0-canary.7a9afaf4b.0","maintainers":[{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"f5c3340e58f0394d0bb6c53dbe247e9cea1b0e21","tarball":"https://registry.npmjs.org/@material/slider/-/slider-8.0.0-canary.7a9afaf4b.0.tgz","fileCount":38,"integrity":"sha512-qvf1xpYdeR6rZRcV9JaUzT+HrYhb0qaIiXS5imBygitUJKKDBeE5QQZDhFHe9TGrg4+TrGumnfGHokgfqn01fQ==","signatures":[{"sig":"MEYCIQCkQZsaxO/d2KiHXd6pxPgUJrxOexZ0wSLl+saIIfWqlAIhAO+XlUOL6LW3+Vai3bfMoEy9+U7ngKxmpnmZZnvQMnSM","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":773581,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfgOofCRA9TVsSAnZWagAAeQQP/ipFd39ki7beMfbTWh0g\nAIbHm0wmRrcq5h5+4/9KIqqNLx73RgJPs3gUxI7rxtFw0zF8HpUla8QodPo9\naXGskTX0A1T2M/SRBWBZAHTeFv0xAQbVS+feu9xH71QMuHbY+Bn3fy7WCVgx\nGYxD1GA4PAkWifFruW1UaJ6BeDIVpfXLrzJKPfc7WgSpUSPBzx2NWuCd7ZG5\nEEc+2jFKTdptBZayPYjdWTY41tSibuuOXj3zvt7ukuMUlVPcd3rVtXqv8VkO\nJUYqkJu1kxcW985swZM5oC05MKK/ULV9QJ9ZOkcyrZ2GvjrCA05vQKDXn1fM\nwdhmJsbcH9sbA6zPKq5eyc+WIpBnzRtrUzVReaDSjYZEV6p4KqAIVRHT1Egb\ncBLAu6P3/+Fpju4WuNpTIczozLACRjTS1mYMCYEU/SKyOLgXqL22Ewy/3E5x\nPINt17GFE+1yeE0hbV1yvk6Ym/2p9kWGiAp1u8dbCt+nWWekFHWFf2l9k1DC\nn8nbrMy1i2gtj9Z0Pgxis87JFnzCxMY3xYlqbP+9piOBstV5zK381jhSekR6\nVrfR9Z2woUPm/ySsgc6OG23XrT+RPf4Pbuml9nXUPKaCETE/tHoGl3+VpJgi\nYOXlE5vBLG2M8QDo5ZN3xwY+Ai2AGOM8GSpeFiRDrfptX6jkDKjsm7+G9e5j\nl9yn\r\n=1lum\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is modeled after the browser's\n`<input type=\"range\">` element.\n\nSliders follow accessibility best practices per the [WAI-ARIA spec](https://www.w3.org/TR/wai-aria-practices/#slider)\nand are fully RTL-aware.\n\n## Contents\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders follow the\n[WAI-ARIA guidelines](https://www.w3.org/TR/wai-aria-practices/#slider).\nPer the spec, ensure that the following attributes are added to the\n`mdc-slider__thumb` element(s):\n\n* `role=\"slider\"`\n* `aria-valuenow`: Value representing the current value.\n* `aria-valuemin`: Value representing the minimum allowed value.\n* `aria-valuemax`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value of `aria-valuenow` is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set to a string that makes the slider value\nunderstandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Continuous slider demo\" aria-valuemin=\"0\"\n       aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Continuous range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Continuous range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   `data-step` attribute on the root element. This will be the step size for\n    value quantization. If not set, the default is 1.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete slider with tick marks demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"20\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `tabindex=\"-1\"` attribute on the thumb(s)\n*   `aria-disabled=\"true\"` on the thumb(s)\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"-1\" aria-label=\"Disabled slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\" aria-disabled=\"true\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the thumb element's `aria-valuemin`,\n`aria-valuemax`, and `aria-valuenow` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"75\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string)|null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"137d6fb8ed93c50312981c75fb37199ad460dcf2","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.22.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.22.1","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.7a9afaf4b.0","@material/rtl":"8.0.0-canary.7a9afaf4b.0","@material/base":"8.0.0-canary.7a9afaf4b.0","@material/theme":"8.0.0-canary.7a9afaf4b.0","@material/ripple":"8.0.0-canary.7a9afaf4b.0","@material/animation":"8.0.0-canary.7a9afaf4b.0","@material/elevation":"8.0.0-canary.7a9afaf4b.0","@material/typography":"8.0.0-canary.7a9afaf4b.0","@material/feature-targeting":"8.0.0-canary.7a9afaf4b.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_8.0.0-canary.7a9afaf4b.0_1602284063135_0.16811642133611726","host":"s3://npm-registry-packages"}},"8.0.0-canary.8a39352c8.0":{"name":"@material/slider","version":"8.0.0-canary.8a39352c8.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@8.0.0-canary.8a39352c8.0","maintainers":[{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"1285cfeeac975d90765c6b35e7af64bb992f8412","tarball":"https://registry.npmjs.org/@material/slider/-/slider-8.0.0-canary.8a39352c8.0.tgz","fileCount":38,"integrity":"sha512-TUagO22RU6lWyUyhBeKGcpnEE62mIGKL/RiMeVOeo5P3XPQVNKKAahHG2CPR7BEm8BrSj7s1XCV0jGb8cewXmQ==","signatures":[{"sig":"MEUCIAuT2w167Rvk2IRY5sgOApHi0NZs/VK6ZTZZ4t6djVlyAiEAkGHSMQttWUbkkSibBnOjzX+OpyoAE2uV9tmt/4cO1KU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":773581,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfhJaICRA9TVsSAnZWagAAYdcP/1puCDPq6qnJmB8roH42\nRygl8lutVAXFAClvSCEIzM2aA6Z0wj3yg0wmdsEHe+jvmfQkjdwSBDPLgtBJ\n+ruWc3ehv0QcCuj/6/YU19d59mNDCgDP+mSSs6054dS0YCVFPgIqt4GROGzm\nkNIBaqht09DD5AV58JhAzldnD74su5jTpuGk9XCp0AgpPQ2bm8UtajdLGG/L\nthlrE5kLKOSjq3BwvHLy4ZBVcpRflyCUwUBIzSWoBSSm2DYRve2TF8YMZbAo\nvhSlKCh51H8iS2BMIHhAuEvBPOrUtJD+UxxgPq2ZowGOI6IXNns0lHnc3tXY\n5fGsPIElx+sIPGX1OIHx9r+f0UEI8wbqTDOoHhmKDzVpCH6yQkpmOXdc/G2A\nwWehpuvA7oPm4c6jbZE/bN9Tw7iu2Ei3eZBPubpaX0rt/ghsVRTJhbiF46Cl\nq/bb7UX691EXnMfsGjblhJe8mlH17nH+DemNSaue4SwSMTSoYW/42n2Od1Yw\ner9krneAQGTNXDiLzR3CD5U5o4DvH9zppVhv+q2l2/IDI4s/8itPy/5aBT7g\nJMjNRyZIEQRUi+DtxE1T5RobF26UPPPJWzqp1pLq0LrDjiT3sAOk+ApbayK9\nz7UvoJmrkoMC8phtMackb1F99m2oxS2bOMaPLm4eKLOKLx8DD4EAHpay4Pbn\nriep\r\n=1eN6\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is modeled after the browser's\n`<input type=\"range\">` element.\n\nSliders follow accessibility best practices per the [WAI-ARIA spec](https://www.w3.org/TR/wai-aria-practices/#slider)\nand are fully RTL-aware.\n\n## Contents\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders follow the\n[WAI-ARIA guidelines](https://www.w3.org/TR/wai-aria-practices/#slider).\nPer the spec, ensure that the following attributes are added to the\n`mdc-slider__thumb` element(s):\n\n* `role=\"slider\"`\n* `aria-valuenow`: Value representing the current value.\n* `aria-valuemin`: Value representing the minimum allowed value.\n* `aria-valuemax`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value of `aria-valuenow` is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set to a string that makes the slider value\nunderstandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Continuous slider demo\" aria-valuemin=\"0\"\n       aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Continuous range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Continuous range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   `data-step` attribute on the root element. This will be the step size for\n    value quantization. If not set, the default is 1.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete slider with tick marks demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"20\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `tabindex=\"-1\"` attribute on the thumb(s)\n*   `aria-disabled=\"true\"` on the thumb(s)\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"-1\" aria-label=\"Disabled slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\" aria-disabled=\"true\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the thumb element's `aria-valuemin`,\n`aria-valuemax`, and `aria-valuenow` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"75\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string)|null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"cedb8cd906516b8d460c813039351e951b960c50","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.22.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.22.1","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.8a39352c8.0","@material/rtl":"8.0.0-canary.8a39352c8.0","@material/base":"8.0.0-canary.8a39352c8.0","@material/theme":"8.0.0-canary.8a39352c8.0","@material/ripple":"8.0.0-canary.8a39352c8.0","@material/animation":"8.0.0-canary.8a39352c8.0","@material/elevation":"8.0.0-canary.8a39352c8.0","@material/typography":"8.0.0-canary.8a39352c8.0","@material/feature-targeting":"8.0.0-canary.8a39352c8.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_8.0.0-canary.8a39352c8.0_1602524807753_0.30434435301982354","host":"s3://npm-registry-packages"}},"8.0.0-canary.790ca85fd.0":{"name":"@material/slider","version":"8.0.0-canary.790ca85fd.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@8.0.0-canary.790ca85fd.0","maintainers":[{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"e389c6f6d6093acdd2880401b656b794a23bab1b","tarball":"https://registry.npmjs.org/@material/slider/-/slider-8.0.0-canary.790ca85fd.0.tgz","fileCount":38,"integrity":"sha512-DV3bYDOq9JvFxDQvWr9Wf+3ycmEf5AWHSjaSKLviNHuRx6vpSZBTsw+UY+otMIpKcQQnT9GMqNb6NxlZyON57g==","signatures":[{"sig":"MEQCIB1t4JZOH9RFBgNuhlggBaJJiGfK3igLbrvwR7Z77BawAiAS+zvrKkkpfCWSggE2SDY8f97ieBQQkmKK0Pwu4vBiEw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":773581,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfhNE3CRA9TVsSAnZWagAAYG4P/2iYqGrR1uxpoctainry\nUa9h20s6WS9NppFcrzwZJNBBuN8x/fLCDKce7NACF15+LjVxCBYH/b29NQxM\nfhR1DHw1YBkXfdaclV2pX3IMmodb8+jfNabX1VrNG4lwmg3ZUmsUgs2ToWng\nelRReQgDjWagdljTPsfRwkRv12RtFfqErf2W1yUyL3PmcN8xO+z456jrebqt\nBouKXTb7cKDJN+qapZOBGKeXQOm/aXtvA3DOQIWmBuk9Ed8jP5FN1duT1rzy\nbc7HKeZqzCXkCYbPXUr8IZIig/WiKet1H0lMbX6ef9u6gAVbKfmWUwapH3uo\nBhm8xmjwkWv+cw88SY9J2tsRs2uOXoVrpsIjJ6NAM/ZR9skDzrqoK38/y1F6\na59OIGNmFLG2qtim0Tnb8WU5QlNZVTNMKWXUZsoJzuteXThMk+g7d3NSwEDf\nvw+8U1/6uVhidujG9dHgbTpvg2/HKNvs0mzAGh9TUinFKHWQC3yqN2uTzrsT\ndSZAAxBLJnfJzQWi0sH5rAVHw9VQ81sSw/6IxUeS14wL8da3BVHv1Ie2Zo6Y\n+XxtvfMraBB0IZAQR7bWK8Mw4lan8gC2Z1s5vnUXMrLx5+g2QY0OPBl5/7XR\nnQAAzogRsQJJ0a+WPcrg3jOR6oL6QTBcVOgpCltd4klXxsewKtrAwhIhn+dt\n87Xp\r\n=knG7\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is modeled after the browser's\n`<input type=\"range\">` element.\n\nSliders follow accessibility best practices per the [WAI-ARIA spec](https://www.w3.org/TR/wai-aria-practices/#slider)\nand are fully RTL-aware.\n\n## Contents\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders follow the\n[WAI-ARIA guidelines](https://www.w3.org/TR/wai-aria-practices/#slider).\nPer the spec, ensure that the following attributes are added to the\n`mdc-slider__thumb` element(s):\n\n* `role=\"slider\"`\n* `aria-valuenow`: Value representing the current value.\n* `aria-valuemin`: Value representing the minimum allowed value.\n* `aria-valuemax`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value of `aria-valuenow` is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set to a string that makes the slider value\nunderstandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Continuous slider demo\" aria-valuemin=\"0\"\n       aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Continuous range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Continuous range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   `data-step` attribute on the root element. This will be the step size for\n    value quantization. If not set, the default is 1.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete slider with tick marks demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"20\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `tabindex=\"-1\"` attribute on the thumb(s)\n*   `aria-disabled=\"true\"` on the thumb(s)\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"-1\" aria-label=\"Disabled slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\" aria-disabled=\"true\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the thumb element's `aria-valuemin`,\n`aria-valuemax`, and `aria-valuenow` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"75\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string)|null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"8971e891898c4a8ca082beda756a7b93097f858e","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.22.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.22.1","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.790ca85fd.0","@material/rtl":"8.0.0-canary.790ca85fd.0","@material/base":"8.0.0-canary.790ca85fd.0","@material/theme":"8.0.0-canary.790ca85fd.0","@material/ripple":"8.0.0-canary.790ca85fd.0","@material/animation":"8.0.0-canary.790ca85fd.0","@material/elevation":"8.0.0-canary.790ca85fd.0","@material/typography":"8.0.0-canary.790ca85fd.0","@material/feature-targeting":"8.0.0-canary.790ca85fd.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_8.0.0-canary.790ca85fd.0_1602539831360_0.27262958574084495","host":"s3://npm-registry-packages"}},"8.0.0-canary.174c0becf.0":{"name":"@material/slider","version":"8.0.0-canary.174c0becf.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@8.0.0-canary.174c0becf.0","maintainers":[{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"395d1df4191e2a2461cabe553c9918f85908a3b8","tarball":"https://registry.npmjs.org/@material/slider/-/slider-8.0.0-canary.174c0becf.0.tgz","fileCount":38,"integrity":"sha512-AXPtmzlngN21yrcMt811yghXHw5ZSgqTJZMaYBc92Lrw7AnsonD+fwjtpdegKtQYtGTi11zaqPKQhCDv8UFIvw==","signatures":[{"sig":"MEUCIQC3J/GVR6JbG9h1QxkvDcyvCMzJQQnP0MYQDoe1HYeyrAIgN3vPop6wgfDCxJWlalpOeVcGLuB8UeatUV8CGVXhtf8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":773581,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfhl9oCRA9TVsSAnZWagAAmcMQAKQP197V8O62wyYCWrjb\ny0Q+c9IeWeE07SdlC6pd1wMu0w3e+IXgKrvaOeDLU+RU3M6j/hT+gPa3xAJB\nIG69JP9OprAPjEZNIre2HqRwyDU2iX0Td9ycFXBULe26QeVBgg4QF+LhmBLW\nbG43ECn6vSc+eFqY1cQvf8bJh0ln/z8NNekx7BlIOL2v5jzfMSF1AF9zfYYJ\nzzASg/MDb6Giyv/JEmeLcVUim9KEmDtbvYbMCg7FwedzammOkXhnRP4ZVyUS\nuocevDM6AwqKg5bWKx0ZHIWE5XicHSDlUopVRenQB3PRJBg+syD0VmLLBB5s\ne+0AT1LfdTelowNBFbFo7xHsMlw9s9Jg1CWj0NVJflX2kX6H6+o4GPcwMrCK\ns/l4YnsJNypJ7QA0aev2NrRMP1WoNqtMVqXQ3DjttHX5T4FftMz6J9p87AL7\nXFJim7NLjTur7og47VWylLF+QWZq9klHU0OVae4nTAlNSl3937+0vmWrK7hf\nc3Zl5TeQ3b2SaMSz5ka/Lsh//Ulvu+ifzM9OYoxqoZLYe4Kf6Yz9NE4BMokR\nfEt9Y6w4UldvKhJH8YpdAsm6Mm7WIO+vTIngUdcrH57X8rR4OruTpSmbzx9t\npD9TfYosnaAT+J1ssJkUcL0mauyfjm86l4Xv7iF97TT8FiAuh+mGT4aLMI3N\nZuJP\r\n=wzUg\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is modeled after the browser's\n`<input type=\"range\">` element.\n\nSliders follow accessibility best practices per the [WAI-ARIA spec](https://www.w3.org/TR/wai-aria-practices/#slider)\nand are fully RTL-aware.\n\n## Contents\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders follow the\n[WAI-ARIA guidelines](https://www.w3.org/TR/wai-aria-practices/#slider).\nPer the spec, ensure that the following attributes are added to the\n`mdc-slider__thumb` element(s):\n\n* `role=\"slider\"`\n* `aria-valuenow`: Value representing the current value.\n* `aria-valuemin`: Value representing the minimum allowed value.\n* `aria-valuemax`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value of `aria-valuenow` is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set to a string that makes the slider value\nunderstandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Continuous slider demo\" aria-valuemin=\"0\"\n       aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Continuous range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Continuous range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   `data-step` attribute on the root element. This will be the step size for\n    value quantization. If not set, the default is 1.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete slider with tick marks demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"20\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `tabindex=\"-1\"` attribute on the thumb(s)\n*   `aria-disabled=\"true\"` on the thumb(s)\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"-1\" aria-label=\"Disabled slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\" aria-disabled=\"true\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the thumb element's `aria-valuemin`,\n`aria-valuemax`, and `aria-valuenow` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"75\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string)|null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"6dc7561b8695889178b3e884e84f5d9c3d59e100","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.22.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.22.1","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.174c0becf.0","@material/rtl":"8.0.0-canary.174c0becf.0","@material/base":"8.0.0-canary.174c0becf.0","@material/theme":"8.0.0-canary.174c0becf.0","@material/ripple":"8.0.0-canary.174c0becf.0","@material/animation":"8.0.0-canary.174c0becf.0","@material/elevation":"8.0.0-canary.174c0becf.0","@material/typography":"8.0.0-canary.174c0becf.0","@material/feature-targeting":"8.0.0-canary.174c0becf.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_8.0.0-canary.174c0becf.0_1602641768391_0.004925479644845687","host":"s3://npm-registry-packages"}},"8.0.0-canary.c71ebfa02.0":{"name":"@material/slider","version":"8.0.0-canary.c71ebfa02.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@8.0.0-canary.c71ebfa02.0","maintainers":[{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"e609fec661b1a76545b9461910c734d52a588553","tarball":"https://registry.npmjs.org/@material/slider/-/slider-8.0.0-canary.c71ebfa02.0.tgz","fileCount":38,"integrity":"sha512-v6uK5dut80A91xACL9HVihca4VieFdjfobPVuwEThbjeksZVIhQH1cNiJMU/haYvexBtTKiLk1mnuBB3kC68yw==","signatures":[{"sig":"MEUCIDtJ51T7FoBwtGjRELnl0mAbriiIKs81qvrkDvGqlQLsAiEA8FxZjHZfHHwO//FM5VPsSJm68FWYPKB5/veD3LZiLRQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":773581,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfhnv5CRA9TVsSAnZWagAAa6YP+wRL5Ma8/dNtySm4OPwl\nucO4MY9a1m6Sd0/9LbXdumWlVD84EH/+DQ/FSj0ZNiV3Arul6jVF42DGUARQ\n6RqO5BB0qE0CLhKd/oPVkUFO4AWRRT3eJiPfIdhisnHguI4Vu74/G3/W+uMN\nKsbhTjgTwT4aRXl711+HyzIyVrYnvXrmLqZBuhAJesMX0ug7OYvz2D8DJDph\n1+/is0W9D3vk6hgZlRw8RaoD4Dbn3ZdzLSEn9F4ReXiPIZUf3QD7wam8sdUs\ngodUDZlhP9iNsp3b6qI1/xhCzx1y/MCZl5gRAn401v4PcgtdGFuVhndOwDGT\nt1hWvxfVH+FfGgcvLP05WbzoXXq3AhxRUbBuDxipaTtEiHkybApPCXlo+bBc\n5nM2/ZdTLVC1uslhlQbyFQ9LmAtXI2LJeiIiWg3LNQFc+0gSO+srwZeAR5FA\nd22f+zmXiy/iZUGcFjQQ0zKacumJOHBTGckWWPt2i1lks21RQQWmuZS+WVQl\n8Ix61v3f467MOpqJ+E4Ok6AqrAPNQBdstlB9mGuy5GRLhW/r2FaopZ33c26X\nCReEpLtfShvj2aCdCRIYi1EFjyQmnw+CUZo0kOGjjRfAgbX7BOkbJWjuXdPD\nxiqTfSAzvczOKdF9/Ts3BZBRkltWH4WRCKtONECZOs5gAcU7excdR8iTZQZA\nXHKg\r\n=rFqG\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is modeled after the browser's\n`<input type=\"range\">` element.\n\nSliders follow accessibility best practices per the [WAI-ARIA spec](https://www.w3.org/TR/wai-aria-practices/#slider)\nand are fully RTL-aware.\n\n## Contents\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders follow the\n[WAI-ARIA guidelines](https://www.w3.org/TR/wai-aria-practices/#slider).\nPer the spec, ensure that the following attributes are added to the\n`mdc-slider__thumb` element(s):\n\n* `role=\"slider\"`\n* `aria-valuenow`: Value representing the current value.\n* `aria-valuemin`: Value representing the minimum allowed value.\n* `aria-valuemax`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value of `aria-valuenow` is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set to a string that makes the slider value\nunderstandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Continuous slider demo\" aria-valuemin=\"0\"\n       aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Continuous range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Continuous range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   `data-step` attribute on the root element. This will be the step size for\n    value quantization. If not set, the default is 1.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete slider with tick marks demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"20\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `tabindex=\"-1\"` attribute on the thumb(s)\n*   `aria-disabled=\"true\"` on the thumb(s)\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"-1\" aria-label=\"Disabled slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\" aria-disabled=\"true\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the thumb element's `aria-valuemin`,\n`aria-valuemax`, and `aria-valuenow` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"75\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string)|null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"d1158a184d234471c81501e838b409c54f591268","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.22.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.22.1","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.c71ebfa02.0","@material/rtl":"8.0.0-canary.c71ebfa02.0","@material/base":"8.0.0-canary.c71ebfa02.0","@material/theme":"8.0.0-canary.c71ebfa02.0","@material/ripple":"8.0.0-canary.c71ebfa02.0","@material/animation":"8.0.0-canary.c71ebfa02.0","@material/elevation":"8.0.0-canary.c71ebfa02.0","@material/typography":"8.0.0-canary.c71ebfa02.0","@material/feature-targeting":"8.0.0-canary.c71ebfa02.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_8.0.0-canary.c71ebfa02.0_1602649081248_0.4485114127839347","host":"s3://npm-registry-packages"}},"8.0.0-canary.2ab716cbd.0":{"name":"@material/slider","version":"8.0.0-canary.2ab716cbd.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@8.0.0-canary.2ab716cbd.0","maintainers":[{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"f3f15c10f861544e377f9d48cf391efbfe814ffb","tarball":"https://registry.npmjs.org/@material/slider/-/slider-8.0.0-canary.2ab716cbd.0.tgz","fileCount":38,"integrity":"sha512-SC7dzW63ieuAlMvMN/I/X8/wIHOrZR1sqL4fJPNMZNtp1ONiWocE/2JLaZbZeWF9tD6/TwZ1Kyoo8nlC6GRpYQ==","signatures":[{"sig":"MEYCIQCE+cd8IYR7qIGvCK52uIZCS9Algz1p7IRziqOt17fMMgIhAOR6rkELFuUkD+HykLcklwPWu+iIMr3H1XHCtyGzeCsy","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":773581,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfiOOcCRA9TVsSAnZWagAAU2sQAIlwDtdzFdnIgpfFAJIR\nm3V+K18aK7NNx3nNLvBn4JG9Fc/XMYdbBxfGMuDSGNKtu37Z9+igRtoUFO0h\nT4Fo7uC4SE6s0t1xfwNuobw9ZHrECFJ2sAXs4hj0KOZEeXeMmycSUuVE3EC6\nQbxDf36VTIY44FWcm8//wTpA4ZQ2KgLVyDRd5oV8V7Nl/LZFBss5neCVYcdS\nJLy0rH2GTyw8OLi/xtYIKYygEbvl6FhPAc1LJMpnQ/Wn4GP85zb0lPm24Y2J\n7KDIgkT4zVsPZkhZxtk4VCFbcaoOu++VPjpxdYQaX5Zz0FFK8jY8+9qrEO4x\nQVPSlE9tDWFnGfWEUK7CfQgBgQypSHS15Oa6Jj40/QXedhj+q+VkQU6CkDXG\nknflDPtAxsfMA9MimI52dcKRCMqrM2fnSPBmLqYKD0PyBQcrPc9nuyTN3kc5\n9bDNmM8mK2QY6GxaXoJ501LRSSmuBceSIb7FI4b9wy2cr0Jwj/2kg7V9Tr5q\nK3ZoZX6CkWqkK2bwG2i5c3EexegijQGmFzdHCgv7Fi+WfLEbWRFgZMjWQjsw\nejEViwsBau4UBSAFDZaNn5XHpd+/4VI0ydO3uA2m4LjysbeF5JD1eUeUYNu4\naNSJ7B8Reb+kfoVcyQsVbr5Jrew/362WA80kWX3b1RFZbydmDfqYGiHAPGlD\nA5CS\r\n=LX7c\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is modeled after the browser's\n`<input type=\"range\">` element.\n\nSliders follow accessibility best practices per the [WAI-ARIA spec](https://www.w3.org/TR/wai-aria-practices/#slider)\nand are fully RTL-aware.\n\n## Contents\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders follow the\n[WAI-ARIA guidelines](https://www.w3.org/TR/wai-aria-practices/#slider).\nPer the spec, ensure that the following attributes are added to the\n`mdc-slider__thumb` element(s):\n\n* `role=\"slider\"`\n* `aria-valuenow`: Value representing the current value.\n* `aria-valuemin`: Value representing the minimum allowed value.\n* `aria-valuemax`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value of `aria-valuenow` is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set to a string that makes the slider value\nunderstandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Continuous slider demo\" aria-valuemin=\"0\"\n       aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Continuous range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Continuous range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   `data-step` attribute on the root element. This will be the step size for\n    value quantization. If not set, the default is 1.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete slider with tick marks demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"20\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `tabindex=\"-1\"` attribute on the thumb(s)\n*   `aria-disabled=\"true\"` on the thumb(s)\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"-1\" aria-label=\"Disabled slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\" aria-disabled=\"true\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the thumb element's `aria-valuemin`,\n`aria-valuemax`, and `aria-valuenow` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"75\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string)|null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"a3f41127e9d90f7e393ee6fa5e01829e52160131","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.22.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.22.1","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.2ab716cbd.0","@material/rtl":"8.0.0-canary.2ab716cbd.0","@material/base":"8.0.0-canary.2ab716cbd.0","@material/theme":"8.0.0-canary.2ab716cbd.0","@material/ripple":"8.0.0-canary.2ab716cbd.0","@material/animation":"8.0.0-canary.2ab716cbd.0","@material/elevation":"8.0.0-canary.2ab716cbd.0","@material/typography":"8.0.0-canary.2ab716cbd.0","@material/feature-targeting":"8.0.0-canary.2ab716cbd.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_8.0.0-canary.2ab716cbd.0_1602806683471_0.06595607492409483","host":"s3://npm-registry-packages"}},"8.0.0-canary.43c1c5e2f.0":{"name":"@material/slider","version":"8.0.0-canary.43c1c5e2f.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@8.0.0-canary.43c1c5e2f.0","maintainers":[{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"19242bc252ef25df1954c267400ddb141ef9ba0b","tarball":"https://registry.npmjs.org/@material/slider/-/slider-8.0.0-canary.43c1c5e2f.0.tgz","fileCount":38,"integrity":"sha512-t7+bTGbeld6JKVssBRQ/SRQvNx4Ppwj+Z8os0y1DPmqhJyfC+RD62b+8Tr8553ZC7vm5u1zTUuf/5zUkA9XnvQ==","signatures":[{"sig":"MEYCIQDs3mfl4IpfiXPr5+95S+RqQlgU5U9xXq/U8uTwgaGRCgIhAO7sKYrQrGfSuhOC4M73KhMURgOLNgyry+JHERqfKC1t","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":773581,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfjZ3eCRA9TVsSAnZWagAAX3IP/2yjyuiRpVpyebRA95yI\n+U73A6+jkD/Z4NzJnqhrldFjuJHvdTjawNrB+mU3vc3IMq3MFlWB1Y29t8du\nFFxz/ULeAcOG/2H5f7I+sTQ9EU8DyoISSoZQJM31uCD7Xv0hl1aiaSwIGu1Q\n1Gg/Hk1D57HQS1R2kz20yPhFz8qnVjNrSztiPBoQL2dfZEg0U3PpSPEqzl2F\ngkJEpGy7ZzGAnJPaO51KYxHzrs/izeWKiSU3mEpIuOEgicdRT1v4yb646V8b\nynhsgTkHTSk2SqeX5M80Ke8j/uboaZO6GrPT7nBR9ACj4sbMNCEEi/u5pyQ7\nfqWF3jeQVivhm7zgiThg3oX1s+BO2usMTxI/m0np2HTOUJRkq7+b7W6gtyHt\nT0dPJXlOY2YNbeCmA7wbFKPc99XuP762PnaWWEPjEQCoHKAJGI8PryrkKRKI\n118CP0lnOdQAHXw5WfrFgZInO95MKyqe5en+rR69fA6GQBBvdIj0HyNlJcJ1\nNWhAkZhgytONwdceqkVnxKNEaozutHIQD+E5NbLJZLwaUcKJOAcvF8ZEbV/r\nzykfDK+sbkvLI1Lb6mUhF27GPdWxoytqDjUUK3ZCCTFjEKn2lC0Ok06rl1O1\nOJhoA/5ZkLN3bhiIA0lFAqLRgcQknnGKv9fxZR5tFmKxYeQGfRYeUe+SQUKE\nzMnc\r\n=Uv/N\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is modeled after the browser's\n`<input type=\"range\">` element.\n\nSliders follow accessibility best practices per the [WAI-ARIA spec](https://www.w3.org/TR/wai-aria-practices/#slider)\nand are fully RTL-aware.\n\n## Contents\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders follow the\n[WAI-ARIA guidelines](https://www.w3.org/TR/wai-aria-practices/#slider).\nPer the spec, ensure that the following attributes are added to the\n`mdc-slider__thumb` element(s):\n\n* `role=\"slider\"`\n* `aria-valuenow`: Value representing the current value.\n* `aria-valuemin`: Value representing the minimum allowed value.\n* `aria-valuemax`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value of `aria-valuenow` is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set to a string that makes the slider value\nunderstandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Continuous slider demo\" aria-valuemin=\"0\"\n       aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Continuous range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Continuous range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   `data-step` attribute on the root element. This will be the step size for\n    value quantization. If not set, the default is 1.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete slider with tick marks demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"20\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `tabindex=\"-1\"` attribute on the thumb(s)\n*   `aria-disabled=\"true\"` on the thumb(s)\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"-1\" aria-label=\"Disabled slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\" aria-disabled=\"true\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the thumb element's `aria-valuemin`,\n`aria-valuemax`, and `aria-valuenow` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"75\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string)|null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"bae89543d5336b4583fd1519cb63078d2a5c39f5","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.22.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.22.1","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.43c1c5e2f.0","@material/rtl":"8.0.0-canary.43c1c5e2f.0","@material/base":"8.0.0-canary.43c1c5e2f.0","@material/theme":"8.0.0-canary.43c1c5e2f.0","@material/ripple":"8.0.0-canary.43c1c5e2f.0","@material/animation":"8.0.0-canary.43c1c5e2f.0","@material/elevation":"8.0.0-canary.43c1c5e2f.0","@material/typography":"8.0.0-canary.43c1c5e2f.0","@material/feature-targeting":"8.0.0-canary.43c1c5e2f.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_8.0.0-canary.43c1c5e2f.0_1603116509903_0.04478348363791107","host":"s3://npm-registry-packages"}},"8.0.0-canary.ccc64eea3.0":{"name":"@material/slider","version":"8.0.0-canary.ccc64eea3.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@8.0.0-canary.ccc64eea3.0","maintainers":[{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"ddd0f3971e2a73ca2c626136e615a77f44b07d55","tarball":"https://registry.npmjs.org/@material/slider/-/slider-8.0.0-canary.ccc64eea3.0.tgz","fileCount":38,"integrity":"sha512-6Bi/yliiIw0VQS/Gb2F+UkS297QBt0UVoIHynco91s6EHpMUri3D8/j7TSqBCngbyV4EmKrdoOGirjcFM1BKoQ==","signatures":[{"sig":"MEUCIQCfJsfeKu8HX+6JrPsVtpn4Bj+53Tl1kwGJjrRZlU6l1gIgF2FdWaU85CBt0Z+DLlZsvhab/3iRcSWjhe+Je6Ay874=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":773581,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfl1MQCRA9TVsSAnZWagAAQ6AP/1628iYV6Cuz3CJjMN0h\nH+Rchpe737itBLRhTTYPUzBPsphHjsMRdgA5urvTPtznTqrjTu2N16ZfDSeD\n+Wki56KWoZDM26jLkgVm+NBosMELzhye8M/QU1uYeQHOrPeAkIqgDpWLkiqR\nMl2pfI4uke38U0Ly89TEMG7ySxHQsW/FMQFFfJqOGG9KWzXp11WbAMO2wDME\nogP3u1eSut6I13YMsPDwjyjKYFEedUp2b/LhEnDWw05oI3mKa8UC4KEa1vQ0\nGYdkA2VlP2hrjbDYkKnITnol+rj4ldSmB4ny46eRmZ3DMGdTVUzx/0+3iijA\nnRbzoLRBlawZI8NllNHLUuvXL+2k4R3Pd0gR/jz2zF1rZDfQ55lrRkcS1S7w\nV/j4icseAvgfFEhssaJQPHJv09RQVmmng08VCwqAyIQTHj9lSa9AffYI5+UV\nVpWn8qyUz86yV4ZxMnadoaJhWRMtO4MUNo0BJN78UixmhwV2L+nvl+GFDfz2\nqonPJwX0045UXjb51NUj3vKtJoliP8SZZGG9cxDu6EYPgEa53thuHtQi0rYa\nKz+fxq9HFwvIdJgWIplpZYX8Bv2O7JjFwDx48R4z5fePHvzfiz+HhpDSEJnv\nf4JoqSey0X5lfARPEzOnqSeuz/fcdHc6Pc270ZJs6mOeMK/pbcBKqcL0AEDA\npBGU\r\n=AKr3\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is modeled after the browser's\n`<input type=\"range\">` element.\n\nSliders follow accessibility best practices per the [WAI-ARIA spec](https://www.w3.org/TR/wai-aria-practices/#slider)\nand are fully RTL-aware.\n\n## Contents\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders follow the\n[WAI-ARIA guidelines](https://www.w3.org/TR/wai-aria-practices/#slider).\nPer the spec, ensure that the following attributes are added to the\n`mdc-slider__thumb` element(s):\n\n* `role=\"slider\"`\n* `aria-valuenow`: Value representing the current value.\n* `aria-valuemin`: Value representing the minimum allowed value.\n* `aria-valuemax`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value of `aria-valuenow` is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set to a string that makes the slider value\nunderstandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Continuous slider demo\" aria-valuemin=\"0\"\n       aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Continuous range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Continuous range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   `data-step` attribute on the root element. This will be the step size for\n    value quantization. If not set, the default is 1.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete slider with tick marks demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"20\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `tabindex=\"-1\"` attribute on the thumb(s)\n*   `aria-disabled=\"true\"` on the thumb(s)\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"-1\" aria-label=\"Disabled slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\" aria-disabled=\"true\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the thumb element's `aria-valuemin`,\n`aria-valuemax`, and `aria-valuenow` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"75\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string)|null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"26df299f75c86dada6da463cae5df1b0277d5c7f","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.22.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.22.1","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.ccc64eea3.0","@material/rtl":"8.0.0-canary.ccc64eea3.0","@material/base":"8.0.0-canary.ccc64eea3.0","@material/theme":"8.0.0-canary.ccc64eea3.0","@material/ripple":"8.0.0-canary.ccc64eea3.0","@material/animation":"8.0.0-canary.ccc64eea3.0","@material/elevation":"8.0.0-canary.ccc64eea3.0","@material/typography":"8.0.0-canary.ccc64eea3.0","@material/feature-targeting":"8.0.0-canary.ccc64eea3.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_8.0.0-canary.ccc64eea3.0_1603752720075_0.8736427724034062","host":"s3://npm-registry-packages"}},"8.0.0-canary.a79cdd019.0":{"name":"@material/slider","version":"8.0.0-canary.a79cdd019.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@8.0.0-canary.a79cdd019.0","maintainers":[{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"1d73344c245cf34cc75b47892336375dbe40c143","tarball":"https://registry.npmjs.org/@material/slider/-/slider-8.0.0-canary.a79cdd019.0.tgz","fileCount":38,"integrity":"sha512-AJvj9me+6A4vDmFuFRW/mWW6Dqp+JRODtsefu1q6slsi8se/BZAkuis96/meVG5n2uqwlCr7buOa4Z9oDkQaqw==","signatures":[{"sig":"MEQCIFtJ/ojFWUXSCEfJT0mbd3vg9sHaBqvgAg88R/RzrNdaAiBmFVjSjhedFsxDk80V1AgXP+0dMj4DiG50dvAvnD2Xxw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":773581,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfmEt9CRA9TVsSAnZWagAAuRgQAKQ/sl9eOfHApi7toLvC\n0ZeeVrgYj0A2/l+sBYkBownIrvqVbB5B7MpgoxMyj3INq1srWVIbluwvfZX7\nMstr4Q3ndHrlxfxwUm1niMF9r1KqJ2pTHmBOITxm014HgaYrYLKWf15DduKt\nmzMPzFozM1uHxXo7drsb1hUBPikr1/bVzG3+yI4N3aY0Vbdw1MClvH9sMEeY\n6TP4kngUhLKppmM54dcTQdlt3VMxCYAxrAmSvIwnfqBIDUaVxD+zdZfUN7+W\nsXaZkuNF4Qv3Jk9BaQfDeQ+Q+7O4Etz++5nvslamk8nJa77Q6Kl7H0rs4q+M\n/O+UW9I4Cc7rPGJWz8UkNKfF8Ty1pSlMh4zNmnqy2hZyE994AQxyz7+JMJTu\njsacnezaYd2zpyAj/3MJJjJXO6DeQOgRR2QHxT902ZN5uzSphgr9JNnJGja6\nHjGpW1vu0dx1urk3eOR8E5AL+0Mvm+aEzLa5pTnDLZllNpTtzguWy+UFqkPM\nIf3xW2NtmjJip3qZdB+B3s0OFKX0esaKWs9vVXSDqdjYr0nuLQmJr7rCfYBR\nxKjKmN1AK4GGH72GvFUrlfPCpiPXJxbG6H6Lmh/F6fl1g8eFzfiYK9ixgUyH\nWJdF3+Pmc2+boxZlBGos2Lv/a9bW1DD8h+PgK5nxQeRTo0AN8UYDjv9V6KF4\nu2Vf\r\n=k+FJ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is modeled after the browser's\n`<input type=\"range\">` element.\n\nSliders follow accessibility best practices per the [WAI-ARIA spec](https://www.w3.org/TR/wai-aria-practices/#slider)\nand are fully RTL-aware.\n\n## Contents\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders follow the\n[WAI-ARIA guidelines](https://www.w3.org/TR/wai-aria-practices/#slider).\nPer the spec, ensure that the following attributes are added to the\n`mdc-slider__thumb` element(s):\n\n* `role=\"slider\"`\n* `aria-valuenow`: Value representing the current value.\n* `aria-valuemin`: Value representing the minimum allowed value.\n* `aria-valuemax`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value of `aria-valuenow` is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set to a string that makes the slider value\nunderstandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Continuous slider demo\" aria-valuemin=\"0\"\n       aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Continuous range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Continuous range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   `data-step` attribute on the root element. This will be the step size for\n    value quantization. If not set, the default is 1.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete slider with tick marks demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"20\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `tabindex=\"-1\"` attribute on the thumb(s)\n*   `aria-disabled=\"true\"` on the thumb(s)\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"-1\" aria-label=\"Disabled slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\" aria-disabled=\"true\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the thumb element's `aria-valuemin`,\n`aria-valuemax`, and `aria-valuenow` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"75\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string)|null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"c54ccf71e4018e84948fec32678595d974f80c67","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.22.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.22.1","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.a79cdd019.0","@material/rtl":"8.0.0-canary.a79cdd019.0","@material/base":"8.0.0-canary.a79cdd019.0","@material/theme":"8.0.0-canary.a79cdd019.0","@material/ripple":"8.0.0-canary.a79cdd019.0","@material/animation":"8.0.0-canary.a79cdd019.0","@material/elevation":"8.0.0-canary.a79cdd019.0","@material/typography":"8.0.0-canary.a79cdd019.0","@material/feature-targeting":"8.0.0-canary.a79cdd019.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_8.0.0-canary.a79cdd019.0_1603816315289_0.5032613780569604","host":"s3://npm-registry-packages"}},"8.0.0-canary.596e98424.0":{"name":"@material/slider","version":"8.0.0-canary.596e98424.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@8.0.0-canary.596e98424.0","maintainers":[{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"d00e3b8e42b117b327a872d5de11022326963362","tarball":"https://registry.npmjs.org/@material/slider/-/slider-8.0.0-canary.596e98424.0.tgz","fileCount":38,"integrity":"sha512-cgXIDniprkyYlOlaZImiTHIsS0Tc/34WQrJR5exhCyTuEXNX0s/bQUNsXfSIA1XO41D8rE9vVaUrOA+E5HYAUA==","signatures":[{"sig":"MEUCICCHP4HwsIkcuYNtOt8e5r4Tov0OqC7WupyhkPzL07WMAiEAnSRTXg1Rwn/55PXHMXKHOtE0fOannhmbSn8lyXsLBhU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":773581,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfmZZwCRA9TVsSAnZWagAAwiQP/2sK2DszGXLgeAnbt3eN\nvy0vPVu6J9XXRv5s8jjjD566JQqFC1mImkGBuB/NTOkinZ+vVKS4QkU3TRT8\nHp+95X/2EFSpCKsir1RJ/y7bzkyF5ZIqSr7lB61RR/mPXuSlkB62lFQv7u/S\n9uIjsEJkXtcV2TNxDnkzE4h/HttTSQ1piRhaMxxEWnDGCu+5yhSCEdHW7IXv\nR/xwHGi77aRudDSW1Mt6c9qNemZSBZyend39xlCYEDYgQ8+AKukJEuBMEPQv\nJKIV3PEAj3oUfbiB1SlHCnZ1cYIobrJGABxD/VuGSHKVdbBiA1SplAV85DZE\nW0/cqKChwLEbozAcZT97+H1DjFKR9XZWpc83ND7EwlBKogFF7RFvc+D1C8A8\n2rUFcYD+5ZBRYzkZB0FSOJTb2bseBN5hf0CbFfhz05kEarebVvWaMxXxTiAV\nYDwlQyISj6Xj9o1ZLr/oIP1bk0SxtK9qO4ty0quoaTpcOCDVucF18p5n7HZ9\nfOi/QGDOIhtVZ2UXMehnEsDPDQn4h2ICYUw7NB4fccQM9nnUjIMbc+h2QLcz\nxzWLlBBV3h22Kj05ard9YOJDqmkXxsfg5676Yn/maITX44pN1O8qWExTzQcE\nDae97is6bG0bc7pESA+7q2VcOueSCgU6k0TOY43MOqGC4uHswvZdesMFfgCu\nlQXO\r\n=2s4j\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is modeled after the browser's\n`<input type=\"range\">` element.\n\nSliders follow accessibility best practices per the [WAI-ARIA spec](https://www.w3.org/TR/wai-aria-practices/#slider)\nand are fully RTL-aware.\n\n## Contents\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders follow the\n[WAI-ARIA guidelines](https://www.w3.org/TR/wai-aria-practices/#slider).\nPer the spec, ensure that the following attributes are added to the\n`mdc-slider__thumb` element(s):\n\n* `role=\"slider\"`\n* `aria-valuenow`: Value representing the current value.\n* `aria-valuemin`: Value representing the minimum allowed value.\n* `aria-valuemax`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value of `aria-valuenow` is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set to a string that makes the slider value\nunderstandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Continuous slider demo\" aria-valuemin=\"0\"\n       aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Continuous range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Continuous range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   `data-step` attribute on the root element. This will be the step size for\n    value quantization. If not set, the default is 1.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete slider with tick marks demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"20\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `tabindex=\"-1\"` attribute on the thumb(s)\n*   `aria-disabled=\"true\"` on the thumb(s)\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"-1\" aria-label=\"Disabled slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\" aria-disabled=\"true\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the thumb element's `aria-valuemin`,\n`aria-valuemax`, and `aria-valuenow` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"75\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string)|null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"8fdc1f444b4540a876847c7c3fb4a934e75fee2c","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.22.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.22.1","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.596e98424.0","@material/rtl":"8.0.0-canary.596e98424.0","@material/base":"8.0.0-canary.596e98424.0","@material/theme":"8.0.0-canary.596e98424.0","@material/ripple":"8.0.0-canary.596e98424.0","@material/animation":"8.0.0-canary.596e98424.0","@material/elevation":"8.0.0-canary.596e98424.0","@material/typography":"8.0.0-canary.596e98424.0","@material/feature-targeting":"8.0.0-canary.596e98424.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_8.0.0-canary.596e98424.0_1603901040078_0.7238576747755137","host":"s3://npm-registry-packages"}},"8.0.0-canary.05d5facc2.0":{"name":"@material/slider","version":"8.0.0-canary.05d5facc2.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@8.0.0-canary.05d5facc2.0","maintainers":[{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"9253b27416e90175c693da180aa254c258df7309","tarball":"https://registry.npmjs.org/@material/slider/-/slider-8.0.0-canary.05d5facc2.0.tgz","fileCount":38,"integrity":"sha512-ZJm3NxyTBj+0eNJfBV2WoM1g7U0loCfVdCYdvyxAHs+R7ALTUADjvZosYYqUy5Dp1WS2lRQR88qRSJYcTTxt/Q==","signatures":[{"sig":"MEUCIBmwc0V3VCY0piKRsUs9I9Iys+8rZwoHUIuA6NoP4F/ZAiEAvpKq1iwTdxLdJCxD6o/STo5jDgCcYw/Q1ym3mQPI1k8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":773581,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfmZh1CRA9TVsSAnZWagAAON8P/3bA+0lZnmfJpr2AsEsS\nR2n9ZBB/YNSE558oflFt/Q/bjZm9PHz/WFHESokKksl2xe5HCVaRu/bWZYwr\nGhCqkcMoBRlBVWWgQW6EgXuyNiXhOHghUdN8/MsvizLHqVlMirwbyNKOp1a1\nVuXpJxvHWiNMgp3/a3Lbnj5a5HXL6ON5HVtOslDU8XqSvEd/6ul6NmWogn2Q\nNwqe02WzJNytAVgexxReRE0SP2Hap0XEUtq4P1TvwvnQyAJByam+vhveqF3z\nettoD+yFBIKETGMPnwBnX4mMg0bY20rFuyehokgHHy0IYkqOvR+UBX0zG4UP\nywaJH3gbIuErKJ/MADAZaOyrnAgjwwIFclkA4DMMIaSzGygSzyjt1qzKvLM4\nGpgJpEBX9f8Cbrb1IvdG07LElZNV9AOirmUztDS0wPGKmCjOOPZps5MGIyLr\nvvp70Wzv7tAepm171G1/qhzMptGTjRudj6Nj2Ip+rhdOs/DZVSv44PitbYK8\neDh4Dkp/qPdE3rFJUnu+NgYVcH21JwaOh9EROf/6JB/jGtwKY9Uhvz8Qy440\nWvr2fMmsdD37pxPaYxq/q43dT161n7Kr38K5fBhulBtBxuZcFqY+SJC4vwph\n7ToHwXFgVOiluAnRzE1OH2gNudz/tM2FDduPxShHt2GMuMTSigFjB5SKH0RT\nUA/7\r\n=rRew\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is modeled after the browser's\n`<input type=\"range\">` element.\n\nSliders follow accessibility best practices per the [WAI-ARIA spec](https://www.w3.org/TR/wai-aria-practices/#slider)\nand are fully RTL-aware.\n\n## Contents\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders follow the\n[WAI-ARIA guidelines](https://www.w3.org/TR/wai-aria-practices/#slider).\nPer the spec, ensure that the following attributes are added to the\n`mdc-slider__thumb` element(s):\n\n* `role=\"slider\"`\n* `aria-valuenow`: Value representing the current value.\n* `aria-valuemin`: Value representing the minimum allowed value.\n* `aria-valuemax`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value of `aria-valuenow` is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set to a string that makes the slider value\nunderstandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Continuous slider demo\" aria-valuemin=\"0\"\n       aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Continuous range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Continuous range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   `data-step` attribute on the root element. This will be the step size for\n    value quantization. If not set, the default is 1.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete slider with tick marks demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"20\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `tabindex=\"-1\"` attribute on the thumb(s)\n*   `aria-disabled=\"true\"` on the thumb(s)\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"-1\" aria-label=\"Disabled slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\" aria-disabled=\"true\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the thumb element's `aria-valuemin`,\n`aria-valuemax`, and `aria-valuenow` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"75\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string)|null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"db17092b19dabd6628edec5bf226f0b6a48e4f95","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.22.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.22.1","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.05d5facc2.0","@material/rtl":"8.0.0-canary.05d5facc2.0","@material/base":"8.0.0-canary.05d5facc2.0","@material/theme":"8.0.0-canary.05d5facc2.0","@material/ripple":"8.0.0-canary.05d5facc2.0","@material/animation":"8.0.0-canary.05d5facc2.0","@material/elevation":"8.0.0-canary.05d5facc2.0","@material/typography":"8.0.0-canary.05d5facc2.0","@material/feature-targeting":"8.0.0-canary.05d5facc2.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_8.0.0-canary.05d5facc2.0_1603901557147_0.6406683225365257","host":"s3://npm-registry-packages"}},"8.0.0-canary.291b3553d.0":{"name":"@material/slider","version":"8.0.0-canary.291b3553d.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@8.0.0-canary.291b3553d.0","maintainers":[{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"52fa957bec8a6766247614f2ae8e134de06801be","tarball":"https://registry.npmjs.org/@material/slider/-/slider-8.0.0-canary.291b3553d.0.tgz","fileCount":38,"integrity":"sha512-P7uYiS+Ld99e8EbRnn6N5MeFBoGubU0jhfcL5JhsXuXJ7EWPiWKQgHytQyeZfUp2n3Hpho2FC2ystyicLBQL0w==","signatures":[{"sig":"MEUCIQCEuEezWV9IRcmAATAW70zm38CmodnSQlPwAr0e6r5odQIgMWkFFakZxpQdUeKTKq3FLTIcv1Ehe32l6Cmb2Rz6kfg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":773581,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfma43CRA9TVsSAnZWagAAjQoP/3WeyznkvA+03xcuA+L1\n2Lq4AeuJYwd++tHxB6S92Bil1gUEveRzDLv6p7E2jtITOn4fyRelchQKeUqZ\nB+CtB1X1sfghntod31MW2D5mceAW1WKoc3KHS1WlDxfuAJ0U82WqRG5ynuOJ\ntKAoAtJwi50m33HfPo4iBOcBlcoMn7Tft6CIquTv5NsVgOvzkWgN24opNc+v\nw3qfWWM46Mt3EboFRT5HX4EWf8V0Ou7DpDgSITtKmkOpPamuMM5n27Zh9MrS\nAtzjKdBlPzJwDEwnqPgPmPsTRu42kYoTFF3krEG5ZdNfvVdvbXEbhPg6H5x7\n/z1gcupptmCHDLpNsZkfRcRXAB/VJxieVo2mcAIToJ/Ep/XG42SNGc3X2mSQ\nAp71pu2X8VpM4jMas7JroI5LSwAEd5pnU+KUkxwWSntzLSCzdzgeiTVvRz9+\nI1OaJZ7jHcRBBvFX3+VJahgwkoQoavW++HGmeRQsHDQGb3OoP/n2H/KnLyLH\nSwBD4JqKGnEaf9uGg2HUlRzFm5smhyl/xo/MiL6r4ogcOZ80/3R9bI1GPEBV\nYSVrm8zt+pJG+WaN17q/WwAqLakTBBTjWh6DfiPOVNGBGsGu59E4FcmkIU5Y\n1SgNLJd+Qiw9++xSfY8AV2TA8wIyy+YZuaZWsu1xWG1kHW3MsnPWBr+96ELs\nQswb\r\n=KQA5\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is modeled after the browser's\n`<input type=\"range\">` element.\n\nSliders follow accessibility best practices per the [WAI-ARIA spec](https://www.w3.org/TR/wai-aria-practices/#slider)\nand are fully RTL-aware.\n\n## Contents\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders follow the\n[WAI-ARIA guidelines](https://www.w3.org/TR/wai-aria-practices/#slider).\nPer the spec, ensure that the following attributes are added to the\n`mdc-slider__thumb` element(s):\n\n* `role=\"slider\"`\n* `aria-valuenow`: Value representing the current value.\n* `aria-valuemin`: Value representing the minimum allowed value.\n* `aria-valuemax`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value of `aria-valuenow` is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set to a string that makes the slider value\nunderstandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Continuous slider demo\" aria-valuemin=\"0\"\n       aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Continuous range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Continuous range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   `data-step` attribute on the root element. This will be the step size for\n    value quantization. If not set, the default is 1.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete slider with tick marks demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"20\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `tabindex=\"-1\"` attribute on the thumb(s)\n*   `aria-disabled=\"true\"` on the thumb(s)\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"-1\" aria-label=\"Disabled slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\" aria-disabled=\"true\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the thumb element's `aria-valuemin`,\n`aria-valuemax`, and `aria-valuenow` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"75\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string)|null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"bbd141e6c5168a84cdf50ef1302c9f705f0eb283","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.22.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.22.1","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.291b3553d.0","@material/rtl":"8.0.0-canary.291b3553d.0","@material/base":"8.0.0-canary.291b3553d.0","@material/theme":"8.0.0-canary.291b3553d.0","@material/ripple":"8.0.0-canary.291b3553d.0","@material/animation":"8.0.0-canary.291b3553d.0","@material/elevation":"8.0.0-canary.291b3553d.0","@material/typography":"8.0.0-canary.291b3553d.0","@material/feature-targeting":"8.0.0-canary.291b3553d.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_8.0.0-canary.291b3553d.0_1603907127390_0.09139839121837556","host":"s3://npm-registry-packages"}},"8.0.0-canary.dbc449b09.0":{"name":"@material/slider","version":"8.0.0-canary.dbc449b09.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@8.0.0-canary.dbc449b09.0","maintainers":[{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"a160537db922344f08a5549b4c454ea236a517a3","tarball":"https://registry.npmjs.org/@material/slider/-/slider-8.0.0-canary.dbc449b09.0.tgz","fileCount":38,"integrity":"sha512-+sdDzLafGgwtMvXMsV3/FW0O0VOFiXl1Y7GLNHv4Ek+hgtS2lS6nnJKOz7PlFJKzMU0+mC1zgYKXcfqyqcyjmA==","signatures":[{"sig":"MEQCIGtyEuXQIpwsnZFAdmEW63WtZW1p1DNr8H6ZDw1upOwUAiAh74A8espNyvrPG2hk88H7vDCwJUHX7J67MEm8hihPUw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":773584,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfmbS5CRA9TVsSAnZWagAA/lMP/jbRv2TN8SULr2m2ICgj\nMmdUw2cw5F0ryWUgrXxSLKY4l2D/dWiSJUQWQj0yHLufF+YJobD+ahPh0IyU\nAOCR/BQvZolcnCXMy6bZfi/2UYAIXwxUZ/Ga//RjkOLOg+67S9dGg4jPxgiE\nGJB5+dl8vJ6V1hk8VmiJgUxwwnQW6w4KjODDj9CmwK4daMwMdZs/6ZP3wpw0\n/NIOw5NopQ9flyvXl3lJQpKxf20k0Ztj25Ako0/RB43WJpgOWayeJ1zhumod\nN1GbsvSlhU9ymDbLy9Ns+AGaH1zC2Wfa4UzlQ8wDP2aAy4kISbuY1GTepUB/\nykPf6HmNcgKaf/JeKSVDMBbBHQaktP0/E2hCm5E0XAFwVvCuCLNiXKF5US/Y\njz64IuISZtaJwi9rTm3gygPn8FV+OcJa1oJyvJKLscVsPXjWAQHhnue2eOCE\nSBnh/eSPMJOQ0yEAWgsuvGh2SKavbtGWvP5Gh5BmXBCbXE0gxZWgyiMzhG0p\nm5X7Sh+L+Hwdc/lA7EWmUQBKZJ8q4UJfu30hryDQqOh21+jYeTWK7BKcBf4g\nb2hyabV6uhBEVNPLEmbj9idu/6nUW/H7hRg91IVGUw7lYC4pGsc6givGr6Ao\nJANgL+Wzn+ADNOL5i0ZJpsU4AQE4tHUKZf8iH5yONXhuw4Kms/5fSuofNJ/S\nfDLT\r\n=CWHP\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is modeled after the browser's\n`<input type=\"range\">` element.\n\nSliders follow accessibility best practices per the [WAI-ARIA spec](https://www.w3.org/TR/wai-aria-practices/#slider)\nand are fully RTL-aware.\n\n## Contents\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders follow the\n[WAI-ARIA guidelines](https://www.w3.org/TR/wai-aria-practices/#slider).\nPer the spec, ensure that the following attributes are added to the\n`mdc-slider__thumb` element(s):\n\n* `role=\"slider\"`\n* `aria-valuenow`: Value representing the current value.\n* `aria-valuemin`: Value representing the minimum allowed value.\n* `aria-valuemax`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value of `aria-valuenow` is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set to a string that makes the slider value\nunderstandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Continuous slider demo\" aria-valuemin=\"0\"\n       aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Continuous range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Continuous range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   `data-step` attribute on the root element. This will be the step size for\n    value quantization. If not set, the default is 1.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete slider with tick marks demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"20\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `tabindex=\"-1\"` attribute on the thumb(s)\n*   `aria-disabled=\"true\"` on the thumb(s)\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"-1\" aria-label=\"Disabled slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\" aria-disabled=\"true\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the thumb element's `aria-valuemin`,\n`aria-valuemax`, and `aria-valuenow` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"75\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string)|null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"7888f3b13baccffea8b2b02ef5c25e264ae321e4","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.22.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.22.1","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.dbc449b09.0","@material/rtl":"8.0.0-canary.dbc449b09.0","@material/base":"8.0.0-canary.dbc449b09.0","@material/theme":"8.0.0-canary.dbc449b09.0","@material/ripple":"8.0.0-canary.dbc449b09.0","@material/animation":"8.0.0-canary.dbc449b09.0","@material/elevation":"8.0.0-canary.dbc449b09.0","@material/typography":"8.0.0-canary.dbc449b09.0","@material/feature-targeting":"8.0.0-canary.dbc449b09.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_8.0.0-canary.dbc449b09.0_1603908793220_0.7655890017679454","host":"s3://npm-registry-packages"}},"8.0.0-canary.4794b25da.0":{"name":"@material/slider","version":"8.0.0-canary.4794b25da.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@8.0.0-canary.4794b25da.0","maintainers":[{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"18485ec6ecd854481ad9db079f70042998b94391","tarball":"https://registry.npmjs.org/@material/slider/-/slider-8.0.0-canary.4794b25da.0.tgz","fileCount":38,"integrity":"sha512-Orkua1AyijcDra+CMSBVa/CU0vYp/LdzbgzSRWcaRzj2ojg0dT+SgED34Cr903y6UGE3pgXcqgCSrzg2+SoZRA==","signatures":[{"sig":"MEUCIAXwDL19FcoEN1mCaw/ZFRU6lwRUI5TPnzFO4zhh1CxRAiEAv9ae6y7eUYWvZS2To9RlJhyrfxG1I+yQUfz7LSRe9hM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":773584,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfmbtiCRA9TVsSAnZWagAAQ4EP/i/VkbMSgRSfZTOPTZGw\n+dlAWEOJdB5iCa+c0HK4tl7PmTdIzuzomefQ2fGWAWnkr62aBwKaRZdb62jZ\n9kmRaWznzpCvQfC7TEtCRTgkZtVqxQEjWj4Pve26UdT5F4LDerutaiEyUHeW\nn2BPVsLBiAFSi2nDjsiVbTFIGBvE3gSCrd1Ma37Tpc7+PlWf49Yfx/TnooXo\nUyR5iW9uwkPrXn87PGbUMHVCw1L2H7k9fRItE8B08MY1ynUH76zbwC5HSnlM\nbLFdHlY1vt/g82JPihP4tSJpRRlAgji/vED5+gqfFTmOEyBhbEHTjFRpJ1kk\nQsmuXvuE5svNsUFORgsWlaERCyYhTFDM7muKjXWGVSuk8k5TfWdyLRw3swYn\nWdBvCH6YIwx3tJ6b5yNYUlWb0J8zKWYtPN5Ji/tSWaNiub9uAvnp95R5HtZ4\n1oQGcCrEaPEMrjH6CaIpfPXfm36HS13mKB/03yiX15jr6roMm85wCC6W4Hi5\nbX2lAl+AZVcTm/4vgzXEXKeEQROa9ASyyU+2IfwCYonLlQPsc9LbUTeKIhXo\nQIgrxAzraG0aVQjoixYKPep+MkNifNcStWakZ+HSztjhUo+SqTmDTJuLf7MV\nsp6Pk/TSOi15aaW8OiPlkifZAkYNx9ml/PZ6kSpg69y2/2eehKWphbUuXHOB\nNkBy\r\n=xgKr\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is modeled after the browser's\n`<input type=\"range\">` element.\n\nSliders follow accessibility best practices per the [WAI-ARIA spec](https://www.w3.org/TR/wai-aria-practices/#slider)\nand are fully RTL-aware.\n\n## Contents\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders follow the\n[WAI-ARIA guidelines](https://www.w3.org/TR/wai-aria-practices/#slider).\nPer the spec, ensure that the following attributes are added to the\n`mdc-slider__thumb` element(s):\n\n* `role=\"slider\"`\n* `aria-valuenow`: Value representing the current value.\n* `aria-valuemin`: Value representing the minimum allowed value.\n* `aria-valuemax`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value of `aria-valuenow` is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set to a string that makes the slider value\nunderstandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Continuous slider demo\" aria-valuemin=\"0\"\n       aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Continuous range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Continuous range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   `data-step` attribute on the root element. This will be the step size for\n    value quantization. If not set, the default is 1.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete slider with tick marks demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"20\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `tabindex=\"-1\"` attribute on the thumb(s)\n*   `aria-disabled=\"true\"` on the thumb(s)\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"-1\" aria-label=\"Disabled slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\" aria-disabled=\"true\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the thumb element's `aria-valuemin`,\n`aria-valuemax`, and `aria-valuenow` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"75\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string)|null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"0c2eec6be7b76adae9376847043bcde093f59d3d","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.22.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.22.1","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.4794b25da.0","@material/rtl":"8.0.0-canary.4794b25da.0","@material/base":"8.0.0-canary.4794b25da.0","@material/theme":"8.0.0-canary.4794b25da.0","@material/ripple":"8.0.0-canary.4794b25da.0","@material/animation":"8.0.0-canary.4794b25da.0","@material/elevation":"8.0.0-canary.4794b25da.0","@material/typography":"8.0.0-canary.4794b25da.0","@material/feature-targeting":"8.0.0-canary.4794b25da.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_8.0.0-canary.4794b25da.0_1603910498209_0.6184284246310361","host":"s3://npm-registry-packages"}},"8.0.0-canary.c61db90a5.0":{"name":"@material/slider","version":"8.0.0-canary.c61db90a5.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@8.0.0-canary.c61db90a5.0","maintainers":[{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"dcbb31fd382f6d7d1c97d108ae1fec9c2e8e7418","tarball":"https://registry.npmjs.org/@material/slider/-/slider-8.0.0-canary.c61db90a5.0.tgz","fileCount":38,"integrity":"sha512-q0LhoHJFCLa3yPg0moQKd2lzNAfcAtd+vgd4FB2FgMRLQ/ipwGktOrvGMVcElvylNwPelVqrR3xfYiTpib8n3A==","signatures":[{"sig":"MEYCIQDDaLHmbQlUAS7WoALIOnOUnnwWANMNv0QhDjGtRyP7yAIhAIPf0ZEbegkvkI+ghgcRh/DzawJVJGihmKTmQn2dIApP","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":773584,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfmb+9CRA9TVsSAnZWagAASgIP/igky09mpuepBL+TVnqF\n+1lUmJ4y7Tm+74SjwPX+EXgsvYIGRfgWErGQwaCwwoKv/wGbWuZ3LmqOZ/1d\nfd1RbPjqaSFH4VM1H7Lt6kClcJyzSRVM8PwYnpBY0hFnF6WYdKraLFGsK+4E\nMuUOFg/kW1sxzBE6DyjMJ7FqMfKGCF9JQ8MmFa+Ea01VfaN5FRhFQamg+iuT\ndKNRZuEhgcv+kMkbdV8D5pBtGaFMRC91EmNQG/T2HwWARGw8PaOsg9ysDO3G\nXg1s4XHqNPs+FAO596x0qXewulYy9cRX0M27NIz/aL9YrCKadhiCpa5j7yt0\n6xmDpoHdgzQL9BPHDF6nI8ICTiF/Mp37aE8Omn7wtfFqbEVooRHqg4A2VDQF\nsOtH4CQXhFWq0QBGLXEZb+lCwMA2dBGDgFCd0s5X9wiNeygxMlRuKaNIWUxI\nTUY0N4REmzJXiHkBY2mx4uHPsWw+5w5V0rOKJweArQ1UNv3b7f6efECT6KLt\nfb56FiApDwBZheGKNh/xfh4DYmY0k37tsSBiGnqtz5d59kMVXSiFUoBxPOU4\nf4VI2gt6L9QCGISgxslw7sYXsI/gvoaJNyJbRSPrDuyxiSk68tebjZmTmA0Z\nTQDBBWeYIdGBfTXqHtgLAEeVI3IZCQRbb7MfN1vIoxGbMvkfjuOrxiTl1IbQ\nCfla\r\n=0R8n\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is modeled after the browser's\n`<input type=\"range\">` element.\n\nSliders follow accessibility best practices per the [WAI-ARIA spec](https://www.w3.org/TR/wai-aria-practices/#slider)\nand are fully RTL-aware.\n\n## Contents\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders follow the\n[WAI-ARIA guidelines](https://www.w3.org/TR/wai-aria-practices/#slider).\nPer the spec, ensure that the following attributes are added to the\n`mdc-slider__thumb` element(s):\n\n* `role=\"slider\"`\n* `aria-valuenow`: Value representing the current value.\n* `aria-valuemin`: Value representing the minimum allowed value.\n* `aria-valuemax`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value of `aria-valuenow` is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set to a string that makes the slider value\nunderstandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Continuous slider demo\" aria-valuemin=\"0\"\n       aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Continuous range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Continuous range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   `data-step` attribute on the root element. This will be the step size for\n    value quantization. If not set, the default is 1.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete slider with tick marks demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"20\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `tabindex=\"-1\"` attribute on the thumb(s)\n*   `aria-disabled=\"true\"` on the thumb(s)\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"-1\" aria-label=\"Disabled slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\" aria-disabled=\"true\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the thumb element's `aria-valuemin`,\n`aria-valuemax`, and `aria-valuenow` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"75\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string)|null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"695570eb7478c283510b9174ac7c4911866e0868","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.22.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.22.1","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.c61db90a5.0","@material/rtl":"8.0.0-canary.c61db90a5.0","@material/base":"8.0.0-canary.c61db90a5.0","@material/theme":"8.0.0-canary.c61db90a5.0","@material/ripple":"8.0.0-canary.c61db90a5.0","@material/animation":"8.0.0-canary.c61db90a5.0","@material/elevation":"8.0.0-canary.c61db90a5.0","@material/typography":"8.0.0-canary.c61db90a5.0","@material/feature-targeting":"8.0.0-canary.c61db90a5.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_8.0.0-canary.c61db90a5.0_1603911613335_0.04274906941259071","host":"s3://npm-registry-packages"}},"8.0.0-canary.6d9648ab2.0":{"name":"@material/slider","version":"8.0.0-canary.6d9648ab2.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@8.0.0-canary.6d9648ab2.0","maintainers":[{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"f965e6da03b858bd096a45afeddc4b9e5540684c","tarball":"https://registry.npmjs.org/@material/slider/-/slider-8.0.0-canary.6d9648ab2.0.tgz","fileCount":38,"integrity":"sha512-0+dPhNjTsOiklbEbAJJ2kGNidBIqXi7vajZETKeQu1HdPmNdRAKhEd9ICPMH0FPqAUtJMSAfUSEH1OE2y24INQ==","signatures":[{"sig":"MEUCIQDqXDP9qncE9QckvsOQ8iRfeIZPEau8Z5E80gqxa6CdLQIge/oE8wLUk5AkZRv/qz9ukhZ8m8voOeB23vCwVKrkuaw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":773584,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfmyb+CRA9TVsSAnZWagAAMysP/j4VFDKAiQ9zFp2MW6JT\nnqk9SqQozTfNQa3yrrPzTOi/d+i+auZs4+k+Q7kaXvQMESwADgecGjC71Aey\ne9WfVdkEOc54CaW1vS7ab4jvkzLHwx4EqJpyM38kP5Y0I4GnFN3lFp2N9+t2\ns4JAtcVRuvNQ1a5k/OzPKjlvjPG5zhx6UJ4pkDsfnxH/bWe4zaX+VrXtPgqp\nTSCSNWiO5LAbBKqGQNxhvKKk6SusrI2Ixr5Do490rHIkjiE7nGh4/oaCu918\nI0o1sGIyysHOKCgBy1ZEmDsKxO1KPxxNm5yOg66JYdYIuUSrXmBtSsLd719b\ny52Sex9iyCFbz1bKCYh50x4UIMvbeWMq8G59oC4clq76tFU4w8sbiyFuGblE\no0PTrCTwWjN9ojX5U/+AB1JyrUN6AzDxLD4dxHkzgHAK55skBxWcC4glCbiV\nXwy+l0a6pNszRDin6cVNxwejurAljJnyFduPFfrIGZ5L8MjcgJBuSoM9UX/y\n6e5kJxLcBZnXDDm7v01EXynX24Zgd3hqEQtF8AKFQwNqnt3zjn2hW5OuoNiO\nV79tqQcowCRKDqv4WGIacaOKE5pVokm5CN+ux6w7LUukkqNHIpb2a7MoB2GE\na7shBFyZb5PMpFUk+97xjZOqcNGIYM+QHEjTos4HrPjfgu0ZcBe9Sr7ne1nB\nUhCk\r\n=HGeI\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is modeled after the browser's\n`<input type=\"range\">` element.\n\nSliders follow accessibility best practices per the [WAI-ARIA spec](https://www.w3.org/TR/wai-aria-practices/#slider)\nand are fully RTL-aware.\n\n## Contents\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders follow the\n[WAI-ARIA guidelines](https://www.w3.org/TR/wai-aria-practices/#slider).\nPer the spec, ensure that the following attributes are added to the\n`mdc-slider__thumb` element(s):\n\n* `role=\"slider\"`\n* `aria-valuenow`: Value representing the current value.\n* `aria-valuemin`: Value representing the minimum allowed value.\n* `aria-valuemax`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value of `aria-valuenow` is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set to a string that makes the slider value\nunderstandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Continuous slider demo\" aria-valuemin=\"0\"\n       aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Continuous range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Continuous range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   `data-step` attribute on the root element. This will be the step size for\n    value quantization. If not set, the default is 1.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete slider with tick marks demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"20\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `tabindex=\"-1\"` attribute on the thumb(s)\n*   `aria-disabled=\"true\"` on the thumb(s)\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"-1\" aria-label=\"Disabled slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\" aria-disabled=\"true\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the thumb element's `aria-valuemin`,\n`aria-valuemax`, and `aria-valuenow` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"75\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string)|null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"5de6a39d4b70a98beb71cf8243a219f454b11aa3","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.22.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.22.1","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.6d9648ab2.0","@material/rtl":"8.0.0-canary.6d9648ab2.0","@material/base":"8.0.0-canary.6d9648ab2.0","@material/theme":"8.0.0-canary.6d9648ab2.0","@material/ripple":"8.0.0-canary.6d9648ab2.0","@material/animation":"8.0.0-canary.6d9648ab2.0","@material/elevation":"8.0.0-canary.6d9648ab2.0","@material/typography":"8.0.0-canary.6d9648ab2.0","@material/feature-targeting":"8.0.0-canary.6d9648ab2.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_8.0.0-canary.6d9648ab2.0_1604003581571_0.12441683095025224","host":"s3://npm-registry-packages"}},"8.0.0-canary.5511c5254.0":{"name":"@material/slider","version":"8.0.0-canary.5511c5254.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@8.0.0-canary.5511c5254.0","maintainers":[{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"5dc2b52a93dbca42d371cb0a3734582246c57f2c","tarball":"https://registry.npmjs.org/@material/slider/-/slider-8.0.0-canary.5511c5254.0.tgz","fileCount":38,"integrity":"sha512-jvNUh0SehppivxxuEYNz+/ZIAR6t1atTD9j0fmV+5FH0WdVuwBvLB4XdVi6MS5ipwH1WZFzb/FpgqCdTufUdYg==","signatures":[{"sig":"MEUCIQCfQDIgZtu70ikwPBvAyz+1KRWMQ+LVwOHRptMnyjsKpgIgUJMXn2Vj3gr+cWN9mh49uG5WMJ4Ir3yAOc9E09juaXc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":773584,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfnFTJCRA9TVsSAnZWagAAvwAP/AzEKS/UJtt96LnTZTvO\nUvPxRyw7o2vrTte+WMTQAb25Vgkmew420HyrO1Dl2L+Yx4DWZB0pojk/HFIk\nMgV0xXwmDBiASgWLHwL64MWbxjWNK9jgFLOjKgUl/WA8KBy1/H239TkHL4eN\nQAgxPTu76oSSQQXZXDBD1pKN7P3LoMf5eCMbycrXhBt4xp6zDvwJVDKNb1Ml\n2EsINZ6Teu8KukEixeKuJeyb3IjkkQGI8AK4Ih6mkUPRCkbhD1pWGgRk2JS9\nJtKYDBlwzjLr/gyPL+mfXsppMRfguW+rPzXrvK92yFuAX9cheDPwosNN2+CV\nzKf8eQd/xYMOkpDovVf73xTdENZf7jRG3/kLCfFDd2jFcI0TB+L5jzE3LVhq\nmh7IiAk77/7/irxE67CdME69DRi5OdtmBfEGWoniIuwH1cVbDBywCmjJcx1L\n3eTPWSwsk3VEnQ4mcmn1tos817UXJyF74CrqVu7ig2CdKDW2AQmQnqssWh+y\nXdAsMHjNPplZsjDcmz9dEIASA6oDElVyjlBxDiW8AskgFKkD9PAxIG65ioNN\nXrsxvEAqEkasjfvauXmAKOJJmKBAlS1OHcctVDeoeyqnwLHRDnXXqRt4ls8a\nF2MMFXtr9p5JTSdGikBvFKFGLpmDbGGUBYjzrWw4Mc2GUwDBvr2sABOEZQrv\nfwks\r\n=5z49\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is modeled after the browser's\n`<input type=\"range\">` element.\n\nSliders follow accessibility best practices per the [WAI-ARIA spec](https://www.w3.org/TR/wai-aria-practices/#slider)\nand are fully RTL-aware.\n\n## Contents\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders follow the\n[WAI-ARIA guidelines](https://www.w3.org/TR/wai-aria-practices/#slider).\nPer the spec, ensure that the following attributes are added to the\n`mdc-slider__thumb` element(s):\n\n* `role=\"slider\"`\n* `aria-valuenow`: Value representing the current value.\n* `aria-valuemin`: Value representing the minimum allowed value.\n* `aria-valuemax`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value of `aria-valuenow` is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set to a string that makes the slider value\nunderstandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Continuous slider demo\" aria-valuemin=\"0\"\n       aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Continuous range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Continuous range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   `data-step` attribute on the root element. This will be the step size for\n    value quantization. If not set, the default is 1.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete slider with tick marks demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"20\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `tabindex=\"-1\"` attribute on the thumb(s)\n*   `aria-disabled=\"true\"` on the thumb(s)\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"-1\" aria-label=\"Disabled slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\" aria-disabled=\"true\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the thumb element's `aria-valuemin`,\n`aria-valuemax`, and `aria-valuenow` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"75\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string)|null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"e847a627e044cecc475be1f0140e17a4e2a68dbc","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.22.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.22.1","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.5511c5254.0","@material/rtl":"8.0.0-canary.5511c5254.0","@material/base":"8.0.0-canary.5511c5254.0","@material/theme":"8.0.0-canary.5511c5254.0","@material/ripple":"8.0.0-canary.5511c5254.0","@material/animation":"8.0.0-canary.5511c5254.0","@material/elevation":"8.0.0-canary.5511c5254.0","@material/typography":"8.0.0-canary.5511c5254.0","@material/feature-targeting":"8.0.0-canary.5511c5254.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_8.0.0-canary.5511c5254.0_1604080840867_0.42027868075828545","host":"s3://npm-registry-packages"}},"8.0.0-canary.bd6e302a4.0":{"name":"@material/slider","version":"8.0.0-canary.bd6e302a4.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@8.0.0-canary.bd6e302a4.0","maintainers":[{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"c47e50f50d8985dc78a9b70bfa48aba9f8f31d69","tarball":"https://registry.npmjs.org/@material/slider/-/slider-8.0.0-canary.bd6e302a4.0.tgz","fileCount":38,"integrity":"sha512-GasG5+nq7tMnW8ZjLWkF00vORwtWxtb6ZBTre2J06ccj9J1VsCgbOgEE/ZpeIozbLHAezXehghdRqvS0cyK/UA==","signatures":[{"sig":"MEUCIERRJlKWaS2KlijQ7cBoOoK+UrfonXyQuKiNidij5LnXAiEAnQnAgjrFHs0+9nX1Fhg4lJr4GQ6gsa8Nqi/LAvb5PrE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":773584,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfoDxRCRA9TVsSAnZWagAA0q8P/jNYrkcpgmyyT5C1kEzI\n1CeM81rZrWlVDYFVpakXOmYkXYjdMssnXg7sizVTqZuVUJYPCJQixLq1aSfo\nV0i8j4JaRS5pA7/YgzKqmquIk2uTu5zfYUb0VTzSb6e+gpH8/rf/maOO0EaX\n8uMgckGXdjRUyXv60eG36Lp3hozxx6Kg/ozoNP7VNIJ3jTFarHPIdDyjfygB\nhRFHQn0P2wA4IPqsxAlf47qhvODg5gbrzh9ajkoio7OMKTo+N20CbjCHNYow\nuxdlFwH8iuRnuKMrPaxwm5u4uJ+7AuvqAGhK1krx0G9JxOflcey4UtOwllWQ\ntWbG0SAtvrkB1OXdSXxwnJc38iM9HZMzGr1HtEUHFSWb6FBzX7jBYI9TzHHJ\nGbNDbz3uPfBq4RGwnnsXfIrMisT9g1p9EIeY4BZceUfmoHMi/UhnwXBUU36E\nhCYmJG/H45MTXw+HfKW6TUkUvrx9cBOTNBiBqEXd7TlRjsPdj5IZDt7tjQCZ\nrqq7rSBsG2CUqj5Qcdl/j7MzaJ1aY3sTP51+5IJ2nqpixwgjysir3FV4IXJ5\naSTb1cFLgECMSOAaeVho7zSsY7vAuSndMCUHTR/8GLW+WD7R8a5tbWYDmVqv\nHU+stozmihunfZy32Vab2DoXtdTlTnUKyMOlvWSDdTZIxXcbaT+zha+L7hSy\nRzpX\r\n=8q2G\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is modeled after the browser's\n`<input type=\"range\">` element.\n\nSliders follow accessibility best practices per the [WAI-ARIA spec](https://www.w3.org/TR/wai-aria-practices/#slider)\nand are fully RTL-aware.\n\n## Contents\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders follow the\n[WAI-ARIA guidelines](https://www.w3.org/TR/wai-aria-practices/#slider).\nPer the spec, ensure that the following attributes are added to the\n`mdc-slider__thumb` element(s):\n\n* `role=\"slider\"`\n* `aria-valuenow`: Value representing the current value.\n* `aria-valuemin`: Value representing the minimum allowed value.\n* `aria-valuemax`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value of `aria-valuenow` is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set to a string that makes the slider value\nunderstandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Continuous slider demo\" aria-valuemin=\"0\"\n       aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Continuous range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Continuous range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   `data-step` attribute on the root element. This will be the step size for\n    value quantization. If not set, the default is 1.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete slider with tick marks demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"20\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `tabindex=\"-1\"` attribute on the thumb(s)\n*   `aria-disabled=\"true\"` on the thumb(s)\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"-1\" aria-label=\"Disabled slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\" aria-disabled=\"true\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the thumb element's `aria-valuemin`,\n`aria-valuemax`, and `aria-valuenow` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"75\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string)|null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"b48f791b92804fe77eeba96f057b1baa89c48e3f","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.22.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.22.1","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.bd6e302a4.0","@material/rtl":"8.0.0-canary.bd6e302a4.0","@material/base":"8.0.0-canary.bd6e302a4.0","@material/theme":"8.0.0-canary.bd6e302a4.0","@material/ripple":"8.0.0-canary.bd6e302a4.0","@material/animation":"8.0.0-canary.bd6e302a4.0","@material/elevation":"8.0.0-canary.bd6e302a4.0","@material/typography":"8.0.0-canary.bd6e302a4.0","@material/feature-targeting":"8.0.0-canary.bd6e302a4.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_8.0.0-canary.bd6e302a4.0_1604336721310_0.3887077043574787","host":"s3://npm-registry-packages"}},"9.0.0-canary.d6b5cd418.0":{"name":"@material/slider","version":"9.0.0-canary.d6b5cd418.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@9.0.0-canary.d6b5cd418.0","maintainers":[{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"5c2420d167f6451432240f97435c6adbf3e8110a","tarball":"https://registry.npmjs.org/@material/slider/-/slider-9.0.0-canary.d6b5cd418.0.tgz","fileCount":38,"integrity":"sha512-+OQ1PbyijzfrdPisyTynKPiPqjj7lGe4hvhkohyVJ8QkpXEYPnieF4QxOgYm7vHte4oXJSusByBDuP3rfpR7bw==","signatures":[{"sig":"MEUCIFrPfoL56drLHMxXUVScN6GfNnwBPiQyGo8Z0ZPEyNgwAiEAxQXRkCM53jc39Q99vDq3pUO8D04B0rFJ1tRETpiikmc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":773584,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfoI9aCRA9TVsSAnZWagAAhKAP/0nprW4qmPOynCfwc/jR\nu3lyp055q8vkAOzhrhDMtOUErxJMBItYBQBm5KPDw9f7TApKbVfl5cEvVbPE\nG/cwRCGkSagGdGVgM9Ub11BWVo29y8dp2ICz1fLG8/I0oLEsXV7HQ1Y8m4HB\nZ6sMpN8dfXKvh82aaxbVbQncgGMsJcioOmjFu0fXg3Dad8SBEJjN16PQ3nAW\nUACEMhsD/9qHsjRiN9LEyLUU8Tb+XeL1iHPU8cu+TGKFWP3yC2sNJz5OvK3f\n8LtE6r+YarEiBCMf8WHeHWGlPvRno7dOQoesdYaUc7nuXFvIxwNLumEWGihB\ntXQcfXn4VES1bP7zEYqwG1XL4a2hLlkQc8BiJrxxb7Ib3DYx0lPVIt4o/aXw\ndzdTwYrbh54w3Aphhkf5EmYQNd9OJBODG/lLmD2Avyp6S4ZW8ymcLD+z9ebb\nuTHCBKJrBSBoxxjgOX6IKqh4X2xAr7JYpuS0dE0A/axJCNV4kwdtTHGQHNH1\nf0yZ2iWb6O1qHXaOG1yMQNWnYHJukZ9ms0FyzhGSLCXJpG8KiUfwMIV0T3x9\nmDDNoy5XUjMTuDwjj6Aq5NsInJpwU41CNgp1vYwdvmFIx2RKYR5zAPKUh/SM\ntLEgF8e6MSKWdRglRxenQ2DDwEWKeMRHhrFjDLj3N45D8tN37f4ZUsE06bFR\nIYFJ\r\n=lYkM\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is modeled after the browser's\n`<input type=\"range\">` element.\n\nSliders follow accessibility best practices per the [WAI-ARIA spec](https://www.w3.org/TR/wai-aria-practices/#slider)\nand are fully RTL-aware.\n\n## Contents\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders follow the\n[WAI-ARIA guidelines](https://www.w3.org/TR/wai-aria-practices/#slider).\nPer the spec, ensure that the following attributes are added to the\n`mdc-slider__thumb` element(s):\n\n* `role=\"slider\"`\n* `aria-valuenow`: Value representing the current value.\n* `aria-valuemin`: Value representing the minimum allowed value.\n* `aria-valuemax`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value of `aria-valuenow` is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set to a string that makes the slider value\nunderstandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Continuous slider demo\" aria-valuemin=\"0\"\n       aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Continuous range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Continuous range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   `data-step` attribute on the root element. This will be the step size for\n    value quantization. If not set, the default is 1.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete slider with tick marks demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"20\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `tabindex=\"-1\"` attribute on the thumb(s)\n*   `aria-disabled=\"true\"` on the thumb(s)\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"-1\" aria-label=\"Disabled slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\" aria-disabled=\"true\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the thumb element's `aria-valuemin`,\n`aria-valuemax`, and `aria-valuenow` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"75\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string)|null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"4fd5e4f9dda92417995fcc822b1d02016642b511","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.22.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.22.1","dependencies":{"tslib":"^1.9.3","@material/dom":"9.0.0-canary.d6b5cd418.0","@material/rtl":"9.0.0-canary.d6b5cd418.0","@material/base":"9.0.0-canary.d6b5cd418.0","@material/theme":"9.0.0-canary.d6b5cd418.0","@material/ripple":"9.0.0-canary.d6b5cd418.0","@material/animation":"9.0.0-canary.d6b5cd418.0","@material/elevation":"9.0.0-canary.d6b5cd418.0","@material/typography":"9.0.0-canary.d6b5cd418.0","@material/feature-targeting":"9.0.0-canary.d6b5cd418.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_9.0.0-canary.d6b5cd418.0_1604357978250_0.022718052552963997","host":"s3://npm-registry-packages"}},"8.0.0":{"name":"@material/slider","version":"8.0.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@8.0.0","maintainers":[{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"350b1caf17093094607d2be0cf1facb9a585c1d9","tarball":"https://registry.npmjs.org/@material/slider/-/slider-8.0.0.tgz","fileCount":37,"integrity":"sha512-AdqrIxe+K+Y3ukge/GQsPABVKCTBNDBAcxOCkuuuHza41Xn4a4DZG5J/fQZFt/a4t0ydLepyfIzemeAhHICEzw==","signatures":[{"sig":"MEYCIQCnA36soAYnv2NGvinD4YY3wDnFM0sNjXDZ+LJnuNWJmgIhALSLhYo83n1Ko7CyIr37j9YIRfgy/CoD9GsoS9ahxCtg","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":770682,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfoI9yCRA9TVsSAnZWagAAC2gQAJwPzhc4uDfHACfoOnqU\nrusMBcC7nhbG2FYQXcbiLFLKxWstVtU15ORxFbFRd81abmNnGENGlQ7CXhib\nvNkHhNLuILNMfaEw5/s4uMs7F/1Fl3/S7xbtrcQX1k8vRe6o3RHr+khh7AJt\nrM72Kt1GwkQE1qPtPCI9ywXEZ7dCz059BwzX/lcLaITIZoo3broaAFn+1w5u\nkWt7W/72bCALgmdc4Masr8WnYICx88jpqZHDjj4wFgnyMrnmr5NwIw6BzVJl\nzcPM99WQfTBp2bXKH0y1/BNGOKp8KYak5QpTdpZ3sdia3+8S98AmTsA+fKsA\njmBvR1sSCVhFE5rBvX9OZv14VZUV2yDkDGwx9sXAEV8C3biBMSjWAVLtlpDu\nBkVNTD4nTgNJqhBogurbLAR4d+dAKbUP6qdpi+2w8WGWXPVtNHggZD+BB+4U\nMIvVHPPBqHjC5JspFTsVTrI+BHKFq+N2GdyeZStSIoc+8xdNVsd2vrzJ04HE\n7CBZfe48pybSpYa0IDUro+CZyXwx+BYH8DfZkj/q/YickSwq4TrCTE0cyMkx\nDIFQ6L+iXZWI0s5vB6WFJ/tsFttCPScrzXwh4Oixp78ZK6Ywvy5bqsWoqnb9\nraA5rXLlketG2fvihqA8V8po2AE7UPpGOJv9FaMixB37ElgKHJiWKp3LlGLu\np+j8\r\n=a4eZ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","gitHead":"d6b5cd4181d0bf11b598b5ca142343fbc87976b9","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.22.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.22.1","dependencies":{"tslib":"^1.9.3","@material/dom":"^8.0.0","@material/rtl":"^8.0.0","@material/base":"^8.0.0","@material/theme":"^8.0.0","@material/ripple":"^8.0.0","@material/animation":"^8.0.0","@material/elevation":"^8.0.0","@material/typography":"^8.0.0","@material/feature-targeting":"^8.0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/slider_8.0.0_1604358001952_0.8561328810799289","host":"s3://npm-registry-packages"}},"9.0.0-canary.fdf9a2634.0":{"name":"@material/slider","version":"9.0.0-canary.fdf9a2634.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@9.0.0-canary.fdf9a2634.0","maintainers":[{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"86efd61fe11355b01a013c8c64f11f64347d83b0","tarball":"https://registry.npmjs.org/@material/slider/-/slider-9.0.0-canary.fdf9a2634.0.tgz","fileCount":38,"integrity":"sha512-bDQAno9cAt8fHIV6klEV5ztpRl90upzI4N5YmHk4C60foazgTJNI6ypw1fs6zTkLqMVVfNyqBaRVYOKmJiwjkQ==","signatures":[{"sig":"MEUCIQCv908j0cjmZW2qvlFrkgqKVQH58uilyFgV9dG0K1+8SgIgaaiWZgbE3Se2x2uZfTMxIWuLenmLCDBcdQy6k1Y7T28=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":771237,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfoeYUCRA9TVsSAnZWagAA3/sP/jymbK8BFKjcw2GEeOv2\nkHTLGGLcDNJE0YVwGx4cCIjWtmziQvqQewFayBy1pcWkUeS1AG4JG0wiXTBr\nv+SlDygEXhPCZxnFttIbYolIIZ+X+NycU3B3mHe4+ga+1IWoF6jPbOHCGYHc\n8Do83kPykaOtVjH4HH809nfHDQuqqU972rSMfc1l8p/Q7o+78JGOwwu1m5/A\nWMdktBZa+BjhLIifSkgB4qG0PdAMvjDEUNrOvfpsEQnmtusDLUg58uw8WfIT\nOjWr5TEf6H2MwVeydJUQ6txWKVhw1ONfH9UDfWeVOX6Tkajl+74kaKqA/lrO\n732Dv/JqAvcXy5+OFec7wHlPYasV/XL7wtlrS299Smj9wbt6mIo6Oa2bnZc9\nbY3vlIE7y1NtEwGwITIO4G+V1O1aLnrL0bueYE4++n4ccIvNhL59Sb1DBc7h\nxKnlPoZdM2YOJGrtFDE+BHVTFVxReXNbTfjCYG0jvjf+baSWtQcq9e5eg7u6\nawl3E47SuC8utp0GHH+Kg3c2ymvF/eD4E7fvzIEtOtLHRYQzne2DIaB14CLz\naknRYJ6Xo7lAp4IWPKJfkEvVo81AcQHHaVvqmC8+2MD/i7macWmqLyral8Xs\n8k3SVVqoA/h7ZB4eewjuVu/d/atL8N0HijgXSISNGOzyRz6rI2OL9AIVHoq0\ndtVu\r\n=1Bu1\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is modeled after the browser's\n`<input type=\"range\">` element.\n\nSliders follow accessibility best practices per the [WAI-ARIA spec](https://www.w3.org/TR/wai-aria-practices/#slider)\nand are fully RTL-aware.\n\n## Contents\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders follow the\n[WAI-ARIA guidelines](https://www.w3.org/TR/wai-aria-practices/#slider).\nPer the spec, ensure that the following attributes are added to the\n`mdc-slider__thumb` element(s):\n\n* `role=\"slider\"`\n* `aria-valuenow`: Value representing the current value.\n* `aria-valuemin`: Value representing the minimum allowed value.\n* `aria-valuemax`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value of `aria-valuenow` is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set to a string that makes the slider value\nunderstandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Continuous slider demo\" aria-valuemin=\"0\"\n       aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Continuous range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Continuous range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   `data-step` attribute on the root element. This will be the step size for\n    value quantization. If not set, the default is 1.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete slider with tick marks demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"20\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `tabindex=\"-1\"` attribute on the thumb(s)\n*   `aria-disabled=\"true\"` on the thumb(s)\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"-1\" aria-label=\"Disabled slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\" aria-disabled=\"true\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the thumb element's `aria-valuemin`,\n`aria-valuemax`, and `aria-valuenow` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"75\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string)|null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"7d38b3b1a677a24d709697b68fb697f1367fb5d0","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.22.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.22.1","dependencies":{"tslib":"^1.9.3","@material/dom":"9.0.0-canary.fdf9a2634.0","@material/rtl":"9.0.0-canary.fdf9a2634.0","@material/base":"9.0.0-canary.fdf9a2634.0","@material/theme":"9.0.0-canary.fdf9a2634.0","@material/ripple":"9.0.0-canary.fdf9a2634.0","@material/animation":"9.0.0-canary.fdf9a2634.0","@material/elevation":"9.0.0-canary.fdf9a2634.0","@material/typography":"9.0.0-canary.fdf9a2634.0","@material/feature-targeting":"9.0.0-canary.fdf9a2634.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_9.0.0-canary.fdf9a2634.0_1604445715786_0.6602177504717635","host":"s3://npm-registry-packages"}},"9.0.0-canary.4a86f30a0.0":{"name":"@material/slider","version":"9.0.0-canary.4a86f30a0.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@9.0.0-canary.4a86f30a0.0","maintainers":[{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"3632e245504d72f2b150a80f91955ef848604106","tarball":"https://registry.npmjs.org/@material/slider/-/slider-9.0.0-canary.4a86f30a0.0.tgz","fileCount":38,"integrity":"sha512-ka3Ass/6pN8LUyF5yrOJyVeLH7YewA+1Y1XBtRGUTHKlVbCtAAt+T5aKO6thk5G4ifQD3yXPHXS5E5QDkZNhNw==","signatures":[{"sig":"MEQCIGTgqqQvv2d42IvGL4fD47IAW7ePRaeGR0GuNjGnEx5DAiAtl0HcugZHQmvAm7EhZ3h4xBgo3ww0llW+kQdAph0UTA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":771237,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfoeeWCRA9TVsSAnZWagAA93YP/j+wOt11j5usJuuesANV\nWuIp6PGH5D/QiyOC64xA8PWUZu5jbrMcK63wg11OamRdS9QbIZq/Y0Guk1we\n5NvGaP4N2ZkjguzPr3BAHvKMx7kIG53QdgSC+t3oSIOhSZ6uQAgt9GScypta\ncSiwbGRTIC4aYqsYpQOpSPkhMp0iF3vkR+P6qA70gEglVGRU0JdY9R1iq0Aw\nxfnKnQx+udxTuR7XDE2+1eBxMSwzxdXyzqsGowSy328olYfgm+stNBIbwSZu\nJBEETmT8+tGFS8YaqdzlwGFwPkhD0zByU0W1KAzDzSHH0LYQ6ORfN1w2Gowd\nAliw8mCnfjZdIx7SEL6puRsHZJJ0CS56JhOcTQC5yTGBhaVha3PINykvSPbv\ncWpZJb0uJdwO/Ob+HdQrs5OFnoITgr68czLIBk/N4ZUDtJAkYuqRTSSXdZy8\nkJlAX5cYI4rUpFRcw0Jok/T76uZay4S7g+aEXgA05te/Yn6/kNu8QWHwymM2\nx43EKAOyzGtky9x5xawlQAl5gNmlNqbb/9NkIA8bFdgkDC/YeOydaKXZWOJc\niIEcpI9fGvKMotW7QwCdABnSm+U//aE6NPT5YCPNY6Ju5V3a5fQu/gzRvHNT\nmcRvCP1ZcMRztiujt6iZAKCP42jVaoNlhza9tIlwmHR0prVHsGTe3CLhWYRA\nCPnA\r\n=2YS9\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is modeled after the browser's\n`<input type=\"range\">` element.\n\nSliders follow accessibility best practices per the [WAI-ARIA spec](https://www.w3.org/TR/wai-aria-practices/#slider)\nand are fully RTL-aware.\n\n## Contents\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders follow the\n[WAI-ARIA guidelines](https://www.w3.org/TR/wai-aria-practices/#slider).\nPer the spec, ensure that the following attributes are added to the\n`mdc-slider__thumb` element(s):\n\n* `role=\"slider\"`\n* `aria-valuenow`: Value representing the current value.\n* `aria-valuemin`: Value representing the minimum allowed value.\n* `aria-valuemax`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value of `aria-valuenow` is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set to a string that makes the slider value\nunderstandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Continuous slider demo\" aria-valuemin=\"0\"\n       aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Continuous range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Continuous range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   `data-step` attribute on the root element. This will be the step size for\n    value quantization. If not set, the default is 1.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete slider with tick marks demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"20\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `tabindex=\"-1\"` attribute on the thumb(s)\n*   `aria-disabled=\"true\"` on the thumb(s)\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"-1\" aria-label=\"Disabled slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\" aria-disabled=\"true\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the thumb element's `aria-valuemin`,\n`aria-valuemax`, and `aria-valuenow` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"75\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string)|null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"ae1cc15cda11f90ef629a1f536e69a9648db906a","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.22.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.22.1","dependencies":{"tslib":"^1.9.3","@material/dom":"9.0.0-canary.4a86f30a0.0","@material/rtl":"9.0.0-canary.4a86f30a0.0","@material/base":"9.0.0-canary.4a86f30a0.0","@material/theme":"9.0.0-canary.4a86f30a0.0","@material/ripple":"9.0.0-canary.4a86f30a0.0","@material/animation":"9.0.0-canary.4a86f30a0.0","@material/elevation":"9.0.0-canary.4a86f30a0.0","@material/typography":"9.0.0-canary.4a86f30a0.0","@material/feature-targeting":"9.0.0-canary.4a86f30a0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_9.0.0-canary.4a86f30a0.0_1604446102191_0.7613209700206507","host":"s3://npm-registry-packages"}},"9.0.0-canary.fc8b045f1.0":{"name":"@material/slider","version":"9.0.0-canary.fc8b045f1.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@9.0.0-canary.fc8b045f1.0","maintainers":[{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"b6e14123b450d67a349ad5084f4bc9b242a8db4b","tarball":"https://registry.npmjs.org/@material/slider/-/slider-9.0.0-canary.fc8b045f1.0.tgz","fileCount":38,"integrity":"sha512-OmykjZsQoU8L3HJiiiJwXXnDKDjTeTg1WPwR8QjV6wN2wH9jNIKBgwFmgUrMQw7FZakqiFb5JS/eZ9nteVvaAg==","signatures":[{"sig":"MEYCIQCHzNEdvn6Mw6qVc3k6O+rbKIM5iHbOEyHPI4V6QSxGpwIhAIxaltB90azNOH1Jwza0/mNcTjX0ZFZHPkCVA5oeTFDR","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":771237,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfoem/CRA9TVsSAnZWagAAsxEP/2RqgJ+xi7rODLYfn6Ri\nrVTDg2ogkmULspKzX50epsO7n5L29m/Hmizv9CbWuBKFUlxax1D0hDeneYTd\n0Z+ZiRGxQaDte8iYwH7ldGE4WdRTuylh02QFPOPVATJskMxEJTnLpZNmTWSx\nR3QO6GMLHPaX3u8m4J7lKdmELwvgC8O3BE0hO9NgjrpZOVHO3nQogySnKG5Y\nfSb3j1SZM1jIuUyrpTCM6P9wPhCyXVEaldaMMn9HW24cHzLd5pzwjg/+Vcre\n6U4j2OyNg0J87oqrS+PU4sz3XrncwasubzewAYGI66RGqb5xOljxusNlihq/\nCAn52UHitl3VEotV7BrN9s8EsTZDhJ38xctNK12lGsgdec5izE/vLHVNpUvj\ntALoamOH4ohgGk0HPOE/njJBqiVMwQOZjnpzmYfP5iiuCLalF1orv9rKu0H3\no7BTErEkvg4XPyKpq278Q3G+UFemOkczFmhFh224q08FdkA4rMlYybmSHpDE\n/gnnGOw3ZgZLiqSiJTMY9Zb1ZnYwyRir1PwXqCSvDhmPPtARrZN8W7vGvRt1\nJ/yyVJuLivLupDn578+KJg9FTdG7ljc7H2V/lUuudLyRBI/0b68xT16f/Vcj\nXfugjp4Q/2g4ylVYR5sD6aHIGVSeML8pD8Kln5nON+CmvzFICwSvkutjs9kz\n3r3F\r\n=g4CI\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is modeled after the browser's\n`<input type=\"range\">` element.\n\nSliders follow accessibility best practices per the [WAI-ARIA spec](https://www.w3.org/TR/wai-aria-practices/#slider)\nand are fully RTL-aware.\n\n## Contents\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders follow the\n[WAI-ARIA guidelines](https://www.w3.org/TR/wai-aria-practices/#slider).\nPer the spec, ensure that the following attributes are added to the\n`mdc-slider__thumb` element(s):\n\n* `role=\"slider\"`\n* `aria-valuenow`: Value representing the current value.\n* `aria-valuemin`: Value representing the minimum allowed value.\n* `aria-valuemax`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value of `aria-valuenow` is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set to a string that makes the slider value\nunderstandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Continuous slider demo\" aria-valuemin=\"0\"\n       aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Continuous range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Continuous range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   `data-step` attribute on the root element. This will be the step size for\n    value quantization. If not set, the default is 1.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete slider with tick marks demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"20\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `tabindex=\"-1\"` attribute on the thumb(s)\n*   `aria-disabled=\"true\"` on the thumb(s)\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"-1\" aria-label=\"Disabled slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\" aria-disabled=\"true\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the thumb element's `aria-valuemin`,\n`aria-valuemax`, and `aria-valuenow` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"75\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string)|null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"7df7659dcee84f0af6a1e7d8617abb4056acceb2","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.22.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.22.1","dependencies":{"tslib":"^1.9.3","@material/dom":"9.0.0-canary.fc8b045f1.0","@material/rtl":"9.0.0-canary.fc8b045f1.0","@material/base":"9.0.0-canary.fc8b045f1.0","@material/theme":"9.0.0-canary.fc8b045f1.0","@material/ripple":"9.0.0-canary.fc8b045f1.0","@material/animation":"9.0.0-canary.fc8b045f1.0","@material/elevation":"9.0.0-canary.fc8b045f1.0","@material/typography":"9.0.0-canary.fc8b045f1.0","@material/feature-targeting":"9.0.0-canary.fc8b045f1.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_9.0.0-canary.fc8b045f1.0_1604446654587_0.6565488731884239","host":"s3://npm-registry-packages"}},"9.0.0-canary.a0b2db26b.0":{"name":"@material/slider","version":"9.0.0-canary.a0b2db26b.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@9.0.0-canary.a0b2db26b.0","maintainers":[{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"b2b063fdc4de320ae294e92a54efaa70b47060ea","tarball":"https://registry.npmjs.org/@material/slider/-/slider-9.0.0-canary.a0b2db26b.0.tgz","fileCount":38,"integrity":"sha512-QgypWS7mPULnZr7yhGELAGsOOGC1BWhf3Ip+WAFptAYrBh+OPmQC2X+EtszKirs+crGYyuS+ifoiweiQAos7Aw==","signatures":[{"sig":"MEUCIQC3g+bJjPnU4bkRDmJE8DsasPqKnhkAs9Tcn0H4QEZlNwIgFxuTLOPQDPgKb0ko1y+u9geb9e7bHKSkLZqw2WBpb4Q=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":771237,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfofE9CRA9TVsSAnZWagAAC1MQAJE6U+Kc0O1lCZVt7qq4\n0SnfXldLTT/FPUbC5IM2TMZLP9Klb7fhurVWLk8E2LjD7UemgZj1wU86+I0e\nORozGsapoMr+9RWT5guHOw0XUQ99+rFL8CCRXg2E/YYmpIhwNdoJ838EnC+L\n/CxF37ZM+s/W0+FVUpW6xi15IXIm98jv0VNOL5qruDkB4s31JObphpKuYrMy\n6xtBgmxA/Ww2J/focsvB0UpZFwT/Kzo2glcu1K5vljaq7MJzdgcLX3dXWwSn\nOjSUm+t3gyLZjRTTvZYJUSGcFDpHUOSaXmPXYb5G4K0e35oDxs59v/in+oad\n+ALe/Bt7s4ywQgXBW9t38A4ZW7WD9Yl7WcOdnUeiRTY7Po4ABOYtD7U8jfJY\nDJGVhWRYciq3j/mF6o4Vbfaxl0qTrCEZbG6XE9NmDlaBXOhGo5/op6s3rti2\nYkM+GuAs7X7ncBxqkZB5tj0MfssWzFyk3fsC2DKFWAcK6lnHOh7dkKPONnwb\nGcZWkjkaI0488dtMh4VpzPK0gOi5OxbW152IWSjug7RvLW4deQf+K2WSadJP\nmb5rIiwfZmk8/+KDPLJx5UBhc8ht9riCq63k4/UsqQCUGj3LiyxUF9SWgHAo\nnigZbzTYRUCAD/Q+qDFpCR+oz20b/mcrVcMqflG8zkHzzbD2tJRec7FDlMgf\nw1l+\r\n=z0Qo\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is modeled after the browser's\n`<input type=\"range\">` element.\n\nSliders follow accessibility best practices per the [WAI-ARIA spec](https://www.w3.org/TR/wai-aria-practices/#slider)\nand are fully RTL-aware.\n\n## Contents\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders follow the\n[WAI-ARIA guidelines](https://www.w3.org/TR/wai-aria-practices/#slider).\nPer the spec, ensure that the following attributes are added to the\n`mdc-slider__thumb` element(s):\n\n* `role=\"slider\"`\n* `aria-valuenow`: Value representing the current value.\n* `aria-valuemin`: Value representing the minimum allowed value.\n* `aria-valuemax`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value of `aria-valuenow` is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set to a string that makes the slider value\nunderstandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Continuous slider demo\" aria-valuemin=\"0\"\n       aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Continuous range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Continuous range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   `data-step` attribute on the root element. This will be the step size for\n    value quantization. If not set, the default is 1.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete slider with tick marks demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"20\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `tabindex=\"-1\"` attribute on the thumb(s)\n*   `aria-disabled=\"true\"` on the thumb(s)\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"-1\" aria-label=\"Disabled slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\" aria-disabled=\"true\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the thumb element's `aria-valuemin`,\n`aria-valuemax`, and `aria-valuenow` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"75\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string)|null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"885abc8ece3b0c3cab58996fab25be733f65b5c2","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.22.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.22.1","dependencies":{"tslib":"^1.9.3","@material/dom":"9.0.0-canary.a0b2db26b.0","@material/rtl":"9.0.0-canary.a0b2db26b.0","@material/base":"9.0.0-canary.a0b2db26b.0","@material/theme":"9.0.0-canary.a0b2db26b.0","@material/ripple":"9.0.0-canary.a0b2db26b.0","@material/animation":"9.0.0-canary.a0b2db26b.0","@material/elevation":"9.0.0-canary.a0b2db26b.0","@material/typography":"9.0.0-canary.a0b2db26b.0","@material/feature-targeting":"9.0.0-canary.a0b2db26b.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_9.0.0-canary.a0b2db26b.0_1604448572548_0.3159637025939699","host":"s3://npm-registry-packages"}},"9.0.0-canary.419e03572.0":{"name":"@material/slider","version":"9.0.0-canary.419e03572.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@9.0.0-canary.419e03572.0","maintainers":[{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"c7111e6ccd0d492d2c8acc7da9bfedcdec9fab44","tarball":"https://registry.npmjs.org/@material/slider/-/slider-9.0.0-canary.419e03572.0.tgz","fileCount":38,"integrity":"sha512-+y3SeDgo+a3Tt8v3/nHmSzhO0fRhrrxng70KjDB09whbC5t5xdyeipFY0Ur/DLToJYeMqiYV98cmvyKG4Uey0Q==","signatures":[{"sig":"MEYCIQCL6t/N20cKWfLRii8R3OdaNZcEdne617nbLowxMfLvugIhANdPVbKcKawEAJubbGk2qnCrd0//qUncTZLZP5bGWt3I","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":771237,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfogTnCRA9TVsSAnZWagAAw10P/Rm1dwUBfHwhkg6RMtZm\nsRgwLbZKYkCfqDj3mnnEXtosKp7xgtROR7VG2mpuChh/rZjLrSGJZ6WLye9r\nKATHTI9Ubd1ZW0Nf3gl23Q9IEzHeaWaBGE9POxpgP/DMZjx0xJkFHfW7s3X5\niT44b5vbR/gYd9kcM7DDZPgGatwWq8HdIPYs92WUtM6X/wijLLo7PxGqefV5\npo1EQ7A1rdEAU/dICWuv6RZIX8OD3rYYyPxcjLl2sCvkIPA0h+xirZxOkKOC\nsTEHCSKMdJZB3aH5TK1d+zOf7fD+2fwuEc+7Y2wzvGNkl7tIMSUlZoYWjBZS\nz543QJ6khTfOp4bIzQXNK+IIukyAfSyfMhE3744qK9is/uDVzgxWwzJp18ZS\nd1RbrBlGKCbaBR4bi8lpJyFZjHhWmVFoqgG91TIJ7K7dGUJqSs2I3hTJ1qMa\nmSZHdr97pPPeN9uaoQqQ4FkKMj2pcYsfuhT4WX8s1fYW5/I69fTsr6V71R44\nRlDjXngMUIcxl2dxJQBCRlbeu6Vgo7L9Me5tEkdY7zShGNl7biQG828K8qI0\nYvHV8BQf33n/2KSCEFgvwTf4MYE13F0vRX+s9H3NkJPleK6pF86to9MC4TNg\nkK6wKTpEP3X/kmeQyjaFCK0T+tHMSuvACNWQZfBgW/m7FWPxqjEL7tLox6Tj\njWgd\r\n=Jdid\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is modeled after the browser's\n`<input type=\"range\">` element.\n\nSliders follow accessibility best practices per the [WAI-ARIA spec](https://www.w3.org/TR/wai-aria-practices/#slider)\nand are fully RTL-aware.\n\n## Contents\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders follow the\n[WAI-ARIA guidelines](https://www.w3.org/TR/wai-aria-practices/#slider).\nPer the spec, ensure that the following attributes are added to the\n`mdc-slider__thumb` element(s):\n\n* `role=\"slider\"`\n* `aria-valuenow`: Value representing the current value.\n* `aria-valuemin`: Value representing the minimum allowed value.\n* `aria-valuemax`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value of `aria-valuenow` is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set to a string that makes the slider value\nunderstandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Continuous slider demo\" aria-valuemin=\"0\"\n       aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Continuous range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Continuous range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   `data-step` attribute on the root element. This will be the step size for\n    value quantization. If not set, the default is 1.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete slider with tick marks demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"20\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `tabindex=\"-1\"` attribute on the thumb(s)\n*   `aria-disabled=\"true\"` on the thumb(s)\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"-1\" aria-label=\"Disabled slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\" aria-disabled=\"true\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the thumb element's `aria-valuemin`,\n`aria-valuemax`, and `aria-valuenow` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"75\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string)|null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"c9528e0a61f88c4fa2a5bcc6a5e406ccf027d7d4","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.22.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.22.1","dependencies":{"tslib":"^1.9.3","@material/dom":"9.0.0-canary.419e03572.0","@material/rtl":"9.0.0-canary.419e03572.0","@material/base":"9.0.0-canary.419e03572.0","@material/theme":"9.0.0-canary.419e03572.0","@material/ripple":"9.0.0-canary.419e03572.0","@material/animation":"9.0.0-canary.419e03572.0","@material/elevation":"9.0.0-canary.419e03572.0","@material/typography":"9.0.0-canary.419e03572.0","@material/feature-targeting":"9.0.0-canary.419e03572.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_9.0.0-canary.419e03572.0_1604453607431_0.7373801190420535","host":"s3://npm-registry-packages"}},"9.0.0-canary.a432ad542.0":{"name":"@material/slider","version":"9.0.0-canary.a432ad542.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@9.0.0-canary.a432ad542.0","maintainers":[{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"17e63fcf0bbd2d26cff5ac8bb3ecd5b8168825f7","tarball":"https://registry.npmjs.org/@material/slider/-/slider-9.0.0-canary.a432ad542.0.tgz","fileCount":38,"integrity":"sha512-E4TBSQkzZYvsu+/lNxUCu+3+tO6oGkbbDwUIrsOXffMXJDv1JUfMQ4KwRZR7yfhc0ZuV6HpTl/ZkSuL75lG2xQ==","signatures":[{"sig":"MEQCIBqx3262NagaSWu8ts9lOzXJk7+1dCU75LYkvlQCaQXkAiBM4QYbqZuDj65M3JmpKR33PhL95iuZbwlcluf9Inp53g==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":771237,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfpKrqCRA9TVsSAnZWagAAlfoP/0y4ATt8CMZ/UUB6WNnZ\nuNPBXP7bn0fpOQEjUD7Vtb9ItEVxQ5yfVtB2cvRa96E9TqhMnxH8zZSrMmz3\nLlEZKhxSMleF9U/1wGPVPUHIk/KEtXAnfWEDyWf0rNKHPL8axo7bafedElDl\nnC2uBMhAhEvMBHPichIodqtUKxMZHmGkFwVAqFFKwXN6Y2qjOxKgegqHQ+8y\nAQObZxjO2CnADiVpDSQDl2/ubnT7dLFlQ07EYjrYUGMr+9rKEM/tsKjNdiUk\nLALh9JTdLMyVDCf0oejXAxjIuoPmYJfMYrGF1EFeBN4oIn9JxYkX+Nd0GPqG\nceQAir537hDKNbxl2PNM9OR64biGxBIF5bcE5lKCQVkMW7sSn+zgG9vLRtWG\n3i0D+l7AlzJX1ufKWZAPZyyctxRI8wL41z7T/HYfAZulJbEz/edl53WwxZju\njTHz3pSPDsmM4A/YGlbmosCekt8W2xlo1+FiJzEFy82iZcCnEkyYFwlFBgAI\nak1VwdVqjxalkAfF2jddJMK2AyPrH38uRGpSEspmz2WCsU87uyZV9CXnqsKI\nW0NYIvhI0eqr7H45gMOcqMFuriLfGDaeuGuYsYHi27Dz0UjAVZLt1dlQNYaX\npuQhig1WPjQxxBfiroMU0oXvzYboVS3ZXa1FcEGXpV/g97is7sXItPwLuja5\n9KD5\r\n=U5w/\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is modeled after the browser's\n`<input type=\"range\">` element.\n\nSliders follow accessibility best practices per the [WAI-ARIA spec](https://www.w3.org/TR/wai-aria-practices/#slider)\nand are fully RTL-aware.\n\n## Contents\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders follow the\n[WAI-ARIA guidelines](https://www.w3.org/TR/wai-aria-practices/#slider).\nPer the spec, ensure that the following attributes are added to the\n`mdc-slider__thumb` element(s):\n\n* `role=\"slider\"`\n* `aria-valuenow`: Value representing the current value.\n* `aria-valuemin`: Value representing the minimum allowed value.\n* `aria-valuemax`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value of `aria-valuenow` is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set to a string that makes the slider value\nunderstandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Continuous slider demo\" aria-valuemin=\"0\"\n       aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Continuous range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Continuous range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   `data-step` attribute on the root element. This will be the step size for\n    value quantization. If not set, the default is 1.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete slider with tick marks demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"20\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `tabindex=\"-1\"` attribute on the thumb(s)\n*   `aria-disabled=\"true\"` on the thumb(s)\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"-1\" aria-label=\"Disabled slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\" aria-disabled=\"true\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the thumb element's `aria-valuemin`,\n`aria-valuemax`, and `aria-valuenow` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"75\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string)|null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"b873a7878b871d2ced45e7f04055b3d4ef0c7af1","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"9.0.0-canary.a432ad542.0","@material/rtl":"9.0.0-canary.a432ad542.0","@material/base":"9.0.0-canary.a432ad542.0","@material/theme":"9.0.0-canary.a432ad542.0","@material/ripple":"9.0.0-canary.a432ad542.0","@material/animation":"9.0.0-canary.a432ad542.0","@material/elevation":"9.0.0-canary.a432ad542.0","@material/typography":"9.0.0-canary.a432ad542.0","@material/feature-targeting":"9.0.0-canary.a432ad542.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_9.0.0-canary.a432ad542.0_1604627178260_0.21014239170378146","host":"s3://npm-registry-packages"}},"9.0.0-canary.e2e8aef1e.0":{"name":"@material/slider","version":"9.0.0-canary.e2e8aef1e.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@9.0.0-canary.e2e8aef1e.0","maintainers":[{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"c93cf74150a5b3e48647d51b5e670b8355f80ec5","tarball":"https://registry.npmjs.org/@material/slider/-/slider-9.0.0-canary.e2e8aef1e.0.tgz","fileCount":38,"integrity":"sha512-FN4bmMwTputIrnksCjpXdzaUjwuFzAKU6WwPu4qhNfWO1iK/hUVNSazK7S3qwEuYQJoRJZF63Aem9PZn9k9o7w==","signatures":[{"sig":"MEUCIQCW+44j1PjpH+hZHgsi4BLlKNZJwVKEQZgcmr8PjjtZOAIgQkkM8rUkcxX6eRmjL+iWJWFhqiXBonYKT/099LBizkg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":771237,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfpK96CRA9TVsSAnZWagAATbwP/A/nYygv9pU9Gb12BemF\nUJ4UxCp2tUZuCaLX2JlTyg4AUhPJj7CLFbPIlpDy1SCXo65Zp1UWhREpvL3L\nGeuTPaaCoXBiEYDwjC4jM8gDmJ6FPC+ZHFxQwTYmVwcNbnlP3SJ+aCFZd3Mg\n7L36VDrvuK8j94DCml3yj/YV4uzFGmFeLy4FAfyDBlhKdo3O5LBWxPdY0OPQ\nQgsy3WPmZ9CSbWUiyAG1VP+ZibYnprIlx11h+RzY1YYsDupLKVVsmCf2uDWP\nTlLzHo/8ZbYH34T44REx99ORMnALs5uuv3LiTuaHOnF2MaPriMpzTsTvAJiB\nRjcW2sxMqZ1/lgZ3CzI+sv/4faBakzl/KqOhcGl3vLDfwQicCDPnfkyukU1L\nygRGVmFAEws/kY7Ox8BMTyJ/h/PuoStkcKmces9dAw82HOALv1FNEjfXTb6R\naTjku8R7mn9J5PfJ7A//wQuZl2K/wt6R+k/VYZoziZJkxqHi0ByoeDp4Qv3a\nEgNwaLJjG2MT7KE6u5XFm/xOB4aJ7TVV34xzfmB9fwxvmIiiGvxBJc0pG0pY\nr/K03hA81jaQtcJqZqtkb98cT/4Uqb1hPyrpEtkqY04n4EXylDfM+b7ZCXfw\nuEQ7DW6O4REPnH95NUUgsqWU/XaNRIVvTWy2AQ9XlX+7lAF5dXw0bCole9FZ\nEe4h\r\n=ro+x\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is modeled after the browser's\n`<input type=\"range\">` element.\n\nSliders follow accessibility best practices per the [WAI-ARIA spec](https://www.w3.org/TR/wai-aria-practices/#slider)\nand are fully RTL-aware.\n\n## Contents\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders follow the\n[WAI-ARIA guidelines](https://www.w3.org/TR/wai-aria-practices/#slider).\nPer the spec, ensure that the following attributes are added to the\n`mdc-slider__thumb` element(s):\n\n* `role=\"slider\"`\n* `aria-valuenow`: Value representing the current value.\n* `aria-valuemin`: Value representing the minimum allowed value.\n* `aria-valuemax`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value of `aria-valuenow` is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set to a string that makes the slider value\nunderstandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Continuous slider demo\" aria-valuemin=\"0\"\n       aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Continuous range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Continuous range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   `data-step` attribute on the root element. This will be the step size for\n    value quantization. If not set, the default is 1.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete slider with tick marks demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"20\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `tabindex=\"-1\"` attribute on the thumb(s)\n*   `aria-disabled=\"true\"` on the thumb(s)\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"-1\" aria-label=\"Disabled slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\" aria-disabled=\"true\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the thumb element's `aria-valuemin`,\n`aria-valuemax`, and `aria-valuenow` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"75\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string)|null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"59b208be2f946b47ab6905d82c0135e81316f2a3","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"9.0.0-canary.e2e8aef1e.0","@material/rtl":"9.0.0-canary.e2e8aef1e.0","@material/base":"9.0.0-canary.e2e8aef1e.0","@material/theme":"9.0.0-canary.e2e8aef1e.0","@material/ripple":"9.0.0-canary.e2e8aef1e.0","@material/animation":"9.0.0-canary.e2e8aef1e.0","@material/elevation":"9.0.0-canary.e2e8aef1e.0","@material/typography":"9.0.0-canary.e2e8aef1e.0","@material/feature-targeting":"9.0.0-canary.e2e8aef1e.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_9.0.0-canary.e2e8aef1e.0_1604628345811_0.6649852952847739","host":"s3://npm-registry-packages"}},"9.0.0-canary.ec6b68b34.0":{"name":"@material/slider","version":"9.0.0-canary.ec6b68b34.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@9.0.0-canary.ec6b68b34.0","maintainers":[{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"1645ff78cc5492cb2d738365c04c42b41828e992","tarball":"https://registry.npmjs.org/@material/slider/-/slider-9.0.0-canary.ec6b68b34.0.tgz","fileCount":38,"integrity":"sha512-sWfqeLMp2fM9G5cNhrG/C9XzLpqhrmqoR8YUpdZbfTuF6elXxZpl7cqDNAEZEUO+SdN/VKixP8ZeVmmfA30jZA==","signatures":[{"sig":"MEUCIQCqACS9fnqLspjz9zUbs74xXixdtgu6emlix9vZ7MpTcAIgGA3CMYorP5X7tDl3mnEs5pqvGZOmrV0GRThGzIW7jzw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":776717,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfpZx7CRA9TVsSAnZWagAAFQQP/0Y/UbxLlIBNVx1nd+PK\nufoxI/szf/mFpwUJih54fEycvqul/PURipkAQWZ9KpjzwYDen7AviLG4vQdF\n7CLEGMjtFHhF8JoqhcJ9uKXzVPDt9pBhaxd3zoWCT93MOKNJfPUe6YT9nDqJ\nLLhtReMR2rk2plY8RgUfe/ZkJZdFfUJhvIRuvL4f9WqalrxhCsVSUtcvwjb8\npY81LIhsnD5ACNF/NCTb12l+0MGv/4vrJeYE2d420tXRTVq5QCWq78G6Hnxo\n0m2zkcAUKrGr6onXBNcjF6ik4+4bTCNEHsd4WOrCmkCZUz2H4fYK7XjTErIm\npAMFMz0D8nnFbzysgGNnInB5P27FrKmcd3efRYyfgyhLl0P6+I14JzwFLcz6\n+uc8lPuv4EQrRKysFLe/VGJQVJbSJV9msJX5KTlyFXQM5xVSNP9uJeyT+gpo\nOCLZ3MctULhNCzBxkARMZbBdQ1Av/ju6BFQrGO9ptd7Cu6f3pN8cbVo/cGnw\nwVRAnSALCkXZvuGCzQ5QO2EeiGmawlDLieqWJc1o47ahuXsHOWiWDoyH8ht6\nN+okY8/2KeVZpKwpXrf75mZTgCualbuuRZc3w6j2IjMwuULqtr0zgmcinSvX\npB/OEu5GfSYmbuF4Orma0w1dnpYN8KYI+8ZzqCH9LR4P1EaAkoVEwZPwJvuM\nKGza\r\n=8Jvy\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is modeled after the browser's\n`<input type=\"range\">` element.\n\nSliders follow accessibility best practices per the [WAI-ARIA spec](https://www.w3.org/TR/wai-aria-practices/#slider)\nand are fully RTL-aware.\n\n## Contents\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders follow the\n[WAI-ARIA guidelines](https://www.w3.org/TR/wai-aria-practices/#slider).\nPer the spec, ensure that the following attributes are added to the\n`mdc-slider__thumb` element(s):\n\n* `role=\"slider\"`\n* `aria-valuenow`: Value representing the current value.\n* `aria-valuemin`: Value representing the minimum allowed value.\n* `aria-valuemax`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value of `aria-valuenow` is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set to a string that makes the slider value\nunderstandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Continuous slider demo\" aria-valuemin=\"0\"\n       aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Continuous range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Continuous range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   `data-step` attribute on the root element. This will be the step size for\n    value quantization. If not set, the default is 1.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete slider with tick marks demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"20\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `tabindex=\"-1\"` attribute on the thumb(s)\n*   `aria-disabled=\"true\"` on the thumb(s)\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"-1\" aria-label=\"Disabled slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\" aria-disabled=\"true\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the thumb element's `aria-valuemin`,\n`aria-valuemax`, and `aria-valuenow` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"75\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string)|null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"a5005840630991931dd5d6aed79aa4986773a5a4","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"9.0.0-canary.ec6b68b34.0","@material/rtl":"9.0.0-canary.ec6b68b34.0","@material/base":"9.0.0-canary.ec6b68b34.0","@material/theme":"9.0.0-canary.ec6b68b34.0","@material/ripple":"9.0.0-canary.ec6b68b34.0","@material/animation":"9.0.0-canary.ec6b68b34.0","@material/elevation":"9.0.0-canary.ec6b68b34.0","@material/typography":"9.0.0-canary.ec6b68b34.0","@material/feature-targeting":"9.0.0-canary.ec6b68b34.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_9.0.0-canary.ec6b68b34.0_1604689018567_0.6486631627031869","host":"s3://npm-registry-packages"}},"9.0.0-canary.b39094d14.0":{"name":"@material/slider","version":"9.0.0-canary.b39094d14.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@9.0.0-canary.b39094d14.0","maintainers":[{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"d9bdd102433a385db5643f333a97593a63015f99","tarball":"https://registry.npmjs.org/@material/slider/-/slider-9.0.0-canary.b39094d14.0.tgz","fileCount":38,"integrity":"sha512-iC/2etqgwgD229+5qY8x2Tn5JlNNPyYbaf+rmWBrUe1ENxPImZh0LtzOgwiWINT8R7w6aEa7p/2O4b/5hFvsRw==","signatures":[{"sig":"MEUCIQCBu/p9S/8DAD+sldxTWHiZnvQMOb+1mpnEaO418HiUCAIgM1Q/8xlBR5WR67EBD3lv1FtKNKtg335pgKvmFYDZ7Us=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":776717,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfpb0rCRA9TVsSAnZWagAA0jsQAJ+Dr7vQoB7tWE5qEtgg\nJ4OqdLBLwFYivpthOU02mR1wVRbbU288t16ALKhmNY2DQuTaiN4chcKhkDEK\n61bpRf0ubxpUGl8626BLkO0ABS5WfbizUnnLYqFe/rfbqGrtahZAeyhw6Xgu\nEwaPd1DpAEpcQdhH0xahKapJF1yOBRUI25ovOc0iU3HsZc4NC2vl8jZf1m6u\nSui6v9m4FIMHcYvCzcJ1GN+W7gr31MP+QxHJBDMUuK6n0QJIKk+V7KRFfWCN\nFIsoKj1acM6pJ5/mrxbdn7HRqpclC499XsORRpJ4tgTsm5wrsWU3kUff2Yni\n/8cEJ0ty2GcyAZRlZ0FfOP4p0Dodnh4IGeBexxrKoLqSyyH2RnrpszrpYlAu\ncej6DqxtSTPxB5Zit74/Nz2l4cvNWval7CPdDDpMs8zoIxzd3E51qIrtja9w\nEAZfAY0kOLGBeaLvbDek3NaAnCqRq7i9qEMajqCrg3WR37vUbYWRkkn8/ZEH\nYdNSRBoNNzfMftzzfIp99+2litnoZd8WBDy3nkrcyCz1fuMgO3BPytKxU4aV\nB+hymLIlNDAE6TkbDBmBBKrGp/M1B0kShNmLOxdnbSg0pqfPDiQNl9EsdShf\ntRCgqkX2YT+lAs3b2u4AOAUGjubHMPyc0mhU0CvlrHZqgnJaQB5mPqk1nH6H\nSZyI\r\n=Xnv1\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is modeled after the browser's\n`<input type=\"range\">` element.\n\nSliders follow accessibility best practices per the [WAI-ARIA spec](https://www.w3.org/TR/wai-aria-practices/#slider)\nand are fully RTL-aware.\n\n## Contents\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders follow the\n[WAI-ARIA guidelines](https://www.w3.org/TR/wai-aria-practices/#slider).\nPer the spec, ensure that the following attributes are added to the\n`mdc-slider__thumb` element(s):\n\n* `role=\"slider\"`\n* `aria-valuenow`: Value representing the current value.\n* `aria-valuemin`: Value representing the minimum allowed value.\n* `aria-valuemax`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value of `aria-valuenow` is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set to a string that makes the slider value\nunderstandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Continuous slider demo\" aria-valuemin=\"0\"\n       aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Continuous range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Continuous range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   `data-step` attribute on the root element. This will be the step size for\n    value quantization. If not set, the default is 1.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete slider with tick marks demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"20\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `tabindex=\"-1\"` attribute on the thumb(s)\n*   `aria-disabled=\"true\"` on the thumb(s)\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"-1\" aria-label=\"Disabled slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\" aria-disabled=\"true\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the thumb element's `aria-valuemin`,\n`aria-valuemax`, and `aria-valuenow` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"75\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string)|null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"f8c5ef7d8cee2d0a63421ee4afe42e4e9260cd47","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"9.0.0-canary.b39094d14.0","@material/rtl":"9.0.0-canary.b39094d14.0","@material/base":"9.0.0-canary.b39094d14.0","@material/theme":"9.0.0-canary.b39094d14.0","@material/ripple":"9.0.0-canary.b39094d14.0","@material/animation":"9.0.0-canary.b39094d14.0","@material/elevation":"9.0.0-canary.b39094d14.0","@material/typography":"9.0.0-canary.b39094d14.0","@material/feature-targeting":"9.0.0-canary.b39094d14.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_9.0.0-canary.b39094d14.0_1604697386857_0.9388819948653435","host":"s3://npm-registry-packages"}},"9.0.0-canary.8648b8258.0":{"name":"@material/slider","version":"9.0.0-canary.8648b8258.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@9.0.0-canary.8648b8258.0","maintainers":[{"name":"taylorv","email":"brian.t.vann@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"69e9a6aed9f04396e99ce09c6e11537761a3eee0","tarball":"https://registry.npmjs.org/@material/slider/-/slider-9.0.0-canary.8648b8258.0.tgz","fileCount":38,"integrity":"sha512-XQxFIkoGhFlIA/1HXVshsIoOyLOzlLOrNTT6hh/jXAakIZIYcORjWxKibNTglja3YeHXZiIJ7MoQf1XvFi1VFw==","signatures":[{"sig":"MEYCIQDPr8cMMlEGQu3lVlW5H6U7M3pi/OfaKMiO5Ss6nSpVMAIhAI4Qa7jXdkQ5KMmh7ovzXJvUOv8SKAabXPeCzi/WQuBd","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":776717,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfrRItCRA9TVsSAnZWagAArnUP/3o9VOsvxC9KpH4+sVil\n9ZPHY8VEcJT2twizzKaZSOznwEaeE9M8J4RnQ0vGow+0Hk1/68uTybvR8Tx3\nEbUFx/x7ayBVh7EyFvBa7qMUacnNk8jvx5fzht9iZ9gNaWanivk3Aen0ILys\nkoJQQ9pj8GH6mB6bY/RGGUbteieVOJZcWPt99OYIaWOHe/HI2kNRJu01gNqX\ncHe8+80Ql0o0fisF0zClnzapC///n4AxiuqQeN9t0dIVHX2E7wMIQyqR4LKL\nvV8XuLrPgi+svawkaDv3LNaPKX77oxd39xJpnq39UO1r0AgtFJyqkoMf0O9/\ncI/s2XT89HURWCiMmWYUqigg534JpFCv/tWiRAscFA4oOZMOP9nwndo7/1AX\nie8HoFq1ufFLq9YR4dqSWIQFQkEE8ZKZVmGsrpR9kbAnTlyg6UmLMT/9EKpO\nauf58CqzQFEjmi+RMVoxx5IM0kRacrKauaw2UsflYuz9YObR0u/QKVzGkPB6\nBYkdoxYz2eHug1GApjzLLunQ8mSLzHSWSrnavM7JXmxSLEJrFGbX35JDlB15\nQV217n8dnjOuiFR5KaIEaa8RMLCMAOpLeq0+QMkyiozhyBvqFIQ+U/ddxLDP\n9geW6I1R/xH1qKnl4IH9y3V5Kgxu4NecYQiFMOMMPz/45ce3awrNwQqW70XN\nsVsW\r\n=dyJE\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is modeled after the browser's\n`<input type=\"range\">` element.\n\nSliders follow accessibility best practices per the [WAI-ARIA spec](https://www.w3.org/TR/wai-aria-practices/#slider)\nand are fully RTL-aware.\n\n## Contents\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders follow the\n[WAI-ARIA guidelines](https://www.w3.org/TR/wai-aria-practices/#slider).\nPer the spec, ensure that the following attributes are added to the\n`mdc-slider__thumb` element(s):\n\n* `role=\"slider\"`\n* `aria-valuenow`: Value representing the current value.\n* `aria-valuemin`: Value representing the minimum allowed value.\n* `aria-valuemax`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value of `aria-valuenow` is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set to a string that makes the slider value\nunderstandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Continuous slider demo\" aria-valuemin=\"0\"\n       aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Continuous range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Continuous range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   `data-step` attribute on the root element. This will be the step size for\n    value quantization. If not set, the default is 1.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete slider with tick marks demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"20\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `tabindex=\"-1\"` attribute on the thumb(s)\n*   `aria-disabled=\"true\"` on the thumb(s)\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"-1\" aria-label=\"Disabled slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\" aria-disabled=\"true\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the thumb element's `aria-valuemin`,\n`aria-valuemax`, and `aria-valuenow` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"75\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string)|null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"d98de60dd3d91dc14a84abb664678188ae936030","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"9.0.0-canary.8648b8258.0","@material/rtl":"9.0.0-canary.8648b8258.0","@material/base":"9.0.0-canary.8648b8258.0","@material/theme":"9.0.0-canary.8648b8258.0","@material/ripple":"9.0.0-canary.8648b8258.0","@material/animation":"9.0.0-canary.8648b8258.0","@material/elevation":"9.0.0-canary.8648b8258.0","@material/typography":"9.0.0-canary.8648b8258.0","@material/feature-targeting":"9.0.0-canary.8648b8258.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_9.0.0-canary.8648b8258.0_1605177901170_0.7406464625734388","host":"s3://npm-registry-packages"}},"9.0.0-canary.240c5f74f.0":{"name":"@material/slider","version":"9.0.0-canary.240c5f74f.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@9.0.0-canary.240c5f74f.0","maintainers":[{"name":"taylorv","email":"brian.t.vann@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"82f847d10cfe17a59c72acef946b27fe7c2f08de","tarball":"https://registry.npmjs.org/@material/slider/-/slider-9.0.0-canary.240c5f74f.0.tgz","fileCount":38,"integrity":"sha512-0f+kXvz2q/2Eicm0b+tUpucemI4ggLL6AprZ7VoUpwAslGkpIwKHDVj+A8cq9JAjmkvwhiYPdXIYo4ndEJO52A==","signatures":[{"sig":"MEYCIQCaViaViy2s8qXNscCd00qNP6A+HDT/LpV6IMx+zD1p/wIhANf3mIucN8abMH0LPrcN8RdowITOSDiQ7ZiJcj8WxKuv","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":776717,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfrZk3CRA9TVsSAnZWagAAP6IP/itCQ5dx9iuoIV0C4O86\ngsutsjdpvdgxrQmbizZmk9LDUTg9ytWge7yM8p6VQDNXDvQpj4gQK7Tsn8aT\nfZifGuIZKuDb/U1grzKIwCIbe587wHGamq+PjT9ec3GkgZU2WubIrgQ6zRfW\nH1YrpahpgYjg9/TTc29UsT1zxMbKslXCrtW5QlAyx+Ud5p0DvElkGDze9k87\nJ1FBEAR5ddFXMa1PKq/nUXIOiAhZ6IDf/DZQSqoKOEuk029YyMjShmxMbUHK\nswep486c4KySrd+ar67ZS0ps1hGSIP1isVF5cFAiKgaB17N24u8wwCp11CgE\n/9kRKjATFdookF4d7G9U/pRCRk3JbQ18YgmlcRFQJ6HhwtoZZLoS1yiJMiO6\n5bFMeGWwgrhoUUEMi4SJfIrJGjyHxvVjqdd4rtZfVBeuuhQBU7gnWBC37nmB\nwJ1zjCCIR9EvdxeWFa7MoDyna3aaZ6Gkv6CAstIAuUTvF07CR9pGzbrdhVF8\nNMGWNSjGsH8xF/gsqITeq29ae0Q58umtamkTHZJ1MZXlcol6n+g1pozNrHMA\nQO9XX3h4skkv+dJiNXfvJZgybndNpZSMvDbHP8PDthX/Bg/KPp8WJJ2ltdO/\nt+wun2ImjvphmvZpZrzLj5qqd4Cr2X+Sdn3m58y8awiGb4nARyk/BmNGtCxw\niXFC\r\n=eTgm\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is modeled after the browser's\n`<input type=\"range\">` element.\n\nSliders follow accessibility best practices per the [WAI-ARIA spec](https://www.w3.org/TR/wai-aria-practices/#slider)\nand are fully RTL-aware.\n\n## Contents\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders follow the\n[WAI-ARIA guidelines](https://www.w3.org/TR/wai-aria-practices/#slider).\nPer the spec, ensure that the following attributes are added to the\n`mdc-slider__thumb` element(s):\n\n* `role=\"slider\"`\n* `aria-valuenow`: Value representing the current value.\n* `aria-valuemin`: Value representing the minimum allowed value.\n* `aria-valuemax`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value of `aria-valuenow` is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set to a string that makes the slider value\nunderstandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Continuous slider demo\" aria-valuemin=\"0\"\n       aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Continuous range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Continuous range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   `data-step` attribute on the root element. This will be the step size for\n    value quantization. If not set, the default is 1.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete slider with tick marks demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"20\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `tabindex=\"-1\"` attribute on the thumb(s)\n*   `aria-disabled=\"true\"` on the thumb(s)\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"-1\" aria-label=\"Disabled slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\" aria-disabled=\"true\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the thumb element's `aria-valuemin`,\n`aria-valuemax`, and `aria-valuenow` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"75\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string)|null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"33b77622681b24909d892ec906f608e75f5e9809","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"9.0.0-canary.240c5f74f.0","@material/rtl":"9.0.0-canary.240c5f74f.0","@material/base":"9.0.0-canary.240c5f74f.0","@material/theme":"9.0.0-canary.240c5f74f.0","@material/ripple":"9.0.0-canary.240c5f74f.0","@material/animation":"9.0.0-canary.240c5f74f.0","@material/elevation":"9.0.0-canary.240c5f74f.0","@material/typography":"9.0.0-canary.240c5f74f.0","@material/feature-targeting":"9.0.0-canary.240c5f74f.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_9.0.0-canary.240c5f74f.0_1605212471091_0.9531015760048669","host":"s3://npm-registry-packages"}},"9.0.0-canary.6cf6ba4f4.0":{"name":"@material/slider","version":"9.0.0-canary.6cf6ba4f4.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@9.0.0-canary.6cf6ba4f4.0","maintainers":[{"name":"taylorv","email":"brian.t.vann@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"635a3235753cfb7a7f5e935d386f8e7853a7e69d","tarball":"https://registry.npmjs.org/@material/slider/-/slider-9.0.0-canary.6cf6ba4f4.0.tgz","fileCount":38,"integrity":"sha512-4QvPo+//YdRbmyfAgEt+cqbGnptDLuDSw0a7LKZ410AGqqnYRG1JydDwVPLVrkFfNAMJAGhOuHufKmiKIHqRIA==","signatures":[{"sig":"MEUCIHb/ybUswdSC+oHRuLrbCA7e2juBuXBXV5S/l63OVZbdAiEA56bubWWu9tcRMOr3KTXzUx68Yc0nNg+ufaaUaDAKuws=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":776717,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfssnvCRA9TVsSAnZWagAAjMEQAIEWcAmsnc7FymZlmE6v\nGCmQm/hj5q+bk4/xL2i5yR5DEhOhoET4PegU9ro1IBtOBmQ01OnrWfHA653d\noSOqNbvrlfXhQOID4CY9lY7fURSMboOUWpGC4ztgCqPRI/DDmz8lsz//P4Ff\n8gZQrfMzSXHVdFncw6lSrtEGxQebFa3lLaPWnRTio0UWkRIv9QW9q46B5af3\nrxfanwedgx6CwpY5TVsQ6LvVj12uUlyrGNOtmo/dsKZWqBMns3D8Xr7YUOKl\nQEZdSKMNx/wa0EjrX9C49m0muRfzjSG6YZZM+PjxsoQqrKdxfffEXceEc8Uk\nXIkCtI9vX4mtcQeLDtSEyb7c4UbqNrSmgN8GRVndjZqvtUws1fSi7rqXB44m\nHjl5ZUkrzQcEaJuQrRiyJxcRW8DW7hpIlB82GXF72kaxnI4zCNczX+MPizPf\nZkvt6E3GuNxHmG7e9xyTNpxbVw4s/kInP/qlqscnEsP49iFv/JETKyWb/SqO\nuresi40f1xDvOpngpWbPJz1vb0EZL7VapE7v2OEGAUT0T/v8DSak36jZb5tN\nY5vz2YA1vMxkG2fzVakH9Bm16glBVNILnjPH4/wnUseZT/CL2CB01bzECIOR\njrGemaVm7s902v/gubTlM7mwLrYiM7W7d23FAokr7eDtr9SHvvM2XeZRDCij\nYv+m\r\n=ROye\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is modeled after the browser's\n`<input type=\"range\">` element.\n\nSliders follow accessibility best practices per the [WAI-ARIA spec](https://www.w3.org/TR/wai-aria-practices/#slider)\nand are fully RTL-aware.\n\n## Contents\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders follow the\n[WAI-ARIA guidelines](https://www.w3.org/TR/wai-aria-practices/#slider).\nPer the spec, ensure that the following attributes are added to the\n`mdc-slider__thumb` element(s):\n\n* `role=\"slider\"`\n* `aria-valuenow`: Value representing the current value.\n* `aria-valuemin`: Value representing the minimum allowed value.\n* `aria-valuemax`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value of `aria-valuenow` is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set to a string that makes the slider value\nunderstandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Continuous slider demo\" aria-valuemin=\"0\"\n       aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Continuous range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Continuous range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   `data-step` attribute on the root element. This will be the step size for\n    value quantization. If not set, the default is 1.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete slider with tick marks demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"20\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `tabindex=\"-1\"` attribute on the thumb(s)\n*   `aria-disabled=\"true\"` on the thumb(s)\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"-1\" aria-label=\"Disabled slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\" aria-disabled=\"true\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the thumb element's `aria-valuemin`,\n`aria-valuemax`, and `aria-valuenow` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"75\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string)|null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"d2d4890ac5812ec797b5f621137f4e8a077c3c0c","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"9.0.0-canary.6cf6ba4f4.0","@material/rtl":"9.0.0-canary.6cf6ba4f4.0","@material/base":"9.0.0-canary.6cf6ba4f4.0","@material/theme":"9.0.0-canary.6cf6ba4f4.0","@material/ripple":"9.0.0-canary.6cf6ba4f4.0","@material/animation":"9.0.0-canary.6cf6ba4f4.0","@material/elevation":"9.0.0-canary.6cf6ba4f4.0","@material/typography":"9.0.0-canary.6cf6ba4f4.0","@material/feature-targeting":"9.0.0-canary.6cf6ba4f4.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_9.0.0-canary.6cf6ba4f4.0_1605552623379_0.42599355541455597","host":"s3://npm-registry-packages"}},"9.0.0-canary.07f3e01b7.0":{"name":"@material/slider","version":"9.0.0-canary.07f3e01b7.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@9.0.0-canary.07f3e01b7.0","maintainers":[{"name":"taylorv","email":"brian.t.vann@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"70d46af0e4654e69f10c20ce6811b77f639440be","tarball":"https://registry.npmjs.org/@material/slider/-/slider-9.0.0-canary.07f3e01b7.0.tgz","fileCount":38,"integrity":"sha512-CnRD26Vu2CbW4xfYPPXRd8vAgzA6p5reIhLgRWCna2LdjYPS2n4f7YzUUYbis4vM5sx050fiuzyB4+/UsV5cxg==","signatures":[{"sig":"MEYCIQDkOfFqY6WxzFpyviLTybZLEA1sy0x2oIRP4qPg0DguwQIhAKApugEfSWejpXERr3Yp1kt0kn19qfSkaoSQiexac+VE","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":776717,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfsvMlCRA9TVsSAnZWagAA3GcP/3lpP5sly/zU2j0w0vbM\nmClw7UCpSu/IIz9Q/IjjnWqYSgWRVwZvlSeYA3ZtMcbOky/ZUqFwxwXqgArJ\nGsfGIaZWrEERkcqRj6uyfACpvyAFsOlj0xRkUsmOr3derhYWtFsTUcN+WSxO\npW7VKfvlviPVOqKSjaDK9gjnVTgbFEYwcBvoJgl+cgjSgZZY6jnDNTJOhbRG\nop59NmYziKwJ5esn6ZT0ZYB9c3aTKWMcJraKPvwt2ycpc/FzQPfduLxD6t+i\nSBvAuJwmQQYfhH2bb4sa8wv6U+SQuRW0pe+/hyxqR3418fvtpLE8KNcQucwf\naenWONIyYNrZqf7q8UcgmgicD5fsuDBT6ZbfJokNKVmRf5rBzyOocnizKmGS\normeR588tE1KHqS1ZoP0uV6EyeIxCCRnRYumxvjmxzc+2ZkYUjPMoiqOgSOV\nnRV1GyKOQD7Y5e/l6bt1G/yeypSlDeDAlu7yEochbFNaALTHeeGPM/KH39PL\nRsCkf0qPooMldRuV1KBWzE4lwMdyQx80Dyw/qzPa/51W0IImmbuI6U6C08sV\nZnQOsrunbk5ai2NsgYBQ5x0LG1hlcIUQ5J9AISqYP4lnx32l7HoEGkZOXpN6\nw3esFRbUUgkn0i7HudeONRuvDOjESMVi9vEpat1L6nHRwwz6AUQS4vv4j/HL\nCNbg\r\n=DqCM\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is modeled after the browser's\n`<input type=\"range\">` element.\n\nSliders follow accessibility best practices per the [WAI-ARIA spec](https://www.w3.org/TR/wai-aria-practices/#slider)\nand are fully RTL-aware.\n\n## Contents\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders follow the\n[WAI-ARIA guidelines](https://www.w3.org/TR/wai-aria-practices/#slider).\nPer the spec, ensure that the following attributes are added to the\n`mdc-slider__thumb` element(s):\n\n* `role=\"slider\"`\n* `aria-valuenow`: Value representing the current value.\n* `aria-valuemin`: Value representing the minimum allowed value.\n* `aria-valuemax`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value of `aria-valuenow` is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set to a string that makes the slider value\nunderstandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Continuous slider demo\" aria-valuemin=\"0\"\n       aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Continuous range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Continuous range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   `data-step` attribute on the root element. This will be the step size for\n    value quantization. If not set, the default is 1.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete slider with tick marks demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"20\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `tabindex=\"-1\"` attribute on the thumb(s)\n*   `aria-disabled=\"true\"` on the thumb(s)\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"-1\" aria-label=\"Disabled slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\" aria-disabled=\"true\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the thumb element's `aria-valuemin`,\n`aria-valuemax`, and `aria-valuenow` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"75\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string)|null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"39f1e043d0db0c6881d84b3d7b54423f64cc8c0b","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"9.0.0-canary.07f3e01b7.0","@material/rtl":"9.0.0-canary.07f3e01b7.0","@material/base":"9.0.0-canary.07f3e01b7.0","@material/theme":"9.0.0-canary.07f3e01b7.0","@material/ripple":"9.0.0-canary.07f3e01b7.0","@material/animation":"9.0.0-canary.07f3e01b7.0","@material/elevation":"9.0.0-canary.07f3e01b7.0","@material/typography":"9.0.0-canary.07f3e01b7.0","@material/feature-targeting":"9.0.0-canary.07f3e01b7.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_9.0.0-canary.07f3e01b7.0_1605563173102_0.6020598975666585","host":"s3://npm-registry-packages"}},"9.0.0-canary.23491cf85.0":{"name":"@material/slider","version":"9.0.0-canary.23491cf85.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@9.0.0-canary.23491cf85.0","maintainers":[{"name":"taylorv","email":"brian.t.vann@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"1add86334319d2d3371ab9f9a33f7b55aecf70b0","tarball":"https://registry.npmjs.org/@material/slider/-/slider-9.0.0-canary.23491cf85.0.tgz","fileCount":38,"integrity":"sha512-4jBg4rt5lZzM3g2FNY0kZ0d9659G7wfJ373ZL/WcpC/AAOWCIsFPeyPiTfi+3xdZhdSt3YetfRPfiIECnNBU/w==","signatures":[{"sig":"MEUCID+sD8vva5nreOjab9pIzBumkTu76rBU/eApzP8OT7Z/AiEAmvcWT9MJyMa6NKBVEhApl7vzbj/mA61JPJtymLMvLMY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":776717,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfsxakCRA9TVsSAnZWagAADrIQAIb18XfPru54PRb9wEMD\nuVgxWTfZq8sB199lH0FltSVz+8jY/HBYTOUhsLaA+gIfslmXw+MNnaNrFx/s\n1IzHnjhYvmGVP9y3k+U0bnmtBNrlG1dbbd0vaVJ0LAKkoFDS/rf3aqXDtpNL\nGwFUj+F1ojP/w8C02Nsq+hhzByrGysv+g50vt1ftPCes7htuo53Qk/+PX1m7\nJ7a7WfTkL0eMYdZdW3mKNRQ2MYzQKB7FZFY6HVLV9ebAjJzhAj+ce6nk/XRf\nR1tXDBjEIUVKYLYh3VSwfNavxdhwmgqc8duEKj9c517FEHStHPtN7rfRDV/A\nMGVK7ltdUrwXretBHbiYn11u5ly9cB9IRIExsNyseu8dGXOrW5G5orqV3xyd\nU++Thb02wtsJNmCMLiNfPaqSUm3Tsa8ohZpXAZPlKkQ1k6k1QVDcTNmjkMoa\nrTxJux0NBldPBLh6Nd7tKxep5yoP0bwGtIbNCGIhhPaiC1KJi4N7ASjgy79B\nRW3laNipZ18sXwhcsuhNdcQCGjzT9IXdQk5sBKsrW6/+Eq6wFy9Cow8kUx8s\nMu1r49ISI8BZ8kqSdAUjSfp8Brcg/JoBex46MsD7mgyt3YbAwqR972+dd6Qj\nwtL8jLGvt+rH7UB7yohYitSWCTi3VnpL9DZgXcrMWt1fbWCJENY26rxjnTmQ\nYO+L\r\n=CinY\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is modeled after the browser's\n`<input type=\"range\">` element.\n\nSliders follow accessibility best practices per the [WAI-ARIA spec](https://www.w3.org/TR/wai-aria-practices/#slider)\nand are fully RTL-aware.\n\n## Contents\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders follow the\n[WAI-ARIA guidelines](https://www.w3.org/TR/wai-aria-practices/#slider).\nPer the spec, ensure that the following attributes are added to the\n`mdc-slider__thumb` element(s):\n\n* `role=\"slider\"`\n* `aria-valuenow`: Value representing the current value.\n* `aria-valuemin`: Value representing the minimum allowed value.\n* `aria-valuemax`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value of `aria-valuenow` is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set to a string that makes the slider value\nunderstandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Continuous slider demo\" aria-valuemin=\"0\"\n       aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Continuous range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Continuous range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   `data-step` attribute on the root element. This will be the step size for\n    value quantization. If not set, the default is 1.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete slider with tick marks demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"20\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `tabindex=\"-1\"` attribute on the thumb(s)\n*   `aria-disabled=\"true\"` on the thumb(s)\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"-1\" aria-label=\"Disabled slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\" aria-disabled=\"true\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the thumb element's `aria-valuemin`,\n`aria-valuemax`, and `aria-valuenow` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"75\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string)|null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"cc2535ba5f66f73426d236b8a85291d7395ce589","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"9.0.0-canary.23491cf85.0","@material/rtl":"9.0.0-canary.23491cf85.0","@material/base":"9.0.0-canary.23491cf85.0","@material/theme":"9.0.0-canary.23491cf85.0","@material/ripple":"9.0.0-canary.23491cf85.0","@material/animation":"9.0.0-canary.23491cf85.0","@material/elevation":"9.0.0-canary.23491cf85.0","@material/typography":"9.0.0-canary.23491cf85.0","@material/feature-targeting":"9.0.0-canary.23491cf85.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_9.0.0-canary.23491cf85.0_1605572259556_0.01632593461283438","host":"s3://npm-registry-packages"}},"9.0.0-canary.b659d4fc3.0":{"name":"@material/slider","version":"9.0.0-canary.b659d4fc3.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@9.0.0-canary.b659d4fc3.0","maintainers":[{"name":"taylorv","email":"brian.t.vann@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"b82f9e8c5ead9007e33cc6aaf56485064a005f4c","tarball":"https://registry.npmjs.org/@material/slider/-/slider-9.0.0-canary.b659d4fc3.0.tgz","fileCount":38,"integrity":"sha512-PE63phOoQBCQnTxmHeN9nejgVBtuL2sm5/6PhMYZVFfPJE2tM0+LMtY10oDWLBWg5DCuwaq2Mj6f8Pe5DDlZBQ==","signatures":[{"sig":"MEUCIACgqZ7mqW+Mde4L7TN9aViQdAXUyHLy4W3zgJl/PV3QAiEAi/IUTrMQHkvz+HDBhnV+oN3t8EIJJnZRr7TfRMUN0zw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":776717,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfsxh8CRA9TVsSAnZWagAAih0QAKNBoSx6lbe5F/XaLmEk\nN6Bz3NP/Sr1mB1G3TJxm4RhFuJSw8VQ5W8Gy2OdDldlo1XOzfQoRWA87veHj\n9xSGNmyqKIf4VN9OF6o0Lhdvw1gV5BIR/mHfxpO62kEgADWRRQssm3qqdnsT\ncMGS6ho8hvkEPBA+CSvDaxcJMsVihULSZ3MSdU3ecX9z0rQA1z+sDhbZO+2T\noRuQEIItp8bD/4tJtED5hobmgaCvrcszIP2Qwuva6OsREOJmqDKpILiZkENF\nzIuTcVuhE56ehcYDJuFtjxFIM4X+Dp2vcjSjDd0YKjFAdXcJ+VGUpWd72KJB\nW9HbUA2jzoRAAkZjj1ZeH2+t3bs+n11UGGGPrshbVYpYYOnlHCPO1xYQ9wzC\nrWVw6sBrbICtR42Gwi9LHOSMb1NywGWTyFOrQ1x+XlWeu3/epCDnC/Jz9kSi\n0v/v7hEpJIf6S19vJhYCnAapzU/xgHHFttr3l8p5ouXue9ZvHPxngzNaiY5s\n/5HNQ75wnwVRxv8fIWW8UfzIE4qOZ+mVTAIAI7iOfmsexf2TX92r75mojvxn\n9jAi4nRR0vTmTH1ivXYHLiVpZEaTdw354+xmsL8lwYXXae3yA1zKFoKtHwxA\nUGoSsAumJdySQi5NKdW93j2fBxV6egqYHG5XIev9KHEsBRaImA2fbuD8eYjp\nF3fI\r\n=3obH\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is modeled after the browser's\n`<input type=\"range\">` element.\n\nSliders follow accessibility best practices per the [WAI-ARIA spec](https://www.w3.org/TR/wai-aria-practices/#slider)\nand are fully RTL-aware.\n\n## Contents\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders follow the\n[WAI-ARIA guidelines](https://www.w3.org/TR/wai-aria-practices/#slider).\nPer the spec, ensure that the following attributes are added to the\n`mdc-slider__thumb` element(s):\n\n* `role=\"slider\"`\n* `aria-valuenow`: Value representing the current value.\n* `aria-valuemin`: Value representing the minimum allowed value.\n* `aria-valuemax`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value of `aria-valuenow` is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set to a string that makes the slider value\nunderstandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Continuous slider demo\" aria-valuemin=\"0\"\n       aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Continuous range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Continuous range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   `data-step` attribute on the root element. This will be the step size for\n    value quantization. If not set, the default is 1.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete slider with tick marks demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"20\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `tabindex=\"-1\"` attribute on the thumb(s)\n*   `aria-disabled=\"true\"` on the thumb(s)\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"-1\" aria-label=\"Disabled slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\" aria-disabled=\"true\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the thumb element's `aria-valuemin`,\n`aria-valuemax`, and `aria-valuenow` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"75\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string)|null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"da948526208886bd05bb015d249db8d19d4b3f05","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"9.0.0-canary.b659d4fc3.0","@material/rtl":"9.0.0-canary.b659d4fc3.0","@material/base":"9.0.0-canary.b659d4fc3.0","@material/theme":"9.0.0-canary.b659d4fc3.0","@material/ripple":"9.0.0-canary.b659d4fc3.0","@material/animation":"9.0.0-canary.b659d4fc3.0","@material/elevation":"9.0.0-canary.b659d4fc3.0","@material/typography":"9.0.0-canary.b659d4fc3.0","@material/feature-targeting":"9.0.0-canary.b659d4fc3.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_9.0.0-canary.b659d4fc3.0_1605572732353_0.9807662041801248","host":"s3://npm-registry-packages"}},"9.0.0-canary.d8a3aed67.0":{"name":"@material/slider","version":"9.0.0-canary.d8a3aed67.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@9.0.0-canary.d8a3aed67.0","maintainers":[{"name":"taylorv","email":"brian.t.vann@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"c7ab0518fdffb221dc2322aea3f46c6475d622ab","tarball":"https://registry.npmjs.org/@material/slider/-/slider-9.0.0-canary.d8a3aed67.0.tgz","fileCount":38,"integrity":"sha512-mmsntyKFETQFsFdVsxW+i6mmr18r7v4dOQxLALLvkIb3miKTb++jE7Stgf/bMj9+FVdBQuwf+jCRdcFKn2DdMw==","signatures":[{"sig":"MEUCIQC0T5h0HbauQhw+mU+88zTTn/q50R4YgEvlUU8O6jkXzAIgG1CJZL9OosH9uV8n1RwoeIHOq3bI6h+Tu+Ny/HTh+/M=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":776749,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfs+waCRA9TVsSAnZWagAA5rwP/jiFS4PPv23qRXcudZOI\nT14f8jzbcWllzm8aWfEumxWxdsVNoHi7DzH+QrIlRKIy+1VKTarMvD57HpKI\nhokYx03CU+XB7l3KJ9Fb1mQ9SAaAKulY2/f0+3YyZU5h58nx7oPwrc8gS05B\njuD4o8sFPB2xu9ecSiznAzTXvtLqtzjEdKOT7LbFGmOVz9huuSbxFtroLoPX\nv1Qjjk3cBGuA21GSAJ5JRr0CvPOMGHOJkVEp4hYNTUimwnSfc3UYnqxZ5sIY\nweJ1midmKyCUQSLTGXp9bxZPfJ2ZcoklwFaz/LYXE+BDYnvMnhQz7b2eXlCp\nBnv002Rf9CeqkD1g6jedkmsicbzbvUZLnYTjuwxGnsDuHP+N/5/xwf27umFO\nY+ySEduG8mDv0YAZ6EiMQLMgXCuE0JuU/VZkOFlhpp7h0AnNZF7S/WNc6n1k\nsNvWZ/jSH8Sr7G91Yezc0HNsxMs65nhn7eCQmuLRkQSPx7vdlV/G7Zlf1dD+\nzPO1ehW7+MMdiWpIFmzJ7yT5tAN8ilEqeUBlLckRlTaLwtQ5DF95j9LUH1fB\nmuxqkxbck5qjOm9anTlkfdpntqmgtT+hMNzhGNfGqErK4yIi01DlAakxLaoK\nDNXZKYh/tH0Hdrezx3yxW48nni+l/d3UuCWQoWQKjhCXbVnM+9fEN8b7pTqS\n/3mS\r\n=Oxwg\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is modeled after the browser's\n`<input type=\"range\">` element.\n\nSliders follow accessibility best practices per the [WAI-ARIA spec](https://www.w3.org/TR/wai-aria-practices/#slider)\nand are fully RTL-aware.\n\n## Contents\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders follow the\n[WAI-ARIA guidelines](https://www.w3.org/TR/wai-aria-practices/#slider).\nPer the spec, ensure that the following attributes are added to the\n`mdc-slider__thumb` element(s):\n\n* `role=\"slider\"`\n* `aria-valuenow`: Value representing the current value.\n* `aria-valuemin`: Value representing the minimum allowed value.\n* `aria-valuemax`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value of `aria-valuenow` is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set to a string that makes the slider value\nunderstandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Continuous slider demo\" aria-valuemin=\"0\"\n       aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Continuous range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Continuous range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   `data-step` attribute on the root element. This will be the step size for\n    value quantization. If not set, the default is 1.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete slider with tick marks demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"20\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `tabindex=\"-1\"` attribute on the thumb(s)\n*   `aria-disabled=\"true\"` on the thumb(s)\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"-1\" aria-label=\"Disabled slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\" aria-disabled=\"true\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the thumb element's `aria-valuemin`,\n`aria-valuemax`, and `aria-valuenow` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"75\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string)|null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"e70765503f122fcb3d748ffd41882655d9d4035e","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"9.0.0-canary.d8a3aed67.0","@material/rtl":"9.0.0-canary.d8a3aed67.0","@material/base":"9.0.0-canary.d8a3aed67.0","@material/theme":"9.0.0-canary.d8a3aed67.0","@material/ripple":"9.0.0-canary.d8a3aed67.0","@material/animation":"9.0.0-canary.d8a3aed67.0","@material/elevation":"9.0.0-canary.d8a3aed67.0","@material/typography":"9.0.0-canary.d8a3aed67.0","@material/feature-targeting":"9.0.0-canary.d8a3aed67.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_9.0.0-canary.d8a3aed67.0_1605626906025_0.40163965786665146","host":"s3://npm-registry-packages"}},"9.0.0-canary.482ff9091.0":{"name":"@material/slider","version":"9.0.0-canary.482ff9091.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@9.0.0-canary.482ff9091.0","maintainers":[{"name":"taylorv","email":"brian.t.vann@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"50a67756727b7a5f490ed2c59759258660eca1de","tarball":"https://registry.npmjs.org/@material/slider/-/slider-9.0.0-canary.482ff9091.0.tgz","fileCount":38,"integrity":"sha512-kPrFfA6Bi67R6Op7uWUo7oxQWZMAVF5zLJuCp8j0IlLV0IkT/pdV/lItQMufULwPXpee/uy8sD9Yoie/9N/3Kw==","signatures":[{"sig":"MEYCIQCQ3h8tv+HI0MkCR7N4QNHu5cNideHTqaCpQTYTLXiLywIhAOoX6lRdYFibbM+aMEzqXDfK67ix3kJer+4+WdZE4DWq","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":776749,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJftA9FCRA9TVsSAnZWagAAJmMP/RcTchQiIjNM8s71kzWX\nV2Sp7bmaH8rgP738tnfE1QbL92AXd9aakFBf4fve+SyE8o0dcmN1rQCVTVXm\nK9YoyAvPi9CwV1t784nvd0GTU5T+x8M5OfEtoHYjwIDNmVi5FCecrKfeAD2z\nsi/9dRoSoADE3qEABmN585wtO+jIcOuU1F5UWmmqjyqAA7iBEKXLyng71ARO\njx43SLIihKe422weO06EDvP6M+e2XZTuuqrKv7Wspy1eZpYYHMoG+/DJkVmj\nL8GZZ8JYZzcvy4BjBe/7rtSLOIAQhea7fod31rm1XilFN/O7BVKgTXKU2sUx\nI2gvGkai7llkV0i8HtU8EJdXQSlnKiLsMDTx6EMDqwvJyDnI3G64+kYmKfp8\nJR2/uZgvqhUUlFmzp99pfqDlWYp+N/Flffe4m/jjKBU2bQ3shacbMErZzpJU\nGVrE0mlvibuVD6Vz544PODf2wsWhWidxQHVkHxvJ/LKR7iXuJ+yZtl6wVOPw\nIGF88iLoQWOfD5e6vNFWMr55o6SnxYP5J+yAWShUq+Vmk8HvijbyU+SkE2pE\nwY8PMU8ddifLdQ/L2JgX6Ffmofw/fiByeYwq23aC0+V58InuZ2dECxvG2IV7\nPlwh8tEbcXVe5yRaGcNCF8BMCvMC9a5Bubmdtd3/QpA7lS8Pv25s9oSeDQTZ\n3slJ\r\n=7wTE\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is modeled after the browser's\n`<input type=\"range\">` element.\n\nSliders follow accessibility best practices per the [WAI-ARIA spec](https://www.w3.org/TR/wai-aria-practices/#slider)\nand are fully RTL-aware.\n\n## Contents\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders follow the\n[WAI-ARIA guidelines](https://www.w3.org/TR/wai-aria-practices/#slider).\nPer the spec, ensure that the following attributes are added to the\n`mdc-slider__thumb` element(s):\n\n* `role=\"slider\"`\n* `aria-valuenow`: Value representing the current value.\n* `aria-valuemin`: Value representing the minimum allowed value.\n* `aria-valuemax`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value of `aria-valuenow` is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set to a string that makes the slider value\nunderstandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Continuous slider demo\" aria-valuemin=\"0\"\n       aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Continuous range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Continuous range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   `data-step` attribute on the root element. This will be the step size for\n    value quantization. If not set, the default is 1.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete slider with tick marks demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"20\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `tabindex=\"-1\"` attribute on the thumb(s)\n*   `aria-disabled=\"true\"` on the thumb(s)\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"-1\" aria-label=\"Disabled slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\" aria-disabled=\"true\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the thumb element's `aria-valuemin`,\n`aria-valuemax`, and `aria-valuenow` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"75\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string)|null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"5b4b306ef0e5d1d3654252169bb9fb9d75490dc1","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"9.0.0-canary.482ff9091.0","@material/rtl":"9.0.0-canary.482ff9091.0","@material/base":"9.0.0-canary.482ff9091.0","@material/theme":"9.0.0-canary.482ff9091.0","@material/ripple":"9.0.0-canary.482ff9091.0","@material/animation":"9.0.0-canary.482ff9091.0","@material/elevation":"9.0.0-canary.482ff9091.0","@material/typography":"9.0.0-canary.482ff9091.0","@material/feature-targeting":"9.0.0-canary.482ff9091.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_9.0.0-canary.482ff9091.0_1605635909443_0.8797706223405224","host":"s3://npm-registry-packages"}},"9.0.0-canary.99cfb6bd5.0":{"name":"@material/slider","version":"9.0.0-canary.99cfb6bd5.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@9.0.0-canary.99cfb6bd5.0","maintainers":[{"name":"taylorv","email":"brian.t.vann@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"b270ecb47a1323e03cf1b5ddc007f012278369fe","tarball":"https://registry.npmjs.org/@material/slider/-/slider-9.0.0-canary.99cfb6bd5.0.tgz","fileCount":38,"integrity":"sha512-5Izcy6Asg24ZtJqY+6X5hBQwtNjI1e1bhm0YsrNPvzfbDAVEryntHKhjjjEMI/xiTbccmwLqR1+c15r8Hu/5OA==","signatures":[{"sig":"MEUCIQDLX1dukdj6W3gzzOOMpmQ/XH/84w/wRDWaWN1O3hUyKAIgF+Elr1gX8u+iDmeNwT62Lr9PW5vpjU9efFPGbmpTpzU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":776749,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJftWuCCRA9TVsSAnZWagAAjUMQAISyCkv3MaYTpD5LxKSd\nEbSPC2p/THkocZ82DBPvu1Kqv8Q93vQ1hDtp9KT9/lbleoq2Fjavcl+LH7Rq\nlga9vTuOsIRW8LoyoKWRVSxP/hFXbnsCbWJ+wevgytylR5yP5l7sOIFIKLJK\nFQnJtMLoD+DC9Xo59GUVCPqmQ9T3CC/0fqIL24hwGZLBG8cqvvauKCyerx4D\nHnhHsEo/uqLvPGUhPH6qbP+4ecGcV9guFQtiKHLejd0nN8H4yhvYXHGBSPFy\n+xNGpQD6hUbBBwlyTfOHV/RgHkK30HQ3zotw55zwOK6eIryHS0AnG+4vHThu\nbugKmjj2rTRwJyr1oJEpOnVkxsRJFZ6RuXtS5OOd9mdgCqbVh0QLLD5NepIf\nakbC1EeZvhWe2PUjec+P8eb1BbO/vSnpaK3ZFATS2f1QRRL3iLqGwaaJn3zk\nDzTNlNS3V9VZY3QtiYWJS8feRt7WpQ53s2+GZ8ozBFFf05Bxu0zNhoahHRcV\nTbU4Lzn/z9QFpshiHmzo5mljN1DQ1cnhcNS2UbdwsEQ0iWsNcUPXe9sSKxMl\nwo22/0v+Q6H3LQs8+6GPn8xEaMzHtRDZr1pLXP6ZeIxb+796u1R55jVWZjYt\nKnspc1OZx/3HdobxHUDSHUVuAO7n09Ywls14kvqsOFtgJKtNXL4sr4eSutTe\nqeTV\r\n=0hKG\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is modeled after the browser's\n`<input type=\"range\">` element.\n\nSliders follow accessibility best practices per the [WAI-ARIA spec](https://www.w3.org/TR/wai-aria-practices/#slider)\nand are fully RTL-aware.\n\n## Contents\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders follow the\n[WAI-ARIA guidelines](https://www.w3.org/TR/wai-aria-practices/#slider).\nPer the spec, ensure that the following attributes are added to the\n`mdc-slider__thumb` element(s):\n\n* `role=\"slider\"`\n* `aria-valuenow`: Value representing the current value.\n* `aria-valuemin`: Value representing the minimum allowed value.\n* `aria-valuemax`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value of `aria-valuenow` is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set to a string that makes the slider value\nunderstandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Continuous slider demo\" aria-valuemin=\"0\"\n       aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Continuous range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Continuous range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   `data-step` attribute on the root element. This will be the step size for\n    value quantization. If not set, the default is 1.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete slider with tick marks demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\" data-step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"20\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `tabindex=\"-1\"` attribute on the thumb(s)\n*   `aria-disabled=\"true\"` on the thumb(s)\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"-1\" aria-label=\"Disabled slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\" aria-disabled=\"true\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the thumb element's `aria-valuemin`,\n`aria-valuemax`, and `aria-valuenow` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"75\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string)|null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"97b5b434f189a370838c9b867dfe1b766ae52fde","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"9.0.0-canary.99cfb6bd5.0","@material/rtl":"9.0.0-canary.99cfb6bd5.0","@material/base":"9.0.0-canary.99cfb6bd5.0","@material/theme":"9.0.0-canary.99cfb6bd5.0","@material/ripple":"9.0.0-canary.99cfb6bd5.0","@material/animation":"9.0.0-canary.99cfb6bd5.0","@material/elevation":"9.0.0-canary.99cfb6bd5.0","@material/typography":"9.0.0-canary.99cfb6bd5.0","@material/feature-targeting":"9.0.0-canary.99cfb6bd5.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_9.0.0-canary.99cfb6bd5.0_1605725057777_0.27563553606890956","host":"s3://npm-registry-packages"}},"9.0.0-canary.b98d15d90.0":{"name":"@material/slider","version":"9.0.0-canary.b98d15d90.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@9.0.0-canary.b98d15d90.0","maintainers":[{"name":"taylorv","email":"brian.t.vann@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"41304c7419a5dc05d287b1210511d4729aac434a","tarball":"https://registry.npmjs.org/@material/slider/-/slider-9.0.0-canary.b98d15d90.0.tgz","fileCount":38,"integrity":"sha512-p1r4rVXXC2ywQL71mV6aKTsnA5N91vz9LqYBDc2nAXLbaWTg1NRW7q4tKeQeYX0O43e5rGhQENKI9ZEVDOinYA==","signatures":[{"sig":"MEUCIB+Zu8z+m/kJrY7SnbE+XgSXeX+nJG8ddTETah09zvjmAiEAmSaghPNbAb6NYQ4sVKosn2F9hIXy/kHyPF9Rnj17+xI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":794238,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJftaGjCRA9TVsSAnZWagAAEH0P/if0c+Y/ZJotGGmNLL5x\nh8meZePY1E67+/SfTtoE/C6GsF+v0tRU8fjT0gFqAidTcjtuR3TPn4jLdnY1\nAInYxcZvs26kmMNssYSXn/w1RG18gr4i968qUfq9ucMI5nFV3ghMbmbdZNLU\nGEtqloNVBosaTRBZu1ZW9ZPDnScJbe977SZIguGfzSgchKvsPp/XadVIXF1H\n50eW78demllVeipWHAtae+pjwOPjPYl4Z0yOOBQdU9RHIyw7w6mlLotRhO/u\nV8Hj4WJKCfxQQ8iW//OKZrwu5vfW/gdZ8fee0fsUzrVM4KdwQdH3MYNOkDqo\nU0IgZW+3ndvLpn4fjmyx2f/ULDUg/nUOzDSte1eeV8ONYmDis0tz28Sga8s9\nubYtEcaeP37vKcNRyC9SAPbPxmN91ci7X6Eo+8Vu8VFjMSTjfoJGUhI9Qd7a\nLYNKFGfC1jIZyCM5qH+GTdYq2MFZU1KzypX8qfwZcMokQoxpGngJ2wE1Izvp\n1H5DH1s5eJZRNjSNLss+uxDFYxu9d/05H1145JyMe8Dku8LuxRy6FSeki7T3\nZHJUglicE+OCCvORQ/lNst9pDwkGfSipnzalcJU98Uzbj7qh9ngWPCLc69NO\nB3hPzLNJRBSFk5dTWbv6yNVXkW8gjERuDvZNzCe3vo5PbMS5KD//ZU9bHR2I\nc9LB\r\n=n3UD\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is modeled after the browser's\n`<input type=\"range\">` element.\n\nSliders follow accessibility best practices per the [WAI-ARIA spec](https://www.w3.org/TR/wai-aria-practices/#slider)\nand are fully RTL-aware.\n\n## Contents\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders follow the\n[WAI-ARIA guidelines](https://www.w3.org/TR/wai-aria-practices/#slider).\nPer the spec, ensure that the following attributes are added to the\n`mdc-slider__thumb` element(s):\n\n* `role=\"slider\"`\n* `aria-valuenow`: Value representing the current value.\n* `aria-valuemin`: Value representing the minimum allowed value.\n* `aria-valuemax`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value of `aria-valuenow` is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set to a string that makes the slider value\nunderstandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"hidden\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Continuous slider demo\" aria-valuemin=\"0\"\n       aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"hidden\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\">\n  <input class=\"mdc-slider__input\" type=\"hidden\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Continuous range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Continuous range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   `data-step` attribute on the root element. This will be the step size for\n    value quantization. If not set, the default is 1.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" data-step=\"10\">\n  <input class=\"mdc-slider__input\" type=\"hidden\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\" data-step=\"10\">\n  <input class=\"mdc-slider__input\" type=\"hidden\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete slider with tick marks demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\" data-step=\"10\">\n  <input class=\"mdc-slider__input\" type=\"hidden\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\">\n  <input class=\"mdc-slider__input\" type=\"hidden\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"20\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `tabindex=\"-1\"` attribute on the thumb(s)\n*   `aria-disabled=\"true\"` on the thumb(s)\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"hidden\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"-1\" aria-label=\"Disabled slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\" aria-disabled=\"true\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the thumb element's `aria-valuemin`,\n`aria-valuemax`, and `aria-valuenow` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"75\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string)|null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"abbd2c5bad9fedd634d7a0c98bb8e4a8b0bf3439","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"9.0.0-canary.b98d15d90.0","@material/rtl":"9.0.0-canary.b98d15d90.0","@material/base":"9.0.0-canary.b98d15d90.0","@material/theme":"9.0.0-canary.b98d15d90.0","@material/ripple":"9.0.0-canary.b98d15d90.0","@material/animation":"9.0.0-canary.b98d15d90.0","@material/elevation":"9.0.0-canary.b98d15d90.0","@material/typography":"9.0.0-canary.b98d15d90.0","@material/feature-targeting":"9.0.0-canary.b98d15d90.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_9.0.0-canary.b98d15d90.0_1605738915278_0.3535445923100373","host":"s3://npm-registry-packages"}},"9.0.0-canary.30c11bfc2.0":{"name":"@material/slider","version":"9.0.0-canary.30c11bfc2.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@9.0.0-canary.30c11bfc2.0","maintainers":[{"name":"taylorv","email":"brian.t.vann@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"0d56538d409cacc349c2a5af829cd1e1a4cace65","tarball":"https://registry.npmjs.org/@material/slider/-/slider-9.0.0-canary.30c11bfc2.0.tgz","fileCount":38,"integrity":"sha512-cn6GODqkUS2O5Z3ggxgMHjadnnPgCB8p8I2qC4nWIHDk00jwbKq5/UKeDyaDcfVFDgodpfbcZLoDNsSQyv+l/g==","signatures":[{"sig":"MEYCIQCmAFM506T4CbBVAyGXuXFdEcbwFMIW/ZPYyH7bfM15PgIhAI25nBCO9PCmCf7Dx6IALC/5cTDefE2OmzcBaJ35rxLt","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":794238,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJftcnACRA9TVsSAnZWagAAIGAQAJTKG4BK0sMgyd81t0zw\nOJlMY4ZSGpTIzqdRKr+4M0gZuArI9ahpWRhhWomz+FW559KMiySU7P1rWpbF\nBN6ru2qmxmk49cIjYqesNWtZrGob6eZmmWvtpIMdFW2iqFHy1L8vB5puTZQg\n9RNQQsn+Qad1Adnw4nddKEBTxAUOKqN00EntAd43F4kBCuA6ne4LvMWm7eQk\nVCKf9VM5h0ZDXm/hQU/erWbM41G2UTBGFJj5BgJUjwDlJAzQKxTfy8C5VEvk\nx1pzlXFA9ihpav4d+pHESChZ4fTM/kcpaAwsnDmQyVwOt3cmxgPO85y7yGgb\nfWl/F7g6+9D5Sp/bVsAZfVz72c/ojMYoT04Lg5D3YdGgoZgNMw7tF3oA1AEG\nSUtxGqTH/kLdZrQjabq8TAC9KPxxu3sqW+mfwHum6gjMue21Ws6EiwYTkzgA\neDp/EhiJQ7XzpGOmi2ROCSeHzlRkwhTOEY+vf2016EXwPWp3wQiC7XAiDMK0\nOesWnARwJzlXDsUSFvZ+drEoArGrXT7/og0YoXvezFwHBgENYe//qDxqMWdA\nLFiiVzY2M47xWs+wLDiKRa+DZIbVnDc2cBC6sTfhLcFUXWmHbsjEakz7f/zP\n4wNgPJv/g6CaH5Ltyb+2f8p2WS6Y6EfmVoKLHuT8MbHf5elpl3tf+sE8NJYl\nzZ01\r\n=X3ME\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is modeled after the browser's\n`<input type=\"range\">` element.\n\nSliders follow accessibility best practices per the [WAI-ARIA spec](https://www.w3.org/TR/wai-aria-practices/#slider)\nand are fully RTL-aware.\n\n## Contents\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders follow the\n[WAI-ARIA guidelines](https://www.w3.org/TR/wai-aria-practices/#slider).\nPer the spec, ensure that the following attributes are added to the\n`mdc-slider__thumb` element(s):\n\n* `role=\"slider\"`\n* `aria-valuenow`: Value representing the current value.\n* `aria-valuemin`: Value representing the minimum allowed value.\n* `aria-valuemax`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value of `aria-valuenow` is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set to a string that makes the slider value\nunderstandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"hidden\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Continuous slider demo\" aria-valuemin=\"0\"\n       aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"hidden\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\">\n  <input class=\"mdc-slider__input\" type=\"hidden\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Continuous range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Continuous range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   `data-step` attribute on the root element. This will be the step size for\n    value quantization. If not set, the default is 1.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" data-step=\"10\">\n  <input class=\"mdc-slider__input\" type=\"hidden\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\" data-step=\"10\">\n  <input class=\"mdc-slider__input\" type=\"hidden\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete slider with tick marks demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\" data-step=\"10\">\n  <input class=\"mdc-slider__input\" type=\"hidden\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\">\n  <input class=\"mdc-slider__input\" type=\"hidden\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"20\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `tabindex=\"-1\"` attribute on the thumb(s)\n*   `aria-disabled=\"true\"` on the thumb(s)\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"hidden\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"-1\" aria-label=\"Disabled slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\" aria-disabled=\"true\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the thumb element's `aria-valuemin`,\n`aria-valuemax`, and `aria-valuenow` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"75\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string)|null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"bde404a844a4528a097cb2c90d03c4ce8bba9d74","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"9.0.0-canary.30c11bfc2.0","@material/rtl":"9.0.0-canary.30c11bfc2.0","@material/base":"9.0.0-canary.30c11bfc2.0","@material/theme":"9.0.0-canary.30c11bfc2.0","@material/ripple":"9.0.0-canary.30c11bfc2.0","@material/animation":"9.0.0-canary.30c11bfc2.0","@material/elevation":"9.0.0-canary.30c11bfc2.0","@material/typography":"9.0.0-canary.30c11bfc2.0","@material/feature-targeting":"9.0.0-canary.30c11bfc2.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_9.0.0-canary.30c11bfc2.0_1605749184024_0.15043620184227713","host":"s3://npm-registry-packages"}},"9.0.0-canary.1b731d51b.0":{"name":"@material/slider","version":"9.0.0-canary.1b731d51b.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@9.0.0-canary.1b731d51b.0","maintainers":[{"name":"taylorv","email":"brian.t.vann@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"79b610399bec9e2439ff6a8c28a958fc892e94bc","tarball":"https://registry.npmjs.org/@material/slider/-/slider-9.0.0-canary.1b731d51b.0.tgz","fileCount":38,"integrity":"sha512-yFv2A5+A9NwLeum1NfRZZq7WKHjW9UCVEqRNmJ68cylMdziSL5rLzeC/Dckw94M9eEe8hPhtjWWkO0lnBUBNxw==","signatures":[{"sig":"MEUCIQD+Fp9dvfab9/cdVSCiLFUlGWxIEvbbmES9x5BQL4ptTgIgULE2Ys1pqXiALDiTtt/UrZl7x/mGYvBc2jFR6A1svmU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":794238,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJftr8ACRA9TVsSAnZWagAAj7sP+wSb8wK3YM/bfawDVwCb\nIiUlqngj9hnEV2JlvvgWJQD3VuLdhU+q/3C+mnzBFQ3EIV62rcibxTV89Abn\nb4lSvCnPlxJagZgB/DO0qhDzOpmGoeX6jZ/s+rgoUS2oeNDfOheKEI+/AjQF\ncp7P++2xTy1LzxsZhMTQptc1m9/3Lm42G7BETg4UiN2Iyz6kfGUZb2oHoXiV\not3wTdrqVulkaL0smG7ImgYwmCMoNRZbZa9x6IKldyi9lQ17TB90IYo3Mti9\noO1Kyx+C0qAqTPZKwYG+wPKUFy29qGyR3z93D+iphUM0EZVQZ+YWW5W3RJta\nScz5W+HKaJKrC6YP5U+PyO0UNetOfc+u4a70P6MaxoFE1RzlfVHF34QGP5ib\nKSK6jwikOIoHO98/uHFqh+AkmQoy/bTCF1TnLTg4u2vIxmtKhDki7fiZx/Qk\n6ZgDgbLRwLGurzj9QplSylj7CXcxadEp2FAIM/OeTeCA4RlxTS5RHLB0oP2o\nBNUD3+od/TZeU2xWMhVyoQYeevKyxbmCpLsUXbfTkYBef4AbVVBlKmkJrKCM\ntybTPIU8ulnf+Lvi4Kd/gevDQBU97N+pT+gGs3lpl4hY0Pa9l9yUIsnSR2L4\nfab0vijzm5yLUsDGCRc40JAc+7cBFNI4e2m37LXE6Fb1ama4rUncbzSsWrfQ\nmeN5\r\n=nBeV\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is modeled after the browser's\n`<input type=\"range\">` element.\n\nSliders follow accessibility best practices per the [WAI-ARIA spec](https://www.w3.org/TR/wai-aria-practices/#slider)\nand are fully RTL-aware.\n\n## Contents\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders follow the\n[WAI-ARIA guidelines](https://www.w3.org/TR/wai-aria-practices/#slider).\nPer the spec, ensure that the following attributes are added to the\n`mdc-slider__thumb` element(s):\n\n* `role=\"slider\"`\n* `aria-valuenow`: Value representing the current value.\n* `aria-valuemin`: Value representing the minimum allowed value.\n* `aria-valuemax`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value of `aria-valuenow` is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set to a string that makes the slider value\nunderstandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"hidden\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Continuous slider demo\" aria-valuemin=\"0\"\n       aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"hidden\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\">\n  <input class=\"mdc-slider__input\" type=\"hidden\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Continuous range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Continuous range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   `data-step` attribute on the root element. This will be the step size for\n    value quantization. If not set, the default is 1.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" data-step=\"10\">\n  <input class=\"mdc-slider__input\" type=\"hidden\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\" data-step=\"10\">\n  <input class=\"mdc-slider__input\" type=\"hidden\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete slider with tick marks demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\" data-step=\"10\">\n  <input class=\"mdc-slider__input\" type=\"hidden\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\">\n  <input class=\"mdc-slider__input\" type=\"hidden\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"20\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `tabindex=\"-1\"` attribute on the thumb(s)\n*   `aria-disabled=\"true\"` on the thumb(s)\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"hidden\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"-1\" aria-label=\"Disabled slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\" aria-disabled=\"true\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the thumb element's `aria-valuemin`,\n`aria-valuemax`, and `aria-valuenow` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"75\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string)|null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"22fd036a79b754fbad742c64041cedbac73ce410","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"9.0.0-canary.1b731d51b.0","@material/rtl":"9.0.0-canary.1b731d51b.0","@material/base":"9.0.0-canary.1b731d51b.0","@material/theme":"9.0.0-canary.1b731d51b.0","@material/ripple":"9.0.0-canary.1b731d51b.0","@material/animation":"9.0.0-canary.1b731d51b.0","@material/elevation":"9.0.0-canary.1b731d51b.0","@material/typography":"9.0.0-canary.1b731d51b.0","@material/feature-targeting":"9.0.0-canary.1b731d51b.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_9.0.0-canary.1b731d51b.0_1605811968009_0.0653871945429374","host":"s3://npm-registry-packages"}},"9.0.0-canary.4ae94ff78.0":{"name":"@material/slider","version":"9.0.0-canary.4ae94ff78.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@9.0.0-canary.4ae94ff78.0","maintainers":[{"name":"taylorv","email":"brian.t.vann@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"fcfd431ccf1c02a7cc5e6d95abbf2109047a57a3","tarball":"https://registry.npmjs.org/@material/slider/-/slider-9.0.0-canary.4ae94ff78.0.tgz","fileCount":38,"integrity":"sha512-Dz0BY85enmKEAY2X/HEZQH11O4TlVZFgm8W8ZMjbW6zmBcf35W1MC/ADeeb7IudhzFLlUGj+l4w2+EOluvfyIg==","signatures":[{"sig":"MEQCIHlyAd092yajS2bGVxx3cjgn8Q2Gzk9kOMvgXnWcz/XrAiBr2qa8yIczoUyn7rzV8gr2KqkpYL6KAnX5qUPXvZ7Zsw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":794238,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJftr+uCRA9TVsSAnZWagAAzbAP+wUTu7dwSbjOQy2yAPj/\nYlF9cdKp5WddAr6yC3yX3aj1huX3ktexHNw/TO9Zf39G0sSDBZXUdvqIy6pP\nK1XOEd16KohNpwnGC0S7pF+GsVN9MN6hf8v2bvkhcfNLKBQ30+uUtWgw7rC+\nrSS7HEttC4LT/paGjoUJAWtsysoN4/xlz0GXDc0O7YOqAQM6PtBj7xTD/iHw\nhBJuxcCqPoIn3Ybt83DXbd6m+jgfJPqA3Ra5wqqqyxG8rZQnnReHuh+QXjea\npLmZdYyjuTBNj5nJ82JILyDOPEMPHSjkchwjg+/rbtHW0oXqsGcnjCubZSCx\n+KLhF599vBp8IN4X1CwFLoQRH8dUr95284rS17p4WNLU00vRSWHkQLJ6dJns\n6f9GHoqSv2mF9z/70RBmwtbUdWQ1AuQQ5d+pRiZGfqLeSJqOuT0Y7JD0gxxz\n3Zn7RQzp1ywc4I7Ni8ZcFogj+gUdMWF+KTe5by2eTDvGJkHaYE3quE9afIb1\nWVBRgjWyWqr+VQFOSphAof8zWk4sit1il04ubFBy57xsgA3MzpuMc8+N6Mpe\nB8r5sqU1fohL8It1Bw53rOIE5F6kkOua+o+PtqQVFA4PX0v3uHI7IGt9pi/Q\nHj8oIY1T/BHvnVmHGKcdV+BhDEtS1cRI9e6xXY3cCWrMhE8kZw6cPS+FUtxp\nJ8z6\r\n=oRsq\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is modeled after the browser's\n`<input type=\"range\">` element.\n\nSliders follow accessibility best practices per the [WAI-ARIA spec](https://www.w3.org/TR/wai-aria-practices/#slider)\nand are fully RTL-aware.\n\n## Contents\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders follow the\n[WAI-ARIA guidelines](https://www.w3.org/TR/wai-aria-practices/#slider).\nPer the spec, ensure that the following attributes are added to the\n`mdc-slider__thumb` element(s):\n\n* `role=\"slider\"`\n* `aria-valuenow`: Value representing the current value.\n* `aria-valuemin`: Value representing the minimum allowed value.\n* `aria-valuemax`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value of `aria-valuenow` is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set to a string that makes the slider value\nunderstandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"hidden\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Continuous slider demo\" aria-valuemin=\"0\"\n       aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"hidden\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\">\n  <input class=\"mdc-slider__input\" type=\"hidden\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Continuous range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Continuous range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   `data-step` attribute on the root element. This will be the step size for\n    value quantization. If not set, the default is 1.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\" data-step=\"10\">\n  <input class=\"mdc-slider__input\" type=\"hidden\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\" data-step=\"10\">\n  <input class=\"mdc-slider__input\" type=\"hidden\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete slider with tick marks demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\" data-step=\"10\">\n  <input class=\"mdc-slider__input\" type=\"hidden\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\">\n  <input class=\"mdc-slider__input\" type=\"hidden\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"20\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `tabindex=\"-1\"` attribute on the thumb(s)\n*   `aria-disabled=\"true\"` on the thumb(s)\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"hidden\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"-1\" aria-label=\"Disabled slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\" aria-disabled=\"true\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the thumb element's `aria-valuemin`,\n`aria-valuemax`, and `aria-valuenow` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"75\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string)|null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"34c69ebecd44026cff9ea0d681fc2be3de9900b2","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"9.0.0-canary.4ae94ff78.0","@material/rtl":"9.0.0-canary.4ae94ff78.0","@material/base":"9.0.0-canary.4ae94ff78.0","@material/theme":"9.0.0-canary.4ae94ff78.0","@material/ripple":"9.0.0-canary.4ae94ff78.0","@material/animation":"9.0.0-canary.4ae94ff78.0","@material/elevation":"9.0.0-canary.4ae94ff78.0","@material/typography":"9.0.0-canary.4ae94ff78.0","@material/feature-targeting":"9.0.0-canary.4ae94ff78.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_9.0.0-canary.4ae94ff78.0_1605812142309_0.29474364682335774","host":"s3://npm-registry-packages"}},"9.0.0-canary.7ad038e1d.0":{"name":"@material/slider","version":"9.0.0-canary.7ad038e1d.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@9.0.0-canary.7ad038e1d.0","maintainers":[{"name":"taylorv","email":"brian.t.vann@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"052b9bf388b464f3f0306865eb3da7640e154826","tarball":"https://registry.npmjs.org/@material/slider/-/slider-9.0.0-canary.7ad038e1d.0.tgz","fileCount":38,"integrity":"sha512-vF6nwLI127c4sfWqjiFsWXwdiSIzjXf/1Purh/nK43cImyUQHEm0UGlFAvsJE2B/uqE1Co/vLC5qWPN1pMS6IA==","signatures":[{"sig":"MEUCIQCQo96QTp4nxSKTIrU4m4+VAtunsiN6UHmCUbOYjX5eDgIgdkwMN8C1MI9GfMbQma/rS2FxN7H0JclUkU0JeQqjt88=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":794467,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJftsUZCRA9TVsSAnZWagAAjHYP/jtA+TWoe+bBB3J0nhjN\nb1Xi98LxirzpyjwPQCJfBsT+pkcoSPL/abBNnuVRw3jCcmLFiGzGDaLtK6PV\nMyh3v+/iZkKEinfOr7ygNuFU96oRK+y5DCj6CA48v0UR1hjOvEniKuWMG1wN\n9MspobVSZuTgW9XlqVxqz4bYPDBP7qlo669N5u9zdna+nLTReBV+6XRG6bqu\nZbs/SN/9p0dXZWfJfB38tG+ajoqKzaClRDaHG3n25WkOYu+tpxzlJBFBRBDD\njClbtU/n0jh68DwtqjbyrI9d8XSmfre2RN6gZlKuuvdf1IVFTgfNMxkF9wUG\nxYayCw+u3dyJTkIUvbVA6LUmYL8nyUtVGUQrHw6gfVl2jV4cub+HdRGQhA5J\nGzTKJtTAw9eHcFvzTZVlr/3Ko27QIRgAlthDMuGs5PlVgxcVSmhfLeeudo/Q\nsvuMXlFNABFSeun5f5TGz24k5TV0OpD2Aet2yN44KVf0qAVmHA3jeikph5zR\nqnwwdxJlwDh8cbpGdn2F43DN7ZK3hXp6mnKuoJKO4sI4HOEFbyqgALUKVpz8\ns1LVkpXAItJFAWOGdEcjXSMjjLdHHxsndfYXlBIIV3DYYmFitlnrSvN0Z7iM\nRDxw6PyEaQdHfpFYHW2TeFUTA/tOFI1u0XXG/Q4UNTaRDKba8L7JAA1oSluk\n62HJ\r\n=EPk5\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is modeled after the browser's\n`<input type=\"range\">` element.\n\nSliders follow accessibility best practices per the [WAI-ARIA spec](https://www.w3.org/TR/wai-aria-practices/#slider)\nand are fully RTL-aware.\n\n## Contents\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders follow the\n[WAI-ARIA guidelines](https://www.w3.org/TR/wai-aria-practices/#slider).\nPer the spec, ensure that the following attributes are added to the\n`mdc-slider__thumb` element(s):\n\n* `role=\"slider\"`\n* `aria-valuenow`: Value representing the current value.\n* `aria-valuemin`: Value representing the minimum allowed value.\n* `aria-valuemax`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value of `aria-valuenow` is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set to a string that makes the slider value\nunderstandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"hidden\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Continuous slider demo\" aria-valuemin=\"0\"\n       aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"hidden\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\">\n  <input class=\"mdc-slider__input\" type=\"hidden\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Continuous range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Continuous range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"hidden\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"hidden\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete slider with tick marks demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"hidden\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\">\n  <input class=\"mdc-slider__input\" type=\"hidden\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"20\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `tabindex=\"-1\"` attribute on the thumb(s)\n*   `aria-disabled=\"true\"` on the thumb(s)\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"hidden\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"-1\" aria-label=\"Disabled slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\" aria-disabled=\"true\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the thumb element's `aria-valuemin`,\n`aria-valuemax`, and `aria-valuenow` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"75\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string)|null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"ae5e88e00f948f916eeb8f578dc80b6aa2084116","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"9.0.0-canary.7ad038e1d.0","@material/rtl":"9.0.0-canary.7ad038e1d.0","@material/base":"9.0.0-canary.7ad038e1d.0","@material/theme":"9.0.0-canary.7ad038e1d.0","@material/ripple":"9.0.0-canary.7ad038e1d.0","@material/animation":"9.0.0-canary.7ad038e1d.0","@material/elevation":"9.0.0-canary.7ad038e1d.0","@material/typography":"9.0.0-canary.7ad038e1d.0","@material/feature-targeting":"9.0.0-canary.7ad038e1d.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_9.0.0-canary.7ad038e1d.0_1605813529140_0.49534773757074957","host":"s3://npm-registry-packages"}},"9.0.0-canary.a41527604.0":{"name":"@material/slider","version":"9.0.0-canary.a41527604.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@9.0.0-canary.a41527604.0","maintainers":[{"name":"taylorv","email":"brian.t.vann@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"b7b91812036b11e1918843dd125da6c47a9c1375","tarball":"https://registry.npmjs.org/@material/slider/-/slider-9.0.0-canary.a41527604.0.tgz","fileCount":38,"integrity":"sha512-ihdcXk0w8zz459Uy+xu0XAA9hKCzuJEpwHmOp8Umhh61hCCUgSLPNcYpjRu7lSQ7l6Vt14A9LlcZqx4Yuw01qw==","signatures":[{"sig":"MEQCIGfLKqvrpj9AGurvFJCoRAH3EP0t9w8olfl3940SGUqgAiAuqIDs0Tq+OVn1XxoFOYjaZPKw3WDpH/LWTt0BploAlg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":794467,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfts7lCRA9TVsSAnZWagAAKpsP/iU10RNGFolcljfnOP28\nmt5ujIoe6r9f2v6CRjLC3h30NCu/SpFn7wZS4rK9VUOC1z+Vll0Iz8ae4464\nXYgFhdG9Wmoam+61PEWK1fpDBStYp8hHjVcwl2+aKihyvn0IAxyyTjx4sdkU\nPmRfuH62wFcwfCN1WweH69h7SrsCsxR2/SpIcXr0CxcXfHLhK4zW78uSd55n\nUXczD2byb/614A3r4Inb1BGCpo9/6njxf98ZTmx2DXpAjc2qrE7pNHbAcDP7\nnMywk1ZBkFvHwdcVtbE1f1NwScFBC0RacHIt+/56cAQXBms5Sud6JmwVMg4S\nePzWtcuuKu3UQsqZt/ivcj/FkgVmGkawEQxnL3Zg0rbw/gjTw9iM+Z40pPPf\nzQFGYcgmfWPxSTCPwfn8amosR7R+Dn/F5EyxOXSjPcnQAyz8iMy6y8oj+cXL\nigKFttaWV5AEU2QQBVQbOT3QmZP4entKD7sOglX7tvDTeL+5XZ5hC9KZisO+\nmbfXuy888nlhQ7wY1fwz2K+hxd4swhX6zOiRVD8PTORIUu9vk8SvCSwBjtZx\nK9DDzSW3yrsT+sRR+b12czbpU6ZiAXSD2oMAaHyR5xcy65BnSALsDycxAyko\noW2qIgQZaZdirJOsXXTEnqhrnGi5iQUmcsQkqf5zvbV++TAKzlZ7WRZeu8Vu\n9arX\r\n=TWbB\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is modeled after the browser's\n`<input type=\"range\">` element.\n\nSliders follow accessibility best practices per the [WAI-ARIA spec](https://www.w3.org/TR/wai-aria-practices/#slider)\nand are fully RTL-aware.\n\n## Contents\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders follow the\n[WAI-ARIA guidelines](https://www.w3.org/TR/wai-aria-practices/#slider).\nPer the spec, ensure that the following attributes are added to the\n`mdc-slider__thumb` element(s):\n\n* `role=\"slider\"`\n* `aria-valuenow`: Value representing the current value.\n* `aria-valuemin`: Value representing the minimum allowed value.\n* `aria-valuemax`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value of `aria-valuenow` is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set to a string that makes the slider value\nunderstandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"hidden\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Continuous slider demo\" aria-valuemin=\"0\"\n       aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"hidden\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\">\n  <input class=\"mdc-slider__input\" type=\"hidden\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Continuous range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Continuous range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"hidden\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"hidden\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete slider with tick marks demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"hidden\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\">\n  <input class=\"mdc-slider__input\" type=\"hidden\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"20\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `tabindex=\"-1\"` attribute on the thumb(s)\n*   `aria-disabled=\"true\"` on the thumb(s)\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"hidden\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"-1\" aria-label=\"Disabled slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\" aria-disabled=\"true\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the thumb element's `aria-valuemin`,\n`aria-valuemax`, and `aria-valuenow` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"75\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string)|null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"4419897c2a5ae382f471047e38ac619bef815058","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"9.0.0-canary.a41527604.0","@material/rtl":"9.0.0-canary.a41527604.0","@material/base":"9.0.0-canary.a41527604.0","@material/theme":"9.0.0-canary.a41527604.0","@material/ripple":"9.0.0-canary.a41527604.0","@material/animation":"9.0.0-canary.a41527604.0","@material/elevation":"9.0.0-canary.a41527604.0","@material/typography":"9.0.0-canary.a41527604.0","@material/feature-targeting":"9.0.0-canary.a41527604.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_9.0.0-canary.a41527604.0_1605816036989_0.10261855952808308","host":"s3://npm-registry-packages"}},"9.0.0-canary.7b0e2b377.0":{"name":"@material/slider","version":"9.0.0-canary.7b0e2b377.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@9.0.0-canary.7b0e2b377.0","maintainers":[{"name":"taylorv","email":"brian.t.vann@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"1e4a47976d812b0cc8d0a5633eef3ee125aea698","tarball":"https://registry.npmjs.org/@material/slider/-/slider-9.0.0-canary.7b0e2b377.0.tgz","fileCount":38,"integrity":"sha512-0C5HEuqmJS0rC763whve6O9UTqCyuNcLUAcuxOkG7kUgHNJA6Wi1FMh19OnRKqlndTRHEAxwCMDFINhR4UnKnA==","signatures":[{"sig":"MEQCIAo7GTDKt9p6CHQLKzQq4qjjHoBxYkXI+jrKWM9Ak4/qAiAFinhiU5qXjvC2WOC4vH871sDbpBU2BFn+l2VA7JYs2Q==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":794467,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfuEmJCRA9TVsSAnZWagAAZLMP/10lsGtCRpgiPkIK4bnN\nTRc93mV9r8Eaxc1IZxf7AbQYHTnoJrXwEK8y+IsysC5A4M6GukVwAoHomeNk\n43Z8kxEH7f8czvtJXHfEIdDH2reiIkP0ZBLDbzTMilXenXHJaLxCCT6/v2Tr\nDF9puJTWwAd3blAwVmNLwaqBx9qDgexzpIdN/cf5abfA7H2cfgFGgG0o9u+U\nmeYzPHP4dQA9y6cP33pH/xOo4ZNktrJHnJPxBkAwskfc2zB/el1YavkV+4PF\nc66UVdOc8j/YIBkWc/yehRR7WF9lnDK5JIIALcUlS+6EOZhIV1Ua2lLU8X2W\nNOsr+pBXWyHCAeDrefLlo3ONlzQKrpfZqyEv16rDe7rS7ZjamlIJWMwei3f3\nprAofl3OPwNd+PoMLGpMSjOhIjHeyO0fxPWAib3gO7RxGE73ck53JibKKdmu\nAsUJKqFNPnUz0wzPuBjGY6RoN0gz3DWyUEGLk+1FFymg2FynHWDLm/5SmaJD\nZuudq/AX7gZiZAMrdRBHzolTTmBQnU9HuGIg0A2qUsEBrsoBO4GND2xLZZRn\nKFj8rFFfVB1QMOgn3/vgrvgoLEWhBp7ropzg/G6ghNPKPT+onL39GHXtfGbX\nr3cpZ9v+PLwCovyMKGfx6LTpDuz4FcyAN+HKhK4wyW+E1eUJoIorpBxF0BuG\nn5WW\r\n=6ZOD\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is modeled after the browser's\n`<input type=\"range\">` element.\n\nSliders follow accessibility best practices per the [WAI-ARIA spec](https://www.w3.org/TR/wai-aria-practices/#slider)\nand are fully RTL-aware.\n\n## Contents\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders follow the\n[WAI-ARIA guidelines](https://www.w3.org/TR/wai-aria-practices/#slider).\nPer the spec, ensure that the following attributes are added to the\n`mdc-slider__thumb` element(s):\n\n* `role=\"slider\"`\n* `aria-valuenow`: Value representing the current value.\n* `aria-valuemin`: Value representing the minimum allowed value.\n* `aria-valuemax`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value of `aria-valuenow` is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set to a string that makes the slider value\nunderstandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"hidden\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Continuous slider demo\" aria-valuemin=\"0\"\n       aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"hidden\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\">\n  <input class=\"mdc-slider__input\" type=\"hidden\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Continuous range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Continuous range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"hidden\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"hidden\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete slider with tick marks demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"hidden\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\">\n  <input class=\"mdc-slider__input\" type=\"hidden\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"20\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `tabindex=\"-1\"` attribute on the thumb(s)\n*   `aria-disabled=\"true\"` on the thumb(s)\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"hidden\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"-1\" aria-label=\"Disabled slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\" aria-disabled=\"true\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the thumb element's `aria-valuemin`,\n`aria-valuemax`, and `aria-valuenow` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"75\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string)|null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"51086f360a63319c786c7b166e515a34aa76c112","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"9.0.0-canary.7b0e2b377.0","@material/rtl":"9.0.0-canary.7b0e2b377.0","@material/base":"9.0.0-canary.7b0e2b377.0","@material/theme":"9.0.0-canary.7b0e2b377.0","@material/ripple":"9.0.0-canary.7b0e2b377.0","@material/animation":"9.0.0-canary.7b0e2b377.0","@material/elevation":"9.0.0-canary.7b0e2b377.0","@material/typography":"9.0.0-canary.7b0e2b377.0","@material/feature-targeting":"9.0.0-canary.7b0e2b377.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_9.0.0-canary.7b0e2b377.0_1605912969184_0.030201498186512854","host":"s3://npm-registry-packages"}},"9.0.0-canary.c927a5d05.0":{"name":"@material/slider","version":"9.0.0-canary.c927a5d05.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@9.0.0-canary.c927a5d05.0","maintainers":[{"name":"taylorv","email":"brian.t.vann@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"106339dab00de49ffa43173682d4750dbd2d699f","tarball":"https://registry.npmjs.org/@material/slider/-/slider-9.0.0-canary.c927a5d05.0.tgz","fileCount":38,"integrity":"sha512-uZ3y0Ilx5T7heJaxG6yUYBIm+ilTQ0ulpkmksBZgrJ4QvMRnd++wFOpbfZasFHBB7neeM7h/P4bS2lmBfSLSCw==","signatures":[{"sig":"MEYCIQDEL49e0LZTBagGALF9Tw0OWOCyusJwbpgvynbpVjvpMQIhALjIDm6MLi0hJolMOE6ge7d/UDZ3C04b4D7K0BxN/CDL","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":794467,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfvBHpCRA9TVsSAnZWagAAAUsQAIphRpBf/leaGztJFJOc\nfVLKYSCWpyCpL1sWU1X6vhNHRtj56uO6IOOzZnqtU0+8y8O4Jv3qP5sMdoQc\nt16d8vMA3YSdzRehC4BAjQgjJnmQHKJWh6/NFYXsf0iOlt7Dk/wn+dgipKfV\ne82anRopHT3G6tKmSypam+m+iJcEzMuTdVZQy/EiLLilpzalajqpyOJuWHQw\ncy7rKnmOBMrmJaPJ0hCNZ0LRjDcwx1dEOrQyR8TqA1j/oe6Jixi3LFnui/ot\n5T/ZUGQbfE3ZvzOMP1SxEYg1F1Zr4zyVabFx6NZMxkKTcStpo4VJ+luM3ZxX\ni59DTdpsRHWBn+2arqkUItiRwmv7LGcpKt0qJAuuXSK0zO8CJj6KSBiVloqn\nizVMLQLE+ZpDEy4P57nGXWsmD1t4Z10hSHT8B0JEHEaHgKuRBdOF/ji2Nrs2\nK/o9J2BXMLQySkM4sWVrghpDBmDXF6csu3AWF7foKqLRPSZLmavkWKk9vnBf\n+PlVP9NKua67rkS+z/7MQBJU/RVIkh8HbPopXr/fkr9n9Tj4Z31qtEmyLgLt\nnDnB0Q7puIe+ulIQXNks5q87eLvTIlrsPEE98aB57zSZXN9bxSD48sbmeHei\nZ0HJJH1mrhR/7Da46aJBCv+HSBY1OoVTAJelQfh5ljQM2ebecOU/82me32s4\nw2Fj\r\n=eMUb\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is modeled after the browser's\n`<input type=\"range\">` element.\n\nSliders follow accessibility best practices per the [WAI-ARIA spec](https://www.w3.org/TR/wai-aria-practices/#slider)\nand are fully RTL-aware.\n\n## Contents\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders follow the\n[WAI-ARIA guidelines](https://www.w3.org/TR/wai-aria-practices/#slider).\nPer the spec, ensure that the following attributes are added to the\n`mdc-slider__thumb` element(s):\n\n* `role=\"slider\"`\n* `aria-valuenow`: Value representing the current value.\n* `aria-valuemin`: Value representing the minimum allowed value.\n* `aria-valuemax`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value of `aria-valuenow` is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set to a string that makes the slider value\nunderstandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"hidden\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Continuous slider demo\" aria-valuemin=\"0\"\n       aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"hidden\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\">\n  <input class=\"mdc-slider__input\" type=\"hidden\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Continuous range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Continuous range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"hidden\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"hidden\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete slider with tick marks demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"hidden\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\">\n  <input class=\"mdc-slider__input\" type=\"hidden\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"20\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `tabindex=\"-1\"` attribute on the thumb(s)\n*   `aria-disabled=\"true\"` on the thumb(s)\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"hidden\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"-1\" aria-label=\"Disabled slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\" aria-disabled=\"true\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the thumb element's `aria-valuemin`,\n`aria-valuemax`, and `aria-valuenow` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"75\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string)|null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"1e41eddb7d951c0eeca983e08e3fbb7b21cc3776","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"9.0.0-canary.c927a5d05.0","@material/rtl":"9.0.0-canary.c927a5d05.0","@material/base":"9.0.0-canary.c927a5d05.0","@material/theme":"9.0.0-canary.c927a5d05.0","@material/ripple":"9.0.0-canary.c927a5d05.0","@material/animation":"9.0.0-canary.c927a5d05.0","@material/elevation":"9.0.0-canary.c927a5d05.0","@material/typography":"9.0.0-canary.c927a5d05.0","@material/feature-targeting":"9.0.0-canary.c927a5d05.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_9.0.0-canary.c927a5d05.0_1606160872939_0.775276341179602","host":"s3://npm-registry-packages"}},"9.0.0-canary.b349b5185.0":{"name":"@material/slider","version":"9.0.0-canary.b349b5185.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@9.0.0-canary.b349b5185.0","maintainers":[{"name":"taylorv","email":"brian.t.vann@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"cb2a58ac8b8c52fda71ba3eebddce0aeb06427ec","tarball":"https://registry.npmjs.org/@material/slider/-/slider-9.0.0-canary.b349b5185.0.tgz","fileCount":38,"integrity":"sha512-GIV0f9+GtGV/RVOI1qfuR4O8OFE7iuGez2ILyc3Lt5GaPLkQlSVHIMKq+u1IPCGoOjEZBcaz82LzSbLBdAHHJA==","signatures":[{"sig":"MEUCICTn7DVPL2y/RFITunGGaiF97V0LT33q6MEGvBBVXedrAiEAsMtn8utAOb0GM3FjmO9eCAK4Ta6cMp4VJxwAwWgpzZ0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":794467,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfvT4/CRA9TVsSAnZWagAAGJcP/2bbCf8RuNyYiFQ8fdgz\ncfGYdDc7SDlfSv7jiKv4stBQ2nmrI+f5e/H4f0Vy7BcdWYuYSDgi7SgJxCBN\nnOfCxyk2iPSkhPv2FsT9TgjUh31NeQANR1V8jDO/7W76sJ+z0A8GAVOKgFpu\nFeqb040AZ4wzQXl1HYjDfbsB2TxnnIJEPFw0/0Jlrp4LitPpOtLqqCgrLcyh\ny+5rd04JGS5jldWJ/ctDD2xGL4p1U5GhnV6Ci/2817ERSaMf8LNX/QVki/IC\nbyISVgtpnEuUsm2AN6/HzlrurCfoxMBADCGZD7IfXsGKzSNPoaKz2KnPFLvJ\nPlnKq+2eZNEWAEGyybg6VZ/91B5QCvYLx/yOHottce5nuYlv24mt+TJqbNu9\n9nSKNGhG54CNWpYylO6HVIaTOSJwK5dN+qIzAZscUi/cURDCWtrULkVDdmzA\nLj07yh0uSfkfO7HcvUuWBNPdoIw72IIgmDpD3/fSp+ic5TARz+/zCG9zPxgs\n8lXnH5pf0soxU5E1YHMerhlFYSf4RquOHNydzXe+/PifeZNrEXHxLHJuXORd\ns396aS6ldDTPWt2ekiMgqIke9GnEqfSt3nm2I+o1MHzkQaVqYUx5H3k0rT/K\nV+RRCewil7wb6KV2UvYv9IJwcT1q20x7DJ9BikGebJ6Dbg8PniqJvk2SPFtc\nOn+c\r\n=1bC6\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is modeled after the browser's\n`<input type=\"range\">` element.\n\nSliders follow accessibility best practices per the [WAI-ARIA spec](https://www.w3.org/TR/wai-aria-practices/#slider)\nand are fully RTL-aware.\n\n## Contents\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders follow the\n[WAI-ARIA guidelines](https://www.w3.org/TR/wai-aria-practices/#slider).\nPer the spec, ensure that the following attributes are added to the\n`mdc-slider__thumb` element(s):\n\n* `role=\"slider\"`\n* `aria-valuenow`: Value representing the current value.\n* `aria-valuemin`: Value representing the minimum allowed value.\n* `aria-valuemax`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value of `aria-valuenow` is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set to a string that makes the slider value\nunderstandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"hidden\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Continuous slider demo\" aria-valuemin=\"0\"\n       aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"hidden\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\">\n  <input class=\"mdc-slider__input\" type=\"hidden\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Continuous range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Continuous range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"hidden\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"hidden\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete slider with tick marks demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"hidden\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\">\n  <input class=\"mdc-slider__input\" type=\"hidden\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"20\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Discrete range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `tabindex=\"-1\"` attribute on the thumb(s)\n*   `aria-disabled=\"true\"` on the thumb(s)\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"hidden\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"-1\" aria-label=\"Disabled slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"50\" aria-disabled=\"true\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the thumb element's `aria-valuemin`,\n`aria-valuemax`, and `aria-valuenow` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"75\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"30\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" role=\"slider\" tabindex=\"0\" aria-label=\"Range slider demo\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"70\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string)|null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"92e0cccba580778200706f15aef4e667fc007066","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"9.0.0-canary.b349b5185.0","@material/rtl":"9.0.0-canary.b349b5185.0","@material/base":"9.0.0-canary.b349b5185.0","@material/theme":"9.0.0-canary.b349b5185.0","@material/ripple":"9.0.0-canary.b349b5185.0","@material/animation":"9.0.0-canary.b349b5185.0","@material/elevation":"9.0.0-canary.b349b5185.0","@material/typography":"9.0.0-canary.b349b5185.0","@material/feature-targeting":"9.0.0-canary.b349b5185.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_9.0.0-canary.b349b5185.0_1606237758684_0.1304501179137747","host":"s3://npm-registry-packages"}},"9.0.0-canary.9083b7d61.0":{"name":"@material/slider","version":"9.0.0-canary.9083b7d61.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@9.0.0-canary.9083b7d61.0","maintainers":[{"name":"taylorv","email":"brian.t.vann@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"e125ff3da6b87dccae159a3efe53dc4aab97b682","tarball":"https://registry.npmjs.org/@material/slider/-/slider-9.0.0-canary.9083b7d61.0.tgz","fileCount":38,"integrity":"sha512-fAdOh+s13fAqsINfIkRQoqBx0pOx9Ys9f9Hr8RvekEh+UrLzYNWdGUq0Ka9F3AhTGLeX1t4b7UHQdXDay07Zog==","signatures":[{"sig":"MEQCIFZ0RzG3Hv3Lu6CeseV1Clscqs4RhRO5U4cevybn3BE7AiB9npLHTBdd7M0QVRGr2RJRnFiO29QT4rLzbX3fmnObvw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":781189,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfvXgvCRA9TVsSAnZWagAAcW0P/3Fjr+TgEvWJCqOAcySg\n80k+560W0J6LF3XccRKs3QufFVXY2L2gpmPbj8a+XTJr/5mjdGH3gU/dyWYt\nLX3JhqqZEFav1537MSKfPX8OE8ZuJuQ5XfT2TqWh3+22SigOdbdYrCzHWZ2Z\ngZCVr9Qp6K5Ludiovg6e3SltXrfSNHaCCHFaIkQoA8xU2QyhJ18H7py571Ty\nW5C6Y36gPXlXefAdTBSUti8pedxjcnNABXt4b4b95fGwG/d+lEs88g/NPpa4\nAN7RBo6CEoTatVCOo0v5QHyP6G/wKsZoa3jQFFIaxShBGfWUNoi7Ph+HcFvm\njY05a+tZu3w+AhS5UCBiwGFSvOJK28oQtyDRkJ92pWgL43e1IFZkkAYFLzEs\nm2U4APcZROFaU4Nexz0BrKFHPkJghPdd60Y3hbOgDB+WhpLRyAU5fQl5wh7C\n1x/24nTtOJjiI4H+58B+jwb8A3M9CV6hX4HLiuehBwiORgV799bnvC2YJtUq\n7/pMXfilcootffQxPw+BnPA1V7ZYUE6f4dbACM1/De4TlqjSEEIe6gSsTjJV\nqS4sznT60Fd2nqt3Ux50YKPr/xidY2tLM9HgQ41BNQM66ShCAOubthDU4Js8\nuuRVyKZyLxUDVd9kFxOzODmf+vrywHBSqSbaw3mnPJBnI9NYDMpZBOtwymxk\nFXwD\r\n=t59P\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n## Contents\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `tabindex=\"-1\"` attribute on the thumb(s)\n*   `aria-disabled=\"true\"` on the thumb(s)\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string)|null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"c6192773b6d2ce6a74a5b464d7df3e9b57b238d4","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"9.0.0-canary.9083b7d61.0","@material/rtl":"9.0.0-canary.9083b7d61.0","@material/base":"9.0.0-canary.9083b7d61.0","@material/theme":"9.0.0-canary.9083b7d61.0","@material/ripple":"9.0.0-canary.9083b7d61.0","@material/animation":"9.0.0-canary.9083b7d61.0","@material/elevation":"9.0.0-canary.9083b7d61.0","@material/typography":"9.0.0-canary.9083b7d61.0","@material/feature-targeting":"9.0.0-canary.9083b7d61.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_9.0.0-canary.9083b7d61.0_1606252591397_0.13013964556801683","host":"s3://npm-registry-packages"}},"9.0.0-canary.eff7b46ac.0":{"name":"@material/slider","version":"9.0.0-canary.eff7b46ac.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@9.0.0-canary.eff7b46ac.0","maintainers":[{"name":"taylorv","email":"brian.t.vann@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"a7474811eb014fa6e4be167cedc42b9296b7be9d","tarball":"https://registry.npmjs.org/@material/slider/-/slider-9.0.0-canary.eff7b46ac.0.tgz","fileCount":38,"integrity":"sha512-5JE446dBBHoPExz/RWRqw3tyb5I3ioOimPsB0TBHnQtv0fumWU197F4rVPRIsJux16UtGspyLWn3ShkgAa4ONA==","signatures":[{"sig":"MEUCIQDMED0NsFrPwNmBrcq80eFrPE/77WLPFpr2H6PIS59iSAIgd3U/8J5lUsau5C6VTy0LYxad3dV0T0mBmQpE6DyAwZ4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":781189,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfvZfNCRA9TVsSAnZWagAAIuAP/0DuzW/r6vKBcL3AmaHG\nU94CHA7yWVUYd1IhvUUtMc/lo9+D9p2/LJvTLEo8ZZqlOZ44h7Au7c7g2ZM0\n1PS5IDeuiHp6ItnpyAFxRKHfpZV1L9/k7+LvUprr3h9MQuopHTQAFLzyO8G9\n1jl+J27UfDZIJIzdWUuk24SXIar59bPE22IKhSRaMhMzbYIkgGy/56L4wycH\nd4S1VlAdNlfrcwTGqOikEp1vbAEApXHB36YUdMOIsHYljBkfFOeNju4D3cO+\nnld3Wu4qTaM0SJrIdwJmJVWi+xMQ3KbPAb8TS+ILQEQggWlO5En63U/E7gVq\nRYKkpKn8idtxnNYmEzJzp4jWEM7WbJjMCaVo43nPBN63J6jl06AvayT9P61D\n/B0lmW0IPWt+/cxqb7vuIUeEqhfeWo7d22vGlhcgS3TtiRIrkLOG5re6OOiv\nRNAmhITcpxofOtsi5Af9kRr1mGquZ49sibAFdEq6xGV53FMPHMfDK26ZVglV\net4/72kKkTOobwa7yi93htsM77wesaTRGAVi6+MV4oH1aTyOvwlBjHRGGmtM\njF/+CF+gFb/ofQSDV7+Oj0ZknEcQpMSu8LVcuHXxdfgqRSpo32XNcdEZiyRs\n1JSUqvHagg8zryIjYMNDUtsXikU3G3Kh7Fxs2Xb1CaLOFhpQaRNmqa0dwexs\ngRBO\r\n=iCK5\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n## Contents\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `tabindex=\"-1\"` attribute on the thumb(s)\n*   `aria-disabled=\"true\"` on the thumb(s)\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string)|null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"b8790bb41654e5c7f7a7725e8e58c9dd08551129","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"9.0.0-canary.eff7b46ac.0","@material/rtl":"9.0.0-canary.eff7b46ac.0","@material/base":"9.0.0-canary.eff7b46ac.0","@material/theme":"9.0.0-canary.eff7b46ac.0","@material/ripple":"9.0.0-canary.eff7b46ac.0","@material/animation":"9.0.0-canary.eff7b46ac.0","@material/elevation":"9.0.0-canary.eff7b46ac.0","@material/typography":"9.0.0-canary.eff7b46ac.0","@material/feature-targeting":"9.0.0-canary.eff7b46ac.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_9.0.0-canary.eff7b46ac.0_1606260684746_0.38614325346770983","host":"s3://npm-registry-packages"}},"9.0.0-canary.ae27b44b0.0":{"name":"@material/slider","version":"9.0.0-canary.ae27b44b0.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@9.0.0-canary.ae27b44b0.0","maintainers":[{"name":"taylorv","email":"brian.t.vann@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"12512bf921f337d9ccae9c9391ce9a49e49df95a","tarball":"https://registry.npmjs.org/@material/slider/-/slider-9.0.0-canary.ae27b44b0.0.tgz","fileCount":38,"integrity":"sha512-up1thn74EtN+YJHTmA52uJsBqcObJFwUHRdogUN7unYoyV1UA5TjUuB+0IIuoJoo5p08LMJuna2qX5ZFzAUryA==","signatures":[{"sig":"MEYCIQDMhv1Anrq1F3NJgIg5/Ycl8OctOxus2C30I8qSCe2tZAIhAOfF1aZ5o0BXRRmKTzjS2iB3WDhuQhrACWfBCDJ8HOyR","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":778254,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfvnlcCRA9TVsSAnZWagAAnr0P/2VESWS4XuKXTYRFi5Td\n/f33u/l/br7cKnUFRoNMFXrtclX/iiv/urdhU8GfeLNAu9KiWApHLq2A/Eee\nOlKYoERZqppy6s2JBWcJm3L2D0spP9nmA9HL/QU6tSWexN5hVMqOVr2BYxqU\n7TEQ2qBD+YGGpz1u7YqAqz2eb624fxjiyDA7gkkfy3XYvuHUxP+GnMpG4Xiv\nMm0wAwhNvbjg1xsrRecZe0oGQtnLai0ZxC2LfUxA1+gU2PjxNPIZ5X9ZkY9R\ndHhnMU39gyC0ZSUOmcwhsHGf+WrRpwXoAR6N+WaVVjki1K/TD0fxauY3TBOc\nZTOqMoN7JAy5MPmYyOagbSM3vARiDEh0iAFKRS402wJUurEKg4TuGQCHXvIj\n9+lP7ffmf+vESNdbmdEsn2sCK8vhvLgVBWC8afu8HuXQd2Kzyq/6vOFIX4Fb\nDgpIFDJ1F7lvEkKJhzifbwFQGThOEgVchg2dvr5Z1out7T9VufJvjogf65hP\ndCR6UY8PjwIUFwV22yva8G6lg5lStPgEg0ZAutM0plc1wY4xFGZdu5NKSXry\nR6swJ+rb6LgxQY9ZRziuTvYXR1Py8zwSkvzp3zpWUR3xJEfdxFzzy0mOiZMw\nsuNFx0n0YpcNtjSDuempVkqrpuU8WfsGCxgQHfdcPKMHeMEQ5L0yrNY68vfd\nkYzJ\r\n=UNIg\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n## Contents\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `tabindex=\"-1\"` attribute on the thumb(s)\n*   `aria-disabled=\"true\"` on the thumb(s)\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string)|null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"eb690fa0e9558b61ded00dc6e4b467cbeaed4c4b","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"9.0.0-canary.ae27b44b0.0","@material/rtl":"9.0.0-canary.ae27b44b0.0","@material/base":"9.0.0-canary.ae27b44b0.0","@material/theme":"9.0.0-canary.ae27b44b0.0","@material/ripple":"9.0.0-canary.ae27b44b0.0","@material/animation":"9.0.0-canary.ae27b44b0.0","@material/elevation":"9.0.0-canary.ae27b44b0.0","@material/typography":"9.0.0-canary.ae27b44b0.0","@material/feature-targeting":"9.0.0-canary.ae27b44b0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_9.0.0-canary.ae27b44b0.0_1606318427486_0.9822922843931312","host":"s3://npm-registry-packages"}},"9.0.0-canary.2fbba2554.0":{"name":"@material/slider","version":"9.0.0-canary.2fbba2554.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@9.0.0-canary.2fbba2554.0","maintainers":[{"name":"taylorv","email":"brian.t.vann@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"470d686df973e46321aacfa3e36a49b56663426b","tarball":"https://registry.npmjs.org/@material/slider/-/slider-9.0.0-canary.2fbba2554.0.tgz","fileCount":38,"integrity":"sha512-Isr2dwKd3iuSWEPugq9WMbo8ne7lmLVWzpU3cThfbbyiAkvwQPRj0MLuDA+YNwJc3R/EQsKu5H3rPXR/630w2w==","signatures":[{"sig":"MEYCIQDJDULD29sRYgH9dqDL+80wxho6v2VD8wj4IkBsvIe/zgIhAILQ1xr8umZI1KdhNjmcksCQCehD/xSfq/7SDHxx/x3M","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":778254,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfxS6eCRA9TVsSAnZWagAA9IwP/3HFUmB9rTjhjMS+8rQe\njNQn7M3dvoGZs0utItK2TI5P9jfLYrbFUMNAfpx+SfxJ/ZEbc+7NdfQ5jn1z\nyB7RKlfwqJiDOQhs2B6PsqLwNcfo0Mv51YqH5JMInwxcRIiOcqnuGFSpya0g\nCP7W8FjGlDJd8szcxQdzADSc4b3UySCRISPd7IvRH3rNZoZwprRiWOFxQZOo\ngrcrpwQgzCbzv/8cy7wWRAHeJcV+XGmjbk0hB/PFe7cL/HdqNd+a/p8XOFDY\n/HxBJqSv5ntGtJ/cTQfGePk6GOxD4MSxTPnAubLPPHq7sf779RzVcl2ICfy/\naM7ReotmicmAbBqMyg7JneXF6kkbh0x5eoQDyDjH453uLOdDKAFV3/TwBm9q\n44qEGHNJ5BY02q15gz5Qb7Bwr8DCoPKXaovpy/EbvHj1LeHdORoejq3LFZKG\nWvuaXqs3abO0gpmlsYJBRVWyQrE9+bC6R1azne9qz8ArJp5uQbbY6ard1T/q\nURIAUDQ8T6TDThNm9wedZ0SZqrK7/AyDr81zn8Fbxwkr1/IbyEdkp+DbbsXM\ntFCoejF7si0kOc6Y5KwooYoqS2AXrqCoFl5udGF9lQTtmHNLGemc9pCKHv3z\noUHJs3smNuARlQXd2o8HB3jKfJsLS0IuLuYSgguokcvub8woDDvkMEy/yNWM\ndX4b\r\n=Dgo7\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n## Contents\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `tabindex=\"-1\"` attribute on the thumb(s)\n*   `aria-disabled=\"true\"` on the thumb(s)\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string)|null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"93356628825eb23bea706adfd527933f0c5e430d","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"9.0.0-canary.2fbba2554.0","@material/rtl":"9.0.0-canary.2fbba2554.0","@material/base":"9.0.0-canary.2fbba2554.0","@material/theme":"9.0.0-canary.2fbba2554.0","@material/ripple":"9.0.0-canary.2fbba2554.0","@material/animation":"9.0.0-canary.2fbba2554.0","@material/elevation":"9.0.0-canary.2fbba2554.0","@material/typography":"9.0.0-canary.2fbba2554.0","@material/feature-targeting":"9.0.0-canary.2fbba2554.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_9.0.0-canary.2fbba2554.0_1606758045536_0.5470098471421998","host":"s3://npm-registry-packages"}},"9.0.0-canary.6d8574fe1.0":{"name":"@material/slider","version":"9.0.0-canary.6d8574fe1.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@9.0.0-canary.6d8574fe1.0","maintainers":[{"name":"taylorv","email":"brian.t.vann@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"0fa6ad36d6fa81859e0254a4956dff62e0f70877","tarball":"https://registry.npmjs.org/@material/slider/-/slider-9.0.0-canary.6d8574fe1.0.tgz","fileCount":38,"integrity":"sha512-C7MxJrQjIwVCKFaH+YDla266f8Tf9wL8KWwzTYGMA6/Dv7XatW+Jcvbh8zudq7NtqhI2EYcS7khAs4Rl0MSq7A==","signatures":[{"sig":"MEUCIG1xNTN8L2f1WLz5Hm/TPcf+QGbSNrOSlYT/e47rzEghAiEAki2GJwtsiXfy0SKJWEOvXJVzcwbqFrCcy6SswZzuMcU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":778254,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfxTExCRA9TVsSAnZWagAApT4P+wbJuHOirEt/zaLyIOOD\nuEwZx2TX41uSZS1C+QY62KiqydfYZKs6572AXk66IzxDe2hUlNN25Q3V9uDM\nazvfARaEKipv/RV013/EFCjgnsScUpfk0mn+CmNTlbe7EBU79tjPynjlIleO\nzr7kC3akix6KhVzLlCkZ8nX7zeVYVKtRv7Zg2umOgaoXNUBL1opn4QaQmNWh\nkNy59AsFtim3BZ8PXOsHUJr4skZ25HgoYU1OD9qEuF6aCkfQa44KqYN5Pi2m\npws8Hdl8BSS5JEsyOPrcJOcVhJd4UZKDn05LhCddlk++rgYpZxYTRmThq5SD\nKZXM0i7+RzhDQOajBka0vr60/QmqllTgx0jCKvtOtXEgkOSp85K2+biAvZ9U\n6XrwXiLk2N1dPRsWtQwBcMqK8FuQEhtfi5mXxUAMa5cmEytfZJfe0/TDkANn\nBLx2eDu9P+gDQGnvhpgJ+mMs66kCbTxcPkBnIZ0lq9w1EwYlP7SsrodPtxQC\nqXyaNVbYmtyC0xogyZ1CggQUQgU0ZXiNqJ3hSCHNhZZgjdCB78mgYorbizLz\nxmNn+A/UvU+zAzS8fYbNK+uBgR5+zyq293aszHAXEbwVCNcw9rk71CPYrfeC\nsozU6z6r4VsBUjjYFF348J73RkfdFNd0+F2pMmKOtErecFvV3Xjmc3keiGzh\nASqi\r\n=7zPB\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n## Contents\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `tabindex=\"-1\"` attribute on the thumb(s)\n*   `aria-disabled=\"true\"` on the thumb(s)\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string)|null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"b98a165c81d2497f6c0e8e5652743d71d87029e3","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"9.0.0-canary.6d8574fe1.0","@material/rtl":"9.0.0-canary.6d8574fe1.0","@material/base":"9.0.0-canary.6d8574fe1.0","@material/theme":"9.0.0-canary.6d8574fe1.0","@material/ripple":"9.0.0-canary.6d8574fe1.0","@material/animation":"9.0.0-canary.6d8574fe1.0","@material/elevation":"9.0.0-canary.6d8574fe1.0","@material/typography":"9.0.0-canary.6d8574fe1.0","@material/feature-targeting":"9.0.0-canary.6d8574fe1.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_9.0.0-canary.6d8574fe1.0_1606758704474_0.5873724589832219","host":"s3://npm-registry-packages"}},"9.0.0-canary.fd22355f7.0":{"name":"@material/slider","version":"9.0.0-canary.fd22355f7.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@9.0.0-canary.fd22355f7.0","maintainers":[{"name":"taylorv","email":"brian.t.vann@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"38fccbd61b7e11c8a94d3953bc5a36c8d31e7965","tarball":"https://registry.npmjs.org/@material/slider/-/slider-9.0.0-canary.fd22355f7.0.tgz","fileCount":38,"integrity":"sha512-4R3oK6eGL4qFEb13oh3p7V0UYKxkBJuN0/cCqzP6sly2ww68ITbmKZInwprPf8u7cSPC9PMkXsDM3wWazGdqpw==","signatures":[{"sig":"MEUCIQDFtxG6X08SS6tGj0qiD782AovGpxmY03etDFDw9V+sZAIgKaH5Ul3vs9KP95wMPb1/sjgUkDjCajfeXWfeQXWhS/A=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":778687,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfxXltCRA9TVsSAnZWagAAdv8QAKE5GeJmL41ge+xFCM5a\nFF71U274gCFL7teWZV2/89Z2j/CfAm1cfyYlItNSeNpeoLrztDglvZatBOM+\nSB3tOm12qZ+PktfP0o+jaFV7kWqP4ZvOwxw3pcZ7NVJtpVSQJWl/F2Qcs9L0\nWyutAEA/JyhSxOwG5tKAY8Jc6qI+Un6IMIYXfgv/HiJz46tCwBWU9J4rPOZT\nrpLPdT0+9MdTiDOquXNvOosmp5+SzVND9U0oXXLoZ//8EEmm2e1bCGh0V+pP\nXcEgawlVJ8dpi5jG8X0ooG/wkNQUAEb6iCELCVVePivdetq80zMBtx3N/AHj\ncmEc9XeF1o/UvYaZnTbsbX2w3WOTViIJiggPrp76IKPiIIyp78nWkiQoXVvw\nag56r9/QTxp2uUg6qMfsE52+9usk499VdzOGsTpHlrruiyq3iaBChjL/ZweA\nIanopSJgx9rDsKPyM7H/XkViYRtGrHoXoLOEii21jQbJAhyGXvYR8yv/9wkr\nOxwfPuHrQJZ9HFH2Cz5rFQekXhFguKOkBXFTz0lwFqPnLS1aIpGUJaYntxsJ\nc9+WKRhtTrptQtlnrmqdDrx888/uQcRHGgGHtM6LynTyB6wM3GRsSWNkewkJ\nEE8wX1JaqwChCp/NdAMZcfWxrCC3BTa/hMQdM3kMqJqCNbWPXNpw3dsr/54d\n8WnW\r\n=oc0U\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n## Contents\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string)|null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"86a40292baea3adb58a6c26ed8c68a9a425cef18","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"9.0.0-canary.fd22355f7.0","@material/rtl":"9.0.0-canary.fd22355f7.0","@material/base":"9.0.0-canary.fd22355f7.0","@material/theme":"9.0.0-canary.fd22355f7.0","@material/ripple":"9.0.0-canary.fd22355f7.0","@material/animation":"9.0.0-canary.fd22355f7.0","@material/elevation":"9.0.0-canary.fd22355f7.0","@material/typography":"9.0.0-canary.fd22355f7.0","@material/feature-targeting":"9.0.0-canary.fd22355f7.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_9.0.0-canary.fd22355f7.0_1606777197128_0.38538700053090924","host":"s3://npm-registry-packages"}},"9.0.0-canary.c4ab98722.0":{"name":"@material/slider","version":"9.0.0-canary.c4ab98722.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@9.0.0-canary.c4ab98722.0","maintainers":[{"name":"taylorv","email":"brian.t.vann@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"21ee1f02bbdb9dad0370e68fbe193d28fdaa6fa6","tarball":"https://registry.npmjs.org/@material/slider/-/slider-9.0.0-canary.c4ab98722.0.tgz","fileCount":38,"integrity":"sha512-mIGfcD69bUPa1UAwp8UDvRxJsuktcuNQvQiQXonn3YpWz9KqAyndMmEo0Sxt00S5R/tXFcej6p0/6u4eHRoFig==","signatures":[{"sig":"MEQCIDutz4R+ch8ypk66M/x2ejKC8NiZaCW9xuS72co4AHIsAiATRXGb14aejd6Tm0HARs5QZbGa3NvqRaB/NrIiJL3BAg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":778687,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfxuZfCRA9TVsSAnZWagAAccMQAJBMJA+tYuuMaF4L/B7s\n2mvBUQPJTyKvNWBoCQvENmG1Ppv46R0EdENtOZDH2Q5D9Q+CWizM65NgLwbG\nblPKbSUBibqAJJ8BA2WepOgvFUGgrCkXt0Vnl/437pbZzQqYVhld+uctm3Ac\n6A+KFRK1q7W2RGijyHD4PjVZ9S3deY+ugwPYDjgVU5zH39nAMqRzqoZD/fOJ\n3pDKCJGPppUn7GoqiDVIx/vKX2dPS5t2uSlYvW1HZ5XvyFRmotJolF1/Wcw+\nx1ZYkK+f1AVfaim/Rp8jSK4IBC7pCa+LglLnde6E6P02S7vCDFwPv1Cmt443\n/RyuGhoZgzVyJeqFCN+u0V2mIrkG9CP6LuuI+EZlDuQuVoZmX6yMZcsS+MZ6\nPcJq6EUQSodvL8QXVVpyn7i6+x4WyjIKC/v3zh4fnoQbCLiygUyenFGdDgR4\nhfZZaCzX3VYHgYChJdOSkAwXl0jIueTlW2Puyr0b3eSmMHjYw78XASlwfyMY\nc9zT3b9k01MDRbFQkd3O1E6HibZJqB9cyzjh+SkAXAGZ1InhAVtmJECkvnzA\nHjpJcgX7NjgW6Tv/tLVx8GoZ8J36BM/+AdofoTRUtBYFb539Yx5lzd2uxgSP\n77VeV5sT5L2c9Hxxkg0553N3TZon10BPcam6QK1puKtmOLn9uGe5dXeMzbCV\njtMO\r\n=jTLm\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n## Contents\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string)|null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"e6187eb74996c124e1abdcea72dfb697bdb1820f","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"9.0.0-canary.c4ab98722.0","@material/rtl":"9.0.0-canary.c4ab98722.0","@material/base":"9.0.0-canary.c4ab98722.0","@material/theme":"9.0.0-canary.c4ab98722.0","@material/ripple":"9.0.0-canary.c4ab98722.0","@material/animation":"9.0.0-canary.c4ab98722.0","@material/elevation":"9.0.0-canary.c4ab98722.0","@material/typography":"9.0.0-canary.c4ab98722.0","@material/feature-targeting":"9.0.0-canary.c4ab98722.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_9.0.0-canary.c4ab98722.0_1606870622852_0.1516336600689452","host":"s3://npm-registry-packages"}},"9.0.0-canary.977585650.0":{"name":"@material/slider","version":"9.0.0-canary.977585650.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@9.0.0-canary.977585650.0","maintainers":[{"name":"taylorv","email":"brian.t.vann@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"b69f3cec864ed97331b7b0b2ed423dacb72bd912","tarball":"https://registry.npmjs.org/@material/slider/-/slider-9.0.0-canary.977585650.0.tgz","fileCount":38,"integrity":"sha512-p4rmls/lmQyQWivkXTyfxK9ZnSv8P3fYfd/Z59xcvfU3ItJWjWJUFGzRzmtmMsmQVBi7Zk7fTKF6PA6W4EvulA==","signatures":[{"sig":"MEUCIDEWRP9553+Z3LvY5E5Qpgfl1u12cQ0D8AYnAEcXS0RJAiEAxWcAbheZyjvxUhREydIpNnflFddSLZYp3ZyzBhexlgo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":778687,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfx6fhCRA9TVsSAnZWagAA0T8P/RWVuMWK+GIn8JNCG6xn\n3LBR2dmx6pxotLMG9/pHYJbbNUDsV6gJqgDZFfYt3HSIJTuWQcRH6eKXtCBC\nh/ba+86LRfKrK2BYx+1eH7+q1B3/PzrNJMoxSnApfCRAPx2lqQTlzwRaE3KZ\nWTt2fo6R73vuHT3yBY3zUXbEkMeCyJn8LeKXb0SpYhE0+RLNmPNa1bgu81CN\nLERLKL1wnBzZ0QAo6B2+TcNC37E4+P27OKi8i3J1khep6LOKC68HCUURUkyM\netyyzX6EQMWw3TnK2jAglSuYXN9J7jSHvONymdYZgW0IxX0seQqrf2Zw+E6c\nbPRbI6uaKPsATUtke7UeI1hsw5WMFHB7LQqCSl1fLIfKKRKTq0JK0lWQxwJZ\n4stEbi/NafEIce3n0aJVhLN+GEXeNqFDRvheJQcongqml9R5yggg+pPdwIVG\nSiqdwPa9b6Q6LcNIABO2I8a/NLN9aWF8NycXWux3Wcdlqu+IuecAFviwr4Uw\nWdp+xN5UZ+sWnDw6NivT5O5dEU/i9gLWfPs6+Bmu3HtubSZv8IU9v7wDgRAT\nSi8PaTkFdGgp/cpVovpwMYFo5kN7LqwFE/+3D57Pzu00iVQeaJe41KE2SuXT\np3FWgb6YJrjATGfR+ISaHqm+izlsPSsK+lAwR/SmYWj8Q5SoEKUYOlb3xJKn\nyP5J\r\n=yixe\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n## Contents\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string)|null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"b008ede8c0d581314d3b967bd295990ca8eee38e","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"9.0.0-canary.977585650.0","@material/rtl":"9.0.0-canary.977585650.0","@material/base":"9.0.0-canary.977585650.0","@material/theme":"9.0.0-canary.977585650.0","@material/ripple":"9.0.0-canary.977585650.0","@material/animation":"9.0.0-canary.977585650.0","@material/elevation":"9.0.0-canary.977585650.0","@material/typography":"9.0.0-canary.977585650.0","@material/feature-targeting":"9.0.0-canary.977585650.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_9.0.0-canary.977585650.0_1606920160869_0.37759117477516124","host":"s3://npm-registry-packages"}},"9.0.0-canary.c7edfc7b6.0":{"name":"@material/slider","version":"9.0.0-canary.c7edfc7b6.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@9.0.0-canary.c7edfc7b6.0","maintainers":[{"name":"taylorv","email":"brian.t.vann@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"2722b00a55c634c8e03e56a0e3b4d243e32c3765","tarball":"https://registry.npmjs.org/@material/slider/-/slider-9.0.0-canary.c7edfc7b6.0.tgz","fileCount":38,"integrity":"sha512-RnNZkqZ3qSZsX/ZF0KbKR4I/GRrrdj+zQ6iihBDDi/frXZLC55b1JG4pr9GVDQKF/TX4bCm5IBXIoodklwNNOg==","signatures":[{"sig":"MEQCIHNHTY6BAHzO6mHxdOoBstOHdEeJPa3Bx0bou7tmtqNOAiAs+59Z8Cc7wcbMr8nH69yHRPfOj9KjrcOo3bzv+zbsaQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":778687,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfx6maCRA9TVsSAnZWagAAKM0QAISHffE8QDo3kwyZJZF8\ncJrpm1ZP6fkUTc+omVvHRW93N7tcgFwONZgzQMTJ2Og5v9xa2qcJSgvkzTCn\nVTr2FRlUkpgKfNiIjQpl6a/Bsuwbtpu5j1HlOw3ejy1VZWJbkkbiQvw8EJax\n81zceAnidtPiUO0qSY/rqO0rdGT2ng3dLz3yX+fkdAYGSjhXQoCIL0uaoI7E\nGFRQbIXVPXPuZAulyZi6NoRSfDn+kTC0NnhtvsmEjDE+ePhIGq06q5KpD3kS\nNPVpJGQQ/AiiJNra3hwXGo+KvFbLl5poaqHXpVe+R4AC1sf55N6z0K9tElXG\n8v1xpqLSZaSIcRtMXZDAkldSe1AMnRvxACIseB0L+rI/mMQscs71CixMsLEt\nyuxkhQ7l0xS6Ntp2DZl230+gn4y/ISm3X0Hv8/MZxP8TdBU4HLslYIEl0vIt\nJyQIKoo1q4bNIY089HoqHo5DXVRAUdheUdYSTTYNthTL0OqxHwThkD7B347z\nW3oi7/KfhOSd4BlYcesiOaASxRSL0bQlF9BJwPz29rOHH9Yq2WiluQOXdzuB\nmgg4hUCRHM3+BElepwY+tWWf0ZCIvEj9+m0DI+xdEPx1Nmab7QrpwEdFHg0b\nw6d57zF3FRJZPSO2PqJwmBVihwNfVIIwMMMcN3eKzJFd9ABS6DjeVuiP9A05\nSKz6\r\n=YL77\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n## Contents\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string)|null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"791973660a1d63a77aa10d2bd0df7c0e6ea94698","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"9.0.0-canary.c7edfc7b6.0","@material/rtl":"9.0.0-canary.c7edfc7b6.0","@material/base":"9.0.0-canary.c7edfc7b6.0","@material/theme":"9.0.0-canary.c7edfc7b6.0","@material/ripple":"9.0.0-canary.c7edfc7b6.0","@material/animation":"9.0.0-canary.c7edfc7b6.0","@material/elevation":"9.0.0-canary.c7edfc7b6.0","@material/typography":"9.0.0-canary.c7edfc7b6.0","@material/feature-targeting":"9.0.0-canary.c7edfc7b6.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_9.0.0-canary.c7edfc7b6.0_1606920601381_0.8295686890532759","host":"s3://npm-registry-packages"}},"9.0.0-canary.4f3347306.0":{"name":"@material/slider","version":"9.0.0-canary.4f3347306.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@9.0.0-canary.4f3347306.0","maintainers":[{"name":"taylorv","email":"brian.t.vann@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"3447aaf5ba7d4c0b6114f28e3514568c1bb54dce","tarball":"https://registry.npmjs.org/@material/slider/-/slider-9.0.0-canary.4f3347306.0.tgz","fileCount":38,"integrity":"sha512-L/SMIJCZe4itG+Oc577/OjJwKUUFh9MJvNjKfv6Pac+hHQC5SKKqAuLjO96BgnNBIelkUrrpZ5aHKEEMk6OXrg==","signatures":[{"sig":"MEUCIQCzThvLZEL1Ow1GP+9XeWKsn5s9+fs42r8qqErWrQP4fQIgVOoIfnmiddOnEHhatbzvnOKWx0ir1KgAJd2us0uYYjo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":778687,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfx63MCRA9TVsSAnZWagAAEyoP/106BhYEPy7d1qvvcJZD\nbbZOhn6iNNl6eVOLPT04S3vNMBh024OP4hcM/FtSGUwwcCmvI3tqGKEQrh9u\n6lW82XmxG+ZNzKy+/AptI9slTnCpAnVy96nK2dAWa+hIkxmAATi+lahzmMdP\nqQHyIhe0y0If9/cItkTU1TJkq1fjlS7fRW/18Zxfncwwh6oS0wV0Xz3NBdzD\n1mBoVapWpTXs6fZC2wlQEP4sbccpeSGMhKN55GhnYw+ifFMQv1eDNq6UCxgi\nN5O/ASMYr78b5a7AnX80oi1qPGi3jq+ejpCQDoMR8y2sFdoxPjT/E2oYQz7g\nlJXKy/MLP6EEhOX7kChe4lAK416KpklaUw7mraUDFNHKdKyweffGZMnvOBng\n4Tb9ioeQ1steDONXQ8z+0V+krl4FeHDvDFuzsrKlSvBYBeIdcPC2sq0sT/pA\nhzWFh1RQU97oWypITILwcsGSai8Zx8nchBMhhbLf8cym6P1GlGDKzBWNUyxS\n396l9goB2su4Ls57IUdpv//Zf22jjRgjzSQ1cbfEVwrCanNxgRoeIVIs4U0B\nWpJy3ibQTDJyOmuZ3EDvPrib9b+a20c1DcArNab4NRqFJgS61lxOn+vxBq3r\nfbSt0cXTA8grj92VQDvNLEPub/mlbUxo2iJpszeXp34sV15PmHUZwPgzr/ow\n/SHK\r\n=l1mL\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n## Contents\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string)|null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"31d08595c0470096709a4d5518ba7444313882e7","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"9.0.0-canary.4f3347306.0","@material/rtl":"9.0.0-canary.4f3347306.0","@material/base":"9.0.0-canary.4f3347306.0","@material/theme":"9.0.0-canary.4f3347306.0","@material/ripple":"9.0.0-canary.4f3347306.0","@material/animation":"9.0.0-canary.4f3347306.0","@material/elevation":"9.0.0-canary.4f3347306.0","@material/typography":"9.0.0-canary.4f3347306.0","@material/feature-targeting":"9.0.0-canary.4f3347306.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_9.0.0-canary.4f3347306.0_1606921676465_0.4988977254581932","host":"s3://npm-registry-packages"}},"9.0.0-canary.37fbae10d.0":{"name":"@material/slider","version":"9.0.0-canary.37fbae10d.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@9.0.0-canary.37fbae10d.0","maintainers":[{"name":"taylorv","email":"brian.t.vann@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"5dfbb74abc36bd89528e9a36878be9b6581d3880","tarball":"https://registry.npmjs.org/@material/slider/-/slider-9.0.0-canary.37fbae10d.0.tgz","fileCount":38,"integrity":"sha512-uFcb2Vfgq7n5ENnRhkBpl9sNYQiZpe5UOG90X39V5Dey3tBMYene3ZETS1NFvwTbuOHLAhrsDFTu8xgVwidz8A==","signatures":[{"sig":"MEUCIQCdYfKYitAX+CB1Mxnfm+C7pBN+tELi3x+f39BQzFGdRQIgcVrOUMQT+UpEXiJgaCzFiATRb+fsASRy04jMzf1L3A0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":778687,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfx9oYCRA9TVsSAnZWagAA91EP/iKQyG/N0ScHcdTvQ0fp\ndjjKbfd6rd8lh1N3tO76f5mzSvspsaEnUjsa/gT6sZhEotbBjaxw0UMwgAc0\nHCTmjuLUDyeiQe1YEJ38rVncNcwh50z7lsbJPZwvujnOMMUWyx3qG2/FCQz2\nsVUAw5MRk4Ru/FYIscAPorqfo0eGCinTvZRph8NInwtsjJXtem5rx5PZFK4z\nANlMk94QTzPK0SfxZ8a5nW82iyMYgsfR1qDfIz9s/qLc/GDln0EpSm+eJwrs\nBOot0zQpd/2kkf9UrGP+RMHAFKdP5kI24DaWBB/7aLfXG8+OQyxFlHaZebTl\nYIKDH4GqbWb07f+2gVZQmXv5u74RjhzxaPWKMOofZDfdRCOrhFMHesKkzFjK\niSgwG3e0yirg4gRHi4xgqbAUetUAIvzWch9F00xAjSsVEIvmMMNq9chTAxs/\n75t7nwkLeJikB1mxjwWIfNAmUkPNbb49nGeiOAae2OtZMjzRxFLrAEY6yo5r\nG8LRXJJsjQTi1tgwVMIwTvYIM/tu8h4Bl86aQ5nvpl3DBluHJB0601KaWQZv\nfy7R3SwqILUcvZp/qyv635Ly63SDWBJDIcyiL/Sc0ilJPKlrkQCJPP4znotB\nUjSzZXgBpwz5Cx8RBMdbrYD0uvvAev14aZ4oYu619MzSiC1SYGup2LqpMz8g\nQE2X\r\n=OQlI\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n## Contents\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string)|null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"104ddf5dd99e7bc09a57e2cae74614b7726fa235","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"9.0.0-canary.37fbae10d.0","@material/rtl":"9.0.0-canary.37fbae10d.0","@material/base":"9.0.0-canary.37fbae10d.0","@material/theme":"9.0.0-canary.37fbae10d.0","@material/ripple":"9.0.0-canary.37fbae10d.0","@material/animation":"9.0.0-canary.37fbae10d.0","@material/elevation":"9.0.0-canary.37fbae10d.0","@material/typography":"9.0.0-canary.37fbae10d.0","@material/feature-targeting":"9.0.0-canary.37fbae10d.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_9.0.0-canary.37fbae10d.0_1606933016034_0.8260344430965447","host":"s3://npm-registry-packages"}},"9.0.0-canary.11da3c0db.0":{"name":"@material/slider","version":"9.0.0-canary.11da3c0db.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@9.0.0-canary.11da3c0db.0","maintainers":[{"name":"taylorv","email":"brian.t.vann@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"4c68b74b9283e1d1099cc8208b953d8f4f1b1961","tarball":"https://registry.npmjs.org/@material/slider/-/slider-9.0.0-canary.11da3c0db.0.tgz","fileCount":38,"integrity":"sha512-nljtqXT1+ObQFIKR/Yj39JfwMHxy0qFZ53IUfJkcP7jPAI+Av+uyQoZJsjX2TLZqxv5X6g/z6vOEMkvW/DpzpA==","signatures":[{"sig":"MEYCIQC5ZyaS9LtfJBlAsoLcMxm53Tkp0b8YdDr5ObIpPlHoogIhAMtUyai/TOMu8UGuc+AUTj5vhycKXmLHqaTOV4Wl0VIG","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":778687,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfx/ecCRA9TVsSAnZWagAALwIP/0vWolftk+En9WaduNv1\ntJYtoErq0m1bfJ6xgcuMfwSgEyxy3Ocq2pyq9JpvqmQqVKDrIhX26dUcCquy\n1nfR8tFlF3cY3px0RU6v30990CMaqbPTYk5Yj76iAJPpSYr+TXMnLeDUZNmP\nBDjcciow9YplkPtoeKZacksVUU2RvsmzBM2i8vg8VNfhT66v2ue8B5s8YB7Y\niksZDr0jr5ZXRZ947UCbUW9d048l0pcRWpjMjez9Fu3rHxEQy57zCPZtQqI+\n223rOOdFMRjVA2Lg19zM8TdtFSvMEcxYV+7fUU9C4ZF4rVBEODpD6QBjVHF5\nuaPsXymyVS+PrVPKgiZ5AQ/xxfTDIt9xm4wdkjIHZq/RbuOUO6US7bjKNNEV\nGRHyQu4W3KsjoWePXIhfyVraDYznt3a9LeN1rfm1KRnXTG5MnmX6mvkiO49O\nCA3YoXVnrE/kyrVrDM2yAS2UgJOlPq71rL3NRodIVpqHmdAIjcbkFwGDu0y+\ndsffAmOygQalESbwf39X48uTtSY5EtNu1FtC3bVxwUgIcUVJjfE7z1c9QH8C\nuqH1D9gQLR+cikqTDuUzc0hLTfSU+g6B6X1SSPjgz8aZAmoWuag06J6Q6MT3\nBUHTMLStsEmxn6mIndPgqXz/rnvVeMNUwidhnYl6mMQN4tdrsXNFVlWo7EkQ\nwX7y\r\n=BR6h\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n## Contents\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string)|null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"db8b5af79bc8221682000a74eab75c30395590f1","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"9.0.0-canary.11da3c0db.0","@material/rtl":"9.0.0-canary.11da3c0db.0","@material/base":"9.0.0-canary.11da3c0db.0","@material/theme":"9.0.0-canary.11da3c0db.0","@material/ripple":"9.0.0-canary.11da3c0db.0","@material/animation":"9.0.0-canary.11da3c0db.0","@material/elevation":"9.0.0-canary.11da3c0db.0","@material/typography":"9.0.0-canary.11da3c0db.0","@material/feature-targeting":"9.0.0-canary.11da3c0db.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_9.0.0-canary.11da3c0db.0_1606940572148_0.6761429062593842","host":"s3://npm-registry-packages"}},"9.0.0-canary.489d4c219.0":{"name":"@material/slider","version":"9.0.0-canary.489d4c219.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@9.0.0-canary.489d4c219.0","maintainers":[{"name":"taylorv","email":"brian.t.vann@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"562a6d01a6649b9ace04da9012edbfe898562601","tarball":"https://registry.npmjs.org/@material/slider/-/slider-9.0.0-canary.489d4c219.0.tgz","fileCount":38,"integrity":"sha512-Lziiu8wUvoUnsm1MLXsyK+oWlLbeOIAyBCrI3wLa72LtkoWJZWv67OIvCGnicNL01vmPyeNjTE1JwyRLEEN2DA==","signatures":[{"sig":"MEUCIQDawpUuhSvQ8I02KBCSVv1EXTwx14jn9ibrp1/t89cGFAIgM142bN86FjSKpCBqdxQffaPJycpx2KfCLZXgchII0Yc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":779797,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfyQR8CRA9TVsSAnZWagAA3KoP/ju009BIH1zMNzjhqjHx\nmBSCkD1qCzveRMHfvMhfys0whby7LqJOBtJzHovm+F9fxu9Ak7gUZb2Q5yxd\nbDI5erkS0uHFAR2d/4uaDNlgDvye3eiCHM4QgQBH4J0wWuA4OPF+DRUcxYb0\n1ZkilrHy9oTz/s+dqYpCSTNOJv6JiJo9UczC8YtnwIS+1WN0Xa9q7uFJN4NX\nZFpVOqEv23ercgc1zIyiy2xdnXrMttn4fn6N7V6LrFZk8tP+sN5GxJZ7P26W\npWAbwYzATKhJ7pKYW2fiWoZd2JHn9waYZc6Qm4cj2jfSZywe9PXUnvX27h23\nDAX6egGCAHxThCO9wN70yFepWeKfChLi+9uNy72MHx3p8CLkxGaDrPpBGLXO\n57K242a/jy6sUhdmb3yfoWqS6zrX9hdnLRPuEflUJwjWpd2rxHi5jhjQj2Lx\nBBQles0+86vBThHwEdmoPIuKz9lQtNV992/FAWKjRjEkmnbakAD+PJDimrRK\njsSIwK4BjUqoVe02R7tnTAmPFauwFjBlOxRPNEFWcPMcFYA0dbGPIKqPvP48\nfEdYcZTZ7+ETre0Q2Chr6xhQIT6ATA/EiljjqAyfJ9E8+P3G9G9hiavzGBxE\nUI8bAuLSI/RFhEdLVLjC/PIU3PttwZrF2CbESl1qfllkFpFR3VqK7bKLX9MN\nv3TM\r\n=kPl/\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n## Contents\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string)|null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"b1c4ecae655bd87a48f6065e7c292d4b30cda43b","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"9.0.0-canary.489d4c219.0","@material/rtl":"9.0.0-canary.489d4c219.0","@material/base":"9.0.0-canary.489d4c219.0","@material/theme":"9.0.0-canary.489d4c219.0","@material/ripple":"9.0.0-canary.489d4c219.0","@material/animation":"9.0.0-canary.489d4c219.0","@material/elevation":"9.0.0-canary.489d4c219.0","@material/typography":"9.0.0-canary.489d4c219.0","@material/feature-targeting":"9.0.0-canary.489d4c219.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_9.0.0-canary.489d4c219.0_1607009404319_0.422061961467205","host":"s3://npm-registry-packages"}},"9.0.0-canary.6557a69d9.0":{"name":"@material/slider","version":"9.0.0-canary.6557a69d9.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@9.0.0-canary.6557a69d9.0","maintainers":[{"name":"taylorv","email":"brian.t.vann@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"63f9ba20092294fa598b3546e2f54aa1a8ca226c","tarball":"https://registry.npmjs.org/@material/slider/-/slider-9.0.0-canary.6557a69d9.0.tgz","fileCount":38,"integrity":"sha512-+uVIeqqhMFg1n39oojw6diiMYZ3z8VIWbjqjbea9LUdjWx/nDVnkpfxxGRhyvf/p4RYslum5CA+NOZd2U5qLPw==","signatures":[{"sig":"MEUCIQDeww9+HOmFCh8c9qtz0fuFpxey7diVhGLuc9ZZgzocAgIgHb36MHJvGOeeE0WLQ95KIbSKbnk7fWmNvIIysDZV2tU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":779797,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfyQc/CRA9TVsSAnZWagAA9iAQAJb+rL2DwCMbpQxaL/Lo\nCsuwqvjDuRQtplYTaUEzoS3Hqad07bN+F9Eg6sqiEtdz8/od+9jznA2pSoWI\n4AUM3Ha4gwtKz5KC5jfUmztwpH6YWdJ9F0b2Ok6hTip3/krDgABcDiW/HMc9\nL7S7JDzcDeyfysseVRejgqTcFWWzgKwNI0lCEGH9wpGMrHEvoddnkf4UGHFu\nW75QJlwnJOhX1XgqcTdKc1PNq8X2IrI7EfFWbpKJq42F0068Zbj1400a5KzY\n8QquXr5zr63fMkp25Fz6q67bfXDYjKVH5Ixb7Gjc14BdCl150Qx02stOd//M\ngwJL/PqegJsNxfiaPBA1Q2Y0T4hxwswe/+5WjKqdO8LtPfBO1Iox6rj9wlS7\n8uZJihCKntD38wrkVMctmQkSqxQ4hwUAb/aRMmpticSdXEsK5EwVmD3yN4h0\nBYeG+RYs1/8OWkSkTgZepm2vQEW3YdVTSF1kjOfmBfGJlA812m1NbFE78JYi\nt95ICiisO92K42kItDiybD34mQnRnvJb4xB28QjATiDTGYkAYjRyNS2V12SJ\nlgb2HKed/r1Vq/PIBhdi9am7FFURXhSs3vEKr7YFaZ4SjCfPFxsni2IHSRyB\n3QbcjA21WU+TrCj2eqJ1Y2qw5cAk8KCjYylnU9OQJeGMx6u8GWJbbpJxKASK\nOn+t\r\n=kenF\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n## Contents\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string)|null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"55ff05f1fcd2efe299d07cfd81279127a6fcaa5f","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"9.0.0-canary.6557a69d9.0","@material/rtl":"9.0.0-canary.6557a69d9.0","@material/base":"9.0.0-canary.6557a69d9.0","@material/theme":"9.0.0-canary.6557a69d9.0","@material/ripple":"9.0.0-canary.6557a69d9.0","@material/animation":"9.0.0-canary.6557a69d9.0","@material/elevation":"9.0.0-canary.6557a69d9.0","@material/typography":"9.0.0-canary.6557a69d9.0","@material/feature-targeting":"9.0.0-canary.6557a69d9.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_9.0.0-canary.6557a69d9.0_1607010111402_0.4608931555222493","host":"s3://npm-registry-packages"}},"9.0.0-canary.4ea1b7c69.0":{"name":"@material/slider","version":"9.0.0-canary.4ea1b7c69.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@9.0.0-canary.4ea1b7c69.0","maintainers":[{"name":"taylorv","email":"brian.t.vann@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"19c7d1fe59ea0d9d7780cfd2edc816eb58c618f9","tarball":"https://registry.npmjs.org/@material/slider/-/slider-9.0.0-canary.4ea1b7c69.0.tgz","fileCount":38,"integrity":"sha512-L7Xxp9aei5Vnv23gdcKZwaWXNgc7Pv5ZvqsIPGZRd/lsyrZIND7QdKmS0uq2bdCVtcYzK5XLafrl5hsBJXTWxQ==","signatures":[{"sig":"MEYCIQDRy4NiZTQptfgqWeHoQHHs/O43gBa1kqmRowgaPCDOdwIhAMdukhNMEpPJcKMbxx0fmoMpdGEtSHUrsRclbvDqBlKN","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":779797,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfyQsrCRA9TVsSAnZWagAA0bUP/3XWprEggvYIFz4xlxjL\nlvQAuSFQ7xMp4NW3w9Y/FRzyBvUklXB+wmJ84DIHCI+9wHDuhQeo/qzSpDLV\nheRKsmnd/RbEN2NWEw0R68tzQHg3qEUpoXRz8saD2Y/80etUmrg2EkciAhzJ\nP9AIlJVP7mubNxg2DrkNkCj2em2VMaw+hlH8pOH/e5HvpM/dCVFfVI7U9puh\nYuRnfNb4KI7nXCNFJ08n3tYWc4mF1cvkgzLm4Ai2JHles3mPhI+HO4pIQo++\n7/QB2RCYc1TWaLUkWzj13bhr4eIVIfmqRrWzuCtYUDAbF11Vas6Bf68+njBM\n4OAItUoVK5lBioRFgNuDroqs2nhZTgn02URG2ArXrLVlTSe8KWMhJbuMnpun\nNLcCOXmYQT6l+aK2PVHz04RgIdfdFhn6PLKEAhQqUlisnv2T+cLuYCTEBlha\nGm+Xgo6CiUHiHhLAzGZ+hJGkIvvtaRcnWYI/IgwLG15Lt7zSpJLc9VMekGdd\nsOlXlRY9qQfN6ItO1mSsGsFT0f68JyWiJDYtF5vUc2QhjudwVHrg5k1CNSr6\n7iwHESEiSqAa/7NQ59tVdHEgRkncAxhrjwkluYe0HUhfeKyef2d3XTWiA952\nyU1qSbrchTVxtUDrzaR+ZzvtVQoq/cdppER8FBhOQQsY44eFvyDyjMfmt1dK\n67sl\r\n=I+em\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n## Contents\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string)|null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"d7307ed831dded5d9e22a8faf595a7411258793f","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"9.0.0-canary.4ea1b7c69.0","@material/rtl":"9.0.0-canary.4ea1b7c69.0","@material/base":"9.0.0-canary.4ea1b7c69.0","@material/theme":"9.0.0-canary.4ea1b7c69.0","@material/ripple":"9.0.0-canary.4ea1b7c69.0","@material/animation":"9.0.0-canary.4ea1b7c69.0","@material/elevation":"9.0.0-canary.4ea1b7c69.0","@material/typography":"9.0.0-canary.4ea1b7c69.0","@material/feature-targeting":"9.0.0-canary.4ea1b7c69.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_9.0.0-canary.4ea1b7c69.0_1607011114682_0.3174969759605304","host":"s3://npm-registry-packages"}},"9.0.0-canary.eaeb78ce3.0":{"name":"@material/slider","version":"9.0.0-canary.eaeb78ce3.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@9.0.0-canary.eaeb78ce3.0","maintainers":[{"name":"taylorv","email":"brian.t.vann@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"4dd5517c00a9a098aeff88cc5cff985b7bdad3b7","tarball":"https://registry.npmjs.org/@material/slider/-/slider-9.0.0-canary.eaeb78ce3.0.tgz","fileCount":38,"integrity":"sha512-FV6Y7Su7vRiZfE1l40/dD91J/Fj767Z7AvbKv7BHF6EbRGpLnpLwUwHPHDFCwHvNniVnUHwl1f9P86hDTx/Okw==","signatures":[{"sig":"MEUCIEr8feCLj7btZTZEoP67gcLyn4bvoUYE9HcMtHnB+PVeAiEAhbi3wtq4aF/mJ6maAFM3HAEVRBtjwN59AhTHZ3+dIDA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":779797,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfyRocCRA9TVsSAnZWagAAI08QAIRGJCpoaV4kSxMo2tnG\n1pBNeOGS9aPBzxVXJHLkPkTk1aFDHdNK835+/lyRM+H4HQ7iyt+1gefe1CrS\nGa9pXRTala0ExAdyIL9eaeSHwYaQdoMn+8kE3VD26dcEKYY3pDydT/DsUJWB\nq2XMMbE5FowD8CoWzczPJDBqpyBg1CXipUNbybW/HM5Wx59JOaz41+Kf5Ah1\n55APOXbYeRhpL2j6bhO3wUGmMMbN5sg4lCHRwf2CGWrom1tqebuZrEOtRQo+\nRQ7aRFDRYNHVOH9LA/pxUwGa7f/dYtGbSHu269UXuQMOFubGYBxKd+2X+nNq\nv6Fgm4Waf1ZlV2T/TUB42YLGrf5U8vhH3kBu4AYfHP0lNSyRTNDfNxaBXYUS\niwpGDd97reFamKl6ncTGVuBEhe9qRFzt+lWqgOPH3X7XiSEKbujN32uTapF/\nvPN0VrYqWeoVToF3Sh6GQkEXtHPltj43NSQ0F6/VWqJDXhzJ3OOS57ra8EaB\niKyQVgq+jTaXbZLabzuq7se4Z0Ju+GCVf0q6Z6Oe9BkED83w1AUUBIJiJwsW\n+skYB0otqxJ9QK7TrJ+orRouuKHPpMiICsQSX3p5BUU0HidhTmY2U7R5T2B9\n+YWU7JBFet0Et74szsdpZgKzzLLz/hrMaXbHKxqWiJOtduxa9mn4FA2kGFx7\nbeVg\r\n=5vs9\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n## Contents\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string)|null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"9902fe5ed18fabe2d289f92e75dbf17abebe5a80","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"9.0.0-canary.eaeb78ce3.0","@material/rtl":"9.0.0-canary.eaeb78ce3.0","@material/base":"9.0.0-canary.eaeb78ce3.0","@material/theme":"9.0.0-canary.eaeb78ce3.0","@material/ripple":"9.0.0-canary.eaeb78ce3.0","@material/animation":"9.0.0-canary.eaeb78ce3.0","@material/elevation":"9.0.0-canary.eaeb78ce3.0","@material/typography":"9.0.0-canary.eaeb78ce3.0","@material/feature-targeting":"9.0.0-canary.eaeb78ce3.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_9.0.0-canary.eaeb78ce3.0_1607014939669_0.6363135029915219","host":"s3://npm-registry-packages"}},"9.0.0-canary.1c156d69d.0":{"name":"@material/slider","version":"9.0.0-canary.1c156d69d.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@9.0.0-canary.1c156d69d.0","maintainers":[{"name":"taylorv","email":"brian.t.vann@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"db026b6c4d1ca28f40367634808e6f2cf633dfcd","tarball":"https://registry.npmjs.org/@material/slider/-/slider-9.0.0-canary.1c156d69d.0.tgz","fileCount":38,"integrity":"sha512-frYbas5K6DgVUbUwMn4iB7xfIfSyw9fFwaU2ZeRM+/NhPMYQrCLKArufau88rf9EPsvO8g5FmD5TyOSaN9VoXw==","signatures":[{"sig":"MEUCICpjj8vfIhs0O5VU21Kh+oeOEdeUQLjJeuVEGjd7uSD3AiEAt0slh4hMWlSbnXnGmuYOtsjY83xPYBsD3qp6GVfD3O0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":779798,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfyU5xCRA9TVsSAnZWagAAi3QQAIIykxh4s+lzRIE0TYEv\n2oht1m+fn7bYC/gLxKy5aLVQTWDSITL+liX0tyP9MhedfvzzQtnZcIzaVrJW\nSOuyfegR16AXyWT/7j1jroMB8Sl/piHlWL7fS0f9t7r+v1MPERB3A7zn+fWc\nQ7KBsu1qBVdN1TMgt9nszmwRGm05YDYH4gWxYkEzugpeLlkPg567PvpesO2q\n046SrSY65JaVse3cndNolsHAxoheSWd+AK6Q+wvbqjl+RkES23ENQYV1598u\nS+gUKip8GdVvMQ0daxk9R8mMqI5B6AaF7EcuKusN1F+fN+JU5B/73gjfKc81\ntkiFkVXeWpRTI/ga+qE56YQdkHhbt9CxtIcPowkkrdoR37FigKDs9hYlEbyY\n5yf7+mOvxYzm1XylW90QxBRLJT/saawKGAhA90CcsbVQdpG/j+eG0HlbbBU5\nBtZAvRIqZFJ5ZmD0SKiutXrDnCCGxK2GL94FgH7jifsf8dUPVYNk2siKHzz1\nNw2f0SybzlEo+DYCfPS9QBT58HP7zSzoYY1pnM/XSgN9/QClmVtY+fBJHQIo\ndaZMlCFYcSh7K5AKGF/+2xaHlEnZ9QlTZx/IVDoYE0oO3Jtgaqn9ngKd6RqN\nB+2LnLtEgGA3DcTSuoJ+1AzUlJC/vT4Era7cG3i9+eavBtvJey/IFIaehdn5\nhHSB\r\n=Hk94\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string)|null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"2239befcb4baad98eef5bd67444b0f759e58a812","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"9.0.0-canary.1c156d69d.0","@material/rtl":"9.0.0-canary.1c156d69d.0","@material/base":"9.0.0-canary.1c156d69d.0","@material/theme":"9.0.0-canary.1c156d69d.0","@material/ripple":"9.0.0-canary.1c156d69d.0","@material/animation":"9.0.0-canary.1c156d69d.0","@material/elevation":"9.0.0-canary.1c156d69d.0","@material/typography":"9.0.0-canary.1c156d69d.0","@material/feature-targeting":"9.0.0-canary.1c156d69d.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_9.0.0-canary.1c156d69d.0_1607028337243_0.4811976192176599","host":"s3://npm-registry-packages"}},"9.0.0-canary.832668d33.0":{"name":"@material/slider","version":"9.0.0-canary.832668d33.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@9.0.0-canary.832668d33.0","maintainers":[{"name":"taylorv","email":"brian.t.vann@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"25ea794e90b5c30c31e021bf49b5e4b059a28156","tarball":"https://registry.npmjs.org/@material/slider/-/slider-9.0.0-canary.832668d33.0.tgz","fileCount":38,"integrity":"sha512-Gudwyd56N/kr14tWsHwmCrwqq5tGHdejojRcHgoBvKfvAY4+AatquGajpPPZv7967pT/oAobDKaYM2JLeX6F3g==","signatures":[{"sig":"MEQCIEqVoFGIOyxdcDzX5sQA+7QfQqObn0Te+S+aicBp2DUfAiBJF/CQzDZ+XP1ljD/fH9EONkCkOvRZOmNFFTMXgj4d2g==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":780950,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfynqbCRA9TVsSAnZWagAAPtIP/Ru7AtCRUgWt9rlzKC3a\nf2HddiFkerPe6OcCYkN+u33Jnnb7gZMqhz7KyJhHoW3dYkybMlrYiIOZ0WVQ\nDh3CBXN5jutjBvuQtVReLoYpseHEs8LYRcTNav1wDqmqPdU510sGyGjcFxy9\n3RmFTbvRhWq98uVxJvygY07V21VRXy5kk/VKJU5yMYL+gZGvZZW6D3jag4ru\nKo8qwWrh9QFSrVsUCKjZcqAUweENiScU4CnMzlsB02TjI9N4CzQ1hGDyGjv1\noNigoAv03OJEPfQ9p5DurFRiDFVJZuv0qIgjgu39MgxfFPT6K00Lo1ZyACZC\nYSsy4X7Q077NQ3BaWQ1MQvvo/U53v8Zea6GzErWthd2zJrM1zkTPBG5iuz3x\n+Iix0hgJkA+4V3HQq2n79KmxCz2G5ls/5GczzwclGXqJlULSjmEE8nBtPhs3\nRQbon8X6xj2aw4uHX0vVqmJCNzUI3Kdqf2/Mv6GFpkUNg6rz10C21LqN1632\ni3eqVLB/7iK/J7CYWw1rdl7g9cz/jHenXYBIAVPr0MSFO6Gl2a8BFu6wzgR9\nMyg7LkVmIpKqgME0ahhh8/dLTFsokTiGtzovG07AKD/XwaXiBCdrFZNYtepC\n+g3+zyaNWEOWfgBHrhZgzw3pYt2y2DO5QFQ9kIyZoCc+ZgclWWWotO6OCDJM\nQPvG\r\n=pk/Z\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string)|null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"5744d71a59950726441cfb1b4e3ae33706069b94","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"9.0.0-canary.832668d33.0","@material/rtl":"9.0.0-canary.832668d33.0","@material/base":"9.0.0-canary.832668d33.0","@material/theme":"9.0.0-canary.832668d33.0","@material/ripple":"9.0.0-canary.832668d33.0","@material/animation":"9.0.0-canary.832668d33.0","@material/elevation":"9.0.0-canary.832668d33.0","@material/typography":"9.0.0-canary.832668d33.0","@material/feature-targeting":"9.0.0-canary.832668d33.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_9.0.0-canary.832668d33.0_1607105179358_0.09377192480543428","host":"s3://npm-registry-packages"}},"9.0.0-canary.4321323e4.0":{"name":"@material/slider","version":"9.0.0-canary.4321323e4.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@9.0.0-canary.4321323e4.0","maintainers":[{"name":"taylorv","email":"brian.t.vann@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"5803f591bd111ffd97b3d789ff05995812b50ec9","tarball":"https://registry.npmjs.org/@material/slider/-/slider-9.0.0-canary.4321323e4.0.tgz","fileCount":38,"integrity":"sha512-YK2ZGUZUJdKnApSZ35UWBgYFg1EBJYJl9IlLom7nz+cZ7p6VwVyIkqkxdXyLZsFa3AuhiTxSvYvzx0fpnLUdpA==","signatures":[{"sig":"MEUCIG+Dhr2slhJiSdzHYg9kOUh9dQ41sjK/vVnro1HitLpiAiEAgtW203uGmEnzzi4z7J34c8ttAi64yDsgEGOi0NDTBL8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":780950,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfzhIUCRA9TVsSAnZWagAA+IwP/AsUlVziwnzrEdCY087Q\nLpfzBAhM87cdlr1IZWVTD727NbBA3GzK9miaL6o7lsI4Uytz6LozeDI4uGmH\nUiiIR9MjiqBFhyV3zzNQCXjSNzSwnS4LxDU4zSyJWXCybb1fduny2OE/Aw+c\n94jUdyFN5oYyXgqE1klsJLhwP3JqGAFTY12IUPUnQFY/cOtpxgODA224lGsr\nnze9XIWIKioxJngY/83gQI+gs/SagUxT0qHgR7OkjyZdsQ6ZK5Rrqdsd0paJ\nihGQBz0cQ1Uum1imXMLwqi4VniRVom5OvDBGJTQcNWy2P54kDAEGMVhLakoK\nFbr+JIVE6LxvbXRqkFjnySIlc8/JZzIVbMcpbpjGJk3UVYptRWbrdsuf75vW\nlFn0ewOXY7YGfYgcS/qnclORokw9BgSs8ljfJrrbW6kAVm3Mp4QVVOAIbGPl\n8bBfZDm57hl1Khlcw4Mt4imGZ3vDFhWmREK6B/vn73+tbnuBGAtsawqH7yAq\ndl1aUAFNSpo/hi9V/KUcRRJGxDRNq5bkFX3HXYHW2kXzP0e7tyqBu6Gp3mfY\nTdR2p8u7qKoPCi3OZYvvVOLdyeaRv2bo2lTh5ABDQRAwSdIXrlfUDkS6DPcz\n3KY5attJXhPueLkcHvN1UJ2PiZ/f/Fgcrve9QdU+A9WIk5oXjbe0QnqeiuIF\nyxr5\r\n=dIyB\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string)|null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"a838a6bc72ee56a967d493a841d4c69ace1f3f13","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"9.0.0-canary.4321323e4.0","@material/rtl":"9.0.0-canary.4321323e4.0","@material/base":"9.0.0-canary.4321323e4.0","@material/theme":"9.0.0-canary.4321323e4.0","@material/ripple":"9.0.0-canary.4321323e4.0","@material/animation":"9.0.0-canary.4321323e4.0","@material/elevation":"9.0.0-canary.4321323e4.0","@material/typography":"9.0.0-canary.4321323e4.0","@material/feature-targeting":"9.0.0-canary.4321323e4.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_9.0.0-canary.4321323e4.0_1607340563582_0.10576453885971882","host":"s3://npm-registry-packages"}},"9.0.0-canary.2d5f32d41.0":{"name":"@material/slider","version":"9.0.0-canary.2d5f32d41.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@9.0.0-canary.2d5f32d41.0","maintainers":[{"name":"taylorv","email":"brian.t.vann@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"aa0b4c9db9574f50f8f4b98c743807ab0c6547c2","tarball":"https://registry.npmjs.org/@material/slider/-/slider-9.0.0-canary.2d5f32d41.0.tgz","fileCount":38,"integrity":"sha512-cBg6VuftN8H/8IoHNBKj3wiNofvD4/ronZdYEwwtqp6ZOzKrllYDgU4YhnCRbRpvkFiGypIzZjl9mXWg1bpGkg==","signatures":[{"sig":"MEYCIQDk7rpf+aCZdjBVc5mQjwime09+jEJ4RFGd9rg5+3IvyAIhAPe8PIN+3FRLclCD3eMHyjr/2X7J4/7G1ygldTjUecgE","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":780720,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfzluICRA9TVsSAnZWagAA35AP/1FyJ9/N7M1U38BaL10b\n1hFkE73HCsERVak+REkHA1B+0w1MNXZ2OQPUrSY6FqfrBywnvji7DjhJjVIt\nPVbDMJF8a7YQZBLDbXhAOJrz22YFCUYVuHVKj6RGC+bU/maUc4Mf+5kyumx9\niv43/J713ltXwks4ZBd9zh21u+EL3LQ50YFrtK3UmHG9d+mG49HqcflV8aq+\nYWOij29Zi3H+u4APANjihK6gT2BkbQsXHxJ0AmNEk8u3AWHmSWiZZEQEoJnt\nY6pFyutiDHLpwFrwDLgVdbiDDEMQxCXrXGefhJ5G9zBNvPOQUY0bSywA7vzc\nIVPnXV3Q2wRLVNtlsyth9aAr+Wpp69bxaOhTDpts/6Da+Fz7pH1vk/snESvb\ngA4aU6y6B7mdD22MG8MJxk7YRdUiUxP/3H7j9VvV8Lkw1bbS2PX1JYtQSGMb\nCow+6f6iPpr8RpQbVvLBfvZPRhkVdw+6xoiF2ZbsAMpI1kz0+2Q0fRa+az9Y\nIaVI7R5fPStuHMQR9NYCwoqTx7zT5zH8qat2xGpY341skNFLRzz1mEJ6Q3Ub\nDN183jF4c/cK+yPGGdPdG+KcpB4C1xFPX9mIM0hyjP5iIILzf8RRdGHCwz7Z\ntwOwv2IKpX/RbLv6uz7sAH20j0znl9YVpkVMp9u++kTJDiPiLvnoM4OUYt2u\nbrtN\r\n=eBJR\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string)|null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"2c385d3016a738d32bd3c03bcc91bccf82981fed","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"9.0.0-canary.2d5f32d41.0","@material/rtl":"9.0.0-canary.2d5f32d41.0","@material/base":"9.0.0-canary.2d5f32d41.0","@material/theme":"9.0.0-canary.2d5f32d41.0","@material/ripple":"9.0.0-canary.2d5f32d41.0","@material/animation":"9.0.0-canary.2d5f32d41.0","@material/elevation":"9.0.0-canary.2d5f32d41.0","@material/typography":"9.0.0-canary.2d5f32d41.0","@material/feature-targeting":"9.0.0-canary.2d5f32d41.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_9.0.0-canary.2d5f32d41.0_1607359367737_0.41823426337632075","host":"s3://npm-registry-packages"}},"9.0.0-canary.8239afc64.0":{"name":"@material/slider","version":"9.0.0-canary.8239afc64.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@9.0.0-canary.8239afc64.0","maintainers":[{"name":"taylorv","email":"brian.t.vann@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"02993cb3a03333293870566e38b0fa27eba3f574","tarball":"https://registry.npmjs.org/@material/slider/-/slider-9.0.0-canary.8239afc64.0.tgz","fileCount":38,"integrity":"sha512-xqVa5OPv/KyjhnruZrB7iKgkcN+vY8Em3YSQ17bmg+niecpkp4Gc/sgIno8JGSVNmL+6VR+iu0acVZHIRy4Ohw==","signatures":[{"sig":"MEYCIQCLkDSWmoBjQWWiQMznYfNWMw9Vc4I5eEMGHz88CC1I/QIhANS9EbCYEo4rNQOLsCAAajPQIIbXx1mQwRVvswjhmGvN","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":780720,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfzodiCRA9TVsSAnZWagAAI6IP/i8Wjs5nMtivzqWnNtuC\n1qN0KFHSFGg4y62E5GFbwDz3fQ1ASgRuQC8xcZjZuNzztXDXstv7QZhyCCzI\nS/qcXvSX0cPh/cvbbkLVs32gnGr5N3fXLdaGeHY/d9olVzjJel3Wj8SH5lej\ngZU3cNolGQzkOXz1KOs46dFtyOr8N+Tnsa83gpVU6+JpJaI9MOZmr6lyNvn0\nJpC8THdDBZTQAFsQxDKskxMQjBPVyJsOjXcM9ac+MIaqt0yU+7wCaroEVNU6\n3/YQbJojCUyBBvtD/VFQiaivQlX1TUlr++Uz4hjGfUDe1zLVY360Kn/xNWas\nanQ+pN6fuiNQO4A4HaG6tJ47vmKEEKTfOb1Hd/gl8L/m5S0ryn6rONA3b9bG\ndSQmCMlsEZUo8PR0uNR64DF7oMXd0JpOvrQT0vKkeS8Xxa11m1mIuMUOJEjm\nDLRW3qSe+GNsF23joQ7YJ2FRX1RII185QIh/4UGCYDTprcdl+PSUOsJWLOH7\ntmuTqqsvKpv5OLwKwraw7ZhCGxnvsZEvFXw4xqFENPJaxDIRUwyr1iVm9gdE\nz5sSLGSfxV16x3FVdcguCYGjcgB6RSte/wLEsyVQyaJh8mP868YzwDt/t44P\no8cio/AL2nWPJRiPMgQyH5pFD7bAe9FWxVuSt4oHoPw8OTdtOF8dnWXwx8u0\n1LX6\r\n=ezVE\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string)|null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"3ba24284e7fdc10c5aba869e2a2d3175867e0f15","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"9.0.0-canary.8239afc64.0","@material/rtl":"9.0.0-canary.8239afc64.0","@material/base":"9.0.0-canary.8239afc64.0","@material/theme":"9.0.0-canary.8239afc64.0","@material/ripple":"9.0.0-canary.8239afc64.0","@material/animation":"9.0.0-canary.8239afc64.0","@material/elevation":"9.0.0-canary.8239afc64.0","@material/typography":"9.0.0-canary.8239afc64.0","@material/feature-targeting":"9.0.0-canary.8239afc64.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_9.0.0-canary.8239afc64.0_1607370594031_0.8705414674697787","host":"s3://npm-registry-packages"}},"9.0.0-canary.6871336f1.0":{"name":"@material/slider","version":"9.0.0-canary.6871336f1.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@9.0.0-canary.6871336f1.0","maintainers":[{"name":"taylorv","email":"brian.t.vann@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"ff292c169e69c8b388af4969ae1e3db479213378","tarball":"https://registry.npmjs.org/@material/slider/-/slider-9.0.0-canary.6871336f1.0.tgz","fileCount":38,"integrity":"sha512-itCpCFV2E5MFQf3C/Z5h4/c9RckIXg89b7MZzPIgSp+9wPCowCNxM07jkDx4eshetdxDK98zFSl+VqsS5YFWkQ==","signatures":[{"sig":"MEUCIAr0yP0ea7CyId6Mk+dKpU3ILE5vBb81nwfT2dkSY4GQAiEA3DURsoQXu5rN+Ir2aH3SdoI3ZXu6AyLNa4rijq95Uw4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":780720,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfz6NvCRA9TVsSAnZWagAAuQAP/1smW68Wff3KMbaw3C9l\nPdEsMGukEvTcI+wScrlxk5jktrhemFDnXgV5P+38C0K5wUBeEGn7g3eNobZT\nh0SBOx99h5fW60ls3askD+HJMABdkvzV4VLgvSKhwCrfUZbG3sCsMw+QHhZ9\nJS3qBY7netFtwltUhKWMUn1FD92oNur5mUM63TZY9qZWfHZ+GaLGnJdtPQrk\noRVFIdys4xuUAx8vJBSYNh68c8D5h9ImyVvtqvc6lJBB32cLAtn/hT78NfiW\nyCFTZeA9Gg0jfhLl29AdSzJEVb4eYfNMbqPLGklH+Gyf1vNGCwK13FkBC0GG\ntTlA29KUtvehzneUUgqFEl6DiNWHS4lwDISIFqbbWAu+CcwUOJLqtQigl/KI\nxYopSrUMnIgghugWYQAoMVfp4f4MSNVdwHGXKPNH1pFz+R+neDRr+fePaeKd\nVvrj01POEQ4xZzAEMttbVzzDyAZYErm+vBodhczndKMvKpoEZmw0couTHSIL\n1QGshD/B///Nhxm68Vas+rhO2qfexUQp+vMwJzPpnzv1v6+MqkWd0yUBXxK7\nH95NBq5iZjRnj9MRJ1cML2K0UzaVOgZ/atKrxb8EtUF137H41aKVvwCYJhnf\nPbesz9w+pgGsLDLgHFNReCFMIm7WCn7l+NvVAGKEl5CpEYIVtUGgqKREOpmP\niVF2\r\n=1sT2\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string)|null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"aed20b07d4f2597c382a6ce4b7c723f6df0c3efc","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"9.0.0-canary.6871336f1.0","@material/rtl":"9.0.0-canary.6871336f1.0","@material/base":"9.0.0-canary.6871336f1.0","@material/theme":"9.0.0-canary.6871336f1.0","@material/ripple":"9.0.0-canary.6871336f1.0","@material/animation":"9.0.0-canary.6871336f1.0","@material/elevation":"9.0.0-canary.6871336f1.0","@material/typography":"9.0.0-canary.6871336f1.0","@material/feature-targeting":"9.0.0-canary.6871336f1.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_9.0.0-canary.6871336f1.0_1607443311107_0.867112686810521","host":"s3://npm-registry-packages"}},"9.0.0-canary.9f718da94.0":{"name":"@material/slider","version":"9.0.0-canary.9f718da94.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@9.0.0-canary.9f718da94.0","maintainers":[{"name":"taylorv","email":"brian.t.vann@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"29d9ab0d8cf72c6ae3392b1b96fd75d60da10f2a","tarball":"https://registry.npmjs.org/@material/slider/-/slider-9.0.0-canary.9f718da94.0.tgz","fileCount":38,"integrity":"sha512-7smV3GnGd7kbUNu6adWRj/wA3rVoHxL5OUZqXW1Jl4DxTkLWLd8sUQlPnBGf1LJ1c5uRCoqRX3iTmDgtFU4G7g==","signatures":[{"sig":"MEYCIQCvHR0Sn2jh6DrVm5dns7LVckklIMLPkZ0WPBDV8nIY1AIhAJySfPJOZ6f7eWxtag6AUczhnESJU4B281GLkCRbxd6Z","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":780720,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfz6YzCRA9TVsSAnZWagAAW34P/jCDgJA0BeQoZNswm52A\nk5k1hsWuihGyc9asyo3PfVAqOiYenDeDG/voMx+76EEi7gP/6TEPZJH+sutS\n8UbhkPAbvzDsd+sGJPnil1sEH/aNXjltZiqdZQf7gimbsGH0iuCanFomLBuT\n5X0cOeB+lWdzQ1ayO1OLFgpD351kFU+dlsp3dGjiSpwlhhpIU5yrArL9U6a5\n2fei9RHA+BLpsRic2Q5qvJk55khlCcjvfrhliqIgVQjrZHw6Umda6zl/NMyN\n9hZ8jTNO+QhSJKOlyUWws6MJ6/yEIcTG8porZouSkdzUdf8X0d6X6g5lhara\ns9YFT2eD6hRnDqtcy+PcW1LxutxzC2wz6eh74A2wwoaPd2lc2FKmgEV0SYOj\nrhm2YP6bJKwTc8mm9Q1ATe1+MRu3OovFmfa5pqtMPyf2EV/XJfpjkvrTAgL3\n1CHqwg99MP/zEcMspTtyzWqRr7aITx0UlzyVQVNbR1FNJIUR9irJ2JCU+7Nl\nK/G0PY83oqJdVLc7NysYV8LZBB/v/IWFEWRLDbU2OyKyhia/DoegnMAf3UTL\nZXYriq/v6l95xKeiesaY6Fs+AY9peusAa0++s8MAt2XaEx0iBLBJN0iOADDw\n/+T1wgzxf8kfjbELDheZtRzD9zI+hSGeIJyrQ4SbCae+/rLrh7rI8qlA55UA\n7mlc\r\n=Jatv\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string)|null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"7fb6692f329c5482f22dc9fe691a20fe4c6dd38c","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"9.0.0-canary.9f718da94.0","@material/rtl":"9.0.0-canary.9f718da94.0","@material/base":"9.0.0-canary.9f718da94.0","@material/theme":"9.0.0-canary.9f718da94.0","@material/ripple":"9.0.0-canary.9f718da94.0","@material/animation":"9.0.0-canary.9f718da94.0","@material/elevation":"9.0.0-canary.9f718da94.0","@material/typography":"9.0.0-canary.9f718da94.0","@material/feature-targeting":"9.0.0-canary.9f718da94.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_9.0.0-canary.9f718da94.0_1607444018672_0.22952245887435607","host":"s3://npm-registry-packages"}},"9.0.0-canary.1fccb1418.0":{"name":"@material/slider","version":"9.0.0-canary.1fccb1418.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@9.0.0-canary.1fccb1418.0","maintainers":[{"name":"taylorv","email":"brian.t.vann@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"241277d785c304ee0665c77e6c0b3ffc5610aeb7","tarball":"https://registry.npmjs.org/@material/slider/-/slider-9.0.0-canary.1fccb1418.0.tgz","fileCount":38,"integrity":"sha512-fRgrMYLzJhUdBwHqYSOEM8cwG9KwRbddrs2/FSUtd4jCFPFFQZ0TH//mTwchrWIMDSbzD6Cs/YXuCB9fwyqxcA==","signatures":[{"sig":"MEUCIBvPK0zgPkCgoV4/BzXuaEZu23cKvUAzoaKwOVSOh2eVAiEAnkOkyGqs3WbE0x6wLM8hbBzQqU2R1mv2/C2Wnuc8EZE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":780720,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfz6m7CRA9TVsSAnZWagAAY9UQAJphjgbfyf5GSRAQf/No\nTdYckcE6BQtsDEre1EdeWbMbjTxeL0vgXEB+GHJlS3/+vDkzGIvd9XmByBkD\nC1VxAgRz7kzTIbps/ZTcvUd67wCAkt1V6Itd//OsxAs65yo+DKr0H55cv9U/\noe0A0zBk7LpHW+jouYTsfr2UAOk4ILPgzJ6gVQz8pE6gGN6yleMxnhXfRPN9\n/9KjTEEwMfNh6oL6Kb/pW800BLQWBp2/1y1Nz/maRipYBR7jFKru3eupWqYz\nWtfdeQ8BHDtaDbBcrlGOkkz2X4Tb/Osk9XWN3RP3bE+CfjrJvOcavOsb1GUu\nYkp79DBljRW7k60p07X2qhMfQTgTHmGmOn1wPMXo+6YzHqFnIMPudUZptc/6\nB/0vfbDwBWGinDrZFh2eZoFF404OHjzwxqGly3VYPnmTU+j46CQN5nH0g3mG\nkf5tjsTNVrarOIsl9kOTQT1mDFAEds+D2pbWPzc5Z5ypGQAJlB/Y56SoIpAH\nUA3vNCf7+kI0F07VfBQw/WF5TnEQuBSUNTxajKMDHWX52peMNnEIfoTjiyW/\n5fMUeykpUC4ZAwfbpi2zmmLfc8cgT31hWuOEOK7CtQvF5AQImlraaD7ELgxv\nwR7+oq1u7a+kmCCiig/hc4IEUk8TWkTVGceNlR0jQlILfoTGQ5YFu54Rnloi\nLyMY\r\n=F+qf\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string)|null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"f9dd96ea7afbac37dca91bc879dc44ce4523c442","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"9.0.0-canary.1fccb1418.0","@material/rtl":"9.0.0-canary.1fccb1418.0","@material/base":"9.0.0-canary.1fccb1418.0","@material/theme":"9.0.0-canary.1fccb1418.0","@material/ripple":"9.0.0-canary.1fccb1418.0","@material/animation":"9.0.0-canary.1fccb1418.0","@material/elevation":"9.0.0-canary.1fccb1418.0","@material/typography":"9.0.0-canary.1fccb1418.0","@material/feature-targeting":"9.0.0-canary.1fccb1418.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_9.0.0-canary.1fccb1418.0_1607444922362_0.588289720023383","host":"s3://npm-registry-packages"}},"9.0.0-canary.afb68894e.0":{"name":"@material/slider","version":"9.0.0-canary.afb68894e.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@9.0.0-canary.afb68894e.0","maintainers":[{"name":"taylorv","email":"brian.t.vann@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"1f89e85748236ed61b451097f2271e24ee8eaaa4","tarball":"https://registry.npmjs.org/@material/slider/-/slider-9.0.0-canary.afb68894e.0.tgz","fileCount":38,"integrity":"sha512-AruylkvIc2kXNaOlTAIzEDfoULyb0ugEgOtl054tiiObpWJvOPCk7s3npDJVR6n3OfR3ZeRehbTeAeuuHNS18w==","signatures":[{"sig":"MEUCIEINYBV+h9MbqVqBYo8Vqt0bbRdeOpBjsntcEQdmFgqOAiEA/w2/QJf3tvUx7bUk1u9WOeqUzGuBQbGP2FjKfe6i7aw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":780720,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfz6qsCRA9TVsSAnZWagAAf20QAJvsc619qZlw+ZJW3ffY\nN2Q6FcmhYzozmI4KQMPLRJzPRlBZ5h8i5szuB4E5nMgh5pE7jzuMnP03TeR+\nhLus/4yN7C5rlpIW4LReRGPQknRB0Eru4D28+VrPcKlok8zuhBNTj7DTs0/c\n8fxqGJCKKQFr5yCUomyZ3QISLCGhhS0Fepw8QKhtNSb2ajqidqd/P+mTsj0a\nCepbo10LuMGxHpFskXPtDHXwq5pWGIQ6AavlyZqP/ZbuzRC0jfyzEP/7j4Wa\nUEt4WbdQCVRCfwwqANWi26aT+t3YD3IjaxyJ4JpN8VHRC342U07+04j29amA\nQWnT8tvDymWvMz9Voz2ASFIkYxpyUCkhiWXYXmz5e70bElTUF4PCavUbRCCv\ntMScmcDix7nLNZgKf292gmnHupRc6b0YhXVUYTK9fYPp2475rKJPuSMq7RRp\ncWx5ve3aVO3jer3MvlQzuIxSwUYRjUodkX3FerqqdpnaOTi84HF6TxkmBZ2M\n3DOweJC8ISL1ZmohpfUga/Qvi0dpr2JGuyFNXeqkCTQNjicB/GJhSxW/uBKr\nmvqoLhDTXVJUIovFqHK3USj55gzD9NXnM0B2xqx4V3VdadfUQfszCyymI/Pq\nSCJjM/7Nfx2ijJ6RfAwAD4+qdjq/cCaP0bPwOQOsaTd9n1ERrbGhuJMa4LKt\nPB7i\r\n=7RFh\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string)|null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"8a3ec1a501083d67f1c342fcf5b11a765a586ca0","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"9.0.0-canary.afb68894e.0","@material/rtl":"9.0.0-canary.afb68894e.0","@material/base":"9.0.0-canary.afb68894e.0","@material/theme":"9.0.0-canary.afb68894e.0","@material/ripple":"9.0.0-canary.afb68894e.0","@material/animation":"9.0.0-canary.afb68894e.0","@material/elevation":"9.0.0-canary.afb68894e.0","@material/typography":"9.0.0-canary.afb68894e.0","@material/feature-targeting":"9.0.0-canary.afb68894e.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_9.0.0-canary.afb68894e.0_1607445163691_0.6283785267784177","host":"s3://npm-registry-packages"}},"9.0.0-canary.fd88d40c2.0":{"name":"@material/slider","version":"9.0.0-canary.fd88d40c2.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@9.0.0-canary.fd88d40c2.0","maintainers":[{"name":"taylorv","email":"brian.t.vann@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"1cfcbb4da4342b515b8b7494323a5617f11024bc","tarball":"https://registry.npmjs.org/@material/slider/-/slider-9.0.0-canary.fd88d40c2.0.tgz","fileCount":38,"integrity":"sha512-+HuhiaZBFYUbHFyr47NnGufp2gEnL1fgbhZwZf8MVd9XCneOnq8nDVZl1I4x9nkJ3xQXaXowOwlUEQRGvP2BtQ==","signatures":[{"sig":"MEQCIC4sfxOzcC0qn+eZg+25C6Xj5s6bvxVaimAYAD96MB63AiAwRKgPwGk8li2b36m+HIPKgQ8k9ABqPhyIm566ZSoQMw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":780720,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfz63LCRA9TVsSAnZWagAAJ34QAKQscyePpjxrEoViVPBT\nTfGV+VZ075H0pJXqF/AJguJ6pZy5x/BcGO661zX67TEsIerZgpfBttV6S92p\nCHDHmCGqxRiZdUMQsoJaI07JWxH4hXcVnRdcj+ewjDs3IkoQlTw8QrnyptyD\n1Ola4MpuydaauiYeL+ThUx+TVqOetDsJK4CuGUx8LiES4r3qTwKotatU8CgI\ngBZp84aAozrAuz+1PGBSHe2emU6D2bqETmWsCP2Yxq3zQtE3UQ1+S6PBBtGn\n2AK5yWjPjg+Wk8vSS4q2s5yo/+qhaINcAZkRBfddoXO7IEVJxgWXYXdlpHSi\nqnMV2wQtAan374gt02stX36xdUqt4yre9Ymg5V+fuuRZ4mIr+rRocYXPHAF+\nZburUNDrMnRAmLdMathCzeH8wZb5vg1t9+GmWCqXxuyeQBKC+lLB4ihE1a5+\nshV0lF/aMoVC3+ofBWeRJUN83oCT6PZ43NqR0dOGeuxtZUgKkw7pQ0iQf2xE\nB23fdoIb9aeZB0CygiAVJaF7p32EBa7Q8NQFZU2hTWnA7MNpmzoC9/y5aGjY\n+luKoPOXy7ZTRYdVSep9ArfX5vtCn6dDnHd6Agz7Y2Z7lYCCvPb2RNP7PxNl\nqIu5vmVtDeha9vAvlpKY7xFT4U2JQZ+Ba4wHAsLUS+yr/wJqIf+DV7K3llPD\n9aQH\r\n=8/+X\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string)|null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"b0f8299700bd0ac44ef5acfdd0234b464d837131","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"9.0.0-canary.fd88d40c2.0","@material/rtl":"9.0.0-canary.fd88d40c2.0","@material/base":"9.0.0-canary.fd88d40c2.0","@material/theme":"9.0.0-canary.fd88d40c2.0","@material/ripple":"9.0.0-canary.fd88d40c2.0","@material/animation":"9.0.0-canary.fd88d40c2.0","@material/elevation":"9.0.0-canary.fd88d40c2.0","@material/typography":"9.0.0-canary.fd88d40c2.0","@material/feature-targeting":"9.0.0-canary.fd88d40c2.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_9.0.0-canary.fd88d40c2.0_1607445963137_0.6471520617937749","host":"s3://npm-registry-packages"}},"9.0.0-canary.ba9e3109c.0":{"name":"@material/slider","version":"9.0.0-canary.ba9e3109c.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@9.0.0-canary.ba9e3109c.0","maintainers":[{"name":"taylorv","email":"brian.t.vann@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"763f79119c88df2eb7f0623c546817fda224ec18","tarball":"https://registry.npmjs.org/@material/slider/-/slider-9.0.0-canary.ba9e3109c.0.tgz","fileCount":38,"integrity":"sha512-N43SBsXfku8gnIz8UrBMdFEoMaGO6vT44NFhECuROpa/7vOfaIfQvRm3/bQIBJun4omtiW9tHjd2GM363OmOoQ==","signatures":[{"sig":"MEUCIF3HDlQm2gf2atUBOacu1gRXad+Qhk+RrXkdLNEbssZ9AiEArsc2THCqDsWVHxAv+U+PbnS/Gcm3jhbiWIO7biyepuA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":780720,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfz86ECRA9TVsSAnZWagAAR1EQAKCfYoXQp3RX8k8a9XQe\nb+u8vcIAy0EGm7xca3iS+7DjHK5ZQ8kThIsbxaAYKlnGobfWuQnFZJjzL28b\ndDCntlmSt0DBtKXIewbIGjcH2gnTTMuyXDnimtm7EqtBLj1jPK2w7htYRmld\ndk1kSL6vAm2zxxDHwumBSG5C9o/ePX2zoIglWY8T1mrCkAuMM9SSsdWAQQrE\nYMr+L0T3CsbxW2iI3OFX0qHVtZ1McwyKeBbXTVpnxX4eCXImNRaChNb5F+sW\n+v1m9CVbo1ihdERN7Jr9RnatrjKk5RDrmE1QaVCPIOtUMJAqLfnFFHNkLD56\nbGXwWkzmNB6mVnwXM4LR5ofiLOXp0sJVIGKYi0AdVYKO2tTZMKHXCbrZY+ei\nQdc1NkjOlSHgqBoI43gSlacyTQqABPutqaK2h4TzU8tMT0fLZDva1ynYv0D3\nJrqTMFKkwV6d+NNBlvWpwF4X1DYBd8Y1fU9UyWxYB/vmXMGYfrYVkIukYpKJ\nnyUfG/Qj522dVFmin2FESi5ddYrLKr8P3SKGhz6RRU/vEY4QSvqMtpfA2SML\nRzIRjYX9psM8J/SM2oC8l4s6UFNzu08R0ZlWaeSAgVJ1p0FAI47BTeB1d0/f\nMXpXdfep5cXyxIEioLdi+DsTL5eBUeOfHurAlEBdmq1tvbbBAiK0nqCJw7Cl\n8lMZ\r\n=HLRu\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string)|null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"84bc4a2a193fb62b5721555a77b59e7bce321bd3","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"9.0.0-canary.ba9e3109c.0","@material/rtl":"9.0.0-canary.ba9e3109c.0","@material/base":"9.0.0-canary.ba9e3109c.0","@material/theme":"9.0.0-canary.ba9e3109c.0","@material/ripple":"9.0.0-canary.ba9e3109c.0","@material/animation":"9.0.0-canary.ba9e3109c.0","@material/elevation":"9.0.0-canary.ba9e3109c.0","@material/typography":"9.0.0-canary.ba9e3109c.0","@material/feature-targeting":"9.0.0-canary.ba9e3109c.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_9.0.0-canary.ba9e3109c.0_1607454339552_0.48667304877588546","host":"s3://npm-registry-packages"}},"9.0.0-canary.1085c3b2d.0":{"name":"@material/slider","version":"9.0.0-canary.1085c3b2d.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@9.0.0-canary.1085c3b2d.0","maintainers":[{"name":"taylorv","email":"brian.t.vann@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"8928509899d3d349d5618eab1df3d29d2c258d4c","tarball":"https://registry.npmjs.org/@material/slider/-/slider-9.0.0-canary.1085c3b2d.0.tgz","fileCount":38,"integrity":"sha512-O3x8LQsigURma1son0Nplhj6e2TXP7al2iL08d3gZ8WHzxiXxAAsorpsmC9VyfxjldcIqa0H8fH6fn6pdl5rBw==","signatures":[{"sig":"MEYCIQCsfvkke5Dl9BMSIjLIZWRy+lJkXcmAGOdwMnLREJODCgIhAOnE09XmT4gd9fhQthn12t4yqjdcCVexdwE4qURBinFp","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":780720,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf0SFbCRA9TVsSAnZWagAAPlIP/iN3qkHEkkTxph73HGXw\n61vKsZ+8C7IzzIbqv0TxeoAI4eiFs5iN8DxO21htcMX0ZcVXrWzsCjtTyzbC\n7J16gJ/jSnrYt2A0OH8cr5yBVZyFNuzyZRNgxCbGrTz/7cWpwqioGYxWbqh7\ndcTQJ8/jzSUzfusJzNUYF0GDXhkIRtq2m1+Gi8YgfY+nHUN+rHNwKNdtJs9g\nlTiapQJBynqwpgpJu8+2EPVO3Yx+g3MZkzHZM5sKo/OG2pjYXSOBShaOWKRu\nPV8JiDl6KS0njKKKymyi5252nx1BSUVEf42J2vt9csWpjQ+b4t7wSRDe1DbV\nmZb4hHfpT3Ow4deVjiqIIpeoMKzKrOI7sKWQyzEp+zLkoFqhFpkwUPS2wWdF\nPmxL/kBoFDHTzBp15pd7Cwve8czfO+//byu97EbYjn20UcAVGymS0pgSTTFe\n7+uK9hlE/CmHsUgR4beCLFWVZmYgbZfbKAk2h/iTxJKGWWnkJpVrJkWag4l1\nK0TaBiPSl9zo54UJouUGq6x7v9RXU9V8XWclu3xchHrDf8wtovw35pIfM32T\nv9MSgRf+vUKr4YxrHutbAqtBPJ3qVumXLOi+f7poI9GmYzPTIcAz550WsntC\nOdF44C4dfnIQxw4P297mP4ull1HdM+7e7CoCBu6sILxCn0r9+cxHjRYxJsvr\n0xS4\r\n=Jd6W\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string)|null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"a223e0b83a78bac523ca498cc8389f361cd0f4e3","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"9.0.0-canary.1085c3b2d.0","@material/rtl":"9.0.0-canary.1085c3b2d.0","@material/base":"9.0.0-canary.1085c3b2d.0","@material/theme":"9.0.0-canary.1085c3b2d.0","@material/ripple":"9.0.0-canary.1085c3b2d.0","@material/animation":"9.0.0-canary.1085c3b2d.0","@material/elevation":"9.0.0-canary.1085c3b2d.0","@material/typography":"9.0.0-canary.1085c3b2d.0","@material/feature-targeting":"9.0.0-canary.1085c3b2d.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_9.0.0-canary.1085c3b2d.0_1607541083156_0.006694265346711914","host":"s3://npm-registry-packages"}},"9.0.0-canary.c5dda809d.0":{"name":"@material/slider","version":"9.0.0-canary.c5dda809d.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@9.0.0-canary.c5dda809d.0","maintainers":[{"name":"taylorv","email":"brian.t.vann@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"5a5c0856d29e5ed7daecb16f92791bbb59b368ae","tarball":"https://registry.npmjs.org/@material/slider/-/slider-9.0.0-canary.c5dda809d.0.tgz","fileCount":38,"integrity":"sha512-fPFk7klJM4v9sKhCUPTQDGOBNor+mt9oAM7P6mwRezZTHI3HPCowClKGLAsdAaO12YM+yCv2LPJxgJ3J3KK9bA==","signatures":[{"sig":"MEYCIQCFVjYhkSTGGTVl6QZ+EK8yPhogIBEQU7ePc+3YYyGoTgIhANOl8OVHccdT34YT2L+D5yfUsXsuTyZ1nKi+yBFjH0Qw","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":780720,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf0TiGCRA9TVsSAnZWagAAYokP/1Qt4dKSxt1WbV5BulI4\nrawErYikszCDRvcvehNkc+RP/jw2t306uNcrfrf6O1NNzVF6OO4sT0fHdBx1\ne+5oW0+q/9AvLkD5q8BOvUNnGyyjSv6OGHdAxULKh9uLnibWlqgJNZIX2D6Z\nFx6LV6mwCMzQttLt74Rt7RFYtcAeSYRRrkFlea6fKO7Y51v8vbdjv6ywnAHc\nF9tiFC/qShGeA24s8sqFf2omPuOTfzLHdg6Fka5V5dj1Pq3/ww+jX/J2DnHE\ndxh5OsHOazon6nQpOITSf3I6tHHb04nbe3qZYO911GjZZJD4fYl73+skmdKe\nqwzNUXlYZxTRyIvsAnS6uyrEMhfl1G0s4mEvZ9tF0nhwHZsmzzwUuBniub0J\nK6PeAF13z7PBPkMoMIn62DDAHpnUADNV/jDw3njWI8sSWDnR6N6l83xAhZ0M\nokVE7nEC90vEKYPHpAJHAhr28owvvTws7WiX2DWpwu0yglccV3BtOlTOhLJC\n+M3Ze9Lq+d8199i+U8OB7uig/tJRP9es3FDcNgFLsc8hbfuxn4hvnvMW0Dfa\nDgXo1zSUolqsmrAZz8SE9QkBjCkdOTLFN/Mg/PI5cq558c4ai7zbyzEH9Ew/\nP/8pKYYAluu6iW6G7tl8LOxvnZRquHBSQn7K6WPOmPYuhaLDmCMWJ4QCNP/z\nEoMS\r\n=KJep\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string)|null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"c2bc7206e40f2f31377a09e53af457109018ff02","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"9.0.0-canary.c5dda809d.0","@material/rtl":"9.0.0-canary.c5dda809d.0","@material/base":"9.0.0-canary.c5dda809d.0","@material/theme":"9.0.0-canary.c5dda809d.0","@material/ripple":"9.0.0-canary.c5dda809d.0","@material/animation":"9.0.0-canary.c5dda809d.0","@material/elevation":"9.0.0-canary.c5dda809d.0","@material/typography":"9.0.0-canary.c5dda809d.0","@material/feature-targeting":"9.0.0-canary.c5dda809d.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_9.0.0-canary.c5dda809d.0_1607547014071_0.3063264336968299","host":"s3://npm-registry-packages"}},"9.0.0-canary.f5f1bd86a.0":{"name":"@material/slider","version":"9.0.0-canary.f5f1bd86a.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@9.0.0-canary.f5f1bd86a.0","maintainers":[{"name":"taylorv","email":"brian.t.vann@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"2910dae5932c88ca20572d9d6612b30ac70f959e","tarball":"https://registry.npmjs.org/@material/slider/-/slider-9.0.0-canary.f5f1bd86a.0.tgz","fileCount":38,"integrity":"sha512-zv2OM08cXBCIk/LFn9Xv+jY/I/6j3Mu3mTdRJJeyJACf6aS5YuaU/N9vVKtD7cxkhUhmQplSHWLmaogkB+hWOQ==","signatures":[{"sig":"MEYCIQCVlLLtju2jdOoWZM0hxvCcbEY3tDvRAuofeZ/t1tnkfQIhAPJWHXe7oow1qc46qCoFi/aF2GHgadynuaa7QRlJUQIV","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":780720,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf0TzVCRA9TVsSAnZWagAAYd4P/1L0IkJgaxyd/yjMb8rz\nWe/efqYtMV+rTryMTPWFEOTiPLWWJU1eT61OigxSFJ2IQpb6FQisWFGeNb3H\nhZbz6Rm5Ky0sFq1g+3f97YowS86eM+FmSKMIw6bB9iVDRPkeP5TrLxO4Iob6\nG8TVJxjxqcKdW5ino0GtX7D2XquiMVAIppWRsHHNMqVYv2C3WyPYEzFFDC+t\nDwVMLVjq7isP7AW4ex8O4im2suoGVAabNKQj09L8BDQtVKGG+ghUbLo15Gzd\nYE6aCCptsDa8zau+jM9In2R+LJ7l8HQP//a+iZ6aLaO7ewE524FqusaIRB1y\n9mqVtY7x3GFga1tmGGRaZlads527jmqZeirzVJ8342BSKzWpwllTVSuZYYn7\nMYXLZm5gccDoNtQsjHqsbV/CyKCraHQTjj3FFb62Y8k/k1A/JjEInAHgIsoc\nweD0vQdUg1LGtYA67fSJg/yqfNZVgxnDev1Cj3yppKl2y8cvXNjUVn8t9uod\nxdRoFbMu056uqsSbaS9gdKHAJ2/BwQGvEjBkhX4DH8WffgVLtSE4d39gvSmr\n60Kd+vVoiQVGRrvIlBlydZl5ntlMrqjXWscn8WOha1FHePOJ0Dq59f06h0Le\nvqEQ1DfekZYqrbqdAfAa5/IMmmTfnoeFYJDQOh0uqFHfu+Xep6wflBfq/GVZ\nDXfk\r\n=+lr1\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string)|null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"86cb1fcac08fb433af0662cec8583dcdf435eede","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"9.0.0-canary.f5f1bd86a.0","@material/rtl":"9.0.0-canary.f5f1bd86a.0","@material/base":"9.0.0-canary.f5f1bd86a.0","@material/theme":"9.0.0-canary.f5f1bd86a.0","@material/ripple":"9.0.0-canary.f5f1bd86a.0","@material/animation":"9.0.0-canary.f5f1bd86a.0","@material/elevation":"9.0.0-canary.f5f1bd86a.0","@material/typography":"9.0.0-canary.f5f1bd86a.0","@material/feature-targeting":"9.0.0-canary.f5f1bd86a.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_9.0.0-canary.f5f1bd86a.0_1607548117016_0.6736205047236308","host":"s3://npm-registry-packages"}},"9.0.0-canary.00f38200f.0":{"name":"@material/slider","version":"9.0.0-canary.00f38200f.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@9.0.0-canary.00f38200f.0","maintainers":[{"name":"taylorv","email":"brian.t.vann@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"5755007a847e005471200b3effa6de65aa62737e","tarball":"https://registry.npmjs.org/@material/slider/-/slider-9.0.0-canary.00f38200f.0.tgz","fileCount":38,"integrity":"sha512-8jQ3HCwl//8W8hKh8glgOTJMbBuJOGXL+6jyhpyRgd0nld/aHsxjIWVhYlXVrSuXY57sxHQf6WULUjbOB++x/w==","signatures":[{"sig":"MEYCIQC1qFTBT9IAwcRXBHERJafPtBERxJTrWE6r8Q/i+IZkMgIhAJlCGCYFG3bpDgAQbEOZ8h3izC+UD+OJBWF1ACeBD/1M","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":780720,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf05QlCRA9TVsSAnZWagAAqGMP/2qFOPNglh69x50sLXzL\ngxo1wDKyZk99s3kQ03XOVSoC2x5nQoIuTHl5MCkJpT5Y4MU1OvlFWAhxCjaJ\neL6BEEQIPHMA73JBiQI8MZbImLIsUJkTO6idOyzS6IVpIREriZxhQz7i8bjl\nERtml6s5Wf2xgKfEnxmy2rYvbYYzhSke+FwdlKVBv/6sEMMLeuzUFWt2fXr1\nXc3WXU4JDfL+yiAhfQPzrtx8CKcPpGTucLxgJfamXQ9vbgnltogmNtIGE/13\nQ39KePtd59S7ZbatD50ZKRWV5KOHNfF/uwasvxpRwEkt40ptcOHY5ThFjcYz\nUJmomnt8bTEWFgAkTZNdh8ch4OdUK9wlZxKAiUJStwxohF3vBq9bv/BgK9Xo\n/v1gkA6pAXnVT9zY016tEvjNratY5H33ri3hkytEikxYwAzJUC4HISkJR/uD\n63m/xaBSQEHV6w0bZl4SHGUfwqL8NUDtSqBAjpvW4Xv0dSxF492as9o2eSwR\nkl2vJMLgBKghzjSqXwDuKGkbgND9OcB+4ggSYFdwaLSrNjUn4r4J2wgInFkF\neExcAK9/jRDSWcSErDAD6nvd7jALX1O28Bw3v+2IzMlo7HQM5RxL73rsaimI\ndMq4hSY6o9Lx4qVSVZKRaeCxLNbFCIFCKwkCBpKqBBi4ElmRMJ7Eo2N8vBl9\nusCk\r\n=zdyk\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string)|null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"2771c0048541c1dde142fd7f565741f0dbb83c20","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"9.0.0-canary.00f38200f.0","@material/rtl":"9.0.0-canary.00f38200f.0","@material/base":"9.0.0-canary.00f38200f.0","@material/theme":"9.0.0-canary.00f38200f.0","@material/ripple":"9.0.0-canary.00f38200f.0","@material/animation":"9.0.0-canary.00f38200f.0","@material/elevation":"9.0.0-canary.00f38200f.0","@material/typography":"9.0.0-canary.00f38200f.0","@material/feature-targeting":"9.0.0-canary.00f38200f.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_9.0.0-canary.00f38200f.0_1607701541015_0.8785178782875935","host":"s3://npm-registry-packages"}},"9.0.0-canary.ac41a5729.0":{"name":"@material/slider","version":"9.0.0-canary.ac41a5729.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@9.0.0-canary.ac41a5729.0","maintainers":[{"name":"taylorv","email":"brian.t.vann@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"5143e281a84db5a12437aaf9ae500d9135cf05c8","tarball":"https://registry.npmjs.org/@material/slider/-/slider-9.0.0-canary.ac41a5729.0.tgz","fileCount":38,"integrity":"sha512-s6THXQoImgOVMBK673bSAmHATxdJEjwh1Tiep2koM/s+q8EReD/OxFtj/enHrfSZvZ1I5WssojtRsPOtj+ln9g==","signatures":[{"sig":"MEYCIQCle/gtgYZSdTOjTz+M/08tUVBVVGtgbA8MgBTf1XXltwIhANxwsAVAJe3+HnhySQpJHe60r7RxVMH5W0Ie0keyOPXu","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":780720,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf054wCRA9TVsSAnZWagAAPx4QAI+9k+IkZ6tOXS6N7lvr\nuNqeJ/RW/1cFsAUYCzOQZBDCJsZaODiaK1DYnGv5jsjL+SCeLfkEfAm20DpE\ntXMCnAaLNvzxZbipNw2B/wbrQL7f8IjwDBg6S00ONgKd8XVVwFZPPmlXWsll\not1cORRzt0WkNIkhh6WWpt/JE/B+QGUTFgFKDFp0+E6xrPqLrwku3+VyuKLx\nnvHcltQ8lFiZoFbaVWGbF1YIr9GNUyYP1SScEwQYoPXRlA2IOmzSHIYs5lc5\nBvTmalG/oHeV66lMf9t5rUlPJ51G1tl5iu82vipFRkF8qzoSI21klf2p1EcS\nV4tpRnIgZGwWW1ny2ujcdMPrMtC/3bxHMhHT9NNQ4lqIskM52eoWLdG0ZwmN\noR6+It4Zl/QtDZI/AozWvrucg1g10K4EoNcLSsTqbhen233tf0y9SjgNONuX\ntEJkqEEXrFzCqAGL7gLzuZ/BZBLclkOMIYFaFIK5cQeED+IS1kLKc2Vzx0dM\n6Q32mxcbeBFqMCBSaHNvT0BpaN7z1k2RB0TsIBxpU3EHkovTTYy/z2qDAIel\ncx3loMIXQdlb+PqfGrCtaI69WjucZvnR1aZrb/6ug+7oW4nbbcdE1OLHJAIb\nZX2o/nnYP95HhdbcT4BV5j/9A5PlMGgX5JVuF/bye5JsYlR0O5YLBbO68krv\ndHUo\r\n=PwUv\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string)|null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"a8313ebe32ee1c67ef38d5e9ba2b5a4ee2d08f77","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"9.0.0-canary.ac41a5729.0","@material/rtl":"9.0.0-canary.ac41a5729.0","@material/base":"9.0.0-canary.ac41a5729.0","@material/theme":"9.0.0-canary.ac41a5729.0","@material/ripple":"9.0.0-canary.ac41a5729.0","@material/animation":"9.0.0-canary.ac41a5729.0","@material/elevation":"9.0.0-canary.ac41a5729.0","@material/typography":"9.0.0-canary.ac41a5729.0","@material/feature-targeting":"9.0.0-canary.ac41a5729.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_9.0.0-canary.ac41a5729.0_1607704111591_0.8905498820420066","host":"s3://npm-registry-packages"}},"9.0.0-canary.7fe0e4f05.0":{"name":"@material/slider","version":"9.0.0-canary.7fe0e4f05.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@9.0.0-canary.7fe0e4f05.0","maintainers":[{"name":"taylorv","email":"brian.t.vann@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"2f38d9ec79de69f6dece9085dba1215d24468870","tarball":"https://registry.npmjs.org/@material/slider/-/slider-9.0.0-canary.7fe0e4f05.0.tgz","fileCount":38,"integrity":"sha512-qNb6GigWvbnQ8DbyWVzSR9aWXvP7RG0AeQrAdZ09IaqKsNVgfjxwEJPPMdoixm2WODzGlirKpn3nKB5cqMkP+w==","signatures":[{"sig":"MEYCIQDTm+ndgFBDP7NNSmZ4spByfvqNxU98c6pCAX17Ube0GwIhANtYUUQalpn3dBaQY8z/cz+Gap4vD0QAD6CmDdVKKda1","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":780720,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf06bvCRA9TVsSAnZWagAA1T4P/jc4vno4X5+rEejaNA8e\nL/jh9+K0Mjws6DPzz8HHIEXvCRrhbJOcr2T661pEHOhuAWzkXqbuZSXbgrga\no/ypspJ2IY9zwJUcSIymxjikt7LBj2ycDmX13hkUe4njgZMTcKy+Qrht6szS\nmBXDTY+VtKr8LLqg038RFosJNRpr9VLOBu/Y4mnssJdor/pq0a4diGvkNN6S\nbHaR3g4dQMD1OIfGzBZOX8It3eQ4NMOIVA8nfKwBICzpuFompY3lnrH1wSOw\nA2ZHTadQdzesfz3VCZ+OXcCSzfvhcV0HKWCae4yuJ2Imh3XcU5+qLCu/VsSp\nil3wWHHPWgvmo8TIZlydg16oZgtOFosPLM37QrpYKmEBeC+08INqJxucZKwd\n3PZ0caQQMPuwTWGCI15BbcaobbPP/23wesr4fEhceGTK0gzsqmWOj620z8CJ\nywSHbZh8PQttGgLq1tZO2voqwZ1J/032oLdlR4HEMfiwJkjw4Zd0uxEOfLC7\n7lKHIyL6OcxCfzLEQbBtpwj300qVV+5cJBTwPx/T5wWhFsDcbSasjmqO5k3m\ncKd3rqcwOcdLEDGCse58babN6PwvoTzBhrK9AoCPaQ8D97jwd8px7EOJMrk7\n5NMxTTXyb/yHTogaHi/yuoHUONL2q6/5gbzTaVK9P4/bZigluslWUiAiAjFk\nmNeO\r\n=nl09\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string)|null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"174435b67952da2f175e31e1db54647a2722499a","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"9.0.0-canary.7fe0e4f05.0","@material/rtl":"9.0.0-canary.7fe0e4f05.0","@material/base":"9.0.0-canary.7fe0e4f05.0","@material/theme":"9.0.0-canary.7fe0e4f05.0","@material/ripple":"9.0.0-canary.7fe0e4f05.0","@material/animation":"9.0.0-canary.7fe0e4f05.0","@material/elevation":"9.0.0-canary.7fe0e4f05.0","@material/typography":"9.0.0-canary.7fe0e4f05.0","@material/feature-targeting":"9.0.0-canary.7fe0e4f05.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_9.0.0-canary.7fe0e4f05.0_1607706351413_0.9772830512210404","host":"s3://npm-registry-packages"}},"9.0.0-canary.9244508bd.0":{"name":"@material/slider","version":"9.0.0-canary.9244508bd.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@9.0.0-canary.9244508bd.0","maintainers":[{"name":"taylorv","email":"brian.t.vann@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"0a182446f670e2b54f10bb2586c259dc5214faef","tarball":"https://registry.npmjs.org/@material/slider/-/slider-9.0.0-canary.9244508bd.0.tgz","fileCount":38,"integrity":"sha512-MqKIZVhxQNC2qxda0Tbo+sIh7uk43k3OSClgVS7JBM2ucLkqOqdbw3FhMBN0trmiY9DKLLWfF+b2e/WAjxCokw==","signatures":[{"sig":"MEYCIQCn5Z/TjZ0QeZ3JL92qh9Sd7uc/3AC2dnGGj0uK5VaZZQIhAL/YH8LO88fRQsKR3vLhWlfssHex24Ox7KzDAOow3m6D","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":780720,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf08OACRA9TVsSAnZWagAA2skP/i6czIP8/HvSgudW6ICT\n+iHFV6AiAt61hHVT2zx+GKIDi+Y2V0ZKoj2cIB7pTVE3QJCNnaeGzB3Bgbnf\n3mbt5RDbtQd+y52QRBPQ3hf98cq9YBsdTSJgkV6YHepCIO4KMo/ZZYlbKvOO\nmcuD+u0uNZVb0G0BFu2S880u7XjTlko94uoenSm8Vz9y1TbcPoOTUSwnvPX6\nrZSQpWiItBLtDM4g82uiXAK/anIsfWOBuicul1mhH69C446buFGpTn9eDsSy\nb1rQtbCUmcFo+m3bKGPiK0RFWgYFpvwlRv5GLNDWIvOhUebFFrVFcgMJaldI\no7cNLuCAZgwu+L5Mlo5OakiT/8xKJacTgIzSoWeCrc1vulpsZjlpm9ux3Q/I\nDDnstkmHDhFrxdVyMmtkpspTM2MMO2Al6rXyVRswhu6Wv3HHGunQR+sSR93d\nTKQJHRADZ4hRt5PmGsu+q1HJKiguHI6K/i6rqmmdDdoArh41prl2Ce2UdAHg\n2PFEkcBdxZjEVIde4hLMlTktoKOpmshnQGWaqtOm7/RDCaM4qQW7uvtjX9y8\nHQT2O7zHOf5tbPfz34KXNmD/MVEsg1x5PlZ8wdsdCKRlFcWGs06sZTgYjF53\nlq4+xzYJd0K5PySU42R3qSkAnOTFDjN/HLnHRS0ITbogDHtDaHtX9rKuNnA6\n2Sbq\r\n=GzaB\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string)|null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"8d704729c3b4ba17ed088d900fb2ddfd57d5803b","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"9.0.0-canary.9244508bd.0","@material/rtl":"9.0.0-canary.9244508bd.0","@material/base":"9.0.0-canary.9244508bd.0","@material/theme":"9.0.0-canary.9244508bd.0","@material/ripple":"9.0.0-canary.9244508bd.0","@material/animation":"9.0.0-canary.9244508bd.0","@material/elevation":"9.0.0-canary.9244508bd.0","@material/typography":"9.0.0-canary.9244508bd.0","@material/feature-targeting":"9.0.0-canary.9244508bd.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_9.0.0-canary.9244508bd.0_1607713664077_0.9090261556068431","host":"s3://npm-registry-packages"}},"9.0.0-canary.384a8eeb1.0":{"name":"@material/slider","version":"9.0.0-canary.384a8eeb1.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@9.0.0-canary.384a8eeb1.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"00fee9bd702491183cc469a2a39571cbd8b66339","tarball":"https://registry.npmjs.org/@material/slider/-/slider-9.0.0-canary.384a8eeb1.0.tgz","fileCount":38,"integrity":"sha512-MaGt8vMTDvSiJ98cJeivrOvEa5dCjXTDhYz0R8SDv1OB6NZbb5WfHC/wbXA8poXez7u8KVSR8uoiUR/bt3U5og==","signatures":[{"sig":"MEUCIQCsREo3PY5O+u8eWflGkopx8lGGLJ6Xx6xVV8typbK1XgIgEWd2/eANEBscE4UDC0wWuZtEj78ZlyuDVczdGA+uANk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":780720,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf2j2TCRA9TVsSAnZWagAA390P/RhAiDOqsbSn4vfxhORl\nrXZGTGPldIwFmTE+ieFbXo/q/iUEbzPahZzkq1G4wiukqQs3fbbiExyZdVvN\nFTcTeq4LtFptcNEW60Q/+/lGr38UfbaLTekdvEBPcvJrxVN7LK0UsRAPeYr+\nJ+2xh27U7uWWtdBvnacY3RFRrjqB7HhyAYaZ8eHH9C2SlybHd5JET1VwBGhJ\nd8DXicJo3nilqMDaIc836Mklt0U5TkUl7oFb912hSWUXb/0bRh8AqglX07d5\nyL3joTuShj/2xFKsMdjSuT7vtMuPyKIeK6VOB4ZifYi2LiNKIVaqpFB8JtLL\nBKVhaU/IWPWpz5tY8YFlWfAEy5yvjDzXTWufn+V6TT7uB7NfsIXqGRMhJK+r\nq+Meb9+zc6jbHWijNSdnzVdKpWOh9zDs+MZf4w5CW7r1zzmr3I5CqdaCqkjX\nEjI7KHDNhlbUi6ZU7bX7MBiB1rDvuNMOFoLsGUWT8mP9EWZsjU/X4Xdlh8Jy\nHjoH5cgrrseEAnNwXaPxkXMFzuzWcaULGSfKjTaXMALwtH9bSBP9HlwilF2j\nAinbewERuA2XFl+vCah2Tnn4O6cMUYjzDAoTP8iKPcCatyZ+VYohW7HnnPsz\nEdms7BN4gX7pi6PZvLagaKt86i03dzdz8k0zd0KuBSsdNsE1uotM/8MrwaMn\n5vG+\r\n=3BI2\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string)|null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"21b2ddce32077f19c001df17ebc3c8ca9c48f8e5","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"9.0.0-canary.384a8eeb1.0","@material/rtl":"9.0.0-canary.384a8eeb1.0","@material/base":"9.0.0-canary.384a8eeb1.0","@material/theme":"9.0.0-canary.384a8eeb1.0","@material/ripple":"9.0.0-canary.384a8eeb1.0","@material/animation":"9.0.0-canary.384a8eeb1.0","@material/elevation":"9.0.0-canary.384a8eeb1.0","@material/typography":"9.0.0-canary.384a8eeb1.0","@material/feature-targeting":"9.0.0-canary.384a8eeb1.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_9.0.0-canary.384a8eeb1.0_1608138130935_0.22378510542758812","host":"s3://npm-registry-packages"}},"9.0.0-canary.eabf9d5c2.0":{"name":"@material/slider","version":"9.0.0-canary.eabf9d5c2.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@9.0.0-canary.eabf9d5c2.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"3c1af6956323895b06353e11a200cda35ff47dfe","tarball":"https://registry.npmjs.org/@material/slider/-/slider-9.0.0-canary.eabf9d5c2.0.tgz","fileCount":38,"integrity":"sha512-Z2Sx9VNubW6xoUDvJPtGhB5MAoWpSjuuIDV0mOtasb/TRYcdTbyUTb65dCPUsnHeoy49Srd+rukEqbVgwefcYQ==","signatures":[{"sig":"MEUCIAmI5Sf08uLIyDLehJU7uxpRCBCvGa1v8f+Xxxm23psZAiEAj6C1T3GgHJHKC5VoybBLus1vTS9PL/4r0Ssg+mT7tVM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":780720,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf2lGvCRA9TVsSAnZWagAABfYP/3vcLaSfTZ57K0J0sqDW\nO/9u29A81KhB9RgbENXKLwaq6LplzjQVIjfEfugEYEr8afKRamCCVxfsGytX\n4yvM3SC6K9EdOqVxNogO+4+lvmxUfkSQjkCQhAc289i/xBH/aMCQ5pkipgj3\noO8Ix9Ad8fTEX9w3AHT+KDPXlD74GatD5Yc9LYTDCnDMlc9CB8PExjnw0bqI\nqN79nHUx9Dclg9kEOdXba9a3lqrWYdkb63HVtmmnKs0obUsn8oWu//at8m8B\nEN4H2qDUnXAxpZdSv4Wyn428jrekkyZVokzNzWAm+nU1v5v3W/7dyRopu2gc\nLwOYyEoNz9MV2okcmzh0xUE1TJI+Y4AplUb/an0TChmRg8m73toJ873wcEr5\nL7OVJXGVVz06ZEEbVsfndSeXl8tQro5ASAZFBtRwT125dGQqCzRIxFm+gDmj\nybN6qhHV9asIQO9qZG4KYCWp7GZOSjudMhu0sHT3+V2Lhs2tfNbyOYUX6Ft6\nC/0urujKuQwByCvrDVDyaQd1MQgRIhtsdjAPYGb5YZSabwBMTKf135s1N2RT\neFi9xrnwXMQF/MuYV1z/WsX8l0itSLWGSFuCB90eCVa5sW375hXqDqTK2SL2\nHgNhSgmG0L0SooxKEYjXEHLSSkWtJCivJgnm3v6fBals66BIsjyAQv5mP9rU\naiVw\r\n=x0F1\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string)|null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"78b3a67c04374ddb43be73dc4daf2613746d08b1","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"9.0.0-canary.eabf9d5c2.0","@material/rtl":"9.0.0-canary.eabf9d5c2.0","@material/base":"9.0.0-canary.eabf9d5c2.0","@material/theme":"9.0.0-canary.eabf9d5c2.0","@material/ripple":"9.0.0-canary.eabf9d5c2.0","@material/animation":"9.0.0-canary.eabf9d5c2.0","@material/elevation":"9.0.0-canary.eabf9d5c2.0","@material/typography":"9.0.0-canary.eabf9d5c2.0","@material/feature-targeting":"9.0.0-canary.eabf9d5c2.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_9.0.0-canary.eabf9d5c2.0_1608143278611_0.6709829273937535","host":"s3://npm-registry-packages"}},"9.0.0-canary.30fdfd06e.0":{"name":"@material/slider","version":"9.0.0-canary.30fdfd06e.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@9.0.0-canary.30fdfd06e.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"e267e1b9cb2d7d3a2600a54dc6bfe77ddc84c246","tarball":"https://registry.npmjs.org/@material/slider/-/slider-9.0.0-canary.30fdfd06e.0.tgz","fileCount":38,"integrity":"sha512-DkvNIeMncmZwRSsI4Gtkyzu2T+ysJSjjS1hmG1v9buf21VDyqL1ZPntJrgBiDsUzH6kEfGr6CVLbEvVE8mR/bg==","signatures":[{"sig":"MEUCIEI1WsUvqdR3RTukwtss7v9zoWZE0bJA+UJY2bmOGAUKAiEAp5+08FF9p78RWWNJcwdZ9J7OT8DqnHvb02+QU4rl3pA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":780720,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf2lsFCRA9TVsSAnZWagAAuxYQAIkf6gEiy0vEafqCjBV6\n5i3vLOtzrEctQ7tEKcu3D8aI4IewsrXHk/sjWNrOmv1/TPF1OzHLzxoDDjDT\nOoRo+gyZA3b6vKBP9rhwwAz2ytA7dUPMo6e/BGpgpoavE3sBSiha5JDqWKM0\n9/SGKlO6mNRNiuXs14+ubgtAg/erVJIV8PlTeYmb9WY359AWoAF5kafVUnZU\nNSin9DSeQbZO1Fesb45L3ThlmMUvim5bPwm9iQ0/BtL4c14eMfBbIc7HC2w8\nZZtri24h3gx3h+EY/oYBI+qTXHbcJYLBgNE02XWQXQAqK8CfiCXQYA73m52L\n2AeB3dj2vwCBrYqsL48yazj77EaPQRcIdFlWjdZfPkyo3UB06Hna4Yh14Mdm\n9ZAN8Rgi/Y6IsIVsd+nHGIFUXRCs5VnOOl33IAlIIg0XYgLL7GsfA8b/FWzW\nBQK3gDr55dJJCHw1ds3jCXbKh8ZidG5JYnZvvuKyFjJT2Qduk8Jhz7DE2tSb\n37i6GuXeIGSZ7nZM+5XcWRKoLqQ+aMXWowz9tbed9WTxDsRe9YLnqc9A+YXd\nQC5K5w5QEUP8w0StsUHcDtWybT+i1+xrRzNlei9rU+2/iXNo6agTxj43ag8b\nEk9pJIhCOEZm3oK4ED8Pph2rmzCQDtKuCgxdKD9rzVjjGQ+IG3mD2UM+IIU/\n7zlr\r\n=BPHX\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string)|null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"f9c9fe091a06230b038ac8a71ccd652c7c662b96","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"9.0.0-canary.30fdfd06e.0","@material/rtl":"9.0.0-canary.30fdfd06e.0","@material/base":"9.0.0-canary.30fdfd06e.0","@material/theme":"9.0.0-canary.30fdfd06e.0","@material/ripple":"9.0.0-canary.30fdfd06e.0","@material/animation":"9.0.0-canary.30fdfd06e.0","@material/elevation":"9.0.0-canary.30fdfd06e.0","@material/typography":"9.0.0-canary.30fdfd06e.0","@material/feature-targeting":"9.0.0-canary.30fdfd06e.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_9.0.0-canary.30fdfd06e.0_1608145669386_0.8434578815340017","host":"s3://npm-registry-packages"}},"9.0.0-canary.9590a8f90.0":{"name":"@material/slider","version":"9.0.0-canary.9590a8f90.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@9.0.0-canary.9590a8f90.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"9bccb5d80e52db1b40166f54e7f292373340d454","tarball":"https://registry.npmjs.org/@material/slider/-/slider-9.0.0-canary.9590a8f90.0.tgz","fileCount":38,"integrity":"sha512-YFhPk769vNrHtMP7iFn2wc9yqgZfC5Kq+WJ2RqGr2P2KHHbWSqlfx+1+3eiAaSqJISsg4rH644uj1yX4rAKIzw==","signatures":[{"sig":"MEUCICIaL/eWFFrxhjpQPlH2ufRzzctBaFOCDMNFN2tTJMNqAiEAo0OOpdjf+LNAQnl20nkEplt10arSKxkpM+Gg1VAlOn8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":780720,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf4i/7CRA9TVsSAnZWagAAuGQP/jI90LIkoZtutfYi4o/Z\n15b8hMQCosZ2brOLFdl3x4yV/gKJuyDR5ZSp+TXrenRs9Vp0TCZNdbMisWnr\nXlNKFGzwlCWAaT9K/28I4+rFCaNh2FvxUj3PecnY0OUsVbEu5pCgbTx2jHhn\nRPzqqofoSjApOprxvhQD5/XKUsiyp/t03FXuKIw1Z/yx+8dAsorHzJEqRe+7\nr48uBHHXP+CdgAJxiPTpIyz7VCBaaxuLYBXamV00NP4tqJkxPRM8Ak3B80I/\ne23Xoh9YrxssM3Ouvnf78yua+zKO/QTwPYduFCR1xMYdQcrcCvCDoBUfX7pP\nCW8B3iddM6R49wfWR01awp59NMs6Xp8lLyLgc1kZ+0G0gnUn4qDQdyM2yqFy\n8Mskx5MM7cc3oorgbSf9Bl/EfKm92Tp5yeZDBODxZzwANe05ZyEC9el0jMuV\n+JcE/6IUVKGmsJ7AhUqsxGezRseVGhCTwFUYWwZQVn0Vu80mN5WLvKnCUtzs\nPZhB0l3HIlN9fZDWCto3YO/dbnCDX9nAMb7Xx2kRyG4j+2TcVHI4YLhafi3n\nT7lFnzrhBpejeQ1ZtBr/dmK921+OrDxzcggdHa7MIPp2mWz3AtPoVkHfaSTL\n/eSX72H29RxpoJBkDZPSyKr/Xt+M1+s8tZiy2ZQhUbg1wgYJeh6uhN5IzNMp\ncg2k\r\n=R2Kw\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string)|null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"a592a11a03887b1e1535d4d49ea05db1b6f72789","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"9.0.0-canary.9590a8f90.0","@material/rtl":"9.0.0-canary.9590a8f90.0","@material/base":"9.0.0-canary.9590a8f90.0","@material/theme":"9.0.0-canary.9590a8f90.0","@material/ripple":"9.0.0-canary.9590a8f90.0","@material/animation":"9.0.0-canary.9590a8f90.0","@material/elevation":"9.0.0-canary.9590a8f90.0","@material/typography":"9.0.0-canary.9590a8f90.0","@material/feature-targeting":"9.0.0-canary.9590a8f90.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_9.0.0-canary.9590a8f90.0_1608658938769_0.46999427377744274","host":"s3://npm-registry-packages"}},"9.0.0-canary.f89d8b8f2.0":{"name":"@material/slider","version":"9.0.0-canary.f89d8b8f2.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@9.0.0-canary.f89d8b8f2.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"84fc0c0cf1098ac0cce25da20185dab646f2df90","tarball":"https://registry.npmjs.org/@material/slider/-/slider-9.0.0-canary.f89d8b8f2.0.tgz","fileCount":38,"integrity":"sha512-V6Eawwb7oVTd5c3ai8Ynyrp54LhtpcynzSRCnU1SKsqW3J0SoE/JBkz9ncTarBf9HLJgfOHHCB6Xd5zUajOTAA==","signatures":[{"sig":"MEYCIQCrruEjbZzpYoqyX4TS5TjYjCB/aVWUTea7iKB9Se4JTwIhAMnEWcWfAp4QQn5Kndl9UOy5vEa582YZq2K678d5j7Yg","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":780720,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf4nu0CRA9TVsSAnZWagAAjLcP/jTK9+LEplC6EJP2Ka+0\nNbUqsqpxIne+NFKCFNetCkQMqOs7NMjNwesNxlby3zS3q7MnouITUKwBppIy\n3LDbhmWY6LwqytNhAbObMZOImkezWeBX1jeuv1oV/u1P1BHo4CvMTerehUKJ\nNWSm/FBMi7XYISTfkFLV4WUS+HLj50i7qKV8+VqKHrM48nWlKn2e6Z52QUdL\nMD1Xh0hSOkBS/r6GF1KaU7b5EPgLHRgFIy+lsKU1yEJJCxsZbWu/6q1u8rZW\nH6Lf3TADQ40GDa6g1mljs6vgIoFuV97rDACPtO/wAy9pnnkbQBMeecYHvwvD\nVH5zJfJiiGPOcA7Ifqxk+HcAUZjA3ZKgBxG5fnVsl6qAp3hKaKpVqPw+l0Er\nZt1C/6tQnv2ZNcsYrkdYvyca1mNBWj4RPjF8lGE1RGHzM73pHlvHyBTmtBy4\n0n0EPCqBzKDZG39285wP18g9ye75qofUFr0hapSJPYcsl66TcC6bWrauQPnI\n4nyu3szuK/kAvO7jf0e/LU8pl1bAac2LG6euhiozPmo2iNtqeaHSzTyhdI2S\nsYCXd/RImwtA360XdR7pTWoYDc8x04zxJMK2a/FijUXwjD9fG68f463S1WiB\nHSXRWK2gUPZBIOS2mafXK8+nV3iQLPN2jSbToY2X6z6Uy/IgjT7NIpmnQ5vQ\nh+NK\r\n=X1tt\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string)|null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"e0d61155aa611a1a8573762d75379cbb25d2e7c0","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"9.0.0-canary.f89d8b8f2.0","@material/rtl":"9.0.0-canary.f89d8b8f2.0","@material/base":"9.0.0-canary.f89d8b8f2.0","@material/theme":"9.0.0-canary.f89d8b8f2.0","@material/ripple":"9.0.0-canary.f89d8b8f2.0","@material/animation":"9.0.0-canary.f89d8b8f2.0","@material/elevation":"9.0.0-canary.f89d8b8f2.0","@material/typography":"9.0.0-canary.f89d8b8f2.0","@material/feature-targeting":"9.0.0-canary.f89d8b8f2.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_9.0.0-canary.f89d8b8f2.0_1608678324185_0.1559234560142193","host":"s3://npm-registry-packages"}},"9.0.0-canary.fb194dd35.0":{"name":"@material/slider","version":"9.0.0-canary.fb194dd35.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@9.0.0-canary.fb194dd35.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"5c6eaac45ed8dd16b1fe1662d6d923e6b6f62be1","tarball":"https://registry.npmjs.org/@material/slider/-/slider-9.0.0-canary.fb194dd35.0.tgz","fileCount":38,"integrity":"sha512-SOgTxfoKqLmv66cjew/xix0TpW6BuPWPirpZLRj5pMoojpCeKMEYmTnsdtPeFqnJ62gTjlVtbiZsVuG78C6SLw==","signatures":[{"sig":"MEYCIQC3t3C6aPp/BJs/ng/Iz3c5y0mWEwBacR3A8gGW6HS2JAIhANTKnJJEhL2Rt68Pgm+M8z4jr+W5e9McmALL/cQTY0z4","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":780720,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf6kQGCRA9TVsSAnZWagAAcLEP/iWiG+B7C5Qsk8PRCOvm\nAz4dh4nMurMf8k1Fi5VNkvVMLKBp28SB9HwoYF5qozT+Y8eGZZ4HrXwOLccm\nrBFhDngbt+qjQPuHQH2qNKExgmxqgDpUgz0WdiYqD7NO+SaDSso77TdX0ZPm\npZv+NP05+6OBt4dZXL25auxrk/vwOCqzGFmcilHKb1IHclD4QUw7cUb+Kkie\nlxJa/px5V3dPRXzaGkrpEL8P46FGKYhxXNcTErqJFBBuVepmsAfPlsLzRd8M\nouLNOI12OIinLgsknv9k7c//s/fceMwkDo05eZqDXXDvtShoGSGeD+RwQPKg\nff7hs6eGcbXmn0QPS6V1auPeobDNL+2IaLIvFm9Qb6NcDMg8FM6EQX8W/YmF\nmvazh0JvFxf8EVQtig2W8zr7EkNxadnDk98JcHieZ4W36ceTHGnrINo8Ttaq\nsL0bfEaVQSxS8LuMli8DJHuAbFZPiw6CkQzKtld6DmSQIgZUt0+4dbwwlNgk\nhwoBTefky/ZbIVx43rnce+0hRvM63qnBDBPHI0gYvUT7K9Bjr9p3tvHpZJnU\nenzvwYdsjk9kSnC9BDU9ySF5IWzuWzNAl0LTBYmDg9zfhEVglIvTQRHx4ka+\nwb1dpbNyCXMrJPDh5hA7yGuFsiebgRfG7aTFeRlxuOS52zEFqSZlXW39yobn\nOioV\r\n=Iq1k\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string)|null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"57a5b34de1026133757436905fc54dc5b326d3e8","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"9.0.0-canary.fb194dd35.0","@material/rtl":"9.0.0-canary.fb194dd35.0","@material/base":"9.0.0-canary.fb194dd35.0","@material/theme":"9.0.0-canary.fb194dd35.0","@material/ripple":"9.0.0-canary.fb194dd35.0","@material/animation":"9.0.0-canary.fb194dd35.0","@material/elevation":"9.0.0-canary.fb194dd35.0","@material/typography":"9.0.0-canary.fb194dd35.0","@material/feature-targeting":"9.0.0-canary.fb194dd35.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_9.0.0-canary.fb194dd35.0_1609188357909_0.09617813972106104","host":"s3://npm-registry-packages"}},"9.0.0-canary.64f36e287.0":{"name":"@material/slider","version":"9.0.0-canary.64f36e287.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@9.0.0-canary.64f36e287.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"2e04c643ab13127a7d23bd16bc695a2f5942cd8b","tarball":"https://registry.npmjs.org/@material/slider/-/slider-9.0.0-canary.64f36e287.0.tgz","fileCount":38,"integrity":"sha512-3eoTUY7n02UqNzc/k5Ez1sa+vR2ZerXuncWDMkSWbnO3K8Saqtxt8iYwQ3nFnb7TLA9iZAvoyN4ZoouHUUHdNQ==","signatures":[{"sig":"MEUCIQD4alwSqWX7nTjtx9eKBF/m9AIQ1bi1elOmxXq4wAD0EgIgaU2zeLCPxP5uD26qIN5Oc0FSZzEaqWyXIlJzCpjNFl4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":780720,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf6kljCRA9TVsSAnZWagAAsdwQAJFMu7XWlgfT+3DlhDGj\nMemlbgF+MamJv5vA0ZpxSutaA6J9F6JITMAxrwVMaBJjci69wg9XQH4PdPCV\npFqXSXh8kUk7NzoKTrAtzeMtW/oxgNZ+TnX/t15WK0In7a/yhkSILhmIMrzG\nkDsNcO3OYIgrTMiOOQd3yIBUKzHRXAEYiuzKIjpCaWd8bAuLOjQlNNfPvy97\n2KQJ9tEkhH3G5ErMNfeXhx5yRuQOp6duSFZPWtj1iYModftIeevQqIh1V4dp\ncMyO7xwgiq8ltq2CAKvoVRZfEFYC/Jp7GRLpT8ohY1aUgekb1jIigKGnQk+2\njR5UkfCr76IJBkzU/MpXByzI/no4crUPVWgkMdMgGtO3JpW02dB8S2iXUxj2\n24IYxibZ7DyFBnu0wf9hHlTyRKCP9Q4E/trN4puUzrungA+bhWUGkoa+A3TX\naWYLVI8dDFF3Uy2WdAGy1GSF/AHzUK5hAf9x55+C8V+gE7b0QmkMdTXOOp63\nGdS7dHDQgY7JxDQfQylkW4UfhFoULLPfAr00FA9VUjf+NJhTkF4ysURnI2/g\nTVrC8n86MpDeJPIvbL9wTDtAA5A0U6gSXuNy0or+eQTRDh+QBJHdDzNz8D80\nemPKtXgsTPZ0V6G/6vXiIJ6SwjS6kD5y+YtN2EfNRE9DTB0jyeWXlOZibUJd\nwY6m\r\n=XWNB\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string)|null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"23f6770d284ec6c17b1aad9913827f8d456418f2","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"9.0.0-canary.64f36e287.0","@material/rtl":"9.0.0-canary.64f36e287.0","@material/base":"9.0.0-canary.64f36e287.0","@material/theme":"9.0.0-canary.64f36e287.0","@material/ripple":"9.0.0-canary.64f36e287.0","@material/animation":"9.0.0-canary.64f36e287.0","@material/elevation":"9.0.0-canary.64f36e287.0","@material/typography":"9.0.0-canary.64f36e287.0","@material/feature-targeting":"9.0.0-canary.64f36e287.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_9.0.0-canary.64f36e287.0_1609189730877_0.3552831648261783","host":"s3://npm-registry-packages"}},"9.0.0-canary.b7bbe7022.0":{"name":"@material/slider","version":"9.0.0-canary.b7bbe7022.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@9.0.0-canary.b7bbe7022.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"100814dbdc10940c84c77183f564a30964616e0a","tarball":"https://registry.npmjs.org/@material/slider/-/slider-9.0.0-canary.b7bbe7022.0.tgz","fileCount":38,"integrity":"sha512-60M3EhLaPlTEHa4z5T4tzMJ9q+5drz/QxzTACcauI0o1Qt1jOKMKgQw5hw/eTcsdZM2FY+OrsM/pd1elrCgplg==","signatures":[{"sig":"MEUCIQDJRFXIV9oPX6p6vli9UDUyZUk8tjFxTzam7XG7vS/gDwIgahZUTblXEj40UYbpWWFphlVpEWLB5VFw1xbgLOquNxo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":780720,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf63n1CRA9TVsSAnZWagAA2t0P/0rihjgSHeZ8dPZtH4i0\nYvrIan3xckIscU7N8tL0a9uAKjxcJpUOxZwAfEw6jbtJDPfP+ALrlxps5XhJ\ntdcd9Zp4OGoHeRKJ7x3l/H1jvn6/DDSRecuhHarZwwbECaNFFwA8uYwDFsxZ\niqGHaVPhVZ50nxjreK8mJMQD7AsC31uBzZzfMjzyheXK77/NJYkM1xbWoXaJ\nen8GEujk5XwIrXE/TPLcP0d9CW5wdcq29M1iZbhA92AXSVtjmJP3W85eshJ1\ni9qBJEF42yss+fgI1CcfFqcQocVY0JMIk7ZmsNPs4vd79NMr4iLN35THELhD\npscZVAGjEZkRyMKdoX5spQrmhmuwFU/UzN2qxVBWTARpKF4bD/vikirG6UKR\n+yZq7yLq+61yuEFEpxzNsPmOJrRafodj7gAaY2NMKNDRz5vD5QUgu/SAFPl1\nplLGv7ZHqR95pCcw/oR6koYaljCfgUF9tDxY8TLcJGkPJ08Tf3Cx1BiTAFYM\ntXhV0MdlyU6N+YchDvU32Y6ybACl0VUtErMh8OuFh9ot9r1MnYM+jjpz9JIC\nB8lW7LocDjBJO/kpg9JyV7FdoCeJ2GUIJE0VSPp/BOJBtO1kTp6GdWwhLgoK\nYPifNESIbw4r5JAP00GxxtfunEsUVbCNQscifThEJ+f7KX49LS90DDDtnieW\nS1aS\r\n=uk7F\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string)|null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"81238a3912ea8bf30c97b0318ac2ce65f297eece","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"9.0.0-canary.b7bbe7022.0","@material/rtl":"9.0.0-canary.b7bbe7022.0","@material/base":"9.0.0-canary.b7bbe7022.0","@material/theme":"9.0.0-canary.b7bbe7022.0","@material/ripple":"9.0.0-canary.b7bbe7022.0","@material/animation":"9.0.0-canary.b7bbe7022.0","@material/elevation":"9.0.0-canary.b7bbe7022.0","@material/typography":"9.0.0-canary.b7bbe7022.0","@material/feature-targeting":"9.0.0-canary.b7bbe7022.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_9.0.0-canary.b7bbe7022.0_1609267700579_0.5658411158748518","host":"s3://npm-registry-packages"}},"9.0.0":{"name":"@material/slider","version":"9.0.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@9.0.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"0c2becefadf9e1e357458e0a418460d71c25efaa","tarball":"https://registry.npmjs.org/@material/slider/-/slider-9.0.0.tgz","fileCount":37,"integrity":"sha512-kaiKKZTA+F6w75k8g1hHXWlexhF8DfZZOtaIygl46rlf/t4aD8lDj1ZMYk/C1/xCjbdFIqCHzltns2xOk1In0w==","signatures":[{"sig":"MEQCIHO2Z3QPkxBNbTspR30RIiWWbDxAuejz1PS4Subz77jPAiAf8uuYCYajbRaRNo5I6BZ3Hc2NG7QL4Fpok34Mmg4oig==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":777797,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf64eSCRA9TVsSAnZWagAA3+AP/1aGv76TrovxLBY+eyOq\nbnxD/bgerQ0uONEpy8NXmdIJTOx/M2TsFjaQSdSV8RbXszhhJdR+xsRKy5A0\naXHkqtQOTTkbMVJpNpdh7naPOeaNVvXCNJqX/AjOZCrep5tECX9fvzr7Ya+D\nc8elFZDyVT7M1TAPsowXGD+3eNrKWThB2s8735ahqBM60YSdUDOiboO9Dkwb\nKXZaGEx6d7KT28r2y1cZoNPGHGV1gdEPa9VU0wELCtwhgVeJdQsB58MBfqac\nBJ/l3aUwj3vIWppwScT4pMIJy/x/1BrRO2BQMLJUuQCUf9qUuHriRE8j3B/R\noWPaSXUlt6qegVH3DOYgM6oYBNUFWDAHnJlIPDSoAdyhVry/0Cx1aUBdJmoH\nxc8G18NMhXztux+uzO6tXeQNURVkz2R3YdKtGN0x1CvdRJXT+8LV8W+tygWi\ngvS04t3gtGJMthufkJKnT4hXx3BABPOsxZloJV+M3s784qbeWz5Du2VLTYaa\nwS8JkeRh2ABxSykpEAKMfAo/HV3AAaXsPuw5uoN/J7n1H5JvnNpZd134YwqU\nJNu6ewSmPc7wg4fERri7WhnGFkOyeVJgvZ4NjbPotbb/dzcecmVE2LeHSaPa\nDnjmglIvYSwXKiDd/aqGG7EnZY9QS6jNR5/JcOt0qzXgdCyhFxrCxPNuxivZ\nxxow\r\n=ZFZp\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","gitHead":"555aecce59125bc3f162b065dca47384bb5822b1","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"^9.0.0","@material/rtl":"^9.0.0","@material/base":"^9.0.0","@material/theme":"^9.0.0","@material/ripple":"^9.0.0","@material/animation":"^9.0.0","@material/elevation":"^9.0.0","@material/typography":"^9.0.0","@material/feature-targeting":"^9.0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/slider_9.0.0_1609271186390_0.627970418936949","host":"s3://npm-registry-packages"}},"10.0.0-canary.776c18681.0":{"name":"@material/slider","version":"10.0.0-canary.776c18681.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@10.0.0-canary.776c18681.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"90bd7432294d373143ac84a48d3351c22dfc8660","tarball":"https://registry.npmjs.org/@material/slider/-/slider-10.0.0-canary.776c18681.0.tgz","fileCount":38,"integrity":"sha512-0ANyYoPMx/XRCAWCc1Y8deQlTerukHxuVmZPbAb7+dEBKOM3Nn8PTw5YJf+b2oAJrkNZqctmTnqtQh1hv2CMvg==","signatures":[{"sig":"MEUCIGSoHvlOnuf4Uho0dpxBLojt4M4CXp8UjKinGewa7yGoAiEAwCBiaRKDTRT6sW92Xj0Vy+REkmYwwRXEN/KaU4jR1Wk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":778391,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf68x9CRA9TVsSAnZWagAAcxsP/0C5rsk9kE7nObq0EMrI\nNW30pPYwLbsdZsV1bjQGDxvrN8xkfgyMdvahcHKWEFTweBPre4+bmOSgxVif\n2Ra/F5QJx34vHtlLe/PDi+8nHGO1wQOPLhJDbFTkB1Q5G2ixAsfUMEPpBmis\nM8HOZzSuZiNrNqARebBs6GX+NOsfhAAA4I7DX2l2Q/bjfBxlPLwQGqEtiI+7\n3YxGMm7ygrYXTpFQJEE1iKCth8HCl47OLpAPpIdqtyvTZdEp7NyI9kxieayx\nHTdD+IKdVe+wkw7D32MREi7CxwtdQjiRPIRv0jiOgq92w73+6Fd4rOtQLrBT\nHvjAFTLPS4SvE9nafU1O+LGTf1W4IqjFK5dijtI/6BbhYPYhLk5j0lf2TZ4l\nr/x1HHNkl9sNVUjAp1I6R4lCnuR6I2clBlxKGuH/kVSI3UMHNKnO7N9In0y6\nUHos3mqkiFw3DkkylBtOwohkvXTLlN+Ci6z9/Fvqywvtdy+Xe+QCAQ65YO+J\nIHrzFjqNxI/0Kn+UWnC4AcZMArBZ1qO6dpsCG7zvSSWNsjFuaH5Cr0acea13\nfIcBknD3C7h4IUKgsHp2Dv+K9DzKQKGAq/7utpedlA/r9B1ca1uVKNCfqYuA\nlF2Yo6zOm5GM+0nO13Fl2U2v8yWUltxyBjOaC/taz7UAJngs47FnXG7xjjL4\nOihC\r\n=y1MU\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"920f8ec98e9709a32b0564a5334ae434137478dc","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"10.0.0-canary.776c18681.0","@material/rtl":"10.0.0-canary.776c18681.0","@material/base":"10.0.0-canary.776c18681.0","@material/theme":"10.0.0-canary.776c18681.0","@material/ripple":"10.0.0-canary.776c18681.0","@material/animation":"10.0.0-canary.776c18681.0","@material/elevation":"10.0.0-canary.776c18681.0","@material/typography":"10.0.0-canary.776c18681.0","@material/feature-targeting":"10.0.0-canary.776c18681.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_10.0.0-canary.776c18681.0_1609288828656_0.0598742107421002","host":"s3://npm-registry-packages"}},"10.0.0-canary.671d72d95.0":{"name":"@material/slider","version":"10.0.0-canary.671d72d95.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@10.0.0-canary.671d72d95.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"b169f20d6c575389934b7853973d0a72875dff21","tarball":"https://registry.npmjs.org/@material/slider/-/slider-10.0.0-canary.671d72d95.0.tgz","fileCount":38,"integrity":"sha512-WUsrmfZ4P1XPwx+tHZ1l4MDlLXTmAcWXVrP69SDonjwkqujGrSocnaxHyjdV3hmb41cKiI2MSMAu3pickiVcLQ==","signatures":[{"sig":"MEYCIQDP9dHbUr8cUQnx6QILlVYtt1dp7S7iFbrd5DFhGkm3CwIhAOChJJbTT6qZhjd5DpVq7X4VSQrpT+79b8o5MoQEeel7","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":780950,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf7N8eCRA9TVsSAnZWagAAm+MP/2bR79/MJrh2r69qIPXu\n2lvqRUJvgqeX/JMKIMHukHMv6Smh/BXScZewpO4oZxAC/qekXgcDynXrLN3w\nncFgMRATktgUbEcNOE/3VbltoxIpuTGypQS+jHwpZ9LlfAkNqZIIAqRTfU0P\n6UgJWg/1LfimBmKUrKXlyjQ31V+WlN+20ayuurNaz3MX1+/0v6AK5/b4Z3a3\ng0A+WGHqDrvp109ZxGEp/6YAlZFGvzTHyS4JCkPXRa16PRfkPFRE+mppuo0b\nIPV/zAOMVpp7/I2L3QyXAiPbTfrtNKTkxtRFTB9DOMxb1Aq4idGVyd3Qy6fl\nU/aq7a5hyriE52VMPOKf79WqIXy18c20XAN/A28mo4a007i1gqfSRoAhrTQK\nApI4x30CQb0JlcufDMJsKfikdCiR138tIL4XIdQyW8srMMozZ6AoQKgE+EG5\ngf4YTuO49bOqSY4qs+bw3hodurenmEExqP5f5w2HPdNRqleo5sYtrSun0nqx\nhoCw6PS49wOljHqQDX/eQsM59Lc8/OnZv8M41wcynkwooYtEhWnmqD+bEV1x\n4fKSB/gBeiMtEQrJTRtah4dkFBN6Fo7kxj/JECZimO1U1oSO1HDUrv4ZSNkN\nKEtYRGDiKvztLL3x+qIiAHVdrTWnCKewz0H9mdFxSPWFDK5W4+haDCQ2uex8\nze9S\r\n=o+ey\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"c22803ec93a76c661222622456cf6f5c5a17459f","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"10.0.0-canary.671d72d95.0","@material/rtl":"10.0.0-canary.671d72d95.0","@material/base":"10.0.0-canary.671d72d95.0","@material/theme":"10.0.0-canary.671d72d95.0","@material/ripple":"10.0.0-canary.671d72d95.0","@material/animation":"10.0.0-canary.671d72d95.0","@material/elevation":"10.0.0-canary.671d72d95.0","@material/typography":"10.0.0-canary.671d72d95.0","@material/feature-targeting":"10.0.0-canary.671d72d95.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_10.0.0-canary.671d72d95.0_1609359134031_0.008311753912968456","host":"s3://npm-registry-packages"}},"10.0.0-canary.b4f5a1c9e.0":{"name":"@material/slider","version":"10.0.0-canary.b4f5a1c9e.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@10.0.0-canary.b4f5a1c9e.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"92a2ae4e1f550d404d60fd7917c5e801cf18d2fe","tarball":"https://registry.npmjs.org/@material/slider/-/slider-10.0.0-canary.b4f5a1c9e.0.tgz","fileCount":38,"integrity":"sha512-ZjYVgbFXZINupaM+BmLVd/ocyfjIntghIAr/pitxqv9a276SV5iyvkGqPo/3FDVHp5IcvpGntB6twm4sxQgdrA==","signatures":[{"sig":"MEUCIF9bf3A2kCAkEnr8p54nHxLzkO58WaQARDgDbn3PoEJ/AiEArOEJSAQgelGWGNk9Wjdg5BvpDstSHv1YVyDow/TLGDo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":780950,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf7PVHCRA9TVsSAnZWagAAltYQAKR8IWikjh8dm96IoPBa\nXMsk7//od+JkSjE/uAEp2TraKwrrjgPo4fy8R0ms8H6TYXaYyJVcobNvqPug\nG4HKFoRHDbj1/cwc2XrlCt7ab/zo6oc6qbodEBwma3r5ZzxhNOVQ5gXNNkNU\nP91eppjuZx3kKwJy0VyFb+R9INWt4mF0KbmNzdTqjsP3lZhHI2cUjjrYQs+k\n2p0+xO5bdB+SSEUMYNrEA0PbBrLePlgnjeIBd17pG3ED5d8Db5nxO9FQNXPI\n0cIGtnURZdS/wsko+4DClDdDegp7YzbTPtSU26A1kz2Su5IO6lheo2tKvpoB\nmj4QT7LRvO+smB94zzUA5j6dsc/aIpJtcH5qeRITC/5KGQ3mc2bfPraiP9vI\nM+AcJfezRyfxBDOrAHxVj/Kso9oesj5s2JpDf/Tgn/HYY+Vr6M3GKM59E3hC\nvzmaFznA29R3WF2V3okrWfbp9McAR9EeSm+p+oiuYN7dn01vUW2c/uBCwLo2\nUzNbpe3q3zM+DH5qq6VQnOSCZdbhu0pqMHjjjLQQ8Vig6ZP2gv5aCoJvqQGR\npZTyUd4oqMd6JWb7bJ/S0OBSLAWHE32e6pEkK+7tRQh6L13iWdjFCdVKbkTV\n7NRRLY4hjIOYjEGT65PA2L8xj7zV/oLFWJQr9Dzv+G3uL8ejIbMycFgTqfTO\nXDUV\r\n=Ydse\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"1db47387aa8e99022677270066e7cba1da23732d","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"10.0.0-canary.b4f5a1c9e.0","@material/rtl":"10.0.0-canary.b4f5a1c9e.0","@material/base":"10.0.0-canary.b4f5a1c9e.0","@material/theme":"10.0.0-canary.b4f5a1c9e.0","@material/ripple":"10.0.0-canary.b4f5a1c9e.0","@material/animation":"10.0.0-canary.b4f5a1c9e.0","@material/elevation":"10.0.0-canary.b4f5a1c9e.0","@material/typography":"10.0.0-canary.b4f5a1c9e.0","@material/feature-targeting":"10.0.0-canary.b4f5a1c9e.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_10.0.0-canary.b4f5a1c9e.0_1609364807156_0.7042545375856863","host":"s3://npm-registry-packages"}},"10.0.0-canary.a94bd8deb.0":{"name":"@material/slider","version":"10.0.0-canary.a94bd8deb.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@10.0.0-canary.a94bd8deb.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"be35a7a6277e2982f575260ebf858e7d24f6b27a","tarball":"https://registry.npmjs.org/@material/slider/-/slider-10.0.0-canary.a94bd8deb.0.tgz","fileCount":38,"integrity":"sha512-eHDthE0wyd83IW5TQcsgAwzQfEclj/gJP/89Xa7beqPXcpJK7ohWBQvf3MpkFEnMroo2xYZ/p3QvRKcI2pfSxw==","signatures":[{"sig":"MEYCIQD/dfz50LRqtZQzks90KgUqo5AOxNBF7BmRlKmJ8rtXWgIhAJyNDtYOf4ivciR1jOdIRh2++Yxdpghuy+6d2uP+0StJ","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":781305,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf7Pl1CRA9TVsSAnZWagAA5RsP/iBmi5WrXyod5FQrMNsw\n2o4g96ue4oo+IbQXG0vdfapIxm5sxPeRh4KyQAgIH64gsZgO5BlHiEuB4ykr\nls6QPh3pDPzggHDhG8rbICR/TEZJSpeL8LYY0a/GB5rcvNT85aNyOb1I+7M+\nU85Z8pWFW/W6cTtfjwtNbvgnJXxfGN44HM4aT+5Nkb02fU10JnxwcrIcE5EP\nuCTop40S49d2UDUvNFpRJyKanLHnGhG7N1t3JiNKpxgrerByH5BP/ykaARVr\nHIONeVJvcr4UWhmeHsrcj71bEhwLVc/xmXxi3974PnJPVowvjvq+zI9DmuCW\nlwsoZXF68+82qNrWTY5wZm8XrkTh2o+ST1uJ82HezvNSRvvyQk41wjLSsrZZ\ng8RQUPufp3xQS7AfOYf5D4ESJ3oI+OskTgyQcVdvlbQ9ncTu/iGOr416+qqG\nKavf99iRC/XV3A2p7Fu9xCloKegq4/yz/DsP2fAeY5KzXlzPvIdorQW5AVLY\nFpPYBU2W5RssgPtyO7A8sLtNmRQepct4mtQ5ks+Q4ccvbnsH7y+UM+0XpGv5\nXcQPuXnl2q+SUo3N8Ie3tl7CW9JNfAow+r30B1if8cBtolnMWeCmJlBOs/UJ\njBmPfvZx1kJi0SNWmPIMxmNA1gxyQm6gSL1du2i6XjPR5v0OsG7DeL+Kbgym\nqp3P\r\n=zOWv\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"12c943490c76f911dda3861f863c68d7abf77ce5","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"10.0.0-canary.a94bd8deb.0","@material/rtl":"10.0.0-canary.a94bd8deb.0","@material/base":"10.0.0-canary.a94bd8deb.0","@material/theme":"10.0.0-canary.a94bd8deb.0","@material/ripple":"10.0.0-canary.a94bd8deb.0","@material/animation":"10.0.0-canary.a94bd8deb.0","@material/elevation":"10.0.0-canary.a94bd8deb.0","@material/typography":"10.0.0-canary.a94bd8deb.0","@material/feature-targeting":"10.0.0-canary.a94bd8deb.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_10.0.0-canary.a94bd8deb.0_1609365876656_0.7957240543556519","host":"s3://npm-registry-packages"}},"10.0.0-canary.5d128511b.0":{"name":"@material/slider","version":"10.0.0-canary.5d128511b.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@10.0.0-canary.5d128511b.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"965a612e16335dabf856d4e5a7d80de051215b4e","tarball":"https://registry.npmjs.org/@material/slider/-/slider-10.0.0-canary.5d128511b.0.tgz","fileCount":38,"integrity":"sha512-ni0jg0cQsP43rdWkPzlFH9CDZ8ZQijociDvh3hYKeIN1KCPM0QiAFsFQzGmUhTLEdKks4v7zMVInDSaRC55SHw==","signatures":[{"sig":"MEQCIC2xygVvz3zmCYO8lzVxeCJ5EX/6xQ1PnNv74LYv+rWKAiAWgpKiKW6ZaxsmiwZnDKjZy5kXWaFD65QLSTCowrsAfA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":781305,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf7Pq6CRA9TVsSAnZWagAAehQP/3ym0GCWWv3R28MggoF9\nH1K885Jfu2d35gA7rQqznw4Cc2Anmejkv666XTYDN7OnRxR+HGt4VKYNT6b/\n8plSDTvb1D3tZssG0nOcLqKMzchoWiT3AZAtYG1nPTA20z/8zdPfHvW+ZR1i\nuAMMaofFu5n03ohci5gXe/KkBOVydkZe81HlUDzQJ+6PbyQsrylICRC+Poim\npQoeoAiacoUMw7XdKh4F4XoMk1DkkjKYbjkK1cYezhG3sJrhiwlTtKusddqv\n3RlntdSnGoVAj+beEtnMIJkcednjoU+N/+WwTz5G8bDzXTlAmIU92/FhJnsG\n2puEmMZWcpIUiN6HkHnU1Ig51KzXSmcuvnbkkuZHxaEPXs40RFmAvzeuYOYQ\nlJ9qsw9GdIWQQDKeNu5hCHo6cm1C1hXyxKZmIJPSFhUKeFRXlIPWbRQsC8g7\nFj/OfFKPLk+7Gu6klOy/bwL+k+7ndpAl5BQzM2z20DOWm1GmrrkTCk8VJvEb\nzmFONpnhzXPBBOZs7eN9HM6qu79ysYGraIMo2AevHR3UwCFZtnNHKqTf+agc\nwvtXCoIKN+hm9ZEMSBOMZIq6XbLy71WEnjMuWnmxlps45QUb8WKTiJlJr1sY\nMAxJkRG4vdhqqco1SAMOK+T7MRZiQjKS2PIegsPhtVPn8ynbBB7yZrR8E9Uf\npnz0\r\n=Ys7I\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"05d17b41cbad4a8aebac080f082633a26be09a3c","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"10.0.0-canary.5d128511b.0","@material/rtl":"10.0.0-canary.5d128511b.0","@material/base":"10.0.0-canary.5d128511b.0","@material/theme":"10.0.0-canary.5d128511b.0","@material/ripple":"10.0.0-canary.5d128511b.0","@material/animation":"10.0.0-canary.5d128511b.0","@material/elevation":"10.0.0-canary.5d128511b.0","@material/typography":"10.0.0-canary.5d128511b.0","@material/feature-targeting":"10.0.0-canary.5d128511b.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_10.0.0-canary.5d128511b.0_1609366202053_0.8155667311655859","host":"s3://npm-registry-packages"}},"10.0.0-canary.365c69360.0":{"name":"@material/slider","version":"10.0.0-canary.365c69360.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@10.0.0-canary.365c69360.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"0ab2425451a6caa8677a96248ae3e805cab18339","tarball":"https://registry.npmjs.org/@material/slider/-/slider-10.0.0-canary.365c69360.0.tgz","fileCount":38,"integrity":"sha512-n647UwUXOp9tv71GHZCpzvb5FBmpsU6qRRvbz5rmbCsv0W5lKiPzdLPNIXXJcho1wn/Yo6IWBFMBeAVl0CJQqA==","signatures":[{"sig":"MEYCIQDmMJBOYkz+wxcLWK/YSkt26EFOrxMm3qLrat3kx6/IBAIhAOmqm2nyIbXaenKemekVG0Wcb8+rAfiz25bsG2JWz+Iy","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":781305,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf9KZ1CRA9TVsSAnZWagAAbF8P/iFK2HwFvh65W2U1JZN4\nWQ3884BB9UMa3qTyRZYcdN0HKrzgvxr/0YG20d5zl51oQq2FaU1ATIM6E7rS\nZ31QtZxCDpITMUcaJonxb082NsAjPj5LHMid9TYdsxByyUI2/m1NF74lspbY\ngu2NWNWAJ/zTavfYNWfo1T5AAvbF069lnJfHKJJnnpCg5HeVuku/s4jo5K+d\niaRRSZFKqfjW+kSx66a0f5VOb5BYZUlcOf6kx32R356/QCRb9LGkIzE+I/gA\n0PkliE5mazF4YYSX46ZAI1MW7IUoqsVY/wk9ESX+I+Od6DDoLECvetvgIBeA\nqJ+4AB02+0HBTJPHygyrUDybeZqSyTaj9Zorq7pw3U+vBG9YbWkKKJ/Z++E6\nPNnVl3yBRaYlhknozXQ3Z1Uz8hti85aYxSbqd5FbtKqIp7yiI2386MKax5a3\nxjd35OIj2LoZj+2A51nxSWLmoWXyI+Pe5aOymKnFzPIt+0CO1EPIjHOZjOHU\n+uSK4eUGTa67f9IDJ9HVgI9xB6PUi80j1NeP/677ZeOgLSCwHI0A2uRKwo9k\nEzk73yxgypnPeP2J5YfAjInNP2L83b8T2PFSu8+6ukqm4JN7qunSp2IRIS/Q\n3eKMttZdWzfk9q30zgWFrEHu920iwOr7+03/6zlVHsaZMQsIJtBk3SQV3R+2\nWrDP\r\n=gpXg\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"0b060c30e2974c71db5d5ed87e3ab7918656edeb","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"10.0.0-canary.365c69360.0","@material/rtl":"10.0.0-canary.365c69360.0","@material/base":"10.0.0-canary.365c69360.0","@material/theme":"10.0.0-canary.365c69360.0","@material/ripple":"10.0.0-canary.365c69360.0","@material/animation":"10.0.0-canary.365c69360.0","@material/elevation":"10.0.0-canary.365c69360.0","@material/typography":"10.0.0-canary.365c69360.0","@material/feature-targeting":"10.0.0-canary.365c69360.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_10.0.0-canary.365c69360.0_1609868917161_0.15245690536744827","host":"s3://npm-registry-packages"}},"10.0.0-canary.700a8261a.0":{"name":"@material/slider","version":"10.0.0-canary.700a8261a.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@10.0.0-canary.700a8261a.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"2d83b10860743d59ebcc9137355e8eaa917a6603","tarball":"https://registry.npmjs.org/@material/slider/-/slider-10.0.0-canary.700a8261a.0.tgz","fileCount":38,"integrity":"sha512-zlmlwd1O2wr7MFVFfEHmTXHnQcQsr6hBO9l9ZEF0qpDM7EH5m0W7OBiNrcuO8Imwh8jQG725KLdJ1rxIZfb8/g==","signatures":[{"sig":"MEQCICBMBOtnMOo+nPvdIgF/hkIQM0xhvdSgSyAxEdoY3d/3AiBbCPmHUDOx7RmPpdoNHfIHBYH6iwd+4vv/Hx2nY5iRMg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":781305,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf9NOJCRA9TVsSAnZWagAAEAMQAKDMlJ4lp34VGJabVskT\nte/6L9fx8O4shWj6qPkWBn9MSlSJBCiV9UbgM4LCFKasLnl4GeH0M9qFuPBc\nKNzORcN+swi7eWSEHpy3Vb9tfL90IUUx1X87d4vcjHOc+drvhJxDGDkY+0Oi\n01Kbh/6TE1rTZhY5NDNbrXlwU9rfsNHSm0XjRJkyy6qf93hZhP6d+2sQW45E\nAjC8+zB0l7/SAP4N2/EMtuxIH5LSZC2yeZZwp7V/SuIujyVQpyuO2sGWp/eR\nDWJOpm3/Mh3rVHhFIpiZjfdBBPFuWdT+H2QXCxYP9ReR1PQn1wrPQH4dcetA\nK+Bk4c/YfikN9hssLCRBlYB6tfAu0cLidYH3215qiAICWzop11aeNVwZSBen\nYSveJyDALnPqrKaPwOlM6sGI3dlc3komkRks3DeWEqcWMizA2lfVOqDpZ0Di\nb6ERREND46HXQXpnHiX7GMO/ben7ivMDEQm0ACTOEIoD7op+BJDRBRNPItaL\nnOyGEimQ552RD6GLNvNKt5qyLyumglZpGJczDe2eO7y8zELZyVIDNU5wbNAt\nLSWyDQ3hmMtbOTRBVCRA/wQrdabVV8q1waQDLei+n+2nx5mqNz+X7/v4zX81\nP56oO7XZtRVr1lI2jfCiVjI7QKP0Cor1l1wGpAyRRGe26rgfVZmiShbSk5ym\nBFdA\r\n=UAXo\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"0e9aee4feea82b83f34c723b52aac42fda1cdbd2","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"10.0.0-canary.700a8261a.0","@material/rtl":"10.0.0-canary.700a8261a.0","@material/base":"10.0.0-canary.700a8261a.0","@material/theme":"10.0.0-canary.700a8261a.0","@material/ripple":"10.0.0-canary.700a8261a.0","@material/animation":"10.0.0-canary.700a8261a.0","@material/elevation":"10.0.0-canary.700a8261a.0","@material/typography":"10.0.0-canary.700a8261a.0","@material/feature-targeting":"10.0.0-canary.700a8261a.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_10.0.0-canary.700a8261a.0_1609880456694_0.05038695803908344","host":"s3://npm-registry-packages"}},"10.0.0-canary.766981c15.0":{"name":"@material/slider","version":"10.0.0-canary.766981c15.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@10.0.0-canary.766981c15.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"40069fef5b2a612c8279016959c9c4c1cb1e2be9","tarball":"https://registry.npmjs.org/@material/slider/-/slider-10.0.0-canary.766981c15.0.tgz","fileCount":38,"integrity":"sha512-GQ39jcVgeEsHSii18by/suyaJeK6yuoHuQFxHBabbHaFAvdxSG3MAr2Omcjqz0oxomJ/asbSdC7SwzzyCc6YlA==","signatures":[{"sig":"MEUCIQCmxhEdiqyaAUxfc+oBWN48b0nwEtYxVKIg5Ic5y8ZhSgIgVso6o2mVS67+J+y1WejnEAwfQhk3b7pTo4d8bbxxn2o=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":781305,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf9OrpCRA9TVsSAnZWagAANi4P/i/Ui+nTr1YLT0QG8yhF\nahioezLsSlcoFECk9HFw2aYEb+2SDz+OcTeZH4AWzkOP9QlZFNySMExQsa+V\nb5Owm8juVdHxR3GhFdc5++vzqhpEmiA51nHVyCLQ0xAT0S4V6pXQ8+PVWJP6\nlE8EYpXcMBEuPSOvhht2WWMJsWbTewJlsquNdyGu5YUtTbif2mqmJy4o4ntz\nFgiNN3lshsZ9sQs9xQ2uKKc5CVcXXELtt/N9NFIHAKGy2O/jSc9Do59pot00\nuo7g0MYrVxOsaxT1bJyiIa8jjn70YOQOkKF/qV0RpcqL05DzzCQ7WZYvG+iI\ngehxINQLmlwdcKrlJTD3ItiHIJfoOcTYs4hMJ6AIHyx8caks/jiVVI7MM2y6\n5tdMflZANCaYI0mZ05AtbCqhSeLNyaAWFO49MN68ZSYhSLd0Idcd0k4nYgzb\npqdN1d5jgsKpnsexbF3uxkRXO3tbZ9b2AOTGJ7/H98yEBSrg1efl5ucLB1Hn\nFtH+NytcL750J2Skh6S4gzosEjeimcaM9wU7CDD38Q1DYz7fLyDsS2+21Aet\nODWIr1u1n8go7DVgW+8EnMd/kOtY1qxN8zhsOxiaoFj8bQqyQ/rePp33hda3\ncujgR+Wud6RFFqv2zZYPOmQCS7WJpyBIzL/3NmQ4QfcvTWmacUfhu9BlJP+2\nQAB/\r\n=KWnE\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"40a13adf47648f48d6dfb1daac9ded2f7f0bd442","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"10.0.0-canary.766981c15.0","@material/rtl":"10.0.0-canary.766981c15.0","@material/base":"10.0.0-canary.766981c15.0","@material/theme":"10.0.0-canary.766981c15.0","@material/ripple":"10.0.0-canary.766981c15.0","@material/animation":"10.0.0-canary.766981c15.0","@material/elevation":"10.0.0-canary.766981c15.0","@material/typography":"10.0.0-canary.766981c15.0","@material/feature-targeting":"10.0.0-canary.766981c15.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_10.0.0-canary.766981c15.0_1609886440770_0.16648509757967767","host":"s3://npm-registry-packages"}},"10.0.0-canary.b28c576d9.0":{"name":"@material/slider","version":"10.0.0-canary.b28c576d9.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@10.0.0-canary.b28c576d9.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"ea46b13509fbe71b02ecba31742fbe2da8d505de","tarball":"https://registry.npmjs.org/@material/slider/-/slider-10.0.0-canary.b28c576d9.0.tgz","fileCount":38,"integrity":"sha512-trRf2AaTwCksDR9wNT/nELOk/Dl/ejrhXBxBw09tQfhqS5TgpfWgLFy/Dwx1+mrWec+9v1WRFM+IeBEbGl+LkA==","signatures":[{"sig":"MEYCIQCozvCupXiL+B55T5xYI2/jREHHTl9ZrZnn1vpQxtSufQIhAO30ypnzgkKgONn4bl6sbvrqv+LoWlJLNSBsaBLhiFYJ","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":781305,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf9O0rCRA9TVsSAnZWagAACtoP/jND5RgMfMNgfeBsabuA\ngbGevkEfbi72u5IK3T3zbOPs9hANXHWoIFWGtBkXm5VQOmfkiRJyLs5NfqZx\nf3oKHguZwo/7VAJJD+GKVS8yY59zk9pK2X++fBlQEs/68VHJO7wH7vb0f9/k\nDkzQ0Jwk1gJkGv6j1EsKaCGMwr1YhHnheEhz7crJoG205h7VEaSBBlzGL9xQ\nMJoID2yUU8g8u3YLMERxCyiW0YwFVJgl7SfrnjvQQXysDMtdqlX2hIUAPthG\n+Kgvn9c4jSM+hnkDZ3+ZL2BxjsGETniKjubpijATuqZrwHN+/fsqJGHgt0Sa\n4J7n1bX60Qzi1rmhD6wZHk7wEQT8g8ajG4lm2+kiLOd1dcKICp+iBoufjPuq\n4291Pfq4aOmfF2mvWX0efRpGSsfQl5Pw1ScLUVnT7E4hM9asVcApkMK+Oxrq\nzHeq5pWV5DPFipMt2R5QzyNHPNZvq/G4IhDeP3GrTJSvm0X1wGJ8FXE4cyU4\nQyOp2xjwlJBlIgSCh+hXmxcja/hQdVokyN7A4P87euFF6rl8Ftt1z0fekeQM\nhWzwHxhBtBFuI6NEXn/+lMbhUnUKNT5yNe/kI9XvmgcAYIj/HC68PP+EHqXh\nghNdA1vcb92IxlNC3+l1VSAcAEwm3EIBUgq9+7XG1xioJ7DGcPfi1a7z+Yc/\n1E22\r\n=9snd\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"f11c5039e5e02253cd6e3eaebf7ee15629f3c182","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"10.0.0-canary.b28c576d9.0","@material/rtl":"10.0.0-canary.b28c576d9.0","@material/base":"10.0.0-canary.b28c576d9.0","@material/theme":"10.0.0-canary.b28c576d9.0","@material/ripple":"10.0.0-canary.b28c576d9.0","@material/animation":"10.0.0-canary.b28c576d9.0","@material/elevation":"10.0.0-canary.b28c576d9.0","@material/typography":"10.0.0-canary.b28c576d9.0","@material/feature-targeting":"10.0.0-canary.b28c576d9.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_10.0.0-canary.b28c576d9.0_1609887018924_0.7108802607356937","host":"s3://npm-registry-packages"}},"10.0.0-canary.968735356.0":{"name":"@material/slider","version":"10.0.0-canary.968735356.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@10.0.0-canary.968735356.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"170cb2271bd3147a143259c34b8b5cdbcb10a0be","tarball":"https://registry.npmjs.org/@material/slider/-/slider-10.0.0-canary.968735356.0.tgz","fileCount":38,"integrity":"sha512-5TPpWuluo4hBZK5R39yyneTzY0ge1gsw0VZrLevRn4aBi4hsHQFai5aLZ18pdSS1Mclnac6vSBFRTmpFsmzthw==","signatures":[{"sig":"MEUCIBtQg0gseSLy4RniPnZ33EWG9mz3iWLa5D1Q2DXX1iYrAiEAz1/kBbwLXYC7Kr+UNCdcldPO0byzbCbjTPXylFLL1a8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":781628,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf9dxwCRA9TVsSAnZWagAAO20P/Av5A6ECDNKVR6KSYxJa\nbVRj5TER/j7oDqgWZ1W9HHUVcfBcmWUD4DxSOq/w+/QsF0vEYK1qgjWGKxuf\nxN5XFQ5PQhk9XhaoUAEigxS9RyRMOxNUsJIeE8g/u7ZKnDOqqJtwhpPO2mri\ngRA8E95A4ibsJJaWpZX6L6KREba4jo4nwmDx3ynSlZzhd7tUNkunWoVlvQ29\nC+UN7ZmNXKr+AStUFZrR0Atqz1UsDzVQlMB+k2qM/epxSpIQhU4qWxc0/E0d\nOFAFvoGfVa/G1MCvdSsoTBI216K0ZNZW2SdcM0XlveDwXaIwshmAGdIEgkFK\n1KKZIWlCajCm5vhWdO45sQ2/1o/QLX5TgFBR7x5stTP12n/sYIhqnKnh67t8\nsVrktxq8G4j14SFJvTCpB2l0U42aU4FMBHwPErFDUUqLFIsgkCrn46LEDjPu\n8b/C8SeLvjkOSmBXkoITaQlikDK1srEt+nPfKb3+EX+NoMCRwgdyw8RBZNrp\nIwXVxPi7AljNOl8hXimIW/NIMT4uFB41g4R3rmS+r0+oJvyVZLqa27aiSnX1\n7PnK5AUmLJLFs3PPed2x8kDEuXUXvCQ7hkCMizLH/2T6ebZXZ/FleyEfE3m8\nh0e1hfrz/Wb8923eJIiERriENHYSeTSrsLkwMtzfXzitwCSJbFB1pbga+xbq\nkG8C\r\n=jhE6\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"016bf1732e983523c8ba8007681b058735467018","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"10.0.0-canary.968735356.0","@material/rtl":"10.0.0-canary.968735356.0","@material/base":"10.0.0-canary.968735356.0","@material/theme":"10.0.0-canary.968735356.0","@material/ripple":"10.0.0-canary.968735356.0","@material/animation":"10.0.0-canary.968735356.0","@material/elevation":"10.0.0-canary.968735356.0","@material/typography":"10.0.0-canary.968735356.0","@material/feature-targeting":"10.0.0-canary.968735356.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_10.0.0-canary.968735356.0_1609948271784_0.1952586793852411","host":"s3://npm-registry-packages"}},"10.0.0-canary.c5e18b020.0":{"name":"@material/slider","version":"10.0.0-canary.c5e18b020.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@10.0.0-canary.c5e18b020.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"27caef4001b5c77e702f95f3cb5509d9bc997532","tarball":"https://registry.npmjs.org/@material/slider/-/slider-10.0.0-canary.c5e18b020.0.tgz","fileCount":38,"integrity":"sha512-ozCnW75N/KfPfHvU42pL4mSLlIwdCn+NpJCw5oR0JuqOcGef1SX/gh/T4E4TMS2+fqguN01/ov7567/Xl8Pz9g==","signatures":[{"sig":"MEYCIQCh3rRSpGXqi9dQD8RwvA714A0ALSgORkQnltOWmsGd/wIhAMes4mIA/zSDBYz2SVzwNMD79TECnaR6tPIB1/7DuVSb","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":781628,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf9hMjCRA9TVsSAnZWagAAROcP/3ivZ1Unx2FqROpZxWfA\nk41j+ad7lSfU7cczGqzpjWEEkLdwHQn+kBJUusZiAkGvd9u/kzA1dHL3Vqb1\nJZwBih9eGn3fLrqKYyDHjstAjVUe7+lcmLRehGdOO4zy9RGgP6XRigQi5VMr\nN+EW9w9oat0ORTkmwefdg2+YT+A0ZzQoNfh/8e3U+1nk6LVfxhy66e1yi21b\nGFi47dhvZ6cj4maU99j2zaLh3rJ6nV2r40O6F0CO/PSFvi15XMClhIfF92a4\nlOzL5j+CYlFKq0UomG/B29G6WhzzqtnawEh/LYaXX9ywpMyx5Jw4lQjbxZsx\nbDARDc4e9JeSddhm2skLvTormvrndjkBZYZM5dWVk02vpk0PQTSZdD1pM9tm\nJ6x/SJnWRCydx8JanBeNFWpt+ypFfNMZ/C4NFymGKftW1mpkpsrc2vHZhSEt\n6TsOhUyuP3PT6jQjNSjEDgybmx8jDppchrYkkcnTWaA6aZs2AKoLgM+O7iYf\nQ7ip4Fw+Q1URleO0oLpfYtXeFbeaRNxhLE1LX9TZmdRRMAdaJADLJhnka9Qf\nBc83oA4x2xiPfrjb+wRrSatijAmQ5fQPA/QfHr2os52PC5OkXFmOSsNRHsJ4\nNv3mQjXMLuX3LotJStHlpcsDi4j38AVUH77yAArMB8Jpr3Uj5fN51VbiL7Dy\nEVq4\r\n=NivL\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"16a60c2c89ea18fb88971304d4491f612734e932","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"10.0.0-canary.c5e18b020.0","@material/rtl":"10.0.0-canary.c5e18b020.0","@material/base":"10.0.0-canary.c5e18b020.0","@material/theme":"10.0.0-canary.c5e18b020.0","@material/ripple":"10.0.0-canary.c5e18b020.0","@material/animation":"10.0.0-canary.c5e18b020.0","@material/elevation":"10.0.0-canary.c5e18b020.0","@material/typography":"10.0.0-canary.c5e18b020.0","@material/feature-targeting":"10.0.0-canary.c5e18b020.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_10.0.0-canary.c5e18b020.0_1609962275043_0.9488719705602477","host":"s3://npm-registry-packages"}},"10.0.0-canary.bcff8a66a.0":{"name":"@material/slider","version":"10.0.0-canary.bcff8a66a.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@10.0.0-canary.bcff8a66a.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"d06ac9a40387bcc10d4bc4933d1231f1c56ad4d0","tarball":"https://registry.npmjs.org/@material/slider/-/slider-10.0.0-canary.bcff8a66a.0.tgz","fileCount":38,"integrity":"sha512-MZrB9SyL1eBzv8EO6tUtRn1frl5PTuvZFs79uT45enT2ePnQBqSX+7XcKJR6EtZZI/vOdUiaTZacj4h/puGYVg==","signatures":[{"sig":"MEUCIE6EQqXSACqyY1I+7BhW8V/8WDtpQEFL0dp4vEFHM3D5AiEAn78oeb26y/8b/EYRhL1Y4B+TuUh9gJLze27SWLa9PdQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":781628,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf9hz/CRA9TVsSAnZWagAAqk0P/3kQM8OxzuX+SfMOmvXT\nuK6Pl/rHEzQbeFFThyem8IR1o4ViOCYg46pnw9OTgnpG65UnpE63m60K4SI/\nphMJ7pBZDVYWtwx0Z6KyngjBphT92XVW0iBc6uDpC9EWhhYRTTkVIWXilyT0\n97sFFsi8rmIKn3+joFCuZ8rHxJgUbX9uMFOqiWvTzgmP2KtRI8Vj2KX3lSWM\nVYVug75yluMfQQlEIznVkEjcujoXmdF5Gzmb6YNiSY7692rp0A7OgwKgbiW5\nLfsNjjW5TA9vDtUTaUlLGUqjOjq1X1AztGB7yqNu89xz8WLaYX7eyKd7VmeI\nLSn17NTLvqJdycNxthuwYwrHNCMD09HtlWtruTLOIbzDfuDdErjU1h3dK03x\nzxwsjJnt+UsFz1fD+YRrcF5xF58jMylojYYxvcATnWohlqNpxi/+3MvGr3bS\nqOBRKuIgvts1VH+6NpeQY7lg07eUIHkzxmemKkdU6LMqg0ceg19i1aMJmf+7\n1GoxPsGDRz1a5dWni6mKgPUuHwYzyausJ3LfyEvn+77rmlorqzLD4p+JR36b\ny5vNkeHMUXocMiO/pdD4DRWhGT8+xTrTvG0CYXBLn0DEkBurR/qM0hBVuyIP\n6c2A3V63poznhwT5K9EM5SDsT4hrESibi81LoT7DuvJPRzMd/fUnQjmg54JV\nlT1t\r\n=Snfh\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"81af087ae7601c8b819dbada709de8d76ddab960","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"10.0.0-canary.bcff8a66a.0","@material/rtl":"10.0.0-canary.bcff8a66a.0","@material/base":"10.0.0-canary.bcff8a66a.0","@material/theme":"10.0.0-canary.bcff8a66a.0","@material/ripple":"10.0.0-canary.bcff8a66a.0","@material/animation":"10.0.0-canary.bcff8a66a.0","@material/elevation":"10.0.0-canary.bcff8a66a.0","@material/typography":"10.0.0-canary.bcff8a66a.0","@material/feature-targeting":"10.0.0-canary.bcff8a66a.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_10.0.0-canary.bcff8a66a.0_1609964798523_0.8464085280395826","host":"s3://npm-registry-packages"}},"10.0.0-canary.79328c9ff.0":{"name":"@material/slider","version":"10.0.0-canary.79328c9ff.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@10.0.0-canary.79328c9ff.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"00d34b697200d9ac5f27505aa735b53ca7f09073","tarball":"https://registry.npmjs.org/@material/slider/-/slider-10.0.0-canary.79328c9ff.0.tgz","fileCount":38,"integrity":"sha512-KmKZB5YlUyTSL0bN3OvpTW/8TIpQbm5t+pdSfwdzG2R8eb6t6YFokFNm9pbWjwD9nC/JKp1A/hdnFdun2205qg==","signatures":[{"sig":"MEYCIQCSe0BYFYxHPDSXqsyssQx/FXx0ljH1hksLbksxNkhDlwIhANuN5WIwzsKVXvQMSqJk3B9nSxXwbGlupY39QDwouDzM","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":781628,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf9nM3CRA9TVsSAnZWagAAzwoQAJNtgbRXoA7QNCfKanTR\nfHj7TIqIFAGrFaV3dcmAJWlSWffuvvxBtEP2icdXP2v7NXXAKLhm3d3wPyDI\nzkK7E1q8JJgkgkUzFUwHAeAsJr9RZ3Hrq15lSAFpsLSwPjoMDLX/eWs0qGb9\nHL1xpCVJZdrl/7BaBOroTSyjF3w6X4QHYiPxW7FqhRqeZkGoS/EVFibuHkqU\nYyKmNMDd1kqXWHx00qU9gf1ldLpYCV+TmWlNEVvfikvviXOpmBxbii2fxmPw\noMQEmpaCwJ7kpCroHGGM0U8EGl+Rt0tjbAY3693MIyya0lsPO/G+lazuiwUZ\nCq5aRmlVfPYVQUkJhOzcmY5RZWHTmN6TWWDoYB+BRpQ3U6uU1N3ZrO5Yx5Rf\n5TGwFEo+c/F/1mnQYof0eVZThx56oIxlCTd38SIQjyte7KQdbAoncnZmThj7\n7LnzstKVh3ZYSNFbgDxdrtwP4/J/PMaATC8gxb035GZUhKBkaJ/ZrIdeE3Lf\nzFlZbrVD2T4GV1sa7+2ypL/FavVamjvu0OZz/C7p6XFfDNJgpijxOtmfWHLm\nvzesJC7peFqOQzUnFU/zK41f67iKUjjm1mPicVt3wQjlrJftJ1TkPZmCW/+L\n+Y/m6WEFO7EMUVYRhOjFIL1HeQPUdTjpoCjm7X6dHly3Kxg+CMr8lWn9Yec2\nwe13\r\n=ZNWz\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"15dd1d7d9065f275f9f9779094b959944d33197a","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"10.0.0-canary.79328c9ff.0","@material/rtl":"10.0.0-canary.79328c9ff.0","@material/base":"10.0.0-canary.79328c9ff.0","@material/theme":"10.0.0-canary.79328c9ff.0","@material/ripple":"10.0.0-canary.79328c9ff.0","@material/animation":"10.0.0-canary.79328c9ff.0","@material/elevation":"10.0.0-canary.79328c9ff.0","@material/typography":"10.0.0-canary.79328c9ff.0","@material/feature-targeting":"10.0.0-canary.79328c9ff.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_10.0.0-canary.79328c9ff.0_1609986871467_0.6667834283396326","host":"s3://npm-registry-packages"}},"10.0.0-canary.121e1f303.0":{"name":"@material/slider","version":"10.0.0-canary.121e1f303.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@10.0.0-canary.121e1f303.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"8c4852e0407d931d398b7f840074bc18b1343496","tarball":"https://registry.npmjs.org/@material/slider/-/slider-10.0.0-canary.121e1f303.0.tgz","fileCount":38,"integrity":"sha512-ZiPA6x2ZgAwoDIi9trvL2hWq3XcmrkLOqm/fSFThhLnKniA4Fx2dU6j/Nc+VBpeobi4Z5+Qt1oEjyfsVq8uxsg==","signatures":[{"sig":"MEUCIDbgzbSfODycuo4F6w90F0OSnV5I7z+05OjN3PQ0xRiEAiEAo3JyaecdWYA7XpU3HXxjqTTteMg8jL6MWBIRRk+T2TU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":781628,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf95cqCRA9TVsSAnZWagAAWaYP/jxeG+GyHTaPJ/66WEsF\nuXN/AHhoXXxGeTeogJndCqtmhDhneCCDuQdWykmF74K9H1ODWdsVJK7V4B5U\nECf3JjyPr3MNkp3Kt1ZaWoC/gwSZpgHULWT9buamfhxCyJSc9PzvfHkcab8u\ntRfvznWMC099iX21xc/1aexXJTvhoSQtfi9KjTdKRbu5Ix/MZ1VPZqxsHcNZ\nx8WfBZty9Mp8qp7oOLvKX7Cg2wtpLF8cKabQjUDiUe5PG5ImIfn4Y46wax64\npAUHyxRcvOr4SaJ9RFsDaGiM9b9iF+M3IPFeN3ZzCV3LK5k2ENcupAbLZ1UL\n8rZ8Sbsylff/IiOmgKkXSBox7R89xJLLgbP2zraJfpTczlCCHdrOaJvOsI/L\nhAjtwIqrJ2wkyAB/SHxj8iz/eyC7UzUgpppd2vn7adGVC79qwdbQkk4j93Wo\nBTsRAWI8u3scHIv+oJjijVovoKJo5LoxTzDFZeDQQwzJl6hB3aW3+BsQ+Q1N\nt5XfPfWtE0VbFbC3GGwgsuLtvr9stsFrji6QNIYTCptOlHi32o1MfpVLH+nG\nYko5n0yqd1gt+yKZgs855vOW0c7l8WJCY+XCdZpRllnDoebSg6EMj28zJhIs\nlhDv+xDhlSmZczxX6LzeCWQot4F+BUJHwGGHOv77NuPb1Szvi//KzoHo0gOa\nhSeh\r\n=1xSM\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"6ae814dae9eac40570f13ed9d7b821cceddf838f","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"10.0.0-canary.121e1f303.0","@material/rtl":"10.0.0-canary.121e1f303.0","@material/base":"10.0.0-canary.121e1f303.0","@material/theme":"10.0.0-canary.121e1f303.0","@material/ripple":"10.0.0-canary.121e1f303.0","@material/animation":"10.0.0-canary.121e1f303.0","@material/elevation":"10.0.0-canary.121e1f303.0","@material/typography":"10.0.0-canary.121e1f303.0","@material/feature-targeting":"10.0.0-canary.121e1f303.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_10.0.0-canary.121e1f303.0_1610061610238_0.8749589954925978","host":"s3://npm-registry-packages"}},"10.0.0-canary.abdd10065.0":{"name":"@material/slider","version":"10.0.0-canary.abdd10065.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@10.0.0-canary.abdd10065.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"f7b612b243920bda188de823d031075d7c3c836d","tarball":"https://registry.npmjs.org/@material/slider/-/slider-10.0.0-canary.abdd10065.0.tgz","fileCount":38,"integrity":"sha512-lxVfXg2syRWMpB8mrhqApTCfTnUmfkugS41EA3/j6ix3PDAySKqYoRgt6LQLwo9niWjtI+2sfoNYjvGnNZ8hXw==","signatures":[{"sig":"MEYCIQDf+d6LTCatIbecri4F5ra8vFt/0Ijiya2IYyGo0jJkrQIhAPgX1qnOXYt8O/Q+ChGx+9mrsD6bFkW8cMAghE+but3P","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":782258,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf+Ju1CRA9TVsSAnZWagAAaB0P/334tYxBjIJTLT6mtjLY\nFbKtF3P24Jk1cKHAYnSQpjQBC/GG4cAar646KqFmJ5TPtzFD9gHA9rj2LoJk\nDQ7LqLsGHbbnai+4DbftNh5PdBIgYDkn+oHgsMWPRKYSGL/di8RrIo0BUEw8\nGBqhc9RcPnyaDbNZd+9IoKLo307Qz2uC2M7MutH14clSsxwr/YIt4izSp0i5\naanTL9rlKWtgw0ctLdBT3DHefLKJZk9klaw5p4ET5H7OvyYpKP8x2pNREdPn\nQvw2cusUB8wy9LmeMOXhy756/0dQZW7V7YocFI8ef18ZV2mjux9scnShp3U7\nRHxd0IsSU7YJ4ftoRXfYz8cqQyJyOwS/rZTTf7hczXt+pgGzWG7NMgwF7lKr\nEJQi1/fbgkflX/YTdEluRoqAReVkD7U7vIdPXLasSUSCGTYuUdZ+L364TxLH\nzp1UhOk8GneRDmQrGDMkuSHVdBWsma9nbyqvB2VE1MUZBCMCiOtt3udOCkPT\nfU1TEuaw0KC1BIIJVNQiL9ilNyVgGKJqKhPpDpEh3BEOgnu+/hWbhT6OrJCQ\nOHhUXyUz/N1DTwlLekXtsXeisPXRBAohX747HE4FVOsSdg7sr8PIC1UVZGJx\nrGRmVA57jIc7bNPBU9VptAbq3r9ubxvB4corYj9plOqH053EVjvi65s+Hc7a\ndjpg\r\n=8pEi\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider\";\n\n@include slider.core-styles;\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"bc8986a19721edfc6facb62cf839cd222de97d02","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"10.0.0-canary.abdd10065.0","@material/rtl":"10.0.0-canary.abdd10065.0","@material/base":"10.0.0-canary.abdd10065.0","@material/theme":"10.0.0-canary.abdd10065.0","@material/ripple":"10.0.0-canary.abdd10065.0","@material/animation":"10.0.0-canary.abdd10065.0","@material/elevation":"10.0.0-canary.abdd10065.0","@material/typography":"10.0.0-canary.abdd10065.0","@material/feature-targeting":"10.0.0-canary.abdd10065.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_10.0.0-canary.abdd10065.0_1610128309277_0.9509596727045486","host":"s3://npm-registry-packages"}},"10.0.0-canary.089de519c.0":{"name":"@material/slider","version":"10.0.0-canary.089de519c.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@10.0.0-canary.089de519c.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"a40ec3b4aa954c6449802e044dc3ad2dcfc3b743","tarball":"https://registry.npmjs.org/@material/slider/-/slider-10.0.0-canary.089de519c.0.tgz","fileCount":38,"integrity":"sha512-VSXOXqjydhyoyhgqtFuCBg3/PjEfgzLvuRjndnJ39u+CsD0Ibr0MbgG9maJtPRJ+DA047H9uOMzSiaQe5f9iNg==","signatures":[{"sig":"MEUCIEm/bpbXp2cgA9t5KmTmXsswB4w7LnKMokRcXZQjfL8/AiEAlWpWc82GQwCI8YV5wlpLkBJR25KXa2wUSMgv8VY46j4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":782235,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf+NrLCRA9TVsSAnZWagAAUUoP/jWOhyPaJoVRoALsJ/So\nGu+sLcehO5u14I+5wqXpBAYuiyt8BAqVhrz/8YGx4mWKFzOHHdnEK4b2k0Mx\nvYryvQIS0OAms5QLxjZyK0+y/0IehcemMMKcZk2OTiA4peac1BiuCZUKfPva\nsuMrEX+o4DGvjJ04LskRc5D/aIqbEu1GOxCMxyp0fPXIW0x4SyYDCeqJqgmR\npB3CapajQdhCeq6j+fcs447iupqllDi7sBd14NnEEpyjYZNMXTZi1hRmcO8h\nSV/otswRmaPbmThludKgwtSuSvZty9yDFsDxGAAb6Lk4Yv6nY4Z4NMyV7Y5h\nhjvELiOwnJBA42iWTOoDi33RcLb4l/HnVL+/K1NKRpB8AYdcj0kUpS/uwWVi\n3O1VYCqTYq0qOhRI0FqoB5bOs8ODH5V7nRBa/0D7qrNIxv3jy++sFW+D9Q2/\n+eR/DaZ1v2L1cOi2BFuGbRLOqz85zRVWF7LEOFk+wWXnbJ03usX5wgyJyqdN\nOQZH7Xsz2llqfwdKWzQXkNTV/dXYhfKWzShGOtRB9LcHzpLHYtvyMhQdphGL\nQIYkOemUOCgQ1bf7hO6LVkfiZQeA7JCyt00mzVR1BWbfg9p39wXaCeYdtZ5R\nhTBxvusfI3nDAPQKXk1ClTIV32mcdXesSMDdXXdOjCozPdP+R8HybvgFTN6u\nYmUZ\r\n=VVm1\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"6a64709b5be73a45401fe82d1e6d126d7312fd21","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"10.0.0-canary.089de519c.0","@material/rtl":"10.0.0-canary.089de519c.0","@material/base":"10.0.0-canary.089de519c.0","@material/theme":"10.0.0-canary.089de519c.0","@material/ripple":"10.0.0-canary.089de519c.0","@material/animation":"10.0.0-canary.089de519c.0","@material/elevation":"10.0.0-canary.089de519c.0","@material/typography":"10.0.0-canary.089de519c.0","@material/feature-targeting":"10.0.0-canary.089de519c.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_10.0.0-canary.089de519c.0_1610144458618_0.8630596923669624","host":"s3://npm-registry-packages"}},"10.0.0-canary.163119837.0":{"name":"@material/slider","version":"10.0.0-canary.163119837.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@10.0.0-canary.163119837.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"0c93541cb5ed7580c564d8097669205cbc029526","tarball":"https://registry.npmjs.org/@material/slider/-/slider-10.0.0-canary.163119837.0.tgz","fileCount":38,"integrity":"sha512-D2NTDYVrwauA2kCTERn1K8o/HuMAdVYP0G7MlLbTE9fT+pQvS2GVEgu9zrAIKnoEDQVo9Iom0lFNEjnLovbeWw==","signatures":[{"sig":"MEUCIB6t9pk0ww4/n1+ol2oRQVKy0/cuSPrSPid+ZRBe89ZHAiEA882/9SpLzwkYCUvLOD/YY/g/+SFPeMsbqFmaJ9B98g0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":782235,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf+O6iCRA9TVsSAnZWagAAbssQAIqVxNB0iof1ltby10vR\nB4vkasjmD7EoymnJyOQFqsW9cLVwTnRT367FqH6nYDbh/30j2rMQk5m8RG2X\nECQiaaSHjzIAH5u4if3ZDwfrNhC9oWt/Dhutcwhle+cGc1J+YHyQDZe5FocY\ndOjfYFd6hRZ70NtbQNTCkVpBKKbKo+68YFMtOSx0kHZVxwCbz+B705R99UZ/\nxWjibva1aIOexjipiSrvmob3zyXVTlyiEgMNjL8EBfQ4D2qTRgnaDWB5BIy9\n/nhI/U+1Gy6vDGpSg+Isvssj3ymHx7w9vP5WAQc+H9Acb2CZDIEZ3mby3hA1\nW7qJ23Gw56S9ZBXJGelHp+nRAQndFLfBBtcwix1TrArEKxjcxDATQsHfguQF\nWk8mhsZdBK0e41BoTMyLxOHfgcK3uDFGDkailzxzl+nct82jM9PnpPIZH/bu\net04M/AK4VhxG7ZD7jo+WxIZAXK576+FxmZOwoYZfZCw9Hs4qgwmX1xCJ9rQ\nq6BNCH5V4o+h38YbA+K9gu7XdXkHlnNz0yI1PNhkiYeJ2wHhTRQgVikHt35u\nfBBm5NqN9/mDihrs5TQt1+pr48Z33DYxGIGsiuDSnVBPLgKbvPl6bVKI4kf0\ntRRSnPB7SJpVxd/y0e/KlSzVziCruDhsvfFxcNecJv/KiYOVkFd17YtiawyZ\nVKiG\r\n=yws+\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"86f8af57c151ec42ed920ac445544bc384ce0975","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"10.0.0-canary.163119837.0","@material/rtl":"10.0.0-canary.163119837.0","@material/base":"10.0.0-canary.163119837.0","@material/theme":"10.0.0-canary.163119837.0","@material/ripple":"10.0.0-canary.163119837.0","@material/animation":"10.0.0-canary.163119837.0","@material/elevation":"10.0.0-canary.163119837.0","@material/typography":"10.0.0-canary.163119837.0","@material/feature-targeting":"10.0.0-canary.163119837.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_10.0.0-canary.163119837.0_1610149538424_0.4612396039703448","host":"s3://npm-registry-packages"}},"10.0.0-canary.b8a1a58e4.0":{"name":"@material/slider","version":"10.0.0-canary.b8a1a58e4.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@10.0.0-canary.b8a1a58e4.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"3a3bd66d58d8258d71f9bdb53ff26517051203e1","tarball":"https://registry.npmjs.org/@material/slider/-/slider-10.0.0-canary.b8a1a58e4.0.tgz","fileCount":38,"integrity":"sha512-kxr2rj1mEMCcGc2/imR3U3b1McL4C3DJOa+zZUQSGf5QV1vj6MQVMYCkNNlTl8OkuQ+eLM4fXCWHaj23yCYtUw==","signatures":[{"sig":"MEUCIQCt1NekrsjaLwJzT7PCz9YO2MKbM3wNH61yEU7NaNWLMAIgGyG3ykpPM98MIukv/ovDVoyZAcV5md4oHEYiNJCCRTU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":782235,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf/HvpCRA9TVsSAnZWagAAnmYQAIlv2lFOgGhgojsrbJni\n5Y9cWFv3bOhRU2Z/iwtA88mZsJcVNkbihDyjXWIUTa0//WnHA5RFHFZfADMp\ndx8mmuBtp3kak9o/R5/fNBQs33CnFLaGTFvlCPQxBAJp1U1ouXIenYaWmp2d\nILlN09dmzmsX3I8pwr382zBRMRV/knS2RxAk1RirTaql5yhWzH5xczeOPgdw\n8ZXrPCXEhi7taocwfp6409CfMak4XO3ZVV7htWLqFbA3lHXLa7/0QZpfI7sh\n9/rYHmtMdIsnzeWgL9FVhiEgboUZT9agrXqi703fpdSpn9VtYnrZauO2h18w\nJHHmmQ2yjLSwRJe8u/NnnMgZci560UxFUVZ+5NzSpLE9Ee5I45HiQhDzc5lD\nJbFonvnFIma6ZRhIIR6TAhhUliEVU+MHIRwgzun1huyCKu6xBNbTj5sWnJ+t\njFYN7V3RINNLkQD3VL5MdJ8pOc2tTmxt5ShsqQCuqA0LI/sGfPaGsDwVOKCN\nni8atiMmqH4s+Rtny8nMLZH+OIk3S99+YxkFN9UFuwt6p48rrHEfgQbJ90u3\n8RVZtgqtnfv/GjuaysZLACi0o5LM8V93crFXE/2ASjPnIQLiPfiL6hdfOMPq\n6vZhFhMaWhv5M558kZmtE8B7dxB19o0OdFRpyjAa1YWTJXECjQpLKsCeQuSf\n+0B3\r\n=Zrxe\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"3b735aa03cc784b7346905168638eb6a486435b9","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"10.0.0-canary.b8a1a58e4.0","@material/rtl":"10.0.0-canary.b8a1a58e4.0","@material/base":"10.0.0-canary.b8a1a58e4.0","@material/theme":"10.0.0-canary.b8a1a58e4.0","@material/ripple":"10.0.0-canary.b8a1a58e4.0","@material/animation":"10.0.0-canary.b8a1a58e4.0","@material/elevation":"10.0.0-canary.b8a1a58e4.0","@material/typography":"10.0.0-canary.b8a1a58e4.0","@material/feature-targeting":"10.0.0-canary.b8a1a58e4.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_10.0.0-canary.b8a1a58e4.0_1610382312613_0.8471373447502519","host":"s3://npm-registry-packages"}},"10.0.0-canary.7584267ff.0":{"name":"@material/slider","version":"10.0.0-canary.7584267ff.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@10.0.0-canary.7584267ff.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"6abfd278e4452ff63edf9257221a7a224b6513d9","tarball":"https://registry.npmjs.org/@material/slider/-/slider-10.0.0-canary.7584267ff.0.tgz","fileCount":38,"integrity":"sha512-snT52Cjr8Iuq9s9zY+mSyNzBbqENjOmexzVRi25D8yk2BRhsaymaU0xw910PUQjqgieSFWe09hvb4MHzMva4Iw==","signatures":[{"sig":"MEUCICnBj11bDOlE/DPAbHrvwQP+FffZcX+bOk7VfNWqxJsQAiEA8ApwrgtD3DWwjJcf9qtvZaxm02YJKiVnRpuvp1syDUc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":782235,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf/PeJCRA9TVsSAnZWagAAWLsQAKJ1lKWJNxrYugIebxt3\naEVmA23a+Sv099jHf18TRu6/SJ0PbFvmgQvZeUsyUVOLKNghhfw6vkjCMV/L\nR5ssX/3DHIqeav9x5epox82ap7EZYiCMCSUgl2ZYL9INQFjvTrFdILB9uSUv\nG6DvF0FVKfEOtlppWqBUNw8TuhGfylfaaR2n+FvzvatjQvFOZriyRXCapKeP\nlwx5F978ChymWTTIsH4N/eKbZcHjbFKh1FJjwAbXxmTINMKNr6GDLaZaSGTL\n0tORsmG7RrHmlYi/10l60X05P969jOFa+SodbiLU5yYSfT8AUYRTOHy45vG5\n8ooBGpbP5UG3LEat0kzfIzEvXvLQzrHOw38v7uwSD5A3zRuFq1dJqP9/062X\nGD2vU/A0Tsa25MwGJbPJh5kL5bFquHJd6BuITRDVEJE+k8JxfbYHuQoHc1/q\nY1IH+K6EAW3vQq+UxRt/p2UQ1Pa26O/1vkXgI+13Wv6q0q6wl28LZdfNwCeF\nmubBHfkUD+Tpt0mgcWFYRzSj4IMOR9TsR4QwxECWfntZmBO3WH2CXi1J8Kpd\nDzUexAj/fuKSJXKSYapzDB1Xpczc2npDTG3GPIlyJbN2328fICjrcmsV4JAI\nGJrNCnMMoM4RIEC/qyW87y27A0mEcMqZyDqGXEJ7xsetJBXgnEq3LGyf6S6M\nkV8A\r\n=6FTg\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"89cedd80674ac536aacf2762f084fd7d1640873f","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"10.0.0-canary.7584267ff.0","@material/rtl":"10.0.0-canary.7584267ff.0","@material/base":"10.0.0-canary.7584267ff.0","@material/theme":"10.0.0-canary.7584267ff.0","@material/ripple":"10.0.0-canary.7584267ff.0","@material/animation":"10.0.0-canary.7584267ff.0","@material/elevation":"10.0.0-canary.7584267ff.0","@material/typography":"10.0.0-canary.7584267ff.0","@material/feature-targeting":"10.0.0-canary.7584267ff.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_10.0.0-canary.7584267ff.0_1610413961031_0.6545074198169705","host":"s3://npm-registry-packages"}},"10.0.0-canary.251ac04c0.0":{"name":"@material/slider","version":"10.0.0-canary.251ac04c0.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@10.0.0-canary.251ac04c0.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"e4f0f0c97ebefc0a30ca7926a68da88a847c053f","tarball":"https://registry.npmjs.org/@material/slider/-/slider-10.0.0-canary.251ac04c0.0.tgz","fileCount":38,"integrity":"sha512-nsQMaDi2amiIjYFwPOAQ+35JsNUftbgpLXjzyz7XfwD0OlN2WSncftkUmRqdbHqIxm6tnF0E2Wyon/VHSdvmYw==","signatures":[{"sig":"MEQCIE7I0yOdS/GCbdtE5rsr+2NluNWVxsLwZF1H7k5Ebl/wAiBxxrk/CHdbO4/uMpYWUxX4TzQfwjfxLKor2bPRbRF8PA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":782235,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf/f6xCRA9TVsSAnZWagAA8HsP/0BRmCTME4vwH8SrFE4u\nIcGAG7raynjxE1DXvRH9jU2M5x+b1dJB8BTdo0IJkepgLUqMZMlNudqR61MA\n83ctmgwemrDt4WvRKOmi/+U5ohAkRrr9Ia7c4mlzqZ6lIofq4uyOg3pmMio5\npXBLm8bUamGdtnsKAb40nABJsBavnDzCt9gk/Wtz/xpnNUyhYyek2tVbpoNU\naWfTQf0ENKj4RutOxu7H0+K06RrKAN5CQlhlmfA2KLcBiBAyZFdKHVMK5FKs\n8SObJlmlWgoZ4HR5QznXcXBjgRS2ifqFOyxQT+4nGI6pNVeQpgI8HW0dJJHR\ntSz9q2bZeWoRMG9rlq13t96acOwD6f7/mMx6FE9eL20z9oJRbYj7HK0eb3+3\nz+YPmWgjHw/rWy5SlQSA1ddEV4ucwA1/6kTWgVxGrXi/Dg53rC1jM8aF8s2h\nV74wzExaBFsd9kF0kJJouhrTnAKuVtIkeCos1vwyyHaILxcSqdIO1junw8Us\n+Hu2l0d2+ta8XDZo37hf/C51jdqDgC9OD70XuJ6MXBAsYDFxyHw9I55l2WoU\njXBqAx8CD9/HxWM8E+oEKfFEAI31Q4kSA/Bg4jCcqJO2YQgOzp7+uDi3w3tP\nYWDyyQoVEoO+7LMzioBh07h6owpFExCizFr1qjgVQU0fJOCAKM/dP4IODjuj\nezrU\r\n=6ONy\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"bacdc97357600156630f8321ac8a3a8746474194","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"10.0.0-canary.251ac04c0.0","@material/rtl":"10.0.0-canary.251ac04c0.0","@material/base":"10.0.0-canary.251ac04c0.0","@material/theme":"10.0.0-canary.251ac04c0.0","@material/ripple":"10.0.0-canary.251ac04c0.0","@material/animation":"10.0.0-canary.251ac04c0.0","@material/elevation":"10.0.0-canary.251ac04c0.0","@material/typography":"10.0.0-canary.251ac04c0.0","@material/feature-targeting":"10.0.0-canary.251ac04c0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_10.0.0-canary.251ac04c0.0_1610481328628_0.39606478345179363","host":"s3://npm-registry-packages"}},"10.0.0-canary.772cc1068.0":{"name":"@material/slider","version":"10.0.0-canary.772cc1068.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@10.0.0-canary.772cc1068.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"d57349bd78de414b197b407685b2e426da145e2f","tarball":"https://registry.npmjs.org/@material/slider/-/slider-10.0.0-canary.772cc1068.0.tgz","fileCount":38,"integrity":"sha512-Y6iVWpcqqXSdgX5G/m3mOdtbur/SXbSJMrNsCuZlFP9LtnIWv/RZsFetSIuQiFBH4MkvLQwfwOldA1lh5MU8ew==","signatures":[{"sig":"MEQCIDFJHs+2uTYVZlZMyjZA8VKdvKMA0xIRO/geYxncvgYpAiAKDNMQvXVgRWskUthWA6h4hm2fiQgUKhUv+Imgyw2uBQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":782235,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf/4s9CRA9TVsSAnZWagAAmBMP/0BA8GRp0qRbUOsJ+Hoc\ndtF/m4WRESQPveoacu0HyzjhS/PBHGGXDXc3HQ/JU5SyAo+My5a27IAu9Sf4\ndMjkm4NsynEUayn66GNxbydSe8L8XkvGzI1PT4mUvUQSBOanxQSKY7QN2g1G\nd/moamBGBRXCB+5I7fUxL4qTq3e5xamqoRTVoQtHe0VReFDcXLDGkLED1W1w\nrMfw0vvQPImYYj1lQnWz1L5AdUnAQkoIlKi0VJrFSbCIGkT35gG5eHklelsn\naE/E9hGahHu1PZld+gRZu3sTW40QV3/Bob3DOKWmPTYUBrxqvJz6kEJcVuyf\nMpa2DbxW343iPBao91sA3XgeR6KVDuvJ0oI0d7phB9fqz3iFzLBQVRwJ7oWz\ndAXCxxqwfBdJ2FwUey5/yXOL7U8+jTn+UbbKgWfuKjAgpJPqVvnQImX1KxwK\nvBZyCXzmMDDM/OKfQtZx7yFt0RBzkdBNe06ybNHIFL9/j8iTOjP6Sjuygd4k\nAw05lEPZSyVvkB3Oorhv+fflgKrcJKq2fWUmqTzJxNJrXzH/ctUtXHMbLAUo\nujSWtrggREWPMZjHpdexD476TipUYkWPEjs01EZjyajvoi7FmCMOnn0rCKZi\n1qCXxWvTiAhM1Hl18Q2yccM0MGOBnhfHrOhhUF6axqEoer/9bGtxxaCNHeaz\nkiBO\r\n=0W7I\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"e8dfb103b25351e76ae27e482ed4f13c4bf997c9","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"10.0.0-canary.772cc1068.0","@material/rtl":"10.0.0-canary.772cc1068.0","@material/base":"10.0.0-canary.772cc1068.0","@material/theme":"10.0.0-canary.772cc1068.0","@material/ripple":"10.0.0-canary.772cc1068.0","@material/animation":"10.0.0-canary.772cc1068.0","@material/elevation":"10.0.0-canary.772cc1068.0","@material/typography":"10.0.0-canary.772cc1068.0","@material/feature-targeting":"10.0.0-canary.772cc1068.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_10.0.0-canary.772cc1068.0_1610582844639_0.3001976470296712","host":"s3://npm-registry-packages"}},"10.0.0-canary.fe13dd130.0":{"name":"@material/slider","version":"10.0.0-canary.fe13dd130.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@10.0.0-canary.fe13dd130.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"bdcb6f5e40d7ac03fcfda5ff8f207db021b31286","tarball":"https://registry.npmjs.org/@material/slider/-/slider-10.0.0-canary.fe13dd130.0.tgz","fileCount":38,"integrity":"sha512-SKNhhkn1tM/So4yEjxhdnPyVc8dwJHvCErEpo3Lckh5MkT1LtsutzWZcEIyiNI4ZbI9CAo1baYKBqG5mE6AStg==","signatures":[{"sig":"MEYCIQCoZZPG+fExAQxhVKTmxsU0bICrkCBlCU5cp3h8b4HcHAIhAO3pie+UtG9LH1eaIrqV4fpdAVumFacc/V7VI2BBrlgR","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":782235,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf/5oPCRA9TVsSAnZWagAATMsP/i6Qfx0neGUSnEhQoHNV\nLJ/2HZi/rJL1Oh9C/xFFzq+HmVUw5UsVf4oB28aDeiXSzis9GOdEKM8dbT5+\nOAybPoYO0X5mkRdxQKBOGxgirMfj6t4WDmwbf1jow0PTvws5jhau6ESIsE1h\nzjKs5Qj1IUBpdOV+ntGudfSYe+aMyvql0EBCyLwWH69WhEInXD67Z1W3oJyM\nEEcucHVB9vyoQhgPr8vaq2EdCjbJpddohkBBHUtvWqcQ8AmTN109ODV06HXx\ndobesHeggMopD57SfjNFjTwxdQlmq00EjvoGExLm0urSnZEKfGcae0k1qriO\nP9JUnlvQoNwwWnj+E3pY11kFDHU8IKUvpRsSdKcFHNuveXdTE/WSI0U1t8YC\nu8nt8ktvzoa0l+8SpjB6vYTe+XnJwu6BnB6DRYeXlzTPmunp3M+ZisCOLTMl\nKvVBmDudZxbsi1lpashe1lYAzBYxXf24abbVszZEpsCvHYgIdhMJZuaLwgj6\nkOe3AZJON+8MNl3eNhWi0nfhtLAcy/0hLpBW4XzHwgmuEI1niH7pe8empUnQ\ngLgDJ2RtQm8PkvJljQ5wEhH9v5L7hDUrouj6yrvV8RofVdObSNFJFaGQ/7PP\nhV84KmZzb9i6cPxzlCAO99JaPR3OcMFNT7dvVhfFKvJBbV7dV9JO7k0KJPjD\nXL+h\r\n=L86j\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"8825c25e04c8e88b7430f2f8e148da8a9197c02e","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"10.0.0-canary.fe13dd130.0","@material/rtl":"10.0.0-canary.fe13dd130.0","@material/base":"10.0.0-canary.fe13dd130.0","@material/theme":"10.0.0-canary.fe13dd130.0","@material/ripple":"10.0.0-canary.fe13dd130.0","@material/animation":"10.0.0-canary.fe13dd130.0","@material/elevation":"10.0.0-canary.fe13dd130.0","@material/typography":"10.0.0-canary.fe13dd130.0","@material/feature-targeting":"10.0.0-canary.fe13dd130.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_10.0.0-canary.fe13dd130.0_1610586638300_0.7322459579021163","host":"s3://npm-registry-packages"}},"10.0.0-canary.c7c5da28f.0":{"name":"@material/slider","version":"10.0.0-canary.c7c5da28f.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@10.0.0-canary.c7c5da28f.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"cbe73634ea29ce90956d047cc250efa7d090a141","tarball":"https://registry.npmjs.org/@material/slider/-/slider-10.0.0-canary.c7c5da28f.0.tgz","fileCount":38,"integrity":"sha512-mjvLK8c+7D4C4bSnfrt57cvTDIX7E6GqZo15xtbAbZaiQQ7wMb3JdVxNVoTlJiM10iqgg+guYL44I2VEq6gWZw==","signatures":[{"sig":"MEQCIBPhTMgWyQlll4b9KYhQRsMHgxb2fWP33riffGEhsHUdAiA7bZhrsW8YmANwoTVcTMa9yKrVGp5g62QsxcdqnhWb1Q==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":782235,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf/5+lCRA9TVsSAnZWagAAhWkP/2ISw/MOYhyfkcwObEUp\nujO/PW2w01u6/ReTqETZvHXB6b13X/XxfoW2xy3JqE3iYR9iQzcvGGN1QalO\nVlGCcTABPWHJQlFZCpRZf4Adc4mQ6Hpq1TDC7vpQ/v9sToXIWO+YxNdT9GuN\ns5iZcCubkbUKBEd/F3VpTw3oM12517Qt50iMzAQip4UalvhQ78neEPXHR505\n8UINR1CEomV4j0M4n9CcNATb/mMoUCfW5ih7fgUuzhabdbiEK8LQIVhOebbL\nYly4vpiDLmhln+IkXMbvR8EqX9hFxtxTLixheb8huN2Ic1/IXlkrdSJwSvl1\n2xEnbLJduITGmqhcq6zj+bZy067+IsX5Igrzq8ld8YNB+bLupe1rXQ0+Ve57\nGBOwpP0WlYWupxwW7NbkG0HA3Cwrt4KvPK6nBXgjBOEFbelDd98zyi5AAH2a\nCbl9wArLhLHqpJAhvYTZcdvR0KGiWG/q/0MovVJkuUw8Bd/mZ21cJPww0iQf\nAQSlv+ZwXN+YTVFsMbKdFh+nF1bq5xQGTfcb6yyHsbJ9a1trVjGqgc9zzwF8\nQgNbvsEa1AElcmHX3a15L4ujEw/M64AQoH2yP2CQ41Nrsrc23j02jy70pXAz\nPrNjGNz81VhS2lEEcZdliDJJ8qlrvvEWbMPlnS9aZhhjp8TCZJ4rzgKpRG+4\nGmxh\r\n=3HM/\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"5d3f3a72d4e9757f2993684a89928b04ad29c6a1","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"10.0.0-canary.c7c5da28f.0","@material/rtl":"10.0.0-canary.c7c5da28f.0","@material/base":"10.0.0-canary.c7c5da28f.0","@material/theme":"10.0.0-canary.c7c5da28f.0","@material/ripple":"10.0.0-canary.c7c5da28f.0","@material/animation":"10.0.0-canary.c7c5da28f.0","@material/elevation":"10.0.0-canary.c7c5da28f.0","@material/typography":"10.0.0-canary.c7c5da28f.0","@material/feature-targeting":"10.0.0-canary.c7c5da28f.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_10.0.0-canary.c7c5da28f.0_1610588068947_0.8052434824120613","host":"s3://npm-registry-packages"}},"10.0.0-canary.b2faa116a.0":{"name":"@material/slider","version":"10.0.0-canary.b2faa116a.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@10.0.0-canary.b2faa116a.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"45f92e5cec0f4790d44322e98d3700996c831cf9","tarball":"https://registry.npmjs.org/@material/slider/-/slider-10.0.0-canary.b2faa116a.0.tgz","fileCount":38,"integrity":"sha512-qthfEfT8J1zm/TKutPktfrK7nI0eoCFy6Q6gzLA0870xGjms5kFiQb6s9zHYzOZOmjRfbjN5muRqI/jXFXp8CA==","signatures":[{"sig":"MEYCIQCLER3qv21jymY5qkuezkz2P+tEgPMVsuzHUGhlsOLrCwIhAMKg8sO7TzUCmBSKgd+sahDyqUhHJ3wMzcH7cVlIDeqF","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":782235,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgBzKACRA9TVsSAnZWagAALzwP/jqATKW/UDwiBfhbq8ff\nJMvepkXHUMkHr7KAczrnETgdTJ5e+iQeaioJcic7Z4YRT8idBsfz29Ru/j7P\n8gJlTQlvDsHv4R3EdyUFbD5K/65kqwM28qLKK1WrWEFpT3N174WY9eO2fF9J\nlbzeJlH0HTaBV2jy1YZGnecPpSu7a/jJDQExoUpp891H5tzvx62r67cjzCrh\nrL5vsTNcMZnigwVdnHs13GUw8MPAgfc67gnnjkr15zLefIxgOO9ySIaVGJ5c\nfOQ5tzjE2GPCrG8GhtXO+piXwUB4KaiBAyXJdOoG+vN4YYiMkH7Xy/fvfD5d\nVAUGbinlCOX1nGoOO57WrodqjRa5llzUjCYB35PDrwgxd8fWqvxmcWoVMMm3\nC1FJp+RC6EDsKbweCBgMQPIoxn2Q4TPpWYGp1ZUxaJ5K2sYR7vJmx8CZPgsl\nrFLcVKaQ2DiIL3/6taJ3kjdfcXMTaAg7nAbHyLUDndvr7fbEA/V/JQ+sOlRb\nqKCu+NoK8I4qnuhAlbk/y7x4/GX7EJOGWwaGW2meGQVx0rzYLl6+jOZQbN95\n+7RwsGn2H4Xhkgm9Xv7brgeHRrcNHipGJW37jqLrMS0hpJ2lejA9kC/Am2ic\nsqqTayNEEl1ghFTrpxAUG4wE/0x6/P/ms9to8llE06iJo2yCpTKAr2YA1PJa\nzHrV\r\n=YqfR\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"8c83e6751cbdbda8095b6ae0686196398066d600","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.23.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.23.1","dependencies":{"tslib":"^1.9.3","@material/dom":"10.0.0-canary.b2faa116a.0","@material/rtl":"10.0.0-canary.b2faa116a.0","@material/base":"10.0.0-canary.b2faa116a.0","@material/theme":"10.0.0-canary.b2faa116a.0","@material/ripple":"10.0.0-canary.b2faa116a.0","@material/animation":"10.0.0-canary.b2faa116a.0","@material/elevation":"10.0.0-canary.b2faa116a.0","@material/typography":"10.0.0-canary.b2faa116a.0","@material/feature-targeting":"10.0.0-canary.b2faa116a.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_10.0.0-canary.b2faa116a.0_1611084416166_0.9908367270751803","host":"s3://npm-registry-packages"}},"10.0.0-canary.0c95c9f7b.0":{"name":"@material/slider","version":"10.0.0-canary.0c95c9f7b.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@10.0.0-canary.0c95c9f7b.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"382cc7a3757909f22ec36f9e907e5eca2bdbf025","tarball":"https://registry.npmjs.org/@material/slider/-/slider-10.0.0-canary.0c95c9f7b.0.tgz","fileCount":38,"integrity":"sha512-vkXCcjpnVy9lb5pWgK7aD5Rh94yqc2pomb9UJkfESILNXkCxvfgAdpoOb0oEeJr05dKco84cwjE/KXJXEGN+Bw==","signatures":[{"sig":"MEUCIQDOiKKk/0Y6CR/9E2R2piTp+o7W81jUXbXYLYc6D2bBSgIgRxS1R5Vb6Sb/pDjzOMHrMlcD2Fo4DnurTv3qlb2+p1E=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":782235,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgB2MSCRA9TVsSAnZWagAA2msP/RGyiO/boLP/kU0xZ7bS\nNGK8RI2Not6/QrHgZYzlxX8cS4yEX6tDX7VCQdngDnAg58VRC5xQb8F3Tyky\nPR4sd5MQUr3juPoW0LaoU5VwdpT7Fqee/l1xB4I/HSyf5vjvt4K5yIR59Ms0\nQ1Ztnf0+Wov42+3FRWRXzfbSnL2IhxdEpHt7mRSs/4p/OGog2Q9TW9GdV7QC\nVdUyPh5RRS5ys2K3OZdXZKcmk9Xuw6biF8vco7+cVYVAY4IIW6ssbsU276ih\nzA1RZcNqepowlzQIQkZYfqOK0F/W9mXyoDgSH/SkEFXPeve03PxuSYwrZMp+\nNFhDEYy2B+Jn7rm5A8e/RP8hLi9XJ/HyJyhImW1hwkHnfmPmyLH1a7iDOSy9\n/xOs99hCN+YLgUQDsKEoWgdbeYnnl/EV8jtrx4R2ouvpdUiwGqJ0Zgep5qf9\nncfXsjaFZn2lOpBMoH+wk6l6BYBO0hgN50H5tJoT6R6e6qaxpgwT8oQjYKaX\nY5oVCUqr9IlQF6TeHuxbZHF/9CaiKA6EewBlm0kVS211pwg3cePywLiSeAgV\neLlJGdsNpIsN44jUVP1KWN2rCQHAATDiDEXDgOjPA1Lxsyv+hnAz8Kd2Dl6u\nx6l3riQoln3H9bHovmpOjlGzrRAKPCMa/ubrBC7w3Pxo0Tv6sLKxAwvztvdN\nsweI\r\n=5jlx\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"c9db31c38cf439af3f1498600e029c2dd812acb2","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.23.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.23.1","dependencies":{"tslib":"^1.9.3","@material/dom":"10.0.0-canary.0c95c9f7b.0","@material/rtl":"10.0.0-canary.0c95c9f7b.0","@material/base":"10.0.0-canary.0c95c9f7b.0","@material/theme":"10.0.0-canary.0c95c9f7b.0","@material/ripple":"10.0.0-canary.0c95c9f7b.0","@material/animation":"10.0.0-canary.0c95c9f7b.0","@material/elevation":"10.0.0-canary.0c95c9f7b.0","@material/typography":"10.0.0-canary.0c95c9f7b.0","@material/feature-targeting":"10.0.0-canary.0c95c9f7b.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_10.0.0-canary.0c95c9f7b.0_1611096849738_0.8672818307748007","host":"s3://npm-registry-packages"}},"10.0.0-canary.5268222c4.0":{"name":"@material/slider","version":"10.0.0-canary.5268222c4.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@10.0.0-canary.5268222c4.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"fe4e32b63559dde9b58cb0871f4b19fc764ef1fe","tarball":"https://registry.npmjs.org/@material/slider/-/slider-10.0.0-canary.5268222c4.0.tgz","fileCount":38,"integrity":"sha512-rWK+QGA1+C1osXZTg54zLLHohQJr4SZXPRfi/NFa4hnK/I5wtD1gWT6vWEVNU+9bK6t/hzet0htPkUesUBfz6w==","signatures":[{"sig":"MEYCIQDiVnU1BU9Hjd3X1AFM4bs0RwPJMkxUMb8EWKP+sgjHMwIhAPGYRf4KfdKHCGvMO6LKgtmPLZO1+swsvGx63oxLAxEV","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":782235,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgCIJCCRA9TVsSAnZWagAA/f8P/1ev6z4kzB5s9R3f30Y2\nLtuTOt6DyK5o/xbbpxuLt+YFsMWM0Imgxw+Yjv5hqbx1v71QJwPXYMgWlORJ\nnJgc3eF/gBu5oxZe47lMYlIlVGzl0U4ChRvgo23BSqviOiLJUd6yFOptihQt\ne816FLWr7wvySmHt6RviCSXWrIS6lhhVruVXF7DyMugphXd/bF/4VUE+rPD3\nCHixP+NMSETi7fiJx3CK1cikzBhue0MhTyu2YRzexSXThSzw63nOAZ8S9U27\njtp0M7gQ9aRSFaFgoaPQDuW1/DKMOBdlwZw8722x8bF3H2a8LncTR7g3HpWz\nZsoWBveb0xlhocQdEBIsJhPn7gpdfpqEGkMlSJvfYEHeVm+FG0Ic2aaG9RnO\na6IF/ftRQzrBwSlY3C2pR96n6MbgkHgDfomm5l3yXOCe5xT6ETHHUPl3eBw3\nlfDYbuKMVP3Ydz1hI8mOWPgEkz3WYRpljQEQRob6HF/zFdr4C3u9EuP4aKDR\nP7hm6MR3OL3MsqKF2Ka6tTR/6qLVRa142MTJAKSQT+9fIGdnqGp6o87e9TVn\nK05tIbmJQb0nuMMajZjTiLHTTjFtSu+XgdvJl+pEdxRY+NusiCpspVQoQlpR\n2hI11ANfBPlqJHr1hnn6MVP/eiL6TrpGlKO86fNrUj7MaqtsDk4YxDdalCKa\nBSMn\r\n=Afdt\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"149775a975bdac97e3f25a99b254c8b632e6ebd4","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"10.0.0-canary.5268222c4.0","@material/rtl":"10.0.0-canary.5268222c4.0","@material/base":"10.0.0-canary.5268222c4.0","@material/theme":"10.0.0-canary.5268222c4.0","@material/ripple":"10.0.0-canary.5268222c4.0","@material/animation":"10.0.0-canary.5268222c4.0","@material/elevation":"10.0.0-canary.5268222c4.0","@material/typography":"10.0.0-canary.5268222c4.0","@material/feature-targeting":"10.0.0-canary.5268222c4.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_10.0.0-canary.5268222c4.0_1611170370500_0.12408912340161615","host":"s3://npm-registry-packages"}},"10.0.0-canary.2ed2d829b.0":{"name":"@material/slider","version":"10.0.0-canary.2ed2d829b.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@10.0.0-canary.2ed2d829b.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"4f4d1fc5aad80a31b9a754792f1e3c90c98182b1","tarball":"https://registry.npmjs.org/@material/slider/-/slider-10.0.0-canary.2ed2d829b.0.tgz","fileCount":38,"integrity":"sha512-wIfy3fduzls0a7EaTQoEzIHPBljxqXUdTHeuSXpi2mBpyz7OICUmIMowa8uXMgyzMjIFo4lMBGEPEFbu6H0prw==","signatures":[{"sig":"MEYCIQCMMNKEpdRSjy/Ov99XSrZSE55xPizPAT3WWoSnnNBpJAIhAPxoizrhI2NeYnEW+CInorUuHmiUzWKT327hHnbGfYHa","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":782235,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgCLfmCRA9TVsSAnZWagAAtyIP/iM6bbOh6Z7waTAH1y6+\ngEOcvMMjtYmyIfUfGDxg9VvkljJ6XwxmeoIiQW6xxy36+o7G8OXUMFvfmSGA\nB1jzCiKb7dIGrieZq3O6o/fuHCKYfXWBRuHC1OjA765HpExdcsNM0aZZoNtc\nP3vvj+5JgkmkURVmGLJjfv2pZQiRTNe4ilgEqxjpoIf326SX5IHLZ/ei0BUE\nCAx7KMRbkgOTuCZDCxqj0Z0gTAlzhkuRkvM2/U39puMeaFkY7qfeXu2Hiavt\nES0jTxcljA6xyrl4iCXNFv21jLGeIp4TmfjagyHRvqY1pECikb3FfJY9zwCH\nzGBsA+ZgDf1yx6FwbbM/wM1jK7bSkx/CkVCHdYpSzan18YdXHqoZgRTUo4UF\njyCSCZt3LcBXf9DfC3wYZCwisEGI9zgw4iknU1DxPQJcJ97NqxFHEM69AZrT\nnziwxMCSfTAnIKia2CrcwqImht+BpQn4F4bgkGfaRtFTI0DFUFQRw9ov7JVK\nq8QpH4L9nRAo7tWv8wfkfk6i7aPwp90Ni8YDP8f9OsJFyd2oryehrScYV4A6\n+V9tj3JqZs4NS9DKoc+gqsZjJZA4Qa/b6Yb1ci/sypaVCRk9H4iQvFfDExNp\nG+YJ6N7NQNt2ILqADzlEsIITrd3qic8b+AyD3HC4p2XX+VGK9nilEHXvIv1i\nvDWi\r\n=GG/R\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"e937a8c393e2170307639b8126f0a461ffaf9e6c","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"10.0.0-canary.2ed2d829b.0","@material/rtl":"10.0.0-canary.2ed2d829b.0","@material/base":"10.0.0-canary.2ed2d829b.0","@material/theme":"10.0.0-canary.2ed2d829b.0","@material/ripple":"10.0.0-canary.2ed2d829b.0","@material/animation":"10.0.0-canary.2ed2d829b.0","@material/elevation":"10.0.0-canary.2ed2d829b.0","@material/typography":"10.0.0-canary.2ed2d829b.0","@material/feature-targeting":"10.0.0-canary.2ed2d829b.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_10.0.0-canary.2ed2d829b.0_1611184101920_0.8346440457211055","host":"s3://npm-registry-packages"}},"10.0.0-canary.df00c2b30.0":{"name":"@material/slider","version":"10.0.0-canary.df00c2b30.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@10.0.0-canary.df00c2b30.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"9b6f947bf2aec0b4ab889ef70d627a45a4da7736","tarball":"https://registry.npmjs.org/@material/slider/-/slider-10.0.0-canary.df00c2b30.0.tgz","fileCount":38,"integrity":"sha512-3NCwj7kYsWXOo1tnoy9L9bKmC18qtHbqt8u2n0G7NdbiYCx6Y0W7DYcHWWlbxeGN86J4SGXmfDRuz26lwb74iw==","signatures":[{"sig":"MEUCIFrgjB7nRhL46pGRJ9PI5LjMtRCk24ZIBooUPDLkVYToAiEAuhH58hjg2XngEghLp3bwZ4hYlUMZ8qCAzTK3odGV3Vc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":782235,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgCdwpCRA9TVsSAnZWagAACeUP/iMbVSV+5vxj8EvMsBaQ\nBketJlbkW4Q+ueFlF7MKYcmqpAJi5lmctRYzttwLDUluZiOBdM6MvKF3/v1j\n34c/yrKizkGD1DoxNt3F/AJba2mwr9FWSUhVH8hq9mPd62+QL5LQlCm2oUD7\ntE8BJ4U8gGZpJFUxbHuBfT2gnXrRXQiZMPExQBEmbVjGuHtH502jJkL6CQWi\nB12zQjnoAi/yeobLcj5Je/6mdoRgDmzNydCfXg7jU9sssjL4TVLQzaM5SOjV\n/5cOJtTsYaIR1puLxHNpBl+xJUClayVqQ6GHiIKKufVB69croEkt2dvtaQ1V\n/wOcmFnJVTxYr1RqDjRBqXiD2m0hB368O4fxBETnhOZIuYtjuYeaq1VZXuiD\nPPDEjfOXlQt9sse7thJEM8r+Xsg61pwGQt5Ztnl4DhLcVRf/UKGNTtyBQFtn\n81gaWG6uJou53f/2FqRBKE7lKG0IkiWU255Sa7P6/uZ0O2yw4VsYYSESSW+b\nWdYvip2CvDIv8sTPQ+JyLvFbdDVYit5O3S/kVwK/2ynWgW4s/+SfHAVHxD6k\nv2A3qfbsoI08s0cv4CvyMULAsZgpPWyDh/9Ai/5UMfPldZg5ESlGF2Ph37Ao\nJYYdMnonjIWi0Ym543BbSaCUTp1OUWE+RriEROA0yd0qbsAWlVqWjobjyxyc\nkpQm\r\n=YkbF\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"b80e68ca5ce1e4ff7a83ec06c805029869aaa5fd","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"10.0.0-canary.df00c2b30.0","@material/rtl":"10.0.0-canary.df00c2b30.0","@material/base":"10.0.0-canary.df00c2b30.0","@material/theme":"10.0.0-canary.df00c2b30.0","@material/ripple":"10.0.0-canary.df00c2b30.0","@material/animation":"10.0.0-canary.df00c2b30.0","@material/elevation":"10.0.0-canary.df00c2b30.0","@material/typography":"10.0.0-canary.df00c2b30.0","@material/feature-targeting":"10.0.0-canary.df00c2b30.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_10.0.0-canary.df00c2b30.0_1611258920645_0.186040322040264","host":"s3://npm-registry-packages"}},"10.0.0-canary.fd61b0476.0":{"name":"@material/slider","version":"10.0.0-canary.fd61b0476.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@10.0.0-canary.fd61b0476.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"5813e0af7b53ab82f3d561eb1e438520d1a282b1","tarball":"https://registry.npmjs.org/@material/slider/-/slider-10.0.0-canary.fd61b0476.0.tgz","fileCount":38,"integrity":"sha512-MLro6ChFBvwDYgh2+9KSDejJqr1F2z2IC79bc3G+XGMmugX5NfPhkZjNf14CfE+2bGgO7gRxn5cIvSHaOQYeCA==","signatures":[{"sig":"MEUCIGx9gh1J7eY1QDPEMPUxoCLPb1xjKvL8sfvObEgUihITAiEAluHzRiuZo3wMNXncYkihnhg7QYssv+OpLGeQ/XJkid0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":782235,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgCd+VCRA9TVsSAnZWagAAK0oP/jw3D4TyjFzny/aFExtr\nJ07ydVxtjWbPUx2OMEYO/NCXPiQC/Xxn1Zx8IJ263kBlmYsc8eunSRTL+zck\nL9/2jdJ6fL09WOz+S+80urMt2nuxPVi61nIgr4HYpeGMytlOTe37XGQJ2aUE\nn26nidV9iOUSGywYQx7t+XNk7FPaGfw2PvU42GJ5JMekr3cTT65E1J1i9rYQ\nhMRXMsFtioHkrQPvhcMR93KvVCbk0BjqKEOWpbzNJbYZViH5SNsB5j0DNRPz\nDl79yy27erBhn2Y2p9U9/y7UPhR58VB1Q40NhAhqx8VHrKeP6pSYAVE/MXPq\n6ouDHjjJtqtj1TDmWQxuSyO8LLIsZ2/+byNIaurqAjexd4VxwDiJunUqrZAn\n2oF8ec2XIYVeU3vciVs7GPmchi2n5EyL6S6B7s4f9OT/z/OUTHUPrbFMEHzJ\nOf3NivE0Jot/Cu2pnqnYGVVtY8JnvES1pUdO01huFP0nAGay3LnTTkJBuoXz\nm4Sx4BsQ6+dss4Ucf4QGgF4yCuKa/grU0KWdxTfLTJE2oTXtt39w6+LFrqnk\nymqZHkajtTprKNdTuwxBma3lR1KOGglllVgP358l9l5zpkP7/P47pJh1Foll\nr3TRKEDxDBpbAP4WwQeO1WqMm/dLBpGz65dXmoh3F98UC7S3v59hH1Fk/4yZ\nPlgu\r\n=ZUlL\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"67853fc809fc128218f211f5b54f854f102d1ec1","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"10.0.0-canary.fd61b0476.0","@material/rtl":"10.0.0-canary.fd61b0476.0","@material/base":"10.0.0-canary.fd61b0476.0","@material/theme":"10.0.0-canary.fd61b0476.0","@material/ripple":"10.0.0-canary.fd61b0476.0","@material/animation":"10.0.0-canary.fd61b0476.0","@material/elevation":"10.0.0-canary.fd61b0476.0","@material/typography":"10.0.0-canary.fd61b0476.0","@material/feature-targeting":"10.0.0-canary.fd61b0476.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_10.0.0-canary.fd61b0476.0_1611259797394_0.9243737543012482","host":"s3://npm-registry-packages"}},"10.0.0-canary.3fb3a0265.0":{"name":"@material/slider","version":"10.0.0-canary.3fb3a0265.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@10.0.0-canary.3fb3a0265.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"d1a9ee5d8b62efe57122eabc95bffcec4bd5cd88","tarball":"https://registry.npmjs.org/@material/slider/-/slider-10.0.0-canary.3fb3a0265.0.tgz","fileCount":38,"integrity":"sha512-1WxLol4p/BSQo8TIErj02N/lkUfA7DZZInwXyilItaixVku3bk9DsXaLb8C3sRAbrEwJeAMQ1ReT1aYmo2+81A==","signatures":[{"sig":"MEYCIQC1zhd6+oG+VIomLuglwZf4ct/g5EjINKZTR85C00JskQIhAMFP1KJJKsUP6j4wTQKBvyfBa/ZbOoLQlb6fksTp8qRK","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":782235,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgCha4CRA9TVsSAnZWagAAHtUP/jbUgrDU2u8ek6XzOo+t\n0mqrZNbtVXamnvmj2YAT01cv4x8tSlm/8mqMeQrn6LlrLQNC24s1Tl+IAuL9\nSXSvW/EC46VykNaMiPzKUsRpu2I0mct+yz6xY/NfJ3Mt/BIXqFkcYHgNQ9ZL\nm4vC8pcu0VEiZSagyjPlQ9cxsNZV9TXtfZuOmQZeGGC39d4XL9dvMa+bnB8u\n6nNbt3rENiFZF54kqLsq8xzFwuk8Q3m9lTOXKz4MuybuNLaASeTdW5iH26k+\nAWn/DurQAAlqBDAblP3PfBIrSTmwrvD0fODgwS9YWXJgQ5WT1L9y8MGamqrA\nxHYcrqg8P5oMTtEbaTropznkNr8uo6Jj033UmI74aj0Vy09ykzJzewD4so38\nk2IrMCkF7cKm4UiknIa7H7nLziXtIgLyxXKfgXUMjcN7AV4mQltxX8di5XCK\ni8+1WbFrqCNb7BTx+uJ6/NJugQRB/Frj3/+2mJPb7uzE9sdQ1hqAdYrO8Egf\nG4ASGH7dbrHRcaW7M78hTtalppJp/g8rf8Y74rLROZiBV72rNRQpWz4Ehz7f\nE4wecdWGHYaSzm8GuMugWwyaBaN+y/kFez/3l8IbOShGJdUEpPsOZXciTDV5\nwEV/S+st7eQkRLAg5q0+sso4Ojk3HNwuRz88B6SlG/6ctFFPrpwuxltFaaaG\na709\r\n=gTXy\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"5e619e42cc5398fa779a726d775cc7e9a72a1acf","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"10.0.0-canary.3fb3a0265.0","@material/rtl":"10.0.0-canary.3fb3a0265.0","@material/base":"10.0.0-canary.3fb3a0265.0","@material/theme":"10.0.0-canary.3fb3a0265.0","@material/ripple":"10.0.0-canary.3fb3a0265.0","@material/animation":"10.0.0-canary.3fb3a0265.0","@material/elevation":"10.0.0-canary.3fb3a0265.0","@material/typography":"10.0.0-canary.3fb3a0265.0","@material/feature-targeting":"10.0.0-canary.3fb3a0265.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_10.0.0-canary.3fb3a0265.0_1611273911913_0.7969973546503335","host":"s3://npm-registry-packages"}},"10.0.0-canary.07deaec27.0":{"name":"@material/slider","version":"10.0.0-canary.07deaec27.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@10.0.0-canary.07deaec27.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"b6525a2854d8653883d7c7286b0b7bf0dcb82215","tarball":"https://registry.npmjs.org/@material/slider/-/slider-10.0.0-canary.07deaec27.0.tgz","fileCount":38,"integrity":"sha512-mQhWarUzYKHvEzHXte8Ma9DG0201OaidLZrZDhAryN/F6m7Zzi4F5P+pmGxzyChgBokFo1Wq9FCY0yNGS9xeMw==","signatures":[{"sig":"MEUCIQDfTv1XuBsJZgP/iiJZGLeixDCYhPILcj38hM0CvkqyHQIgCea7VvEJBaojwnGaEjAwaouT3fpPqppixDySl1mY5oE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":783012,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgCwPOCRA9TVsSAnZWagAACgUP/RSYfFA9EGXRbqvfMa+E\n0ShW6HyWH4V6GfClH5tFnsgSp4csrxxf3EHY6IekpJFZ5AakMGOo4SWMTrV2\nOpBM6jdhmKb0Qsy5ap3e/YrGBt2cxl9GupfiUcG5KmI0tYEoL3DwxCAKW6VX\nwcPyzp8FFPhfZ4aX/Gbt1CjNHGuaJFX/AylPR9h5x4Oc5dENG7r/UbIoctLb\nZcbyHgdWIx/sP6m7kUQ5QJln/m/8KDbdphqTWnMXnfGnezfubbe7VelZqr24\ncEvNEeoiiWdpS0S9WnnZtSuihPB3YCJbm9CaVmbu7q+S1P6zWE50600sjhWP\nbspb0TiDwdHAPqftIjIMeb9ST45QYRprYl4o080g1vsmVZm/CYyN2PFzUkQ4\nGrTZkvwUrHpE4QSWubdGgtuOGs/bjUU9fRxHEI58yocDTvkm2bat8+3FgoP8\nl3YQKy4uiDzBpiRG2CFr/wq4BzOhLni8jPIOhE0WiT1wslbBO6AoCvyJHojX\n9ENoOyhJP4ODsH+ai6CSiAVNnZnv9wdqqVmo/to9iOZHOEXrr5Bq6ru+Oqfy\nL/OZQ/VJmBmhzR5qMpT287eo6GIkM85ZprkT4lykUXtaANuiWpSEE+EGsFTy\nrGV19/hoX9wWIaboztcIE6jS09V045HKl2bCDreFWxEEoCN1cE7md5QxM5M4\nYYYI\r\n=YoaQ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"be75b8d81f1ed6f8ebe94c8673f32110d71cec7c","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"10.0.0-canary.07deaec27.0","@material/rtl":"10.0.0-canary.07deaec27.0","@material/base":"10.0.0-canary.07deaec27.0","@material/theme":"10.0.0-canary.07deaec27.0","@material/ripple":"10.0.0-canary.07deaec27.0","@material/animation":"10.0.0-canary.07deaec27.0","@material/elevation":"10.0.0-canary.07deaec27.0","@material/typography":"10.0.0-canary.07deaec27.0","@material/feature-targeting":"10.0.0-canary.07deaec27.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_10.0.0-canary.07deaec27.0_1611334605978_0.8073882088875532","host":"s3://npm-registry-packages"}},"10.0.0-canary.d2959b16c.0":{"name":"@material/slider","version":"10.0.0-canary.d2959b16c.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@10.0.0-canary.d2959b16c.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"cf003ec4f6855a45d4c56655de15b6e4ac136feb","tarball":"https://registry.npmjs.org/@material/slider/-/slider-10.0.0-canary.d2959b16c.0.tgz","fileCount":38,"integrity":"sha512-wWwx1AoAjiG86p45TfdCZrSQ2xL1+55/b9RvWdDDO8kaSSBW8hNumMm/2QswXucGO/3+27B04dUo2hPNWTmMFg==","signatures":[{"sig":"MEQCIBgqgqywwC2GthIr/b3I80YpUrnuuCmmyPd8eb/vNtAWAiBYK5vLay48q3q4e/q6WCeLjDlbCnQaSLZ/G0yiSqgwQw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":783012,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgCx7uCRA9TVsSAnZWagAADo8P/ROl7bWoMuTmdeyItcmC\nYvLfAIqiVtnjpLOdcVhRYVqqCWaTgIvCQ7ieT4ae4av3K9YyAlVAh5tqvESE\nlqdoQmf1+FURHg7o/skzP+l29YVYeP6i22ILN6HN5css8eiY2wz0VNBIXWpg\nJYNKT6lXT2Rz3nh6Ma83+gnqlA06wGJMo+1nSoLImJOwbyhJ4PFdx4FPmY5l\n8bFu0mrU0sBXCHuPHa5OyndfaYzcmMriQpTC0w+dpUSuslRge88w9RPXRzO7\ntgRJ5aOFKjbD8bwA3NSYH0mx6sxmfj6+u/OyFy1rg46BSpVahhj1QhXX7boJ\nK1I/AOB0K2vkPXk3EMmtdMaAUZy7+u042b7JMX+Zkj7HSAJ8YpQhmZhfPGjK\nVo6Rsrf8PgQwMkhVOFrs4TlrK+5cvMBJfVQdenSyP+e94Y3+6C9NdxHNum2a\nq/q/tTLAo7qAyjoPeSKVy6JsWwK3FrNxpRv8aqnnKaYMqqtbTXh1p/Ntca9U\nWisTQI0xtulaoa+smkrSGb0fui7qCWbg8GCiOhLmC0t0cqQ6MTUSpbMOkE2e\nVNujsoExaOC3iJ07QVHztX0y7lT5Tj6JZ37VUzV7uIYYFJkNUyK1AiMOGMif\nfp8PtvJDfqI0jQwgM/LtpKXoXM6prCX2PjU+hEIHCPaWycW4R4HkyT0slA0C\nPGf6\r\n=5AmV\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"9a89df0257ea15e66bbd565cfea291993f0c4ef6","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"10.0.0-canary.d2959b16c.0","@material/rtl":"10.0.0-canary.d2959b16c.0","@material/base":"10.0.0-canary.d2959b16c.0","@material/theme":"10.0.0-canary.d2959b16c.0","@material/ripple":"10.0.0-canary.d2959b16c.0","@material/animation":"10.0.0-canary.d2959b16c.0","@material/elevation":"10.0.0-canary.d2959b16c.0","@material/typography":"10.0.0-canary.d2959b16c.0","@material/feature-targeting":"10.0.0-canary.d2959b16c.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_10.0.0-canary.d2959b16c.0_1611341550377_0.7132047712558884","host":"s3://npm-registry-packages"}},"10.0.0-canary.75f3bfe7c.0":{"name":"@material/slider","version":"10.0.0-canary.75f3bfe7c.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@10.0.0-canary.75f3bfe7c.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"42e104200d2447a8931470f5c24b064e2764cfd5","tarball":"https://registry.npmjs.org/@material/slider/-/slider-10.0.0-canary.75f3bfe7c.0.tgz","fileCount":38,"integrity":"sha512-4tZ1bmPmjql7ektrtenVqqLuXC/5bkKF1T3k69fUWXq3Dcd7YX11eV5NwjGX2+UoQTOPEyMx7ZwpRJVaO3XqeQ==","signatures":[{"sig":"MEUCIQCXFfoUqte+yG07zSO9LowC7A4OskYb/Ax9JNmEInHMLgIgDAIOZgs+/k3wg6A0NFSjvpOq114RnRTuutDsWCQ3+Do=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":783012,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgC1cHCRA9TVsSAnZWagAA2xsP+wVx2L1aoF8AlvvDlDBD\nfIBTWY2IjK4QU6fwR/s0QObR5SIkH9f/Jydq7an13ADnp4/xrXNr/hVogJh3\nshWgnrqlr3i15ZvzpLvWHMauqAA89oV3tRmgWSOXSAQA0wSMu0Dss2hpL+/l\nerDW7bEmArTR8Ejnpg1Sq3ATBnVI25DSYUURG/aryfyy0NagFZQ4UlSnCyXH\nmk7cwX5+iKqv0p+Jm7znV95qvPo0RImaPlQo2P7BhgKj7BWU+WnblaOqVi/P\neMeGyyxDoT0lg+I0FJaMfnAGSOTXj3QSgo+m/GhWSNr/aYyVVYFUurdyG0/e\nnlu9bMm+Z+Cp7iAck+fOT0vdeLP5rh9nst/UEwALICjmou7foufhtA4/gb2q\nfFwdXjeNPPKk//chHnRvfX1ke2mktZJ+nvxDd8TlM65xA1Kom80XAIyulWij\nGDzTtnBOIPnKx4Wm1QQ/UeW4IMrbjRBFu+t68L/gMY9VSD9kw0TGFJhvD1O5\nMTPaErE1Q7irHnyMVE1XgebHBXRqycUTpk500GmCqYhK00bpdst54uEbIPal\n0xzSlubaMEH4Ic4dU/FaWonapOGvkcnVo5WSs83QVR2Kfr7CXdb1xQn7JIco\nBTLGvbY0VgRsFhtOOzi/YDRs0OloBaRbc3I4G1xGcNpYxenvZgTMfjURuEE6\n/f3W\r\n=JTf/\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"057941e604e02f88d571d61967040f58bf499bdc","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"10.0.0-canary.75f3bfe7c.0","@material/rtl":"10.0.0-canary.75f3bfe7c.0","@material/base":"10.0.0-canary.75f3bfe7c.0","@material/theme":"10.0.0-canary.75f3bfe7c.0","@material/ripple":"10.0.0-canary.75f3bfe7c.0","@material/animation":"10.0.0-canary.75f3bfe7c.0","@material/elevation":"10.0.0-canary.75f3bfe7c.0","@material/typography":"10.0.0-canary.75f3bfe7c.0","@material/feature-targeting":"10.0.0-canary.75f3bfe7c.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_10.0.0-canary.75f3bfe7c.0_1611355910477_0.4778599556541532","host":"s3://npm-registry-packages"}},"10.0.0-canary.b9adb7a0f.0":{"name":"@material/slider","version":"10.0.0-canary.b9adb7a0f.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@10.0.0-canary.b9adb7a0f.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"dff71efe56b3edf5d5ad0141976a9f9b88b20cfd","tarball":"https://registry.npmjs.org/@material/slider/-/slider-10.0.0-canary.b9adb7a0f.0.tgz","fileCount":38,"integrity":"sha512-0jozD+k/lqVlaOAKWrNbllToQLXPITE3+LjBwAvAH9meXwPJj73iiHd7LVcT9beHluzdeT0njV/6Sh3WYK4ntQ==","signatures":[{"sig":"MEUCIQCSOnPxiG+8iT9l8OqQlqF/hM6ZADj22OyfvLMMsSZnMAIgEFOqVNEKVNeD6NLhFycwJopq8ZHDlBe+xZwDlwE+brY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":783012,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgC2FqCRA9TVsSAnZWagAAjD0P/1tc/4eiNBRQhXhdyOcJ\npQU3disv9hzbuFgxa5MJPQ42TOp5mlgGwlTXJikerzY7b+zdH8kNOZtBeKSH\ngkgZbIC5xdG58DYPReXGo3kXo9rpHM08ZIeW2j767ZPPPhFJYGgDKuIP8ySB\nex9yuWECGzbJwV6M62lvvA7EjZRrqUv8n0k13zEE5+tXMOOuChLFCgFZj38D\nWo1EZDRaecVPGAx1g4Y1ooXiuVJJhaD10gIyG8B5sXRE1phb50DBEOtwf7LX\niZ6qdFf9C80muBpAI7pwzlVH1wje0H7xwCyYu3ACYi2q3wDETSn/OsAlARp5\nbLoAkaiBF+rQupZZQesvOFNtk+34SLLSxvUUwdFbANjDbB1M+vYRupzTuHvZ\nWAfWi95ecSZ4x520+MvYQ+/iq+gwLYdVfsvAAjxjmO4OSZj4VZfGqq2yMZzN\nccRvTvcI/NxcLY0mQdWziJsngSwdO1iMXbcXp4MoxFuOCoP+IFO/kSgVvsE+\nIX77tBetYZyg80vmD3DZTs3LoEzMEy/yZBa0iP98Ixsn3iqJC4ybA9QPkmRA\nepiCFkcYatxES0MFkGKjqveb3eHQiH1c0BoCwFV8PGL/9+1mIYYKiPcbE/D8\nciSBwyhbw1HwdOwXOyzOE6U1amXpfNkgktibEQa4mrs/1XbChppKpFoGkTGd\n/kcn\r\n=YMHD\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"a591eb080c699d02013eb9ab0090fdd5e9813a72","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"10.0.0-canary.b9adb7a0f.0","@material/rtl":"10.0.0-canary.b9adb7a0f.0","@material/base":"10.0.0-canary.b9adb7a0f.0","@material/theme":"10.0.0-canary.b9adb7a0f.0","@material/ripple":"10.0.0-canary.b9adb7a0f.0","@material/animation":"10.0.0-canary.b9adb7a0f.0","@material/elevation":"10.0.0-canary.b9adb7a0f.0","@material/typography":"10.0.0-canary.b9adb7a0f.0","@material/feature-targeting":"10.0.0-canary.b9adb7a0f.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_10.0.0-canary.b9adb7a0f.0_1611358569667_0.2817275597371922","host":"s3://npm-registry-packages"}},"10.0.0-canary.d29ec2862.0":{"name":"@material/slider","version":"10.0.0-canary.d29ec2862.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@10.0.0-canary.d29ec2862.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"0b1c6d731403fe5cd0948ec7e48efba4fdbae8f4","tarball":"https://registry.npmjs.org/@material/slider/-/slider-10.0.0-canary.d29ec2862.0.tgz","fileCount":38,"integrity":"sha512-UutBGlm0nz+bmIRsUNuDu/I+MBqB+Cd9sVDewcmrVZiYYXyU6Gxq6hp5HW5pPLw9gTW7uiexybZCq+Nrz1xXQQ==","signatures":[{"sig":"MEQCIGaIirhIlbka58oyg7L2AKRhah8iK9uqSJCPVyswOiHXAiA/22pg4c0+YXfj47bnW/2/9/kFzPIsoQN18Sglo4DqcA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":783012,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgDvC1CRA9TVsSAnZWagAAg1IP/2Uj9PCac1D9dZ1k3QNG\ntBAhWiaCkhprDMjLDnNq43PDG1iG4WdNIVsdl1+sYzHxKh0x8s3DRESMllsJ\nUpMIIj6dIUDqN5mucbLDFFmsJDAyGWW79kAjzc7MgKg/fErZVoyoKAhr05NE\n20dDaTAH3P/Ydyq0c4DL4HuXDvIFfzu+5/bfP1C5DIYZ9Q+2qVI+wcrJQ8qm\nwpNDp4TO33NWYxQWdxnCEiX1jiOf1Byx/+2azV1jbl4fuuZ9BoU0XNo7Yuh6\nAk3HX2OmePjEQt7i4urGSP8u8gjp0rLvZciABSmiBoj4F0UBR4oTjtf1FMKX\nWHeEhfo9OZh/eCnlfyw89zY3SNgq4eVKmZcNXrD7v4vTZTWPYKcWLhtMRAem\n1e/kKzjWBy7ezoTyDLBK9AaRIiM3VmuDLSR54ZHi9zZGol6gPnybEyXXDkAq\n1aIs+gX7AxuoM652aWFN6QrIsIhUFMvSoxMyG4PvaUwh+xywPO3QlhtI1bzn\nS0xi+5OjuqBVLdhw8U2J50BAwOCRUPnpE/29yi8aLyEUTsyNNEkeFrYORRw0\nxoOOGKPRWSIufdykwohZ5ZXFqtyvhXTrGRwJeiiLhno7dSWYYmzwn9VEWGoD\nit0j2Z3ymkijB930mPa9BX2DfBRrf8MhBdQYa88ZnyAGy/W4mPKym7Rr8b8m\niprh\r\n=ZFdK\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"1f2d18d6e94fa1f0808b7d768169b9f4827dc692","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"10.0.0-canary.d29ec2862.0","@material/rtl":"10.0.0-canary.d29ec2862.0","@material/base":"10.0.0-canary.d29ec2862.0","@material/theme":"10.0.0-canary.d29ec2862.0","@material/ripple":"10.0.0-canary.d29ec2862.0","@material/animation":"10.0.0-canary.d29ec2862.0","@material/elevation":"10.0.0-canary.d29ec2862.0","@material/typography":"10.0.0-canary.d29ec2862.0","@material/feature-targeting":"10.0.0-canary.d29ec2862.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_10.0.0-canary.d29ec2862.0_1611591861159_0.33499302780328577","host":"s3://npm-registry-packages"}},"10.0.0-canary.96be07c68.0":{"name":"@material/slider","version":"10.0.0-canary.96be07c68.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@10.0.0-canary.96be07c68.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"e92204772ad0649c542c7b319f39146472f317eb","tarball":"https://registry.npmjs.org/@material/slider/-/slider-10.0.0-canary.96be07c68.0.tgz","fileCount":38,"integrity":"sha512-hVwGNcm5vaTRMxOsJCCat9p2oFdWwXkChmKuDBDt3InRuKkZ7xCEjTfMuRvm5KMZOz3ukDrK5xSDVS6TGFaxYg==","signatures":[{"sig":"MEUCIQCAfpkBaJPCmCDyRCCcxUG6drsRbEndjiM5LTrTUWzgCAIgS8oGnrjSvoqUXEWrqpdxrbEwVjJUUhLSZklxqveIJxU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":783028,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgD134CRA9TVsSAnZWagAAVwcP/jgXMvD+V9qsJdVUlhDe\ncM+qf912q6Y7x+zrnUxdFUQ8JiNC4T6u0HiYQ7DcKH0XN+Mm7SSosZy045PQ\nmifLrTa7EsYh3gc83APPrav7L9Fnf+7vgNfbB3L5zzDZAp4MXjewqKSpKMPW\nyUPmt5MhO59NXjIjm7dfZmjFoXNFKd2s6DD4vXH4npL2pZg40txpMQxPc4GK\nYu9/vFFL0OtP5uHtm2pZ4bBNBq6+a6uJcH8B2QanlTQZQ/lP9MxMKMzUyq40\ndp4EiisfVh7ZD/lOQKXrEFKFiy8i6KEbCIKg2p0AEIYG/E4x/D8t1FhqXkgY\n8wa4TxFmpjsSD8+TRsb6LDKBliCdbRF/ycRQEnigu3139/bUtdiDAJb2vuw6\n5Xsr6hl3IQ+ETGz8dUYwC+oQL+7b8QIa4U+mIrilf9/99L2HWVTN3wpQHuEK\nYlGOFE7Z2g5yDY8gwZLtpsq/RxGutAodY3BrTDHH4MHm6DYLrA3MWkxaKHvN\n9uYb4gGvMpGV8AX9dFIOmUyCWJc02u3hNcKTTQfhhGBdJ2fvXGQJYI+7Ws0a\nmo6ehGoWg5hsF+7pq8xOXgQhwOvh7D3d4DouR5h57P6TkBmiCvDTLcxT4e8K\n+07BtDm4rxiTNYe5T/mg5nb1LqDKmNWieP31f9IAxE9wpmMg9BxANNHOLJr0\nSveo\r\n=4nmx\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"ad510acabea4f02cd7399e109ef73d3b0bb52e0f","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"10.0.0-canary.96be07c68.0","@material/rtl":"10.0.0-canary.96be07c68.0","@material/base":"10.0.0-canary.96be07c68.0","@material/theme":"10.0.0-canary.96be07c68.0","@material/ripple":"10.0.0-canary.96be07c68.0","@material/animation":"10.0.0-canary.96be07c68.0","@material/elevation":"10.0.0-canary.96be07c68.0","@material/typography":"10.0.0-canary.96be07c68.0","@material/feature-targeting":"10.0.0-canary.96be07c68.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_10.0.0-canary.96be07c68.0_1611619831392_0.03807995381914164","host":"s3://npm-registry-packages"}},"10.0.0-canary.e383944e9.0":{"name":"@material/slider","version":"10.0.0-canary.e383944e9.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@10.0.0-canary.e383944e9.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"dca6bc0a82184fcb8e9ab4bb718350e381204040","tarball":"https://registry.npmjs.org/@material/slider/-/slider-10.0.0-canary.e383944e9.0.tgz","fileCount":38,"integrity":"sha512-8SMr2Dxhmkl4+gdPtvJoyIhiQHWGwPROHQDE/xzkJtvtHrcHhD73jO3diR2jGo/2uE9/9f2ejKeRYUws6L4oyA==","signatures":[{"sig":"MEUCIQCV6gE2e7W0/FTnhNlWROYBGfOxek0Tt/wLsElnUloQRQIgHRQa0YKcAQyUkMNEvZaDqwpVssBvX9eitaBOXH20do8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":783028,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgD3QuCRA9TVsSAnZWagAAQygP/2IWaXNTg4PqJCcWOY2k\nn8CKcuBqFjn4RPLTjXR2G7JISA8ZYowxGNAXg9gesSlx5pu8nO9FVeL8TmZL\ndigEeOz3DscF6mKSDzcTcGrf+qyD1Ab5ZS0c9tBu9WZFZDJn1LMP8ws2DCN+\nZLNCZ7+n5Pz/rB3g3yALr56uNZvHgsnmWvAqtsJVBNOjLs6XQbAV5PBIs3St\nkprCWl1I9poQJoZv+U3KzT/+JQJNkyFrnKD3dflXUyvBKwAsXQkMYsXZZKNV\nh8WDYDWmO0BsO2NmOY9YfMq08ps1R0zLb7rScHv9lDSaM0I+5k3JMuKc2JOA\n3ilaTPaVVF8g3rIjOPoIPxj/Np4lFIuGoHnmSdft+8RRN6OR9BIIQbRH0sXc\nVBlUSOaKkeZDautCtwaRUWAH4JtoXztn0m5+dshGUiUhphrdh5eQu1ZcRe1Y\nZwOtuS1aJoQCEOJEG3lHZtvV4CTqLczZm3ulLiRQv1YvKleK1F17XWGX5O+H\n4iM7RUfJfvJBlMiK5w6guV8ZKf0Wwvmr0Kg3p3KzKnaMWZA7S3k1WLfcCzrh\nQ12nql83bSB2oOoJIqQq+S0zbjB33D/J/xUuvuk0Ixo+LMuekF2YcspXJd8t\n41CwvyiiznyVJgqcqByR3Ffj+Z16qKaEGSAc10/QcmOqBxkthY1bYHdOc5vv\ngdRf\r\n=iPc5\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"dc6dc4efb9210fc9c70fb089edb90278a8ab66f8","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"10.0.0-canary.e383944e9.0","@material/rtl":"10.0.0-canary.e383944e9.0","@material/base":"10.0.0-canary.e383944e9.0","@material/theme":"10.0.0-canary.e383944e9.0","@material/ripple":"10.0.0-canary.e383944e9.0","@material/animation":"10.0.0-canary.e383944e9.0","@material/elevation":"10.0.0-canary.e383944e9.0","@material/typography":"10.0.0-canary.e383944e9.0","@material/feature-targeting":"10.0.0-canary.e383944e9.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_10.0.0-canary.e383944e9.0_1611625517924_0.9793554615784992","host":"s3://npm-registry-packages"}},"10.0.0-canary.623af861e.0":{"name":"@material/slider","version":"10.0.0-canary.623af861e.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@10.0.0-canary.623af861e.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"f1e96bc68e6f2b50d5b7419d5417bd2a3b0721ec","tarball":"https://registry.npmjs.org/@material/slider/-/slider-10.0.0-canary.623af861e.0.tgz","fileCount":38,"integrity":"sha512-25CDiF3bYDajzccrZeZ1g7QV9ICFEn7nH+1tAsNFtp/5X3Ddigq8PJrltXWa6kdSFtGcih7o6o4N7Qb5uv4RPQ==","signatures":[{"sig":"MEUCIQDAOaDIQVqXXRcqnFaNOxfPzBDf/5OpI4gJXX7uUXHQtAIgVpPQEIiEv6BGnAHgTKBxxxcz829hyLcjU9AMqk/rjqg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":783026,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgD5BgCRA9TVsSAnZWagAAlXwP/RQ2gMMUeRRMqztKmNqI\nyjKvC8AthbEYSPekBRRpTTolj7VAOE7jBQ4a6+RnloTXid0nY8JKI9QXdjVz\naiQ82M1GZtToVdO9tWLnJ8oHceV/ROCGikG7H1BegAnoPWmm6eyeh+pUTfoX\nQggBvvntAnqSmXv9mwJF+n0DrbCvxnHmyI2f09fpx79JD6UzUbRGNekC+g1M\n7BfKorha6hjGgY284YC/b+7B05QuoxWO7KcKYCf/zTzdNVdo9/SwaDwvAZMV\n1RSc+fbpP0aBXoeaodlds+pRkl+TUlDGY704GtqfnkrZNaA8QFZKaRC2bCAB\nS27zK82w16utPBht24EJte/PuyD153uCmPTf8BH9ZXeIzA5qSHKODiC6H6Ex\nZzHEljFEScJAceI9k7ppgBDg1VL8NnwqYUSdnmQ4hfbhkVtaazsGeK5jQV56\nQbtvrQLEUU8BDuppNj8reAmyHXzotfjH2hAlitxS6RLJ2JB2wGe2N61c1moj\ngnxgpenMiAt2gwDqJDdewGl5Lqema/Xvg9Ig6fHKcTKUfwIv80B56dw7IB8P\nLynbZzpONOPCxVOM3kD6bT3DKaPdbCmSl/UTX+QOKUn5KaDS7r6dEX+qh/zn\n8pyS6IueV8tZ29GGnwovVFSeC7T1zj0S72mP3uhZOfIRcY7DZSKvsBqMjjwP\nF9rD\r\n=up6e\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"5906815761339487fac225651c29aa422211a72b","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"10.0.0-canary.623af861e.0","@material/rtl":"10.0.0-canary.623af861e.0","@material/base":"10.0.0-canary.623af861e.0","@material/theme":"10.0.0-canary.623af861e.0","@material/ripple":"10.0.0-canary.623af861e.0","@material/animation":"10.0.0-canary.623af861e.0","@material/elevation":"10.0.0-canary.623af861e.0","@material/typography":"10.0.0-canary.623af861e.0","@material/feature-targeting":"10.0.0-canary.623af861e.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_10.0.0-canary.623af861e.0_1611632736156_0.9320552535866926","host":"s3://npm-registry-packages"}},"10.0.0-canary.6863fd43a.0":{"name":"@material/slider","version":"10.0.0-canary.6863fd43a.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@10.0.0-canary.6863fd43a.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"b27f6f9001c4481e653dd5c341fcc80fcc2f25c0","tarball":"https://registry.npmjs.org/@material/slider/-/slider-10.0.0-canary.6863fd43a.0.tgz","fileCount":38,"integrity":"sha512-79eoCeTNlVOSUwQqs8CiZyqtphM54V7wP8Vr3ZiSh11JGBKFxIAZZeS7Wn8OLW9Lyvn7kCxNOw7FPtprjiUDQQ==","signatures":[{"sig":"MEUCIQDqCq9zLqDmbjeAE8CdURy1oASyUTEL1G0xT6XqBB1OtgIgHYxKufEybjCnjAU6wb7tVfex/b8xL1NvQ5GedkctquE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":783026,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgEIqxCRA9TVsSAnZWagAAi4sQAKQEOuQ5/vETUnUxZTE7\nTZldJ5aoYnCvO0qetfFK16PMEdDh20oAz4dtaC6lNWF8KsUnwESjyCt4ezWW\nHhkdpwm41eXKy+oUvDMPPMLApAMpR0JwilhUoSPGhUfz6/44Xf3fWSUzVD7c\n7kWJRjzfhszNqi2qKHbK4DlL4Nkn8bATQUZlG7kPWWgd5gm/9YWoH2xQj8A/\namPzuMrUW9L/ysmese8FCKcC2ECIai1GLgvOdl/DinhbC00HZnre//kNZmvS\npfZ6jwb9BO915eIp4jFwm1A/lE0zW4LK5URTAN+Fh9/foWfy0TiKQuoJNYI/\nej4KPGfLy0/XBKz3dCfWY9ReOAvsb/01ipmuOwRY8kUBMOU4541nTrYbRnNF\nxBwSmSywLrlFrXBjmu8Zni+Gx8BILZ+I20aPPSKiCMUCBO0BPgnRLackrz0/\nvFp+jidmPKwltDzz5Ex+0Qy7l3Mpyo3dDaafoQSuMm9BYI+yFO8IqCclwCfB\nxnO4hv4ePnE7RTONv5kzuAwbODjCyIR1qqmRDljPegznv/LAlHEVVuti+Zya\noqRjjIIEMGM9shZHPJOhAagT/5DzqV7dOuWojzluZcMuACUWMxU8J0Ek4U9G\nKLq7PJgbhDp2TgHfDMcGgJIXgOWkok2pGgG9Ru3Tkn4U8NRmVcHHI1+VVhNF\nOhZZ\r\n=ofzP\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"49d0dacd3a675991bd5b8c454304b1f10dbcfda4","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"10.0.0-canary.6863fd43a.0","@material/rtl":"10.0.0-canary.6863fd43a.0","@material/base":"10.0.0-canary.6863fd43a.0","@material/theme":"10.0.0-canary.6863fd43a.0","@material/ripple":"10.0.0-canary.6863fd43a.0","@material/animation":"10.0.0-canary.6863fd43a.0","@material/elevation":"10.0.0-canary.6863fd43a.0","@material/typography":"10.0.0-canary.6863fd43a.0","@material/feature-targeting":"10.0.0-canary.6863fd43a.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_10.0.0-canary.6863fd43a.0_1611696816956_0.15761221378683055","host":"s3://npm-registry-packages"}},"10.0.0-canary.ea55b87ca.0":{"name":"@material/slider","version":"10.0.0-canary.ea55b87ca.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@10.0.0-canary.ea55b87ca.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"57828ba99309f51c222108e23d490286d43b0d9f","tarball":"https://registry.npmjs.org/@material/slider/-/slider-10.0.0-canary.ea55b87ca.0.tgz","fileCount":38,"integrity":"sha512-mNQQq75b06KEbiN4ZuoOhQLGNBQAzxtswWJgoU8zH2oMSEh8JaNYELLQos2rcn8MSX9mzt0+fAPKkqpoXEV1OA==","signatures":[{"sig":"MEYCIQD9lLAYy4/GuJnA5a16ay0dYtDVr1yzI7HAg3koaRwe/AIhAOEKjjL6RWVEw7lKl0k+oT4+RNwoVfqlFzW+Jwj1KEwE","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":783026,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgEKnVCRA9TVsSAnZWagAAPrMQAIs0+irCBSflDpcZgw/Z\nt76gIFQNKqauMvanHRsqYOodAGhKZCoY8NWfoaWYwV3r8UgRL+6bkFTVNbZN\nNPVoBLsEaDiPLP3Rw37WnODK03tOhejO3V3yRuliVinGILt/3ojGjIRZu6JR\nmGCmx0uxHqVsWvC7fW6ZI3TmWSzkMuSYADaFnLmmacqL2r8D5G2yYVsKuD4D\n4Uz1LFUsG7hfs8jKJDHzCvLSmj3k9RBj2MGPahgSfBLH5yuU4l2f/ftU7QFE\nvial8V2a6SjjdKluuvhRg2nI8YHFHMUDy65krIAYDsua637W9ZqIRw8D0AMt\noEmY2CWh5OqwSHlwaQElgVAHNKv1/qyujvslDubbvxPNiGIxfhbO5rXLRwUR\nswMPdCy5S3CkIYYnERmEnNQY4xMjZAWs7E+WOb3iVtzRfQ+8TGGqxtY3SpZv\nqx9HdjSOD53JrUpjfh4muFWi3DcP/MJdlLTwBIZ3DVCKXEPQuPaLxVihgFrQ\n4nBvgG6Uul0TvViTM9E9R3myEkkW1pi4aIBW5S+DqnMiEykNXmUym1TsNxaO\npkbXWJUfDbQoS+u+nqWerbWrjPlFYvQpSnTcaWfd1QpvaO+mCL92ZdFCfMbT\ntRY85llAvS/VDO39RLe5EocpZNxQIdkyF4DqXvu43iMtStbiRuIH79P0RSQb\nXiRg\r\n=1/jY\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"00e7569feb0aac4c4dbbfb9b292c9f53adb608bd","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"10.0.0-canary.ea55b87ca.0","@material/rtl":"10.0.0-canary.ea55b87ca.0","@material/base":"10.0.0-canary.ea55b87ca.0","@material/theme":"10.0.0-canary.ea55b87ca.0","@material/ripple":"10.0.0-canary.ea55b87ca.0","@material/animation":"10.0.0-canary.ea55b87ca.0","@material/elevation":"10.0.0-canary.ea55b87ca.0","@material/typography":"10.0.0-canary.ea55b87ca.0","@material/feature-targeting":"10.0.0-canary.ea55b87ca.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_10.0.0-canary.ea55b87ca.0_1611704789209_0.004248530634060055","host":"s3://npm-registry-packages"}},"10.0.0-canary.e902ff05f.0":{"name":"@material/slider","version":"10.0.0-canary.e902ff05f.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@10.0.0-canary.e902ff05f.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"3c34cbb102b0a331a0930be813d2367e1b486454","tarball":"https://registry.npmjs.org/@material/slider/-/slider-10.0.0-canary.e902ff05f.0.tgz","fileCount":38,"integrity":"sha512-VxtjF9s2+jcWJNFeboYMbgy9if11MNQSXRLBstWDIKes7LprYxL3kLBFwdnbp9iEOvALGhevXitCGL/6xQcxLQ==","signatures":[{"sig":"MEUCIA9+BDdTbIy7iZNx/7aqKnlsUtK9q/laXVRLySBSUeTYAiEA+tJjpsGCctXsZfh5wS+jYHq3ZrvTj1GsKT+x+G/vt5o=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":783026,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgEK4JCRA9TVsSAnZWagAA7gAP/2GBsmmC+Yj80HNeDBPN\ni2diM4bmdAzCRJ1lvA6epWkBxjCz4app1CMkNKrm98pYMhwdxSZLVdUwfrRy\n3ECEPgUXs+v8dAbCBe5cVWVPeYqbIGGjUI23UxizD+55TWqnZneja5dn8TN6\n+h+Mi5cInwlFbOiTZ4EZxCWqhmJD7gaiFlmPNZjsuz/MAFRvhM79BsCrpslC\nfgOsMJgcLrhexVosn2/vaH0XHQq5fd5ThWjirTrMcDTcKJDhdxv0UWznsRB1\nnDV+i/psRTwjcb9NsWwlQ39Xs7iNDqCiyGQcGeGH2gGcq2DUN3T5pPGRT7LJ\n/nQtbKDx+K7dPSxt0o8Yl3BghVJPTVgbW9HMtrlB3MwH2N/VAGT9NVvvPJa2\nkv1ZJ6NEH/wDuW7HYkT9OWEAWD3FEGHALCmigKWgiLJFame0CCsPTeqQrPq8\nkLIjxew/8Abxma/bpc7aoJ75Mitu1f+zL1f8LwAFI1PsRi3x02e13ox3qH/Y\n801Mm+7ohKQtM70Mm7uNuwxjrQvQ2wT+DRUJ6diKhzOM59JylEViI3xSUq1T\nRsxTp+7N/80QPCWx+xp8i5BTbYc1fO9/PIx9N2ogj52ked0OzPF97U5hMDaB\n7hmEK5StgU9kEvd+QcF006QSCYhI8qXGuWCa2mL7yp5+fDvSkFyk1I14eRX7\n9hmE\r\n=Lr/T\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"8ae6ee07772b70becfa69208ee5a4849f86c2fea","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"10.0.0-canary.e902ff05f.0","@material/rtl":"10.0.0-canary.e902ff05f.0","@material/base":"10.0.0-canary.e902ff05f.0","@material/theme":"10.0.0-canary.e902ff05f.0","@material/ripple":"10.0.0-canary.e902ff05f.0","@material/animation":"10.0.0-canary.e902ff05f.0","@material/elevation":"10.0.0-canary.e902ff05f.0","@material/typography":"10.0.0-canary.e902ff05f.0","@material/feature-targeting":"10.0.0-canary.e902ff05f.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_10.0.0-canary.e902ff05f.0_1611705864485_0.8183244605640188","host":"s3://npm-registry-packages"}},"10.0.0-canary.2c9fc538a.0":{"name":"@material/slider","version":"10.0.0-canary.2c9fc538a.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@10.0.0-canary.2c9fc538a.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"a0d3025b5f0f0ca5121aadfd84e632a3de7b59dc","tarball":"https://registry.npmjs.org/@material/slider/-/slider-10.0.0-canary.2c9fc538a.0.tgz","fileCount":38,"integrity":"sha512-aoH1c8In7ojEH2wPw1VZsvCeKxpS55VRNtUHjvyMJdTeQ0lQMxVA0K15J5NK8GV7ZL2rAzSf0DxGNYn0ScNUvg==","signatures":[{"sig":"MEQCIC8m2O42H3pbSrZevF6Iaxsc4D5nm3XW0PLiElpSqwo1AiAYn5Bdf/WsaQCjXvx2frxDYtP7CxzlIbPZHMUX6+qKFQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":783026,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgELN3CRA9TVsSAnZWagAAkekP/3s6hbZ87G0nr6XevlVn\n8LJLid7MGkYQycAFN2QJ+53mBbuoU/nkSj7kgF0yUW0qv+sJKGYen0iu8Cmb\nbtJdK1hNIS7u6sEyHE5xJcOUXSH91LwZ1PMPr/VanOXbhji/Mb15+2tlJb2t\nhMzH7ObLVxXCdk4HLGVnX+u7IQN5/Roq1oQlTMCco1i7jKZxHDMo1iStGa3e\nZemOcD/irhmnDGFclOEItFeDLnpGqF0ar1yjUhneLUbJAF3NrF8ixx9B5Z4o\nlNjOi7spIIUHh26wQDW0+c4Uve4qv0doup/Eav3ITPuP8HyvNU23d0yXvxbl\nl/9mQWznmuTcp+If1xAGsfAeoq9hDmKH83o7jNdvPsDJ8DWtEK1wPNcRnH9Y\nW3Rpw4gvvSDuEK6GsjZtoLzcJx364mOtyJXg21YzuwITMVMn28Q7hvau0DgD\nYOPoqFnUuhWlsfndBspU303MhWf/oYK8hKGu3/ZIJGc+NC2LfUcuKfZaiwSe\nU9gd/LVRFOAGvUGb1DZyfXSddGJylkkvWSDwqecjQOvsG8rmmSUS5oyk3II0\n1M+Z1+LcdR+qIBu3qZwTVaMjHp6z6CvwCg/YiiSDBG0uSEcsdmX/6uJGzxpN\nCDt3gVlzikoAgvm2dxHdHz+rsaUvYV2R6q03o9HRKLDuJmobEJ+hTauWUxoj\nVBo3\r\n=ljBe\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"4bc5fff9ddee1f7703010e418626d050ca883474","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"10.0.0-canary.2c9fc538a.0","@material/rtl":"10.0.0-canary.2c9fc538a.0","@material/base":"10.0.0-canary.2c9fc538a.0","@material/theme":"10.0.0-canary.2c9fc538a.0","@material/ripple":"10.0.0-canary.2c9fc538a.0","@material/animation":"10.0.0-canary.2c9fc538a.0","@material/elevation":"10.0.0-canary.2c9fc538a.0","@material/typography":"10.0.0-canary.2c9fc538a.0","@material/feature-targeting":"10.0.0-canary.2c9fc538a.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_10.0.0-canary.2c9fc538a.0_1611707255029_0.012868481781915131","host":"s3://npm-registry-packages"}},"10.0.0-canary.6bf56aaa4.0":{"name":"@material/slider","version":"10.0.0-canary.6bf56aaa4.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@10.0.0-canary.6bf56aaa4.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"0c29fd4f40b68dcd0495384179b8e09144e50814","tarball":"https://registry.npmjs.org/@material/slider/-/slider-10.0.0-canary.6bf56aaa4.0.tgz","fileCount":38,"integrity":"sha512-7LFXRrcjWo/E+lxNNSNJ0Wp6zPm/UGaVJxjAhNVOVCp/vmSGX7Tg/JkJw1RLDDLlW0UYK6QUPWbXc6gVmg7T+w==","signatures":[{"sig":"MEUCIQChz6eMX/lrDElXI3wuvzEzrMufCnS0pTMxZ34k4926lgIgGHRFQLC78EkM7eYG1MWE84AKXe3nOPNjyYFouS/E6Uo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":783026,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgEL/hCRA9TVsSAnZWagAAY7cP/3MUcPs0zTewIr7xYDCt\nR9eq3pzsj1Y0rxxTg4/lLavQCkda+vELmzjX8aXKk/cseym/O/9wdHboXpmP\nNc7k5OvtkgTnz5pY+hMXhEmZM0cV/UjpXmbAxtP15y+F7CLi3czOIuoLjIgi\nooWb7gGXqJ0jpCkTFhP/l3OvH8pO+HCkojodzyAmLNwn3wk0G1pWXVQU1Xkw\nZ8jefSsE5Mqzvo+F6S9DcTdJ2dMUL3Jy3qoA8kdZ61ERPRjbgA3s6j7Ukxzn\nlsO/VNkJ4ZuPwephgzmvp9wi01MPtWKmbTMYcjQKXQ1CN243evy6fwFcIEs6\n1LE5CBN+XI6fo0CsFrydVKkXZUOq+MFuXKcLuSYnrsdklb2XqN5+td7ma9hb\nVUg9Y7lW1biNZ9MQKBfB3uDyB/mZMG2PQtuz3g1UsTYBzPOP3ltoff+rbs1g\nAomXk0HvR7ql7NUvbRXDlzMtW8GmP8CGvP+ELaw6MssLmSABJS9JE56Hnr/3\np1BLBgCNTldS3xBkXG9xuX12fCIcRAEDZGhiMub/bXm+sIXuYsqVeuv76bjd\nDc21qdxfTWybUm/aB+54es4xFPKDRHlftoTKMYAd3Fe7zvqgXYJmVc+ZSzZU\n1tcV37iLAZRq4lo9JaojoC49bwSd5BbfNyJnPjdjDuyc1nWTe29fViKk11Ag\n21nY\r\n=zrx1\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"557b9cd09fc15e60ea09bd17651230487a292b59","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"10.0.0-canary.6bf56aaa4.0","@material/rtl":"10.0.0-canary.6bf56aaa4.0","@material/base":"10.0.0-canary.6bf56aaa4.0","@material/theme":"10.0.0-canary.6bf56aaa4.0","@material/ripple":"10.0.0-canary.6bf56aaa4.0","@material/animation":"10.0.0-canary.6bf56aaa4.0","@material/elevation":"10.0.0-canary.6bf56aaa4.0","@material/typography":"10.0.0-canary.6bf56aaa4.0","@material/feature-targeting":"10.0.0-canary.6bf56aaa4.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_10.0.0-canary.6bf56aaa4.0_1611710432774_0.5003516740555152","host":"s3://npm-registry-packages"}},"10.0.0-canary.994873795.0":{"name":"@material/slider","version":"10.0.0-canary.994873795.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@10.0.0-canary.994873795.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"f2530b138b7625339dc394d7ea83b2fbe72ccff9","tarball":"https://registry.npmjs.org/@material/slider/-/slider-10.0.0-canary.994873795.0.tgz","fileCount":38,"integrity":"sha512-6xZmAP3Buc1Skjj11ILw0QYkXsVtWFU4ZQF84Qpl9sWgEQ3YRyZpT/XbM2adeCH2CBrn/XK8U9T9XUmx8JrrsA==","signatures":[{"sig":"MEYCIQDqpKkhGOV7tgzAaspXBQESBNzCsV5Hu0SV9BwqA5hDWQIhAM4RUNWE/ZVJPX1WsaQO6m74/RwMS6KYGGWNJ9BeWcYx","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":783026,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgEX3vCRA9TVsSAnZWagAAA+wP/A6d0cje1cxrFOxBTc44\np+rxmoZjRrSfaYn2CiiiVd66HYqrEw074n+aLUN/Td/WZH5XfYo58tFwfXiU\nygX6wpJNltyb8C5ad/jCNu8GtjmVlnl2HuguoU1sHb2lQqjW+XEd6y2i8QjV\n1Y171BrvrnfpszSnbJo/KjLGJD8hXkMIhoMghv91GnBzVHEU6nWQWWCjsM92\nbRlNP0vt9Uohw+uKawTK+7IVYyMUgi1yKQ6D/mDQFGrtZkdVs+j4d82fJRJs\nnqcrGm3X+ZxEjObY30Fkz95YDE36Hq6kPdmK6snbyAsQBZB2Ku4OHas03fbr\nK7J2J9CMN0X758rLOTgeYxgS95x+TWxzBbKyXS1YY/H3pnSbnC0QgusxoXXB\nkySMxKq8i4YifJ6TlZMOlbSueJCRQ0xDfQMwfAfwtsPJR/S0g6rutMtddFS9\nTLeo7WnSQtr54pKrmT3KwqxG6EyWzdbvkhDGi31xl8BAb/Ybs8atWBFsothO\nDrgyUKmG0amcGQuOyAuH8frsaoGvBktq0ylZn64f01D1e76rlRAwz3xeBdTr\nPvQoQv2RX6Ay/5FC+KC3ePucqmFNd3Dun0EYffsO+1SopNsAzNxBZCIExJ1Y\nR6+PLMA3zzyLzdxxR221LuhRyIhwx1tny/1VPZ7n5jj7wncbvWdYFkESkViD\nJcFP\r\n=WcRT\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"8d1337af6a27bed9f06167ca1cc1c996fffdd9a8","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"10.0.0-canary.994873795.0","@material/rtl":"10.0.0-canary.994873795.0","@material/base":"10.0.0-canary.994873795.0","@material/theme":"10.0.0-canary.994873795.0","@material/ripple":"10.0.0-canary.994873795.0","@material/animation":"10.0.0-canary.994873795.0","@material/elevation":"10.0.0-canary.994873795.0","@material/typography":"10.0.0-canary.994873795.0","@material/feature-targeting":"10.0.0-canary.994873795.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_10.0.0-canary.994873795.0_1611759087240_0.49647788883381616","host":"s3://npm-registry-packages"}},"10.0.0-canary.96878e1d0.0":{"name":"@material/slider","version":"10.0.0-canary.96878e1d0.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@10.0.0-canary.96878e1d0.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"df6cb8dcc6ff4ba057c7edbc2aaf615b3ac4c1cd","tarball":"https://registry.npmjs.org/@material/slider/-/slider-10.0.0-canary.96878e1d0.0.tgz","fileCount":38,"integrity":"sha512-BRp3mWN4ve3veEt2q56Bln18JcbBd8uh7MszlczVOIESb8IGWxpzRnAY0j1iJtzUFBYv8TrSjjTqusPQIrWWpA==","signatures":[{"sig":"MEQCIHoRQASk+F3vQyli1xUhvz7XNt8g0O6lsoHzP8EJIl3aAiA7XYYwL5xypbeuWPjQvu7Utg1JU0RbdD7Qyu+gwvIoxQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":783026,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgEarBCRA9TVsSAnZWagAAEDYQAILEFl9ZDF27h6uKqrT9\n0/TMHBN/QP+iQvihFi1iwrAg4l5uRdrFATkI3meYWeCrUvBAj4NXJuzgLYcn\nNEWG8PqbpOM6ij3KRmbjjmSQOE21v+G1nKvnHVrMk6ldQZzr1SjmHbd7BkRn\nLxmDnHxBhPj1GRRNib6NBN3FI5r3nOyus2wNDuImaJvGp5WRvJFeiwJqef5g\nflJ77IsCYJCZ1JhEzrjFA11b6ZxpemKbK4S3FoCeCRnRaJ5lN9xhqc1hygDd\nC1NOkh3j/BQ1gUPjojRiUcR8v2pD541dTM4gfb5QojWvrrMWJtqIfICcYsr6\nPQWuE8ooXtIRjo4l0LsaQqC0jqt3OhjeoFGERbdelXVrvAQCxM+SbtsuPIR2\nn0Qbn7XppZvCUrvuC45qH2xWTUT55PhNEO3ZgQ43+MkLGi9LDRQ43xm9qm9v\nWx//bOfm9vbvuBdAadnxK1sH9U1arpd7Z3sqKq7vDBkLxavLd1o2+UWNNs+I\nrzf0WlCidBWgbIL6aJ0PYOLNfoh5x9sa+l50H5/vDJIFyIo6wMGBMSPKuw3n\nfxw+olDMK0zBnsy9i+r32Ek1wQdi0N57wN6Zu+JCF+rOezTIxK+ZjvmQySBn\nx3lb2UiSpfqco9r3SsCHEshKa+WhHaCx4HphQOZyVBsxK7wV4IwBUFTCVQqc\nEFTz\r\n=exTj\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"cc9f62002fbbf03874065eac25971ed2b49a47ae","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"10.0.0-canary.96878e1d0.0","@material/rtl":"10.0.0-canary.96878e1d0.0","@material/base":"10.0.0-canary.96878e1d0.0","@material/theme":"10.0.0-canary.96878e1d0.0","@material/ripple":"10.0.0-canary.96878e1d0.0","@material/animation":"10.0.0-canary.96878e1d0.0","@material/elevation":"10.0.0-canary.96878e1d0.0","@material/typography":"10.0.0-canary.96878e1d0.0","@material/feature-targeting":"10.0.0-canary.96878e1d0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_10.0.0-canary.96878e1d0.0_1611770561199_0.7373785771095982","host":"s3://npm-registry-packages"}},"10.0.0-canary.3c117cdcc.0":{"name":"@material/slider","version":"10.0.0-canary.3c117cdcc.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@10.0.0-canary.3c117cdcc.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"eb8d46e9ae0be9e1a380ba50aa1caf3a3afb969c","tarball":"https://registry.npmjs.org/@material/slider/-/slider-10.0.0-canary.3c117cdcc.0.tgz","fileCount":38,"integrity":"sha512-L3bMmlE9i2YHjyPtBcHvysMFEl4LoxJ/vCGPnS99r+2qVCQyJsB2DF/UDR7It3T/9LJI2RB4CUnXx78OiBW1IA==","signatures":[{"sig":"MEQCIDOZZvpdwLHN838FOJxF+zRolv1RF/ZrlomqVtnF365bAiALpeKf+25q8EBkEEh3xUKEONQp9oOfVQZX0kd8RUJaag==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":783026,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgEbHPCRA9TVsSAnZWagAAzdgP/RCRswq6lKGM50/5kbzH\nNtN6Bbf8PAbw9wipTwFPpjmfAh4jTwbiCSrApDRj0jHuBxlu6wn6uTYGoxjN\ndAlZKTRCG0RCy0l/UpscEvgJTVEtn6WuPqvggai1YoQIK1+yuFAJ0xNG05rZ\nVFqpriOENfMzp32R9o235iV3DhD96OoHAFRYAM4q3ittwMnmMUsxS0sKmJys\njMxFi1ckEMmq5xz2BNtzWsn+GHizigeWLb7Tpzr3M6jdC8qLn6Vx1zG41pxe\n8NChRMkk8dRD7eAi2nNDnfuRCEjdX6QdhICndhthYCDV2jVOVilxItY8PEww\nEdCIE/+dEJOyqjljVAHF+Ig5brSxzY+TcdIDTVRSfdgVruIwaXmcZ33MaB6q\nDCFdWrxaWUzla1mNR+pfiVjgT1fWAebGYcgmqa24q8CMaD2ArF/JpDpi5Wwp\nVqhxdT8lMyC+p1FHVKSBqozH+cIdfFTC9Lpa/0SnmXUlIhaRXNUdW+mxVbUL\n8cWBtYmuSYPDCFaryb8gvhTfC4b2rlIpUUG9BUoDZTAdtI4gmfH8xvRVIS0s\n+RFSEBQw6eRKini46c6W86qi539233eyp8e/ect3HCU8hFMT/fdWxa83T3aU\nWRnQUUHnVh+9Ns3KIvKr06sBly8luY0/eAjJWJgdz/yMMXwURFCPBPzmtEQ8\nS0nC\r\n=hzO5\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"dfd1ede4a4727199e63765d305bb36d91509dde8","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"10.0.0-canary.3c117cdcc.0","@material/rtl":"10.0.0-canary.3c117cdcc.0","@material/base":"10.0.0-canary.3c117cdcc.0","@material/theme":"10.0.0-canary.3c117cdcc.0","@material/ripple":"10.0.0-canary.3c117cdcc.0","@material/animation":"10.0.0-canary.3c117cdcc.0","@material/elevation":"10.0.0-canary.3c117cdcc.0","@material/typography":"10.0.0-canary.3c117cdcc.0","@material/feature-targeting":"10.0.0-canary.3c117cdcc.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_10.0.0-canary.3c117cdcc.0_1611772366758_0.7145033110981458","host":"s3://npm-registry-packages"}},"10.0.0-canary.b411e7033.0":{"name":"@material/slider","version":"10.0.0-canary.b411e7033.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@10.0.0-canary.b411e7033.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"de15ef9d45f3d350d3a607f32a245c80bd54e111","tarball":"https://registry.npmjs.org/@material/slider/-/slider-10.0.0-canary.b411e7033.0.tgz","fileCount":38,"integrity":"sha512-aCAPDoY7BGV722FUzEh65/ege59LVljKx9UrBw4bLdjqOLvyH/JlvoAXL96hf2TRIQ5BYUQcCmzXIZfWog4JlA==","signatures":[{"sig":"MEYCIQDPTdWOM6sQiEiCF1TgmeGW+6WPM1nLK1GPHvHazxvL1QIhAMId2rI59qywEJyLphYkeQa3wZySsgWVAFjuozDBh0Fe","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":783026,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgEeNQCRA9TVsSAnZWagAAMiAQAIwunRCJ3tdVPGSzkEWm\nwWANwpZiDyKDFwDXlo/eGfZLgAAwfC6fXICAWsEXilr0pAn+X19ROG52cSTr\nGD4LZ2POIrmuY/+MFCSAqfbU7eht+CFbVzjNx3Ipn6rRIS5T2G4k9dA7F0/z\nT0L+ZKT1uyAGQSLQigi03bZ6xB8EFyFYNyHcRWTPGi40EPFX+K1j8NteaGfL\nYG2Vv98HPfcQJNpdtDIgeveSR/EO2sc1LmSOEu7TZSfHrBUQZeE0ynnktTjS\nVmQhTdC9selOBZYCaxdXBXHL1DHg/1gru2m4Vlp1Wf3c0GaREn0J3h5KfBLr\n/GHedb18pPEuwkYshtqu+672k/mhoCiMLyI08QWYdMuLc+sZZ6s8AnbXrUGW\nHMvYp/dNI5u55eRqdWzeJDy7b9fEUJWCh1KwsA2WMb2CwB6F9+DAtis/fKFi\ntvGP3L6OmGxanXqzhLWZqQVpwgcbWdn645DU+NBHt+UKtgeyfDEsVeN6m0Zm\n/AUjUrXOHeEVWliBmWZpfwuO+bCthRc8l0d9ZvPmhZSYdoALGRHFzA7Y2AET\nRELjyS35VAbIul+j1/bn5aSIlEHNiOjb2jjp8mTKL58NvccOWOj/335cRiEa\nKVeJfEdbgVC+3yZJgLCOz9kil4WuWq+KNj1VqdeOaZdCdrYckT1CwxlB02GX\n9ZLd\r\n=uRiM\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"1d12550a6229cb648f6739f83d7ba5feeaa67dac","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"10.0.0-canary.b411e7033.0","@material/rtl":"10.0.0-canary.b411e7033.0","@material/base":"10.0.0-canary.b411e7033.0","@material/theme":"10.0.0-canary.b411e7033.0","@material/ripple":"10.0.0-canary.b411e7033.0","@material/animation":"10.0.0-canary.b411e7033.0","@material/elevation":"10.0.0-canary.b411e7033.0","@material/typography":"10.0.0-canary.b411e7033.0","@material/feature-targeting":"10.0.0-canary.b411e7033.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_10.0.0-canary.b411e7033.0_1611785039900_0.01327465049981913","host":"s3://npm-registry-packages"}},"10.0.0-canary.a9ac16b4a.0":{"name":"@material/slider","version":"10.0.0-canary.a9ac16b4a.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@10.0.0-canary.a9ac16b4a.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"3d2b58114da09f43b068902d465c98fce8496b69","tarball":"https://registry.npmjs.org/@material/slider/-/slider-10.0.0-canary.a9ac16b4a.0.tgz","fileCount":38,"integrity":"sha512-8SPpzcDBoxVi5fp9Yxssyzx28kgkPpOef3An6C2vQqV4eoHu61TFVrw6v/pEMqe52e7noLoaZYESTS9doHmH/A==","signatures":[{"sig":"MEQCIFTkPALyLSWk21OzhXhM5ZW7AxdDfuHTWYTvp19BWiZIAiBdvsMvXrWs4Zt0IZjZeYfVDZup3ts1OPTUuiX3a/jIzw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":783026,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgEfFcCRA9TVsSAnZWagAAnewP/jsZQ6J4LnJT6ASYhi09\nTT4AyrlrTERorThm0YIWgMPaSe81qLs0HMW53dYylqd+zvzObXseSlYM1BzD\nAzP2CdLVDYUFjZj1r07L88KWbWu7rJD7MrOWUdLW9qgYYUJ6k0m9TuRSIwbx\nwNvZbqjcz0jau8ch7d2Fhi8o9TG2eujtsEHXY607dzSyEb10FoBaM1tofLIh\njNJ3B0J//YQGSSt2p3JKvnJsiOa6rlvSPA4LrcbuF+v+rMWrV5FnTevh4jCd\n15y6FHifB9CobyisdOIbR1jM0CA3ya4fRUTwKMCY6YDzpIRfS3CWAdBMJ0Qh\nRlnSLnS8s83HfaNBF0A3McmlijfQRYl8YOvtNMhM68lvE/lMumSlVG1Z40da\nmyvycfcFbzCoqB20Q4Au5jHoRqN/98ikIjxZdxNZ7xlzTRs1ylpNl8KLHkP3\nmFfPXzvh8HorbFk34nCcR8k4baThxuNxZkcYUgGQ+sr5qdy9GU+eBuAarLWO\nCeES7ueVyg9BOgeH08BWxCyPn98RsV8VGZtQy1jzsm3hul7n4WiGOyzRxNRK\nVN/gb9yspZr5E1wlTzHcvWzs9YtkOcL2nO1yTPDSZ+gTcvoH8lulBj8yD5e9\ngWz55kmedSzQGiTIPdeUtDi391Fkc+fxL08NwSocVZikKxyTT1D4+dJnY/Wy\nkUXe\r\n=9kI7\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"1635bad405a8d329ac4e844d0a2b5f3bac553113","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"10.0.0-canary.a9ac16b4a.0","@material/rtl":"10.0.0-canary.a9ac16b4a.0","@material/base":"10.0.0-canary.a9ac16b4a.0","@material/theme":"10.0.0-canary.a9ac16b4a.0","@material/ripple":"10.0.0-canary.a9ac16b4a.0","@material/animation":"10.0.0-canary.a9ac16b4a.0","@material/elevation":"10.0.0-canary.a9ac16b4a.0","@material/typography":"10.0.0-canary.a9ac16b4a.0","@material/feature-targeting":"10.0.0-canary.a9ac16b4a.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_10.0.0-canary.a9ac16b4a.0_1611788636323_0.15129760759306166","host":"s3://npm-registry-packages"}},"10.0.0-canary.fec7b42ca.0":{"name":"@material/slider","version":"10.0.0-canary.fec7b42ca.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@10.0.0-canary.fec7b42ca.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"726ebc1b3408c9d3fb98f50f0c30485ad94228e4","tarball":"https://registry.npmjs.org/@material/slider/-/slider-10.0.0-canary.fec7b42ca.0.tgz","fileCount":38,"integrity":"sha512-EUU8/Z2Hmp/UIQqHyL3pUiWdLGAfpN+mKK6pfAu7bqQM3bWmL/ptpT88cbQgHALFfpRXDezQLLLEmgv8yOK/nA==","signatures":[{"sig":"MEYCIQDGmqlInoKvcUScXOZhLiS3ZzKXF3xenxzf9sOICEM3gQIhAIfNEzlH2HPJpLFUiSMJm9vcAVgxOhRDwquGP2sqssSx","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":783026,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgEw01CRA9TVsSAnZWagAAQ1IP/3X6bGtkBP7kXRkslcoc\n05g6mnPbUL1XlhsFAqtMJiYD5hwlLLFKI0zoXLEIf23cZolaGlezJPwWPFAk\n05vTGms4YgSK62jvKQLMh7p8hES7np7u4ABYD3aVlx2K51w1JgAyptij21nD\neudkGFy/M2ohSIitki6DRvnQaFr5Zi/jAvv57HfMCK9WN7liMYNEbpovr2dR\nvAwTgpwfBo4ZfvCSthLOX/O5c/aoCKSdMXYAP0m2V7WZHn1xZ9A7BzdOjG/G\nM3E8raKThBfQ1pEVNK5XqbpXfNftULPtqp4HKQUeooTtg5dJtSKx31pDb0Mi\nPI6sd2QlaZOQ+yxTSCQ2NdnJD6u7wHI/gXt3mJnl7kMdvjgn2hkFNivF4kVq\nXhJ9Hzh8SkXHQGXotXN37zgeWyDdr05WQt/JVibGuOtPnGx/Pqcx3ekZnqij\nruJSOi8A4zHbk95Naae+6DL3JnnZkl0JuuWj+lKocADrvM0gQqCsO2sigYgR\nCkjj4taKHCtrDtBG2VMuSWYOc5YhFFHoJMJ2TxSgt//S/E2OqsMGyndo+w3C\nUOglajNsADRygDiOcPZZElp4U7xoETdUAGH10+00MLUh58YOvLnKq0zdnvnE\nBfV7K4gzI0jg6EfHIqfDDwudgT5xV/Ub0qb0PMutRCZCtrFIDNecc8ca7mVZ\nsNLZ\r\n=cS2n\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"c05b9618cc2b93ff9a68314dc20c83c691206159","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.23.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.23.1","dependencies":{"tslib":"^1.9.3","@material/dom":"10.0.0-canary.fec7b42ca.0","@material/rtl":"10.0.0-canary.fec7b42ca.0","@material/base":"10.0.0-canary.fec7b42ca.0","@material/theme":"10.0.0-canary.fec7b42ca.0","@material/ripple":"10.0.0-canary.fec7b42ca.0","@material/animation":"10.0.0-canary.fec7b42ca.0","@material/elevation":"10.0.0-canary.fec7b42ca.0","@material/typography":"10.0.0-canary.fec7b42ca.0","@material/feature-targeting":"10.0.0-canary.fec7b42ca.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_10.0.0-canary.fec7b42ca.0_1611861300555_0.9725121982499956","host":"s3://npm-registry-packages"}},"10.0.0-canary.8e66dbfee.0":{"name":"@material/slider","version":"10.0.0-canary.8e66dbfee.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@10.0.0-canary.8e66dbfee.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"f3241bf8e56d19f2f23fe63341d3e56390ccea42","tarball":"https://registry.npmjs.org/@material/slider/-/slider-10.0.0-canary.8e66dbfee.0.tgz","fileCount":38,"integrity":"sha512-plJXFU1FSQLdYI5SRMTCAZIsqAH9ODoFnk7MHrPZEt34T1UmhHkH95JngCRwGdYfzZNFMsJmI7/teqAUea0LnA==","signatures":[{"sig":"MEUCIBCmVgcQJ6qlrA/T14JBaK1aJ2aUQ2a9WKewsoovhFGcAiEAmSinQrdC9NgL6wr5bndIlasuiLPhxbZMh2R7H92CRJY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":783026,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgGIzSCRA9TVsSAnZWagAAdAwQAKAVgqGJZgM6ABYUsaS2\nQ5DyBmYyYZ9V2FtGNQHRSJ93tinsIPPOY85H1toCOYUn5vjLaHJV2h+8+4nS\nhMV4V+BCvglo2EBOpt93sy0nuuSJfQ6mVp4jrJTsnso4qHiOnIf98Plnp0KV\n5S+9jZxY0aWcgD4fuUjMduR/v7fbWN82KjY9ikZ9HwjHaGGxLIsml5LUoJlV\nK1U1rZvjvsToObnOPwuW7qxDHKo8S12OTPE8uAZqOrFcv5a8aoHl5czu/BhP\n6B+P897HCRz0zrF24Qt0JrW7yYH+tZIC9aDMFQtQpgyaCc6fJGQwWEFZaMZo\n2SKlHfjQQBFVAiIcOcaan5gAhruGPECLUu+zueqKa3QtulrP5Fh/VL8Urhb5\nG5zv7B+BQ65j6XurBkHxosQ7OzvUl/aVj1VgbHR8PPtsNLpZTaGSfrBOrxws\nbV6rz2IeX1Hau9AxZx/lL+qnGDN90Ty+ZSTJnTHi/MXkAfmZhAhv8Kc/xFx7\nSIItF+UqhBxY6WN8YrQFg5HDjFDsKVyMPCUz/5uSCVoGJBv7rW+vWNOobYWW\nRdADqd/8xWon+wFQSfijT8B8NIUCCNAWAHFmEY8FBzVnVVs8h38mt4Mc01ZR\nfSLZVJhs2+eDaKVJG4gpvuzFeXGSGCQNtaVsSI46tTJL2SKTfKdK5ngjbel5\ndVQn\r\n=t8Fz\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"63606d4d60d94cbfccb1897812018e02aa13bd18","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.23.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.23.1","dependencies":{"tslib":"^1.9.3","@material/dom":"10.0.0-canary.8e66dbfee.0","@material/rtl":"10.0.0-canary.8e66dbfee.0","@material/base":"10.0.0-canary.8e66dbfee.0","@material/theme":"10.0.0-canary.8e66dbfee.0","@material/ripple":"10.0.0-canary.8e66dbfee.0","@material/animation":"10.0.0-canary.8e66dbfee.0","@material/elevation":"10.0.0-canary.8e66dbfee.0","@material/typography":"10.0.0-canary.8e66dbfee.0","@material/feature-targeting":"10.0.0-canary.8e66dbfee.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_10.0.0-canary.8e66dbfee.0_1612221649515_0.07887295358153223","host":"s3://npm-registry-packages"}},"10.0.0-canary.637d15da6.0":{"name":"@material/slider","version":"10.0.0-canary.637d15da6.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@10.0.0-canary.637d15da6.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"eeb881be1a8fa5c68a0809c90b39b9fda3df034d","tarball":"https://registry.npmjs.org/@material/slider/-/slider-10.0.0-canary.637d15da6.0.tgz","fileCount":38,"integrity":"sha512-ABYwM9JzeLXhjz8hGQFmoCsk74VZiHkfBn0F7CV4fkxTfWY3UlgaveXRBxrRYaV/joKd34RkhqP1UIbTWyd8SQ==","signatures":[{"sig":"MEQCIAVnk/HnfDSiqJYePOw4Di3fNKKh8p0phWuWV3VoLl3NAiA2YNQZboJ5pkQhu4n+oJ92TlsAWP9rfXDkiwkIPOR83g==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":783026,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgGZ7CCRA9TVsSAnZWagAALbYQAJtpx5DB0BMZ6dEQLDbp\nX1cYQwz0pbMmwOL3THjrnEbaK34qQt0LhNQU2AF9p5tc0G8RCs1PNbwBL6pz\n6FR1YmtmgC5U31TvQiCG0RAJrG+VYXt88n7u7TzcA7W7ixjy1TCo7WTNVPth\na5+e82qND77JokHZS5MR8Lf7IXtvBwjjxc86V0CPgucfjoAITxWN6CMfVR/G\nFmTYO01oXbxfo6YfGHrI7x9skDm4LCZH2yNy7XByY5g/YWqk08C2y577DkpI\nWlWvihI5SYoYl8A248Fsn4JPpcdRPmJyR5H2rqKAvSzALNTREjhy+IXE3SMI\nhBGMnpRkY+yGkRJwDDsxNiA+LY9WIbplXIHVcmxSpzx2w9QAY7CSRmb0PKoS\nncH0DnAm0KyFsCKlPsJRTtyK/EqnrUq/BeP9e3cy1Zm2PBkYtjmETcb/Tt8U\nMNtvqJBvrfzcWyYwEn1AueMZNLfnUtzy39YP9fA2ZVHSVmmHcqzxuVNoykZD\neH2BEv6rSzPmbGpwIGm/ZjKUNQNW2wBjXH4JwveXmwfRO5LG8J0MjpSSvKFu\nJkCzkrmiG3ye6g6/O63hVUXhhoY6KHBUeCnibPNOgSViw6SyEmJDCrEZUN1k\nMoGSdG10daP8odh2xJAxwzqx6IzvgOP19rDgC1laia3Dtnr7rCEEtY9Vu46G\n3Oiz\r\n=LjSY\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"264dfb09f81436a3537d88f2366133e250344864","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.23.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.23.1","dependencies":{"tslib":"^1.9.3","@material/dom":"10.0.0-canary.637d15da6.0","@material/rtl":"10.0.0-canary.637d15da6.0","@material/base":"10.0.0-canary.637d15da6.0","@material/theme":"10.0.0-canary.637d15da6.0","@material/ripple":"10.0.0-canary.637d15da6.0","@material/animation":"10.0.0-canary.637d15da6.0","@material/elevation":"10.0.0-canary.637d15da6.0","@material/typography":"10.0.0-canary.637d15da6.0","@material/feature-targeting":"10.0.0-canary.637d15da6.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_10.0.0-canary.637d15da6.0_1612291777584_0.7044954186608579","host":"s3://npm-registry-packages"}},"10.0.0-canary.fb793939e.0":{"name":"@material/slider","version":"10.0.0-canary.fb793939e.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@10.0.0-canary.fb793939e.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"6111607c6ed011d63cfe44d5acf83414d12064dd","tarball":"https://registry.npmjs.org/@material/slider/-/slider-10.0.0-canary.fb793939e.0.tgz","fileCount":38,"integrity":"sha512-0PlhM5aHFh6DjuxO/O95+B1JeA3uDDW3x9o3GAGRS9qrpoQc6Vg1TCj5nbe1mDFWIRkjjawH8MFm3Ei6zz/3wA==","signatures":[{"sig":"MEUCIQDpIerbAmxGdtEuY/hEPW6NZcWqeqFTsKjfjd1OM5auTgIgRyb1WfmfqaGqeW0fef8WcNncUjaYiPaC7xG9PsP9yhE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":783026,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgGeObCRA9TVsSAnZWagAA8IgP/2Y1bYRkx6YUM7QdXX2K\ngUPkNskeRWVFwry5XgBS25u5BVD7FlzvUFOgqs9pY4nbz1rWVwzEgcEbwQVn\nJqNemk6sWJKP4IqPGQlAffZzdVJCNWwG9Djp4ImGuI2QstwBNHXrhokIR407\nz2ihNWW0XgaiIjUXGR9OLW0VOZ8BQv1AEgf5LKE5EmNRBVPYMfrGRM9o6qYG\nCB+K06LpnLR4sR7VJtiJu8a+dlK6jWC0c0zAfU/GUdJtK7lA5SJDhZ4RpqqA\nLMSgaD6zdkygFxzrSuMPzZ8k2HbrSPke61Rc+Be1C6Lh74kmyRXHyKPQM2io\nf9vS0JoK0/ygORNVLUEUz8cA2iqHp//Pq5zGIiUH4LMUb24wZmP+ICga5lpN\nG3A+eByAiPeRFiXY/HSoU6vaytWBpHtyuvkqYR+Bun64OGdnpy/Gh+aAtv5h\nxGLG1F91CNpWiFkVWWwaBRzmaGoVUATlO0MoT3gtxN1igKOdcMg1M20fWxPB\ngh4EJjNf5GQGF5dECFaBzmEBJo7Y2glcaA5jFK8u3usmrWcHWXGCFrjv32gH\nHa3ZGX2iDGWLiGRdvD7pBmd48YzKZ6pqi4OeT2so7gpFkAFY9ZucuoEBycwp\nk42wkxjQQE/M7G35i3AFobOWaDGch4OxlMK/vprzGJFkfiw0EmjpIlmWsvPo\nxBBB\r\n=NpFB\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"b89489007d2a0c1f3821bd2291e448d44723ac68","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.23.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.23.1","dependencies":{"tslib":"^1.9.3","@material/dom":"10.0.0-canary.fb793939e.0","@material/rtl":"10.0.0-canary.fb793939e.0","@material/base":"10.0.0-canary.fb793939e.0","@material/theme":"10.0.0-canary.fb793939e.0","@material/ripple":"10.0.0-canary.fb793939e.0","@material/animation":"10.0.0-canary.fb793939e.0","@material/elevation":"10.0.0-canary.fb793939e.0","@material/typography":"10.0.0-canary.fb793939e.0","@material/feature-targeting":"10.0.0-canary.fb793939e.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_10.0.0-canary.fb793939e.0_1612309403131_0.8391235344748667","host":"s3://npm-registry-packages"}},"10.0.0-canary.15a4d40dd.0":{"name":"@material/slider","version":"10.0.0-canary.15a4d40dd.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@10.0.0-canary.15a4d40dd.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"50365c508bc06514391655724562c9adb263f374","tarball":"https://registry.npmjs.org/@material/slider/-/slider-10.0.0-canary.15a4d40dd.0.tgz","fileCount":38,"integrity":"sha512-kuUhlT4vDW1XSCrzuQodRzEZjUAlUoF6r19DWKYUMU7yzIw2ki4uBuutCaRYElnQPZ3pkENtN2EHFphA4Wn54w==","signatures":[{"sig":"MEUCIGvwQk9yFoeQYjWyLWZwbCswpq1pR7wAFy95KJqcd0AXAiEA1Q15Pdh1wr6uGUrHNIoQQv1ywQ2VsSisFctq76R2ekE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":783026,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgGggOCRA9TVsSAnZWagAATusP/2GnVG8kk6hyGBy4WsMb\nGUVMMh8yM/qVRRD+yUz1/wODvKcRVAlNs9/zT0wYbGdK92W3PMP0zoRecwrP\ncPaaI/7s0Uq2ra3+Saq3XL8Ap64n29xbYKfizTi6YGeo2zsJy41jBJtgDU/m\ngx+HIpYqVpE+wgnTqjWBKUMYR5E+TPbrwlkGlryBmRt1be1p9vdah5kBPazN\n1rtjEMhDPWZXJ1IC2vA2qd5ISn+G9JuWM6cl7Q2x+s+uL7f/oXgl/L7yK+wa\nmr2EEjHaMHziA8g3jPYialQ586KXeyVBQBRqOAiM+SqUKsZDORuAtoXKriFL\nq4iV9mAip74zmDf3t4Jg/KGgpLAf96W6p1lxmtRcBfKp4OXSEDL+AfEXdFCu\neRmGQH0Psh+uVHZuprCv8SqOy6sy3MnrkB+YflThdAPmTQ3XhM4icl7q6S+D\nqVWj8p6Z6ZAZm6d+K2hWBdRKn7Mm50jvUHFQbhqi7HhmkwpU9xYOz0phK/Ye\ngDsXSlbQKGs0VQG8LWLrXXHtrdUb1mfrYlbwJQw8ureUZrmSVRMtQzPIFlU+\nqFpxLzBn8oy4LYG4nQyph5Gpxq4CvQgy662a+6nCppqVoNrIhyQihgSpCvTH\nxtq7IJRldc/pmmQx/PZlnKxnNt42LrTMPC0ZMj6X+dmGx4OmGCkzQc6zdvWi\nIXMz\r\n=fK6m\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"a6b5f072852f1f101d03fb492c57fc97f7f0ca9e","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.23.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.23.1","dependencies":{"tslib":"^1.9.3","@material/dom":"10.0.0-canary.15a4d40dd.0","@material/rtl":"10.0.0-canary.15a4d40dd.0","@material/base":"10.0.0-canary.15a4d40dd.0","@material/theme":"10.0.0-canary.15a4d40dd.0","@material/ripple":"10.0.0-canary.15a4d40dd.0","@material/animation":"10.0.0-canary.15a4d40dd.0","@material/elevation":"10.0.0-canary.15a4d40dd.0","@material/typography":"10.0.0-canary.15a4d40dd.0","@material/feature-targeting":"10.0.0-canary.15a4d40dd.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_10.0.0-canary.15a4d40dd.0_1612318733784_0.9879137045288986","host":"s3://npm-registry-packages"}},"10.0.0-canary.7a003acf0.0":{"name":"@material/slider","version":"10.0.0-canary.7a003acf0.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@10.0.0-canary.7a003acf0.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"a7e79e6182a1f8e503e4f24ea2880f1732fa6325","tarball":"https://registry.npmjs.org/@material/slider/-/slider-10.0.0-canary.7a003acf0.0.tgz","fileCount":38,"integrity":"sha512-04tfPuXGQwUdOe9XVeG+HbNQb3KcBfZpm7jt7W5bGDAfnHnBmKs9OwFMcUzJ1++ZqGXd/AO5LIRN9OP9Zd2MMw==","signatures":[{"sig":"MEUCIEN7Qe61VJ+73/+TBX/XOtB72xbl0XlR8qeJBAy4olyAAiEAyALMWpvHjDONW2YWrdVKkXkD9qNGl718DM4W4Cz3iC0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":783026,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgG10sCRA9TVsSAnZWagAAkXkP/RpJvmVbNFkit95zI7TM\nwSTslNPChG3uJbrgxaVb4vu+m8HzVWUP/l0RoFSadfxFeGYv7dKe+yvAAKvb\nERcCUkdsmM7zeGTCbsiv3aAOFKNRHayH+0KipIJpkg1k75zWcCOwzwQCuv7n\nG4O/fY44sg7Sp5JJA9bw59AWuqaJ+FNzEIvkDsD9O/YeS1YL4D+RN9r6udIy\nFscXrmLOYleDwInWPpteBvMNsF6ttjjGpJr1n52Ywn//02S1e0XY2cTzkAgT\n/1XlXpU2IPWG7V6Zh/Ny2U+k8qepGEeqCqe2toHugAGjbN9ohi9d8HUg0ymG\nbQgjlv2i7RRIUHbooTfEW6YLHaqp88zGABgFv82f83ZGxn5U+jjKIwc6Olur\nbaD7xHfdA+5Bbpr95wFlGdI2mt6YXMUekE+/I6iKTr7JP6+Dr0O+bGtbDZhu\nK7VRXy7VdlvcQvmX4vSgAWKYsDX8mOMvjGM5kDPKkAsQem9Lv9eEqWyHhlg5\niAAW9nvVjow1nDnXt2HIVq4tNKt1QJe77X1ch5T8ze1cqwYhRjGRpGe84m28\nPOKe8W0iO+cMBbu4JNQPWPwNyZcBi8ukVQiM4cgd7Xic+BqeOFbAWXAK/4NO\nhZ7ynFvoaQfBR9bL5sFHRDOUQnk0oxrWlkdeYaf8N/yGTfAxqvurO/PVN3dd\nJ9ma\r\n=Lrxg\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"50aca8110f6412e14432e118e1f9229dafb02d85","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.23.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.23.1","dependencies":{"tslib":"^1.9.3","@material/dom":"10.0.0-canary.7a003acf0.0","@material/rtl":"10.0.0-canary.7a003acf0.0","@material/base":"10.0.0-canary.7a003acf0.0","@material/theme":"10.0.0-canary.7a003acf0.0","@material/ripple":"10.0.0-canary.7a003acf0.0","@material/animation":"10.0.0-canary.7a003acf0.0","@material/elevation":"10.0.0-canary.7a003acf0.0","@material/typography":"10.0.0-canary.7a003acf0.0","@material/feature-targeting":"10.0.0-canary.7a003acf0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_10.0.0-canary.7a003acf0.0_1612406059959_0.46755852086105","host":"s3://npm-registry-packages"}},"10.0.0-canary.05f249666.0":{"name":"@material/slider","version":"10.0.0-canary.05f249666.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@10.0.0-canary.05f249666.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"2b0e84639a9530e8c05a15e544b9928890afe58d","tarball":"https://registry.npmjs.org/@material/slider/-/slider-10.0.0-canary.05f249666.0.tgz","fileCount":38,"integrity":"sha512-quwqK+d9Zd+NOtnDqyBeuj1N2HOfZ8GD9VUqe2z8BlmM1rN52R153aUbyHACwwdxLfUgux/+o114EO9wHsfVzw==","signatures":[{"sig":"MEQCIH3cxvNFOj6W3XaW31u2B67G7IxTJZpugq2DsCraAWkXAiAWZNfHu/jqgZ1Wboh3V9NjERYMTQ4WP/Zt4DS23WSP7A==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":783026,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgHDPtCRA9TVsSAnZWagAAvJUP/001GWjdkm4m+R/ueLgy\np3Yk4OD0+fxKiL9hRj7tg4UG8WtRvjtUD3vwUoQ+GLHaq8sovkevwCMykXCS\nK/YCGJdP/Z9fvfAOV54zfS4Dtq2I/X9a092eXa8IjQ5zFxWd0hMb0HrG+k9W\nfOrm3rMyK3Vk/NGA2Pf1NLMi228+C1OmIjpNY2pJo2p6QcU0sW8QC4gDK2yP\n6w31L9oCr/G6nJucw+EyFlBI1yNly/UJ8m5I9o67rrceDmrHGNjv+E97VzFU\nWhzXvIBXV7hiuCS+e2gfeqXjYJK/sNgJA4VL6P+YlToolj3jsxeB81EO0kj4\nKPm3YNJWlliEgEwWeVlnZvLRU5SbtKJJxYpwMthjS3V8Q6uSt5Mw2srxuiV7\nrzQq6/fluqosrftjOitMoMzy/VOxRHgrxVpXnf+H4wHMc/TRaXOCdskYfS8z\n+bxUSYoPzYxbJ2fQjoK3sWlnn4UtElULCsJvVzRPfQJXs6ddiAUv0tRMN8I1\nXAO8Z1upG50DEU1i79J/1bqF5dxcH/V56dgIfPcZkbUCAMh78w2PO7CMPoAW\n95frw6RvoXpQ3v3kmP00X4R/CzaG6YN8hL6Pp2Dsyx96Vp0N33aCg55gd04V\nvLfthpvKCc30W0ztjWrVx1BfFWGrOz61lDvXODnnSksYxT9UlCQhWRaNlJBk\n/MwD\r\n=EpUZ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"6f1fffc7e905a3d49f007f288c26a4b5ea11dfd0","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.23.2+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.23.2","dependencies":{"tslib":"^1.9.3","@material/dom":"10.0.0-canary.05f249666.0","@material/rtl":"10.0.0-canary.05f249666.0","@material/base":"10.0.0-canary.05f249666.0","@material/theme":"10.0.0-canary.05f249666.0","@material/ripple":"10.0.0-canary.05f249666.0","@material/animation":"10.0.0-canary.05f249666.0","@material/elevation":"10.0.0-canary.05f249666.0","@material/typography":"10.0.0-canary.05f249666.0","@material/feature-targeting":"10.0.0-canary.05f249666.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_10.0.0-canary.05f249666.0_1612461036849_0.3895356327038191","host":"s3://npm-registry-packages"}},"10.0.0-canary.1a3a39629.0":{"name":"@material/slider","version":"10.0.0-canary.1a3a39629.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@10.0.0-canary.1a3a39629.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"00bcfd41f638e0f18ba22d248d9978e9e61cf2dd","tarball":"https://registry.npmjs.org/@material/slider/-/slider-10.0.0-canary.1a3a39629.0.tgz","fileCount":38,"integrity":"sha512-QVXIkPh8isg+ft1FrXVi/Mn7rBYOYrtg0fIaF59NY0q60u9gMOOyuHFR0xWBl6egFAvEtCY2XHUl90TwI+LvYg==","signatures":[{"sig":"MEUCIC891WPb7tXPeZ9QrldN22yBd00N2FRZExkAMPMhi2aZAiEA9aMlXiwm5d2bUIL5/32cxJiq++rzhpa9XKGU5NfzB7Y=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":783026,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgHEBTCRA9TVsSAnZWagAA9AgP/1J9FaIXs38q6em1OK9A\nak+g8nEAGXDGc+XjXMYn9q299r/zQ71Y44c8g9s/8RdfBt0EOyWQ6FsRZX4p\nENNFrebLDTA/S3pw8XFzj2/KZIooMOZtduJUWuCzm4qfYDPuDcZLugs9fiuy\nzE2dClLwsTp82Qg7YhxE/VbWN1wZanTGggjYSTqWb5KSsYzmXyl6tNjztXp5\nJ0l1fH6z+4UuCJgJAs088wSFplGNnhiMtjSjHfff+UPKNdZJOvRMUJgS2RT2\nnQLNLu3bRbWRbKhPXgVKlzU7QF2eQUgwJQLLZH6kYWo2PqEu8WVoaFel9q/D\nrKI78ukDQMo6bE28K8ej8H03IzXzsuJkDLMM1fnJPAkUkmUDLQYYqhvtafn4\nkqODB7xNu0Sq0vtHm1yzGwZNzsfXuEDBXVuB/STJbfB+6RtBbYmjIYepKshc\nAN7AWpCQVI00tme1qFlixFdPB0epm/I/HLW2uYX8li56v8ttIyuU5PYrs9jB\nwLnOOCFHsoQtsPDt1VIbTjy6Y1f0Qz1p9czkzrZnWgBPU/k1bI+4Dnnvsp4w\nQDzuJZLTMZunJuBmquVboZKYGqoZBgUidtNRL6q7IZngZzbTyqlGee9eKtEQ\nVBg7orfQmtzRik31Uyd3XAifiuDqIUtXonAdbgNbUSU4R9fYN/THT1jY8m5Z\nygyX\r\n=sg9Z\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"87d65275f85db5a2c4e630df10d231afaba36449","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.23.2+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.23.2","dependencies":{"tslib":"^1.9.3","@material/dom":"10.0.0-canary.1a3a39629.0","@material/rtl":"10.0.0-canary.1a3a39629.0","@material/base":"10.0.0-canary.1a3a39629.0","@material/theme":"10.0.0-canary.1a3a39629.0","@material/ripple":"10.0.0-canary.1a3a39629.0","@material/animation":"10.0.0-canary.1a3a39629.0","@material/elevation":"10.0.0-canary.1a3a39629.0","@material/typography":"10.0.0-canary.1a3a39629.0","@material/feature-targeting":"10.0.0-canary.1a3a39629.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_10.0.0-canary.1a3a39629.0_1612464211271_0.3132106418481806","host":"s3://npm-registry-packages"}},"10.0.0-canary.8b1cdb1be.0":{"name":"@material/slider","version":"10.0.0-canary.8b1cdb1be.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@10.0.0-canary.8b1cdb1be.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"1a06f1f59471384cd8d0f3a30a99f62df5f8f60d","tarball":"https://registry.npmjs.org/@material/slider/-/slider-10.0.0-canary.8b1cdb1be.0.tgz","fileCount":38,"integrity":"sha512-g3kzzHX/09qVcK8TqJptF402QiBeRh3QUMPAK4+WfQ+t40DaH1+5gaagz2/1JRr4jMxe5bqi5kaWI6I2HA3KIg==","signatures":[{"sig":"MEUCIFaWjUnCmOqspN5l98vQSSsdVv/k1VQu5EnB6FF6FM0oAiEA5y69uyTgoYfSOP60If11jpI5gWIt+9nOlTqKp74PKq0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":783026,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgHHajCRA9TVsSAnZWagAA3D4P/jEr1l1v65yCEC74S/CC\nBl9dfp+GPEWcXgjiZaz8GjGqd03aOGMbaX9hLrbcxj12g6wHNN7JJyTDIWsD\nPJYM7H5Z0OlHWFzAirB2hRTJ6x9bAFszwsYgltGdzMAWc0fbx3v88LFrPOK+\nzXnZosY6pcZUWKmTMa9encS/wO69b0EE2UcsO974Qn3hfwuV2zXvj5lbInlD\nTfIfuuw1zBsfepTkNNUricc7VB1tKTLkkyKfQ7WOe5vEWaPz4pxwpMRhMd2W\n2yV3bTOCZ2Bm1lh0XITvNBENSxa2CpNsfgTcQrcl1DqEAFHF0AFmLOhnHWyX\nj68ARaQke1x/HKDHvQ4ZBaM96Z7oPVgln5UczLrBrs9/RAlgjHFHvfiJhQre\nh40Jecp/twEnjvTKwZ/vcN0Um2v7gVTKCy38eEKoUS2xk5URW7Aw91Hhx6RW\nb/aDtJTDIAm3Mr0uo8vAvgYMibD7Fwm0HVXgWvRjyQTu95PAgea2Ci9578QG\nbT9EEBJ20Kp3pc5pdWs0gRIK2eIwFE7SYAlh+2gYV6o+vpDF2jJGLMgIDYfa\nc2cdHUDUbMEtc5vmrJmfmGy3YXzLIblEjGpdkTuPIC+LVDJzONzOqvCcS1hI\n/K4vMNfqajvSrQUauaTbPRvAxoin17BSCgnFyeLYV8ZBh2ynTbAm7Uu+KBRk\nmp8B\r\n=b02N\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"73f8ad23c72c2fe32bd1a9e5e102b6aca8ce21d1","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.23.2+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.23.2","dependencies":{"tslib":"^1.9.3","@material/dom":"10.0.0-canary.8b1cdb1be.0","@material/rtl":"10.0.0-canary.8b1cdb1be.0","@material/base":"10.0.0-canary.8b1cdb1be.0","@material/theme":"10.0.0-canary.8b1cdb1be.0","@material/ripple":"10.0.0-canary.8b1cdb1be.0","@material/animation":"10.0.0-canary.8b1cdb1be.0","@material/elevation":"10.0.0-canary.8b1cdb1be.0","@material/typography":"10.0.0-canary.8b1cdb1be.0","@material/feature-targeting":"10.0.0-canary.8b1cdb1be.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_10.0.0-canary.8b1cdb1be.0_1612478114835_0.27894807799913135","host":"s3://npm-registry-packages"}},"10.0.0-canary.8271f00f7.0":{"name":"@material/slider","version":"10.0.0-canary.8271f00f7.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@10.0.0-canary.8271f00f7.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"fc6d0c1b557296d34ecd6fc6852126f934340a58","tarball":"https://registry.npmjs.org/@material/slider/-/slider-10.0.0-canary.8271f00f7.0.tgz","fileCount":38,"integrity":"sha512-Mm72f1K0T90YWso5pWIcNhJGciSCz/9SfwNj85vjnt/R1uOw4i1ICsgHPVun9FHxhj3+zA0r5bH/or7wlpiSTw==","signatures":[{"sig":"MEUCIQD9AjwbOOsasIEuJJkQ4uw6y3KowWbNxU+O8JRfuit4oAIgJ+ULWeaphmppMhoo9nTUDEjtbFD5xweuwIosRHcTGUM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":783026,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgHHyrCRA9TVsSAnZWagAAIQQP/1qLlurKcicwJREA806B\nb43Zti7MXyNJNAVbmqX+ak15TH1pvU1fecIqOEHg08Wbe4qiigPcrc4nLpum\nJDlAvDCQu4taNahtUVmZhlN34jR7pt7rs5sljL/yokWxQsLLW8HfbiPbE3Ho\nTDHajtiEDIj0/adSe/BHvHnCCpKFWkIFnPBJnKvmYAWY3C7LO/xK0c6tw8bl\nC8OiLIX12GZ/cAPw3u2jF8QjAw4cVrCILtE4MPc85zv6wlaXNFwoGNq4VaeV\nmta+wHQnHY+31zO/2zQUEAtZIG0pq4J6JEinPjWyqHZ3rIZbYu82kUMVedMH\nNpHmc5Fehk6xWpj+iVzr3fwg5DnpL9OXQOKVG0gjgBVGfWL950PY0ksiJdct\ne7U8bFeybO4c2vjTpHHEQWsGs6Mt5Yzy5Shqa8upGeRXNRfApDlv3N+02YXn\nlPyS+2WDJTuza306rMjO3rAsG5urTSTTHluq3ZCUIo1dZkHWvTPwXv8k6VoN\nCl6BKrZVs8OuGO9zXlxIERtvAlrTQi3Qma8aCE5faZzJ0Ax1wVwuaciXG8zh\n6OlynTX8C7yg7MH2PprYFnazCVSs4p3PEFEuawT1IamqABbpuDxeZIRnOAlB\nOSpP2SwiUCj4v22a4ZBNkXSXey1uNL6/DnNc4uMDe82tdYorDItUFdzNpNXt\nEwHb\r\n=I6rt\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"e210c5292564fea23c9cedf08acd2b8ecf86e94d","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.23.2+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.23.2","dependencies":{"tslib":"^1.9.3","@material/dom":"10.0.0-canary.8271f00f7.0","@material/rtl":"10.0.0-canary.8271f00f7.0","@material/base":"10.0.0-canary.8271f00f7.0","@material/theme":"10.0.0-canary.8271f00f7.0","@material/ripple":"10.0.0-canary.8271f00f7.0","@material/animation":"10.0.0-canary.8271f00f7.0","@material/elevation":"10.0.0-canary.8271f00f7.0","@material/typography":"10.0.0-canary.8271f00f7.0","@material/feature-targeting":"10.0.0-canary.8271f00f7.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_10.0.0-canary.8271f00f7.0_1612479659037_0.9556778531643066","host":"s3://npm-registry-packages"}},"10.0.0-canary.533092a90.0":{"name":"@material/slider","version":"10.0.0-canary.533092a90.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@10.0.0-canary.533092a90.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"7281d7c2d1bc7fad176db8fcd4295a9a3c9f152f","tarball":"https://registry.npmjs.org/@material/slider/-/slider-10.0.0-canary.533092a90.0.tgz","fileCount":38,"integrity":"sha512-yYjjPqb2Mm76qi+B83EszzbgPKywaZItTSnX5o7hG0DSczKwKmjb3NuoEn0uSXSBiyZfxtLeMc75djJkhodM+w==","signatures":[{"sig":"MEUCIB+bstaWcZDeIGEzI8KvGUrhroh2ReghDYADBPaByEwDAiEAlDNK+PtlfNQuPB7DHM6kdpDdE7KP/J13EwtHqWhNDos=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":783026,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgHL+6CRA9TVsSAnZWagAAR9MP/3Be8Hcct7QNn2EiqCNE\npiOu2DTBoY6OUcAllELYPDKqMqHYiwWNxXtDL/Ot2IRKPsJGo+YokOa9c+oF\n6zsGJL+Sd7lklDxLyHKgnStnkxJ7A2nqMdv2BsKowPYQMfGzPRKCUf1LnmIW\nkfpjq0JI/zMhte53/P8rY3rwLa9/vLPNd9Z982VQ9ekSOeGCh7TrD11D1+tm\n1yQNG7b7ZRIM6mv5AB3t211YKCD7RR4vKm8mMLJjkH3Z19nmL5ere8DxlrK9\nlcmLzbdiKSVNoKtoGS1CpUqqCDMyyYprrku6PuJsZ7ZwOCroMu0WJapHFqg+\nwNNsy0/oLNJeYNVj+cAZkdIYC+UMkkMQPNwvWYxWypeJ4eoOXDiok//TtMRx\nUjAm0lqSvULMDLaDFdBEWjTBEuoe+abf+FgCVYMlldn7aL1UnKgeOTX49EZ4\n8Bqc0Du9NpfCI2MtKeA6voI+mtr8CB+dfUvOzghUZHzdwlK//Z8F4Jp1SLVw\nveUQbOKgoyA8KcsT2cXkre2xUaRtw7541nepoPdDGAbI0gFmUHJyYyaaKJ4X\nGzQbmuiZ+2rYksNYr6k9lnZvXDZb6FLMnF4f5NdO2jxf4CELHEho3Pg5SD2U\ndPUWgX9eh2Vz+zC0PIyRuIZYZXlT2bTGYOKhY9iwO/r+HJ+Df3o0Fv5k8lrE\nTbkq\r\n=VQG5\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"1f76aa244e85ddde7348716259e771c739c09f23","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.23.2+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.23.2","dependencies":{"tslib":"^1.9.3","@material/dom":"10.0.0-canary.533092a90.0","@material/rtl":"10.0.0-canary.533092a90.0","@material/base":"10.0.0-canary.533092a90.0","@material/theme":"10.0.0-canary.533092a90.0","@material/ripple":"10.0.0-canary.533092a90.0","@material/animation":"10.0.0-canary.533092a90.0","@material/elevation":"10.0.0-canary.533092a90.0","@material/typography":"10.0.0-canary.533092a90.0","@material/feature-targeting":"10.0.0-canary.533092a90.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_10.0.0-canary.533092a90.0_1612496826318_0.8440508830616298","host":"s3://npm-registry-packages"}},"11.0.0-canary.633a9fc7a.0":{"name":"@material/slider","version":"11.0.0-canary.633a9fc7a.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@11.0.0-canary.633a9fc7a.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"db781343611dcb8d4b39ad5d468577e51335e14d","tarball":"https://registry.npmjs.org/@material/slider/-/slider-11.0.0-canary.633a9fc7a.0.tgz","fileCount":38,"integrity":"sha512-of0AJ6TWpU5NswjMxzTyM2hq9JLD1cRHZ4xlaU6UvSjfGPzfBfeX0NEH/o5w+qugVAX9yRXwqNpz2AYKDM2I/g==","signatures":[{"sig":"MEUCIQCMwtuZZwGJnnWOJ/Uq+iVBW89A00/wp/LFu4LCfwcWRQIgS16nS3yqy1A/maV14VndzO9LdvCbAi2DoTlGjhaNb7k=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":783026,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgHW+vCRA9TVsSAnZWagAADtoP/3DQaxtyMqt9YWO+jqt4\ngUB7KceTktNgbRJ/dkKt2WBg0189jVrICVONTe6x1lzhVnz6fYwlPazkMlTz\niDcl+bv3+L70eCFoiktUOAepN4GRqjEJqq7zjZ50XFGmmxKlSNieGiVyN4Fp\nKuMC/q42apl8nASQmpI0RERZ0jBHyn+yWYVO6QZduyX1HQJxdC2eDve6HImx\nbfCe0jLBrXji+ST3p0DHgQZWek3EMRVra1KDdT0VD5mhVZZnWOSz2k7WDdLJ\nu4DjOnA5NgPndC5e9TTxtYbsw1e+TKakZbwc1dAYlrr4cnefcNTos+03VOdL\nDjFhJtmPlRT93iCC64sArr1eQG0/zRQ5nRs0lYFN2uRpnRNcLRhXEiKxPalJ\nfJBwSLHR8YzGjyYo+g0+/HOML5v9gelvIqHUEjFjmkonzdPn3D+hMgEMggcW\nWHB+XjYlwGMDUbINfY4/hOD9JjQE1iAo9Rq/x91Gz9Gr4hqq5CcsmJd31obx\n+peEJQbeoAD3w56eUeDLW2gN+kkr5Hi52CX+zlMyEnVR2CIJnpWW+Q14lkWR\n4yOmsK/4onFVXwlMDPpec+98tu5sGsLcsItZ41dUvJ4PR6Imq3A7dFKdLAVG\nYZQu68v1Dlhg0whoh7NXJLdtbU8wqixngkz2LWz9YK6oaEHBhAbThhyiOZjF\nD17I\r\n=WX2c\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"9fe28e8829bc50c384861e340d551c0718dac053","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.23.2+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.23.2","dependencies":{"tslib":"^1.9.3","@material/dom":"11.0.0-canary.633a9fc7a.0","@material/rtl":"11.0.0-canary.633a9fc7a.0","@material/base":"11.0.0-canary.633a9fc7a.0","@material/theme":"11.0.0-canary.633a9fc7a.0","@material/ripple":"11.0.0-canary.633a9fc7a.0","@material/animation":"11.0.0-canary.633a9fc7a.0","@material/elevation":"11.0.0-canary.633a9fc7a.0","@material/typography":"11.0.0-canary.633a9fc7a.0","@material/feature-targeting":"11.0.0-canary.633a9fc7a.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_11.0.0-canary.633a9fc7a.0_1612541871046_0.10163067618916788","host":"s3://npm-registry-packages"}},"10.0.0":{"name":"@material/slider","version":"10.0.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@10.0.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"9f63b18959fbfbab8c60331a579a977ea879b1ae","tarball":"https://registry.npmjs.org/@material/slider/-/slider-10.0.0.tgz","fileCount":37,"integrity":"sha512-RsCPCk/dWba0W1LxRCALM9iVQtww2wgEZM7P/erQQyNKHDCR9CPNrCW5Y9HUhtzr+j3RaFqkSGDzJ1+WpIOQ5g==","signatures":[{"sig":"MEQCIF3Yakaor8ygyugX7nq0haVSWi3FTWMpUtSepXdeF8jNAiAdtyE92hPv3J2rLzlovr7pqQy7sMRlgMj1vGWoLoiZMQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":781157,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgHXAICRA9TVsSAnZWagAAcOoP/2dVG+Jp1PdgOR89/AbQ\nZIkDkcBwQ+9Z3n3aPP72GlyCMJF2lwOK7Bkw+8AYCDedFAY1rfpcwekEnx8h\naUdAJ1XsiBHZRUdR2jOOlIJkIIPcQ1lLD6CYGli343z+LT95fA/EWbsziID3\nv9rcrw/prWmw8qwQIM5Z2Oo2Kl3/L60DsBfpXqLu5M4N7HPzMpCiLgOQHZ2S\nMLnIyDjcHSveKA6MJQny3ebUDsmcdzKO756GTQZJM1rZ+OTgiKaEbcb3X2qC\n7MDfIiny28cfK5FOXQYM5KojBsWkVbTe7Hv8rINgeeZDhvwnSZ7ZXFQlR6QJ\n2jNRWmBDBr5otvLgGL0PiILrXLYG8jCl2fJKzP9tmInn7g0CYR8lx1CFSs/b\nG7Gl12P5pZ1Lsj/I1hJ7o9cRSCqH/fxdSTn/G/4JHIzwWVf++79Ou7f0NHdn\ny3NOce8HRP23b13disEO2LiPx7qm+jOBePX83YWcWfb8m1aUY2Rkj+47P9k2\nzE8A+Q+mDfqjjCu0vBjHvw/J0eWzES/YBnDFRNsChpuVaA6xtWvO2wimKbNX\n3n7lC3XcjURO/rTAgNE06rJgmMhosW4BmX8NRoYYJXd0PiqQ/SuAr2lgImPD\nDbEvABhpMiq4oRwB43PCyDm526gCVuTcbbKsK4vDkX5m92F7I+OO0ujd6pAY\nhXm5\r\n=7HUe\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","gitHead":"633a9fc7a98d0d9bdc177bc9ccbd49beb25bd5b6","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.23.2+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.23.2","dependencies":{"tslib":"^1.9.3","@material/dom":"^10.0.0","@material/rtl":"^10.0.0","@material/base":"^10.0.0","@material/theme":"^10.0.0","@material/ripple":"^10.0.0","@material/animation":"^10.0.0","@material/elevation":"^10.0.0","@material/typography":"^10.0.0","@material/feature-targeting":"^10.0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/slider_10.0.0_1612541959499_0.4783950835513291","host":"s3://npm-registry-packages"}},"11.0.0-canary.b5227247d.0":{"name":"@material/slider","version":"11.0.0-canary.b5227247d.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@11.0.0-canary.b5227247d.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"697e784623794b36be2f89704cc806518dbc3824","tarball":"https://registry.npmjs.org/@material/slider/-/slider-11.0.0-canary.b5227247d.0.tgz","fileCount":38,"integrity":"sha512-Hk+Y3JKxWQloxsL1exltMcYRiadUPn7OSK/lo6dIhbDFpqMRYBLo41Z+HIw81Z59zBg4AfrersovZAoloWp1bw==","signatures":[{"sig":"MEQCIFrAlvk1e8RDOH772xhEonwZ+ZYJmNqkCkSR6wRJXoh3AiALjc+DgHiLKysFLhk7e63z0jRZmKWXHzvE4W+Pmidvnw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":781715,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgHYN/CRA9TVsSAnZWagAA24IP/iNRgtMqIP5cvYMgDOJ+\nf1H36vTtgC5GEWmJNbqOon4YWNXChmP7KSjV66D5AOyfzrMZuhzKel0bxkgo\nyaPKmhXiW5dc28N/m0Kn5dI/eXAv4QnO0nWk1hw0I/6yBZ2fg6uUZYSLjVyj\n2DTV+yywESdJ8cDQmgHmCq8nXGnSzILtAV1G8rmNq904IJzc937w63/ABbhS\ng+bTPPAeScuqWLLxEpxGtIha88ZW6CCdKaU2/3sZBagnzJfXkcTD+jCkALht\nj6xPIat9q1soSf0okbSzSq5yopWfWpIa2iJtNgyr20NGOEx0q8HQyhWGVxQM\nZ9nUtmzTv8mdCLrBG1MjaRALq/7fSwaAuYhQRbODEDsF8ELuYj9qXRy3gIyc\nT27+hiT5153r5Dgbck0s93RgcFItOO2eFmEvbiKWL+J+uLSD2ECDdxI9S5ul\ntW9luFge/AleJl5dKx9EhaRtULxujBiaxjJbGQE6TdoFmh3nXtU8HQSaetF5\nAACF57/VUbpqj9eGierTMi2YQDvZiq82z+h5mVRtbZuISChBRchfLKCXjI2O\n9OlwNDAZO0TjjIfiBmGq5TpllnQNY+JH5H/0TcalILwJYMIfGJRwL1Bkk58T\n4yLNqRdzYIpPSKVZnQJ9LI0jUbdrXNZ2QJpSClwqqPJn1W1YvxgGFvNZDCJO\nuUow\r\n=F9kB\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"6f733c52a8cabe9fdd3ba4c35cb19e5526d8b312","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.23.2+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.23.2","dependencies":{"tslib":"^1.9.3","@material/dom":"11.0.0-canary.b5227247d.0","@material/rtl":"11.0.0-canary.b5227247d.0","@material/base":"11.0.0-canary.b5227247d.0","@material/theme":"11.0.0-canary.b5227247d.0","@material/ripple":"11.0.0-canary.b5227247d.0","@material/animation":"11.0.0-canary.b5227247d.0","@material/elevation":"11.0.0-canary.b5227247d.0","@material/typography":"11.0.0-canary.b5227247d.0","@material/feature-targeting":"11.0.0-canary.b5227247d.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_11.0.0-canary.b5227247d.0_1612546943348_0.6501128436290411","host":"s3://npm-registry-packages"}},"11.0.0-canary.95322b11e.0":{"name":"@material/slider","version":"11.0.0-canary.95322b11e.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@11.0.0-canary.95322b11e.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"f09aa2f5981acfb3459c3b8b1b1b9152c128fc89","tarball":"https://registry.npmjs.org/@material/slider/-/slider-11.0.0-canary.95322b11e.0.tgz","fileCount":38,"integrity":"sha512-+UDpxBnrAPZWzxjhkHUi950esN9Hik1gQmJhlLcJImFl56Q5jB8vUF+Jsh3xd4n+1jJ8JXT5iI0JCfTtPfWVsA==","signatures":[{"sig":"MEUCIQC2gjsY7bUKO6+gD6HHgGKVeA6WFofVeage5867oMIcxgIgDFEEEY8Dh85zRAzL10W2jpikcPKEzUASbt+4O7v2x6c=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":781715,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgHdVwCRA9TVsSAnZWagAA89YP/3e3A/hImTpflTiq2n03\ngi/cNkFkfuBTYW5l8Qd/Zx6X2DJA0JrlRkP+HV1ajbnZAx5p2X2YAzZ+/9IK\nw8e3AD59UE9LXzp3eH6u4lM98TjI9XB4BYFoWemya4TlsgROUzGBGemDIiwz\nobgNI0VC1dWasKUE+KlnTlb7QXPlsjPeUA5mUNPECi4x8neRnRqwTJ/bwGom\nO6+7HT6Xn88vkw7+LKiZxEvnozSzH5mJO9opN/D9q1atXbhnpVXZgjll4BUU\nd0ydwQSdUSHyrzqkp5bU7zsB14G1sCxMpak9RwI73rVpwqOJYQ3Kno/Q7evR\n+ExmOuvuNqFwI9HGI8OHQsUMzb3FSIoAIEYY5x04BU5He99CynugEVKki5EH\nw1Sh+vOtH1bOTs2ghNwxeq51Hzu+kNhlB4AqnDW62XkbhV2iwzbAZvYYBZTY\noUVlp1Gu+zUH2QTdQ6k+G/6mRdSvGcaNCnJFHamxaxU39MZ5gMMDHrclXNHK\n2r+8BJ15/wO6PjTjG2I9fe/wFqKFlFYiqviCiYsFGBJdNxO6rzolKzcpshdh\nw1VQDxZBVAf73GSRdPrXaBF5PxyJAHAPG47nN1/35papWAUDa8QVcJnLInhx\ntrQzKe3z878UODJhHgS7Hrgnr+ag1jfdyacGdgjQhClZT4+W4mf9eeovmupB\ngvYM\r\n=95mz\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"96cbc49ea4bd39eb1c275fdae68b6bae32b59ad9","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.23.2+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.23.2","dependencies":{"tslib":"^1.9.3","@material/dom":"11.0.0-canary.95322b11e.0","@material/rtl":"11.0.0-canary.95322b11e.0","@material/base":"11.0.0-canary.95322b11e.0","@material/theme":"11.0.0-canary.95322b11e.0","@material/ripple":"11.0.0-canary.95322b11e.0","@material/animation":"11.0.0-canary.95322b11e.0","@material/elevation":"11.0.0-canary.95322b11e.0","@material/typography":"11.0.0-canary.95322b11e.0","@material/feature-targeting":"11.0.0-canary.95322b11e.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_11.0.0-canary.95322b11e.0_1612567919944_0.17434726806973533","host":"s3://npm-registry-packages"}},"11.0.0-canary.1f318ff0f.0":{"name":"@material/slider","version":"11.0.0-canary.1f318ff0f.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@11.0.0-canary.1f318ff0f.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"000bbeef31dc1512dd29aeed2517067537065957","tarball":"https://registry.npmjs.org/@material/slider/-/slider-11.0.0-canary.1f318ff0f.0.tgz","fileCount":38,"integrity":"sha512-AnXlrPg4eNNkbfTvvkpRv0F5omEr3t2rtmlI+KPuuztj7FY8PY0Ijp4hkD+Xx/n2Ur94KxtX1qk8VloXaQwfnQ==","signatures":[{"sig":"MEQCIAyWTkp6ZOWwsidEEP9YhOtEX5VJNuowCX4/8p1X/d+7AiAtqn3FGNYBTBdaPnudcKJIF6cCZsA7ajWcpEiqntW5ZQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":781715,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgHd05CRA9TVsSAnZWagAA6roP/3aJ1XL23LLQDWkj0Yxe\niIv7fPFHrqaIUx7uduUK3aRokt0/+OWvg7QkMlNyqztYp50mUKIfxxlomcBK\nov85aKrax/4P0ggPjHCFngfjlxam/ynU569rACn4oXbOEgP90UvTCLdB9t4G\nZPhivlhoox0hrR7WHvipD3CLk56VHQPmdiLdTenDw/5i011L+zi/afYygi3L\nX86FqbouXUQtlJcqHkQPMEyXPpJ0E07J+gVMuDw4s1asBLGJWoLOISdiWJ2P\n9hBQTDcxfgL4LchakcCtCYlklf7D8Q6uNcGgjf+6g5wq1vHXNMCw1+zXyAlS\nkIE3dV/+nbwoMKXOUVBYFke9IDaoZmdCxogic1YTwCAs0b/IRE7ka1dMjc0O\nHYWt/mLgJiq2AQGOZZXKaHyN6V6Ms+jRBc8QIR2uZJ24XXN/WOMT6mEv1yYF\no8gvmDXqebQ/pTFWJsro75QDppoCxq2ulq/nh9PPzXT8wd8/I7fpyX/okTgf\nPFjzghyXG+6EI07Yp61nQv8zy+9wJmL+Iy/TJGHO86q1AITcxRsb+C/j6OWv\n4eBPII714WYGLMSW1jU8a+NAffD/oLHbLBOfaRbt5gYPZxnM6iEBj3UNEZtY\nUucAzMWSeM5YWsrUMhqDG0Hr9Di5vNzwiruOABZqLQ/vD4XjAFrzjHKExnS4\nK45x\r\n=ZINN\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"fbdc53421d5701ba23a43e18a010bebd179dbae0","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.23.2+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.23.2","dependencies":{"tslib":"^1.9.3","@material/dom":"11.0.0-canary.1f318ff0f.0","@material/rtl":"11.0.0-canary.1f318ff0f.0","@material/base":"11.0.0-canary.1f318ff0f.0","@material/theme":"11.0.0-canary.1f318ff0f.0","@material/ripple":"11.0.0-canary.1f318ff0f.0","@material/animation":"11.0.0-canary.1f318ff0f.0","@material/elevation":"11.0.0-canary.1f318ff0f.0","@material/typography":"11.0.0-canary.1f318ff0f.0","@material/feature-targeting":"11.0.0-canary.1f318ff0f.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_11.0.0-canary.1f318ff0f.0_1612569912744_0.04639444157625028","host":"s3://npm-registry-packages"}},"11.0.0-canary.ab12cf7a3.0":{"name":"@material/slider","version":"11.0.0-canary.ab12cf7a3.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@11.0.0-canary.ab12cf7a3.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"fdcb8cc1aef62112748e547c033956a2e7550795","tarball":"https://registry.npmjs.org/@material/slider/-/slider-11.0.0-canary.ab12cf7a3.0.tgz","fileCount":38,"integrity":"sha512-+HSj1TaVgrP78IRdbO7vj5WQdykJEUJoqEK94SXCgRw/OQe6I4nCYiqrqh52yyjWQkNtxvqnzUDCfFopbcmtHg==","signatures":[{"sig":"MEUCIQCvgpiACkE35iLhdihkzBOePgV6m7U+2tskDlTjnFIieQIgFk4bjWc78iEcCf0f8Dh8N7FbHnRqS0ZJiUQZqu8VqJE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":781715,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgIVLYCRA9TVsSAnZWagAAoSYP/Rj4CbPmYLfP1HJnSSO5\nlat0nXRZ/F1of5ytBvXmsrjfp0L5nnX8AP3Etfn/wNQWXxGZ5WthTsgHTlPc\neyT1Yk8P4wzhux3j+5Szgw/BUUjHv1a7NYFb74px/7waZV+YHWavMU+h6fGv\nUOUYOYSnH0gJ099RXiuhvvHnWbGAKNgwsZeL1r7O0mR6iHEgmzXGQg28enTD\nLPz4acbDjpdTFcJcq7FmrDM2fZhSh+SyMQCx4ksxhPR77LCNPbpJ5f/h9W9Y\nyGaoJJzOJGBGUFPAtabqEdnigDPhfofysp2H9F1IRx74xCWQx3ar15bbFyfW\nvQNGyJkkPIp8VZxEp9Mvx/FJghTgVkJc/XFHI5KEEY3mdG20YWQLYVPf2rYo\n7rj+5zQcCZ8q+E/xmlMN6Fo5LORZW8HYL64M4ZLgN+kMRnYHy2QLgmce7PWB\ntscHVYPrpNHoiGi09O50nnKpcUPmA017qlKSnKOsyZrw84zLWbd+af1pTfOY\n69ecqyJRfO6YK0QkJ3gvckJBBmy+mDq4KkB+ctsU4JOazC/kjP/fiTi5jcb/\nKdh/DObV1qEcP0nr5qq2cgryakXgM323/2gD0R7VPHL+zil6O2uxLbGyGXeg\n4ySS9Rz0CEvxSFaep/nJfUMJdsIg/j/YgQ8Ysic61Fm3O/J7M90H1DQkKupY\nB8N4\r\n=Gony\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"b1cf52745607ed664e2dca58a230a3b3849aa273","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.23.2+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.23.2","dependencies":{"tslib":"^1.9.3","@material/dom":"11.0.0-canary.ab12cf7a3.0","@material/rtl":"11.0.0-canary.ab12cf7a3.0","@material/base":"11.0.0-canary.ab12cf7a3.0","@material/theme":"11.0.0-canary.ab12cf7a3.0","@material/ripple":"11.0.0-canary.ab12cf7a3.0","@material/animation":"11.0.0-canary.ab12cf7a3.0","@material/elevation":"11.0.0-canary.ab12cf7a3.0","@material/typography":"11.0.0-canary.ab12cf7a3.0","@material/feature-targeting":"11.0.0-canary.ab12cf7a3.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_11.0.0-canary.ab12cf7a3.0_1612796631385_0.5586442848558233","host":"s3://npm-registry-packages"}},"11.0.0-canary.98db2c5ec.0":{"name":"@material/slider","version":"11.0.0-canary.98db2c5ec.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@11.0.0-canary.98db2c5ec.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"9352937935c0d4359496cafe50216d76b0955273","tarball":"https://registry.npmjs.org/@material/slider/-/slider-11.0.0-canary.98db2c5ec.0.tgz","fileCount":38,"integrity":"sha512-o1aifT+WH6DgObx8zXsBPbetGff5g3NcCkut5UOoqAnqONYXBKELDtSAs5N+uAkd1NQsDuM5UjlWD61WV7UL7w==","signatures":[{"sig":"MEUCIQDj8EpN/l/rSQP/a9REk+xoILRGRFJnSJsBOzuujmuFZwIga3zRmqSWVIERUXK6mStsX9/umDWFYsRdWApfggiK7Vo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":781715,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgIVoaCRA9TVsSAnZWagAAxaAP/ioyaJdE7oSXu8lPtUOW\nfrl4PPDJS1NcSmEMU10cQRjmRbeoPbzJ7lb1L+702CZwOkXMC3ay/LiBR3x6\ncTIQ2yv6/9vY03tidVeY1WHqgfCDxzEVvXDj+OUphA+zPtly+8IGs1YPooCG\nsXizOBXf9d2Inwj4zBJWN85MtPsFb/T37/s4XWfYKaSevyuClv8xhhCU0H11\nUDIKjCmSFDZwimhbINZzUK06kd6KlCWyLSSuUWOQOLWF6s8XVzFa5af/r+/T\n2xIUliXGseo90ZjbMC9IR6UKgFDn+kNOQSC07Xg9OkK8d9U/o/5TDUnV/Lyl\nODj8LZI6NvTVlsOqRK79ObGGlqyIBswMvv7DyCKRrXTGzfgXJn1E3Qfu1blu\nWY63JW1gAI9mwA/ThHgyqRjIHgILKCi1nthPQrKuc261hdyV1gtGUMPEs112\nH3XMEYtk4eODFo83WpdX3YP+fpAaNTAQv5zj4hvPQsSfKeIEMXLFP1X7XDjX\n0IjG5eRv+hZ7lqMcRRWQKo+5HeK09/knT6uF/ZIzeBQBqTKdlBHHcynbU3HM\nf8AHs8anhVzuFmBnAQgBJjii+7/fPg7MqgR8T+CWtoi9o5EE3+6lepRwN9eO\nL1Q/8bvwmEjtbcsGgyxEBfYndEAaUB1OQ2AAcR6+rR1HvLqV1XpZe9PXFgBY\n2Qy+\r\n=eB2a\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"cc1b9da2cd7b871fe0f5c8370793e0ad9b1a5f1d","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.23.2+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.23.2","dependencies":{"tslib":"^1.9.3","@material/dom":"11.0.0-canary.98db2c5ec.0","@material/rtl":"11.0.0-canary.98db2c5ec.0","@material/base":"11.0.0-canary.98db2c5ec.0","@material/theme":"11.0.0-canary.98db2c5ec.0","@material/ripple":"11.0.0-canary.98db2c5ec.0","@material/animation":"11.0.0-canary.98db2c5ec.0","@material/elevation":"11.0.0-canary.98db2c5ec.0","@material/typography":"11.0.0-canary.98db2c5ec.0","@material/feature-targeting":"11.0.0-canary.98db2c5ec.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_11.0.0-canary.98db2c5ec.0_1612798490146_0.6496875509082127","host":"s3://npm-registry-packages"}},"11.0.0-canary.1f86b9f6d.0":{"name":"@material/slider","version":"11.0.0-canary.1f86b9f6d.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@11.0.0-canary.1f86b9f6d.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"2100f382d51e4017d7580b8277ce32cafa5f94ff","tarball":"https://registry.npmjs.org/@material/slider/-/slider-11.0.0-canary.1f86b9f6d.0.tgz","fileCount":38,"integrity":"sha512-XTRKowe1XaE+F1NWmbow4cru+DJgN1yNl4BaXlU2D0UaamhzbHu1LnvFMiatlj3NmIBcqMSzBIwtZLwxHlIweA==","signatures":[{"sig":"MEUCIQDl27vcrapSULEzRLkd9TKCX4V6cHxCNQRsqxbKWPJ8hgIgToZJZkMi5Xk1dGVzcPEU0X7+1YEV8Fm+4GVctqFYV9k=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":781715,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgIXI8CRA9TVsSAnZWagAA/ZMP/AjSCQ/ToQL91BJrc6Ps\n78QE2LCCCE3yiaNr+a9JgedK8jYvZISSxYw9AelnPJQ6ed1HcVWhZF6QWQ61\nv1tqvftCXBBXLVgJ/2zTn+LBpS17SIt8Da4dVZfvH4DTmbFwE6ey+ULZvAVW\nrDaBqYx3UNXOToFEA7/r8DV3m6l56VziDg/S4gID97hKZtUCbjKk0zgmyCY4\nMXFf/BkDKweEnFt3R5lAdnNMla4IRmIiQEl1jN1N6201KrRUlFf4dGdCahC9\nNk+XmGeKN5Jyvo7A3LJqD195PWfEzZOxciOgbFqlCUmb5uHkhlQa6k3zuo9h\n1KMDLV1F/k3FzXrO/Je1vUF+vw/3iUXycvo2GNKlxi9sh5HQEpwJEITzVLrh\nVrXBVO039oy+M94rCI0hxZxzmDofbxL5e8HytweD7XWvK5vRhgmMC9tlowmG\nxYYgCUe5J8KUsUlGSskWnII17+Y8SZbecdjyCBbH8MWjKUOlFG4XrfG8raHh\nmMEiFJ83fNs69IBjHb3N7G0vrTvL4P5R5JNSl6X3uQqd4wVw25h2Pn4fCuzN\nYfvabQvxd1WyUxEqez8jLkn4RWyGWVt5+6JyYENfspwBt4Oef4Bz+YwL5kbL\n4TzE6Avx/r/Q7aUJRq+AWSkoA0ChapEqhUv176Y3iMzxk+EHt29wK+Sanqim\ntFrb\r\n=Uj5G\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"aff88a7d3786743558ecb0dabd92c225698d2b93","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.23.2+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.23.2","dependencies":{"tslib":"^1.9.3","@material/dom":"11.0.0-canary.1f86b9f6d.0","@material/rtl":"11.0.0-canary.1f86b9f6d.0","@material/base":"11.0.0-canary.1f86b9f6d.0","@material/theme":"11.0.0-canary.1f86b9f6d.0","@material/ripple":"11.0.0-canary.1f86b9f6d.0","@material/animation":"11.0.0-canary.1f86b9f6d.0","@material/elevation":"11.0.0-canary.1f86b9f6d.0","@material/typography":"11.0.0-canary.1f86b9f6d.0","@material/feature-targeting":"11.0.0-canary.1f86b9f6d.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_11.0.0-canary.1f86b9f6d.0_1612804667562_0.5200102991091078","host":"s3://npm-registry-packages"}},"11.0.0-canary.aac8f5d9a.0":{"name":"@material/slider","version":"11.0.0-canary.aac8f5d9a.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@11.0.0-canary.aac8f5d9a.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"487002c84f2e175e07643340ca9b3e3d133280de","tarball":"https://registry.npmjs.org/@material/slider/-/slider-11.0.0-canary.aac8f5d9a.0.tgz","fileCount":38,"integrity":"sha512-J5ohg4pYNlNntmttqfgTF3VA2P2YrfGg6qLeGEoTn9l0ie7QKh8pHLAo2+3DVGwlWNVYDie5RTbDCRLo4uyo6w==","signatures":[{"sig":"MEUCIQCSr6tSZCvGna5xz156TFoScnQ4m/HCdO0jKyT486ZBBwIgDUPXuahHGpC6vcLtCK0+4cAYO5iWmlqmK8cANYg1LU4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":781715,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgIXxPCRA9TVsSAnZWagAAyTUP/jXzdCGQMVaizhg1ytQO\nNNOfwMohhYIM7qJtPPfMdnBoAFeWlYYFiuLB8dNrFPHbkdJP5gCKgbpAYLr+\nf+hIQy/ONIRcmn4OnwxoFFMlKHwEuV8/Yse+rLw87Ldm3tBAOBfbcA/pXOA5\nAFFtimAdwFBNHIUmR4kPwaVV9OLeVnMLVVEbgjLjoWmNmFO8YxtHrYwp7iim\nvexluObrqqXqTOxubqFXl3qPbkC5hHOl4m+1BhFZBz0FdPZWrmu2LUA5E2Yr\nPQWxJhqhB67TybCIGyzghx4dGEyrO0tHFIS77dbiTByOuQ8NFxyw4owIRaWc\nZSo7TiwkoLTD3o3b4xnZrKMmb32v6IgexfRZZ1R5zvUbZBYVFd5Z5crHnPfc\nt8ph618+DBq7pReODZqFJm9fOWn96Np8wJ+uuFjpWNu+colj2Big3aCfPHxZ\nUT8agVIZs03bAKqINztoScYy8nnerxX/QdjwFyqJGg0ojqNgE2kaHQylAn6A\nrz+lsLLy7BeV32Rz0fV2HtENw/Tvn9lOMOgkH7Mybt2wgbnmIdLbXw3Ecsah\nb7W4im6drY9OyR3pEW9aa3RX3tabVGny5DXR09+P7c2xCTGDy/lxeVu3UH6L\n7z4gugBeagDhWXosFZAMGcoaGKaDnl6f30xb2+zW/JcyLF5q41BjMm3s+NVg\nnUxf\r\n=lUnV\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"5accfac22392cfbc1035dcad920093851b33cc79","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.23.2+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.23.2","dependencies":{"tslib":"^1.9.3","@material/dom":"11.0.0-canary.aac8f5d9a.0","@material/rtl":"11.0.0-canary.aac8f5d9a.0","@material/base":"11.0.0-canary.aac8f5d9a.0","@material/theme":"11.0.0-canary.aac8f5d9a.0","@material/ripple":"11.0.0-canary.aac8f5d9a.0","@material/animation":"11.0.0-canary.aac8f5d9a.0","@material/elevation":"11.0.0-canary.aac8f5d9a.0","@material/typography":"11.0.0-canary.aac8f5d9a.0","@material/feature-targeting":"11.0.0-canary.aac8f5d9a.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_11.0.0-canary.aac8f5d9a.0_1612807246897_0.6713419799293667","host":"s3://npm-registry-packages"}},"11.0.0-canary.750e18fc7.0":{"name":"@material/slider","version":"11.0.0-canary.750e18fc7.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@11.0.0-canary.750e18fc7.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"e59ec871f9ccd29cc89136380aae4add390cac6d","tarball":"https://registry.npmjs.org/@material/slider/-/slider-11.0.0-canary.750e18fc7.0.tgz","fileCount":38,"integrity":"sha512-GPaMELv2My48ynX5LqHZtz3PvD8I8NKOFJKy+yWcc25oIr9mCT9T4n4JVBscQXAn5kMda+H8gMmaRNo7e1QQjg==","signatures":[{"sig":"MEUCIQDeX3JCXNB0qoUz2YIVc6SGIhNhPiVxD61g7PyCaDWq0gIgUh2/GZW1XsfZe0fzz5NjzaVF4iToXVwSNeDPOm/ZTIY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":782123,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgIbAVCRA9TVsSAnZWagAA0AwP/1eKiKu0zJjuiF6VGHuf\nUAahvEnQ4Yz/ajO99BFIn5C80bzasV7H0dsCWMtoVV0ClxF1ikjqMsmFn4KC\nwq5Qg6DZHRQWNOwsfO7S3X2Nyq85dhANyFsY84EutB06Qe7cx4pHFEQ/UkP0\nYj2DEzEJw4RYTEE25h+PH2fi2RkhobguPv32xmb7/58q3FU43g64ZBDTHZ5n\nGuXOSccUT+ko220YuM86boHXi9qQ8ITwY9ltctuKrpbupeb70n9BWw17W2Oa\na83Fe+pj4JbqmhNhlm8tMCsXFen4zRurR6SvJ8eAJJOBwrxVr0mwJQFxLLbd\nuSgCziTD7ewbAiAbfv1Bm5QnXX3+6+NlUzwNW4I12hukRWxedzsOBizNt2yx\nvgja6xPF2E0Njm72yLB+KWTKHzxs2ibPAF0MuynCajbFi8+YI/lnF8QLqneS\n41aBGU7HMLO8EG0TEL7TZhiMrIHZiI3kpmB+nDxNGNfuBdtCjTEk5TPjlXRI\nYTQG4fAPo7FC2NGIR18/VvjGM6OvCi87h5PaR+h6qEPRAVLAxq7BvLK85lvg\nF+VA+ngusuv0Erb0DkbpLJYLj86mAJTib8OQkAhf5k/ZQ4R1haJIeJu0F+2Q\n1DRyV3boqONAbIWs4bQ4LiHFSGqgzFm+5vv41ni5y1kiPjtbxpnteE2sdCNU\nsPEQ\r\n=Ojo6\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"1bab3bfc895c50d4159c7b24b69d3ab3a7eb9e72","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.23.2+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.23.2","dependencies":{"tslib":"^1.9.3","@material/dom":"11.0.0-canary.750e18fc7.0","@material/rtl":"11.0.0-canary.750e18fc7.0","@material/base":"11.0.0-canary.750e18fc7.0","@material/theme":"11.0.0-canary.750e18fc7.0","@material/ripple":"11.0.0-canary.750e18fc7.0","@material/animation":"11.0.0-canary.750e18fc7.0","@material/elevation":"11.0.0-canary.750e18fc7.0","@material/typography":"11.0.0-canary.750e18fc7.0","@material/feature-targeting":"11.0.0-canary.750e18fc7.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_11.0.0-canary.750e18fc7.0_1612820501268_0.25189208244848804","host":"s3://npm-registry-packages"}},"11.0.0-canary.b62b1266d.0":{"name":"@material/slider","version":"11.0.0-canary.b62b1266d.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@11.0.0-canary.b62b1266d.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"2b9a3b148c17aea27dff424186ba2bad346036b4","tarball":"https://registry.npmjs.org/@material/slider/-/slider-11.0.0-canary.b62b1266d.0.tgz","fileCount":38,"integrity":"sha512-hlnGvRhvXDNHip20PpUHrKzL3/k8p2Z9oLu6bq2xVkpAacVYlfaSuh/lHot2ZS7aKWzxvMEgqkjaWIRMWGpx/A==","signatures":[{"sig":"MEQCIHsY3ffhCmP77aV+Uxw/G2di1CYKwKlNbeX3qhtWE/DjAiA3RwwC9oOy0fm6ObCTS2ViY/JixtIxyAEiav7lRmdd7A==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":782123,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgIwRACRA9TVsSAnZWagAAuy4P/RkzuXaVCQIa+fwrDqaG\neGwY0AO8YwpOP0Han7btXl4hjGwAO/FTq8qsE2w76bIJ9lfV+hwgYepUF+gv\nyXJuKbnya4xudBJ1BRlEmw4+WRY6jSyhDawPH5AqQegqKNyIV+1MzD8IUOba\n8iozGTXsXw8uvTidHMen9Rl/UKkFJwGz+hiwdmM4miCLm/EwHBdhePAnlRzg\n9Li68p4SFpgYjYFYfVKOIV0W7318N8khcTa6GFZpTk+TTxCz5FEaQEQ7/NxI\ne8W4IyurrD9i5cWdHybyD1J48+hYttvn3/c/fnLfaZkua3ceRWS7ovgtqIOZ\ne/RPvufZFtn+X0kMdG77QvyvPb2k3C79xPKQuaY0a47VBVuTxgcdMBtvsjpa\nrLGXLEjimM0T0mOEcNDmkJfG6n7ny+10bVZhiNY+L68J1I2Rf5I5GhXIFBtS\nOUjUPJROKxd1BTJgYqIefrU1fF4aFZGCb3RdZ73JKWtoGRUO4T8MZKDbe9Sy\nsr7J3DXoM8NaaIXqih4LCuszpJDnjL5GVdxy5BWFIQeicUphj4cS/dl/5l+H\nA76pnDzUm3pwRf4RoVqE/nzHm97AHqBc92uv1bGIdn0GBn5U2QZw2WRVDXLR\nR1FW1lCqs9Y+sR62VwZxq/zwboH8QiFmm0WKDVcvrsK9M+2DCE+CP0Xhcr0t\nTxjD\r\n=Hs5A\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"2369de5a28b7ff8c15bb5f1b2ba96320e8a9126d","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.23.2+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.23.2","dependencies":{"tslib":"^1.9.3","@material/dom":"11.0.0-canary.b62b1266d.0","@material/rtl":"11.0.0-canary.b62b1266d.0","@material/base":"11.0.0-canary.b62b1266d.0","@material/theme":"11.0.0-canary.b62b1266d.0","@material/ripple":"11.0.0-canary.b62b1266d.0","@material/animation":"11.0.0-canary.b62b1266d.0","@material/elevation":"11.0.0-canary.b62b1266d.0","@material/typography":"11.0.0-canary.b62b1266d.0","@material/feature-targeting":"11.0.0-canary.b62b1266d.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_11.0.0-canary.b62b1266d.0_1612907583451_0.6041527615036362","host":"s3://npm-registry-packages"}},"11.0.0-canary.a6b3101fb.0":{"name":"@material/slider","version":"11.0.0-canary.a6b3101fb.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@11.0.0-canary.a6b3101fb.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"18d2a932008f8aa89f1689a110727386d8ab6f59","tarball":"https://registry.npmjs.org/@material/slider/-/slider-11.0.0-canary.a6b3101fb.0.tgz","fileCount":38,"integrity":"sha512-cCmQ3HiXo/o82XyIOBVAzZ0uAhlaoQmmCAV/7t1nflucgtmSk35WNhqfEbmsMICYOFM9HRIL51Q7zguKPKPIoA==","signatures":[{"sig":"MEUCIQCGEZz3C1j+CIjormA4flq/EVKg+Ch/HUuDehyheaEJrAIgeAcSz8If4hhtx2ZLocRiRhFVlBgtK5CYhK4/JquiQcs=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":782123,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgJbr6CRA9TVsSAnZWagAAKIcP/ij15OyWP0yUOffpMCjS\nwS9OwWdFzjGoaDlfT/aPD/05HV5xprrdE08lGia5jtkzhg3femGotupy/bl1\n/EhCh+a0TLtl3g+d1qw4gsdRjDYkjO1ayVEM5SqG53JwpTOwogT+Pqtj2+P8\nP9NYmIWWPdy+5AjIZ18fMCRq3P1WJ5xxKTRnYC9EUNnoDTRnSep8oZJCJjkS\nVBihzZEe5q2DD0q2OopmvkZZIqX+mgchgSwefEaFJlAdk8II7IOtfc6cWpMB\nboRgNUmo173/S/CQ+fWyLLkniwRe9ke+/mAMNCAWRMnyjmf4TmrYwJaDHwt2\niwVmi2Vj+B0HAMx0/RaV7OVgg9QmMlxFjfqOEef9R3US4OZna9XbE7aGyXF4\nx9xQcx7nZOI+IkLJrt+5lZwoYk1B1Ms7oNpoIwUoV8jEgNaOEFgI3zDpWIfU\n953/wYEybq00pTVwCff6SfxXzcGhdYlv7PqRIBXqhBPTYKmJI4fvea8u+KWA\nBjWLuXEvaiiotWPgUtWGs7CGsgD7WMW8b1rLMYhd2a7pvGqwO9JEPfW+Csro\nVgckZ8PDN5dAkRciIYvdhoRro/2b8GOU1ZPOe16ktqNbTKox74yuZxuI5eAs\nkaH3bxjnohCeJCdZo70N29ye9Ge1xEE9ol+Iz+29IEDc2I4yjdE5Ouh4D4z+\n5e0d\r\n=IRmq\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"4e94d35f86983ae07d81d1c7893ffdfca50c2afd","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.23.2+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.23.2","dependencies":{"tslib":"^1.9.3","@material/dom":"11.0.0-canary.a6b3101fb.0","@material/rtl":"11.0.0-canary.a6b3101fb.0","@material/base":"11.0.0-canary.a6b3101fb.0","@material/theme":"11.0.0-canary.a6b3101fb.0","@material/ripple":"11.0.0-canary.a6b3101fb.0","@material/animation":"11.0.0-canary.a6b3101fb.0","@material/elevation":"11.0.0-canary.a6b3101fb.0","@material/typography":"11.0.0-canary.a6b3101fb.0","@material/feature-targeting":"11.0.0-canary.a6b3101fb.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_11.0.0-canary.a6b3101fb.0_1613085433684_0.7474552577052551","host":"s3://npm-registry-packages"}},"11.0.0-canary.ed88df700.0":{"name":"@material/slider","version":"11.0.0-canary.ed88df700.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@11.0.0-canary.ed88df700.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"2a0d521660b1000fbab9751c775b48832e2b5563","tarball":"https://registry.npmjs.org/@material/slider/-/slider-11.0.0-canary.ed88df700.0.tgz","fileCount":38,"integrity":"sha512-cKQdd1ahKuTG21hI5l1bn+T0sLO+b2a0jFs8gjpBt6eko3DZoLrllR2jmyOOeGpgATtu0r4Tix5DUp+kdiji5Q==","signatures":[{"sig":"MEUCIQDyxmPsZ9yb1+H55o42eCmKevmdQOg7/iyJK7fUXlzd7AIgJtttE9F+BR6ZV8M6fafx5tXhg/IpFQN7Rp97t2nd4SA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":782733,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgJcayCRA9TVsSAnZWagAAMlQP/iM54eIPkn9PQKOPaf4x\nAuX1MsGrpXOTsScFCFv1a/LjDY3P+Tl9OA/bUykN5WYVUWUjbbzSLYCIFN2F\nFPXMjLGOZZPagqKYT44pPu7WzBGc5R1NULGcLI8tXKigP290VRhPK4FC2dFh\nwQXBuYyJQ2GOsCezpnGGHbAA+RchpXec6/AvuiRhqqllRgWbaFGj/VTP1G2x\ngvjZHYTqpjB3K/3EsujXS30RC315tMq5yQUJNo+0/V4tohRgp/F+73K1guUg\nrINTPdWaWn4kEzi742b3g5aR5XeWhQZGXE+XWlFYMepM8Zk0Ea3iNR1z2bvS\nJIWLY9T18CINMXrLqdfxEduDfqAmQ2fYdYnM0uepJECkWKbjbszU8vinapxs\nUyTxJbMOSOsHe6X5DIdAnNLOsgbGvFCQjUNWveF5ApjgnYovTaQKVKfzEOds\nwDlckPv6M67k7gPXxAsxdtS9dfUI0bDg0U6wFgcSE7HYry2zp5JuSSM20Mf5\nfVCYiqTH8QqzNb5SDr9wR83a9jo/334+q23lAYGO4Q1RflV5eogXGgmkFl0y\njUVsijA8ten7CBeKlYemm6rda+CpBdJVZTFyVmDBXwIYLEvvNl4zJN+Dpytv\nWSpX/psGZHJXFYo6Vi3YhiF59JTAeRgFnMwxz9mgLA757sSxknqOsdnJsfDc\nI7F/\r\n=MBOk\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"9ee8b051c4fdfde9d63ea193e791d71e20094867","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.23.2+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.23.2","dependencies":{"tslib":"^1.9.3","@material/dom":"11.0.0-canary.ed88df700.0","@material/rtl":"11.0.0-canary.ed88df700.0","@material/base":"11.0.0-canary.ed88df700.0","@material/theme":"11.0.0-canary.ed88df700.0","@material/ripple":"11.0.0-canary.ed88df700.0","@material/animation":"11.0.0-canary.ed88df700.0","@material/elevation":"11.0.0-canary.ed88df700.0","@material/typography":"11.0.0-canary.ed88df700.0","@material/feature-targeting":"11.0.0-canary.ed88df700.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_11.0.0-canary.ed88df700.0_1613088434018_0.5626699556766201","host":"s3://npm-registry-packages"}},"11.0.0-canary.d30efe6b4.0":{"name":"@material/slider","version":"11.0.0-canary.d30efe6b4.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@11.0.0-canary.d30efe6b4.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"fa501d2d2d37284e568cffcea8c08abf98f7c085","tarball":"https://registry.npmjs.org/@material/slider/-/slider-11.0.0-canary.d30efe6b4.0.tgz","fileCount":38,"integrity":"sha512-LV8rQj253ePNclGD2QmjTXjvmTq0wJRizRoqGI2rnYj9PJ7TpORpolEN0QiQJOETeRilgb1iYQ7gv1cBYTcZIA==","signatures":[{"sig":"MEUCIFsn+Fi+Ypi7HDQPVgkd+ggWn68l91nlNKq+QsUqTQgoAiEA1gFnB5cL0e4gPivnU08mHlGpCjIHyM3C+NLy4/8I0Cc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":782733,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgJesHCRA9TVsSAnZWagAAzSUQAJwVNYQwMPLfLLGSbIa5\nLCWY1fqA1S2sMcMdFI7/RIQ4VWMJMITzYZrJB7xKDnpwC847MVzXfDNWkrOy\n2oHYvmZd2dv7khevrlT0y90abkPCiirsQgYUkf4l7m4TcXZe92u7FsjpA+jt\n9lkYEwjon7c3sC2W95icYsa2jb/tMc0ajTnD840clMBieCR+IfgGnkaogvGn\nNt5yFraOrXgP6F32k9WtLHZwDf+gwVRdAW5Rk9PuSuu+W421u6cS03eXGuw4\nnclhe1xuBAyvWph32yL+BUtxCRuegJPTkAnOPchNszgX4kSuAPuZX+I9bh92\nEvFDs1mPbIN/elCAgCIhhHtZiT8E60IIkWgzJurPCiod2YiiuOjd3ZAsnNUW\nPfjnOSYfaK/hBLVbN7SDWVmtxxlOM0lmtjEltDgfly4BeEVs8QGFan/+kDMP\nhXElsPm0phMmO9PtIGUfvvYzc7tmCVHPWitC68DYtTJoBhJD9F1kg22dIE+i\nBMPZYxAEktv9x4dCXZVNBDH45D4OP5hj5Q+wQSDI+ABUjhLM/ctmcUkyht8z\nNzLgz20oRktSbYQhU6wwMaKvxmqTCuU125vkl/5WpYCqAcG4yE/yuL6IRx8o\nHBfrqf9N12cUrFaojYFG4FOIHW89GimXcOiXRciLljgp6Anh4FMPsrcXK3lR\nV9/H\r\n=Yon5\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"0d2a46d4ab9ca5088511e4e0b5cf2b261e3e644f","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.23.2+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.23.2","dependencies":{"tslib":"^1.9.3","@material/dom":"11.0.0-canary.d30efe6b4.0","@material/rtl":"11.0.0-canary.d30efe6b4.0","@material/base":"11.0.0-canary.d30efe6b4.0","@material/theme":"11.0.0-canary.d30efe6b4.0","@material/ripple":"11.0.0-canary.d30efe6b4.0","@material/animation":"11.0.0-canary.d30efe6b4.0","@material/elevation":"11.0.0-canary.d30efe6b4.0","@material/typography":"11.0.0-canary.d30efe6b4.0","@material/feature-targeting":"11.0.0-canary.d30efe6b4.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_11.0.0-canary.d30efe6b4.0_1613097734504_0.09684565659416244","host":"s3://npm-registry-packages"}},"11.0.0-canary.0393bdc4b.0":{"name":"@material/slider","version":"11.0.0-canary.0393bdc4b.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@11.0.0-canary.0393bdc4b.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"651579fb29bd9b9756a593e5bf8fbaa3b9ea978e","tarball":"https://registry.npmjs.org/@material/slider/-/slider-11.0.0-canary.0393bdc4b.0.tgz","fileCount":38,"integrity":"sha512-PMvlvy0lXRski/0auD1bQ2M5eXpgCGDLW7Blb2LRwq7FfBPqCREOJlkETAQ626rJe/CpSpMYJ33+e5sq0PBxjw==","signatures":[{"sig":"MEUCIQCRNvUcaMNMjUE1lIZp7FSWkkIH8xBQENPUNtJ/ZuVeBQIgQD9ZLbFBv4Lj1A80N7VDEWocNuFgcVWzjfXhnaEGukI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":782733,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgJgSTCRA9TVsSAnZWagAAJz0QAIGcI/zHojNwIKuTQbdr\nGn08iTBg0iImBM4l7ccbQK5yVzN6stB8tTnKwEBOHCUYLgpA/dSc7q1dWwE3\nbMx9QNrWs3Kb6XGklf5j/JGnbtj8WFievGo+XJTzJ+wuCNRQWn6eVAxJ9iQn\nhDqFGXla2YmGs9D5LDoprrd+o8AV/UCDEHpQvp9+emrYcFZXAOpsVNNtcYQV\nDzObYDRtTYZH7L3yFwxgANehSrNKFuUycUhM0ucw6tCx/1gN3Xs3NDSgR43O\n6vi7B/b2YBdKz5FvEgF9Ufy6URGTcSKLx9axVzWt/2C+a/jP3S/w2jA3TwyK\nZmdIuPAS2uqYu0G3tM4CzQ3bq9eph7V1RBNKnmT5uuNBSxue2tyB/PwjlsoM\nYLakfrN5qI486A1J/e4vL5sZIC5K9rv5z3jlSmCdOsuysswGFHuNJ3e43g6y\nrxyzOdzAud7t7vw6fLyasTWvQkrWt5kSdzj8aqItf+3/9+GVXGo4GWHkAIWa\nEhP67cgQTb5o423zQCWMuhx6RHrlnCUDhlZoHHn4kktgQ0pr/CL3JvbgWKgG\n4SlbZjgW8AcqfkhVDOyjdV7ncx7w7TLNovsFAtygkqQBpmYDZygKC+KHv/G1\n0NAKez3kEi/0nE05qIw/pLByZMumseLxabT8yYNhGcza1GR4ntkFIgq69VEZ\nz8CA\r\n=QBog\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"8f241a2f549ae5b1fefdbb0c93ddadbc1e1705a6","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.23.2+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.23.2","dependencies":{"tslib":"^1.9.3","@material/dom":"11.0.0-canary.0393bdc4b.0","@material/rtl":"11.0.0-canary.0393bdc4b.0","@material/base":"11.0.0-canary.0393bdc4b.0","@material/theme":"11.0.0-canary.0393bdc4b.0","@material/ripple":"11.0.0-canary.0393bdc4b.0","@material/animation":"11.0.0-canary.0393bdc4b.0","@material/elevation":"11.0.0-canary.0393bdc4b.0","@material/typography":"11.0.0-canary.0393bdc4b.0","@material/feature-targeting":"11.0.0-canary.0393bdc4b.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_11.0.0-canary.0393bdc4b.0_1613104275226_0.9612082600246992","host":"s3://npm-registry-packages"}},"11.0.0-canary.7cd26af4d.0":{"name":"@material/slider","version":"11.0.0-canary.7cd26af4d.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@11.0.0-canary.7cd26af4d.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"7c81541721ba251108fdb4d295ebe5b640ddcb74","tarball":"https://registry.npmjs.org/@material/slider/-/slider-11.0.0-canary.7cd26af4d.0.tgz","fileCount":38,"integrity":"sha512-G+bFoUgMrcbFNp1vh5m8hjIqCEuqd+CDay2n/M8EqgWYmkYr7P8mZxEJZCg+2o1t8rOwBkwARCwYWe4sD9jg0Q==","signatures":[{"sig":"MEYCIQDGmtkiD41scpxuJGFFVPfFxK+BI4qmlQ8MDgRIiAMDrwIhAPuubRcM7j7rhgWsGsH7n9Fpmq52zLKcBnOwqVKAz/AX","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":782733,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgJqXvCRA9TVsSAnZWagAA2tUP/j75TcnUZorcJMBqbo7C\nX0EwrUco5V1FJBlO8dHhwvVqUjHTEmzC5eHg5uNejQpBWE8WIfrJl9y0WS7h\nnjUeHb1TVauYR0PtbPlUyGPyWSFZlmFouzv9hHSmKU7WGR/NkRXC2qhcNKsp\nHHWBJ/gUGPr+dPDBWhJYbyimwXwvJA+hJBFf0dpvg4+NCuhqvsa/UlMkOQx3\nBT6bOVwqgfISVcMkHcm/VghKJU8O1qj4V1Li83DMtZKCx5QMBOMs9QBJPWoq\nOFXOoM+s38TGMdWDLQngkb0Tekvuf6p7XGtJOE3tR5hgyhrU2kAr50mz17Z2\n45vpRjU3Jh1dyAE/8FQ7OJ6A5Tr51HlyjR9qAlbqzPip/vGyycUYRlMiJK7N\nuUc/KN8K4euLnZdGzNTcrezPhdpD+bdjcLviufluWfjK4C/V5S9Pxb0TSGD5\nEeDmNS8h700pEd3GiMCZSE48bkZeRAtQIGa+qKY4+l2FTxnwggEdICxldwIn\npKFgim8zvBhYNT9WdUCVTVE5Cb6jyrW2bNJqt2eRskzQHEoeqGpwDWctQSfb\nLVGViR2fuCoOTiaA+/pcCC/QYwAUT6q0gioT+0kz+sfH2QPq+VK6508NepRI\nj0R+rp+lDwQ3jtL6sm5DmrwhKXm/ZLg1Q5k8J4zVTvZm5bjMJje3p+BX20yh\n/3Z4\r\n=CDpB\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"da78e237011a9e38abc623fed26601ad22a7426d","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.23.2+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.23.2","dependencies":{"tslib":"^1.9.3","@material/dom":"11.0.0-canary.7cd26af4d.0","@material/rtl":"11.0.0-canary.7cd26af4d.0","@material/base":"11.0.0-canary.7cd26af4d.0","@material/theme":"11.0.0-canary.7cd26af4d.0","@material/ripple":"11.0.0-canary.7cd26af4d.0","@material/animation":"11.0.0-canary.7cd26af4d.0","@material/elevation":"11.0.0-canary.7cd26af4d.0","@material/typography":"11.0.0-canary.7cd26af4d.0","@material/feature-targeting":"11.0.0-canary.7cd26af4d.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_11.0.0-canary.7cd26af4d.0_1613145582436_0.6695032004276749","host":"s3://npm-registry-packages"}},"11.0.0-canary.71fe9a067.0":{"name":"@material/slider","version":"11.0.0-canary.71fe9a067.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@11.0.0-canary.71fe9a067.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"92031119276ac2a9082b75a9f8f0fd302d045441","tarball":"https://registry.npmjs.org/@material/slider/-/slider-11.0.0-canary.71fe9a067.0.tgz","fileCount":38,"integrity":"sha512-gyC4BkWL87mTyM5PSk5G1G4kH+ud8tej0SnixGBKT/18ORDLHW103JcKHWE0RF+OONoxe85LWul7lqci2DwEzg==","signatures":[{"sig":"MEQCIAWNPMJNYr8Nad7neRg/W7FXLAeX9bXYutOwaMeEjsdUAiBY3icoK1ujv3gvarIyLRPBFKTpIeFoQi6csOsFdk1HSw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":782733,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgJq1XCRA9TVsSAnZWagAAm20P/0jpo46/wLPMXONUQky5\nVYQDO+Y7D/nN96pySsi5QLHNS3d3lJGPbju+gNNsRS4GdNBhrzlKYefgWrU4\nZV5e93HbMJ7WEiI8LxMNVoJ1SVXa2O6sQFtzXYxuI28hgJZ/rGKtRmNWcOEH\nhQYRzKE7h63f10xDRnPL1Fo2Nkppa/PR7069ksHaoWUDthkpM9d6VMa30xsR\nIozfdakdRlM8sDevOYjk5LDPTmfnTVlPEN/T2aUFNsxZRwNohOEEqz0K9mYl\nrUI87uClJEDK8CEOVam36xpGfuL3PumnQp8flCUqLvyV8tZiQgq4aTjvZS5f\n9wfJa7YWtLZPypZN2n2+Owf8yAM7JjLeFfUiev4RvxLsj+2vHEFER1WnfCTC\nCilAKuEObdydRFOzxaxldL4Ha/OY1FDVQpjPSBXo4AjYgTTqWVQJ32mf1/Tm\nVxyRVMxEfyodR2qULMfCxsSg5mNyR/y+Bkmkz818CM8qzip9qGcwMukLXR5Q\nQPslj48Yz3MhzTlX0+wiYvCXefLvYGHFVzcN0FLgihp6eNnk/ni1FdY8XSRY\n5B3MsBWCg3V6ZIeI4iZYFd4NVXj14h4CFaYuhq8BJmhhBrYEoXYM+VT2SwM3\n+rZIHlmPTbk6iYV52n3YLTocDUF5W5UCoKh05smRNZsVc+tuF7Mra+5hXpN5\n6rC4\r\n=Yc6y\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"c79890da6d0bcf08c3d7c57e31df805b50394019","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.23.2+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.23.2","dependencies":{"tslib":"^1.9.3","@material/dom":"11.0.0-canary.71fe9a067.0","@material/rtl":"11.0.0-canary.71fe9a067.0","@material/base":"11.0.0-canary.71fe9a067.0","@material/theme":"11.0.0-canary.71fe9a067.0","@material/ripple":"11.0.0-canary.71fe9a067.0","@material/animation":"11.0.0-canary.71fe9a067.0","@material/elevation":"11.0.0-canary.71fe9a067.0","@material/typography":"11.0.0-canary.71fe9a067.0","@material/feature-targeting":"11.0.0-canary.71fe9a067.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_11.0.0-canary.71fe9a067.0_1613147479027_0.8653901449431902","host":"s3://npm-registry-packages"}},"11.0.0-canary.0fd56a86b.0":{"name":"@material/slider","version":"11.0.0-canary.0fd56a86b.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@11.0.0-canary.0fd56a86b.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"042090eaf2bf63113b0ceb05a17fb92f29f1fd9f","tarball":"https://registry.npmjs.org/@material/slider/-/slider-11.0.0-canary.0fd56a86b.0.tgz","fileCount":38,"integrity":"sha512-EyKZFqd2SLCB+kgsT9ASuJtNwNyzoziFZIEmxGepraPLupvMx5AHqJHbOnfCXoKSxS5hieE6oNHmaKaRKyPgvQ==","signatures":[{"sig":"MEUCIQDjIV9cvChoM1U1Ocni3CIufCoSQTob6dCOIGFzAQSAagIgMDVPwdflFupTzN0y0++ouPTw5giEyEuvfaueokulJ3g=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":782733,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgJxlVCRA9TVsSAnZWagAAVJYQAJyWC+pJbZbA2s2nwcuI\nLFiwQsuC/m2ncvfEO/6uA74eom07JUphlpKFOCfFhqpxDb051tUWW3Cnbl1x\nyDDnzLb/YuOW3hDqFz//Y0LWyF1WG+ri40UUrJUXrWszMqB5+yQ5uBZNmRIi\nw/hj0DH2kB1XlXMErnY6dIki2J0TblnKbiAaYazJwRTUVt/p8C52iVmK+ho1\n99fCXFX4xQox+OmilFAPUJbCYwU1wqBCdiOhVhf6Ot5qT2zZgFZ7LTDDOXHh\n82Ycl24IkaiVYa/B6cOgEOncFeUlZAHgpHE3jl55J+VzoKADlqRCp9Q26XY8\nUYsAN0aoMoxcmAbSCHvZDYHBkZUEs5Q2qjxYbxuYLJsItSMwkx7t6FoVfOP0\n3DE3jlJwZr61gQy9Tv1B1IoR6l93ACZxaK4QOAFB0YGw3hNktwXpyTBmecBt\nd1NjIV1Ir2HDS9hcWdy177XHWR9ea1pYxsQRgv+c0lJw5IfI5cVIzLwp1Ki5\nZRvOIgC5hh8wqgs3zhlgEah6MySSqoKwBXzUoxUmrQP7TGfuJNkh+ShZ93Vx\nVBIur3aFK4LpofhQynC9aMBR/+GP9Sycae7b3cMtePrCmDPQ4rmVzGJgk6hm\n6GnUoBJ3LDv3F03UStHBFyQncUqTUoY7bNV4b6MT0COGu0ys7hLsXnf0IKdT\nWDvQ\r\n=VU87\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"b5d7e78bfa318c864343a15754f4c5ab98160ff6","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.23.2+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.23.2","dependencies":{"tslib":"^1.9.3","@material/dom":"11.0.0-canary.0fd56a86b.0","@material/rtl":"11.0.0-canary.0fd56a86b.0","@material/base":"11.0.0-canary.0fd56a86b.0","@material/theme":"11.0.0-canary.0fd56a86b.0","@material/ripple":"11.0.0-canary.0fd56a86b.0","@material/animation":"11.0.0-canary.0fd56a86b.0","@material/elevation":"11.0.0-canary.0fd56a86b.0","@material/typography":"11.0.0-canary.0fd56a86b.0","@material/feature-targeting":"11.0.0-canary.0fd56a86b.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_11.0.0-canary.0fd56a86b.0_1613175124975_0.5103351110468566","host":"s3://npm-registry-packages"}},"11.0.0-canary.f19bbc4af.0":{"name":"@material/slider","version":"11.0.0-canary.f19bbc4af.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@11.0.0-canary.f19bbc4af.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"5bbe9c35ab844c7e6ac19ccd8cf1299076e85cb7","tarball":"https://registry.npmjs.org/@material/slider/-/slider-11.0.0-canary.f19bbc4af.0.tgz","fileCount":38,"integrity":"sha512-cK0sZE8hl18iKdMGOWpYJtr8XkuF4UwDxsJWOmTMivElZnTWxP1MD9HhgVf83bsQvF/4KUBfhN8O5C2/sfcCXQ==","signatures":[{"sig":"MEQCIHMsoc8rEq2QHMc51H7gfY9PinPkl7Y6h5P3DrpPEC1mAiA0AeIPaoS7+oiX9xKE/foO9GWvHKAwNISYWIW80k3cfw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":782899,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgLERACRA9TVsSAnZWagAA+k0P/0blfhAtYjBl3fpqShtB\nSu1/w+Qf3AaU7ilXZlt6pg3xcsxSNgpPINgbV/eJjfpX7WQ1+fmeDIOAI782\nmiB7JnDWvmzICuCvaijoJGkvm38tN23vgoWzd+b+EIRUQQZ6FP00AnGnzquc\nirLI28+dDCYY+arp4k2mV+IcgZC7e2vV2TMRZ1jAjvQtgGBPauFAuHsQu0pI\nyST1SwCI8YieC7FVeG54uhrs/9ul+WdDjtQb8LG5DOKP69qAEN9nVXeiv/XU\nfl1yuFShOXh5srdJd35htG9z1VQObkDIxOZLRorjTiha4fkR/1sRW5vF+S0A\nbPqQfZFUaBKyyR/vm2YdORDcema+M/d4t94dRH4AyOSSNzM7bdhsKGTAayPj\nqLvgHg+sUc79yvenarxzxvF0dN8BTDofXYflcU9RQB3pnDffI1Bd8GciuX+J\naHlAYpXpcisB9+pW3hTnpYeBWIzOn1YyCL0cNs2VBhFzGhvcq7yGnM1eIOmQ\nGKOm5DeqWLlOwukjjA4mIV8mEKnMSbeswdoIIoxZ51Lrfry9gb0++9cKx1YS\n8sKul4mnyxCQ/dO2IPJ+hxO47pZ8Cynv+hFsHUZgrsP1bQRRl7yxFOTvqQAp\nyzcwVKmucNU5pR9JNYC6rwr7W1es8uXVIBQ8FFz1TuFnqb50+/aNWxKI3nAk\nvgy7\r\n=KxKG\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"842729c260f5a3be9fec8618b41657a90e725af0","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.23.2+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.23.2","dependencies":{"tslib":"^1.9.3","@material/dom":"11.0.0-canary.f19bbc4af.0","@material/rtl":"11.0.0-canary.f19bbc4af.0","@material/base":"11.0.0-canary.f19bbc4af.0","@material/theme":"11.0.0-canary.f19bbc4af.0","@material/ripple":"11.0.0-canary.f19bbc4af.0","@material/animation":"11.0.0-canary.f19bbc4af.0","@material/elevation":"11.0.0-canary.f19bbc4af.0","@material/typography":"11.0.0-canary.f19bbc4af.0","@material/feature-targeting":"11.0.0-canary.f19bbc4af.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_11.0.0-canary.f19bbc4af.0_1613513791709_0.0013493774195998398","host":"s3://npm-registry-packages"}},"11.0.0-canary.f9cac96cc.0":{"name":"@material/slider","version":"11.0.0-canary.f9cac96cc.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@11.0.0-canary.f9cac96cc.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"20cbd17a2eb809030152d9f1ffd325e84f3899fd","tarball":"https://registry.npmjs.org/@material/slider/-/slider-11.0.0-canary.f9cac96cc.0.tgz","fileCount":38,"integrity":"sha512-Dh/3g7yWlx+Cpeh3QuDxV90Isk1HLhr8pe6ffyjIttkS2k6RL86GlrWfuTlPgls544oav5lWHoGWF2zOvHFkOA==","signatures":[{"sig":"MEUCIAZUwdnRMjl7I2pLJNKSn+TmEYqCmwodyVyGFSqhWmKiAiEAwnsriEyDfwc3jfOj0lzBTKrJE4x5yzAE9HtNBxcnzLI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":782899,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgLT/mCRA9TVsSAnZWagAAAp0QAJqnVAwZ0IT7v7hGp4CN\nQLMTx78Ar8CSK7MdZqbdanLBN2efKBjfk3n0yYUJN6/vnFuGXmDdTW5hLFL1\nvH8TGAWM8sikz+2ruohsp2IV14MWSelOYg4/ZT3C5HmwMxSO+elB9wZHbzT1\nlOYF9LDQYPxgHNHnEC499AflHVnZb73DIOXr0sFgBlaApit3t4OKFbJfBFwY\nOThaZJx6rELbokNzsTCb2fuT6dvuvJ9/NOcrVaYimoLL6LgVBwhQ1/ZDnoBd\npVS1SgO0ZWRYumBj0spFsEORXcvEch6JNN6w+HvX7Sq1XXGQV5wAjC+MIrq/\nSk4lma79mNoHp2sgwpID/cJmdJl0CcaHI8rBv/6sSLCQqtKmHe6EgAitCAMe\nD85Cq5JlpMjP/q6NfqLMQob8tOckkgFCv64a1PkDf8I1cqHkqoKTuOdoG6CU\npRK27OXzd+ZZrimKdkwfJ1opsXBdgpOvsXkjue4FvE16lr99cXws5Tyjnoma\nSx/OlklOI2XosmzZ2TUKJlQJKjcfuLxcPO/uKheThu1Hgcok29RgcvO2kHU1\neABY9G1udU6JBN3Tqn3YVglwpcHkfxU+oGUt4FxXDy1BcjQngACexqXSqDrm\nY8I56Q08auUejGjelWQD5XWL9MvpvS7qengVYBXH0wFSWJ4vqspHFkwD2uYd\nXO35\r\n=uy21\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"993e327235c8cd36a8c15095389eb149ada97cee","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.23.2+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.23.2","dependencies":{"tslib":"^1.9.3","@material/dom":"11.0.0-canary.f9cac96cc.0","@material/rtl":"11.0.0-canary.f9cac96cc.0","@material/base":"11.0.0-canary.f9cac96cc.0","@material/theme":"11.0.0-canary.f9cac96cc.0","@material/ripple":"11.0.0-canary.f9cac96cc.0","@material/animation":"11.0.0-canary.f9cac96cc.0","@material/elevation":"11.0.0-canary.f9cac96cc.0","@material/typography":"11.0.0-canary.f9cac96cc.0","@material/feature-targeting":"11.0.0-canary.f9cac96cc.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_11.0.0-canary.f9cac96cc.0_1613578214371_0.05784644817938922","host":"s3://npm-registry-packages"}},"11.0.0-canary.79ce0878b.0":{"name":"@material/slider","version":"11.0.0-canary.79ce0878b.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@11.0.0-canary.79ce0878b.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"212bc89440e5849f680ce3302991e54e4e50211d","tarball":"https://registry.npmjs.org/@material/slider/-/slider-11.0.0-canary.79ce0878b.0.tgz","fileCount":38,"integrity":"sha512-I6AH/t6RW8z47mQK/VReT+OuJLOa0wi66Vu3L1WUbeOdJU1Yus4r6AW0vwgWuM22hM3cRZMFHksaHc1DEw7ftg==","signatures":[{"sig":"MEUCIQCcm1GbRS0q8fdPmLY6SRL4mFkgQV/qEO1wojsLQypdGgIgOWZLt1EneOoO2Ty0cLWp6ARbaCV3idb/ai2T30VW8A4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":782899,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgLW2pCRA9TVsSAnZWagAAD60QAJsAK3K76sWAkpGzCW59\nCVFsB7IDXI/gEWZbZOznYvv2hyPNbuaolniDrUjDAKe+EsO9oMZf4usTR0x9\njL6J8x6IfNoR2N5tHD165PPtG2TWk89JOxuU4xUlzp/hkWEP4LwNIXl3qSYj\n3L29oPWJ4XN3+7jHkAv2xBu8pv/jS9dJ1e3vNjJ3Xd5jaiiWv1wMkNymwNCm\nr/cjjys1pRUH12novIV9xIk5wrcy1SrcPk3qVguIEQNfzEqhWUnlAHAYTdRT\n3d52aLq6ZPdjxaQ1XBKRd29CI+S8TN/7cl+gKKvD2eCw1iij/JUEf8tZmrXl\n92zN4Y2ZLv8fBOgG1BLmaGSs+A02DrAvohjj5KQmakejtzxw1a/2Z7Lviely\nAbjsFRHVO+yGSGspFRP/ALO55VpGkhU5/10B9no9UYRRXtf9x5mLtWzq0eoH\nboDt/xRqZxYzv4ofZOf8y/Bb88dtIVchhXW8CbFHtl00I3HTecmykL4b6VQ2\n1F+g5xYDUMWmh3+kSbStuF3xbYdKWo0/XqrNhzglF4cV1m+NdwmrCWk6+TBk\nVCiDSNm/DyOvk0lglPmrcPOhi1lSKR9pPeUWgZS4Q4m8SPXsxNrotmujo577\n2HxWsG02HTQvuxu7hmOSk0Ab51U+v0f9WdbCun2fcgZrABB8YHEHT5ZFs9SP\nbxdH\r\n=1WwR\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"3941c218ed650b1d1767cd6b17652d4e1b5f7ac9","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.23.2+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.23.2","dependencies":{"tslib":"^1.9.3","@material/dom":"11.0.0-canary.79ce0878b.0","@material/rtl":"11.0.0-canary.79ce0878b.0","@material/base":"11.0.0-canary.79ce0878b.0","@material/theme":"11.0.0-canary.79ce0878b.0","@material/ripple":"11.0.0-canary.79ce0878b.0","@material/animation":"11.0.0-canary.79ce0878b.0","@material/elevation":"11.0.0-canary.79ce0878b.0","@material/typography":"11.0.0-canary.79ce0878b.0","@material/feature-targeting":"11.0.0-canary.79ce0878b.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_11.0.0-canary.79ce0878b.0_1613589929025_0.7461214530648581","host":"s3://npm-registry-packages"}},"11.0.0-canary.d6e507b5b.0":{"name":"@material/slider","version":"11.0.0-canary.d6e507b5b.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@11.0.0-canary.d6e507b5b.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"2587aff1e23a6bf87f7f134d937ba5b3202647aa","tarball":"https://registry.npmjs.org/@material/slider/-/slider-11.0.0-canary.d6e507b5b.0.tgz","fileCount":38,"integrity":"sha512-ry/U7uNqC0zsEzhKVSnYHmgvwZ0SAOkVY72XG/gb0gE3Vh0A1tKSpP8agqXlAx8tOBxkDX6jVoGUrT8algkcQw==","signatures":[{"sig":"MEYCIQCLu6g8mWPXEDxB2tVDqV620Jmp4u+jhfLTGaVyO9sD0AIhALF6mLPY9jrFXsvoQojRrZHI2Q3K0eS1elylm1ZF6C88","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":782899,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgLXVkCRA9TVsSAnZWagAAzCcP/16nbrpWon8hqYjAxJ3+\nXqHyINO0iaGAI7nRCSFq9OHfh+N8suhjUThVp4oU6VEPAFr+OCC+cNrRYxVm\nithX3Va1AJWlSG+0vreVdE15nOus+PBDKNWMiDGJnvluZfMOAYY8yoS6hg6n\nOwLvwG99do60QXmuv7HRKjHKPsgN9dnMpgikWoj12GD8Dg11NqqfgglnDJWU\nfxN8POmG5lVNXELOid4v6nThoSjSjHHpUqRk+ej2MJFJ2RWA1MHCR9MXO6oQ\nRBrr4vppIf9N2uMeGbtWVEIv430lVV47BVHOQldwkTJ/bJQ4+ySX1bVcmrZU\n0PeMrYPqaYmPt1GtsFhoQn6SMN+xfClpPtMltv7vqQcOhpZjljEKR2ZWRMvP\nOjC6mDCb4fUsvin9Tufnaa/3wItBwjGog+eFHRU/dKWCi8HoPV5iNIa4F/0Q\nroKwOH42N+j+UnfBdR0n64KPlXMG0/10r5pIHebwXgSKWTSc2GsbuZJFMeJ7\niZlY59ODHw4slByR8JuxnhZ404T0S/CrsVc5mBBLBjSP9xEDS/kZ8ZLH9UyM\nlNB4n2a/w0GBxP2FvgEST5Pu980auCc8rFvdHu7ETSttOia8KqmVOmOFmXY9\nTf03YGdvhl/XnjMl7t4hjvwCp5HraBFP8lHv+JHN014Cy5DXBNj9xxVl7wLT\nK1VL\r\n=Fl/i\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"b20b73a4aa16995dcd0b73e46e4dc31f7914a367","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.23.2+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.23.2","dependencies":{"tslib":"^1.9.3","@material/dom":"11.0.0-canary.d6e507b5b.0","@material/rtl":"11.0.0-canary.d6e507b5b.0","@material/base":"11.0.0-canary.d6e507b5b.0","@material/theme":"11.0.0-canary.d6e507b5b.0","@material/ripple":"11.0.0-canary.d6e507b5b.0","@material/animation":"11.0.0-canary.d6e507b5b.0","@material/elevation":"11.0.0-canary.d6e507b5b.0","@material/typography":"11.0.0-canary.d6e507b5b.0","@material/feature-targeting":"11.0.0-canary.d6e507b5b.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_11.0.0-canary.d6e507b5b.0_1613591907949_0.5585316871802357","host":"s3://npm-registry-packages"}},"11.0.0-canary.f2658381b.0":{"name":"@material/slider","version":"11.0.0-canary.f2658381b.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@11.0.0-canary.f2658381b.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"bcf5a608b09a87ae2c57e18e8466d6f8f477464d","tarball":"https://registry.npmjs.org/@material/slider/-/slider-11.0.0-canary.f2658381b.0.tgz","fileCount":38,"integrity":"sha512-xQt+ozX2qaCXKWoLufMn0VAVtGZGG+f2Fe8/y/vYzNxOH+dxY+lfZ/pNAD5yx1qqIiu1JiizA9f/Hin0w8SgXw==","signatures":[{"sig":"MEQCIB2B7/3cK/NGdiYgjwIhZOwSZm3G565ibp8oZmIKyLPTAiAvpDVKKGCJMOkbfLYgdxos6pKRjj578K/Qwb9Eq/hKsw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":782899,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgLZxzCRA9TVsSAnZWagAA738P/ioV74lxq+cGd7bqeFj3\nowkXJS3l5zl0DXJ8gzdmkM/IMTotNRg/Jw44NeUnTxt5G6E51oFy7H1i5Zl9\nLQhsRnOtUVvLHwYTsBLOzRnHA0jAGrbhAht5x/c7qL0qnNojIa4YQjO68W2q\nQ+vxyNAuL6xhJK9Rpy1D8qvJ0vO1tSk//tNhqAFbp2+YHdgJBERGbGQtGYg6\nkaQ62+XBfbW/eZo7Biwebg+rimuiJArNsrfyMZ7j6ohnulB3v+1UTwJ0ZNQR\nFJtz5zPrVV7AD4sKLQYZNSwvyISCJhBdyVvvPFGYKCPTxzHVGQPz6CI3PEEV\nTL2fU5cpaCAp1aJrJ3pOuoP0o32DdSMzi2VX+YXb+9HkSJ926UeH3xtRb6rD\nCaxy2tqY4SA+/lDFBpoUjI2iTcK3NQ4NVTi3Jl+x47D+Fv6TckpVLQzrzt5C\nt0xJGnSPc8IBW4HJmJbmMHKhDQIeMKb9HTRZbelbI19F2gXnihppwqe4v6z5\ntpU0RdJ8Qo5ORb6Uor5dEybjD+AS3BiH7EIyG4v+FEfq+jUodAUWbjJYTfDS\n+GOZfC0VZYcRguhtKYHYm8IjJ0WStuN+jMZgcYie+CJWYhV7HFGc9mf/odmj\nHuWvnLst7bXWxa4gkVFLFw8Dn6Xv1UCkHrunfc0E0iGyocpUUC7CfHTlS6NP\nCzVv\r\n=S9p9\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"bb1b60f60cf9b1a4184aa52e590bcb4003d3c09b","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.23.2+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.23.2","dependencies":{"tslib":"^1.9.3","@material/dom":"11.0.0-canary.f2658381b.0","@material/rtl":"11.0.0-canary.f2658381b.0","@material/base":"11.0.0-canary.f2658381b.0","@material/theme":"11.0.0-canary.f2658381b.0","@material/ripple":"11.0.0-canary.f2658381b.0","@material/animation":"11.0.0-canary.f2658381b.0","@material/elevation":"11.0.0-canary.f2658381b.0","@material/typography":"11.0.0-canary.f2658381b.0","@material/feature-targeting":"11.0.0-canary.f2658381b.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_11.0.0-canary.f2658381b.0_1613601906341_0.5288620924509957","host":"s3://npm-registry-packages"}},"11.0.0-canary.97c4d4035.0":{"name":"@material/slider","version":"11.0.0-canary.97c4d4035.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@11.0.0-canary.97c4d4035.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"e4be40c6b690abd93fafbc837ffe0e1cb9d7ac1c","tarball":"https://registry.npmjs.org/@material/slider/-/slider-11.0.0-canary.97c4d4035.0.tgz","fileCount":38,"integrity":"sha512-vPNSvi1N1AYf6c2HF9TWxIcpRmNbENpggNCG++Rmh00/08m3EoyGxUSYoDBHOA91xy3209RU0BApT/SXX5cr1w==","signatures":[{"sig":"MEYCIQDAZoRVV51Y51lvns04Ggn7/XHC3jBG9lyBoXw//o5HuwIhAKl6WHDVpAuyxfaTUKVvZv637BpgntlYWOd7R7waWgZ9","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":782899,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgLdJtCRA9TVsSAnZWagAAQkIP/RD/EumdFaC06SoyTV6Y\nLiud2Tojhz+1SlyN38p8SjsbLhzdNCaaI+wAtUFuQRwEoK8TvldrApFntVwH\nihJGxrSrlg+6rT9bdX3b+L5jnDHVxkBp6sxGheZV4vYCPGvmhCFJuU/LoAM7\nGY9vRLo2/JEBZprbMK/qfC48Dm8mAf9N/GEen96QFu0bqEHRRAyTUzQYJM51\ndhXaQVBNZEKkl49zjwFG+/49gsmxtWFU+Ucn1JtUqZnQ+XnrgXBNxQjels25\nLPl5zgfZoBccrZhdbxT0oZx4maMubDYDFQL8hdV+UTyhwxpHPCMnuYyL++fK\nbS1ppnv1P1IbXq0WzK1Nm2Dq1Mbjn23AQhE04qmJdefUz8JHoREbedaV0HQd\n2R8i9N3iE9hvgLXO7IAuJS6PPead+BKe3VMPPQH7KocP4rFlxGiKVuAivsr/\nu+jeOJobNLDViQOF4nBYPAa/rR0iMeVq8vedKCp6muTkXrCdUlHvU7INYWAN\ndAG6QAStuBtSRF0mf4jl2UuaxruuouapbFPOrFrxfgTcCre/CkbhwxgCLlyK\nZQBkOA88vYldZybgXsU+W+zaD5MVWIqeW+ctTQrIBu7tvbs/VHGLwXQZS2ff\nGHaFmBkyzhcdaARZ0AEKPqSM2FCJDmWZBfwI25dL/1kv6PqN/Euo9eXl8qoH\nEFxI\r\n=wVxH\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"1d9a223ae17277dc00b76dbbc4263232d38e50c9","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.23.2+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.23.2","dependencies":{"tslib":"^1.9.3","@material/dom":"11.0.0-canary.97c4d4035.0","@material/rtl":"11.0.0-canary.97c4d4035.0","@material/base":"11.0.0-canary.97c4d4035.0","@material/theme":"11.0.0-canary.97c4d4035.0","@material/ripple":"11.0.0-canary.97c4d4035.0","@material/animation":"11.0.0-canary.97c4d4035.0","@material/elevation":"11.0.0-canary.97c4d4035.0","@material/typography":"11.0.0-canary.97c4d4035.0","@material/feature-targeting":"11.0.0-canary.97c4d4035.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_11.0.0-canary.97c4d4035.0_1613615724846_0.09755798855247355","host":"s3://npm-registry-packages"}},"11.0.0-canary.f5bb4648c.0":{"name":"@material/slider","version":"11.0.0-canary.f5bb4648c.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@11.0.0-canary.f5bb4648c.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"7204c376fbfab3de600b39b9ac0213a145b92e38","tarball":"https://registry.npmjs.org/@material/slider/-/slider-11.0.0-canary.f5bb4648c.0.tgz","fileCount":38,"integrity":"sha512-YxyO4hbTIFYjCT/X/TyiCE4absM3eIsQo80GGdggpnvEq3FKNwrBG4OkS3p1MKgn7EmxubkBf0b4T7WceBaoYg==","signatures":[{"sig":"MEUCIGdfPrnqf3PIwHGMOLMuINKlgKzdDvm5hIXfU/04ShA5AiEAir4Z65xZY5IkeAfzihZLAdbxv2G/Jt9g4p34A5xmHy0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":782899,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgLpBhCRA9TVsSAnZWagAAMXYQAJEV+YRP4GLqdIonq0Si\n0VjI1IZkd6P4fqUpTSJAuj8KjPga0pi9FeJMHiKIC0BE9tedmEDLyBNimxTB\nv/OxZWbw6ViWx1yyIv1jqDyeDZoNRB4jqBLJHM+6j8fTYwNcf5aVMBfhfPlk\nhYKVsWzHPktENQZs18X2q+ft+v9YJHblM8dRpaMwSuvB1wgNkYsQew4dXf9/\nygSWHPEfE2EABCyv+aGTiOcqvx8eoYXla4mykGXmb84iUKXWTepJng95Mteh\n02P5hbXevMME0Wq5xxMf0Phs522VPnVZ/x2qFwn+C4LSrsgAjstokmGprEeW\njAj0acC/Aa+VmmcOa5lI5V5tStTwpmMIk3q81NjFSsHcohywUunspfz38bXC\n7ZbnlpaYwBN8rEQ/Ayez/gvb2ywyfYQujAJjekWTkZmh3Lb9+GOSVX6nZvbt\nFy0oXvuI+RPBx8ten7eRtHaH+5LyjxB36ruVuJVChgAVXVPJy00U7XqL39DD\nDEuhNgokYd9A1Y1v8bMt+uoTpGM0RO/h5ySPvMbHLMCR8pn0dcFfmPEyVehM\nFyOFbbYGpHXkIVai4mEWYmbp4X6RjTkMaqL3tTn6K1FNpfgXcOA81Mys6UtK\n62b9OUQW6wVuw7RdjjwZ+yXkuuVHQOHmplECZw0DJhwEHy2rOMFRF8v2BQJ4\nJi1M\r\n=KH6M\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"3abc3c2f94ce48fd3a6cc689419e03b8f7769ce0","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.23.3+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.23.3","dependencies":{"tslib":"^1.9.3","@material/dom":"11.0.0-canary.f5bb4648c.0","@material/rtl":"11.0.0-canary.f5bb4648c.0","@material/base":"11.0.0-canary.f5bb4648c.0","@material/theme":"11.0.0-canary.f5bb4648c.0","@material/ripple":"11.0.0-canary.f5bb4648c.0","@material/animation":"11.0.0-canary.f5bb4648c.0","@material/elevation":"11.0.0-canary.f5bb4648c.0","@material/typography":"11.0.0-canary.f5bb4648c.0","@material/feature-targeting":"11.0.0-canary.f5bb4648c.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_11.0.0-canary.f5bb4648c.0_1613664353026_0.5429452070042897","host":"s3://npm-registry-packages"}},"11.0.0-canary.302c7a960.0":{"name":"@material/slider","version":"11.0.0-canary.302c7a960.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@11.0.0-canary.302c7a960.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"651ae3d08a5624b1a6c2c0d4c95c629fe2ba8512","tarball":"https://registry.npmjs.org/@material/slider/-/slider-11.0.0-canary.302c7a960.0.tgz","fileCount":38,"integrity":"sha512-zvNzhygxJWrPUn7HIsAsAdJp7PhGadR0nQVnRWzzZcYfN+CEsqZOIqEhnA8O5FQTGbZf+TfqjBl8uJ+3GtlhOg==","signatures":[{"sig":"MEYCIQC5eWMr2lsNFuNyXNsRoEmRfPvFRO771in4BPYbu4E5+wIhAPGKzKlvlus94W1YBsekG8JBOATR9554jf9zkfmOfPOQ","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":782899,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgLrQZCRA9TVsSAnZWagAAKhsQAJh+Wym9rX1bbRhaTYCW\nFoAu54HtITFgo+o6S5XhuCH3Aw4Ly4yahi5UZUO+BwQyhHXVVzmIsblGF/EM\nS26/AdwKyD3LO66L1vsXEe6Pcgcic/PoWtgAtmRS6RC0RWWj1qYS+xW/Lh6W\nkwfoc8hRVpkqscz0CdC/h5RS9NR9W9RH8E85KtJmHeRLQN023buFoWH/xAPc\nFIfDHwdIdVHgyxw31hISTwFfIqXJNFAdPzeqxuCoj/wLbUGjfGot9nn+sO5o\n1DdgYYPdstnoL1M6zu+kOC/LXpibrQe0smhGiP5Mg+pzDGQgzmeKfo6D6RHg\nBka5AErltbzDVpBKTrA3b76ocs+kGbf9lrbdVbs/VgHk7yAGY6YDlJxvFX59\nVHQA/VcfnSJacHC5/G9QFR0eeqWooVgrCzKbkUUR3vTRAy3vEWg4kiW7bZW5\negdTMnxjIRzb/OAGpQk8FNJWc9mQfSSvLLinnwHvI1aOuI/SnK+MS9IDuHUH\nTaJVTKfYHbEyYGb7zF6JDg+LnX6tc5ENCxD+QJfNGS8Tuw0G88o2mFE62S1r\n0qEKilZe45ogpCN5ZlrVYrT7bE3RPZYPRAsbwwl1MyxTi5WaT7EEDFEGToLp\n4qsBowrFThJg2p53AWeHL56YIULsXNG23ek4yZWyDho1wOF4iO0+BuREYrJD\ndGRa\r\n=xdHl\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"b16c4cf1d0826970ff04a72b663f1838cf8c37d0","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.23.3+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.23.3","dependencies":{"tslib":"^1.9.3","@material/dom":"11.0.0-canary.302c7a960.0","@material/rtl":"11.0.0-canary.302c7a960.0","@material/base":"11.0.0-canary.302c7a960.0","@material/theme":"11.0.0-canary.302c7a960.0","@material/ripple":"11.0.0-canary.302c7a960.0","@material/animation":"11.0.0-canary.302c7a960.0","@material/elevation":"11.0.0-canary.302c7a960.0","@material/typography":"11.0.0-canary.302c7a960.0","@material/feature-targeting":"11.0.0-canary.302c7a960.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_11.0.0-canary.302c7a960.0_1613673489983_0.4872211933815924","host":"s3://npm-registry-packages"}},"11.0.0-canary.aa0aaf026.0":{"name":"@material/slider","version":"11.0.0-canary.aa0aaf026.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@11.0.0-canary.aa0aaf026.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"b7d2e7c090d5cd5373fba8acfe8c7a1f1edabc1f","tarball":"https://registry.npmjs.org/@material/slider/-/slider-11.0.0-canary.aa0aaf026.0.tgz","fileCount":38,"integrity":"sha512-TeTHJC8WYNn8b+yZJ7dX6VZ+49K7SJiEbBeE6PbW3xJ14+50nnFEcYf1kHCVQIpN/iw3ftLXpSInOkocOlLkDg==","signatures":[{"sig":"MEYCIQDXsA+F4KnirK9E+Cs4BdQjrErVYTIUCgw+Gca2SuMslQIhAOQzSvs0gc4u70GnRc4EDtlS5y7XXU8a2Il1rhvJ7q+8","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":782899,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgLr7ECRA9TVsSAnZWagAALJUP/A1ln7ko9qb04MpM1lue\nPpJfzPYC/BA+DdlT/Dvq26UQftGMUrF/uP+rQuuD0pTTBs2gJMj6s9fTLVg7\npyUOuWPs27VfPe9mof4E9zwZtmPsaC6gbCLQv9urwzVNMroh8vEEj03hvNYv\nnmKTGyq+qkJGkSE1PxEhEbuijwfevc6afQIEFuaPlxh4swktGcvezunMZlPX\ndWrVT1TcyUmEpeDoIbEsfm9RIZ4sgab1St4FiaEnlxlV8VolQegLcgPkl+0E\n0Htpp16m1aHIH2M2IM8wUVkzZexswimmCBeMbaccHUUgXROknFiflB9qICOa\neB3dZdqozhLzlRFQVmAt9E9vJ2RNZzUcZsQeckDG6HOAtaFlX3czbSiVBnuQ\nhfDclz0jAO4MS9ePA5peu/NIVE5BW2Tg1dv9WD2Sqp3FHnizLWJzUs+bjRMK\n3wIcdqzsS6+47cClzR5nhCj88WwnEXF+lk9p08JPTvlm7krX//JOxuCNaC/2\nwGneCkQs5CVqKjZ97TIJllixWEJunJkbIGPVkVh5Bg03KWbAlJuEjltzGo3p\nJBcv7z5x7qJsGVe6NE+oA8Qyk9jBHaR3n3KruVgftPwBrl/s0waU98Gzvyl0\nZdE0dM0vr0cd0Ih7fl1te0n51MQZwLudnhWVL6o3mFdLtbJP5X4Foggr/pJp\nEJfY\r\n=jJQ3\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"de542de1d7c4c8f5f51199fe207ef527fc1265fe","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.23.3+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.23.3","dependencies":{"tslib":"^1.9.3","@material/dom":"11.0.0-canary.aa0aaf026.0","@material/rtl":"11.0.0-canary.aa0aaf026.0","@material/base":"11.0.0-canary.aa0aaf026.0","@material/theme":"11.0.0-canary.aa0aaf026.0","@material/ripple":"11.0.0-canary.aa0aaf026.0","@material/animation":"11.0.0-canary.aa0aaf026.0","@material/elevation":"11.0.0-canary.aa0aaf026.0","@material/typography":"11.0.0-canary.aa0aaf026.0","@material/feature-targeting":"11.0.0-canary.aa0aaf026.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_11.0.0-canary.aa0aaf026.0_1613676227798_0.7957499023429944","host":"s3://npm-registry-packages"}},"11.0.0-canary.07ff0c452.0":{"name":"@material/slider","version":"11.0.0-canary.07ff0c452.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@11.0.0-canary.07ff0c452.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"e7cec7c48c31f0125d340288ff0ff4fe40fbce05","tarball":"https://registry.npmjs.org/@material/slider/-/slider-11.0.0-canary.07ff0c452.0.tgz","fileCount":38,"integrity":"sha512-4RxVcLrWHZSuQUHCoGzmaZOupKH/ysImcNRW88xd+Bv94R/aSTI4Do3J4GZ9wH9+ET0Q9UGpt72OGPtYwO2Z9Q==","signatures":[{"sig":"MEYCIQCOKjwxK7ysjLgPssW2Rv2kiDLcsbk0FXV3lFWFe8vHuQIhALMTBahlyrw3unsTx7x4KJMwIVrZYg9ZuYOlkKWhjA+O","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":786003,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgLsM5CRA9TVsSAnZWagAAR5YP/iNPzIqkPFFwSBE1rezO\nUdyMcxDoL97xlfX9Zw28YE3k0tCP6+vVGyBqx6uqpdTj/nj3ylB3Afom0SeG\nQ66XplLxQuiPqDoFc7smHQJGfb9vcD9xK7pH2srsbKitikP0I85UczaVOdo2\n5w+MI8RtRjHwtmaAbcm558uQd9Q6TDrqfFGqrvn4czUHZEmtt6prUO4X3ZBr\nTrp5Uzrte+E1PHQe3GIIdrWAuV5VAzI6jOITQ0+3LqYdvm+Cqyq1WRRt/Xsh\nXPI8xL/u4s+4/go3v0Rf6uX/ikvGhLW0ZWI2BtNM6P9UK4Gnf2VrS7JP9WTk\nFue0916MLxta4WqStTuO11BIOO+Yg1FKwltCN58cFVc1CGCWtBXdl7dFjpY/\n13KLvakjd8wYV+OvARI+dDgLs3YTv7dlbOn+LfJzgdXjsvX0UQOxuH0f1zM+\nL38A3NkVzEtqfc3fv2dG9yHSDAEUnAe+hPgSuCCtF3Hs5omebycn0+1/POrt\nkbWB4M6Nx0aF9y3zVyKT1rGwzkUH4W8w+nvOV2cFx/l5Gy/5tQqZ1SbbT9np\nYYvoNIhPCqOIE/Lzqg9nQZuwgvprVUm6enhlqI53xUxev7s9kAF5gup7d5OV\n7bvMQabT8XI01pYfXCV8JFfhOtdFF/84adDWtM3ouZYHw6+FinGfD3Y9IoHX\ngC+Y\r\n=S0sV\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"52e3f1cc8fd4568a48ba4314f982d5613f53ef5b","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.23.3+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.23.3","dependencies":{"tslib":"^1.9.3","@material/dom":"11.0.0-canary.07ff0c452.0","@material/rtl":"11.0.0-canary.07ff0c452.0","@material/base":"11.0.0-canary.07ff0c452.0","@material/theme":"11.0.0-canary.07ff0c452.0","@material/ripple":"11.0.0-canary.07ff0c452.0","@material/animation":"11.0.0-canary.07ff0c452.0","@material/elevation":"11.0.0-canary.07ff0c452.0","@material/typography":"11.0.0-canary.07ff0c452.0","@material/feature-targeting":"11.0.0-canary.07ff0c452.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_11.0.0-canary.07ff0c452.0_1613677369231_0.6782504088099397","host":"s3://npm-registry-packages"}},"11.0.0-canary.bed7ecd3e.0":{"name":"@material/slider","version":"11.0.0-canary.bed7ecd3e.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@11.0.0-canary.bed7ecd3e.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"2999f366c07d0e3c76dd8ecc92d5dbe40523746d","tarball":"https://registry.npmjs.org/@material/slider/-/slider-11.0.0-canary.bed7ecd3e.0.tgz","fileCount":38,"integrity":"sha512-VQabswPKJ3QvqZv4Z2iv4JxkI23kcu1pgcg2FUJ1L9FV51S2P3I7RInIwoOTxQX4MWGyCOfX7/uwhvXot+Dkwg==","signatures":[{"sig":"MEUCIC6G4f6SkEbmf2phZTgRbsI3By70sNfv0VGO5jtbsSl+AiEAoQLu3rZF19liPzf16WvcALGm3yH36vEcQzps48aIQWY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":786003,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgLvf4CRA9TVsSAnZWagAAP1EP/Raip6AKtxnjj8DzhTEl\n+txaZaYICOigdsohNAb1LaLbheZT+TI8kf5DyRsM8Ne4hbUR7wrRkjVmU4MC\naNf8AvanzW6VqAHQwhfxfoDFjMC9goKWHGIfJadYikmCRN1oNJJSDPSzU5h5\nxxBWVth4LXAHmeXhJibuj8bOok4xymUxbkJgiLG2qupGR5Qs8e1UM7+5lcLK\nwMY9N446guCsGS1NtZkLGQ+RPHZL+ymtH7Hk/TBISrfbUQrZLwPn+FC+Wv3N\nb/R7Pyrv20099abeBJKTqkJX8boR+LtCxYwe3qX0mS3jcn80nc6g32LIarGC\nmjsotj7t0iUlpKQYuA4eTaPUBwy/I5DnLZ1gzTGk9jiMYLEw4+aBEzP6Lvyd\nJrTSE/ijIwpSuFcmCOtVXpyATRYlrnzpFUjcc1ZpSM1zHx6pFJ3NLFYK5+tx\ntwep2Q1XgKAWPkYygzlU0f9evOFoZQGkVNd0esiO/4RZ++SbjrjOXelON9HZ\nO+ziOQSJB3rLFOhzJyVzYRKINdUkor/XQQoaDPi8gfIveSrLob46itr+8FX5\nGi/JdHGQxS3KypSpkV7KeRGmw2nibMl8zzUcPPAPLeCTAyYtU4uj+mXwzKJc\nzY+uA2kmpbiA3NYjHL4KcgbmYcicareOQOqTbOoR62uaKdl1v8nbZKgxNPM1\narIu\r\n=71ij\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"c23b9ab547a5ebb36a108742217a017fed1886a5","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.23.3+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.23.3","dependencies":{"tslib":"^1.9.3","@material/dom":"11.0.0-canary.bed7ecd3e.0","@material/rtl":"11.0.0-canary.bed7ecd3e.0","@material/base":"11.0.0-canary.bed7ecd3e.0","@material/theme":"11.0.0-canary.bed7ecd3e.0","@material/ripple":"11.0.0-canary.bed7ecd3e.0","@material/animation":"11.0.0-canary.bed7ecd3e.0","@material/elevation":"11.0.0-canary.bed7ecd3e.0","@material/typography":"11.0.0-canary.bed7ecd3e.0","@material/feature-targeting":"11.0.0-canary.bed7ecd3e.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_11.0.0-canary.bed7ecd3e.0_1613690872189_0.9497971625941446","host":"s3://npm-registry-packages"}},"11.0.0-canary.06dead2d6.0":{"name":"@material/slider","version":"11.0.0-canary.06dead2d6.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@11.0.0-canary.06dead2d6.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"af356adddd26d8ce0c204d34223b1d671b897f71","tarball":"https://registry.npmjs.org/@material/slider/-/slider-11.0.0-canary.06dead2d6.0.tgz","fileCount":38,"integrity":"sha512-Fi93k48fCgPgZt/1AtwQN0TgUts06ePptNwmSEaZ9vqTp/TsnTmZqqKnpO5TY/b6xoWWjr/eZbUOcl8TpMlizA==","signatures":[{"sig":"MEUCIQDkOSDRhcDqGWQMfVb3KBNYbwM2D240P3CxNmZlfZkQzgIgUI7IfTCF+rdrmTN6RP5JcDI6GsE50sqAUcLHZnnHqgY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":786003,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgLwhBCRA9TVsSAnZWagAAilkP/ien2FX/IJeo4XAx0aF4\nKp5+ep10T08U5YxgTi/zUbs0lluknm16IDQ4EMfQoVAkQw5Nyo9qJ2Kx16W7\neTZ0bJmVMCl0uEMnRl6FkKaZcWZ74AsFYxBmOt6QdtnEdlbsFxSB/dVhbMrs\nyWznuBB/Bq+2Ldw+oa4DbwVMYtRJ9iuRNK0vmfG3wVfjMN3gb43XpKLh3eah\nCXlnLWvXj7M5JyC7B7wvlOV4yNrICR2jcQ3R31UJw9V8xMVzU9CaGeJ2ymOk\no+yx894pN8juYmx+NXGjLAn5KCTGlqO+ZIWjQ4rBHhLzOE4cv3UKyCAQMtUm\nUVw5QXwO4a5M6oiKn76dMK8XTdUeUfBHjJerOXIrgbpoY/8erpwgrBVagdV9\naYjDZ9+CTGe17QeY9S9reJiqr2nSy2R5GzmBNY1pjSIC2i2tD9GwTH/TeFfG\nOhA7TAKTFRz7QG9GtUnuSyzWReQou5LDyMxtW0GUQ5p1Hj9p44AnApJQUgbD\nxE9lCzPtSmGGBfxAb8GhB9SuM4D9b1UtT/2zFbwiZleB8H9zv9LyZGYwg4d0\nOVWOJUbKDAX+B41qz4rHQeoN9sQFejULNLy4i97qYbxKkO3z5o9DPzul86Z4\nORK7fLYwfnwFhynhIeKRtWKR231B/LpyGiLYTwSYCkYZmQwMFJWLb2cGOdo6\nwes0\r\n=Me0V\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"7458ca9f14be94c1a279bd594f262289d278bd39","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.23.3+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.23.3","dependencies":{"tslib":"^1.9.3","@material/dom":"11.0.0-canary.06dead2d6.0","@material/rtl":"11.0.0-canary.06dead2d6.0","@material/base":"11.0.0-canary.06dead2d6.0","@material/theme":"11.0.0-canary.06dead2d6.0","@material/ripple":"11.0.0-canary.06dead2d6.0","@material/animation":"11.0.0-canary.06dead2d6.0","@material/elevation":"11.0.0-canary.06dead2d6.0","@material/typography":"11.0.0-canary.06dead2d6.0","@material/feature-targeting":"11.0.0-canary.06dead2d6.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_11.0.0-canary.06dead2d6.0_1613695041386_0.9332099914033583","host":"s3://npm-registry-packages"}},"11.0.0-canary.cddb03553.0":{"name":"@material/slider","version":"11.0.0-canary.cddb03553.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@11.0.0-canary.cddb03553.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"8647eeb278cb600ce8c091deb0cc5100fe7e29f1","tarball":"https://registry.npmjs.org/@material/slider/-/slider-11.0.0-canary.cddb03553.0.tgz","fileCount":38,"integrity":"sha512-zzNKrau/HV6Yo0joqgQnCHyShqlvJoXv2r9ut7269Hg93cT865kNFEUAXsh8HICRNM7I9JH4GZWLUQDYqji5+w==","signatures":[{"sig":"MEYCIQDFrXnoZ/kM7DH7SZwrQ/+rp6ilJyjFKKFM2uPAx/u5mQIhAMYK483CtaW3BuGnvJX83s5gxis/x+M3UbOElFEQ9Clh","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":786003,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgLyzaCRA9TVsSAnZWagAAessP+wQWTpFh+EvrKMxMvvbw\nsrfN9uXrhLUfcQRWVZSZ7FU4LhqnST28yiYJwdt/6QcjuZ41rcU0zouOjSWX\ng/5iomE6F85L/SclCEWZQQ8atA1ex2jZbV+s+fPR+tHv5A/kC8R1BWPFeEti\nzxFdlvUh3k9f3E0RRW1Abci2mc7j0wY2R6BTU8l2mdQWgwZelFR1a56r3P2W\n7zUI9ceHQKPUMQ4F/AZHA1u6UrkPFekZmV8reF5HkYMRYH5gCTSPOI5geGW2\nzrBaxq4bhnQS/ld8ymGx4XgbeXanHhjK46Pnl8rs6Jyh9Kd11b5GiFVx9+Vw\nVy8XAcjjB+tqsGBaEFy8F6r9E2O2P6o1Kfah8FfZ5a/ac8JLTZiVCvOQhmUx\nWbae/12tFdtabb/aRlXPqjflq7B3s2bkvJR1NQ3j6KOcMVShr5KBjAeiG9Om\nkc5SFD/zVQYqzTWUXNAf017p69TH1cRHvqCWSph/Nmuf7SnCCzFLYlBWe7NJ\nkE0jNP+Ww6rYCGJIyzS6Oo7hHMP0ozeLauv/AFCTBpe29u4q6cFhLeLjIy/1\n0+774TNCTxPvp6qaSPAYR2p8psyUoBu2r2vIAK4tLwD80z6n2tK4ruu5SZWJ\nXU/8Uit1WLRDaAIgTSlkIfZ2EouC9Nm8+iu/aTDoGUQKIUcc982Lh5892Gj0\niSO9\r\n=ay8D\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"a8deff13e5978e42ae51f60c844f7ca0abf64b45","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.23.3+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.23.3","dependencies":{"tslib":"^1.9.3","@material/dom":"11.0.0-canary.cddb03553.0","@material/rtl":"11.0.0-canary.cddb03553.0","@material/base":"11.0.0-canary.cddb03553.0","@material/theme":"11.0.0-canary.cddb03553.0","@material/ripple":"11.0.0-canary.cddb03553.0","@material/animation":"11.0.0-canary.cddb03553.0","@material/elevation":"11.0.0-canary.cddb03553.0","@material/typography":"11.0.0-canary.cddb03553.0","@material/feature-targeting":"11.0.0-canary.cddb03553.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_11.0.0-canary.cddb03553.0_1613704410310_0.2540062247792383","host":"s3://npm-registry-packages"}},"11.0.0-canary.d6d8d0476.0":{"name":"@material/slider","version":"11.0.0-canary.d6d8d0476.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@11.0.0-canary.d6d8d0476.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"3cfe2f7693739c34a9cae7f9296d685805cb26cf","tarball":"https://registry.npmjs.org/@material/slider/-/slider-11.0.0-canary.d6d8d0476.0.tgz","fileCount":38,"integrity":"sha512-I5RpBfIfOvn6ycS8LXio3SN/3GghhvjGCOgT13Sf46KGklmFm1Yaf7i9urPA/y1jwlj9a2CA2F6mINu49c9pRA==","signatures":[{"sig":"MEYCIQC8d5PoALWD7twi4hAIL8lxVH6Yf5kAqhuxZp0D1okUfgIhAI6Yag+flav/QJOUzWl6nDOGo7YfwHzBiNgoSj7e7/oj","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":786003,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgL053CRA9TVsSAnZWagAAmEQP/2jI9/QJJHb6Q6uNzEhu\njPpgP2QJ9P4i9gw/MykOx44p4lyWxT8QAniBI6/jIv0jgJtlcVPXDtFfAwi2\nH6KS7NU8aUYz3MPvEuVO4WVrfzwKi0uTvT2qoGdJj+2Z/F5qgkYEQCeS5KOT\n0JyEGhyzaSaZzGfcVwj3nlyW8CE8Pd2bWaU0M0hl3d/FQ4RWxugWaY1+PQ2B\nad+1czv4Sglja0XuEPs3JdZ6aNgJ37uMD0+bZFFnQlKD8PxAWvZCcTJDE0yU\nuDGEBrRPebN3UrxyLGCuAoilllmbwU+xbVaWJEdLK3rZpXeeogCCB4WOEh9d\ni0lRZAsBX+SSKT+s4mzJ7Zec9t4RvkYW9MRjy1P/ypf0sxShCbyAsf67zShe\nc6RHI+MvOeujRkm4GxyhV8+2mZIVHOWyXVUh/ixSN+uUPk2wz4b1zfTR2FqF\nRig7UlwGhV8OIz3WvtS9TxP1Nmki00HjpXBQcYTnOJe5Z2Sm3fzFKUEL5Kes\no7WkPBAhYimdKX957mqmrjwuaeWgofO86opWxoGdKApstZQG90YR9ZfxKV8N\nVAojqDATnqIkTUg0gj8APFFFIf3IfkSUYZO6NFkyR5P8+pkKzOVXtroOe6D6\nhIJalqZkzOGHab0Zv74TxbA72ft5jqRWlFgqd/Hl1M+ZKk7wtP4XXQ3AwzjM\nagyH\r\n=A/u7\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"17aa6317e2c1a8109a8bae34e962d438f170f811","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.23.3+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.23.3","dependencies":{"tslib":"^1.9.3","@material/dom":"11.0.0-canary.d6d8d0476.0","@material/rtl":"11.0.0-canary.d6d8d0476.0","@material/base":"11.0.0-canary.d6d8d0476.0","@material/theme":"11.0.0-canary.d6d8d0476.0","@material/ripple":"11.0.0-canary.d6d8d0476.0","@material/animation":"11.0.0-canary.d6d8d0476.0","@material/elevation":"11.0.0-canary.d6d8d0476.0","@material/typography":"11.0.0-canary.d6d8d0476.0","@material/feature-targeting":"11.0.0-canary.d6d8d0476.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_11.0.0-canary.d6d8d0476.0_1613713014841_0.698530459901326","host":"s3://npm-registry-packages"}},"11.0.0-canary.0b4a4b2eb.0":{"name":"@material/slider","version":"11.0.0-canary.0b4a4b2eb.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@11.0.0-canary.0b4a4b2eb.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"719d2dfee7d9a8f0a1ad8f7de5b452faa62dcbb8","tarball":"https://registry.npmjs.org/@material/slider/-/slider-11.0.0-canary.0b4a4b2eb.0.tgz","fileCount":38,"integrity":"sha512-33HQNDNmAyXGWchntoOMx2aFicPlHvCxqIL329YhmdqaGdHc0rcKYe+HAAIe6KLGBeRS+8KBR3wZSgnXvTQArA==","signatures":[{"sig":"MEUCIQDUqMGXqOS2emlah9YvokCn2Mt5R8rg9c23wPy+a5lIJwIgSH8dF1plXKOAw6mEedACyCZnhKADeb3n2A38JoDXekE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":786003,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgL905CRA9TVsSAnZWagAAY24P/3tW1YmgQ7qB+PSeiAhb\nMgCQEU6V7qNt7HEkeB7OlNhCMbZYy7wEpoBUc8XHWCmmyR6FAaKdtNnIrQf2\n8XJt/tAg6QmS6jAptBwn5N2wsB7HEVZowvzpGVKZooDCnhNvw7BRedDldyDy\nYpWb4D6fAcQB1OMvCpxgpAHxjbZeGglOlWhZLBIwZCmRncGSX4SOOGSBv/ln\nj8hURzqiQ4X3JJt1f0QCMzJL/WacaFmpBc4Z+xoDmGUTFLjPGCprqRVNtgUn\nf86ybvm1VAv8clz8H/ixlYSLnuukFRP95QF9yfWd0aiycCcLm6E/dgXwUoQc\nBxWNiIIJ3dBc1rJnsUpn7eUIWaYJBNiFBS7NX508QOFdzZ8EWz3oinBkGhus\n4Sq1UfoF2bb0Ct3bv76pbU+1vSJPs3sm66h9C41Orlch4lEEsJ+HRAvQxK6g\nWup55NTme/yxFfxVySZYKnQDrh3CRPJvrcOqRAIhWqThKirmp/Qm01Fpi/Iz\nkazrEfjrusqpEOEJ2inLOLxyeJ0s6kFkL/19WZtToWhbk8dG6xeBVWpbEVu4\nnryhi3Ox5QSTrodWkK6qt7WSq3O1HCYDc00cwF2rzReRnBl/0b4gP7k/TOCq\n83FsuLy30Oya/yB+rco/dnI4JEC5rUr/puf83LLxmfkR6g5ObtRKKExK1yH1\nNJV+\r\n=fslU\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"d96f438a60c2d44b9a3f9ec055d1dad78d316e6c","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.23.3+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.23.3","dependencies":{"tslib":"^1.9.3","@material/dom":"11.0.0-canary.0b4a4b2eb.0","@material/rtl":"11.0.0-canary.0b4a4b2eb.0","@material/base":"11.0.0-canary.0b4a4b2eb.0","@material/theme":"11.0.0-canary.0b4a4b2eb.0","@material/ripple":"11.0.0-canary.0b4a4b2eb.0","@material/animation":"11.0.0-canary.0b4a4b2eb.0","@material/elevation":"11.0.0-canary.0b4a4b2eb.0","@material/typography":"11.0.0-canary.0b4a4b2eb.0","@material/feature-targeting":"11.0.0-canary.0b4a4b2eb.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_11.0.0-canary.0b4a4b2eb.0_1613749561169_0.6082006948214094","host":"s3://npm-registry-packages"}},"11.0.0-canary.3201cae47.0":{"name":"@material/slider","version":"11.0.0-canary.3201cae47.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@11.0.0-canary.3201cae47.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"e8a46e1f802d37a27bf3782ddba5a7a82355afd1","tarball":"https://registry.npmjs.org/@material/slider/-/slider-11.0.0-canary.3201cae47.0.tgz","fileCount":38,"integrity":"sha512-/9jbhhO6sTH+THaHPEacBIpJ7h8Cz2AKeolGmVv9A/CG3SvXyloB8l1hjb9PM3yvGZRkz/6zd4KS6sfTXp4Eig==","signatures":[{"sig":"MEUCICtBYtfk9e5Y/R5ogcGy8K/U5N0MRubLeuXM5KjoQ+pdAiEAyxzWHb+ITlsi9gX5l1A35AQKQ4nxcOqkpvXwp/aPevA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":786003,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgMEMtCRA9TVsSAnZWagAAp2sP/1AJPliRA0Tprpkpo+/G\nFfxL9+UrUbBif2K+8vMF3sn9huldKHTOubChU2XtBof6+61bB5txr1DDYkoT\nSJ5E90L30fnJ7368W8xVQ5dEItjcIdz+6CbTUqsJFZInEzh/ws3qKFQMwexw\n7BOK85fu8CulrPXcyXeBM40R6tGBXu3H3yiIMOZJvUCrtDVnbK/ygKJDgl3e\nJ/FO5jVFmtQMKU2gIWg65m4u/MTeFC6B7GTwHzqtBZAb4NuRCZ0loGMAFgYB\nc/1Opw3BsGdnNggOldR+YWh59LEy1C47lo7Q4Vc/GKYviAnrqeuHd1Lv/R1T\nKnURpLcLksfR9k+7vczlxbJNYf1yURWo+gu3ed/D4ErSzKtTneI8d95xIGRb\nBqRthtKvJV+GcRRy+o5zaxFx5YHU8DCNcy582+5k0M47GSzBZcRVJ4SG3DKT\nAYaj0+jonV9DPzNMFRwqU6WsVqujFY7ep4YQZFktIMFyMNb2RGMYrIaLwUF6\ngMb8H7+SUMtsYvkkpTlhk2hyit7do1Ci+u0JB2dep3/yZPxJrzx12eFvF+pT\nsxEjpzTcSA0mGXenp34q/wcWwKk/obG6nN1iB2kUzLp+g0Q6AcsF5TUoxdar\niXWvsPvrX9+Tk/PklSAFqyO7VWj7ioTvMQqZViNsNa+6YDmhHcod2ernbkm0\noB1l\r\n=TzV5\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"274d3ca7227bee74ffff3d46ddf3ae266226bca7","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.23.3+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.23.3","dependencies":{"tslib":"^1.9.3","@material/dom":"11.0.0-canary.3201cae47.0","@material/rtl":"11.0.0-canary.3201cae47.0","@material/base":"11.0.0-canary.3201cae47.0","@material/theme":"11.0.0-canary.3201cae47.0","@material/ripple":"11.0.0-canary.3201cae47.0","@material/animation":"11.0.0-canary.3201cae47.0","@material/elevation":"11.0.0-canary.3201cae47.0","@material/typography":"11.0.0-canary.3201cae47.0","@material/feature-targeting":"11.0.0-canary.3201cae47.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_11.0.0-canary.3201cae47.0_1613775660746_0.6191646812743961","host":"s3://npm-registry-packages"}},"11.0.0-canary.f1b1fd5d3.0":{"name":"@material/slider","version":"11.0.0-canary.f1b1fd5d3.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@11.0.0-canary.f1b1fd5d3.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"4e0d5794a7fa890c33075a31f9c0a9d94994ab1e","tarball":"https://registry.npmjs.org/@material/slider/-/slider-11.0.0-canary.f1b1fd5d3.0.tgz","fileCount":38,"integrity":"sha512-QMzcFZrtvsYIKcUuyPVG0+raJRBay9zFESPDa+UmDcjlr4nh8WSV6JriS+gwuVRpPX1fQu5D4juTH96i827xCw==","signatures":[{"sig":"MEUCIQCvTtVUZjChtYTcai6KnO0afDGETFmsYwyJ08jutwy6NQIgJj3Hj+jAM53Jdha4LB+7jTYbTSy79z4xIUcUC0NZZmQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":786003,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgNArbCRA9TVsSAnZWagAAitoQAIfAzwsEqZaSpfIEduMT\nSRgJaNS6nQa/XWhJJCu2D+5YgGskpgqEv4zOtHJOwBxzm2d+MtVKTvega3fh\nUjZWfPDxzDCJsoMrpPOTiXpbEzF0rtrtuklBLKzYNnhM0NK1frADg8/F+402\n4KE/R5fq4vVTa/Qch5IoTMaSo3Q2IPl2IDW/a/6Z30dXc7HMz+usuwGQcZm/\nMfRrmgWoQtNQPF9RdUv55vCyaxC7room2rWlrAuTckZLcuFOqKK6nmCA+vAc\ntjbtg/LxZRBNpj9pUnMiH+t+NRj/UaWNM7OujSHr0/icCmtL772HFvos5xyU\nLw9zwVwVrAVsOKRZB1bi5lKnVQYOLOkdthDIuKOP++haeKIQMD+Iu6OSRHxS\nMqC1WbYydv0gKTjTQ2KlyxIyKI4hf/Xtp6WnSt7fZWVCGXkFpF6IwF6zJRDo\ngTeo7Vjg9vValCoUJ21sUSxDxTTknD5ZwIGeIMbZHyOW5Dd9zjgsNfiXNTSI\n6JxCBc/o/IBqpuaB45xGSZs0Q7yDJVxawucpFVSFTs2d76tRULDaRt4V6WOX\nACpUvC9hWrFEdzz7ozgp/aDBZaz/4eU9UlJNPO1bfcTkkZKp7C5WcmpVlhd2\ncDowN5tEWXptAQWkXBrkfKBN1fIaXw0prYhFKLQnErb6m2eezVr91K241VIO\nYGqZ\r\n=ly0z\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"b73a5cc3b15b450664de92ee70312cc1e8b17304","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.23.3+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.23.3","dependencies":{"tslib":"^1.9.3","@material/dom":"11.0.0-canary.f1b1fd5d3.0","@material/rtl":"11.0.0-canary.f1b1fd5d3.0","@material/base":"11.0.0-canary.f1b1fd5d3.0","@material/theme":"11.0.0-canary.f1b1fd5d3.0","@material/ripple":"11.0.0-canary.f1b1fd5d3.0","@material/animation":"11.0.0-canary.f1b1fd5d3.0","@material/elevation":"11.0.0-canary.f1b1fd5d3.0","@material/typography":"11.0.0-canary.f1b1fd5d3.0","@material/feature-targeting":"11.0.0-canary.f1b1fd5d3.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_11.0.0-canary.f1b1fd5d3.0_1614023386725_0.6134198415320031","host":"s3://npm-registry-packages"}},"11.0.0-canary.7899e0fe0.0":{"name":"@material/slider","version":"11.0.0-canary.7899e0fe0.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@11.0.0-canary.7899e0fe0.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"94f54c58833186004c7e8dc65d4840535d9f4e69","tarball":"https://registry.npmjs.org/@material/slider/-/slider-11.0.0-canary.7899e0fe0.0.tgz","fileCount":38,"integrity":"sha512-xTUFyFM0zmp1CEIQWcKcNCtLKJzfHgfCge100htCrcOhKXlSVwpQ7grM0xnnR2Cc3NJR7mx2jFWVmQpO4dYZZQ==","signatures":[{"sig":"MEYCIQClYySEnBBjlE1mSypWB767+z1NVwrTdqjW2ErcADvyiQIhAJ7Hcm8POgjRdKNe6vKamVcBbkD0BjLE7RBtSX6HmK6J","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":786003,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgNDQ2CRA9TVsSAnZWagAAfvcP/0+nWJaLlsKCOFR2gH+8\nWEsK6A2bkRTlVvihBeUEOccEg/VYh2M2MAVwhf5L+n6FzCsOitZIlHsl9+FP\n23fUTtzeTZgOmcTQShmk1e5RCcSDZbllZJyg29auM40zKc7bW76yXxH3+PXI\niG95jMMbK2kdMxAVLfW+PVt//sKESud0LCfY40pWSgQAOiz4lp3Sbep5iB5J\nFruz0hN4lKuQXfMIyYXKywE1zofwcWcFyLMEuQUv4ZbE2eC8MRAuyBvnm8on\nSX4CUCIpDj/h8IkT39CbZ3PCVWDltVQtZwH0q/LOh5U1JdrWqmq0n8FQ2lRq\nPuXF1pQPa87BKh2liJTBDymXGiufdyyoiHFTZRgms5oTNRAzRZxCvC0Ji0kO\nbOyX4491LnY8vXXX1fulI4U6t6ezvrx9kkynaUujKXoHRqG0NwFjw85e1nqa\nnwgWkbFne4Wdt9YAr1LERvdk1LVZBlzFahITE923j5HxIKQi3naN6iLdXe7o\niOQpCkA8WxAs6eGfRMaV2bpxVwCJzxvAwjCoFuFG+1+Pl+EpvtaKGBmuk/fb\npl/Emi/CmldZTDer+I6pAjfWhfi20gTfCW+VBryNNFgbIQ32nBH6XU2Fsesj\nd60RZnRlfaFTLuu/TztX0vttrF0m5bkfkLTP7jxJYT6jC7G3J/EDE6li/5JK\nyK5C\r\n=ernY\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"73b260d2233a31311cff76e4c10438913b91c2ea","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.23.3+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.23.3","dependencies":{"tslib":"^1.9.3","@material/dom":"11.0.0-canary.7899e0fe0.0","@material/rtl":"11.0.0-canary.7899e0fe0.0","@material/base":"11.0.0-canary.7899e0fe0.0","@material/theme":"11.0.0-canary.7899e0fe0.0","@material/ripple":"11.0.0-canary.7899e0fe0.0","@material/animation":"11.0.0-canary.7899e0fe0.0","@material/elevation":"11.0.0-canary.7899e0fe0.0","@material/typography":"11.0.0-canary.7899e0fe0.0","@material/feature-targeting":"11.0.0-canary.7899e0fe0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_11.0.0-canary.7899e0fe0.0_1614033973571_0.9861183763347225","host":"s3://npm-registry-packages"}},"11.0.0-canary.f19c86d13.0":{"name":"@material/slider","version":"11.0.0-canary.f19c86d13.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@11.0.0-canary.f19c86d13.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"bfab63a9b51a99daca0c771f7eacab8e6d5d0a8a","tarball":"https://registry.npmjs.org/@material/slider/-/slider-11.0.0-canary.f19c86d13.0.tgz","fileCount":38,"integrity":"sha512-xftkJZLVyZTXPyXevqNGvTocXQudvhhNzM+iCk3k8IWZ4ZBAaqeMau6WMjDLNwNnAGhxNL5YrG8y93/aeJt8fQ==","signatures":[{"sig":"MEUCIQDfciObcPm4FCs4f4Cx1NDKWui18xRzihTeWQloTx0TjwIgYOsj1nAD2vMmktzx2kCQDOE/IyqhkrxbgHqdlil7p9Y=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":786981,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgND6xCRA9TVsSAnZWagAAxOAP/1UsQvXFyS3Xu8dYSfr+\nAUjOsAgCn7JirqZtTAYhMM+VENtA8gJND1HKM/1hyYeIyVhPFqyCguqSZnYi\nSUDhsTuo4xpvduDQ9W7pDOIjwdt/08TyTVHIkxQqC8aynUvb/RQ7g+mz7R0H\nAD1lG+56E2TwCG3jaXHf4GPlULbM2s5tEh3tXulHLj+uAP1qBI8mSO8AFvFk\nNnqvFUrYFb/uqlQlxWHXVpyNiPP8cmzFFerVO4YU44I2aXua0Sv9rpUT/70e\nPPLbR1YmYibQLztknU21oN0G2UHdYpKEe3fqu9DfaM83gnSdNsGybw8y4wiK\nmPh/YaUFR8gN0HI6fnZ366iuNjIle0Eo3zxDBqOKWDIuuhlfo3gTdYGFojEk\nPg1XJ0rOICyhS0XvtoRbCVjtdh6mG0a1XXDbjYfgvD0CyQ8SvaKQXCn7HRio\n9jMmkYfsl3DcJaHtng3q/i+VNc9uoWECXD3maDFLlXNT86Z2FvzkJ/ZZVBiC\n8tQpwaQlf9O07r9be5GslRaJBCZFt5x53AeG7kyl3M9KJTo4HR14tv/j35XB\nfNHfUhxDk//3QpPlfMWu72WTipwE/V/bRc2eSdsZewe5oOAveL2DsEdLr2T1\n63v5TW4DZT3Dd2MTaHI4sdX0eQLqRu0j6wInZNZvcVHqF8e2KjACaxj4S8Ch\nXpAe\r\n=iOmO\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"a4b2b851fa6f3895a9e915d4bdc5b6b6715a4260","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.23.3+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.23.3","dependencies":{"tslib":"^1.9.3","@material/dom":"11.0.0-canary.f19c86d13.0","@material/rtl":"11.0.0-canary.f19c86d13.0","@material/base":"11.0.0-canary.f19c86d13.0","@material/theme":"11.0.0-canary.f19c86d13.0","@material/ripple":"11.0.0-canary.f19c86d13.0","@material/animation":"11.0.0-canary.f19c86d13.0","@material/elevation":"11.0.0-canary.f19c86d13.0","@material/typography":"11.0.0-canary.f19c86d13.0","@material/feature-targeting":"11.0.0-canary.f19c86d13.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_11.0.0-canary.f19c86d13.0_1614036656938_0.8633258971720454","host":"s3://npm-registry-packages"}},"11.0.0-canary.60e892d79.0":{"name":"@material/slider","version":"11.0.0-canary.60e892d79.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@11.0.0-canary.60e892d79.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"a63cb3c1ec1745d7bd15e5e4814aff738910a386","tarball":"https://registry.npmjs.org/@material/slider/-/slider-11.0.0-canary.60e892d79.0.tgz","fileCount":38,"integrity":"sha512-JIWOzbk+SXEcYIFMpNylawOetIWHQrX57E7tagyyRoB56hmdOcQup7Q0wAqZvhYRR/HCTrtR4Gi+R0rSoPicqg==","signatures":[{"sig":"MEYCIQCl8nYEjTkmetAHuOHOouweO6WzvGillHok6dZ3Pw+rFAIhALQOj3Eo31YlOUvSsaISHFxjQqE13MK6Faw7P+6qX28T","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":786981,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgNFbvCRA9TVsSAnZWagAAPIMP/3jlmQWnTtISvA4mVac8\nAiCpuBXWVUUwSgjPiVbm2v8AMEY+VXDrMD9bUZxcVqWiAQoaYQxfMvZ7sxNY\nseB2Ot6NiyJDJRSdEjEnmYD/TfpPBN4EEbP5BgpH4WZ40dLWAarXiRdJRMyS\nA5ZxEiik968Etq5chs4ufv/Smynby1iIBPrYXY20Bkh/8SmuyhobkNNsTRYt\npBG6UJQ3aYxHIqFi0k8MDIFrQAu8QMaLMpIAOYJTaxPGBVXVeo3suGYcQC2N\nevDsRWGFsHpIA9RA0ZyxpDXJpAdQy2gQwwKdUMnfqfOEEvEQjlogWguYOHI2\nXIX5+sIogGSw5jLUb0DqD1jqnbXpowyFhC+Cbi9KDzEgzcvvlpHQjdwwrzzO\nIsLWL848I51c9RgTCsgXOArZgNH6ScSR1BheZacXZlwaLgk7XHUDVVFEZAOk\nOJ2jLyISTJ4H+6nFPxkcDOzQyYYIt9PHZXNEsXu6Acgd+X8+KiLir91DFd+i\nOGtzJjCqLXbESzppnad1J+4KFSvvt27iXVuz/u1xqBnrz13aTsEO8pU7IRR4\nFGC1GkJVcptV0LMvq1Fv10GP7tOvG1ahX5ti2bFGbCGnXqLzAOVBr7XtnZBt\no6QSutgEc0vw7lZ5gYGwiRe+wzlohtMoI60zjAP/h4lcqZ0w8MF28JCvAQVy\nM9O9\r\n=dnrO\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"c94f9f392484897a962a9b7101ddc6d70e5df67e","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.23.3+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.23.3","dependencies":{"tslib":"^1.9.3","@material/dom":"11.0.0-canary.60e892d79.0","@material/rtl":"11.0.0-canary.60e892d79.0","@material/base":"11.0.0-canary.60e892d79.0","@material/theme":"11.0.0-canary.60e892d79.0","@material/ripple":"11.0.0-canary.60e892d79.0","@material/animation":"11.0.0-canary.60e892d79.0","@material/elevation":"11.0.0-canary.60e892d79.0","@material/typography":"11.0.0-canary.60e892d79.0","@material/feature-targeting":"11.0.0-canary.60e892d79.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_11.0.0-canary.60e892d79.0_1614042863430_0.1482177698692193","host":"s3://npm-registry-packages"}},"11.0.0-canary.c96bfa495.0":{"name":"@material/slider","version":"11.0.0-canary.c96bfa495.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@11.0.0-canary.c96bfa495.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"49f2e41cf5c8b3703537132e82492c82b9015d3c","tarball":"https://registry.npmjs.org/@material/slider/-/slider-11.0.0-canary.c96bfa495.0.tgz","fileCount":38,"integrity":"sha512-16eEFznx4y7N8lHgxmjwtx+Bs+b5vIij4gmcVzDFk0YVyQK8tvfVPPjd/gDE9RoNTE0pT980hieujy94K8s3pw==","signatures":[{"sig":"MEYCIQDBkMVlY2QVC7Tfq1VESJMxUEYAIp+1cn8xi2JyatSNRgIhAMBIoZP5Mt7UbbUJc9FQ6aI3bvcK7vphze+6ng1LtbUr","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":786981,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgNVh7CRA9TVsSAnZWagAAuHUQAJCm1zwB4dt3p4T7rAov\nu/9C017T7XnHg5ucA7SR+lUR0jpwlXZy79O9AMSc+YGJzj23+1RNVIzDIzEh\nO4IxQ9yKvJ6HHaeNpKlseZODAiEwIc5Fk0SVuIHuHBbEIt9n1U8mEGKuNv98\nPE2ginPdXMrsx5Vp2/0ZRvjHKMEHEOzKXveuuUvkMnedLqO8u5PRAqY0QYYg\npM+LnpDm2ffFOcl8h2D+0avJOD3ggC4K1hbUSYAHo7/NGK2agcunPuZc1cb0\neylBqWdaxneQ3UwIN8uqriyJQwvcUNh9/MdObX2VAYisKlEMmSTTamv5B65H\n97VmHTwD7uqrQPH8Gh/WERn+48k5lEnMtA778fF531FGWs25SkI7TstkbDHq\nUDtQ2EORCIewwWsCHCIv6TsvqzZ6C9S8o1VGL313RsCtIY9K70ec5/Y/hni9\nlEfaLDQ4U8S0oT38zKhxdPkkWmoiF8n4DjP5mYVHyUrbgOSwOGHQlgmnNih7\nvte9Pu229XM24/kpchaOgQ13YI0uCdww2W94vVODRA0ezlsox+3Dn+UJD8jb\ntYiRT6oR+O8iEzDuHuJFm31f07ajQxJ3io8fy3dB++P4zmlTbekelPsI+10x\npzqzSc9RYJyC2qDQ3XzlXxlYvqtutadIVUi4zE95krf8bT92S+8J2jebVNi8\nQjpx\r\n=Jwc1\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"1fd35f98370bc606c6677b7045a8acf16c0ea7a1","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.23.3+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.23.3","dependencies":{"tslib":"^1.9.3","@material/dom":"11.0.0-canary.c96bfa495.0","@material/rtl":"11.0.0-canary.c96bfa495.0","@material/base":"11.0.0-canary.c96bfa495.0","@material/theme":"11.0.0-canary.c96bfa495.0","@material/ripple":"11.0.0-canary.c96bfa495.0","@material/animation":"11.0.0-canary.c96bfa495.0","@material/elevation":"11.0.0-canary.c96bfa495.0","@material/typography":"11.0.0-canary.c96bfa495.0","@material/feature-targeting":"11.0.0-canary.c96bfa495.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_11.0.0-canary.c96bfa495.0_1614108794572_0.8984555100821705","host":"s3://npm-registry-packages"}},"11.0.0-canary.fa9b59f67.0":{"name":"@material/slider","version":"11.0.0-canary.fa9b59f67.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@11.0.0-canary.fa9b59f67.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"f0c6c18032dd9a20af29c0e236b92a77292ece03","tarball":"https://registry.npmjs.org/@material/slider/-/slider-11.0.0-canary.fa9b59f67.0.tgz","fileCount":38,"integrity":"sha512-Ux+zciERzDhSg/PxawmFD9bMfyXfDvdvW8lEuXVSorjGvM811vJVmBjfn0QgmQ2zXslSF7/Tv7DR8GTdTaQcJg==","signatures":[{"sig":"MEUCIHrwx21SNWTX5lxvoVDUtz1RDAuVIkZq7/KKEbWUi7OjAiEA2RfzeCbKzPgxBr4M/mGbIBBN4UrhO42lNWIT/Dsvljo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":786981,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgNVjOCRA9TVsSAnZWagAAOPcP/2rnQT4fCYHHSxTdD9ZD\nUVrx6xKC5Gx0kEdig16xmwDfY0y5/wkWQMLO6e3J4wDZq7rJRkolAFrsE7y6\n+dWUgUDXa66lt4aKt27q79UVHUpSkKAfCrdSXPkkfag5kbGuQDVh64sgPe6a\n8uHju45zO24lejMMMf+1P4Vb1b8pDVL7gS0RHpVDTLaTUw1hHUPX79RZuMlO\nnAU5qj0C4BFzAaGcS3tczNsMUbUhexSP8+QmlA31Hq9vwyVbtEe3QzscC0wx\nCQA0mLS2lSXG6BmhRjlLv6sQVGU6ZTz70TnOSaCu7MMN7SDY2cQmP+gRU/tA\nGFsDghkofRl14lMKUIMVhSkKdh8w5L56psqvn22CbYLSsDBWRGQXeCUYawX/\ntzRdbz+2q8nB3736hjWC2uGSW8pW1Nrmr20XUhhGDe4qWf9Ek9/QpUqx/EAY\nt5fAVNsBq9J9+IuNb/jOft2pcYT8RKeKUMRkdU0KmqPFHLzrD4wXwXkP1uEm\nUtTB6r+nuJte6Drj7Ty6maiuIEltYB3Lru+pOTfi+jehgjDpELoJAsp7hANB\nfKtoJS1tGyygpOMuFJI1nQ0QEjW+CcOLXMfBE0hzK1QPIso+VesQAHP4Q+wN\nIRPh3SSfPD2damkaHVYJQ1nP8AvZUlCddMZw8MBpG3FbfYIkQ9v4MZ8UfJiI\n/pGB\r\n=H7VE\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"5fd97ca8b5906f3b3097bd333237976e3e93d192","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.23.3+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.23.3","dependencies":{"tslib":"^1.9.3","@material/dom":"11.0.0-canary.fa9b59f67.0","@material/rtl":"11.0.0-canary.fa9b59f67.0","@material/base":"11.0.0-canary.fa9b59f67.0","@material/theme":"11.0.0-canary.fa9b59f67.0","@material/ripple":"11.0.0-canary.fa9b59f67.0","@material/animation":"11.0.0-canary.fa9b59f67.0","@material/elevation":"11.0.0-canary.fa9b59f67.0","@material/typography":"11.0.0-canary.fa9b59f67.0","@material/feature-targeting":"11.0.0-canary.fa9b59f67.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_11.0.0-canary.fa9b59f67.0_1614108878367_0.3050013368320075","host":"s3://npm-registry-packages"}},"11.0.0-canary.869e3497c.0":{"name":"@material/slider","version":"11.0.0-canary.869e3497c.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@11.0.0-canary.869e3497c.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"784502e6be972da0f6492bfce6a9cba2a130f2a2","tarball":"https://registry.npmjs.org/@material/slider/-/slider-11.0.0-canary.869e3497c.0.tgz","fileCount":38,"integrity":"sha512-gYiHjh2z2/RCXR75WiZcd3aYojJdQbbWSwIjzn6QWmw4CZoDilfv/g29iLcYr/vSsf9Vm7LbRYdI5hjOcrBWXg==","signatures":[{"sig":"MEUCIDGbiVAtOoAiIcrOTViHdnNVZzM26kz8gvAd09nVq3ZNAiEAwXf3M6TABOiJV1zHdoWYk7r/TzSH6GZvgXH1p9wehHs=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":786981,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgNVjrCRA9TVsSAnZWagAAsz8P/i6UrGTXFXo1ENgi2BlO\nujOl47DjYsSlLp+Rsnp7pdiLERNYMwoG5aBsCdbGdWbIyQTq2exjRB7YOwfl\n25l4r+17kWc46MVKZKS5u2VrTrOG4sNgKGA0Wv4/4/GYJy1Ch6/N0f8pWYXu\nJomvony64Lb+0nvngISkPt1xGLCvLeq/Tw+GCQIuniYxkrg4nKII/wqYs56A\nq+6gimuh8lncjYjEuI5hMHFHLZWQqDEtd2LTwzjDQ9Peb1Plku3nQ7NmedTv\nTijEJsUtPxdJOMNdFjjVXVu44tmwkAjLalc/1KgNStYMNe8sD8FbQEwo2z/h\nBGT+gUv0qhyswOEGzHEFhASmupitxGjtBzuviCsgaNwM3T63wVXK/qtV89Vu\niABUz082wWzW0IONy5sQCTuEIYnE2RRDcb5rsb7UgjbECVl9T+zGn4wsBrSl\n/+gB75v+Nuz8onoeKlFq4EIQJncjIN1flhduZYT8PuxTOjJOJlTtYwLdzP7S\nFK2Leolxk0SSi5hg6sTtvdv4dbZzB0/gu8N+Z1KoN+coesMk0KmMpT5LD7qD\nKpGHfQCK5rxTuY6CYh6nbX4yQSnW/+ZAes7H61WqXo8C3vNS7/gw6CQ1blB9\nJzOOHt2HNC4Izr9CUoEwHMgk0WNBkufczl8+vtngsRZI0VoZ5fMDRWm9hPQ0\nxPlc\r\n=baFJ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"2e1e116734dbd0e962ee4e11a9952ba9ee6684da","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.23.3+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.23.3","dependencies":{"tslib":"^1.9.3","@material/dom":"11.0.0-canary.869e3497c.0","@material/rtl":"11.0.0-canary.869e3497c.0","@material/base":"11.0.0-canary.869e3497c.0","@material/theme":"11.0.0-canary.869e3497c.0","@material/ripple":"11.0.0-canary.869e3497c.0","@material/animation":"11.0.0-canary.869e3497c.0","@material/elevation":"11.0.0-canary.869e3497c.0","@material/typography":"11.0.0-canary.869e3497c.0","@material/feature-targeting":"11.0.0-canary.869e3497c.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_11.0.0-canary.869e3497c.0_1614108906996_0.9968009403075413","host":"s3://npm-registry-packages"}},"11.0.0-canary.8ecd7c9a9.0":{"name":"@material/slider","version":"11.0.0-canary.8ecd7c9a9.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@11.0.0-canary.8ecd7c9a9.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"fead2339c5e0ca7a148c7c66d638296a918455e5","tarball":"https://registry.npmjs.org/@material/slider/-/slider-11.0.0-canary.8ecd7c9a9.0.tgz","fileCount":38,"integrity":"sha512-MAeAqriOYmIi1VjnvRxskuOvgbUy43DKNnTQZb6nL14HauD9vJJsxxCfKqWY+9ZbFWI6IHcbapt2MIFeHPacow==","signatures":[{"sig":"MEUCIQDejy0oEILKF5u8n4Yowk9pm17hsim+2WFx8Lr/G3UqugIgOWsjrUAR7S/Z5XtNzcKd3fOAoX+1Sm2J+eDU3AUBb0c=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":786981,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgNVyhCRA9TVsSAnZWagAAk9MP/RPJ+URk8sMj71zaiGsO\na0Ohpy6QGReZ9kWy4G18e1/ift6Gw+RTdjpzEDWE6HEilHvixzVUkzEcjcsl\nyLuiPBJDjvVpev+ZUJ0z6PPRjk2zH3TfsbIe2HXp+YjnK3/6SV8yEUv3Lcln\npcsGuicg8rlgmvbKglVimOsKL+uTzoes7mqcyIj1ThlRmnfrhiQkgCHA+tNV\nO3bh4GDcMT7L5XUOgd9hmfh+LGtRueLIHL2ExmgVgL+g+c160Yg8j5VKMfls\nPcr9mcm8yfZUVYz4cFd6eqxrple9I3w8WUw25NthdJEwz1/zY93p7/CFJXaS\n6zdkPzTyWUEUCmXNdgel7xfPappIT1nlQ2kuwih4OdHDlD4dABmAAlMCxI2x\nM89EkU7QhzHUBgxBouyiwTYyV1NM0On+5Td1xAYWRr9Fo6DajpJGVndFOLbU\nn++Zqcw0Z7Bm7Iqf3+u+rfe8OjXi3NVr8eUOmDAMjNEF9CYzQzcPrxlYGyyo\nes1fzsJeoiNEzAw/U5zA+uZjfPgr9cuATFHJlicgov5ih8SkCcu/pmZT+eyH\n8ifftgOjgQpDycsveio0RJZYp7tA9hhwcNcl2wkHj/DsSz7PZIdsIk+gVNrL\nbq3+tUgyHclWjkYQFd/PFwiz6mCa60jDLIRYRC9ojEIUq+L9o4IwK4HmIFON\nSOzZ\r\n=Ge/3\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"ec70d22f543f79f769bc5b509c9dc06cb8114af1","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.23.3+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.23.3","dependencies":{"tslib":"^1.9.3","@material/dom":"11.0.0-canary.8ecd7c9a9.0","@material/rtl":"11.0.0-canary.8ecd7c9a9.0","@material/base":"11.0.0-canary.8ecd7c9a9.0","@material/theme":"11.0.0-canary.8ecd7c9a9.0","@material/ripple":"11.0.0-canary.8ecd7c9a9.0","@material/animation":"11.0.0-canary.8ecd7c9a9.0","@material/elevation":"11.0.0-canary.8ecd7c9a9.0","@material/typography":"11.0.0-canary.8ecd7c9a9.0","@material/feature-targeting":"11.0.0-canary.8ecd7c9a9.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_11.0.0-canary.8ecd7c9a9.0_1614109857343_0.5588908415099134","host":"s3://npm-registry-packages"}},"11.0.0-canary.9c85d505b.0":{"name":"@material/slider","version":"11.0.0-canary.9c85d505b.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@11.0.0-canary.9c85d505b.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"aa26e16302c35e962ad9447c0407b5874cd7fb45","tarball":"https://registry.npmjs.org/@material/slider/-/slider-11.0.0-canary.9c85d505b.0.tgz","fileCount":38,"integrity":"sha512-YPJksXj6mbOho13CMkh4WCs4OrLK05McRJnljCl/e2BYmA50+IGrym758o4t8lXugJkBeDGHx4zXjfBmcIbIsg==","signatures":[{"sig":"MEUCIDheefjzP3XlZsX92cI1O42cIA9pcTChC57Dtg+wQ1PXAiEAnFyE1czxdSmWupkXNrkG0vtk6zAnZB5/q/lQZpmk8GA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":786981,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgNX6cCRA9TVsSAnZWagAA0zkP/j9k6pOukpyEmZp3qk23\n7QZZBtz5mQRXBGU4vTiPusTbzMWa93IJor3ia2BuoOYKflp+L9MsHeKp34SH\nZYPnW4frUImGY2jxFHef+CHxktE6tXtZB03DpsswjY8l77xFGbugb2hh2HjE\nAVh/4OdkDxrVW542cKkncI+gOeBtp5oybOwjEIyxUZ2l6IsNY0q8wuBog7p0\n7DCrDU2VyWpkds76k5W6JZjyEBuY3BOb7Iap9B/MxxNsVkP/o3kksAyz2hn2\nIoLgEOluBUXctqF+hiMEgExq1iUem9c16iRYoq8e5z588WBqEXTQeL5uqU9D\nyOtzqbF/ufxt63llAEDp/zHi131zlh599QZTN3aQhs5ZXVv5YXqYoYcwcqbJ\nk8yBT00hkgtC7py2szKnM0QsJds/+BdgzmuNzGh+FsqpxFHjW4yr6zYa19ct\n+/FuM6jm9ZGcYeMLKS56c8ONB65vZwONHM6j2TWNzJnZ8Ps6q3fg3pisJawA\nx+42O6/4+otp/+c5a8DLjjN9ImhTWQ99Sgclwd5RQ0+eJxVE6niphfxUpuQu\nL/qjA3Hlsnz9pPRk9SZEjSms/LK34qw0m9Q5I+ZaJcBPwMz5gqsyoYZjqCv6\nGCo968O8Iycg381MI9f/iWB2+tg3GyrlZFDKI4DM0P3TlyHbT2Eme/FGx5Y8\naP/4\r\n=o21Q\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"374562c85250daef48b37a0e27a506a7e81c56d2","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.23.3+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.23.3","dependencies":{"tslib":"^1.9.3","@material/dom":"11.0.0-canary.9c85d505b.0","@material/rtl":"11.0.0-canary.9c85d505b.0","@material/base":"11.0.0-canary.9c85d505b.0","@material/theme":"11.0.0-canary.9c85d505b.0","@material/ripple":"11.0.0-canary.9c85d505b.0","@material/animation":"11.0.0-canary.9c85d505b.0","@material/elevation":"11.0.0-canary.9c85d505b.0","@material/typography":"11.0.0-canary.9c85d505b.0","@material/feature-targeting":"11.0.0-canary.9c85d505b.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_11.0.0-canary.9c85d505b.0_1614118556470_0.35367172971466365","host":"s3://npm-registry-packages"}},"11.0.0-canary.9f2e85fb8.0":{"name":"@material/slider","version":"11.0.0-canary.9f2e85fb8.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@11.0.0-canary.9f2e85fb8.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"f9115c649cfa2a2a2ebd17c54e87fbeca36fe9bd","tarball":"https://registry.npmjs.org/@material/slider/-/slider-11.0.0-canary.9f2e85fb8.0.tgz","fileCount":38,"integrity":"sha512-F65S30WymtDMflrDJ+pwK/hdQZ3M8afbBid9dOfVltAU5oC+ir+fy/pcop2BaqIeSNXNyUBhsdiyGoLRymOwWg==","signatures":[{"sig":"MEUCIQC0O5esUHAt1zT+ruMm7cEpU6gx7wQtbMJHU2SCWldPigIgLlh2c9MLVG/X6wf/o35ExgPLEt2qmc2ZjGPsCqjqifU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":787421,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgNbBzCRA9TVsSAnZWagAAgcsQAJXuK3roQ82TVGMYcPoY\nGluCWRY2eBtbi4F9KMka39K9EYrH53ELLVUMrqJ4k6/sxsc6f32j8YRFaPXR\nZah8MynG6FHyN775QoenIpoM7Y2FBGhhZA05BpGV81Wq2qiIgCpPulFVSEaq\nYihtc1ejJfmPXONKPNJdjWdob/WfhQ1TZ1SunnaTHBMRWQRJeke0C4x8Z9SN\noYGH5UNaLWS/f5v334bZd5CDLdqla3o+j3epZyq5+h1NSUPBLe0Pyi1UJ0QH\nSP6j8AuXy3WmV4QyNgMbUIsVQeM4uGp3ZqUIxmsjpVdaBeZz8ksvQ/umq1mj\n0JUM/yviFtot+OMiLsWAnlprlloOolRSMUI5eqeHCmJs0io5blouCtg27Hzc\ncu7fuoVntQ/zN2Irk9IhyCUiLc6wK0YxPo5NnRMWAOuVSpDFVmsf96wrIlI5\nRG+BlJzB0lP0nf2XXLGSXNTDgIn77wsMTRHUmmquR3quSKQCNv3psGeJ1gH8\ns57g8/EYmGjTUGfWUS3Ag79c4U2tlFtKYyuWyJlj6Ko5y/8YCvgWGE6a/WO3\nF61HEokIUnke4lf3/QOO/F+z8ECHOYtONCbJCvIxyOfmf9yr6IhrOiGMc7ig\ndA9JCTKLAF8W+XtI567fbq1NoyiQWMc9hnpeCAE1eAm32qg4Kky+nREi/f60\n/v1u\r\n=xYrN\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"4dfe4e49ca9339b2914b3dfd9e5c12642a0fd60e","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.23.3+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.23.3","dependencies":{"tslib":"^1.9.3","@material/dom":"11.0.0-canary.9f2e85fb8.0","@material/rtl":"11.0.0-canary.9f2e85fb8.0","@material/base":"11.0.0-canary.9f2e85fb8.0","@material/theme":"11.0.0-canary.9f2e85fb8.0","@material/ripple":"11.0.0-canary.9f2e85fb8.0","@material/animation":"11.0.0-canary.9f2e85fb8.0","@material/elevation":"11.0.0-canary.9f2e85fb8.0","@material/typography":"11.0.0-canary.9f2e85fb8.0","@material/feature-targeting":"11.0.0-canary.9f2e85fb8.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_11.0.0-canary.9f2e85fb8.0_1614131314715_0.8425042983611484","host":"s3://npm-registry-packages"}},"11.0.0-canary.19c4f29ef.0":{"name":"@material/slider","version":"11.0.0-canary.19c4f29ef.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@11.0.0-canary.19c4f29ef.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"60c1f53dae3a239397d576240e10f22281738312","tarball":"https://registry.npmjs.org/@material/slider/-/slider-11.0.0-canary.19c4f29ef.0.tgz","fileCount":38,"integrity":"sha512-/b+HVJiZdOpiGDN04AbQ+Q3HDKg+/S3k93oqmaxTjcBtHasugpF8fitUbd0XX+RIRbAZvny6pWZfK+Mb4/uJAA==","signatures":[{"sig":"MEYCIQD41sMBqSVq2a8nIIxPBN/HgCzoJqrSAwmbsrNOZq57gAIhAPwCQp84CULpxtnWxZ0wGHDTucMcA9weL4/0uZsFrYWI","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":787421,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgN/kECRA9TVsSAnZWagAAARIQAKJ/HY3DN2u2PTthBd9V\nFXcZZulw2PWBDuupIn1402cnfZrS19HVhcAyXEES2U/iJBkWSw3y8BHn8sZA\nZ75KnjwexcHnKZjHQa6bhpmXgRt1hJShn0+lnD/6mfIFeOm+L1HVshXq2lpf\nnK71brHk0maTdZTQ/zEzPv8wTAhzELfQiP5S8c8E+C4+hiXxLe2bfkF7MfNl\nOo7rOK+fLdNTuBVdUhf3XhlMRX3E4/c0cahR1Znza5eXQu1xgJ+UDBxlS8cA\ngeMFC/cU9iVyDAzeYl3bKxDUmjDJixlkseIBMLoGTXZmgmkZieVcgQm3oLK6\nffALoDgD3CwnUFilnzuve+C57fbBoYqzbPUus2fAHp3foCnxRz5dYthZKU/j\n44jQIrcZz0Vau8EL+IMYJ6uYn6vpTACw+iI2z65gx4+lTV8c1uUvN3rOaosd\n6vs03alliQ1ou/cNfxXc7os2GUg/Xs0MiceoudZoEecOaRUbngcNAl23HyLZ\nxxweqJj82g/cP5FsbDT/l8UIbbC/x0TWP8HGlpTu6UzDDsmH7B6qkH0aw2w3\n/n1spZsWs6xrz36EgW/JojPvO8kG8Pcf0Baoyj/pipIkwbN2lj+v3wim1NFK\nmzIovPVy2iBJL/1Hrmh8Gq3vIiWvXxWkZMLpDdE5JVn7w3QUvpVqoOwTtRT3\nlwk/\r\n=enpy\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"cf61b54810b37e81ab57d447f7d050104a2f6f46","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.23.3+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.23.3","dependencies":{"tslib":"^1.9.3","@material/dom":"11.0.0-canary.19c4f29ef.0","@material/rtl":"11.0.0-canary.19c4f29ef.0","@material/base":"11.0.0-canary.19c4f29ef.0","@material/theme":"11.0.0-canary.19c4f29ef.0","@material/ripple":"11.0.0-canary.19c4f29ef.0","@material/animation":"11.0.0-canary.19c4f29ef.0","@material/elevation":"11.0.0-canary.19c4f29ef.0","@material/typography":"11.0.0-canary.19c4f29ef.0","@material/feature-targeting":"11.0.0-canary.19c4f29ef.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_11.0.0-canary.19c4f29ef.0_1614280963408_0.383613600657557","host":"s3://npm-registry-packages"}},"11.0.0-canary.63df6e9bf.0":{"name":"@material/slider","version":"11.0.0-canary.63df6e9bf.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@11.0.0-canary.63df6e9bf.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"593a694d007011e91dcc448a06e514208a7f51ab","tarball":"https://registry.npmjs.org/@material/slider/-/slider-11.0.0-canary.63df6e9bf.0.tgz","fileCount":38,"integrity":"sha512-SN2VKbGzj2wimcn9Ln8gaqWiJQfhESNVMJcSEye9tmoYmbJzs4BTybcYYh18bdJ/+nbvNJiNV3P6gNcSjlXHwA==","signatures":[{"sig":"MEUCIQC7yR+U1v/xxnXcyJQbaJcIcHC4LGaAj9AFRpYJOUaO1QIgMeuRvrc9eMGWsh8Y+jK1EJE+nXmzNmEjjrMBl+WYCfw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":787421,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgN/x3CRA9TVsSAnZWagAAfzUQAJmKHbrc7NvxbhTfcC5B\nKhYgA7ASOIARf9MQycmWzMF7/O3CZ/EYzB2Lf0SO8D27YDGAkc32DAT6g0Xc\nWrsOoTj/N/iadKePNj2Maz/hUHvLIw3ajsmlHQyRYzGd2hdbbaD8ZaW75aF4\nudbrC7kW+57JBmj2XXy8tdjop17GgRF1PL46H8szSIcXWiPyNR3WTII0bkwu\nHvekt2oAt/f26Q7eHhMvIG2xJyjtIn2XPKY4LAPV/fQHt7HkvQwe5k/fSK5C\nZGJRqdCu5Zlblp5HIXl4Ye7FNwiC92u50TQMpfBqe3t1Rta7P6GsaK79JQzy\nN/jISVOYLs137Rnx47BTtUUQrk7eLgkR3RMIfh01/noE4Yaq0LhA9Co8jhes\nQ1g3xRVjA0ARGNZYdkNIXi5quz431M9ETrXEV/jnRuVMxl1yRIOWdZ+QxYPE\n0XPboIJt6mEtkxRXqQwnzkwgxL8/varL1CssGrI+m7pweOhhr03Jo596QWqb\nSg/AZVjo8ihtt+MA3RQ024pdO9CR3UugnxfdLZEDIvoFOSyQAWevhlolU+ZZ\nhi1SvWtdhfuSNIzVOG18UpIdY96sd+R8xoXwVsCtY8fFM0ZozQcuoLn19SCc\nsRLrx3p3Gpp21Xyqe586O5zB/LkxbU8jimBxsEDF/2FvO9EIT/kEP/jNREsw\nHTuE\r\n=NK93\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"6d11b414d4ea43b5c780988e2437ee30c9f1c0b3","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.23.3+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.23.3","dependencies":{"tslib":"^1.9.3","@material/dom":"11.0.0-canary.63df6e9bf.0","@material/rtl":"11.0.0-canary.63df6e9bf.0","@material/base":"11.0.0-canary.63df6e9bf.0","@material/theme":"11.0.0-canary.63df6e9bf.0","@material/ripple":"11.0.0-canary.63df6e9bf.0","@material/animation":"11.0.0-canary.63df6e9bf.0","@material/elevation":"11.0.0-canary.63df6e9bf.0","@material/typography":"11.0.0-canary.63df6e9bf.0","@material/feature-targeting":"11.0.0-canary.63df6e9bf.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_11.0.0-canary.63df6e9bf.0_1614281847309_0.6753599633722562","host":"s3://npm-registry-packages"}},"11.0.0-canary.981ad970a.0":{"name":"@material/slider","version":"11.0.0-canary.981ad970a.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@11.0.0-canary.981ad970a.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"176a253980dd1a62eef2de24e3ba1d152d87fa70","tarball":"https://registry.npmjs.org/@material/slider/-/slider-11.0.0-canary.981ad970a.0.tgz","fileCount":38,"integrity":"sha512-w/ITuVERgcv/TmYzPpZBL8hwx3j8IbJvAIHr4dYwfHVS7oB5wm7Tv1gmx65Nvjq23aRNjAtWZWlvKksLGKKXTw==","signatures":[{"sig":"MEYCIQDTDSumTXRO/gAIYvOMXs+f8exYo9C/B0uj1hrFbdkBIAIhAIrEYJ/o33h1U2M0FS4JT00z8a7tmofmJnNfensVPOmj","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":787421,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgODvOCRA9TVsSAnZWagAAiA0P/R/vLPKhbyZPN7QmkTje\nmwoVa7CmfWPtfxUcW9R99tqdSIDZp/GDKSIIz0mL7CgcmC7ZJIvx6/mp6pg7\nvVxQCp2mdb4UGn3pMhHWqSPraPv+obzhhhmA7fMi+T57PaT6LuUlDOeGCNZu\nOTRRHHE9hObIC2uCzmusM65H7h436ERPsX6NV/wN8MyyZpGe9AP997GaeYts\ntPlrRBAQMrNnYKhOLIfWv8zKWrrpwWnF7ElS3JbFueIXtawRRj+9rnZe3Rta\n/WWJm7wvjca2LU2rVzNWeRDnc2qq5OfcTHVwQzyBfm5WNuozvjKdHA2RsV8y\nZVaEAQdz6oRM6R4AsYEVWLO2tuC2uoeAKMBDuCLeVxpCIt9KiVFyIn41/4vN\nCs/ivkMgLygwce67hHHwxlllfBHUrDj+6Cxg1C9GEmL0z6Q++oOKLlcbWPR1\n/8oQxpsJMVWYlEg6HN3SV1gTuVQVDlGt01EPlURSuxG8TrNtC2kq4Hfo+wdA\n6NuAkBnSQ9UqRd6yLJMUkyl+PeZAKl31xBR2E86mD13uvJ+yE5tNgOQClu3I\nylLafkmlWnSKtjttN6fsiBwr6DAcD6+Yv9yaFypgR/6THpwsQXFAj9F+035p\nxtnpUw0y0WuLcpidA1sA/PSJIFiaA2ErQSaWyskkWwsfo/4J/hlFHzFsYVGv\n1/4L\r\n=00Xw\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"0faf6e6b78f0c9b2c63f416ae85331d13aea198e","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.23.3+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.23.3","dependencies":{"tslib":"^1.9.3","@material/dom":"11.0.0-canary.981ad970a.0","@material/rtl":"11.0.0-canary.981ad970a.0","@material/base":"11.0.0-canary.981ad970a.0","@material/theme":"11.0.0-canary.981ad970a.0","@material/ripple":"11.0.0-canary.981ad970a.0","@material/animation":"11.0.0-canary.981ad970a.0","@material/elevation":"11.0.0-canary.981ad970a.0","@material/typography":"11.0.0-canary.981ad970a.0","@material/feature-targeting":"11.0.0-canary.981ad970a.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_11.0.0-canary.981ad970a.0_1614298061623_0.3005368185136159","host":"s3://npm-registry-packages"}},"11.0.0-canary.f9c9e39d6.0":{"name":"@material/slider","version":"11.0.0-canary.f9c9e39d6.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@11.0.0-canary.f9c9e39d6.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"d1250a4e936a024868eaaf9aaef3569d43eda6e2","tarball":"https://registry.npmjs.org/@material/slider/-/slider-11.0.0-canary.f9c9e39d6.0.tgz","fileCount":38,"integrity":"sha512-4L0xsdjPuW999OZbMcb3RBA+pWW4xyzbXSf6NsSLZ73RmVjIT4pMYv5Nf3pXWVwiSo6CAQCPiMvhhSOkD5Q3yQ==","signatures":[{"sig":"MEUCIAXwGCN7tBPsf+txdSg88sR5iHTyoRXUBjZrOmGWspO9AiEAlKZhxGwI8yFzmNMAz9ofRtCcP8Lqr7oRLJ5tB6w4Yn4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":787421,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgOUBLCRA9TVsSAnZWagAA87sQAInKMg5fkPpF6IKKiFwf\nmBFdN0lrwGRcv08vlPlR8PHm+NPAdXXy3bi8U3yxUPm7Azy/FztWPw4BYx+K\nqMXjjo+9fxMAU1Vl+me3NoLT3bNS6tZ+wRFQOENyhAoTTeIeJYMh2d5PCMtn\nwV0KTCaLeXO8V5T8O9L7Ie2+hUvpCXhrtTM2J9ErwuzJWLd71IzjN7hnOVmK\nHwcA0gErZMJiFiRXpbZhepCM8nc39OWI8NZ7+e2eJ1GIr00EtJvzoREU++ib\n2f0q73Fyc3aX/04+RXyRqqJYMv49QAHzYtcx83aPv9jowyK48Obd3X5d7o6D\nj3LfNNzw2xPmFKNxUF4TEUMWOu7D9KokccDMlQ/gf1k7HmajDDHh2Jvhbjil\nkuMuSzrohmLP48Lt83jpu6aN2EVqjMkPxQ1oO/VXFpf8YSrzZaxVAz9Qu0Mp\n4wGgLAN/a5/K335AfABCqV2y7hIAxhQIYwNKd+JQwT56UL8XBjVbbKcxAI/p\nAOZcujWId8/DLyRdlrtP8j1UkzNeVn0+J778yL/xbtY3OxYgx3xw9a9wp8GD\n6+2zcOlOqxigqngW7vD2GCEce0c8pV6OeNHv1iNobiXHwdIn/GA30kfe4hRM\nJxXLVkcosfikgFFtuXD44DrAsX9gDXD+rEnXTaKQBVBEnEUtNcuQJuMXX6NP\ntZiC\r\n=u60m\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"81d489ae3f1defd63ee64de05a2a330040ae6406","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.23.3+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.23.3","dependencies":{"tslib":"^1.9.3","@material/dom":"11.0.0-canary.f9c9e39d6.0","@material/rtl":"11.0.0-canary.f9c9e39d6.0","@material/base":"11.0.0-canary.f9c9e39d6.0","@material/theme":"11.0.0-canary.f9c9e39d6.0","@material/ripple":"11.0.0-canary.f9c9e39d6.0","@material/animation":"11.0.0-canary.f9c9e39d6.0","@material/elevation":"11.0.0-canary.f9c9e39d6.0","@material/typography":"11.0.0-canary.f9c9e39d6.0","@material/feature-targeting":"11.0.0-canary.f9c9e39d6.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_11.0.0-canary.f9c9e39d6.0_1614364746674_0.7992406553110778","host":"s3://npm-registry-packages"}},"11.0.0-canary.c97d7d881.0":{"name":"@material/slider","version":"11.0.0-canary.c97d7d881.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@11.0.0-canary.c97d7d881.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"b40b2a54fbe87e6ecbd9658282f0ca3806843021","tarball":"https://registry.npmjs.org/@material/slider/-/slider-11.0.0-canary.c97d7d881.0.tgz","fileCount":38,"integrity":"sha512-/MXNP/XSu3BOqDZvpjhZb0pQwcqsbFw4LPR4Qs2Jjf/HYT2qLLmyyGCHll+c+0tMZOb3nhno+rnEXHQxSCwVGQ==","signatures":[{"sig":"MEQCIE1oHK+hisPmurd9dsDzEAX4HTjOyxxghP8Tt6zstdQaAiBSP7qF3JjF+qvbN/DB0TTFBjL6EqTVFkUWMIqyxQjK/Q==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":787421,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgPVRHCRA9TVsSAnZWagAAZ7QP/3ur/1iDWgaht5C9VEM4\nCRefdHIoTkhzS71W+VOwtkbKutpqfnFsQdNDs7Q4xVYOZTJqHEUj3xyN3CU4\nalmWYI7j2XTjYY2oQEbZp0trrRUqGpT7zj3l/yRreXNducNLk2ww3+w74JbN\njpd+YT1DxjM795q3IwMyZFW8vhW6Q1qsMJLDUKp/z5rUQLk805Y94oLitr1X\n4fMynJ7V/HY/BD1xtAB1JcpuJ/b5TJo9Ve07b8+9OPoqLjErhKbS6eWuhGDm\nrOPlNu7RrQEaB9H/y7CvKUm/zXGBkLddSlyrICmEjgbtITYj8hqK5CrTcLeN\n9EACuZfiGl7/9I0jiJNzY7lzOVcSdLjRsq7JQg98/QM65QUbWchUwED5FVQD\nQF+Iv9FZUktHyNdhP/4sIbQ5op2DIXIXQSweeuoecOYrqIEQojTg1lTBWUVx\nXoEow0e/AfAt8OKIsZSH1FQuedFplbIiN6C7vzrbWhRN1lrW6TKxKvVIdHG1\nBkKFHGLm7zylrSni0ms1JzktWHJuFb/1yFRSWJq82z6HPlGkxHoDaawJgkZf\nYOnVfa8PMWDbrys/89CXBZ80yC/0qCI9dglZnalfrX4y8m9NZw8EfTm/1jyz\n2HLbYb6oGwbglXmJkR1lYzNzFg+/r+GkeIRbAt86ERcM+vuLAa6gbVdJCUqN\nvm87\r\n=YrTy\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"27a49055320511cea9f431f9c62d44a6490bb64a","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.23.3+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.23.3","dependencies":{"tslib":"^1.9.3","@material/dom":"11.0.0-canary.c97d7d881.0","@material/rtl":"11.0.0-canary.c97d7d881.0","@material/base":"11.0.0-canary.c97d7d881.0","@material/theme":"11.0.0-canary.c97d7d881.0","@material/ripple":"11.0.0-canary.c97d7d881.0","@material/animation":"11.0.0-canary.c97d7d881.0","@material/elevation":"11.0.0-canary.c97d7d881.0","@material/typography":"11.0.0-canary.c97d7d881.0","@material/feature-targeting":"11.0.0-canary.c97d7d881.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_11.0.0-canary.c97d7d881.0_1614632007320_0.16468065937170762","host":"s3://npm-registry-packages"}},"11.0.0-canary.bf670dad7.0":{"name":"@material/slider","version":"11.0.0-canary.bf670dad7.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@11.0.0-canary.bf670dad7.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"4acf9e2ff4b406ddf17a5c61e68fc1f3594e9cd6","tarball":"https://registry.npmjs.org/@material/slider/-/slider-11.0.0-canary.bf670dad7.0.tgz","fileCount":38,"integrity":"sha512-RpNmNczWUwu1MbZYzSVSeeP24cLXN47O/N3slkBbioBAV7eXXVZhSKnRYIOVtOnsiiVEtKTru07e5J6Wf0h6bQ==","signatures":[{"sig":"MEQCIH8j59TCOskiTrZKQDbxivPCRsP9y/lpw2vxVCi4vTvYAiBj4qeCyqD87pODc/oXkg0ihocHPaoGVDKYtrN+Bgk0xw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":787421,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgPtZ9CRA9TVsSAnZWagAArF4P/jxOZElSL7huop04PqXs\nr7w53I1PnuTr4Rw+cF1TR2fW7jXzPucO7jvTAAM9c2yGisvJtgWHpvKhBehI\nqFOLhJIWv1/26Fc7OAQAZcgn1THgZ85X70QruxKHSwyebGPlZx2ThR8R89dq\nk9SKy//RexJGUbenUNwkfKUbqVkN3//i4+Vorc3Qrvb8ZjppbdOz4iM7noFP\nrJ6eFPPeu0PN57MWLyE0jjqoVGAOEgheowc8GhoKEH1lREb4Lq3Ho0+lJXKn\nlyaNoEy7tL3xE7SzvkCUiaWclO+d1ubjpWvAweXhnhoXlsTz5hT+z0Nc/HSM\nXItCH2pmXwv/huuj9tFFFhIqIeR+xgc678CDqnGb0vyV7aCYh8CSv1JSaYYM\nNxnV9iiw02lKjSuLffHa5rGrBLHbhMeU9YSwLw7s37scm4VXWG180vK+nX4E\nwDY1VImY/VwSY1XBX+B9iGjEdO0EE/n1i0d4FZEWyOoVu2NQaIo5HCDe1xoA\n840WVctK1Phjgn9oPlA3H24QzAml/N3R66XMpIGBSCkPdBkS/mKKkx9ZK/zO\nfFz15cx7SQS/8Ib7WcfXxQdoXYooc/XaUBzl53ixQD/WLPFozWt6gSNjktP+\nf+7TCwof/MT90j+4oTmoOMYNMumfUmnB9fvZEksPCpZmWVXejd1buRhtgL4r\nXTSM\r\n=KL+a\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"61b03e5331bd5c886de5c4a57a4edc1b53878e47","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.23.3+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.23.3","dependencies":{"tslib":"^1.9.3","@material/dom":"11.0.0-canary.bf670dad7.0","@material/rtl":"11.0.0-canary.bf670dad7.0","@material/base":"11.0.0-canary.bf670dad7.0","@material/theme":"11.0.0-canary.bf670dad7.0","@material/ripple":"11.0.0-canary.bf670dad7.0","@material/animation":"11.0.0-canary.bf670dad7.0","@material/elevation":"11.0.0-canary.bf670dad7.0","@material/typography":"11.0.0-canary.bf670dad7.0","@material/feature-targeting":"11.0.0-canary.bf670dad7.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_11.0.0-canary.bf670dad7.0_1614730877173_0.9233071834376232","host":"s3://npm-registry-packages"}},"11.0.0-canary.c7d98fcde.0":{"name":"@material/slider","version":"11.0.0-canary.c7d98fcde.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@11.0.0-canary.c7d98fcde.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"2b63cd93aa90c0ac74f1a63fb7a3279577684094","tarball":"https://registry.npmjs.org/@material/slider/-/slider-11.0.0-canary.c7d98fcde.0.tgz","fileCount":38,"integrity":"sha512-H3JWGxpI1YkW4HBcDl6fPcZBwvPEJNwf7B/P5O3IK2kGPsxdwBPb4+pbL0jXnCwTXfU+bTssusL5hLqjCVHdRA==","signatures":[{"sig":"MEYCIQCHqYhPf1RSG3n1tPS59vCDFehOe0G3IlN2QWW+ROJoBQIhAOH3y7s8naMHnK4DRBijVnt0QGPOn7MfQcl66z0OqwEw","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":787421,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgP/JFCRA9TVsSAnZWagAA2IMP/0vsgTVI3qYM9Ob1ipIb\nraT1CH+5b9eNGvfoBCVpWXvBVwHPjtyVVglUDtvzY1dh1xHUAioVyoaL2/Do\nuYpTwZnXa6U85tcFPvSWutpXctKnduISOaqqg0tEHJG0S0WVr4lV+q5UK1CW\nfP7S8xBAfgveHxg9byM5T4wycpIi15SAE5XtD8QUsIGCXZlXa7gb7n6HyfKB\nYZ5+1Q5JETZbz1bRl9Y7jyPhVd+HDYnR/v9kBHAqxiDSwwgmF1baChk9HhcE\nRjfpLC+Hd8fe+R4UWcLY6tgGF6j+zuaSdqSI0+ifDgnKS+4a3JHU5sevx8Yg\nwRnbjs/WXrP0bTUBwuV3gN3GKpc0HwJtGOsg4Bn0/VEf1PR9xKFs3uEEjozU\ni/YcSpnxmVxGj+qjfNM69a1isyQtk2ygt/+xcN56qd6WXVZok1m4G2s4vl/C\nZCqqb5NAP2uC9O9W6xVOs+ohbgxrshXPfSw62/3lBJZ84poJmRY9+22s5xT4\nO6NmuxP5vzq4J87Sdlbs7azLxjOBgAbMeTGYG1nwX6yEMQh0qpCSJVOi1PDf\nHko6okwaJ7pu9XyEXBo7gHaqhmadkKq21GDI9hfXrgtc0il1aLuwLFUTL99P\nCv41RSywITk5fymAFtEsNVEnizflzKz3VKLii+2X/QHl/XtSPDGx175xtgu5\n/0KV\r\n=A416\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"c5c4c5b417df34d141edcb1fd743d83d7a2b49cc","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.23.3+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.23.3","dependencies":{"tslib":"^1.9.3","@material/dom":"11.0.0-canary.c7d98fcde.0","@material/rtl":"11.0.0-canary.c7d98fcde.0","@material/base":"11.0.0-canary.c7d98fcde.0","@material/theme":"11.0.0-canary.c7d98fcde.0","@material/ripple":"11.0.0-canary.c7d98fcde.0","@material/animation":"11.0.0-canary.c7d98fcde.0","@material/elevation":"11.0.0-canary.c7d98fcde.0","@material/typography":"11.0.0-canary.c7d98fcde.0","@material/feature-targeting":"11.0.0-canary.c7d98fcde.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_11.0.0-canary.c7d98fcde.0_1614803525381_0.7986087846732981","host":"s3://npm-registry-packages"}},"11.0.0-canary.4fef8bc1e.0":{"name":"@material/slider","version":"11.0.0-canary.4fef8bc1e.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@11.0.0-canary.4fef8bc1e.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"e98287163a7ae7f6b502cdcd63810e57f61750b0","tarball":"https://registry.npmjs.org/@material/slider/-/slider-11.0.0-canary.4fef8bc1e.0.tgz","fileCount":38,"integrity":"sha512-JiuaTEN2QOs7MWCnOTsO0ht7EGpuFO1Wbxzb7omEIuSviXr2SFES2xb267cpUJFFtHwWMMwnVGVjckQUjNE2mw==","signatures":[{"sig":"MEYCIQCReSPeBufO11gQaFqBDcG+YaTEOtHpDVtOb8N6o6kBCgIhAM+O0i6s5/nTTJrjkqT/iDSJYhIqtXnnZQwyxkhDlUq6","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":787421,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgQBqvCRA9TVsSAnZWagAARIgP/1jp7C1udm/RGA1d+swL\nxStmPVo4EoWapVk8+L0Wyd3/PUl1x6Wqxu3JjfaVVGRayX8gC+ILdrfHK1z3\nHT2j/NkGtZ1qqdQiZ8r6P/jPGt94WXl2mSiJIBfwDIOie8VGgNQMjpekJIkg\nJ7JWGD1CInqYmBMqgCJTtG5f5p+NOS09BU6v15duVQY9y3ADxu/57AatKodi\njWtYxYo+NyuzZ9cIEmIgwt1u9nQNqI5gz5bQABTjxOIEFu48PJQXf6an11SK\nArO6f0HZrM7Q5qjNO+Oes8i8eHhlos9soGEk3Wjmd1zBBjrawi2/0vTVD2D0\nVvGKj5ASUIIj3ChbSVgekmvBkKgnAksxuC8mNM/H2Oa4b2BvVhQZKCgvb0se\nJlfIptUhUs3H8ZNGHGy+Z13ZGf6EOFXzfw9K4xtyYODkyfA0IkqDNHbgb8yI\noLlmvzRNtrWS1KTHLAFQEgAaVuaL2LA8R7spysLMDLcodisWFdWUtjBIs0gW\nL3J/aAZcW6EUluS0D8iUjQogfkE1qihh2xz2yt+pm75RcAPvcmfMi1z+hTZ6\nPOAOxW6cIJngHWmNr3BBKyUhPLGtVpd7ze0RtBALBc0XKnBT+fYNu8FvT2kg\ngYoiGYyrJ3RaLGNH+4CTvzTmq/SYDmuRkJDWyNxco2CzorCMAXcIoEjKv8He\ntiSr\r\n=izba\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"933905005f9c16276caed5327bc6ca581afabb6f","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.23.3+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.23.3","dependencies":{"tslib":"^2.1.0","@material/dom":"11.0.0-canary.4fef8bc1e.0","@material/rtl":"11.0.0-canary.4fef8bc1e.0","@material/base":"11.0.0-canary.4fef8bc1e.0","@material/theme":"11.0.0-canary.4fef8bc1e.0","@material/ripple":"11.0.0-canary.4fef8bc1e.0","@material/animation":"11.0.0-canary.4fef8bc1e.0","@material/elevation":"11.0.0-canary.4fef8bc1e.0","@material/typography":"11.0.0-canary.4fef8bc1e.0","@material/feature-targeting":"11.0.0-canary.4fef8bc1e.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_11.0.0-canary.4fef8bc1e.0_1614813871330_0.8399374003567996","host":"s3://npm-registry-packages"}},"11.0.0-canary.afae3a3ec.0":{"name":"@material/slider","version":"11.0.0-canary.afae3a3ec.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@11.0.0-canary.afae3a3ec.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"398ef96353143df7cdec777035830eb182c84e9e","tarball":"https://registry.npmjs.org/@material/slider/-/slider-11.0.0-canary.afae3a3ec.0.tgz","fileCount":38,"integrity":"sha512-7g6JgCBAbEFkcwT/TyLSn51HprVWjeU/siKuICIcUNsM4dCNWVqVGOeRSpvjXHI6MK06fb2czpayyzd74WEnTw==","signatures":[{"sig":"MEUCIQDxAggbRkHZGH5gvktsSpe66qBtmrMOxelM9/VEOPdrzwIgT3/4M8NWx5yDtcZspcF52mn0FlSXez2PPcs2J19+uDg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":803649,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgQB7mCRA9TVsSAnZWagAADvsP/RBq9B+nQOtojFDJo6B+\ngTNP+A0v6PwU47e5jwqHLRTnUjVIlJWSbWt75aaY6XRIKOsAQLjyCJpsfGml\nS3lA7op4vJrmQKPPA02rj39uUP0pb2pgdjiqzd/LxkjRAJFlYIw02J2GGEAe\n1NK37hlqxb1BGmWfwluUh8rqMYWs2Hs42tD4YPhxu43WWnufj6Ac3/NlD8AL\nEIAkt5XPY110TbdSnUafSkzbD67SbEONOTDNGXn3m7konOTiMtzCp1kIzG1S\nhRc9b1nUAji4lIsfPi4ujWlx0s/yDGrTPEMvQTxAcc2uKybCXOveldj3c20b\n1qK+1FUxMlDxxKto/hIhnk31QKKnsz7sDj3OuSX4aD4buwO94osq9nuhOjmH\nYOFjoodltJkYIXCpfKgHpXByWHGrSFIUgL2YITUdMSHm5PsWJMEcRuuMBrP4\nCEmJtARKDBZ6Dh8M9cIiRKHFcor6beFdNnaPLW1AV6CQqJMjqK6WGAVM+0VK\n5O8pjIKe3AQOO6WEO4T1MLp/ONcgsM9FEYCYK/zbXOLnWHpZJoXwHOpo+MCg\nUm7XU473Qij998NrINLj+GfaG1BUr/nFAZ+pJ8oV31730iEHw31vB7gCPcUO\nfhqh40NnSRuBOaM3CHf+A/Dj8Ay7slmqzPTjrYFpN0uH71eggzroCYk+DrhW\nPdO1\r\n=LNra\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"054b07cc588568c82346f2cab8aa8948b77a80d9","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.23.3+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.23.3","dependencies":{"tslib":"^2.1.0","@material/dom":"11.0.0-canary.afae3a3ec.0","@material/rtl":"11.0.0-canary.afae3a3ec.0","@material/base":"11.0.0-canary.afae3a3ec.0","@material/theme":"11.0.0-canary.afae3a3ec.0","@material/ripple":"11.0.0-canary.afae3a3ec.0","@material/animation":"11.0.0-canary.afae3a3ec.0","@material/elevation":"11.0.0-canary.afae3a3ec.0","@material/typography":"11.0.0-canary.afae3a3ec.0","@material/feature-targeting":"11.0.0-canary.afae3a3ec.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_11.0.0-canary.afae3a3ec.0_1614814949771_0.42538313938007755","host":"s3://npm-registry-packages"}},"11.0.0-canary.0a0b10f22.0":{"name":"@material/slider","version":"11.0.0-canary.0a0b10f22.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@11.0.0-canary.0a0b10f22.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"f8b00b533ec2680655378699637e3f8254b4c287","tarball":"https://registry.npmjs.org/@material/slider/-/slider-11.0.0-canary.0a0b10f22.0.tgz","fileCount":38,"integrity":"sha512-q+b04kGO/toRuE8OgwW+HBpnML17i1DS2Ejx62R8ZP1N/TXCOH/MyxaE5qN97B9axk82GehTpefM8JQlthulrw==","signatures":[{"sig":"MEQCIH5UfDNywuta/1Dw+T7YO0u3Yk+on4VWtQ6QT+sABkiEAiAJ15/1mqVSz4ulkTu+992xFijkzThpJrvL8wz2pOsLow==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":804259,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgQCNPCRA9TVsSAnZWagAAeK0P/Rnj41HhudII1KbbKuDJ\n+LxV4ORwvddUIoqab1JZIOPydYJ64WG4PE0pj8ua04G4ZRkTT0xxRdY8/a/f\nZdi/aLH3acl6GSW36VqLkSGbfsFM7WhDonnfUJFtyksTqQMAux4uTmOSglIp\n64LuI2aNLVIszR8sSbVRsUZcwjvwtgDEWW4Pt+jgpvUMbbvRgbudkiXzBo1p\nHKNtfwKHWTfUFaSjkw18fbKI7bqAXa7Nag1pXztDzS4VGvpBe9uP+C2jNAXX\njS4fEnw0VJrRJMG3Dypk5mIBGLRpAumCntDDj/uQiam3tSeaULPxLvhFKIQU\n2/lhRkfruey/WOZ3b9ClGqYLl9s2/gHcoQkcDxXaYiPqg9evciXEzL+0Gzpb\nUbE24/63yZOMOWyMS7c7gE4060vS+GuQ+5gXzPX/YHDlrywJ7otpQVFfj/lv\nTycEyjstU2tOakpQRjy2KWISgE3FjT2EL5KIhHKgTmPwlhJjTpheFDrRFIHL\nEJ6D9LC+om7bIdnkqjKVen+AUtxn+2RXM5cVdNNws5SZM2piX7nfBTCS+p9V\nKDh0h4bquOjMicm/vp3BjHemkyvK1eIWF6ClvRgpbf23VTpzm/MXHwopUymX\nl3lre898syHCaeo73UJT7skGN8SW2v2PdMK7KcKOiCt19UgEp1IDuKK9XA/a\nLufS\r\n=5m2y\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"5b560f4bc4c4b50a124c9432e81b3287bd348abe","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.23.3+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.23.3","dependencies":{"tslib":"^2.1.0","@material/dom":"11.0.0-canary.0a0b10f22.0","@material/rtl":"11.0.0-canary.0a0b10f22.0","@material/base":"11.0.0-canary.0a0b10f22.0","@material/theme":"11.0.0-canary.0a0b10f22.0","@material/ripple":"11.0.0-canary.0a0b10f22.0","@material/animation":"11.0.0-canary.0a0b10f22.0","@material/elevation":"11.0.0-canary.0a0b10f22.0","@material/typography":"11.0.0-canary.0a0b10f22.0","@material/feature-targeting":"11.0.0-canary.0a0b10f22.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_11.0.0-canary.0a0b10f22.0_1614816078604_0.21897291520429185","host":"s3://npm-registry-packages"}},"11.0.0-canary.6f678a91a.0":{"name":"@material/slider","version":"11.0.0-canary.6f678a91a.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@11.0.0-canary.6f678a91a.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"1521027624af98ff1976913bbc0de82e9a00c2ab","tarball":"https://registry.npmjs.org/@material/slider/-/slider-11.0.0-canary.6f678a91a.0.tgz","fileCount":38,"integrity":"sha512-cHL9HpYZ6DaIbZWw75fiqLgwrmMKWyQ2t+OubMzATPaz7/eJeEGXkayZFzM4NAGq7X8H63d7FEjUjevsZc2VnQ==","signatures":[{"sig":"MEUCIQDOA2GxiWTcnbw0BpGJgBvKCRGQF+ZGscHBF9lbRw8ZugIgIkGJX7pw2nF2E3sMCcfPuApxGx/oX0WBisUBi7RIWBs=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":804259,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgQSmQCRA9TVsSAnZWagAAD1sP/3UnjEOHt1nyoJWbAfey\neKYwQXS+WdxfNSGMSyAn13ygduUtROAvNP8/g2Ni5wkjRjKHRK2PkMid3783\nHX/v/2b7jDGcEAxG0K79xh9SFPotc7lU98qDOrUwqbXHEsuhOYP+MfoeTcnV\n38EQNQDKilxyIry0xFzfjHlyY6DkDKKMbjQMuaC1sIvVVOPPl5jd5eCPbVnP\n5n1+rRTGuVAjEx8zy5rQ1K+HH+Gk3HQvZdJIHGmM8FmYpgCE0tTZVPoKni8c\nDeK47As7FG+1jJTDE/Hemp2wnTh+OUx8YZHFqcmVt18ec6DMu4JR9IkCXecz\nRxXXd6ABIk/Io0QK2+EbHL06Slm5kzoIjIHeE96nQTUUWNfUahrBAyqJntJp\ns40IqNnRY15oSACzrzKLEajFZHOpbxJ+wu+kjKNQS1XJ9vHchiyLzBB5FOyw\nczOyrtxv5lV1kZ7MLSeNUOwwuVUlKAhwYS3I4PZV8ox9odGl6dID7smQSX2l\niUt/+vfmXQpwbCAs+TVGfnuAwoo0v8QOXHSEGUT8Xs9xZQ44oUilpf2IQ2uS\nb9ejq5jFSs8cLxijybbo6mwIA/hP2poghEOt5V30hhbt73hefLeNmt46IQgc\nMxVNeuiMa8+rfPQ832FUEEX6coc3oy9NzxrxoQ43vmnUw/FcDAXqWXimqXvC\nLV5S\r\n=Lst8\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"863e8a04081286602f8b0c9bf446655b9399e8c6","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.0","dependencies":{"tslib":"^2.1.0","@material/dom":"11.0.0-canary.6f678a91a.0","@material/rtl":"11.0.0-canary.6f678a91a.0","@material/base":"11.0.0-canary.6f678a91a.0","@material/theme":"11.0.0-canary.6f678a91a.0","@material/ripple":"11.0.0-canary.6f678a91a.0","@material/animation":"11.0.0-canary.6f678a91a.0","@material/elevation":"11.0.0-canary.6f678a91a.0","@material/typography":"11.0.0-canary.6f678a91a.0","@material/feature-targeting":"11.0.0-canary.6f678a91a.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_11.0.0-canary.6f678a91a.0_1614883216182_0.38231572226730837","host":"s3://npm-registry-packages"}},"11.0.0-canary.f5f1b613c.0":{"name":"@material/slider","version":"11.0.0-canary.f5f1b613c.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@11.0.0-canary.f5f1b613c.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"de76d97ed11591e52e68d580117bf445f4e3e840","tarball":"https://registry.npmjs.org/@material/slider/-/slider-11.0.0-canary.f5f1b613c.0.tgz","fileCount":38,"integrity":"sha512-rHe7QGg5iXBn6+IxSu4cVUImwQqPSNR1PdTyulpKBQYxToEZC3hjX0NIH3AilSxwtTKw+rdyH70O2xUdknEqFg==","signatures":[{"sig":"MEYCIQCKdCp/1FttiBlkCZj9vGn5nA1tnf4ho1TXxtdpo9X3qQIhAPP+urBIYD2x+SkzS5AzMTGBuROtn543RgmLzZIC33M2","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":804501,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgQUfvCRA9TVsSAnZWagAA8P0P/2L3ozWpKONBxWOcuJTa\nWXHvu4U0n+nGHSMSf3aCgfXBK7gZku6HGUoz4qUrX1+DTDefG9+TWiuyQ7mI\nJXANstguuEr0rMFvtV1V3yaWFJbXmXpmrwrrDlmOeySOy1ow0QVSgfcwXlSa\ny43WeaTGgYy8DgSkJfSi4HixzsDvHHTn65c5bYNd4H5rjF/dMx3A5iat5iqO\neL+1GF16gPCnUJlOxXorcnvHU54QX1z87W5VaD3/ol1u6YCu7KeEWyknJcbI\nqXqpiG4r2aursTQ5rbZNz4NvasptVddToIOeiZfLVnn2095YJNmCST05rEI1\nEOwa9Zi8UX1ngj1vUJaqG0/pMSfxsFURMySmRgT91ZniUjMFHyBxxhuzdhZE\n6pkMDOAI4+iTAniEbfAKj8oCNqcyC1EBZR0RjPd5p409XD9je+MuVwS5GyIt\nlcAcIXye6O0VjvlFP8OrBjDtjwUraZCIeyW663vqxcLNT5NOO+CqtWZLWs+j\nxm8pkzmxexDvdEeBRzjcRKIto6IqOXCrd1O5HWOvO1KkmqZJvQzVYy9uzIu8\n5ZQcegrgR+LlZYAipj4yA1ECYZMY3+aBmTqiMompe9EPygvkVBp9SZivaua/\n0qmklQK1/Vxwx0ZRlng5DNZWTOPuXB4r3S+foJ4e0jsA3/R8NxrvaFc5bmHW\nF5iJ\r\n=Acd+\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"20e2000d9ec732c7cdd0b5c15381f0a55f778036","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.0","dependencies":{"tslib":"^2.1.0","@material/dom":"11.0.0-canary.f5f1b613c.0","@material/rtl":"11.0.0-canary.f5f1b613c.0","@material/base":"11.0.0-canary.f5f1b613c.0","@material/theme":"11.0.0-canary.f5f1b613c.0","@material/ripple":"11.0.0-canary.f5f1b613c.0","@material/animation":"11.0.0-canary.f5f1b613c.0","@material/elevation":"11.0.0-canary.f5f1b613c.0","@material/typography":"11.0.0-canary.f5f1b613c.0","@material/feature-targeting":"11.0.0-canary.f5f1b613c.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_11.0.0-canary.f5f1b613c.0_1614890990774_0.8999212134745638","host":"s3://npm-registry-packages"}},"11.0.0-canary.606e767ef.0":{"name":"@material/slider","version":"11.0.0-canary.606e767ef.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@11.0.0-canary.606e767ef.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"74532812c328162a91f0e48ed80c671041896f32","tarball":"https://registry.npmjs.org/@material/slider/-/slider-11.0.0-canary.606e767ef.0.tgz","fileCount":38,"integrity":"sha512-qijcKsJeec7i70ZscjGr5nL3wp/5LsH2iXaby1GgobaStYTLyu3psggBLeW7H5WUkUDZujrhQjlxj4PDkDxHjw==","signatures":[{"sig":"MEUCIGxR8YGlHWv1WmsUUej+TcALnmJ51DCbprgbwhjgqXDTAiEA5zW0ACYwbUTdei9oOwV9SmxRo6wIj0VpiZ8txCT3cIs=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":804501,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgQVUUCRA9TVsSAnZWagAAx7cP/3hTKNhB86Q8K4L+KlC1\nxDeuYLcHpbnGuSnKek9qcRcaXb6k3AHoGPDeubMiaXg2sHZvZ73/yS/tt5yi\nuN+CSCh1yhJEbMeZqJIqGqbK7OyPWT1cJfCgwiVQ0dFK/6vcOqjcz7sbIjFm\nNkKY2viTENO3r4sp/aWEG1+3XFk+1g34V8RZxyJ40TDQWT8XP1HYxPczaHwM\na0w3qXA+CgU+ydOdH2QchD+tlq/6Qj0zHeQP3awTVtL0SYPlPc6sgwAfqMXw\nj84jWGJLjcfCP8F/IVNrO0ot4+jJnoR1wfeYRm7QD4FJqjSouUYclmhM7JmH\nPpdXK453yZ+asXiljC8AtRtw0fVvijOP15ttzOiFdPMGd0YteVM/cpv/z7/S\nD/g7h9k/P4oJ2R1lE2Oop+axjEkClTJHeOX30dd5WBQdu1SVcsN+iW1nIuah\n+8GODI/JfnIbUt4ybPf4dCTQCEl05a4pq/2yO6jvlJkE/a0BGsQVvQfp6p/U\nVZ6+b2YADw/yztPRAoH08yJbkSCu/BvtZtgCDVEspK1U697b4WINwhSAoPBg\nsP6IbfD9n3NYiCuDXYFU/kIRr6E10HcrQNa4g38kEn574FJP/TBkGDWypFuU\nD6SIMBNC0Lg/hsC3yzVb7/vFUldeCqBB8zDb5GQxlAMnwlgYohbePqwZLIgh\nKsod\r\n=nwpS\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"34c41b3553e1ca4ee49c0c36a1685f3f462d33ce","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.0","dependencies":{"tslib":"^2.1.0","@material/dom":"11.0.0-canary.606e767ef.0","@material/rtl":"11.0.0-canary.606e767ef.0","@material/base":"11.0.0-canary.606e767ef.0","@material/theme":"11.0.0-canary.606e767ef.0","@material/ripple":"11.0.0-canary.606e767ef.0","@material/animation":"11.0.0-canary.606e767ef.0","@material/elevation":"11.0.0-canary.606e767ef.0","@material/typography":"11.0.0-canary.606e767ef.0","@material/feature-targeting":"11.0.0-canary.606e767ef.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_11.0.0-canary.606e767ef.0_1614894356174_0.34400242412774995","host":"s3://npm-registry-packages"}},"11.0.0-canary.f77a4dd1a.0":{"name":"@material/slider","version":"11.0.0-canary.f77a4dd1a.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@11.0.0-canary.f77a4dd1a.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"fb1ace39fa2c7f77a6e748953f92335fc41bd4af","tarball":"https://registry.npmjs.org/@material/slider/-/slider-11.0.0-canary.f77a4dd1a.0.tgz","fileCount":38,"integrity":"sha512-znZjYMgiLtKzu8rtYAmEMM3ILZ154L66cmyyNgmuml34pi3vtHHX/F0CuRxu8FOApG8nG9t7ZpxAb87EAciXvw==","signatures":[{"sig":"MEYCIQCcOpuzgRWcseH3bX2snFn2l1d3GUqHX2gND58wMIE0XwIhAJB2i83i9gCd3OctqohHm27vtpzHauKDoeIFeqA+4Brm","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":804501,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgQweqCRA9TVsSAnZWagAAd9YP/1DPa41CXrElsdtB1V11\nYrztkPfzlQAi8l5Mg/reWFs3x1fDtqsTLMRSATqiUoBHjZ7J9ohX3QT/SnfY\n/691HWgeXHHS6negdKZB9xs8VB4ZLM3iz4sJ7B1NrVuhxyG3b6O55YWTY8Y+\n6t6U5v2BfuLJ+i8ut7+1EVFd8cQLKi668xrwAWLFsUNG76DohWSjZQd7hsvM\nmD1j9AufhZh2ewDP//+TNDB+nm4jDCuWQ7VDUmbK+P9erETVY1/dny+SaJht\nLp+1QCEBa5nQOkXKl2nFBvH5Y8SXcg7WgixBJcYoT0jJDPONb3wj7M/dSOZC\ndRdCeULBEEGqz26gYNdw+gwiNn7QHnh8CW/J85QP/aLmO91xGE0/N0N+d8jw\nVQ5y+OFdKf2cuwNCbKcxJEWPrgFlbSpDtCA8w9v9jui3kL99lCmVPhpfBHNA\nMQPQPKwiGLYF0SJTvLqAMjhNxQIJFoLbH/gK73USkAyd/Qlte16gFBXX6vKI\nQs093AIcwmfZpCiO2+WDvqVGblM0nk0fG9F21ThfRKJXDWuOpXSKqz5m+kgT\nHChZxFsRTO4f7vd0ywri9jaTZomcRi65jFfKt9Y4reAKaS+BWEHClNBNozsT\nurtX36nJqjWdiAEDoEbJ19M4LZMma1VOqI+SUIrbdwALWyuyn+Wvko+oxe3k\nDyhx\r\n=4QLt\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"9a729bc3e368dfd8685190e8460ffef16eac8947","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.0","dependencies":{"tslib":"^2.1.0","@material/dom":"11.0.0-canary.f77a4dd1a.0","@material/rtl":"11.0.0-canary.f77a4dd1a.0","@material/base":"11.0.0-canary.f77a4dd1a.0","@material/theme":"11.0.0-canary.f77a4dd1a.0","@material/ripple":"11.0.0-canary.f77a4dd1a.0","@material/animation":"11.0.0-canary.f77a4dd1a.0","@material/elevation":"11.0.0-canary.f77a4dd1a.0","@material/typography":"11.0.0-canary.f77a4dd1a.0","@material/feature-targeting":"11.0.0-canary.f77a4dd1a.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_11.0.0-canary.f77a4dd1a.0_1615005609884_0.6433948823423694","host":"s3://npm-registry-packages"}},"11.0.0-canary.2d6ba2c23.0":{"name":"@material/slider","version":"11.0.0-canary.2d6ba2c23.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@11.0.0-canary.2d6ba2c23.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"304b8ccc5d1c997560e12db9577d9cef73f69a4f","tarball":"https://registry.npmjs.org/@material/slider/-/slider-11.0.0-canary.2d6ba2c23.0.tgz","fileCount":38,"integrity":"sha512-J48S7WhFrCAlbhRNtm+mRQPD63iqObrrzN7DJTNKtPZxQhtOSO4EvQmFLzwinYzdcrZJyNSzeYVjdP6sJLy5TA==","signatures":[{"sig":"MEQCIHcClDrpxMK46mbG4+X8SPucUjX+p8EPb27IJtMPaiZUAiBNqX+v0F8nBFJOnldc1mqMRbJfAsZG0aWe+POn7eaECQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":804501,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgRqjKCRA9TVsSAnZWagAA9dkQAI09D3IyTBJYXqXRNg6h\nTkOn0W3zDWPiud6hzFRZ9sZRNnUTnncyYEKvDefD5bcpuOXE0HVX/7X//KQH\nEmUR3FllAdR1kvhdFCJcQS/Tnco8y9dBzKrPTEiKCvhfZo99Vxiui7dIJVAJ\n0psO30TKjEF3QopQIjheLo33Wab1MJs+q79ZCEtrC/iopZ32IJWU4+xL1YF8\nBfiggfvIK150QLzDLasmcH8p2QuKu3W5CQ3TE5ssa0zetUwkz8PaoJK+lwbj\nywvi7OtWOXy4/mbVC+lBkH0QfJIJ8+wYyiL8w4nNzDq5T61dPxM3dhLr9cYQ\n5K15EOeaSRFd/5IXDH9i2nDVDWxFFS4R7/TDu9wZ5p9fBi4ycSMpcibWelNB\nZT5B0pyD2ULO7NRTSKuQyJSboT94Emjf7IMF7qMj3T+euZ5GuvI1wZKwfBkd\nuf2KYSVATHKzoxkWT085kYbIDV8e+qHKCgWT55RuyRtm+BS/i3csURYja8y1\nFs9ox+hen0QaCLTHAfSxRlbNUUV5Va5Xa1RBv4KWo3omESDSJrPB5zCuGr50\nEH4whRIzJEZ946Um4fAsExuKCylE0dAR3oJduAuX/vTH1kEhyi2zJyawGv7D\nvup4u/r2Ef+RiEkcglnLiz3kRzbcBL0xqdxrMrdcXwBwIWbhX0dcePGSgWmO\nY4D6\r\n=wu+R\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"a0b889753d981e10bf70b9bcaead70c1549cf865","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.0","dependencies":{"tslib":"^2.1.0","@material/dom":"11.0.0-canary.2d6ba2c23.0","@material/rtl":"11.0.0-canary.2d6ba2c23.0","@material/base":"11.0.0-canary.2d6ba2c23.0","@material/theme":"11.0.0-canary.2d6ba2c23.0","@material/ripple":"11.0.0-canary.2d6ba2c23.0","@material/animation":"11.0.0-canary.2d6ba2c23.0","@material/elevation":"11.0.0-canary.2d6ba2c23.0","@material/typography":"11.0.0-canary.2d6ba2c23.0","@material/feature-targeting":"11.0.0-canary.2d6ba2c23.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_11.0.0-canary.2d6ba2c23.0_1615243465679_0.25680297284965437","host":"s3://npm-registry-packages"}},"11.0.0-canary.7522dcaca.0":{"name":"@material/slider","version":"11.0.0-canary.7522dcaca.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@11.0.0-canary.7522dcaca.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"98b87a0af1d0bd20e0dda2d12b04adf88848aa88","tarball":"https://registry.npmjs.org/@material/slider/-/slider-11.0.0-canary.7522dcaca.0.tgz","fileCount":38,"integrity":"sha512-WDG+PHfuueZ7wqwUkN99Z7L9vQLLgrlZBkGnH7KLw1CClz9HVDTBD9oiqad7u5amgyuBTnQa5tOGNskiLzrxyg==","signatures":[{"sig":"MEYCIQDyImJkyyqmOqlxoaJK16ZF/R4HaRSfB93c7YIKMCPKAwIhAIW7gjYGQUXjWuEQOeWJxBMN6KtcocW6nYCnXo8DKURE","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":804501,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgRsEECRA9TVsSAnZWagAAupoQAI6htvSAWiMdnU1hHKyg\n0B2Ni3qJRfQIIQwe+kYZnuxdKoGnvY6vC5RZ9qMZEgFiJv0RtnhpL6a2sKpg\nonZPK6CaYHKlJ9fdaqMeJPpM8G1TyP3+qVUdNjNrpSt3rGXUWMPmZfa9IYEo\nsZZftO9TygzaP5TsGf5N4rBFD50bPQlEJhrKuc59RrkD2BCICyWkxgEwHcNn\nlsu/YEuDLbbw0F0BB1BtcI2YcNElH3gciuLfk2wvV/oGveJ1vKZg7nniSX1E\niKPzFYzyDB7e5zMHylDSIIng31sqoNVzHV27BFn6MvYLnh/2PI80Ja1Zfmmh\n+ZZEo75YS80hn7S8D9LcS39NzJIQVV79+B0d7+bBPaWKO1cVzK+D9WRZorjU\nvlPS4RBD775Sm+jKQsoz2Y/AKg7dFGp3PpszeuGXDcPq93Z2RmIdOV6Yh1Ao\nhO1nBjufTeNo8oVw17Cn33+/SniD+L2Ht6uZKGSWnkleYzs22V5yvEg5mNUM\nv/p8/9p8Nc2mwTv3imjTH12NztMOeVGYXlluAe1fWnmybdkcBa4hkJ6qNXIG\n2vTtbFK+ZaKYGYTEGlqk5C8X7jzx6aB1z+bLX6Nu0ysvuKn8AKzi6UwVIVsM\nLoXhFW1IpJ3xbFevFal0djCcNKjxgFVJulW36GqdrdLOXzrYsOukk07w9IAr\nbB/b\r\n=wsBs\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"6e73ae404aecb0602a5da37f40b650181ac48062","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.0","dependencies":{"tslib":"^2.1.0","@material/dom":"11.0.0-canary.7522dcaca.0","@material/rtl":"11.0.0-canary.7522dcaca.0","@material/base":"11.0.0-canary.7522dcaca.0","@material/theme":"11.0.0-canary.7522dcaca.0","@material/ripple":"11.0.0-canary.7522dcaca.0","@material/animation":"11.0.0-canary.7522dcaca.0","@material/elevation":"11.0.0-canary.7522dcaca.0","@material/typography":"11.0.0-canary.7522dcaca.0","@material/feature-targeting":"11.0.0-canary.7522dcaca.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_11.0.0-canary.7522dcaca.0_1615249667810_0.9105507275223552","host":"s3://npm-registry-packages"}},"11.0.0-canary.5c0ab7401.0":{"name":"@material/slider","version":"11.0.0-canary.5c0ab7401.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@11.0.0-canary.5c0ab7401.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"d1a199cb64704308ee8deb777d30585eb7c47315","tarball":"https://registry.npmjs.org/@material/slider/-/slider-11.0.0-canary.5c0ab7401.0.tgz","fileCount":38,"integrity":"sha512-rz8E2qZ+XGk6JVfWYc4q774OwSZ5/T/MlFF3HTV2vuxwjPmKlncNRZerfUfIziMsjVgKcy09YP6d+o04Rq5H9g==","signatures":[{"sig":"MEUCIEOzie+Flmx7Lru7MS2r8Jb0pRFlSYMjFTRpwkiSvpiNAiEAgbFlhPvaLyd97od8CZNQ/xh/79oCRAJgmvv+CBZnHB4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":804501,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgR/w0CRA9TVsSAnZWagAAovIP/1YEx81dbRSr7R5jNMLu\n1LVbAo5qGikZ/nB7KVVUs3TahhmFFBx/ykVp2DQP8YbZNnhYEOWxrB2UL29C\n/PQwGAlMFDcqleiN6z29RpIgjRFYhqJQQQK1u41+78r77Qv41HsIrUMdAZcz\nU4lTbrATIYFPrZ5OUBnUH/VfYFxi7wgW8U0JgcquXymoiZGkd9qPprCrNywk\nYAGoPUsu/78I8MysY4hh5+ifJGFKpfWev3s+kqrY7AtmiW8yFWWxYMs8iE6k\nO3s75PNjT+eLz9+TWGuweK1JhLj5GuCkiN9+1ULTaKnp6x9rJf3MIV+G7YQs\n+u1RX8jsU9x1DFu5Ismyrz12UhnBPKoKcCQHeL7qdzfnuttElV+lrUu7U7Vw\nRuS/IhB1J/cTbPerWFBp8hKFdXYGfJ5FDJGenIdaojaookTKEjAxB45KBxD6\n8BvJbaDFjFqMSCVdX5w2bc8Mqz0r35lLvbHzYpUsn5gplPRDznEZwBTPIqeZ\nMe+mJm7+vDq6JinIUzBl1HaLi2PiyFKfzBCrX7kfK3SAG1CPYNKWygbHOyYN\nsA57ytSV9uv1VvhxzRTKUfRSaQLePS0TWrcCzUBEUfHR93ElupiGPVs/eKK+\nwomCF9JxstN1riab8twHzXk9pziz1fhUsgzlwRYVkX5OZATX1yz4hK2vB1kN\nG8fy\r\n=qBgG\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"95ff5a1121ca15128776896b8e4759594ec51246","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.0","dependencies":{"tslib":"^2.1.0","@material/dom":"11.0.0-canary.5c0ab7401.0","@material/rtl":"11.0.0-canary.5c0ab7401.0","@material/base":"11.0.0-canary.5c0ab7401.0","@material/theme":"11.0.0-canary.5c0ab7401.0","@material/ripple":"11.0.0-canary.5c0ab7401.0","@material/animation":"11.0.0-canary.5c0ab7401.0","@material/elevation":"11.0.0-canary.5c0ab7401.0","@material/typography":"11.0.0-canary.5c0ab7401.0","@material/feature-targeting":"11.0.0-canary.5c0ab7401.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_11.0.0-canary.5c0ab7401.0_1615330356083_0.7933490959016203","host":"s3://npm-registry-packages"}},"11.0.0-canary.59010b6dc.0":{"name":"@material/slider","version":"11.0.0-canary.59010b6dc.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@11.0.0-canary.59010b6dc.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"ce5d53581a4240e2fbb1d700c5b073f259e6eb48","tarball":"https://registry.npmjs.org/@material/slider/-/slider-11.0.0-canary.59010b6dc.0.tgz","fileCount":38,"integrity":"sha512-kYDiLUs7B+uk5L2tCGgOL43RT2xzeq49efBINTAvbgb5vyAJPi+k5cNUNfBlec5i+R1Yfkd2WynQ/Zadie3Uiw==","signatures":[{"sig":"MEUCIEbedWZgVf/oWtf4CTBNPj6wkzgWq22B7yqZg2hJ0YoLAiEAm1pZuidfWYxOWaIJxeTg+3GC7SWfnAGEMxIL4ryPCGg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":804501,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgSPp9CRA9TVsSAnZWagAA/BAP/itwczub046LKr53C9SR\nk/RYcPvHjTYIBBhpe7WoGFd9CEgb78dYHsXgynCq9aHLu7H32JacSwu1RpqC\nGmhCc8hmbLHAL17RwMiNVhWszw054XRIgqxD7VKTbcstNgV/rrOFROlJO2x2\nVHXKFrRDMyq0RY7X6F6+3dhUUwbA8DCrP/4uPbtqY0sFGOFPad4yM6V0zILk\nwJnuyzlAlrJ5p0UpaNlA+N+jbHtuJj42AC7tTOixVWm1X0e55yrDZsyAETCn\na/nbzUbcaicUYhGcIF3TGDisi6+a172tjwW56Z+5kxG2ocAAn9Oh/QROhiiz\nqHY37VbNo/6GfK4Pr9sQGFFbQYPi3tQGSl3EZNEMGH9Di4rsl8+0ExdUvZaQ\nWn2V7ZqCp9IKmp17YFgfBmjrERs8jToi/FVdG0KwUwNkKiRXvoYD7sAiuJvW\nLBT76OuzDwP27T/Ibi2Xg7C2a+3pJ3E9ts9b63T48TfmRLvxaUXjtzqVu+i4\neSO2ZLvyQ8ZdTreJfeX+y6VCIne6HXDl13Y0s0nuIKn1CL9Mo01SCT6n61+5\nLOkuHR3kPn/YXzkPx5Nz42YR5zv0QdAZHe15+iP4C2m7/kHKSj0a0+B+a50D\nIr76hn7iIh5YRFMKDx6Rl0hi4W6n0VR+DWs5WMxFx3Av//DOJUjkQc4vzBLZ\n5KSa\r\n=Hbdq\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"e697574285a5102f4c1e5002a85ae33a3bf2210b","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.0","dependencies":{"tslib":"^2.1.0","@material/dom":"11.0.0-canary.59010b6dc.0","@material/rtl":"11.0.0-canary.59010b6dc.0","@material/base":"11.0.0-canary.59010b6dc.0","@material/theme":"11.0.0-canary.59010b6dc.0","@material/ripple":"11.0.0-canary.59010b6dc.0","@material/animation":"11.0.0-canary.59010b6dc.0","@material/elevation":"11.0.0-canary.59010b6dc.0","@material/typography":"11.0.0-canary.59010b6dc.0","@material/feature-targeting":"11.0.0-canary.59010b6dc.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_11.0.0-canary.59010b6dc.0_1615395453493_0.4970219381553289","host":"s3://npm-registry-packages"}},"11.0.0-canary.9e52f5544.0":{"name":"@material/slider","version":"11.0.0-canary.9e52f5544.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@11.0.0-canary.9e52f5544.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"1386679910a5ff0ae52abdef844a99321029223b","tarball":"https://registry.npmjs.org/@material/slider/-/slider-11.0.0-canary.9e52f5544.0.tgz","fileCount":38,"integrity":"sha512-sxSHHonlRpiVbvAcDlsfi9Sib2opw7gPpoMKScQ7Avz0RAZn+rmXEtqJYLNGN4PC1OuaYlWv2A+eIktcmuYyQg==","signatures":[{"sig":"MEUCIQCbrf2mQ6QbF40NFbghVmQJklKVd9EEvNWQ79hcpmNqwwIgFhoQpg3pQWx/sXa3mYSYzGiidC1+NfRt4NAiSZeS5E8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":804501,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgSVVZCRA9TVsSAnZWagAA9f4QAJ2z33zkeGkMiPegTqjv\nUP9hiFFPmcrIGGpQ36hXPQPW8FPfruZKxCa9TOv5GSanPYke+ruegEk9Rjap\nT0nETaPIcSLoHge/sCiqCOMDIsNQ50DuDo9ps1dRgr+kD6FqdLcEX3eUSq0n\ndvtH8QK2fPwxOh79xFP4o2OMgTZxNcmO0xwN/LAf8wBmQtK/HtLz/ao3gP04\nkMlW7He1VoLTcDJJFYZkarEqQ7bEKh/XGLJ87CONWIF/N+bEAX2YvL1+7s+q\nNdKaPGexaHssW2GmRtSBaf3sVJq8YbvEEw4gagYN+tUbaP1TaebzOLVQFBMB\nK9XwWHtnZtWfI01EOuyj4dPKzcbvOtq2+xQ8MBeUidMSXlCbcNcLFBjcqOux\nqJDtv/FKdPnnBCyEUVCnvv5hdJai32eMA5OJV57TB9J8aQN+NtDfRcQyqFfp\nBWShFhyFcj1T710iXsQ7FYnB3ppWn7+VkAqxltryxelfSUAnqKF5wO8Fb68n\nxMhi7Cwb63cazQ5r2CJNNWSCKreNgG8Pq4db6uXv9LopJhKzKSIZWLAzqXTl\nTk022XZdbQKkYHDAwZEHPLwv7/c6Rr7HnZDh+nNWSogANLpTVdW3tjBdsCae\nJjJYul57r4smPbFz+130A3uEULgLQMaX1FyOBLye9Ujf0LP7SL+z3zbZeBeA\n4o/2\r\n=DY8p\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"4763f125770ec8e3a6ea4d8f1f5f607371847e45","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.0","dependencies":{"tslib":"^2.1.0","@material/dom":"11.0.0-canary.9e52f5544.0","@material/rtl":"11.0.0-canary.9e52f5544.0","@material/base":"11.0.0-canary.9e52f5544.0","@material/theme":"11.0.0-canary.9e52f5544.0","@material/ripple":"11.0.0-canary.9e52f5544.0","@material/animation":"11.0.0-canary.9e52f5544.0","@material/elevation":"11.0.0-canary.9e52f5544.0","@material/typography":"11.0.0-canary.9e52f5544.0","@material/feature-targeting":"11.0.0-canary.9e52f5544.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_11.0.0-canary.9e52f5544.0_1615418713173_0.4782568075074425","host":"s3://npm-registry-packages"}},"11.0.0-canary.a678806f5.0":{"name":"@material/slider","version":"11.0.0-canary.a678806f5.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@11.0.0-canary.a678806f5.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"69468b51de9ee2117f18b24fbb6e92f1ac55a689","tarball":"https://registry.npmjs.org/@material/slider/-/slider-11.0.0-canary.a678806f5.0.tgz","fileCount":38,"integrity":"sha512-jcK4ObI/iWfREPL3hsp1Vmj+KoZz6aC5ftUne1ePjqJqGv+BzuzG+1aGtQpMEkcNbf7Jllmpzd5D0EVoMlolOA==","signatures":[{"sig":"MEQCIAOld3uDmOQeYaFfEsn0i4NnKB4Z0czQhSe6wfwAMWLQAiAeAmrdKHdHK+GxkN2ZACFjmCkMnj46FDzUWjEIQJFh6A==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":804501,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgSXdPCRA9TVsSAnZWagAALaEQAIBupgBvZuI6O4+c+hHd\nlDtYxKYMW2/hc4N76rqNF/Aa3hJygqvNfy3W+cNbNc9xm/KeyVvt6QshULVI\nkCtgu6a1JVYgBmSXH0YdbN/8fP3X+Dq2z5Kq1oddmT3lTQeKUGrRk2Z4SNoB\nWdFYuUGu4px5iPPbj6KX6HiMGl7golS7dgJwm/XzYnLkfeCcd+XapIEPsmVi\n4pPqdH7Oe71+Yjv4ooH15+UwnyQc+mAymEbt1ERYRGh4XiznP8O1eITRkaUe\nkciW0PTvJCUDj5Pm0wKTDBk3az7YoRQ3dgBP0U1sysAX/4MfkFVL+C4XsK5f\nOyNj8lYOZvRz5IUNO56Xmdh9V8SQwZkCLYa93QkULwOnYGOPjdIwZI62Jc5k\nXm/mn93NWg8gqR1o5Nz2qSwzz0dSjxu0V1S+bwcH7TS6XJ2XfZDzalaYUEfj\nHQqQz5mQgk+AD/oX8/abtRNFjH8WRq5HwIS9Njl39x2MDjAq/bqPh/Fkwosi\njSpBql6/anERgouL/FBYz/V28utSsigDFHvVvXrH15w10Tu8aQhDtESURaeu\nzYr21HSAY+g3JItBjYBhHT2bx//PpPDu1JAFbFS5cwu/N2Nnra9DvYDcz8cB\n0IKM5oy30wiiKBdJsOxqlxQyg5tTFp7IK5HyZ1kfMZkqqBYJ+F+1Y7QqiDaQ\nrbwF\r\n=BDTe\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"a724ed1e64d54989ee4c27c71935f90fd5614f3e","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.0","dependencies":{"tslib":"^2.1.0","@material/dom":"11.0.0-canary.a678806f5.0","@material/rtl":"11.0.0-canary.a678806f5.0","@material/base":"11.0.0-canary.a678806f5.0","@material/theme":"11.0.0-canary.a678806f5.0","@material/ripple":"11.0.0-canary.a678806f5.0","@material/animation":"11.0.0-canary.a678806f5.0","@material/elevation":"11.0.0-canary.a678806f5.0","@material/typography":"11.0.0-canary.a678806f5.0","@material/feature-targeting":"11.0.0-canary.a678806f5.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_11.0.0-canary.a678806f5.0_1615427406531_0.05107437969076378","host":"s3://npm-registry-packages"}},"11.0.0-canary.b2d22df5b.0":{"name":"@material/slider","version":"11.0.0-canary.b2d22df5b.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@11.0.0-canary.b2d22df5b.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"03eb06e4d1690af13642984aefa9747972e1163a","tarball":"https://registry.npmjs.org/@material/slider/-/slider-11.0.0-canary.b2d22df5b.0.tgz","fileCount":38,"integrity":"sha512-jjvX/rtLfJFFBbmBCEe+kjrWXcopxU5A6+k/rNcyJDehWou5weaLSe4rXm7rG/62Ch2qQANzrAIQszdLm55Edw==","signatures":[{"sig":"MEUCIQCNXqEnZwjDwLwU5HcHksbs4yS3og991hFh2ECFde2gPQIgSoHS2uTS6CHOcVN0uW5wdMD5w9F1sh42EU3XATUnY9o=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":804501,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgSk1ECRA9TVsSAnZWagAAGvAP/RRqv/8wbQ/5dGuvmqja\ngwjFn0bWBTPoeGpvW5S/vB0n8wDu8Ns1IBQs6vuYvKYmnaj4/TN9MOIpmwBE\ncA652P734l8YHhTZR9t6gOf+PDEVAmW/5k0Hag5l6/kaDJkgqVAjUV1ONrAg\n0VF/9bllhTmvhwM3elFIJ/Jf7HGSe+/jI2k6hElflYdwYYIzlAg8yIs0QTt9\ndqKD0966heKjocqrl9BPISV9rHdlTJlb4XkWtXqrwsj5c02Ir2ZYI9DNslMH\nEOq6qoHVyoq2/nEz7+dr064y+79CkMrx44HEfjuikwWm8PCMCsb5YQ4Vl+kD\nD32oapWQSeuoHp3FSs8xKh6QjCA6VujSyXXh9EwggbYK4wfohBq/zfcvSGSu\nfANJrRYEWLW4+xCIPejbRcSmvW3Z8tD/RWI69lDl3t8hn8P8zOrXy1CrWHcB\nueyeOJeWqDpX6Q0fobjoPV+xF7r75O3lMXHph97+cp5hBBw6qG1f2uRZ4Pl5\nfOf2hB/ezo3hS0sFKPF2ZeX6kDwL3iOxELkRD4MDq5n06ezykcT8q5NZv0PK\nUr9bxgnbdOXsx66diyvhAwKm3ItsWTjFNvgiZIlpT2ZCcnAFpI7G1+OZuyB3\n7EihpUVwWOhYsLy2h2EMRn9Zkthkzrajys7UuDGGX+N+xnOAQtc8Kw2R+8H+\nGFAm\r\n=0PjQ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"5c38fa8d841f5b293e55e4a22202bc6ea8220874","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.0","dependencies":{"tslib":"^2.1.0","@material/dom":"11.0.0-canary.b2d22df5b.0","@material/rtl":"11.0.0-canary.b2d22df5b.0","@material/base":"11.0.0-canary.b2d22df5b.0","@material/theme":"11.0.0-canary.b2d22df5b.0","@material/ripple":"11.0.0-canary.b2d22df5b.0","@material/animation":"11.0.0-canary.b2d22df5b.0","@material/elevation":"11.0.0-canary.b2d22df5b.0","@material/typography":"11.0.0-canary.b2d22df5b.0","@material/feature-targeting":"11.0.0-canary.b2d22df5b.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_11.0.0-canary.b2d22df5b.0_1615482179728_0.1580260158464155","host":"s3://npm-registry-packages"}},"11.0.0-canary.81911b707.0":{"name":"@material/slider","version":"11.0.0-canary.81911b707.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@11.0.0-canary.81911b707.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"0c46388c34a4038c628d92eadd9956e4e3f74fed","tarball":"https://registry.npmjs.org/@material/slider/-/slider-11.0.0-canary.81911b707.0.tgz","fileCount":38,"integrity":"sha512-P/BIT74APCnkuY1Qd68N0bewSM3oXc4VRmeJLeI8mPzltB0phxTATBmgNqcs8WcSLbRx00nzus6fQqh3VfBF9w==","signatures":[{"sig":"MEUCIQCxHztvXeWDJFkGyhinnatTA4LyqLn3CP0sWuiUy89bHQIgBSRA3vunxOzbBd0YpXTUVnMFn9tjRAcpZ42TBXIGLhI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":804501,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgSmAmCRA9TVsSAnZWagAA3qUP+wUvObZ/gi/bBxj7MJYa\nIB8+XzebAhnueaw7ok7QqbxnmeNamZunsq1Y7mVqq3YZ1sXux5F/KniEAfWf\n4vERCIvn9F5JyC8IOVBm8zIo+msmNstHJ4c4tOMbAYu54oQwFKk9aM1/5wrE\nuydJmn73HIHKV2WrCOVKnnywBtbSKHAsvlTs3cfYzvnibHCqTM7o5Rhg1f4P\nZIfC2+aNCNubAGShrGcIPA+/pWXx9CxnCMIp4V6vFQoGFMqIKTFVeVIIDpVD\nQU/3lgYxaGGRmzZlLdJzTk2EI/r64wez795Id19RI/Hy3JaDJ4PScZ5ogfwN\n8fwReBWNteDSsOAFhB2lI9ZoyjEd6xN8/FB23IgOFbO5y1y6LvUJYSiWHLgL\n6OTgSdaSZ4r9Bpuh0fD5stak0OTH4KzTXbH/akZc0bEkxBZg7ry34288uMx8\n4Khas0zqhYjIkxcAHyPyuj0wlbDJCIXpDoR6u0dOfZKLbLY6/DeyzgakFttT\ns/alHJrR9/ko1BE+YjMpW92vy69FRG4gLxOzS3ahn+YJy+PszleRiJbyLZei\noFSwa4pmQGQaIxNqC5GkuNV9GTW4kk50F9BZbfNo/6zTIyEW6zsaMgBhPM3a\n9mQQc5ini8tg0BXhSVcOsbeU6uM9nVtW77gSGVteILaueiCVZpp7K8TksX/S\ny3eE\r\n=DZA6\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"3c1bd5b1d6d6453c4f616633e1d16b1fe0812814","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.0","dependencies":{"tslib":"^2.1.0","@material/dom":"11.0.0-canary.81911b707.0","@material/rtl":"11.0.0-canary.81911b707.0","@material/base":"11.0.0-canary.81911b707.0","@material/theme":"11.0.0-canary.81911b707.0","@material/ripple":"11.0.0-canary.81911b707.0","@material/animation":"11.0.0-canary.81911b707.0","@material/elevation":"11.0.0-canary.81911b707.0","@material/typography":"11.0.0-canary.81911b707.0","@material/feature-targeting":"11.0.0-canary.81911b707.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_11.0.0-canary.81911b707.0_1615487014389_0.9738335333168302","host":"s3://npm-registry-packages"}},"11.0.0-canary.9eeb35c38.0":{"name":"@material/slider","version":"11.0.0-canary.9eeb35c38.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@11.0.0-canary.9eeb35c38.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"7c06855b946e01bd117fb0e1fe3d64d21f6a5031","tarball":"https://registry.npmjs.org/@material/slider/-/slider-11.0.0-canary.9eeb35c38.0.tgz","fileCount":38,"integrity":"sha512-Dexy4LmJim4LIBB8dBOwg8bIXyRp+wuF6I+enGnge7t7Ji3hIiE6JI2DM0HU+Cz3AWybhxEmJhOUFA8VyJYWog==","signatures":[{"sig":"MEQCIF2RZrveRQcEIqqhvNoq3qxv3UGiVdAZ2nmTzwImmGnjAiBJzS7v6SHPTybl38JJxqkADkslqdU010xqR6xNF1K8QQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":804501,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgSnFhCRA9TVsSAnZWagAAy8QP/2uNtKzZOd+seCAftgnZ\nZ8SB4zoQr70h1ZbQivLwgQfyvKEc5pdT19wd/TPYYWQ+5/xvHo87JV0JwTv4\nAGLEHvF+A6DXcSgTk3+4hThsIhX9dhWeZ6HXz/aQKTspYJ8R/MbhfM0W727R\ntYmtktvjp6OxHvd7wsb/RrR1Y6TU7KTd2g6wFNDEc9LyLZxYy3Xdgw9uEVMu\nB2JNEwd3nVuErnfBxzi9RKeaCu/cLn5LK1xn+diDBuQbzgXJRi4QYXn39Szs\n2tHU43u5sG08R9iiBu3B5pTvqRekQefnvnm2/HofTgfRaov8mWPcmxpdHtzC\n2ypUoH5CLhHD0iwv5tlW9YO3sxFUNrLVJAcbk92iC2t4KCXCyOsnEHgAJAx5\nmuJJEiGuPjBs4k6EA0f0WDmpsd5aX7LtWrkTcDWNseCjoGU5tbl41zohhc2A\n6e7tGXRZz+qLsddRuEg6N6SUl9tLYcUmJClI/QXicBtQw0/QQo99VHgqeYAt\nvAtGPXc7zs/BGsv7hnj9DN7I8+t1q71Du4UHNMYfOUTRf7jzcJLCS1z8VBi3\nwV/YXsPa0k1+OIiiThI5HyImFBF0EPa3YaflzQQWZNY5DV813oTQnWXIRHeG\nqKlVyY+shH7DrXAVvei6Psrp5Mk+wb2qJKWT8T/Rh4a/5PJSCBFBvampmigp\nyuIY\r\n=h4hP\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"147a2a556e5155bedce0b0f267f64c26cf87d0bd","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.0","dependencies":{"tslib":"^2.1.0","@material/dom":"11.0.0-canary.9eeb35c38.0","@material/rtl":"11.0.0-canary.9eeb35c38.0","@material/base":"11.0.0-canary.9eeb35c38.0","@material/theme":"11.0.0-canary.9eeb35c38.0","@material/ripple":"11.0.0-canary.9eeb35c38.0","@material/animation":"11.0.0-canary.9eeb35c38.0","@material/elevation":"11.0.0-canary.9eeb35c38.0","@material/typography":"11.0.0-canary.9eeb35c38.0","@material/feature-targeting":"11.0.0-canary.9eeb35c38.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_11.0.0-canary.9eeb35c38.0_1615491425195_0.323305731813613","host":"s3://npm-registry-packages"}},"11.0.0-canary.12be3e95a.0":{"name":"@material/slider","version":"11.0.0-canary.12be3e95a.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@11.0.0-canary.12be3e95a.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"96f5488b0b9f35bc18096daed846bde7bc844330","tarball":"https://registry.npmjs.org/@material/slider/-/slider-11.0.0-canary.12be3e95a.0.tgz","fileCount":38,"integrity":"sha512-p59WxkA7KAObI7lbI5Rfk1mZOls1+HSOY/qO+p9OGBvIw/yreaNY3TxatEJ7Dz2ZEa6J1zP3CKUnXiExdHvFNw==","signatures":[{"sig":"MEQCIDSn6RhJqMzwl0dhFUMVt26rPMFjTM++dfWClppDFzCOAiBW5LNP5SdACETWBJUSxt6ZM1rvfdaPeIRqFGSJVqZAYg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":804501,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgSncmCRA9TVsSAnZWagAAOugP/0DCIWBh8Zz4yF6CIjX2\nBbL0DTGmeOrZ5ET5ucjH/f0TTagF5bKTBECEiPkJc2cpJbk9qdZOgVXoEGdJ\nrDfHq9l4b9W6JYsxJwqvVxobQNSHq6cfgjetbiO44XLz78W0ELokJVC+bpLW\ngRJUOCegubZuU56ihUU/G+c7J6/qcqNYEE1aIoKKAs203OmCdnvDLeFStcf1\nQaJWDURHwUNTbegEaEgDtjgvkLv3vITL4UW6DEPstc0Na1sBPITDfZniGYo7\nPiXVPkL39BKzSsGtjDWdFY5i9FwW+nZSzfn9ScFJ1S+XRhBNZvF/v7goxZ89\nYTqfWi53GaB0lhTW//ynMvPh9q51JBBZgwLTjF5hvxFb9MxevarBx811oPqy\njGNw/vElrYk0x73A1+73nrzvdcvkPGFPb0FwxP6PNanGuXoqRESJA8h3zv29\nvYkE+mCAtuDOjvqF5XKbpXJNlgx1ZlYcwGBEjLhvI2HkvMu0y1TBX8yAJLqX\nOimonTuuPCo9mQ7jRtRD6gakyeR0N6AgY6QmQQ3J3O7DN7D9gx56Ks9t89iI\nfPSxa6ldUXWu7nEG1saONeY8fki3U4aEjtYsLWUkzRz9l6D1yT2wnwlM4BO2\nWoqwJfP1eLE/f87Yv15W0OCAdOf7UChgwPr8zLy3zyhWP1j6AdRO/RdiOpzS\nsDG3\r\n=9djz\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"883077446617b632d698e09818dc9d5903a7586e","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.0","dependencies":{"tslib":"^2.1.0","@material/dom":"11.0.0-canary.12be3e95a.0","@material/rtl":"11.0.0-canary.12be3e95a.0","@material/base":"11.0.0-canary.12be3e95a.0","@material/theme":"11.0.0-canary.12be3e95a.0","@material/ripple":"11.0.0-canary.12be3e95a.0","@material/animation":"11.0.0-canary.12be3e95a.0","@material/elevation":"11.0.0-canary.12be3e95a.0","@material/typography":"11.0.0-canary.12be3e95a.0","@material/feature-targeting":"11.0.0-canary.12be3e95a.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_11.0.0-canary.12be3e95a.0_1615492901865_0.11704691535285838","host":"s3://npm-registry-packages"}},"11.0.0-canary.e683bdf4a.0":{"name":"@material/slider","version":"11.0.0-canary.e683bdf4a.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@11.0.0-canary.e683bdf4a.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"b69a85dc4e801fd4fea014d71d37200a8dc6f6f0","tarball":"https://registry.npmjs.org/@material/slider/-/slider-11.0.0-canary.e683bdf4a.0.tgz","fileCount":38,"integrity":"sha512-HyKJEAU92ZEhCYj+iSnygr3yPe+uu0MJxk9xP+Qxpkba7yENwX3S/gL6gNMxRle417XfPW0DbUP06CdxQwFdJQ==","signatures":[{"sig":"MEUCIQCDcQpWK3R0M8f1eCPu5s9oHphyiFlzeKSCTgub85CL/wIgQULRsuoP/LMmWTguT7ZS7pzWAr9WwJkG6V0O19bKH1E=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":804501,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgSnjeCRA9TVsSAnZWagAAzI4P/0+0OMvwv91mkZFVSRYa\nU4PXU0MUDXAQG+T5dvX/IXZxNMxTMrkilKf17szMBlz7gJhflTtxU7sgaW7E\n768KR0nI5MmBFaMYWret6UoelR2chBuO54YKXJs3oEkKku1KJF9ZyACgzjKy\nV/m18XADLDnV2RoVnot7fYbXcSxV0RdfAluP2Y+h0E+oUU99X/GbNAGq+UaP\njFJzMe4RT5f2F0o+3Mpyzy2tMNgLrjxWDmrXsmuqvztL95GnDeJgIoQfa03f\noDEuty8L77kr/X+CnMK89TtkwuJafflTFonTnVKs/+vh9acVAapqdcfxdCQ+\nLQYdXXAdTgXLDdOvlpTqNkP5LNMjXNs236jToEPKxSyz6l2BqxhgdlFCE1Y0\nkpMgJd1rMxtBn1Kh8T1uNnWLGb1jwGoxw9epAJJSrSFtM6FxY27JoTvDAPIk\nzATrPSY1vLV4eHoIW3GSk9yhYwecAl205+DyXpAsViPdloIw5NNJbgfwuFyX\nboiQGCQi4HSlsiQiQ8I1zCD7kaeCeeVgsI+GENpqwWeP7HvoiWABktRe5yY1\nPpQCjCYwH6TgL9+LzRq4nTIUOQ59IIxfTPzmNYBc13/7FfOzlNwUrYwWznyy\nQkEpOw98dAgmLoSMfMyQwsyIctp/0Zvor75biJ8xVJiwdiR9gTnMuKsPC0GZ\nvmgB\r\n=BqHw\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"0323fd7f39f825f8717fba8542628d111777ae35","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.0","dependencies":{"tslib":"^2.1.0","@material/dom":"11.0.0-canary.e683bdf4a.0","@material/rtl":"11.0.0-canary.e683bdf4a.0","@material/base":"11.0.0-canary.e683bdf4a.0","@material/theme":"11.0.0-canary.e683bdf4a.0","@material/ripple":"11.0.0-canary.e683bdf4a.0","@material/animation":"11.0.0-canary.e683bdf4a.0","@material/elevation":"11.0.0-canary.e683bdf4a.0","@material/typography":"11.0.0-canary.e683bdf4a.0","@material/feature-targeting":"11.0.0-canary.e683bdf4a.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_11.0.0-canary.e683bdf4a.0_1615493341491_0.5893340976325041","host":"s3://npm-registry-packages"}},"11.0.0-canary.a07b6d486.0":{"name":"@material/slider","version":"11.0.0-canary.a07b6d486.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@11.0.0-canary.a07b6d486.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"413a194ae0503026c14e09b06ee06e7237d07a59","tarball":"https://registry.npmjs.org/@material/slider/-/slider-11.0.0-canary.a07b6d486.0.tgz","fileCount":38,"integrity":"sha512-og1glNKwWQsmHphgbplbQ/88FuiSfZfqxeftzs5B+NbAHHvEo6MYHOmfvXzLxLzxjuS0ASpNLX3Lrw9EtIiQmA==","signatures":[{"sig":"MEUCIAuFzsmNoGQ8h3mRdfLJ+7GwxnIlP18dMhtyMBDVkFtZAiEAt8fPB9JLZETI8495Ltrko/G0eqn5RFIAp50g5ZYyl+c=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":804501,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgSn6UCRA9TVsSAnZWagAAR94P/iJTG09lmVzcNhsIJdAX\nQ6bxIXtvej35UCgPo38BjaKNa5IaN06kDDbaRM8Eq3gDYWliDVZhAXCtkjeo\nF/iksYcg9wW90O1bAIiUW0snh7EoYWsoz2E/+xjCtugihEnqyrKIOgZxYuqx\nu4bNc/Qjsul0YnueSKAdq4zwgLyJXHXhQly3/uf6xmQEg5pcFiHL7Q4fWmFe\ng0r4VdwpCT5RoZhEF82YtSdmTED9jYiIyypnhY4ftSO0mKGYCSoCFV36PN2x\n8z6/sLlb2IAJwVMwosfNmp4uHGEkK/yjCdrMIUzXVQUmEFM8aEc2vEJmqSxs\n1PM/8GhF9LF3R0sSoQQKZGgRbN+lJe3yqgHGHYtxWJpXesNu+bOMep8gt1BP\nWNT6Fpvu+5EK86/Ad7mE5bsW8u9ogE5INoFgJ4YLvRz/aqXLm6MhfqOOObOi\nzq6Q/2SWs6DnMCOUQb6LIy8FSL+Npi7+/m/b/2iSJHdDFudgy8Tev34bhIFZ\nvAnCrAhOIXTWDF5c6nUHH/6p4KFBxB6vxqhbzIDKlOaKDiEmORu7Up6ipKMS\nFBhaI2sXGMG7PPdFoTgspW5IKsREt3ENFpHMmk5WYMNh00ILP+FdTssb8tBU\nNXuuIHmIFRB+99dw1B6n+wvuMvsVyu2/qa0cnwnIpxwzYXxDoyiIMzt4Sr+c\nCgQk\r\n=Plyc\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"425bbecac77849f8786f0a32de18a168e1874c9b","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.0","dependencies":{"tslib":"^2.1.0","@material/dom":"11.0.0-canary.a07b6d486.0","@material/rtl":"11.0.0-canary.a07b6d486.0","@material/base":"11.0.0-canary.a07b6d486.0","@material/theme":"11.0.0-canary.a07b6d486.0","@material/ripple":"11.0.0-canary.a07b6d486.0","@material/animation":"11.0.0-canary.a07b6d486.0","@material/elevation":"11.0.0-canary.a07b6d486.0","@material/typography":"11.0.0-canary.a07b6d486.0","@material/feature-targeting":"11.0.0-canary.a07b6d486.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_11.0.0-canary.a07b6d486.0_1615494803670_0.08900356082898497","host":"s3://npm-registry-packages"}},"11.0.0-canary.1e0653477.0":{"name":"@material/slider","version":"11.0.0-canary.1e0653477.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@11.0.0-canary.1e0653477.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"43b1107a239cd7612c0f7650c0ef13aad4377257","tarball":"https://registry.npmjs.org/@material/slider/-/slider-11.0.0-canary.1e0653477.0.tgz","fileCount":38,"integrity":"sha512-wxc7esAaV+dejY4C28iHIQl8mlwCH+rqOYyJ964aJy5mPuLukjdAoJWV3XVHV8MvLjrrakQtqktbvztG48+m9w==","signatures":[{"sig":"MEQCIHXXvDP3KEW3MD359x7WsYn2iIX/sZ1hSf1La1cb94eZAiAcBJrkPl5lPWR2vAPXKPrfPZd4YHgsS+WAbBwBTn6LlA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":804501,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgSoBMCRA9TVsSAnZWagAAvKYP/iZIvXAOobMJYyQ/6pVQ\nVKbyUP/LJ+WTqdSwjWefkHR4y8OQ6vEV9GBReVMGHLTvKUMZS1inGqqEufXE\nnYEar0zeZbhD//J2vVRGGf6sl/daJoHEzoQbMVzvMlTDGEV75jzDamkAXijC\nAKJRPdsxOLdrX3snTpCzL5LXXrQ+EYagPbIsgjarZHeodBwTrb/IWZXbyEUg\nCQEHcSKqaRgalntNz0qhjNIkc2Z+sfi2/Vguu5p1dkE03xTVy9Du9FmBx2K/\ntu+RgVI9UhcppFmgl87G3b9Tzs3KwBb96MI1MeKR6QCs5Unwc2InyaSLETNa\nJgCMib0JOYXPCfx+Y8N00oCpgBlWgsbDtK1OnqdEAPsJ/cW+Qa7Z3fYO7SvR\nHecf48pTxtqhh+EdTgNtzV4GoW6IlAw/Bk+b/R8hBwDHA7F177/DPyBuh62w\nJrefSgzsPsHNv7X9VV+xkd1TMryA+VbM8iXhlgY+XwPwHEnUj77m29XmvEDb\nX9hLClGFaeqJwtxeuRv76ABvJht6aIXIzb7fVkw7heCCvdTA4qDGhFo5dqcB\n4Z8O5mdJFMXmE0hgZyYHvd2PK1WphFwRdBV6GEq6H4lNsedMrZSdUkKghjX7\nRBfQkkQe6SzF+PdI7H/i56kC1c2vjQsO9R3conzboySuACHY7mtwy/J5agtr\nEJWz\r\n=a27a\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"6130e0fb82d7c39da4ae1e02df8f0851da419fba","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.0","dependencies":{"tslib":"^2.1.0","@material/dom":"11.0.0-canary.1e0653477.0","@material/rtl":"11.0.0-canary.1e0653477.0","@material/base":"11.0.0-canary.1e0653477.0","@material/theme":"11.0.0-canary.1e0653477.0","@material/ripple":"11.0.0-canary.1e0653477.0","@material/animation":"11.0.0-canary.1e0653477.0","@material/elevation":"11.0.0-canary.1e0653477.0","@material/typography":"11.0.0-canary.1e0653477.0","@material/feature-targeting":"11.0.0-canary.1e0653477.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_11.0.0-canary.1e0653477.0_1615495243601_0.4325485113118883","host":"s3://npm-registry-packages"}},"11.0.0-canary.148e8cfcc.0":{"name":"@material/slider","version":"11.0.0-canary.148e8cfcc.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@11.0.0-canary.148e8cfcc.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"9302684ddef90a9328452b9456bc311c937a6ff2","tarball":"https://registry.npmjs.org/@material/slider/-/slider-11.0.0-canary.148e8cfcc.0.tgz","fileCount":38,"integrity":"sha512-JGlFDEBCf8hiL10uSskIVC+Q26yAg+kDa+ErEINifbEkX5CEkylkWILJusrXDyljIofP/zxIaADBPg1pVZJGDA==","signatures":[{"sig":"MEYCIQCyiKaRijgCKNP3r5PdYCjfd11gVkJq5fmkh3a0kxiqnAIhAI0sMBmmX66uJlGqp2EpG+bfC4ppbM74f/y3pi04ir0Q","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":804501,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgSp1LCRA9TVsSAnZWagAAK6sP/ihzIo5IjGkOwLCS1tUE\n/P13nJ32pHyBwSWenWJInJ9cXu8ziwBsTOBhbUeUaGNT5gtibWlkhdnC6712\nmsYDwCSpD5oOEkH1w1Nzu4a5zqDxD0FkQRydGwnDCDgRusxwDRmMsIVMvBTT\nXdCkIsFkcts4RnjOw4pjNFfwsA4I8WJOs32NNavHhwQgzHRR2Je87jGw+3ZG\neCJaTNSicRwveVTQ+vGIunMqmzpW3N5a5U3dk8w3borLmRVUKTUBLf2kMoF5\nrnlQ+B4s5uskOaKyQyhMozXjX2QmCiChmfniN/wNay1+M/8T8EhN4qdHFJKN\nkbAlddjzufv4yiQhqiQOTDgbgPT66E3D2WuPGUs+r/nDh+ycCPOlTHjfkK/0\n6Ssf6GbiJySp8EaaaOQAW9ywuqodxYtpfWPSLdDRtLet67Oh9DXxCtdkXcTl\nGN5pFy+TbgCAfXuDxHY098dOc6ai/ZpJ1m7V+ahS+tDJwWDHpcs3M8Wc3Qe/\nIdepra8GNAQnMuM2URKh1T1jVfP5qFoEscpFag6kybWkPEkoJcIdJpQQj7LA\nqbVJYnjmTLXYVO/3DmUrmLrDx2MhHPdtbEmIZLpFDL5PUTEVXe8vYMoT7ZOs\nvma8Vtz55yBBx48zgfUU4pdfTSGSsRwwXFvcJqFMrhJy6zyqRVW2B264o3wA\ndqkX\r\n=u6AU\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"2e686ac2d72b7a249bc4deb8b09742bba99ce581","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.0","dependencies":{"tslib":"^2.1.0","@material/dom":"11.0.0-canary.148e8cfcc.0","@material/rtl":"11.0.0-canary.148e8cfcc.0","@material/base":"11.0.0-canary.148e8cfcc.0","@material/theme":"11.0.0-canary.148e8cfcc.0","@material/ripple":"11.0.0-canary.148e8cfcc.0","@material/animation":"11.0.0-canary.148e8cfcc.0","@material/elevation":"11.0.0-canary.148e8cfcc.0","@material/typography":"11.0.0-canary.148e8cfcc.0","@material/feature-targeting":"11.0.0-canary.148e8cfcc.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_11.0.0-canary.148e8cfcc.0_1615502666495_0.8028972577054541","host":"s3://npm-registry-packages"}},"11.0.0-canary.73a227194.0":{"name":"@material/slider","version":"11.0.0-canary.73a227194.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@11.0.0-canary.73a227194.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"5e30e3e5467dce7e0124bcd6e435490a58e35b9c","tarball":"https://registry.npmjs.org/@material/slider/-/slider-11.0.0-canary.73a227194.0.tgz","fileCount":38,"integrity":"sha512-oHh8JZyy+dxDqmAwf3UB5cn91gGUUhKuKISNtkZGdmpdcM/DnfP1hYj+GcCLkLg5kUmZ24UwCKh00YdAQjtrmg==","signatures":[{"sig":"MEQCIAimam8//8prdhqPdz27+KWTP4/9H4KBLzOoRnuvKszTAiBTnzv9D2BwhQoXLjSfYBo+8lHgv7AMyn+XwfG84yyQnQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":804501,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgSrSuCRA9TVsSAnZWagAAr0IP/3fjGmk/N1vuw5LXMJ4u\n3QgB+qro8ZSAwSo0wA6J7tdFoSdfcT7eoS0z+F5GXjrInSkERGFVb9IoTVaB\nY44Ym4zWDnEBedSTiLCmOUgQ1yIkR1EbcO6vdrW/pne9Er2vpgxzgJ2M/E5v\nU2CsgMIJvTDRSN6ROTQuZ5TntyDE9WHD1d3eTw7P37+zDGbSaAhMU53FtmmU\nci/4vdh4O3wp5FV2/8OmOICIfHvYi9zUugHBfDpzaOoBzJv0cwP04JQyZfic\nMuJU114VoeQBqi8f1LzlCXTUaFymWquVVgIrI9p2aZFWrAP/tML86ly2G3PE\nSeD5Czd2mV5eHUf1ZJQ36xxa7Ape2m3/5OPOMOxHxdIVcdcK5O+g4blfDBzE\ncPbjV4hoPVj7E+0p+rJK9U+1z2/EUf+GHkRrv7sL9HD8sEUphP9zzsrR0JMB\n9lB44S5DUDtg8qY0L+CHLxk1CXCrpOUC9nfalY/YI5ZAAl09XsTfh1Ukj0jg\nG60O87OB9SjopLBOnYb6pA5+ngdtBvAiJ753ciCc2rS3MUmQBJnIL4DS64YY\n8AHIsV2Y3bP0xxQnL1WV3yXagqcgEx9PTRZDxNc6usq/LEMohEH5/aAZucfK\n282BH3J3/uZvPM3Q6RkL1jaNAiqflwpbzfbaKtbZMlRV8JTrRZaC+kI8TwnF\n1e9H\r\n=QkHQ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"3bb5344393057d23abf5414ff61402a5091ac74b","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.0","dependencies":{"tslib":"^2.1.0","@material/dom":"11.0.0-canary.73a227194.0","@material/rtl":"11.0.0-canary.73a227194.0","@material/base":"11.0.0-canary.73a227194.0","@material/theme":"11.0.0-canary.73a227194.0","@material/ripple":"11.0.0-canary.73a227194.0","@material/animation":"11.0.0-canary.73a227194.0","@material/elevation":"11.0.0-canary.73a227194.0","@material/typography":"11.0.0-canary.73a227194.0","@material/feature-targeting":"11.0.0-canary.73a227194.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_11.0.0-canary.73a227194.0_1615508653540_0.13489277638674824","host":"s3://npm-registry-packages"}},"11.0.0-canary.f8579b7ea.0":{"name":"@material/slider","version":"11.0.0-canary.f8579b7ea.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@11.0.0-canary.f8579b7ea.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"d23b7de9911b4eef4d30ed8b9a468fc4c41826f2","tarball":"https://registry.npmjs.org/@material/slider/-/slider-11.0.0-canary.f8579b7ea.0.tgz","fileCount":38,"integrity":"sha512-eI4IH4DgR7hqZID29msFXdr7/RLCNCK01NwcO32ZXuWTNazwxAnHFi2C1ADLtz4GkEW17ZsCSmIzwI+gGvQ57Q==","signatures":[{"sig":"MEUCIQCqiQSfQ/rVNsibf+/WzeHLW6QLCgAE/9nslsoces3vqwIgd6y7aja2nDTkTLDcFb4ML0ECnMw21heuFWy6UiLW7jA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":804501,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgTB1jCRA9TVsSAnZWagAAumgP/0sYGU2j/jPTivIglt57\nRJmR6ZPRfrkg5yvop7vkRz6lc94hh/k5cMbPpQmWHvwaliTSNdqNGCWfQ3QK\nTYav4cCMdJDB+7+75U0gFD082sXZLcBji0MjfkO7RrA9ZDkbBDWGeXcsD8uY\nwLj7lGN8+EmsmBBDMpQPXNfq505Wf4+HK2D9b9VkhC3jG0Ui1OyQPaFlOtdZ\niHPouOVM8/5XwFaT8wofAHngS8lVXnVaTWzJoTNlcG2udIgD5cYaBMbvrryM\nvGfZ1bxol//MIOcfiyvxXBKQpGiWHKd5sQAQoZutc1VxQ8RYi18KodRKDd8V\nELs/FjUik6NL73JJxOQSEqMCJLzdIuwxWSePTp7R0Yrau1XNz0hT3w+vadlg\nfwtWo2u122WQ2fCQuH45f2oO2YXfhG+yIgorT/gPJ090lwy3gLwkrSOnze55\nRgYQg4nZeA3x8Xxpfs76SyXHOmwvZtKcomGlnOXVD4HhBcwd9fRf2tt8/+44\nCSBrw3OOkZVFLzawqTOXQlO4n75tlJq/acux48H6k0dNdwkWN7cle4hVuX7J\nXS+KZvYQdtjCa/Y4GXwL74hFRPumUcxmisDI3BQbOxHoPDSDZwfvPZOmuvXe\nx3ZmEUEm94LtJzDEteFkIM+TGW8/LHwaqW/xI7ejWHvyoe3pZy0mWUwdFvbQ\nXEOC\r\n=LWDT\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"8b1a0816c0d3a68a851c5e6a199c4a9ff75cce07","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.0","dependencies":{"tslib":"^2.1.0","@material/dom":"11.0.0-canary.f8579b7ea.0","@material/rtl":"11.0.0-canary.f8579b7ea.0","@material/base":"11.0.0-canary.f8579b7ea.0","@material/theme":"11.0.0-canary.f8579b7ea.0","@material/ripple":"11.0.0-canary.f8579b7ea.0","@material/animation":"11.0.0-canary.f8579b7ea.0","@material/elevation":"11.0.0-canary.f8579b7ea.0","@material/typography":"11.0.0-canary.f8579b7ea.0","@material/feature-targeting":"11.0.0-canary.f8579b7ea.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_11.0.0-canary.f8579b7ea.0_1615600995181_0.96259971647615","host":"s3://npm-registry-packages"}},"11.0.0-canary.d2a39d300.0":{"name":"@material/slider","version":"11.0.0-canary.d2a39d300.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@11.0.0-canary.d2a39d300.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"5a61c689c9dcf1d32dc4aec9a9a86312e2916390","tarball":"https://registry.npmjs.org/@material/slider/-/slider-11.0.0-canary.d2a39d300.0.tgz","fileCount":38,"integrity":"sha512-biaQht9M6VgY3XxrDCjQpLKxgvNAl1/6qaw4nKbR3LB2FZallpzpGA54wSZI2yqyoWLIklrFxLjPdzrcBYeAfQ==","signatures":[{"sig":"MEUCIGMZC8qXCN/Z59JaBWiCiD4oanjNjm+QT5bcW2ujaAvDAiEAjtSl9G1omoEkXu3445zmpnuHjllyMXnSqLMiqP3SrEc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":804501,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgT/1DCRA9TVsSAnZWagAALwIP/2ls+ZF2++vivJ/2RFkn\nfa9ZHUbm8CbeyDoI6H8ea10ipxAxd7DA8aKFKvjZGCunwQxiaxssJzN76iod\nkfn9bOU0aywdgxSY9B8PxRJIeJYTJnhq9bxiN7r6SVQmAGX+p5odIofP0kWM\nyCYaMNrxrQSlKN6xT5FttwQ8jjheFf3Xw7NG7DYT9tQoXIgM3q27ZG0LRfwb\nZOep3Oul1cRBsZkOiOOPbUCwBpHvqPs6/ji1ctDbTBBGLziDShEmlX0biM6d\nb/vZbL9tUIWHUe0zSI+IxivXrJpOfd3Jomo4GJg7jE5TW5aJdkXB2Bs0+yfP\nIgUwwl3mD6jPTjYIT84hzEL+43Wv2yC+1jfvtBrHv9NRvJRdojwEV3taug7R\ndM+IEdnVna7WviEsWSpEM7rPhGSpLxPrZbBgbpj43vfo1lq5bQszAZc6mICP\nAFNmIOF6+r19fpVhHG2BsyFVhnf/VP4rjqdiak+sykWFSgvSO312pTjaa7wL\nlxRyzFdR1fb1+Wm/RHqBoMQl0FHbDHk7H4tefK6/9k9ZjMpk/lT3bpJ7Flc3\nSlxwnFBP9Jxq5TTIYGPK0KMF/kVHHTiNggeF4Ymcj1sLkdxLQQvlFoJaQNUQ\nzA6anMP9q1e9xbHeI8H9fHWB+bYMD1UaRqPNozfVakJTfSn1NgJusSsJOJ4m\nwuNS\r\n=85T1\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"4e928ba6e35dc70b34314c7509f647a6fbc4be00","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.0","dependencies":{"tslib":"^2.1.0","@material/dom":"11.0.0-canary.d2a39d300.0","@material/rtl":"11.0.0-canary.d2a39d300.0","@material/base":"11.0.0-canary.d2a39d300.0","@material/theme":"11.0.0-canary.d2a39d300.0","@material/ripple":"11.0.0-canary.d2a39d300.0","@material/animation":"11.0.0-canary.d2a39d300.0","@material/elevation":"11.0.0-canary.d2a39d300.0","@material/typography":"11.0.0-canary.d2a39d300.0","@material/feature-targeting":"11.0.0-canary.d2a39d300.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_11.0.0-canary.d2a39d300.0_1615854914507_0.5289763816786712","host":"s3://npm-registry-packages"}},"11.0.0-canary.7cf67823e.0":{"name":"@material/slider","version":"11.0.0-canary.7cf67823e.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@11.0.0-canary.7cf67823e.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"f0cd7a0c717c513ae20575e985f49f66c4dd964f","tarball":"https://registry.npmjs.org/@material/slider/-/slider-11.0.0-canary.7cf67823e.0.tgz","fileCount":38,"integrity":"sha512-I7cazqzbdOejc9UU5HO2QZRpQZdlfreX53EOQQv4ZktUYQfUMxFmIAOA9RNIVw/w9pc4pX7L1xscgNaXgRLaVA==","signatures":[{"sig":"MEUCIQC/Z5EN9I9tEJ84ufD7/0mUSgXqbOp3+r07DHeQ2WM4UAIgakZAwJiCQ/o6cUjhf/oByw1D5xRgXBity/akVGQIOLI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":804501,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgUPbjCRA9TVsSAnZWagAApSAP/29QjR608lJQF0p6Q8fQ\nJ432b6JRKvLCFjE05AkR/bU/VFTLksyOb+Efrvo79HLfq4duuO/E6rz178zg\nKa9FYFaikfYUlieUcIxpS27GnEyfQ5MAwe3E99m65AjwxmwseDQwGyzXyKdA\nmi6KHohq+Vkt3Bcp8pkQQj1ds/WbbF4LV+uEBdTy7/79SqvneoaUB9JB1QQ/\n5XOzK4/ewuZrcADg12IQlvVwB6EspnTRskdJGQeImMmVAAI60XpXUzWXZP+A\nuUDLHU4ln3YMEJurNu8infZy7GkOXn0DFNQzgDXPuuSAxiG8UWsj7nTWuzuQ\nufJiKIBR9jFGdA5LqGqtK7XL46a9N1jbe3Iy3d2hy8kQ7ppLVse0ww8ph5QY\n89tkPrRIRrjqhwNhwholUvRPm/NoYv1SPz7mOUFPrZNE5lAbZCccgJv8WKZS\n4wZm5+AbUHN6qMQmMeBgAngOMUf44BrVHKTOibiYTGq/uEmwMEIqqhAU5yMU\nhSHTrnAGK9XtlwpC4SwDJLm6T4GXwXMH1U1U3EjWu2yJdyiN4rYx3rpsB3fw\nR6opDXEOcwq7ZTBEoSTx+v+w6YI01PeNVkJkz/SSfRzsJ5TubXLvyyciI26q\ng7JozXS7ffzK98MqvDwrKqbTES9NyOlUszID/ClCirPU5cQxVbihIgRnPlkV\n9lEE\r\n=WX/4\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"afabf42a48ec8775fa133ab10e023c1b5d2ab802","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.0","dependencies":{"tslib":"^2.1.0","@material/dom":"11.0.0-canary.7cf67823e.0","@material/rtl":"11.0.0-canary.7cf67823e.0","@material/base":"11.0.0-canary.7cf67823e.0","@material/theme":"11.0.0-canary.7cf67823e.0","@material/ripple":"11.0.0-canary.7cf67823e.0","@material/animation":"11.0.0-canary.7cf67823e.0","@material/elevation":"11.0.0-canary.7cf67823e.0","@material/typography":"11.0.0-canary.7cf67823e.0","@material/feature-targeting":"11.0.0-canary.7cf67823e.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_11.0.0-canary.7cf67823e.0_1615918818511_0.4712438231370284","host":"s3://npm-registry-packages"}},"11.0.0-canary.67d780c79.0":{"name":"@material/slider","version":"11.0.0-canary.67d780c79.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@11.0.0-canary.67d780c79.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"67e9b3fc28429b7d460ad0bc0dbc5b5a8db51b97","tarball":"https://registry.npmjs.org/@material/slider/-/slider-11.0.0-canary.67d780c79.0.tgz","fileCount":38,"integrity":"sha512-YhV090spuzjhldxPQpm8kbLJ8o0LSlB+dtojgDBttCKkHtLd9oIXArXlj4jyUPna709RjHOqj1fwDfZPCn0P6Q==","signatures":[{"sig":"MEUCIF/LtJ3brhTQDvJHT++H4698h9Om+ErOOPEkjsIu7Nr9AiEAkfz1ziqifMBbX2id2w5rx3uBfRXn3oo/2tIsAbYzTjo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":804501,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgUQtyCRA9TVsSAnZWagAAhhgP/0rPDYDYJ8D4Zrn/3IcT\nfxR5MbNunnFxac89dr/KDeoTMz7oWkjVRuG9WHRDZlincDnIr1Q4YHjVNVGJ\n3oMEK+yrVC/C9xHeEBnmDGbRmDewDnZL/d2f02qroGkt8RSi+xyY3F7ylUpc\nVXNZI5VqWLLIyBZwnZY1szymrMHfKcQAjIWTqubULyUsNxFv50ddCuwZTBSB\niDJBso5k/MBFnXLxuhq+Xo2SjRlc1P104aelSLYGzbr5u2C6Lt82VReyid43\nnU6912AWXHKrMk2uMA3r52ZMD+JUSN40Gmk+HSuckhDh/azPQ5pYoaq8ujvy\nJoi6OHBm5ALuG17idg44QTgFU36YVug32pgszk53W3y1NAnYy+LVMNOJxM04\n+vW3h75kcAZFebglXRyf2f9HunaWoiBufshQotC/RuwNpyQc6oDGHQlXShCF\nn7C4kf2whY3fLHppYpPT/169NMIgFO90IAIX8uC9g6YR5HHYmGPr4V2q3RY0\nXFaMFYSYIekNKBZLlFLIgGhdwERrzt4YQFlyrGTpaoUMtfsgkVrkYFQNMVyg\nePPCeLj6Mtvw50q7ggZCo3fmKgz22R4iPvG7yh5OyeJICY2hcLKEJitGNbfx\ntzkSD6j/ZjsooxXY6A7haCidZObqJxScP/zkqVnfHFxa6vmPemt3a9P24IKD\nOS3p\r\n=r6dR\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"05a76ad8cd6b15550e685799fb6b9b5643d7e0e0","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.0","dependencies":{"tslib":"^2.1.0","@material/dom":"11.0.0-canary.67d780c79.0","@material/rtl":"11.0.0-canary.67d780c79.0","@material/base":"11.0.0-canary.67d780c79.0","@material/theme":"11.0.0-canary.67d780c79.0","@material/ripple":"11.0.0-canary.67d780c79.0","@material/animation":"11.0.0-canary.67d780c79.0","@material/elevation":"11.0.0-canary.67d780c79.0","@material/typography":"11.0.0-canary.67d780c79.0","@material/feature-targeting":"11.0.0-canary.67d780c79.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_11.0.0-canary.67d780c79.0_1615924081739_0.5873456652187243","host":"s3://npm-registry-packages"}},"11.0.0-canary.0f358ddae.0":{"name":"@material/slider","version":"11.0.0-canary.0f358ddae.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@11.0.0-canary.0f358ddae.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"19ea39ca0bafa07b987dd8451e3e948474a1925d","tarball":"https://registry.npmjs.org/@material/slider/-/slider-11.0.0-canary.0f358ddae.0.tgz","fileCount":38,"integrity":"sha512-dmMowfZcGThK9sICy6/UsO+FfRTSRjo4PZ03Mehv3gnemH2kaQ7qLh9cVCP1Gh8Fe/37Kg3LXIQRJXxMzaTJrg==","signatures":[{"sig":"MEQCIC62jwvfbMuMCq1t9RrHOxsRHUpzALdENQn+y1mic237AiBYqvsOy6hC7HIaozMn1UMT1t2REeWJDPDAJ3dTUq77iQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":804821,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgUS1QCRA9TVsSAnZWagAAs9sP/2z0epOlQt4exuUKq1b7\nKaRsRq1/M0Q5KDl6uApVBPr55855utcudwAu/rNlR9Olsiogz4m2uHtHm/5c\nanjhu4JtzUAquKFi4DiP9ojbAc1Qy+2FKNLiYhskPnZpD3B5pOb35+3HO7J5\naGYBapY5wizTKaMEVBHaFPPk1jfny6nRZwbqyKi/AV1osEV/REqjr7Ma0/dJ\n6br7i53Jykl4s9PeZXckH8QYNjE13TBhyn5Yp+YCH76kCixOy/ymrrqDZyeo\nn55ziZDqgb6VnhoBbonkV5/ZQO/g+J9Rb8MbaD/yJPTDTUM3sw0cFMvaHpI2\nqZYZtpwemb8BbY5DXpBIdMFj6gaTTxTND0kptXoBTi962KvRI+lq9QyhhZ8Q\nH+g3m9DBhYavTYhh9p4ZwCAOvCW18eyS17ce/JTs3KY4KnluTKfiUHRlBT7X\nlYrVSngUvcAGZxYP5adfsStuMqh9NBtz+8W2mSI3lZNCjSt3ve5GzO7+HGvR\noe8EHHIxBEqsewUpU4cRRKCUXy0V/dehlV+3YkmWRk9609EZZkvLRmaoe1Ev\nSh7svrUMxg1zdGhNLgveYPitOY8ztcF07M906IjLKrFZNjqu2P0nqeFd17rq\nDtqtqvqDwfjZe9SAdb8O1/tU94qv1p4XpzwCWA1kmwG9qDFsaUmRP6e5YqvA\nqolQ\r\n=7ATO\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"6acdc7677f01b6502d0b491a9816d6600ea9cbd7","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.0","dependencies":{"tslib":"^2.1.0","@material/dom":"11.0.0-canary.0f358ddae.0","@material/rtl":"11.0.0-canary.0f358ddae.0","@material/base":"11.0.0-canary.0f358ddae.0","@material/theme":"11.0.0-canary.0f358ddae.0","@material/ripple":"11.0.0-canary.0f358ddae.0","@material/animation":"11.0.0-canary.0f358ddae.0","@material/elevation":"11.0.0-canary.0f358ddae.0","@material/typography":"11.0.0-canary.0f358ddae.0","@material/feature-targeting":"11.0.0-canary.0f358ddae.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_11.0.0-canary.0f358ddae.0_1615932751244_0.3047592053879007","host":"s3://npm-registry-packages"}},"11.0.0-canary.67eb0df80.0":{"name":"@material/slider","version":"11.0.0-canary.67eb0df80.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@11.0.0-canary.67eb0df80.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"8e634b2b44a1a5a0b76b3aa60f851654492f814d","tarball":"https://registry.npmjs.org/@material/slider/-/slider-11.0.0-canary.67eb0df80.0.tgz","fileCount":38,"integrity":"sha512-uyB2dyBVqCOIwUKo36wuU/xA9XfcdyGHBySd5kiuAsZtbiWQpQLSwr68c52BIo4/aBZArEFrbWa4cUCvkDKljw==","signatures":[{"sig":"MEYCIQCLqJXBtCYKFOPrSaijbmM2PRgGMP4yuDPphahG4WgWSQIhAJ5Z9enf41R/yp75BeZu2Oiv5fpzLvGbPPMSOsoGfQZk","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":804997,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgUTOwCRA9TVsSAnZWagAAqYgP/2Anv55y4JFyPwwmsDLq\n+o3+vMfAhTAgPccJRmsFw3/g7iEUgZ1zfQyOSqRLSsfG3mKEpj4MAXRKdOl6\njrV20iWSS+gDtqc+P9mWp3iiFLfD4dwLwAN2du8hqKlRLksoUFAmZRNfMWWD\najfFw+9QqfLag2wB8FPbl2EEb9sVlg2L58OuTlkeemr6ak/TkqSxgKXINJGI\n1bsufBWdjPLqJmpgOwThVACyxfP5P68wzqVOOub3DyGkIcsUmHkUC4EAStv7\nZGJX2tTxpz8BuPsh2Y/VE9/x2IrDgj7MN/H8MiPWgQ67e+mUmlv9vt7+lPQq\ncTJCh4FxR2wD74s4y7JyBYVqQksjXh1g53Nc5ZSUlV18t8nzwtPYcO2JZJeQ\nu92hOXJ8hM1ptZyhEZpLlKuGEmbhtVTglS9w0AAxh00ZriR72Z0NM3JkLwaE\ngpf7LspvUbBu7jF7TA9i6k+GZxT2YBVsFs5xsvsJbSadAKN66Vw0SDSNO6i5\nbGYEg09i9Ph/3Hu4aDmDQI3v11EJ/6hIHeYxqTU3c4v0z3nJm7Z476jH1dgH\nrf38IJIndTnFN9VHmISkNnoxdZ2eyxE1cjcjnY25PeyOCidI7BCFuCF9i/YL\nvrlUyIlqJhXxTvuKg4lpg/+KqDvbFpceclSi1izyw6rc44EqZ97GYZnh8h1I\npTNF\r\n=kSNU\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"5f5e9d259d95bf3abf565622edf7345e62993020","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.0","dependencies":{"tslib":"^2.1.0","@material/dom":"11.0.0-canary.67eb0df80.0","@material/rtl":"11.0.0-canary.67eb0df80.0","@material/base":"11.0.0-canary.67eb0df80.0","@material/theme":"11.0.0-canary.67eb0df80.0","@material/ripple":"11.0.0-canary.67eb0df80.0","@material/animation":"11.0.0-canary.67eb0df80.0","@material/elevation":"11.0.0-canary.67eb0df80.0","@material/typography":"11.0.0-canary.67eb0df80.0","@material/feature-targeting":"11.0.0-canary.67eb0df80.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_11.0.0-canary.67eb0df80.0_1615934384379_0.40317282175356306","host":"s3://npm-registry-packages"}},"11.0.0-canary.941ca3b3c.0":{"name":"@material/slider","version":"11.0.0-canary.941ca3b3c.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@11.0.0-canary.941ca3b3c.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"61ecb107b0fc5c8da7d68aa8e116e18e4b48294e","tarball":"https://registry.npmjs.org/@material/slider/-/slider-11.0.0-canary.941ca3b3c.0.tgz","fileCount":38,"integrity":"sha512-QFSGupOrIGgUCqVVZTGh75Duwqx0X81ZMBSFSI3RaxVdO9qze3B1cTIJdaN3phuWtjVkcaFUmu7+AyxfhXeIQg==","signatures":[{"sig":"MEUCIAVO+gqs1m0fJLx9FUoKG8q7olSbU6PB9tZjtSApMmunAiEA9yf+gV6zUT0dn9pBaXNFdw/64UWP14hqAmtp90QrM04=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":804997,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgUTQeCRA9TVsSAnZWagAAATwQAIZtrjcD53L6exybWkay\nrSde4/9CbYJ0QC9bqoRYKp9qQVWi1LGGa1DVyb9Gl7j45XMuEFOkfaWaFqdi\nQTcYE/ezbqGTCEcX9IVHv15NEhFnJirrCKoHWIgEYbGOoJNBvhE1xnaBqisg\nq8rcKy10tNK8KLzYj9s5NMAeQw3QQ6Zv4HIrjIndZW/p+Q01t5UkFRDTrQDc\nmxgGQSpTKiWEpPtG1pisP+2yHXnNwjV11WyWtbV6fwzbibRkeeHxfrwaSDUv\n5WurDsQcVD3aZp8VlLzm3jVBQGR+P/vIoJHhcwz/2ZHcI9NEi+JdhwwDs+H0\ngItEoN6a1/GJZncUByMKA1vT6TYSLPULAGRE5uWHHW6/CYfeJ3KbR4Md+jMO\n4bjVaj1JqzsXNURbqaCf+KLbbXkuPZzD9MyZ7UBZgLWlbtKxrQZqatTmFNEm\n3QCMMp0XpLkMssu6tDSpuhFDfVsGvpmup+6sc/kGgeKAsT4G58rfOQAzRdri\ncqWgDIxlvgkJjzAS8IpiIpQ7zfwC2I9TxCPGGmD0eJkt8DZODtXMTany1Rpi\n6zsUy0wwU0PUqjhbxyx880EJ/AWwVAhZG/eSUqUjalpKeLSjS6EuT8TGepNa\nwf9cDQPNDZgGLVIteWVFwHZqsMnslYbylkgrHNzYQ0C8ry/+sdJs9fC2ivZH\nCPWF\r\n=JLeR\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"27181e4c2c90af170c9149616613beb6599ff94a","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.0","dependencies":{"tslib":"^2.1.0","@material/dom":"11.0.0-canary.941ca3b3c.0","@material/rtl":"11.0.0-canary.941ca3b3c.0","@material/base":"11.0.0-canary.941ca3b3c.0","@material/theme":"11.0.0-canary.941ca3b3c.0","@material/ripple":"11.0.0-canary.941ca3b3c.0","@material/animation":"11.0.0-canary.941ca3b3c.0","@material/elevation":"11.0.0-canary.941ca3b3c.0","@material/typography":"11.0.0-canary.941ca3b3c.0","@material/feature-targeting":"11.0.0-canary.941ca3b3c.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_11.0.0-canary.941ca3b3c.0_1615934494336_0.823883277632135","host":"s3://npm-registry-packages"}},"11.0.0-canary.3344d12ad.0":{"name":"@material/slider","version":"11.0.0-canary.3344d12ad.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@11.0.0-canary.3344d12ad.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"ac5ad0ba11fed84abb837add82a73161b5fcc19e","tarball":"https://registry.npmjs.org/@material/slider/-/slider-11.0.0-canary.3344d12ad.0.tgz","fileCount":38,"integrity":"sha512-jcld5oUlL43hjm2S7sTaiBp3LyG/3SuxyxR/3IXtZnEgTw5LfPMFzv0WILdVKtmR+6jTEexoRId9cijej3SGNA==","signatures":[{"sig":"MEQCIB00HWW4YLoim2A9QpdR/dk+v8eE0/OUb1PUa63zGNWRAiBgh8HfdmEalBdKwHV2zaUPbeOhQEdup3qiVg9yJYfdMQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":804997,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgUdOSCRA9TVsSAnZWagAAoVIP/RPH9qjnK+FQ30uS8Zlj\n4nrJW1CNtm2OoHt8L9MSiGUV2DjJN3fEd2alWIBRMUPq6muqtrc52X5JdFYC\nm/bSjqk/9v92arUsnsgQ8avYAzhH4vOu2Z+OiVkZfPmaFfWeCbU1Mh/EADNw\nZ5CzU76A0GrdsQcdwgUNNVC01ozx+5Z+zIo+w6b0Qgn7H2AH9jzZctMZOFnx\nOv42rjNjesc1k1m/nhbR9d8P+wmJSQGik5B4hqqZTRMAnnDtabhPc0ymamG7\nbNVN6UjetbtNOi9K9uf7mfTEaOXRs4oNToIC9wg5LCmNOu5yzbJs6fx/2K/D\neclMKJCc17KzPr7+QUDGUuUaJHh90thO/xTFYTaLYnVD4AJD4SjHsfWm19nh\nLk4/2q815sf/koKGSjqEj8X0qytgOxCbWeBp5es8TJ736CA1CqYy3H3tThaX\nMF3hQjlvLjSXylIGuhrZkL0LPy4Jx+64SOFK8tv1DVrYtD/NfPibhL8xm76r\nCYbq5atWdaIeJJrUhWXItJgUR4jm4RSfCogDAliJVXRMNMlcMJCoBV5kg707\nZoGof1yoSx7+cWuGu3Pvr5+dRu8arFNWGRZRBM9lS9HRdsaXUpLTQQGucMkY\nf3mffs0f9/tmHrrcLy1uvT8jZi4yDiqSLZUu4VMQHxhsEHfEjx0V7YBNJn1z\nUU1l\r\n=s2j0\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"fc17c547b4aa66b6412c0b0b56b75978332702cc","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.0","dependencies":{"tslib":"^2.1.0","@material/dom":"11.0.0-canary.3344d12ad.0","@material/rtl":"11.0.0-canary.3344d12ad.0","@material/base":"11.0.0-canary.3344d12ad.0","@material/theme":"11.0.0-canary.3344d12ad.0","@material/ripple":"11.0.0-canary.3344d12ad.0","@material/animation":"11.0.0-canary.3344d12ad.0","@material/elevation":"11.0.0-canary.3344d12ad.0","@material/typography":"11.0.0-canary.3344d12ad.0","@material/feature-targeting":"11.0.0-canary.3344d12ad.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_11.0.0-canary.3344d12ad.0_1615975314324_0.007406066024022495","host":"s3://npm-registry-packages"}},"11.0.0-canary.6072ed604.0":{"name":"@material/slider","version":"11.0.0-canary.6072ed604.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@11.0.0-canary.6072ed604.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"6635aa0790dd4086e6900de67f01ed8729315731","tarball":"https://registry.npmjs.org/@material/slider/-/slider-11.0.0-canary.6072ed604.0.tgz","fileCount":38,"integrity":"sha512-HZtkg47HQOoXAmsWwbvwpglGzMrDL3C3t5P6iU/QWmniEkyrPNupriI4oD8nvde3EEWwtlxgmb9rzkg8n8jF9w==","signatures":[{"sig":"MEUCIHc9qjOL3NMjvY29IyS9qx+Oydt65nuddXFpMuostcEQAiEAjMSMEQhFoKmQs1RPtVS3lehX6sbIIJ9rLk3lzG5QGlk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":810093,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgUonZCRA9TVsSAnZWagAAsKgQAKMLNgRw9f2S6utt0d4n\nHFmgeiAqEbFJfIHUHOvfkAk5QMAW2M4Rt9/vD3M16DzZSbVfit/ZHTf12PK2\nqHzqVrMAKx/cG/4W3gbsN6u1HW9+ygA4HLOfCYyLyU4WJRRWICleVXE/OmXE\no+8dZsi6PP1a5UmSKWlp6noDPuW7P9GO9M7glRSJa72mMaBUmuqzee8QVbEG\nBRJtsnAnHTL4I8K3oui2ZLFeMQBVJFWNPMP4snvp1hWNkgL1pBoZPMIcM5EI\ndd1Oc7V59w+cslfHhNZg83cE7bly3TvuLwNFCV9o4j1gq+hJXGTC8E1NTjzZ\nKPJG0txqZ671Zspa4QQI/mivyFm02Zk2j7VrNvJvmD/lFRAJm4YSa4X0Pk2y\nt4llS/i1mB00EHU2mtblYHUQcUIUq10OtcclRLAOStcpdCowKe/q5lgA9UBK\nsv2IFyBDpp1vOPiYnLcB3rn5Q6yFus7lDk/BxEQrhwVa8d893wAbVsgs6/iF\nPZMCwZ9F+4PMlcBXEGaqmFBB4rXMHELa8vCW1AxTvy73OzBRljLsa8ch8r29\nfXlZMfDBE9/B4g/8Zgq/+FbiJBifoGcKpwXIhnmZQKm6Fv8fHEo0c6xBEVbY\nFRIDxUC9yrLVgeDFgZgmLNeiBXl3l+bPUlZZeBdo4HNs02r8Tinmk6CkEyvk\n2V14\r\n=6Fm0\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"219b085de7ee97c7b75e5f25dc757e7b5240916b","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.0","dependencies":{"tslib":"^2.1.0","@material/dom":"11.0.0-canary.6072ed604.0","@material/rtl":"11.0.0-canary.6072ed604.0","@material/base":"11.0.0-canary.6072ed604.0","@material/theme":"11.0.0-canary.6072ed604.0","@material/ripple":"11.0.0-canary.6072ed604.0","@material/animation":"11.0.0-canary.6072ed604.0","@material/elevation":"11.0.0-canary.6072ed604.0","@material/typography":"11.0.0-canary.6072ed604.0","@material/feature-targeting":"11.0.0-canary.6072ed604.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_11.0.0-canary.6072ed604.0_1616021976815_0.347737374019627","host":"s3://npm-registry-packages"}},"11.0.0-canary.d3a6862af.0":{"name":"@material/slider","version":"11.0.0-canary.d3a6862af.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@11.0.0-canary.d3a6862af.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"2d27d493204a4fd174b42eb8fc0daa9619a09077","tarball":"https://registry.npmjs.org/@material/slider/-/slider-11.0.0-canary.d3a6862af.0.tgz","fileCount":38,"integrity":"sha512-302M/nA3lYevVY6LuPFQLnT4j3g58ZIMKoxmZLugkaPv2RRe9bv8vUT3yq95RdgZb9hjRHbM4t55N/JVR9Flrg==","signatures":[{"sig":"MEQCIGRa4DDnHDgBEgzd1f/eYF4hbltrjUdqrBcWsM0aYvjDAiBmMyy31/c8sxiiF6K4HShjiUH+cT6cZ9obdSvlheBm4w==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":810093,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgU32+CRA9TVsSAnZWagAAw6EP/i0KSe5SKCNCR5ILqfa6\nTpUe0eGQgsBeCnLNY1vDbPzkF84nLmYHkq5ELAry/X4YMjJplf1P8UGEryKR\nCXXWE7MvLWLI3Yq1/x/Q1Q92ZO35R8O6qSahh/5Q2OgV30XeMFLeIdXg/BRZ\nztnLTcuZjwHSpI43fwhmuQVDe6ioUr6/iHflHl6JS119zXidlQou0eH5t7eT\nK2CWis5/LNXtwegrOTNUUneWJC/rXod+IvA/ho2fhPZgLXiGS8I9IMqS2xDN\nLHhJAcrjdR0SE1UItXIH405D3QKWIJyCF3+YnTqUnYBKEKrX/GCSuxAoR5tr\nUsDnX1YeuvUoCBIgqSDQE9DQ00TlYvGvcB3GU2WiUULKSq3cjDx8anwBmUHX\n9CIM//cPu1jnIxxN1HFk/0DgnGDQI866cSGpixNNHLrHsFh9N7wSa4X1pHqX\nbdIWu6z2JtEzghMnKfy/PZLvX+246FQKVM/QbV9VC57jO22e9QLQWhXSCCw/\n7LpK+5fR8DBZPpcqcnri8az/8Xv2i8nlkis4qFO6zuv8XF/T49yAUJVxBbD0\nloaq/fxn4IebJmilxvlODk9EFdmLpHfP7FocW7PD4pCm5TLtBWSt+DxAhqUN\nB2sXI/FEACjy+N0u54uWZCGN+/cVxSk2HvaIvJxxEWzIN+6Dc7Jk/Z/QUKsE\nyHn8\r\n=lRgk\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"ab10f53a050cbeb103a3ee070a9134ff428deae0","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.0","dependencies":{"tslib":"^2.1.0","@material/dom":"11.0.0-canary.d3a6862af.0","@material/rtl":"11.0.0-canary.d3a6862af.0","@material/base":"11.0.0-canary.d3a6862af.0","@material/theme":"11.0.0-canary.d3a6862af.0","@material/ripple":"11.0.0-canary.d3a6862af.0","@material/animation":"11.0.0-canary.d3a6862af.0","@material/elevation":"11.0.0-canary.d3a6862af.0","@material/typography":"11.0.0-canary.d3a6862af.0","@material/feature-targeting":"11.0.0-canary.d3a6862af.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_11.0.0-canary.d3a6862af.0_1616084413748_0.07294311623905769","host":"s3://npm-registry-packages"}},"11.0.0-canary.40dd242d5.0":{"name":"@material/slider","version":"11.0.0-canary.40dd242d5.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@11.0.0-canary.40dd242d5.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"eff9fb5f5fd1e039ca2563994f82018991413ca5","tarball":"https://registry.npmjs.org/@material/slider/-/slider-11.0.0-canary.40dd242d5.0.tgz","fileCount":38,"integrity":"sha512-MmMRIqe6awHaT9v6v3KWYZDixNQj8EBTm18dCQsiyDQutHgUozTXOYJuqvkIx6gmtyMHx73Cde6MnS3vyjxTsw==","signatures":[{"sig":"MEUCIEl3JEoIyKTSdty/DdO7Oq6H2L/8Y3WSO5cnvQm7ddV0AiEAtJYCsqyOMvfGS8OEEBuTzfz6Bqpm5QWhmEVgWpwKkfU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":810093,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgU8NnCRA9TVsSAnZWagAAQr8P/3myZHLs2ztkrQjtSOtA\ns+3huj3uMAFdTmOjSIcSD5AFLv1sUu13eaKwz8IOJu9KhlM7JFH2mtoxhBZT\nvAm7WSeYAbAFvLIETR6kqaUaPWchCGTAFZT8EGvXDAW2Ru5gWowDzeQ6vXoQ\nCt1xDX207u5eIvHx9jR8Gr/zQf6+06oUSbbuh/bX50H1QB5ZCCaRyzsnRF8L\npAs1t1d7ncNX3S/rWf2unp/4cgf41ZreyGGO3Yx2JpCK1PIf9SRfjsX/WmST\n4JrStcO4WDLwwDDvlmQ9XdsOIiXLcXQb8d/hJTOMhja/rFkaWeaZocGAR7QJ\nfFI+geXpGkVEOW/BbhOKgD22dkiJi4C7Vy0cxtQfCu6NSvm6TIVriEMwlJwB\nqeaoHSewU/WY2WM40ZA30VUwVXE/7T2hBcSKx4VMlhOifUZqy9QwY2PnXMs0\ndZP7iKqxKq9qies6cQg5yyInog4/9X3Wb5CPulg9gHOA2tykn2B27Ki6tAA3\n8fzubjW82j57rCERctfppnfP1miIxnADWQKNPtUGLcmR2+X2PoPh61cw/bzU\neRvzGkzRkt5nt3ynGJRouCuv8OsVMnekYwp9jYOHNWZIcKqCsI/Swb14M7uS\nXt3D4d9dH6alKGRfO+Buf1qmK5DPdxd7HMC42oQglaIfRWmQFS42OIvkA54B\ntvJp\r\n=8o/H\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"07de383ae306cbdee42be69fa0a06884d97ec259","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.0","dependencies":{"tslib":"^2.1.0","@material/dom":"11.0.0-canary.40dd242d5.0","@material/rtl":"11.0.0-canary.40dd242d5.0","@material/base":"11.0.0-canary.40dd242d5.0","@material/theme":"11.0.0-canary.40dd242d5.0","@material/ripple":"11.0.0-canary.40dd242d5.0","@material/animation":"11.0.0-canary.40dd242d5.0","@material/elevation":"11.0.0-canary.40dd242d5.0","@material/typography":"11.0.0-canary.40dd242d5.0","@material/feature-targeting":"11.0.0-canary.40dd242d5.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_11.0.0-canary.40dd242d5.0_1616102247053_0.8279509119277364","host":"s3://npm-registry-packages"}},"11.0.0-canary.ec8f8465f.0":{"name":"@material/slider","version":"11.0.0-canary.ec8f8465f.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@11.0.0-canary.ec8f8465f.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"111feec10978960dbc6cfa4504fad43ee543cb9c","tarball":"https://registry.npmjs.org/@material/slider/-/slider-11.0.0-canary.ec8f8465f.0.tgz","fileCount":38,"integrity":"sha512-EMCCpNJ4PqwIUBlilKtTph/8vtRsZwy9PeL+TTwR9AjPP2pkO/nLveKTZTLN39HZ7lRSLQRC1Wl1S0KxUu4iwA==","signatures":[{"sig":"MEUCIQDOdJ8Q0UwFMa9sEJrrQBma/qegPhzY/XcQN9kWAKoAvwIgetLtkLdLQj7mcxWq0R705SUyHe67y52xOsDhdZKFhk8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":810004,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgU8m1CRA9TVsSAnZWagAAfSgQAIX4gFOdgGFmdV/dLY7N\nxUVIxUdzV5s0CQoOT8d0hqF67kYOJdzuMWmktiFbF90165tTaCYk33HwtuBk\nYxMq73o2uwwCS6WMLxQSax2bAcIjUmROYcTz9JIkdAGGTtsvzgB288n2cxEX\nMPZezDW2UsWywMfS3sQFYZ+sXLcd51SVNAUpnzzVy4dmMgcxccw/wDWw3ui1\n9LJPYgfbzys1S8lEbeYrpoEryLFbmXCDSw2pcD905eJcWw12xcFrJRR+Z6iy\nVjj62iKC1XmJm6J7R9tPte1iEftTXlSzaZGjoDXW5RHo5WmCjbQQH9C3OHdq\n83F1iJn9GJJC6mELpfuuxq5o6T/7t98hoz5tnjGHXGH88ACrfQNz5PsSh0Tq\nTsQi8i1IfTtzpd0vd606kUbzd4am+hvGFtguHnvQ2EOLoVfddJ5dsyXHrAZO\nHxPkRIouvyRD4JkfbOLJXBhsAMSiTW17eID7kKH2qbZnMxcHNa+WmLijGl6v\nKblF5ysBNix4bGcp2TLzxN0UB62IUdpRcnuDNQgP0ephiuAG3zcDG1VR+Z9W\nOe7CN4HBEvvHT3T1RPMD5xwZ9YV/iGiAIhkYRov5on1JTvqjEVUCUPko9R6c\nLXteKa9i7bV0P86drCvHIoo4eX1ZmnGnoMOzjPVcdlxPjfwfzmN1h1lW1xzE\nfQXg\r\n=KkIL\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"896f8e45effbe3c44209b4542bcd3d10a7f8421b","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.0","dependencies":{"tslib":"^2.1.0","@material/dom":"11.0.0-canary.ec8f8465f.0","@material/rtl":"11.0.0-canary.ec8f8465f.0","@material/base":"11.0.0-canary.ec8f8465f.0","@material/theme":"11.0.0-canary.ec8f8465f.0","@material/ripple":"11.0.0-canary.ec8f8465f.0","@material/animation":"11.0.0-canary.ec8f8465f.0","@material/elevation":"11.0.0-canary.ec8f8465f.0","@material/typography":"11.0.0-canary.ec8f8465f.0","@material/feature-targeting":"11.0.0-canary.ec8f8465f.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_11.0.0-canary.ec8f8465f.0_1616103860851_0.08221187992939094","host":"s3://npm-registry-packages"}},"11.0.0-canary.da38969ec.0":{"name":"@material/slider","version":"11.0.0-canary.da38969ec.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@11.0.0-canary.da38969ec.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"90bbae39f4b8322e23276d6a4095e0cfdc540a82","tarball":"https://registry.npmjs.org/@material/slider/-/slider-11.0.0-canary.da38969ec.0.tgz","fileCount":38,"integrity":"sha512-sYAAgMXHdNlfnUM3oCqgYjo65fmfSV9ETYmAr63wQNdemVVuvknmnd8upzPwxb1oPSNX2I6igTwPI4npG6k84A==","signatures":[{"sig":"MEUCIHhAgdkMOtMWenHBqMrMqDQmH+qggvkLqs9l1uPGynbdAiEAt9/9N/RXSZwRiacQ5uhBlrHZ5YOTunWB8lxBqKaE+ww=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":810004,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgU9GbCRA9TVsSAnZWagAAVcQP/3kuDvNB2eZrMiUF8BnS\nY+T3XHWSSIakg7BknJrZNDC1Mjvn77POdbfLRbZs6iFIJ9m3/lMNFZP4MULC\nRq6T6ToppJNGUxc/RlJpnz109p1eOqK+dFKU9r8hhNYc9aYt9YUUB415XHYL\nssGeY1p5Irl7OIkcN3NgFlPiKXnqjxbz/AwpoMj7Vx0Y+Z/Q2GmpKQ1Gi475\nlBpNLTO9XQaQi12zLKrwoM5jI9zZVY0pJUWw8Ti2Cyw5Is1zGGA/OZ4CtYS5\nIQNGfrmCC6onsciWYuNmdTVi9CQqS33IRtxgdGWrX6V+G98isXW+l6K8oduS\nkj5XgCBEt8CuXQDzyjW7TwvLjHIDmd16v8cmWUZ7pmj2uSqFmsjr1LF55scM\nKZ4drM8MKRf0OVD0C+2NC88YIT+nFM0wtyKlhDSOpSv+F8PcqEsd0BktdgGS\nQn4WK4s3OiGowD4RB4zGa/4hepKj+yg6H3qkggjXxoUxEOF7VRKnegNBbOJQ\npNxITct5asKJLQImxWLyqPSMjyN+ZFaGqj0rZ8m8+X5z4+hJAqzH/bpR4CLt\nCanDOqJAPnWwJloPjnmxOFZJKkNAOsnnF6GIBLqewT8AD3GahzqtIMbTRoAT\nNO/EJKLYrXIJZ0gEz+rYOHw+cOgS91DSAc16l6axiIjFKLuTzisxS0Pu2hGA\njFli\r\n=j7Yz\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"b43d112facdf74c62e02576a918d522587133fa9","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.0","dependencies":{"tslib":"^2.1.0","@material/dom":"11.0.0-canary.da38969ec.0","@material/rtl":"11.0.0-canary.da38969ec.0","@material/base":"11.0.0-canary.da38969ec.0","@material/theme":"11.0.0-canary.da38969ec.0","@material/ripple":"11.0.0-canary.da38969ec.0","@material/animation":"11.0.0-canary.da38969ec.0","@material/elevation":"11.0.0-canary.da38969ec.0","@material/typography":"11.0.0-canary.da38969ec.0","@material/feature-targeting":"11.0.0-canary.da38969ec.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_11.0.0-canary.da38969ec.0_1616105882815_0.22469466565743068","host":"s3://npm-registry-packages"}},"11.0.0-canary.f5246264d.0":{"name":"@material/slider","version":"11.0.0-canary.f5246264d.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@11.0.0-canary.f5246264d.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"e4db99fe89de37e37a5e8e9db2f994fc5f588368","tarball":"https://registry.npmjs.org/@material/slider/-/slider-11.0.0-canary.f5246264d.0.tgz","fileCount":38,"integrity":"sha512-nQ3tkwAWGt7xmxWcWHUXbdKGBjhKRlCe9l/C7TIXulbaC5u0fL0cSvBN70LzkKAB8RBBGAB2bY5bKFiZn612jQ==","signatures":[{"sig":"MEUCIFyRHqDEwQdyydwIqvgf4zmoGhKIOtxUh7hXUiq1s7+3AiEA3uHnJL5HDbIl2kGKSlV5cVKSb94ym/0w6hiCDcStZoo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":810004,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgU/JxCRA9TVsSAnZWagAAfi8P/iSbDbKNgSTyWzAWSDdS\nBWsahIMNtfgASaV0bzmNPNHY6CTZ6TrWTpUZVosvaQMZ1P1/iSaVl8vQgIPz\nBfhdzEVDDo+q7zNGGXA3tgRpdZyD6sN4TSUrCK6jriRIsGLDmxe6utZF/5zz\ntIVrQMbnjYXRX1EqYbydd//zbb4ERRb2q3Jn8YpzqXu/gm+10p7qk8OpEEO4\n5PiSqjFVpVSDureuFyIcd0j/OPQaR23sbVV0hYqpp6jVsHsEyqf6Sop0eXnR\nI8l92C21MK6BjtYVBLwN9pTvjEIGQwZWs+DVkmIn1assVk5sgBUKVtTNdmMD\nnJey5lvzjTn4mq2ypLJVuZw85qYAmw3JEvs5FqThM2tgCjQdiA1HIqQ1gwJk\ndfitSLKjmatcgnrsMsas1Q1MQVHlWhlWS8PbKDaG0PeJpAVW1PyBL6gJYlnJ\nLzbGl/hO3DGErWhZkBVpLjRf/xBdL7eEPFAAVeed4W8urZtEDrvUAJJ7CpGh\nebu30/bnKQ6FR5TIE4B8JvE7BDhit0eFregKl/Os64dHSMK0PKAtTPA81ERd\n/91GpzS7peSIv2MlZURZ1M2/YLD+iVvQvH0fzDQE/6TbXeZTyWTEVenff7DN\nFS90CImvtD0Cvgks+mtl++FY4TYXS1cVL+yVPFbVcYKrWm7KF9anDdlZ/NjW\np2OB\r\n=qm2a\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"e5bc1717405750210bb9d7e3572f0cd36c9bc0cb","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.0","dependencies":{"tslib":"^2.1.0","@material/dom":"11.0.0-canary.f5246264d.0","@material/rtl":"11.0.0-canary.f5246264d.0","@material/base":"11.0.0-canary.f5246264d.0","@material/theme":"11.0.0-canary.f5246264d.0","@material/ripple":"11.0.0-canary.f5246264d.0","@material/animation":"11.0.0-canary.f5246264d.0","@material/elevation":"11.0.0-canary.f5246264d.0","@material/typography":"11.0.0-canary.f5246264d.0","@material/feature-targeting":"11.0.0-canary.f5246264d.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_11.0.0-canary.f5246264d.0_1616114289118_0.7637039124792575","host":"s3://npm-registry-packages"}},"11.0.0-canary.03d34bbad.0":{"name":"@material/slider","version":"11.0.0-canary.03d34bbad.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@11.0.0-canary.03d34bbad.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"8e110b2769900836255a698f4079ec9c0830ddb0","tarball":"https://registry.npmjs.org/@material/slider/-/slider-11.0.0-canary.03d34bbad.0.tgz","fileCount":38,"integrity":"sha512-SPdY3pJ2GDHQhMMA/tDf1Nxt2AZoA5f4p72XIhlC8MWPrjB2nSMdNc3oj04bvJkMCp9R00StRI5BY47spigikQ==","signatures":[{"sig":"MEYCIQCN0FlNBWLmLDjYHwa3NXzNyKi34IBa/VzRXNROCcYuxgIhAJIjHqnEB0cqfppRYmWln8E9DdSBL9oGK/j4bUmsYldV","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":810004,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgU/WPCRA9TVsSAnZWagAAw8UP/2g3vo/SHzfnTMVAO0e2\nyaIC0SkenPT1dSqDwDazCHyK+n8qs34V+XEQAUaz4V9fWcHgCE/nzjV3ndWJ\nxCNyyh3CFrDxG2FPprdSYQN6zYTZSI2kSkXj56JWecXlVytuXbozjT2NQj/w\nVBTsy1jf5BVM3yjjKBAZR+ybpCqkfsoUPizX7KU+yqnGXV/3Gd+um4djj4HR\nOLe9r1dwujkNJBTz+sZ9QVB9/zY0rmo+fKpCxtShBvA1QR33bjhgFEdl3Bij\niEbe/mHRJKOtG2t5av0ge3mgiQ0XgCw3RGIjxe27wx8sdZFQNE2khRJqAjg3\nqQfItQK8YDeH2Y4jbWpC1r5sXSWnFB5xsMLwTUF2YZV8YlfWI0WSxqqJgM4b\nX3aps52RiIuJG+CH62QWdq2XsHnu2OVuNaEPAr678mjh6lklmYySIIu0H2t3\nxE44oZ/WkhQ9d/uR00OR3hFcT7EKgArfzFD53qTblAUKowa5RYCP2pgwUWCu\nKjn9afeLHNUQi3/BDM+tGMgrjvteOgZcmSGX7qqY3B9G0ZaG26Gm5God3NbH\nTM5G1cXI8LPeIZa1Fr04IDpmyZLH1RyZL5ys4PQqULGKURsqwUWeJjQzC89R\nKeIpp3bmTFNA1wfvIEtqCDrSenDyBidU1fy6op4CpWNqEXeE8nr8DdsHMJ5b\nJVDH\r\n=P6n4\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"650c89999524e7131f5808d28c8ea2fa15db0c86","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.0","dependencies":{"tslib":"^2.1.0","@material/dom":"11.0.0-canary.03d34bbad.0","@material/rtl":"11.0.0-canary.03d34bbad.0","@material/base":"11.0.0-canary.03d34bbad.0","@material/theme":"11.0.0-canary.03d34bbad.0","@material/ripple":"11.0.0-canary.03d34bbad.0","@material/animation":"11.0.0-canary.03d34bbad.0","@material/elevation":"11.0.0-canary.03d34bbad.0","@material/typography":"11.0.0-canary.03d34bbad.0","@material/feature-targeting":"11.0.0-canary.03d34bbad.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_11.0.0-canary.03d34bbad.0_1616115086778_0.5987070916396191","host":"s3://npm-registry-packages"}},"11.0.0-canary.cbc57c600.0":{"name":"@material/slider","version":"11.0.0-canary.cbc57c600.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@11.0.0-canary.cbc57c600.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"66a59bbd50bf89fa3ba6cd06028e49af675a47dd","tarball":"https://registry.npmjs.org/@material/slider/-/slider-11.0.0-canary.cbc57c600.0.tgz","fileCount":38,"integrity":"sha512-dhe/rA3+AC7FZHpSY6QSsqFAyRlJABLS3DGsXCZuUjFxbnQYP85jklPnDo0IPFjwgbdOMEgqPW53giV+JCEtXA==","signatures":[{"sig":"MEQCIHb0Hz+lQh3qg7XaBQdFkAVDS9h1IAS+4AxkOXhF9PEcAiBznHYeq93n5hw/65puAH2H73U3jlqIflBkbBzwFuJwKA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":810004,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgU/eJCRA9TVsSAnZWagAA9WsP/iLzHLRNsrT3+niKGAy7\nbTbMWWkwySJON4WV8r11eb6JLKr4OVTTg6gW4LAzgrgGgykeY2YCYUJuS8Av\numP+A6XAU5ZtA/XzUmRVXKs7GWOSZpN3EPlCNOrT5CYi0Z+fcB7Sh//i6J5K\nExOakxQhKmy8Sq0wO8qwNHghqq3svJiti9RCDvJQ7gwoz0qufuRjaN0v/NU2\nP3Gtvguly+3MKKtWuQUfTk9erUU7tYXxK/kenBCbeXtevSedj3HGTu9w2q8b\nj8ioAKZXwHvSS+RidwT3c9DThlVNuPxKCwXwrvizbQaN3u0JVme4tnFKmHkG\n3wlQBmHaZZOX+uDjZmC0gYAS2+DCdyJGb7a6L/7Hbe0Zv9Z2coDpSnSQORw+\n8ZMOj85Hg55ziUUN1rWAIuJvQtF2wbAGfEV9RaYpRW+NBpRLgye2rKEErgTF\ngWQPdA2xhVq6Ps+cfGevcRARcqJnFYZ1CmJuRlsyZN5Pvizn24/XSwTQH0kI\n48Xh8lxqWf9jb0L/HR4TdAxiqlgPWXCumlRpSEuVx8F0ReDDB2l9JgitRXl1\nV/qK7zl+/955ypqE8zpH6xNPruWKyhZzLau0HJqpCWgliOvVSZRtQzGSLSuR\nf04csF+tpanKfC7MhRUmRyUSmwxn50PqZec1m9CPg0Cj/dhMHRbF2yK0Um2B\nUTNP\r\n=cpT9\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"c16ee9654e2ac3913ee3140dbc31e34bbc443c00","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.0","dependencies":{"tslib":"^2.1.0","@material/dom":"11.0.0-canary.cbc57c600.0","@material/rtl":"11.0.0-canary.cbc57c600.0","@material/base":"11.0.0-canary.cbc57c600.0","@material/theme":"11.0.0-canary.cbc57c600.0","@material/ripple":"11.0.0-canary.cbc57c600.0","@material/animation":"11.0.0-canary.cbc57c600.0","@material/elevation":"11.0.0-canary.cbc57c600.0","@material/typography":"11.0.0-canary.cbc57c600.0","@material/feature-targeting":"11.0.0-canary.cbc57c600.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_11.0.0-canary.cbc57c600.0_1616115592823_0.25781684605034494","host":"s3://npm-registry-packages"}},"11.0.0-canary.d6c5bcf37.0":{"name":"@material/slider","version":"11.0.0-canary.d6c5bcf37.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@11.0.0-canary.d6c5bcf37.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"8da6c200a516a34851db570b798ec710af044240","tarball":"https://registry.npmjs.org/@material/slider/-/slider-11.0.0-canary.d6c5bcf37.0.tgz","fileCount":38,"integrity":"sha512-NoZ1QD6ykkrR9To3uu/DWra1zBSvFYkL9g67AbM3xi7BnOBoRXQIKiXk14fUMYLZY1Z6pHbp7xfoUMjwnPizHg==","signatures":[{"sig":"MEQCIHnhTYFHIFg1+RVjUPVniAZIKoHhpLLvzFvxLACdtprLAiBF7Bwyn/rXybxYkvDxB8rAb1EnqPDblN01IpgtqGikoA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":810004,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgU/qCCRA9TVsSAnZWagAAqqgP/Ak4wp9wOY232EOszVDg\nNm/QAh4sM3qTouogE8FW/3sGdbJjVibRnSbdRnVLXzSdkFt8TE02QpGx816V\nK4gUbaXmPqqNzXlX60RtQs/iYQ3L0wskkx9XUwjradFwuTXmg6SNi8DIGM7Y\n3RrHT9CbnojDI17MuZF/hY6D5vnK8McH5IRWKgdmHl30GbuD1u0a22tBLqoA\ntfvlfLOEITB3GZ6o6ANZ8pN3KX4iizSnr67FWXsut1D5nWvMElBvDkTzthpt\nzlXVbU+iQtn3lsq95TW/o9hpu4UK9liSGmvY0gftToog7q2VEUbc4ZH1Yb8V\nDwOgb/SZOkXja3f21pO5aAKeRyXInSNRmxnUE7Mwn8e9zBWbaaOkSpuK1leF\ncYLQPwSCzoefTR5HQRWF2tkpf1SI8jZnw4jwEr/XBtYhkLradwSc6HJE3bWU\ngr8rQoAAREbHJASwdV9hvb6R6YIAslj8O8M0Bgb+KqLdzgXSNcyGm1V4T/a0\n2nKGs9VtxuLk/8XSehzF/rX/gD1cvZg39gws0vKAesQ5tHqjuSCBBI51Gbo0\noLtThnAFzgJMhJrYpKzpW9WR7x9nGC4PL7g+oo1RglDcHpZVqCOFXVHyUPs5\nUyGcWtOfN3Ikf6oa3Z9OgTl0qtfG10txOhczNeDZiKrjkNExAK5/8OmY47oq\nP7Tf\r\n=Ynxm\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"7ed31c18c565964157fdadec7c7876ba58c6dfff","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.0","dependencies":{"tslib":"^2.1.0","@material/dom":"11.0.0-canary.d6c5bcf37.0","@material/rtl":"11.0.0-canary.d6c5bcf37.0","@material/base":"11.0.0-canary.d6c5bcf37.0","@material/theme":"11.0.0-canary.d6c5bcf37.0","@material/ripple":"11.0.0-canary.d6c5bcf37.0","@material/animation":"11.0.0-canary.d6c5bcf37.0","@material/elevation":"11.0.0-canary.d6c5bcf37.0","@material/typography":"11.0.0-canary.d6c5bcf37.0","@material/feature-targeting":"11.0.0-canary.d6c5bcf37.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_11.0.0-canary.d6c5bcf37.0_1616116353969_0.25055978019187863","host":"s3://npm-registry-packages"}},"11.0.0-canary.fefc668d7.0":{"name":"@material/slider","version":"11.0.0-canary.fefc668d7.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@11.0.0-canary.fefc668d7.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"ede6dba9ca312cfbfb39873b29e8314ec5e50c0b","tarball":"https://registry.npmjs.org/@material/slider/-/slider-11.0.0-canary.fefc668d7.0.tgz","fileCount":38,"integrity":"sha512-Qdt/9/zGXolPjahKLQcTM4vCw9FDtlxNz0VIGmOcbLPAmUcPEVz9CKRxKLtdZbW4KxUBn9ivUYUF4sonBIG2gg==","signatures":[{"sig":"MEYCIQCH/yfnMDSGDPGg090TaRbayPqMGluDdJHs3RpmGTPnUAIhAMO+nb3u4HdubojbY3MRhPoKObN8TVEaDtQJZ+UxN84f","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":810004,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgU/+HCRA9TVsSAnZWagAA1GcP/ifLDRDHD5CT9hqlX26u\nVGWOxxAA8S76Jg83Do78hEaQnxiDcNixwQo9UOELPnny8ujGJe0a2KJvRQKe\nwjmsEvKHaiQXpD0dehFmpGWJiyS08yGGooaOOHmufK6C5sNT7Fkof5J3GJGK\nsH5Thu6L3ZfKALR3kbzmDmg4XGZSFvrggtxsyPOTJADUUe5FfFL+tYmMOyBw\nWIL1dPu4hLz5NZZvQFq+N78kLcAkg0eTHjYdZaZoziiiWY4+nHFvGsbGgy77\n01TaSNuta3Ly5UnnWTF+16Zo36VRL7N9Q4nPB+P+qD6Mv/qLoEUEsJlKvMsa\n3zBeCaFncbW6L9HI1vU2ReuTOyNNpPbTOB2VEcgrHVGcy6/hO6TVNizKF/ey\nKXrrlIju/YS8Y405+MRw59iChem+1V6e5ohFwZSdii8s6Tkqvo7F2FCF7sxu\nxJnQjCi8QAKhkKROvNAHY99jCwwslQbIqj8DAjcr1r2Tc4c7FiTQ5mBFUbo+\noZgrdqWsJht2zJ3IUZR/p8b+W+dU1PjTQIqnUXeq5Gt+TZ0zDJ+rbY8xQEup\nKrupI1TafNnJmes/fGoudUXH1PxAIiviIEV9lP1DDCX0nB6ODWOmf8BNTOnV\n/DVTbY162H1k0p0NVbsigT5+gralvmlcSewW84zJOVainXo0zbcz0wF+UN4C\n01WE\r\n=8L23\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"7c976c590b16e8f3a000dcf5cf2b4daf6269aa21","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.0","dependencies":{"tslib":"^2.1.0","@material/dom":"11.0.0-canary.fefc668d7.0","@material/rtl":"11.0.0-canary.fefc668d7.0","@material/base":"11.0.0-canary.fefc668d7.0","@material/theme":"11.0.0-canary.fefc668d7.0","@material/ripple":"11.0.0-canary.fefc668d7.0","@material/animation":"11.0.0-canary.fefc668d7.0","@material/elevation":"11.0.0-canary.fefc668d7.0","@material/typography":"11.0.0-canary.fefc668d7.0","@material/feature-targeting":"11.0.0-canary.fefc668d7.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_11.0.0-canary.fefc668d7.0_1616117638633_0.005890380527936445","host":"s3://npm-registry-packages"}},"11.0.0-canary.faa7d3226.0":{"name":"@material/slider","version":"11.0.0-canary.faa7d3226.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@11.0.0-canary.faa7d3226.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"b52c1694a7f9100a35a514cb02cc4320fc363197","tarball":"https://registry.npmjs.org/@material/slider/-/slider-11.0.0-canary.faa7d3226.0.tgz","fileCount":38,"integrity":"sha512-J6ZHYr3x3L3HnYiia8ioTqKlwgkvnU2io05KgAfxQ5iY8YDoFrJPJBR2EdEcO7npSLhCsZc4gqDkoNWnd8dAfA==","signatures":[{"sig":"MEQCIEgR1gTGtNIWTxnoNjI1qcUGzkp+57iRU1f7xY7XyxwlAiAMRlIHci0zVq3CHjhOqhq5wvP4RO3MpnXG4YhEBSEuGQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":809972,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgVOLwCRA9TVsSAnZWagAA9QwP/2uFbf5myG8mEGw7oEI4\n3yPtNCqi0nNYvOZKga60O3tbgYWZN0He6ymxghTU9OiSrF3jj/LqvkTcEI8H\nB+iLHqBPLxiTvMg7uwy3dnVaYBHLh2GdsCrzeLikj9JmpT9xjfthIgTbU5O8\nuPkh8iW2498RKQrbbVA8Ck8ZdW7C8XYhy7ICby0bIS6ngD/KM/hBBMLerC9X\nXkDRNQmqYJPgW7S8lvAIdhX5OywT6eGwXNntpJman/Dc1evJQiF3XfZKcuTz\n7kAeDZHJwl+hL/3dBlP+GhT64OlmSHYl8BisfGv6oQvTOxgeOqXcMCAftPKW\nrPj5GYiJMigq5U63SOlVocfhsdn3KPgXwK3SuNncoNkhD9F06t6LoF8iQ269\nA4IgcJ6LpUsVr3qwtJc9s7x9E17t8ya6Ae2yGZ6/Bv7nQP0f1HzAnk4YZAWb\n+qIpwfrKzlOOBq0x6fZc+acNIDmwG7v5uH0eLh5uOJiRWJjHtK5wSk4CCCnj\nvBFt6QBQbZD4prT+hjka321SwqwoIZbszBLCccWIB85WOsjG7pfl0qbeen5o\nBO3SvUJxqXeUoMqJF9cbw872u90IpVE7PwVkzgfIREvZraFQYdZpIumGFA4v\nFbatkImS0VCq07JVxHQJdYmTc8/rEnZpJfnq7AgcktU6aolL3bBQwjYeXOgt\n6GhC\r\n=1uCk\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"c6038c8b2af85b70f2434939a69416e1593d5a36","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.0","dependencies":{"tslib":"^2.1.0","@material/dom":"11.0.0-canary.faa7d3226.0","@material/rtl":"11.0.0-canary.faa7d3226.0","@material/base":"11.0.0-canary.faa7d3226.0","@material/theme":"11.0.0-canary.faa7d3226.0","@material/ripple":"11.0.0-canary.faa7d3226.0","@material/animation":"11.0.0-canary.faa7d3226.0","@material/elevation":"11.0.0-canary.faa7d3226.0","@material/typography":"11.0.0-canary.faa7d3226.0","@material/feature-targeting":"11.0.0-canary.faa7d3226.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_11.0.0-canary.faa7d3226.0_1616175856248_0.8291413666734735","host":"s3://npm-registry-packages"}},"11.0.0-canary.c60449bc8.0":{"name":"@material/slider","version":"11.0.0-canary.c60449bc8.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@11.0.0-canary.c60449bc8.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"5788531ae9a29eb47e8cc97540cc6088631f83e9","tarball":"https://registry.npmjs.org/@material/slider/-/slider-11.0.0-canary.c60449bc8.0.tgz","fileCount":38,"integrity":"sha512-QLE85XBkmwoU/ToL1bBei02eZf6Jfbgmv75mZ3J/a8VSuTgHcRu+vhSdiqt84nM/uD1HpZSuzjqoj9+CIFNBcg==","signatures":[{"sig":"MEUCIQCDunWLV8XPgQGJu1cYRrmypleMPshsOhFtMtB8uQBbggIgBWvFQZH1926XIrLg70QzYiU4HpZhkBDVt8NUVE/kHE8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":809972,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgVOfdCRA9TVsSAnZWagAAUdMP/RrCzlCyk1Ysk9NU/vEx\nA3uc/TtXT0yIo32pyQYF3LNSZ9EqNIj8gz+w7VtEFJIYqKfD4fVN0OJfAzOG\nJZw1bEUBFtjbcEJosDYWftCCktc6QUd48SyLLOZfb7UxqrKsH7KBLad9tOi/\n41rQkL7lkZBJhNT9KQthtZ/wet+0CzQF8fpKXmfWgcFQElI1zcw4hB7ZxqKV\nSHL4VQwKRi4t4BePkduABjtUShw+yl5rB7j3mOzjpdsPoxgICAmDtd8sqP+e\ngDOV9d3bP9P1Z0a+W2MUYmqUwrt0Qs+fjK+Jn82Cu8XNnY+9klJktSqcLGdw\nlKAk2s/gCcQ9rKjrXQj8KZlk9kso4rstnZl+6CzIFqd7+ZoaGzhDPLiqvSLd\nTpJ996RZuPz2u0PdU2RrSSTARUiHY87ERIiCJaGPCp6u+RZahrNdNaR2HTrH\nL+JgKztAmwRgPqvxmbDMT/o+qSrGa2p256oEeKM0O/4pLIctEwjmsrIdibye\nHFKai8G9T2jlM8VLAo6WbZ2FiJT6H6QhWiigux5jKWbuAB8I/Uw3laJyGl94\nd3dSVbdaDNwwj6Z6yUEkQn5iVj6/dxPk6uC69u3CtWrPJD4dirBzbJWs6biq\nS9Erzv6kczC0SEmw2LZTmEIo67UEWaDHKyF66xLea2S9MvCXK3rlRNWXbjhN\nplsA\r\n=zfjv\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"874083f8b4dbf457158a7eaf9924ce1143ef6fa0","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.0","dependencies":{"tslib":"^2.1.0","@material/dom":"11.0.0-canary.c60449bc8.0","@material/rtl":"11.0.0-canary.c60449bc8.0","@material/base":"11.0.0-canary.c60449bc8.0","@material/theme":"11.0.0-canary.c60449bc8.0","@material/ripple":"11.0.0-canary.c60449bc8.0","@material/animation":"11.0.0-canary.c60449bc8.0","@material/elevation":"11.0.0-canary.c60449bc8.0","@material/typography":"11.0.0-canary.c60449bc8.0","@material/feature-targeting":"11.0.0-canary.c60449bc8.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_11.0.0-canary.c60449bc8.0_1616177116584_0.11406842765102576","host":"s3://npm-registry-packages"}},"11.0.0-canary.5f0fc444a.0":{"name":"@material/slider","version":"11.0.0-canary.5f0fc444a.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@11.0.0-canary.5f0fc444a.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"9f5397746e10a1080f89ca36cc830450f776906a","tarball":"https://registry.npmjs.org/@material/slider/-/slider-11.0.0-canary.5f0fc444a.0.tgz","fileCount":38,"integrity":"sha512-tC2ygfl+VTg5wxdchIPLdNkj+4v6K+h1EOkpTT8mgCBs528SpTYvUkKTz8sHsz4qpTWo1Ogp/1eFYjYqam4YcQ==","signatures":[{"sig":"MEUCIAeT6ttJF0WBskyGMRpMVTeaV41xASA2Gv1I2K68gem4AiEAzC47xGUinWKMqtc776tcwkIef41CzdXOnjv0OU/xej0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":809972,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgVO+BCRA9TVsSAnZWagAA1w4QAIzLkJGXCqEGJKc2f1+U\n2uoXxTtgNmCHMdWqgw722qw0Hi8E3EghBN1SK/PHmGA3+yNQLZeZ7SiIWJMa\nt1t+qnEEMvDwCPvfOZAGnAsiQsbpQKrewHO1OwzPzbfbXd8av4zt8fdSydmN\nROCkNwf+B4sKNuNKEs4YPm+7hwNDgGRoHVpJZIg3DcFk2oKIAEmAvhYIhxam\nb8uevN3ziebaim7bF/lu0OkwpghXhXiQA80lxIiCaF2dK1LQo2uQKt2l0epG\nJwVzh9kn/rJY22bhErHyIQBk4GVE1yH/fcR3yYqBFkJqtZx1CgE5PQLqkdzT\nMImfpDWNe9eB3ft9fAj8SyCwAoKT6aHAqRS5vQGHLuvqU53UV5ki/YbECtI8\nCevn82ymtEyNrJwsuhB+hbu2d5YHBwrpD4UDpyMM0J40P2Q4KxxtpmV1lZtP\nYg+Y6VubIvnu7MFNjq8PheZTI0OLgDGWp+TTX0wHykgrldvJHnXlFuONPHVZ\nZzTYkSVRncsdqDHOB+++LJ14C1EoSoeDm0xSdDeNI66ESrBhZP4yONQxQsAw\nu9uBbensRguu4zYBXZlzJCzya/7+ay1g1e22IC3I3Ydm8h/B0KHZvRMgxK8Q\nsY1tldAOra6woqZMasJj8Cad93WA1bQwNBWge606WlaMaxRziwIas0OwfHrZ\n1XYW\r\n=RqC2\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"122f31622300f5877c850a516d74f7c692d0718e","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.0","dependencies":{"tslib":"^2.1.0","@material/dom":"11.0.0-canary.5f0fc444a.0","@material/rtl":"11.0.0-canary.5f0fc444a.0","@material/base":"11.0.0-canary.5f0fc444a.0","@material/theme":"11.0.0-canary.5f0fc444a.0","@material/ripple":"11.0.0-canary.5f0fc444a.0","@material/animation":"11.0.0-canary.5f0fc444a.0","@material/elevation":"11.0.0-canary.5f0fc444a.0","@material/typography":"11.0.0-canary.5f0fc444a.0","@material/feature-targeting":"11.0.0-canary.5f0fc444a.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_11.0.0-canary.5f0fc444a.0_1616179073167_0.35438206687237006","host":"s3://npm-registry-packages"}},"11.0.0-canary.4567a750d.0":{"name":"@material/slider","version":"11.0.0-canary.4567a750d.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@11.0.0-canary.4567a750d.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"48b5ea27262854bca2d6e12c6ecae1a81203f243","tarball":"https://registry.npmjs.org/@material/slider/-/slider-11.0.0-canary.4567a750d.0.tgz","fileCount":38,"integrity":"sha512-a7KpOi9d4tXCOkY5H43h9rQ733BQZwbdZ5a/N2PubSjULpNy4tJtq6y9dNFb3dPBkV5UrBPX5dLcfWJSqDD9wQ==","signatures":[{"sig":"MEQCIBU52P/rCL2EM2DPLNhI+DUtChW5rISrPv2BwE0BS7w0AiAmN54Pt8IwoPd5LbdgmSiWHUeY1mJhcwUZap0zT1txCQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":810300,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgVVkCCRA9TVsSAnZWagAA9hEP/ioLcqG9dsbRVSDLzlWJ\nppL7+uo+DQudsE3m4rEwhWd/eLje/clT3yQxE8rsutyyqvDJ3wd8oau7oAh6\n3dp3OCjynJmfK3qgatRO7XQZe/XRoKlxr4lCjHdzO+HkNnGNGbDETrKerQ2Q\nknpuOwSwqsjEcJ7CqcfLZiNOJojqId8bOpHcC68MuYSwdRhj7xUA3r8t2mWx\n3CaQYg0PjuXm8dGYVZGNwyicblOcUSfCVTV7i7Dfh3lUuX1f7SXYsOmERZI8\nE5v6KTMVDUdOd+Ka6RlHkkbrX1yzhX0nLQO5ApsZ8dVppZ4y622N8BgSbK7+\nzB5gs7zHJuxBDiNCCWTusv795yLdbeJNXKUTHwBBziu9NdCz4ARhSUDk078O\nLwZBAof+cVEsyNRGG1mrTwSNzAD9XmPZLgels8N3f78D6mywy/raFOxL//UQ\nCbQuPqABTRX7xuU/nflxKwIefGyjTXMbIL/VNCr+8DXBk+P7RRH7RsKkX9tK\nezv+afGcmOh9l9kCY3H4SIGur4/W6Shresd2zNZkwVWNxLralEw6k6UWKsJC\no9QKjwCHLwZjNe7+0SguNgtLdkfryni5qxgzpOIfrRY6Zky3o+gTpAMlEHEO\nFbTPVM4cj7mHHetkZR6/4WX8RvTWWM+TD+ruRQ1zGIGYjxEGMiZI3QSDAr8+\nsZlT\r\n=H9wj\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"e165b3e1af02e963deb71d6f39a7df6962710c30","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.0","dependencies":{"tslib":"^2.1.0","@material/dom":"11.0.0-canary.4567a750d.0","@material/rtl":"11.0.0-canary.4567a750d.0","@material/base":"11.0.0-canary.4567a750d.0","@material/theme":"11.0.0-canary.4567a750d.0","@material/ripple":"11.0.0-canary.4567a750d.0","@material/animation":"11.0.0-canary.4567a750d.0","@material/elevation":"11.0.0-canary.4567a750d.0","@material/typography":"11.0.0-canary.4567a750d.0","@material/feature-targeting":"11.0.0-canary.4567a750d.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_11.0.0-canary.4567a750d.0_1616206081485_0.8110777421914896","host":"s3://npm-registry-packages"}},"11.0.0-canary.0cde52f5a.0":{"name":"@material/slider","version":"11.0.0-canary.0cde52f5a.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@11.0.0-canary.0cde52f5a.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"9b5d531fd833e27fd732cd159069e098f5062e4f","tarball":"https://registry.npmjs.org/@material/slider/-/slider-11.0.0-canary.0cde52f5a.0.tgz","fileCount":38,"integrity":"sha512-tBk262BU9D5gk3GyU+9hpcHR5IWMsj3/xYZNVK7gBIgYOjOGPseBJIDD/AUv4dIdBfqEnp1T9Fyx/UIj0eB02w==","signatures":[{"sig":"MEYCIQCoXCOj2F68/ihQsqfuy5lY7gn+j9qhxkcLWm+jf2SB8wIhAORMTPsAbk+v68zbueWHXe/298UbxOsra6C2VMs54aQ1","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":810300,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgWTA5CRA9TVsSAnZWagAA1QoP/jBcruJVwD+d6nj6i4Kt\nnUqKpwleDF0Qk/PFFQjSu9AbrqDEq2rVqSRScnB1xdDvjm7T9TpvZb2rOnAA\nbt8dEE94L+9NrTAB+/Pr/7DVI41zCO9UbrvuaJq7yXvYeB/jDwvm4dsrco6H\nQ9XfXxKL//D3lo1D6p9z2dX7QYixOvH8z9F3jxn8zc4fESvBBpv28jtJ1r2C\nf52lDpA+m6zzo5vQqguqvMVICKprHDCzBFNNv66FaJxa/0u0moMkHzO+iUaV\nWwkjsmGusskWGEO4ipdOs3r27gBK1hYNuvIBsF7IFSBtdLCZsKnUa1SFnb/P\nP+7XhYU1WONrSxR0VTk9+kDeuXG/rTm/OLEOAZdw6sFXsajc1Ywvz9Hoz8bu\nfPXbFyzXFmePGxj4FfsLsichOUCB1mD1gj7yfthZbu3D2wHmz2xChRkTWUzH\ndS8InavXDpOwvciiq8XVBYhg/oknVzJjvAoTY9aOeqaipX4DxMWhmofRGv5j\nQFYRhom1EkJur9JwpJ37pxb2QlEKmmZa6+sI+1qR9aDIx1CuS+kjURKvc57u\nMG3hyyN1KiMm4xsJotnQSOTVAkDNuQmQXkzEioxUapLpyiYTnqGdg5AMU/OK\nHF7g1YRIInIZhoKschcjA6QCId6FFmTNMLDzovSs4hzI/TDDYNxKrvchubpR\nRVl4\r\n=IZTv\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"6f6719c5270f569fd2ab44620e89ccd53a31f98c","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.0","dependencies":{"tslib":"^2.1.0","@material/dom":"11.0.0-canary.0cde52f5a.0","@material/rtl":"11.0.0-canary.0cde52f5a.0","@material/base":"11.0.0-canary.0cde52f5a.0","@material/theme":"11.0.0-canary.0cde52f5a.0","@material/ripple":"11.0.0-canary.0cde52f5a.0","@material/animation":"11.0.0-canary.0cde52f5a.0","@material/elevation":"11.0.0-canary.0cde52f5a.0","@material/typography":"11.0.0-canary.0cde52f5a.0","@material/feature-targeting":"11.0.0-canary.0cde52f5a.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_11.0.0-canary.0cde52f5a.0_1616457784501_0.6504869302865806","host":"s3://npm-registry-packages"}},"11.0.0-canary.48f4b67fb.0":{"name":"@material/slider","version":"11.0.0-canary.48f4b67fb.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@11.0.0-canary.48f4b67fb.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"b43561df48b1bee6c2a850b85c3ea4e17385307e","tarball":"https://registry.npmjs.org/@material/slider/-/slider-11.0.0-canary.48f4b67fb.0.tgz","fileCount":38,"integrity":"sha512-oajFjLBIcV/ZK9aqsRO/SiNBCuaHA8CMSIzGH1xew5HUxtIJk+vvOW/EM0gLZNdVtvVDq5flO7FkLMKlWNwV/w==","signatures":[{"sig":"MEYCIQDmJVCRTEb5YS16bkLnTrkvPJ0X/rIymwQWZfU4kZ4DxgIhAOlSpNrAha/WZMWCU2eAL3B2bRLkz0oO3BWUvDwPdtG/","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":810300,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgWkdsCRA9TVsSAnZWagAAQWEP/R71sMoxIkFKldnGylXY\nnZALVSG5xzu/GwU8V1ShIW5nyY2i/OdqpkN3tcDl6oSIkvBRPyrEAL8eNc1+\nzKYgVnBA7YJXzSqF5129kNKyqbTsj6gW4RmGo6JHaO6NOOcCbeOBx9GZYSFo\nwFgj8rVdDM8ozqwTVc2/dVPQpaN1Srrws8JnNijoXAqm2a2PJFyarMl0/B8y\nu6JlbUbBS59VpkJPCuFdKYIKwWczaltWJbpevZPmTj0Bd3w0EwaT0TL7jH24\nI6SHZqQ9nehM9iZ9orUc/enBvRl9lstIlnX+aN1yAXFzs5cIciI6bcUDEwyQ\nWkEWFI+OYBz1hTBwHtRdwnrXD8+H9+rh+gXI7uhJPhAcE6eIoOQlcsNcMuK+\n5Ld+28h6nHxoMuslQDp2eD/Kp0xUdQ2MVgsPYnnm1X6qIp/+U3giQkyJnfiS\nE+2TuwYD2i6OmBtM4FT1NxupvS2wnTrutqrTTZGW7lHmtZXD7mn23DgKQj/n\nEGwwHX5Be0HOree/pvR69hnIZMjd61pydkoLDryKLO50gpgb5DiOKtCJzwxP\nbrRCR2dxSdI/LB/BCxKxlgqjfBfOCTKB4G2R515DvSvmLuCCIdMlGGIcZZP0\nE/9WwLKz+b6j+Yw9q/Dn85CKL6SnVzGRzpK2vSwmzpb2GqlcOvVb2RYw2ut+\n4hH2\r\n=nEaF\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"f83669b240feaba73206d330f10c80a9aa31c1f7","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.0","dependencies":{"tslib":"^2.1.0","@material/dom":"11.0.0-canary.48f4b67fb.0","@material/rtl":"11.0.0-canary.48f4b67fb.0","@material/base":"11.0.0-canary.48f4b67fb.0","@material/theme":"11.0.0-canary.48f4b67fb.0","@material/ripple":"11.0.0-canary.48f4b67fb.0","@material/animation":"11.0.0-canary.48f4b67fb.0","@material/elevation":"11.0.0-canary.48f4b67fb.0","@material/typography":"11.0.0-canary.48f4b67fb.0","@material/feature-targeting":"11.0.0-canary.48f4b67fb.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_11.0.0-canary.48f4b67fb.0_1616529259967_0.33305482556260246","host":"s3://npm-registry-packages"}},"11.0.0-canary.0b8cff734.0":{"name":"@material/slider","version":"11.0.0-canary.0b8cff734.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@11.0.0-canary.0b8cff734.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"1c33ce62077e21634d19a0ce418914029c4aea7c","tarball":"https://registry.npmjs.org/@material/slider/-/slider-11.0.0-canary.0b8cff734.0.tgz","fileCount":38,"integrity":"sha512-EunUNeCwTtNu4R+hM5lnf2gPNc88Qy7Q9LnCX4It/ha1wEvL/qvPkFN9NMyZwh/aNgfeQN1cgbgHZPloBh2pMw==","signatures":[{"sig":"MEYCIQCdS/p+37Gs+DhEje19Be6qzom6WtH6OYatN4zjPtPJqAIhAP3lKi+FFXcC+drpHlMmw2XHxF7JXBkpCOBpkeZLne6O","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":810278,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgWkndCRA9TVsSAnZWagAAOJkP/i/k/+pTdrQahk8Sb1Vx\nwrEdc069QgwCnxXF++KQReEUfxDCOnfiblp5cEe5ohNaddYhzxdGR2zcP/tM\n8qwKaaCtDV4eHXDYGIvie14ZBR329AnX3MvMbKSqxaTrft8t8lnDU88UVUNS\ntyQ98blMpAB9uCCTWlRsOdD43CzoUrPe7Hq7aLbCD1Z8j6o2+nSWo+wLDtIM\nXP3TtS+qcrEu/UgURyIblm3AvMqOLZ00MNUE106JeB/q2cdjMoD4ZzfNSafU\nJy7Eqo1Il+gqbv2ikC4Oxs6QDX4wl1rPrTLQWeCxxa/thS8VyJBR1Q8aSI1+\nzxNF7FVClJrxBhBrFvvlwL/PpvRsDFOSLqHiVj7XQaVzzw7Ljg7SzBl5jiA/\nAXHHnV0Bsiuc5HivZ3hHiu3YYR1ZHsZ4KVpEwYYZ+xY02b7ROa/Wgpq+lG+0\nDXuKmHqsj0bzeiswtUPBKho9u3pSiMJuskMS2JTaCuQwJjIolK7YT6iqjM2i\nPZwmkcDU+pVg/tFWCXkEecA5BFvnDXsWM/8fIu9BsOO+UyrUWv7yqdl9ZdNV\nKFM6HHq3uyiTODplXpvyP7K6bnT3oMXbQ9TzbmJ+FOad2xVuJzd29T0EZMmQ\nDwT4NAHjDDQPoMluRX1nU6XabWBH0rPthBRMjXM9mGgbAP4qqI4UOW/0Hm5M\nkZKx\r\n=wWLS\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"0371cb1671557f9e1d8a3bee3ffce11bdea058d8","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.0","dependencies":{"tslib":"^2.1.0","@material/dom":"11.0.0-canary.0b8cff734.0","@material/rtl":"11.0.0-canary.0b8cff734.0","@material/base":"11.0.0-canary.0b8cff734.0","@material/theme":"11.0.0-canary.0b8cff734.0","@material/ripple":"11.0.0-canary.0b8cff734.0","@material/animation":"11.0.0-canary.0b8cff734.0","@material/elevation":"11.0.0-canary.0b8cff734.0","@material/typography":"11.0.0-canary.0b8cff734.0","@material/feature-targeting":"11.0.0-canary.0b8cff734.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_11.0.0-canary.0b8cff734.0_1616529885309_0.8867076145523001","host":"s3://npm-registry-packages"}},"11.0.0-canary.8943b991f.0":{"name":"@material/slider","version":"11.0.0-canary.8943b991f.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@11.0.0-canary.8943b991f.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"88a6d571c04de94b1ed83373b844339c66b6bdf0","tarball":"https://registry.npmjs.org/@material/slider/-/slider-11.0.0-canary.8943b991f.0.tgz","fileCount":38,"integrity":"sha512-niPlbYvKjoo8tkUvr63uL1erDmGBlZAiXFQLDLePbDRwyOUf/ofvJoplAmK5pssVkbAE+GG9daecDOWkr0ugZA==","signatures":[{"sig":"MEUCIQC5UTq74gMamLadDAVt4EibyF13NIoKYswrPzttvBIIjgIgascDxcKw97MLVCjjyAOhbTROEK5MkoGmPd4ly3sE4so=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":810278,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgWk+7CRA9TVsSAnZWagAALCoP/1Jag5sPWI5fNkVI/l2B\nz+gLYTkQgA5bVZY5zv/HqCaIjmk5y1yWThq0vggpldHobfhh0U39mLIPQDlA\nT8GNOE1vjIHbI3HeVIOPxvPZxoL1IJ8cSs6Y6BI/yqTQdq5OZdDSaktAQ8hF\nJmxVfwBjCT2wBFrZenBRjldHZfQxtfPeFC5PThcZDnGkuD8FhNZ7OCoaY8Kv\nJ4p9VD0xI6RJMiDSN1xzylNYnxLSmsYN1aoJPNGT5L7cDwTZjtUAVRTrHR3T\nK7x8D9+mj08NAW9yOAqvikrzwvv4XIW3SWAjM2J+K8lp6tFrTC6enMnN9CuM\nhPE73Tp2rRFZMFB2kJ8GUTYqoGpA9Wkzq1ioHVT1zzZfvQcWUQYsHtF5hFVO\nUXlNGxYMLl6mCH4iUlvUAbV/3cu8iD5/FexnJ+1a1IW8IbJ1WFhKZfIGXbbD\ngP0AOHDE59R1U5HmaAm5T3U1ntRIm41txZonEI1h1MBGQMx4DxwpLl8Px23l\nKLvje/1rbxHdwXyGuz+D6gKKmfQG1xSRBgGEDLUJ0iCJjyYRlvlecWt7W3Ic\nX12PwqAAaBkaFcbNXgZqSiIIpxLeK1X2jNm7iWRdWFp2gEvOL34Xw5uC/R3V\n3KCdIzLFHM5p63AMdtpdCrN2/liSGndPsM98gHPINY5KXHLXuDge9eo5F9bv\nkZ0F\r\n=Me1y\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"85cb2528143c5117974441e499367a5fc252b745","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.0","dependencies":{"tslib":"^2.1.0","@material/dom":"11.0.0-canary.8943b991f.0","@material/rtl":"11.0.0-canary.8943b991f.0","@material/base":"11.0.0-canary.8943b991f.0","@material/theme":"11.0.0-canary.8943b991f.0","@material/ripple":"11.0.0-canary.8943b991f.0","@material/animation":"11.0.0-canary.8943b991f.0","@material/elevation":"11.0.0-canary.8943b991f.0","@material/typography":"11.0.0-canary.8943b991f.0","@material/feature-targeting":"11.0.0-canary.8943b991f.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_11.0.0-canary.8943b991f.0_1616531386293_0.6150144644647972","host":"s3://npm-registry-packages"}},"11.0.0-canary.3955d8d3d.0":{"name":"@material/slider","version":"11.0.0-canary.3955d8d3d.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@11.0.0-canary.3955d8d3d.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"daec443705304ea68e8e208ef8c82e37ac42cba6","tarball":"https://registry.npmjs.org/@material/slider/-/slider-11.0.0-canary.3955d8d3d.0.tgz","fileCount":38,"integrity":"sha512-ZcEGxfZnyZwDBSCOd0d00xSt47hazrIAcx3dMziNHB//Bfa6ANWbds+F41sMWD0NHtyVdXaiEPM+nKkd/L1uAg==","signatures":[{"sig":"MEUCIQCw3nxeUYOTGn4X7bB7VRRHreu2Z8PTR8kM59czbGZlmgIgeZAKHNH8kgaLkQEZAMlukpw8Pk7XNOwBXsn56ceRO6k=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":814071,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgW5APCRA9TVsSAnZWagAAT74P/1nONZ1fXklKzrN9TwWe\nuo/gkDb5pYcJz8EaGFtLrxyOX42IPX5rdzDJSxjGaDky4GzpmZ2L6f+K2Roi\nxnvH4buENEq7f2P7NUcwbT8oLgPFnFSFag11qUyRKqwUyF6eg1y14BX3L7wn\nIvERbFqMf4gT9Y4jB7EQPscDLeo+ZvVKOUgD8st/ssVZ8r86BtjrZzzyKYks\nog2yA/9P4iGtjj9L1ef5d8foM4BMxWex9Pby87JvF9A+95rLWv2lhBKf7CjA\nfzPB/SmvCbZ2GiA3OxiA0nIcHoAuswMeNuBY6lPWyFuFCxm6r1frdlG6vrIQ\ntUN+3zPNRvG0CUOeMFNBFE1PoTFYh6J0qk+7nf3eRfuicVzEW645yarJGQQ8\nLNVZ/FfwgLk5+hw1bYnAXTHx4v9j+gCa54VUYKuUUkshtXPDq+JpIlu6Zkf5\nkJaHnob/DxrtWknhOyk7jfrv/qoO8a5AbD1mgE4Zk8A8z87tfLk9WkoeIJam\njenoEsqzFiHSMy8/3bPd9/Jh1+bhUcBc6UDLfwnVkgF//wRsleBwsq9gMIjT\n+WkQqhAiD72TAT1KG6m4ZoCzGTBu9a4Ju2CtgBvrtf/OzaG/fI/LjFNFNmHI\nsR+lQIUA1zvyZIlSVkLT7FLvBmqRwlMaz8kYit+p8Dyfk7Sxew0XnGIV6SaG\nBRLi\r\n=Ol9z\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"2679d736975b17823079a52aad1e329d8c2a3b71","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.0","dependencies":{"tslib":"^2.1.0","@material/dom":"11.0.0-canary.3955d8d3d.0","@material/rtl":"11.0.0-canary.3955d8d3d.0","@material/base":"11.0.0-canary.3955d8d3d.0","@material/theme":"11.0.0-canary.3955d8d3d.0","@material/ripple":"11.0.0-canary.3955d8d3d.0","@material/animation":"11.0.0-canary.3955d8d3d.0","@material/elevation":"11.0.0-canary.3955d8d3d.0","@material/typography":"11.0.0-canary.3955d8d3d.0","@material/feature-targeting":"11.0.0-canary.3955d8d3d.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_11.0.0-canary.3955d8d3d.0_1616613391193_0.497759439770874","host":"s3://npm-registry-packages"}},"11.0.0-canary.23ea2d85e.0":{"name":"@material/slider","version":"11.0.0-canary.23ea2d85e.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@11.0.0-canary.23ea2d85e.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"1810b5a81191cb031326cf6ced33ce652add0960","tarball":"https://registry.npmjs.org/@material/slider/-/slider-11.0.0-canary.23ea2d85e.0.tgz","fileCount":38,"integrity":"sha512-WHtVsm+NWe3mQIOvKzNrn4A4LtW5noBTwNiPTlL3P7Tz3+ugkjTSGsWAQvsOU7pWp0c3VP7KkbYp4ITG6uSRGQ==","signatures":[{"sig":"MEYCIQDs1FX4eM+mIj8PQn/yYp5dboBOo+aH6ATu3rN1E81kzwIhAJXSYjM0rNSHAWxHbFW7PJP7Js2Yj7lqd6KqPsKEESN8","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":814071,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgXMlECRA9TVsSAnZWagAAuzgQAI3fuwk7+Po4F/AoNJI1\nlIyTmYWNhbtSXAFlFC3wvyA6DUWtNdrzt+Yb6q1Jjslij3ttWSBXbWAk5Luf\n4J/ODDjKgDHmyNP/ffRNQD+6AWVPLhwFiSGAEPq8YOkwqUg/fKPqCv9RKn3X\ncxOBhOvQodOwcN0S7DO840kFMZlUozW3jukPTnBjrByRfCLT4CXcRaNrS1SY\n12XpfYUC2hT2QjnTtfgOPlRDBovuE6CsvTuPhOXXwjQ6w1DUKzH8i/mgN6Bt\nptH5+svdGfFU86EvkQCopZoDHcW9KiwSgyBm1kV+qajsuoME28tlvvQYfhAr\nMP5SjWpQ1HVU6dsh1jeRjTNaRh7W6UicmBA7E+Kcl/Vp/1bsPDkX1wR5mv4l\ngH8aarBHEQEDu+TNgvnxFog6t8dWdvSl51smBAeHutI4PVu01q6+HsXoTtUX\n8cCcEyV7yFLF5QBhK7l7dpHX8obCrOjAt5FS9LW/bDkjuHo6n3XOYVgJpqxw\nnJl13F7LtMulxZsEyNYdoUruFnG30PpjKt2uprtbE2rnaorOmU1rGSHCN9o5\nX9jbTW6iodaoDuVbR8JnufLaForA6B/P/uqcW4cXJrquc3COgMHaxfqdUCcZ\nedGl3Ao+IkbtYZfCR4akVOR0S6H3kkHPu5ds89fwhXi344FjtTiGqWUtQ6/Z\ngBV8\r\n=Z5YP\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"705a9cbab9462d9e300da18c26d7992aec452ff4","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.0","dependencies":{"tslib":"^2.1.0","@material/dom":"11.0.0-canary.23ea2d85e.0","@material/rtl":"11.0.0-canary.23ea2d85e.0","@material/base":"11.0.0-canary.23ea2d85e.0","@material/theme":"11.0.0-canary.23ea2d85e.0","@material/ripple":"11.0.0-canary.23ea2d85e.0","@material/animation":"11.0.0-canary.23ea2d85e.0","@material/elevation":"11.0.0-canary.23ea2d85e.0","@material/typography":"11.0.0-canary.23ea2d85e.0","@material/feature-targeting":"11.0.0-canary.23ea2d85e.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_11.0.0-canary.23ea2d85e.0_1616693571556_0.3086114751738731","host":"s3://npm-registry-packages"}},"11.0.0-canary.e3ec22f45.0":{"name":"@material/slider","version":"11.0.0-canary.e3ec22f45.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@11.0.0-canary.e3ec22f45.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"ba81443f32be4b2e687e38015d3f765c3e723564","tarball":"https://registry.npmjs.org/@material/slider/-/slider-11.0.0-canary.e3ec22f45.0.tgz","fileCount":38,"integrity":"sha512-75W75NSv/lRgzP3jPU0OjE4/eYPdIwR71ZPV5NuGFg0qEKiBDZR7PkVq69iKiWsyhnlmozvmFnDrr41F2jIAXA==","signatures":[{"sig":"MEUCIG9XzmuJ7dKMrhd6RFTNR+rB6bmDrhR+6i51gog1uZr9AiEA+pwE1Dp2b9WMZFryL8uSk+oojsez/hgU0tiTx1nacVM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":814335,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgXM7wCRA9TVsSAnZWagAAUUwP/3aO4OUQAqi0Wi22LFPe\n1rlBG7nbZfMwIiGAO80MSPt2dYHCKqIJztN0V7Cl1jZ9pDErVfqwZ8BVFVrO\ni1RwxFXcMHpEr0JXPrhJKx6CRcI5X1eK76uhhxitMgCt9QzzlV0f1ZAdE6Gu\n7xomWMUlTnWDE9PZHL+nLs6ta1s1W3t40ARzivlWJwe7woqTo9pnncnR5RZ0\nFGc60la60wOt7jU2EpesOtAZQtMLRqmXZmkFGj4+fTRjynV9vvqGuqKtNsyg\nbcKKa3lxcEJ1fNSrrCIGZbLnZIC6wQzJraWUwvsOoDFjVDAWrf2bROU+dKoA\nDROQu1XS+2pl/cFy+BTI7t5XhQYGMqtu6TFj0bk7p7EM79ns4ZBNLlXB2vR4\n23/tbbfIe51DdnZhZkdLCsjn2UlDB/bRN9acbsipDWRfesynIlfgpOJZaUZy\ndT2m+EIbtResges4NIM3bUBk3srMefkOLabvE4QxrDIgbJB2uljmy+eBJm54\nzZ3IGoYKXbCEj24dDh8943S+OZ97SRc2yjqtws2B4QavXtLXx/bMpU0Q6lzd\nhBqbrTUzTauBDS+wsFim5lcLFciGu402AnSm9gV6ImmMBaMnjs5F5YVjx/EL\n3XxHggKeNAQwMkNiKZ52gewSwWE/J/41xQyvprLdteNe4zoAOAziiK5ERByr\n1Ajh\r\n=vm07\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"2827fdf50a2ab264554f8f307d61fddbab82c5cc","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.0","dependencies":{"tslib":"^2.1.0","@material/dom":"11.0.0-canary.e3ec22f45.0","@material/rtl":"11.0.0-canary.e3ec22f45.0","@material/base":"11.0.0-canary.e3ec22f45.0","@material/theme":"11.0.0-canary.e3ec22f45.0","@material/ripple":"11.0.0-canary.e3ec22f45.0","@material/animation":"11.0.0-canary.e3ec22f45.0","@material/elevation":"11.0.0-canary.e3ec22f45.0","@material/typography":"11.0.0-canary.e3ec22f45.0","@material/feature-targeting":"11.0.0-canary.e3ec22f45.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_11.0.0-canary.e3ec22f45.0_1616695024022_0.7632004141776361","host":"s3://npm-registry-packages"}},"11.0.0-canary.4ceb42220.0":{"name":"@material/slider","version":"11.0.0-canary.4ceb42220.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@11.0.0-canary.4ceb42220.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"5145077ce46e021a2c27b4de0ef4787d834d52dd","tarball":"https://registry.npmjs.org/@material/slider/-/slider-11.0.0-canary.4ceb42220.0.tgz","fileCount":38,"integrity":"sha512-3LFop0amevabafBfEWc6Fk7TViipMoJ5NNrKh0fWVZysqnADfnou4mDZWUDFxZPDHVkg2zHkvQZc8H6S67FN3w==","signatures":[{"sig":"MEYCIQDTb2GiwauyxS5zD0awl70w19AZAQ8kYA8ImhdMY5bJJQIhAO+9bCG1o1McRFN8PzwQNvVkNCN/vOiM37u1yWqglr8M","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":814335,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgXZPxCRA9TVsSAnZWagAAB2kP/3AjSjh0d4R9kyMk4fCB\nACgG4z616Db4WRPw9c8LkEajx7kuLV+bnToEKTJ1Qam3NheEtMF1KVD+hAEp\ncYR773daY0yKZFVqPPhYZqmCM2FiCn33vJTqdeSHakQGRJpA/veGq20BNx/+\n2HMEiIAxorMCZ9ZB3E8S/FjTpZmm/+ANE96wC+nW4MbpD75O5jPpFQ9sPzDT\nHwUVIFditKlH2UqsewJWWy6zbIUaAfFGZc8DWT4NbGEohLiRMG5Vej7PpEko\nQ2S6kEsz4yx1yrOP8RbfpCTnPY4j1UMIehxDCZUV/+RG2a6lQP+kb+yfPN9F\niHvCa46cKaK9xm1emNVy+A7P/OUDMcDHbp0lGiHfof/x69Q0azql7AXjC11e\nK8RBzYzWGjDPFtgHmfSywSurRiZ0X3kAJmFMYeV83qR+MqjNQ0ePndFxDlA/\ntZZN08sLHkVdvcefJUD+Tf00yLJ8QLPwZsp1Z88X5ZB3aL3UHhOmMCe4TNT+\nfwdd8R7H+NUmUeZG5BtF8fz41RMKMiIM8B1fc4TWf+NDtj/EeGbknCaRagS3\n26ONe5lTiqKt4l7XR0eu9caOT6JE7ZheBAvpDIKst2JksIrDSMxyDtr7Ny9g\nJVdOPeKw47KblZUq7dvRa+vpA21uy22V09U91XnnemyStf2of94PTseZpGCB\nRg2K\r\n=c+JY\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"75fb611f33737c857d1b59245ff5a31676d7f3ee","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.0","dependencies":{"tslib":"^2.1.0","@material/dom":"11.0.0-canary.4ceb42220.0","@material/rtl":"11.0.0-canary.4ceb42220.0","@material/base":"11.0.0-canary.4ceb42220.0","@material/theme":"11.0.0-canary.4ceb42220.0","@material/ripple":"11.0.0-canary.4ceb42220.0","@material/animation":"11.0.0-canary.4ceb42220.0","@material/elevation":"11.0.0-canary.4ceb42220.0","@material/typography":"11.0.0-canary.4ceb42220.0","@material/feature-targeting":"11.0.0-canary.4ceb42220.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_11.0.0-canary.4ceb42220.0_1616745456292_0.04987913410895861","host":"s3://npm-registry-packages"}},"11.0.0-canary.dc9c84023.0":{"name":"@material/slider","version":"11.0.0-canary.dc9c84023.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@11.0.0-canary.dc9c84023.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"055885ffd24e46ad0730fdd36d8a3c0e593369df","tarball":"https://registry.npmjs.org/@material/slider/-/slider-11.0.0-canary.dc9c84023.0.tgz","fileCount":38,"integrity":"sha512-Ulas+YwA9TIMCgtcYgN1l7DjqthhHRPV44jJOuAXYSHgeqn4zVEvNCXgurrJAAeXIS9ea424j3HW1N+sJ0ichw==","signatures":[{"sig":"MEYCIQCPhRr2eGo1rgrLeT1h67O1D3W4WpBzeO+G/8qDPNh8OQIhAKEDRBXByABLGsOkMtJf9WC7Gf16vVzigWGxbVdsuZKi","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":814335,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgY2R/CRA9TVsSAnZWagAAYL8P/Al6NQbxitJcDn65anga\nS4NlxqFszMmgpqO9eurCVnfYbEGkiN1VV7TrfRPkC8r3zSh21e0S6tSlZnKq\njqFacvRprLnmOcIeZTqbXFal3r2jII6v2/4bqdjU0+uR61f7dmTwG2ow8mt4\nMPvgTHltVAHZ0xie5JYKtmC2HSRvc1p2y2KJp+SUZXLFlVuCcGv45V3YY4CQ\nY4/y1pENoS4BocM79RP85LiEI0s8ezUgkF8PlQJNJepnjBGIkJzMvf28Hvzn\nputrs/djYzq0QQ8NWY33Q/lQDynppKOZPTUiYgdmZiJGZKNhW0TNIo07JVt2\nKRRIvNXFrSfYBvdXuPnX3+FZlEXSwlX5F0MURd2apkwcUrStB69//XUgOt2r\nM+1ZvJjeiRKv7xh8+dn0q+W0Dkap76MtYr0jocpyId1yFEukaydhLIOWBcQh\npUX+UTzZcJi0QYaWF05eEBY5cOO9xARqW23VErrpd5pa7e6BSPGPtshgW9jg\n1zpI2EnKBbWHxk8cTpR+RccvLQPp+QT0I/EeIuezq4qZyLMin4qmRLu9LTue\nuHNJlRDfnRvGiq2AFelFvXTFYKzf8fAUdUSM4XnjW+NXZ9q+5E7m802g6qg9\nd3IRzawo3ji24NqiZQgIuemThO+Lp+jY0kwRtkJ4TmdNeLWyruuOTVZW0UaY\nniNL\r\n=uTOF\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"d7f7ddbc4309b6a8ce5cca3772255dcc6acdc701","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.0","dependencies":{"tslib":"^2.1.0","@material/dom":"11.0.0-canary.dc9c84023.0","@material/rtl":"11.0.0-canary.dc9c84023.0","@material/base":"11.0.0-canary.dc9c84023.0","@material/theme":"11.0.0-canary.dc9c84023.0","@material/ripple":"11.0.0-canary.dc9c84023.0","@material/animation":"11.0.0-canary.dc9c84023.0","@material/elevation":"11.0.0-canary.dc9c84023.0","@material/typography":"11.0.0-canary.dc9c84023.0","@material/feature-targeting":"11.0.0-canary.dc9c84023.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_11.0.0-canary.dc9c84023.0_1617126527448_0.49402459751413397","host":"s3://npm-registry-packages"}},"11.0.0-canary.56fc26962.0":{"name":"@material/slider","version":"11.0.0-canary.56fc26962.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@11.0.0-canary.56fc26962.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"9ed39e4b7e9c2bc86eb4df6dd37dd0cb28d0e675","tarball":"https://registry.npmjs.org/@material/slider/-/slider-11.0.0-canary.56fc26962.0.tgz","fileCount":38,"integrity":"sha512-Ub7SqKtsgs7bOurrpu8vErvSSs3XXsq01yrqr1VOY6LbSywFi67q7dlAft7SmGgO/0hAMhMP8l73CtlO1NTmVw==","signatures":[{"sig":"MEYCIQCgw68j7N5Ecfrs035KWDeQYngF9jw1MIuwyB/EsfouiwIhAPx8uz/cnS9TpJeXbliWG6bzzm8etG6Kfn9ZW0xuDVzc","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":814335,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgY8BsCRA9TVsSAnZWagAAL9YP/A+25acYpCXdhBq8VcWq\nZST+m0SW6Rva2kNpVpQF/o0tnOarkM8CD6bkghXKpnhx+UkMjMjPcuaLMip/\nFa6WdMp4cZa3N3gXt5g87+vFu+8Vn03Zd7fX9y6IxVtHu/mTRFB6Ayla+loB\nWiCKFXVPyMF20v7HD7yzHnahfMFqZy8gmeISw9Cvu9JKlarekEIrIQCU/wSK\n4TNwPKv4fBUu33Zt76XnEHKuqNNYdQx1t91GB1i36BVKVI71W3ES8H92Cd8t\nAASmBpIq9e7FXwyj4Utd9/9IXPylysJRXL4WIYtvPkzEbgJcnBoLR1JhAShq\nAXwK6k9ieNxbqXjb9VQepOBjyEIIYxVqqyoQQER0M+rt8h/Y5XdpwjiriLcN\nX+VKQkdc4JDEgTqFyINDmKnRPBJXCAVpEqWZb9xYCjA+8SC/ZSnuZKCZwB9R\nruvamLbwuBvRjuzrDtcV8vff9wSXJr1A+4qEFjXMPP+7WPf1DQ0XhO/08/8A\nEJ13bgAjFcek9L3Q976+WbIPYL0q3U4OWmmY4YkXAiNYLZ7jEzgFMgPvTNtR\nYLJDjpd+KpCsEi9enYuJTMHqeSSY4KQS5GEGEVqNAG6wC3Le5lncU9uAK4jp\n6LYZreD0axXhHxTtOVMyQV2GXkdCwptFj17nuoeCjmHJGIfxCDl8UFO1DBBx\n0kj9\r\n=dbUP\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"dfdb8792d4ee8bddc61386ac6a8e7e216c1681a3","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.0","dependencies":{"tslib":"^2.1.0","@material/dom":"11.0.0-canary.56fc26962.0","@material/rtl":"11.0.0-canary.56fc26962.0","@material/base":"11.0.0-canary.56fc26962.0","@material/theme":"11.0.0-canary.56fc26962.0","@material/ripple":"11.0.0-canary.56fc26962.0","@material/animation":"11.0.0-canary.56fc26962.0","@material/elevation":"11.0.0-canary.56fc26962.0","@material/typography":"11.0.0-canary.56fc26962.0","@material/feature-targeting":"11.0.0-canary.56fc26962.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_11.0.0-canary.56fc26962.0_1617150060134_0.8150181586634633","host":"s3://npm-registry-packages"}},"11.0.0-canary.bc318250e.0":{"name":"@material/slider","version":"11.0.0-canary.bc318250e.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@11.0.0-canary.bc318250e.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"16cf191b12fa59a9eb7a7c9e2e524006f9ae9023","tarball":"https://registry.npmjs.org/@material/slider/-/slider-11.0.0-canary.bc318250e.0.tgz","fileCount":38,"integrity":"sha512-+vYk6SUtfqAbZa+1K027Q5tfaisovBubm9xh6I0NtsjRYo9qrTrCJGa9cK62Ga8qa/8n7m2FihAgaaNfhwX1vw==","signatures":[{"sig":"MEUCIQDe7M0iA7CKWD6FfQnoR2OMXd3QC+YsoMiAvQz8BFWdxgIgR6Kw99lw46l9LDBa+9F1pjz7cKp1jwgoY7tib8UWEd8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":814335,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgY9F/CRA9TVsSAnZWagAA0j8P/0pK9VXTivjVzjRgrT6D\nJQCncXa3pYwdEFLdkdfmxDm/8F4PIaASoq4KK1UeTsBJ5quQrHaYItCuYgkF\nbuJKut4c8K372tBV8wo0VoI6nMw71Jblnc0OD/jqpBH+PDPQRQSSlixyH7M2\ntgddPljbkTPcIXBRwz7NtzjyzVLTH3NK/2z9zeFxSTe9RJh1GY8TR8JUOHmJ\nGaW/FxMk3lKegSdRbsJjiUGj/Qw247f/Y/+Xvr2dhCWrjplvc06aCgh13tVV\n48XnVLw/lgLCz2RkF3ERxITrXFN36PxdTJswq4u0JgNy9FdTETnrG9z8GmvC\nPZi5dGMDYhaIiZ9qkWZuNOuIOLNRWP7xMxHP+h5fRFCW/oVgjRjBA+sMSXr/\nb8ubTzBINBGGkzwywwkHkkdL1Jh0aNf41Gv6vCMYvj7F6EimfxLs1JHRmq1g\nQv0XlP4eijaXPvJlolzAy2wsAygtfklOpZa35n16wdeqjSnYwmawCoaWjBO1\noTDtRVmDg+1F6Lr7UfYJI2huFz6/Yf4u029GAP7mWdIlm6YqgF2wlZ8R8Z6+\nWTsxOMZNCcK751HRfyIIhP63Kq1LCMfAnVKN31OjALpzY7USalSMr4vQZGCl\nz1SfWy89W+UMVJZpNwjKMcBFOe0oh+CRtDgmS8BGCIW2nJoCh7gOIrbEx1ns\nsFfG\r\n=jl44\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"1de1daa9e4e0ee7a779d524a027b9e7566841b56","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.0","dependencies":{"tslib":"^2.1.0","@material/dom":"11.0.0-canary.bc318250e.0","@material/rtl":"11.0.0-canary.bc318250e.0","@material/base":"11.0.0-canary.bc318250e.0","@material/theme":"11.0.0-canary.bc318250e.0","@material/ripple":"11.0.0-canary.bc318250e.0","@material/animation":"11.0.0-canary.bc318250e.0","@material/elevation":"11.0.0-canary.bc318250e.0","@material/typography":"11.0.0-canary.bc318250e.0","@material/feature-targeting":"11.0.0-canary.bc318250e.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_11.0.0-canary.bc318250e.0_1617154431246_0.2122252933341","host":"s3://npm-registry-packages"}},"11.0.0-canary.edaee19aa.0":{"name":"@material/slider","version":"11.0.0-canary.edaee19aa.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@11.0.0-canary.edaee19aa.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"f6f337a252b187d093d75e3728e856208d320eeb","tarball":"https://registry.npmjs.org/@material/slider/-/slider-11.0.0-canary.edaee19aa.0.tgz","fileCount":38,"integrity":"sha512-qpkXkwRQocAZvKqKrX4gfIbyHzKA9AyRjS6xK9G+08ockdyf20KJ1vNjkWIfDgAKjU8n0e2WtCjewFAowsMcWA==","signatures":[{"sig":"MEUCIQC9BU7ya/XhtlX4YK98zyeH2WD2GR0LXazooMjQSlK6WgIgVY3lrOfpMjeftR9AlTeTXnRkwajFgFpUQvT6C8ECLgU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":814335,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgY9poCRA9TVsSAnZWagAAfQ0P/jS2X0R0gl3G9IG0rAv9\nZCRAVpAuGF9d84ZOjG/MWHznIPTpuuZJf0DmJhARmxoFvihDkXFzfcU47nzV\n9R6YuA/a2zrpyaH21hIMaUap+6gLAOvDV7iBDYIaHPtanjIs/3+XKF0zuCK+\nZf5xgRAbLUZjDbeX6suVwKVG9ShJUMrFjDbX9BvweeDpwrVCr2ez9IhX76c3\n6BT0EwPBUI80WjDo/GCv/7zEKgHL3srEE0Bq9qG9nzXez+BxbAhzLpbAV/vI\niYSTx87xeRqdju6tn0q1zpYHIu6mN+i9+q7hmXK4zjcVrzrDAEawcVw9wGVJ\nXLdaxu6pFIcCMv7virkXVq5740hi+wQvj3bdf09dsuaj/2bxMi4JVxrXIOu0\nf1r40v++ZzCUyTARc4XNiPYQjq5OLYqsAjfDbZtLUTh8qCk1nD4VuQRquqNs\nea75GrRf/23Nr7pdAJk/4uZo+Pw76Z7jQWN93fLzTClU2xRynT8A+KiKNLjG\nc1fILPwhJyIWrXzhFZpmKFpCYmsx8PurHJFXYwsQXZIOko3bsUukRoYTM8Lj\nU64rjjDGnIpK+J/gk3hyAVW4vkk6WTaGiBxuQgYxy6pDhTnXEldamKqcfHiX\nyJm6PXFWz1GvkdoL2mIBhZcMTy1xvqb3t4rTtQ8Urot2xB5m/83jVPYWYjHe\nS2C+\r\n=ElaX\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"e2249b4be4cc5bba6887f28ddb9a3b9cc8ee09de","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.0","dependencies":{"tslib":"^2.1.0","@material/dom":"11.0.0-canary.edaee19aa.0","@material/rtl":"11.0.0-canary.edaee19aa.0","@material/base":"11.0.0-canary.edaee19aa.0","@material/theme":"11.0.0-canary.edaee19aa.0","@material/ripple":"11.0.0-canary.edaee19aa.0","@material/animation":"11.0.0-canary.edaee19aa.0","@material/elevation":"11.0.0-canary.edaee19aa.0","@material/typography":"11.0.0-canary.edaee19aa.0","@material/feature-targeting":"11.0.0-canary.edaee19aa.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_11.0.0-canary.edaee19aa.0_1617156711792_0.0034051598679505357","host":"s3://npm-registry-packages"}},"11.0.0-canary.24609b822.0":{"name":"@material/slider","version":"11.0.0-canary.24609b822.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@11.0.0-canary.24609b822.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"e65aca7b3ebbbc60f4898c2a78f1a729242c0f01","tarball":"https://registry.npmjs.org/@material/slider/-/slider-11.0.0-canary.24609b822.0.tgz","fileCount":38,"integrity":"sha512-CbIVItkkz1lt0ao0ObnZHRCi56sfXPYVVrVhfXLE9i0nyzLCuS60AZ5VQGLWl92Jc5+iA9G8BZES4OJ5bwmOzQ==","signatures":[{"sig":"MEQCIHtHUP1H32VqgQmu+kS5TJU4OAvqhLdx4fA8gILQp5w0AiBb5cMQ2oJ+cgLkgBMqfAfnfmrVF+o6s5uibfrpwbaGcg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":814335,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgZOIrCRA9TVsSAnZWagAAQS8QAIGVmA5MfIqspBPuVxll\n1mfekwCPIOxeKNxH0t4/JXcB5xdhvIVxbdUHXG4zNs91N8bUt94xRWCdIoWh\nE+YoTkluSzjIFZgVftvanvnCdLyv3+AfvzkZFVUFvphYThitoLp+UHYnATZz\nHInKulUOg8mJHluwBDwJ47r/8wPNVtm0cs5KKyP0+AULNUFUGUu7MTS5Ig78\n02P/eErioLOPvtAcWi1VKQ6RpqUS9hWuIeBJVptMNMTb4dFV1QD9K3YmVSG1\nx8xpMr1IqDX4GkqM1s0ovCwSKw8Wi+C+t/W94H+qP2VE7kCqZcwt20/bfkLr\nnDD+bWqtieAySATpF862bQi3vkMc6VE9b1qOMWxBPCF1LALZUA6NtG6p6K+d\n1vKFggqSnyrs+tPRzuVaROR62eTG8DYGnwOnvcvc/pg27X5wV4WCXXX9QwNF\nIEI4Q+3q+tEfIYB3b2Lm28ezV6akmRZEL6AGqQObdFvjmFb/SXtyuZYmEHsU\njj3evHm1cnN5LZCwrG3BM4AziN1+JjBkSpu6PZfanvPliCbCoErpYk5wLgw4\n4X9m9STH0Nv6Uh2lYx0pQsbUpBYIdInJfcseLgXbWqe7qdnrGbUPRESqUirb\nohWkjoS2qcPazxuFyawujTbTVlP4rsJ9qerJqBdSKOTfXPR7GXf6/U+IsMPA\n2GZl\r\n=Etd2\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"50b495134dae6937c2262389aba694d7664f78c9","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.0","dependencies":{"tslib":"^2.1.0","@material/dom":"11.0.0-canary.24609b822.0","@material/rtl":"11.0.0-canary.24609b822.0","@material/base":"11.0.0-canary.24609b822.0","@material/theme":"11.0.0-canary.24609b822.0","@material/ripple":"11.0.0-canary.24609b822.0","@material/animation":"11.0.0-canary.24609b822.0","@material/elevation":"11.0.0-canary.24609b822.0","@material/typography":"11.0.0-canary.24609b822.0","@material/feature-targeting":"11.0.0-canary.24609b822.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_11.0.0-canary.24609b822.0_1617224234808_0.8783413851118895","host":"s3://npm-registry-packages"}},"11.0.0-canary.b6cddc2b7.0":{"name":"@material/slider","version":"11.0.0-canary.b6cddc2b7.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@11.0.0-canary.b6cddc2b7.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"220b4c16f74bf4d390a47dc2c2666b22033fbb93","tarball":"https://registry.npmjs.org/@material/slider/-/slider-11.0.0-canary.b6cddc2b7.0.tgz","fileCount":38,"integrity":"sha512-MI2P8KmYdJCBhVDIMkZWqhzyWWCPGInlE8Sxut2ZWjRFMxZDBadbGH8k/WO4RF4LXTG7gO/UrRMTGEsxiAJyHw==","signatures":[{"sig":"MEYCIQCdlTRz9qQlBFKDAoiENWzjknoTB1S1/YX3Eh/IHQGiJAIhAOG+64qc/R0F7sG5v4odTHDvf4SQO1uJITo1hD5C3uC+","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":813419,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgZeE4CRA9TVsSAnZWagAAO9UP/i1DfCMdLRNYKyIvppnc\nmD2sgO0iv5TK77MXtbd0PEY3UvR+upr9E/eBeRUw4WKDv+KuDSqMCldpna8l\nXmtE2t0uJ1UqdJuFIwYfA+sTgVLI3f3aVRHbnH1f0auz1I3RPBV4xR+0OB2I\nEMTQ6J3Sj0heaogi9xADfSU00mRxZ9NKar8RNL+4iuWtlCw3n5c0TDLeAhCS\nszoWJh/0tk5hN1bvXLb+fli4KZRnlyUvpq12Zx9rgKNd9ZJvjfPonZ8rwlL+\nVxKbdUVOqKQ6F+IPYoBXKou4Tq+OWW9NaKwPBCli3fqKUjobuewY3o0MluFD\nloYbjHpA4/vxxOQrIb7yBG1fwPiMLiTaP3M+BlhDS4x7ts2bJdctT2j2rAhN\nwf7FgI6YNvCogyeJRgzywCqZPpR+B8TMjJDipcRna/TT42pCOUdnmYJXUyzK\nIf0RVjUADt5STb8rAavh7R0WPs/gyFC5BFRv68Lbkis5kUgKXtlHFQldWM3U\n2IXTnVtQtjNmhAx13MYHPpV5OfnFV/joM+fttsoZLf6zWwLdPT00WErNUv/S\npjto0VvMq/z5R2wj6lUYWjCM73q/GbeLJEsQm+w5RsiBx3y6tYU6HZybJhJS\nvL2VhXfSXvkQgnsSpskF3qs/s4jEKToWd5Tn88RrgKAf9Ae79zg8sZ4RM9+r\niqc1\r\n=ScxV\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"dbd92fa1a28a9b31a1e4eb476b15f4cff38986b8","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.0","dependencies":{"tslib":"^2.1.0","@material/dom":"11.0.0-canary.b6cddc2b7.0","@material/rtl":"11.0.0-canary.b6cddc2b7.0","@material/base":"11.0.0-canary.b6cddc2b7.0","@material/theme":"11.0.0-canary.b6cddc2b7.0","@material/ripple":"11.0.0-canary.b6cddc2b7.0","@material/animation":"11.0.0-canary.b6cddc2b7.0","@material/elevation":"11.0.0-canary.b6cddc2b7.0","@material/typography":"11.0.0-canary.b6cddc2b7.0","@material/feature-targeting":"11.0.0-canary.b6cddc2b7.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_11.0.0-canary.b6cddc2b7.0_1617289527793_0.17202351443453967","host":"s3://npm-registry-packages"}},"11.0.0-canary.94937c78c.0":{"name":"@material/slider","version":"11.0.0-canary.94937c78c.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@11.0.0-canary.94937c78c.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"4eea7f0b111582b42dd174abd3da4ce6a84f6400","tarball":"https://registry.npmjs.org/@material/slider/-/slider-11.0.0-canary.94937c78c.0.tgz","fileCount":38,"integrity":"sha512-hJ/58bmICZ0mLlYszJE9NPT47+Ne5tZuYoj+923re42T7rTXPkNaWTUfwdP+CxInLQUquuA+G1oq4FWQwbufTA==","signatures":[{"sig":"MEUCIE1VJZXc60pDxLpGdjnt+dxKp7+/HggDXmOugSyBmbuMAiEArJKIf9bwDYFAJOIu5+o090tti5vaVmCfNT9LQ/B6q1c=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":813419,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgZjSNCRA9TVsSAnZWagAA6QIP/AuXv0QHg93+k4fjku2X\n9BE8aPfwOZyDKw9SsyY3r5TGULQxzRzArVDFQbyH7Gmyei1aPW41dHJiqS+g\nP5Vb08NQ8elPiUOmNnWiqMs6RMcQGDmvfhUG4RnOfvj6LtgJchgK5EQhumIj\nc+xROdJC8b3njuuhdyJkSz9TE8TX2vS+Q1Td1ZR5juHnwxun8yS+D1Uuf8s7\nDj9OsYDjFVH5OyeURj0ME9fsuy0gi0s34W3zSKRWv4hDe12wXlJKz2ZWJ3Ys\n5Nus3B0F5GQ3Q9Wjwo4l0F090XcybxkU5U43yTl3DSaqWaX6tdwtFFQAxBGx\n//fHrXYrciUYl4MYgV3GOtX7w7Kcm/Dsq9ySRrd70NpzVSkJAvugqzB70cwo\nflfxOwbSXSYfiTj8MOwRhg4FwILTfVsojkfFSP/h/VuZMXv6lOGJbnk0n9Z7\n9WrDkv0GNonkGy6xMJt8utGJO4Kvj88JytJnwuHFJKaPiMJamEf2ODOIvU1T\ngBhpGS6GDlFFbxZghqqmbHkPINbtUOWeZ5ruVrDWf176+ifHdJfjPzjpyStg\nrZ0xOidWMDLR8nRdr3r/gwZe6wLeB3DXNWFmR4clvGoO/vKeJOeT1YGdibLm\nZhr/HtYKvfqtAiCrw6+3Y7Y4TICes5XXHBj98nwoDtCHJaNgZ8MmLvxHL5T5\nPVf3\r\n=+er0\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"ada608c773d2657680fffa3be444debd83967f00","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.0","dependencies":{"tslib":"^2.1.0","@material/dom":"11.0.0-canary.94937c78c.0","@material/rtl":"11.0.0-canary.94937c78c.0","@material/base":"11.0.0-canary.94937c78c.0","@material/theme":"11.0.0-canary.94937c78c.0","@material/ripple":"11.0.0-canary.94937c78c.0","@material/animation":"11.0.0-canary.94937c78c.0","@material/elevation":"11.0.0-canary.94937c78c.0","@material/typography":"11.0.0-canary.94937c78c.0","@material/feature-targeting":"11.0.0-canary.94937c78c.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_11.0.0-canary.94937c78c.0_1617310860697_0.6667667281824889","host":"s3://npm-registry-packages"}},"11.0.0-canary.e7202cb57.0":{"name":"@material/slider","version":"11.0.0-canary.e7202cb57.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@11.0.0-canary.e7202cb57.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"82ad2dce58a96a9b0823d393690a47964416702f","tarball":"https://registry.npmjs.org/@material/slider/-/slider-11.0.0-canary.e7202cb57.0.tgz","fileCount":38,"integrity":"sha512-RjVqKCuDK65VgzwGkxEbrU0KfFW3mTI+FN5uuLurHMtXNECoTDLEZuEVkFT0LwheOYESORgj19UxJCx9O9mJaw==","signatures":[{"sig":"MEQCIQDMdu1eiG2ddAGufXlbe8Y3/oOzr+2xxNpgU6nfFEa1ZAIfEDjm50GlTSVuyfNh8LD8WGPjaqUrTALwfrk5Eac8Nw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":821223,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgZk2DCRA9TVsSAnZWagAA62kQAJ5CYU24txqd+y/0baU8\nNLfa1U7W8RncfAfufQSrRrFCbxB6Mu5qpgL/fH8NL3hnbEB2QSeyrKTWsZ3Y\nE6MQCcCN8pUIDxWdC1kGHWFmT3xY5Eh7QDFIc5QTz01ZnI3KEOIAiwsPq5gq\n4saqtr5xFqTcefrriZEFOhw5q6aIMcc4/Y/GkDlKhulXsWdt9ACXfeT5zc/c\nbxBP7360+rN8sOqtJkNOu9Yrd74NNwfzfAddTg9790KWBV47N0mnvY7rYqbo\nMOTCHZr7h1cZYyAn3JhMD61n4Rq3VG1hI26acIMyTtihT9ohqDAND8I4jFFi\naOcYyI7gT5CKVnTM7NkNf+ixmug+soolwH7jWkzfkKs8zpeqd6bXuWnhMbPQ\nOP+uOg7zC9BCy/MdgJtFWELRi+cibQxwvLB9JF4OECh0i0/5JibC6yJ9OP6u\nzvK/q4wC70pkFuoa76GtvUDXdXoe/k8v+myUc/S4akTvY06QrlREaAHielB6\nM8Kwq5v7hJuZTXc2VQdsW0VxKiuevJLWx/jrVC7RC941TZCZ35+LIxWW2Lih\n8Jd9vbT+D8pcJNCRm2+6Bz3bpRhK/H3p8Nt4NZ4vvQLE7IcvIvo5FAa5Lo9f\nudytJ+5DKmvv5UmlmDDHmHKDN4RJMenflWJdHkBh0MTK4miXh+yg2sTyHfhN\nd29a\r\n=VbFX\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"113d79c2879cb1503ff12c8064eeb38ada16b472","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.0","dependencies":{"tslib":"^2.1.0","@material/dom":"11.0.0-canary.e7202cb57.0","@material/rtl":"11.0.0-canary.e7202cb57.0","@material/base":"11.0.0-canary.e7202cb57.0","@material/theme":"11.0.0-canary.e7202cb57.0","@material/ripple":"11.0.0-canary.e7202cb57.0","@material/animation":"11.0.0-canary.e7202cb57.0","@material/elevation":"11.0.0-canary.e7202cb57.0","@material/typography":"11.0.0-canary.e7202cb57.0","@material/feature-targeting":"11.0.0-canary.e7202cb57.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_11.0.0-canary.e7202cb57.0_1617317250714_0.24896716217209747","host":"s3://npm-registry-packages"}},"11.0.0-canary.1f636b205.0":{"name":"@material/slider","version":"11.0.0-canary.1f636b205.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@11.0.0-canary.1f636b205.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"dec04db33ede070c27281c254582b4e69835f41e","tarball":"https://registry.npmjs.org/@material/slider/-/slider-11.0.0-canary.1f636b205.0.tgz","fileCount":38,"integrity":"sha512-W6TP638LJ92eKZ929UvJfM86hzhJvCa/pYPiZmqOaazUOw31eFVBsrQnn/exrqHV99jYXsfmy+Qa+oO3apCOaQ==","signatures":[{"sig":"MEQCIB2zmvCyEmeRLBGcCtmXaWMz33DUraBBmwv3k6mFoaQ8AiBZGSPv7gM7kCybX08MVkJ9msu3qwZPW7xZzvy0AfWrnA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":821223,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgZ5mSCRA9TVsSAnZWagAAam0P/0acCEMvk2rZv0udtk8X\nbYWlBb8dRBhZFkllp+/ohhZkGP1AWKokQphlULKjTFy9V6iYTUBomUfVMrMU\nSViK1EUiceCJaWqRuc3VlbXLqGifG2cYBzkcHJzKbgwEv2dycPcyIdcO+zp5\n+AruC4ruGfmS8qNnp7oOBconpqdorQPcjcU2QXT1Beroy2Zmf4gfjPfpoG1l\n0SExejqYHjXNeURRTVwsexYtlv8ENruQd4FrSAsy39Se6FhIO6IYS3yTXUg2\n7371DTUV38zurX8rh3AwpLrBN7GVSvtuqq3otysbjAAMKggusekFVwXsFuQ3\nNidgkjeGfDIggjAt3UXrsIslRpi29ShyL2CxlwMDzD2QOZpSuT/PMV9t81h4\nPYDAoAZj3G9jTsdO3cGHBnF/FlaA/xTd6PACA1rvN/jNsQD6GaETMfD9xbe1\nFhvtJSiPqwh22lZz+nXMol09E0zOQg4JOqlBR2fRnUfcxsNpLRVDs2R+yYxN\nVRWj148YMENhHM2dNBgm69QXVJkHWsuSEurN3FuuXkLY4e1ApM4Gg9OUGewH\no/2+UT5LZsQJbPdVugK/CF6YD6NP7TFvUPh8EpmUJudXDlv4WxirXIBoIABX\ndznbzgZS7aDRqg7PeplI/s2yLlfriydRdxata3Tsd80nbVZsN5bfZ8621s+/\n27bb\r\n=/vvA\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"a523c6467be13e8aeead7e4e2e5f20c418871bb2","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.0","dependencies":{"tslib":"^2.1.0","@material/dom":"11.0.0-canary.1f636b205.0","@material/rtl":"11.0.0-canary.1f636b205.0","@material/base":"11.0.0-canary.1f636b205.0","@material/theme":"11.0.0-canary.1f636b205.0","@material/ripple":"11.0.0-canary.1f636b205.0","@material/animation":"11.0.0-canary.1f636b205.0","@material/elevation":"11.0.0-canary.1f636b205.0","@material/typography":"11.0.0-canary.1f636b205.0","@material/feature-targeting":"11.0.0-canary.1f636b205.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_11.0.0-canary.1f636b205.0_1617402257893_0.7773322555277542","host":"s3://npm-registry-packages"}},"11.0.0-canary.94f50b260.0":{"name":"@material/slider","version":"11.0.0-canary.94f50b260.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@11.0.0-canary.94f50b260.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"25c3f46a7fca037ec9b467b79152a52d86f32498","tarball":"https://registry.npmjs.org/@material/slider/-/slider-11.0.0-canary.94f50b260.0.tgz","fileCount":38,"integrity":"sha512-/olZk2eomC6492Vx8N/0TmOZ4Dk/iaUrkJFJjxfnVW3dqtbawnaV13e3KQRZdmjFi1TRZfT3mYFmWzcK1eLICQ==","signatures":[{"sig":"MEYCIQCMq8osUJVdIXbuLCB3H180IQTvaBXgXC3hkFdihuS+lAIhAN0OX1Z2DrgOIY2ggtsT0zlcHLyhHJcOSvNLrzm3HmUK","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":824804,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgayczCRA9TVsSAnZWagAAjl8QAJgDDFFIQCbqVaDGm0DE\n3avpE85acJg3Mr9eH7KHL4VXXHba6NSlVQuK1vGU7Os1c0RbPGWvtE7BEHTA\njjrP/GiJvQG2lpO6d2Kd5V+tNhEaxtPUzwl9vVsmVKCeeY8JxQyif7GBty/x\n3npaFaYmmAKJWV8ob+yzh8/EugnkIH0UgiHY1Y7AmIR19u3IDjjczwI5hXEn\nASwPI2NccbCXz6IiF4eBEc4UYShJqiK5VHABrwqLf7EtrM0i+YgIfF76yUTm\nZwyV3fmpoh1JF0K3CnhbR8Yij3r1/crbY37mixlr9dxn1JBAW6+T4Zp+PWUf\nKnRQ000jbn3OCRs1zn+IDlsHnaTENAhBSBbA7EDcal+8cj+pySOtkKZmdTJY\nMPVyQGWXImmp9Rg02zrHzrcYGWNxA4LDprNliUvD/Sure4pCp39Wb6iytHGi\n35xkWhuQwc/R5johRjrMGiIPILAe4/Yz76K9l2m79w3mMjrpx/GpkKDb+Hsj\nJKXu9pMGJOs6m81Ob9TyFFfL0R4bc4Q/bV09kc3aTVBVgc9KB5Gie9Z4dBWj\nBIwxNI5lbNI/puH/K2D4bnj1CA+X2k/z93IdNd8hXQz3j7CqFdUhWUDszxAw\nOcRFqmT4FXwwBqjfC6P1ggNTRTx/IOZp8JbthkAxX/STKAD52borwGEk57ZI\nT3/r\r\n=QRVX\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"b5f84c677cd669d6958748a69435b56ebb640bc6","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.0","dependencies":{"tslib":"^2.1.0","@material/dom":"11.0.0-canary.94f50b260.0","@material/rtl":"11.0.0-canary.94f50b260.0","@material/base":"11.0.0-canary.94f50b260.0","@material/theme":"11.0.0-canary.94f50b260.0","@material/ripple":"11.0.0-canary.94f50b260.0","@material/animation":"11.0.0-canary.94f50b260.0","@material/elevation":"11.0.0-canary.94f50b260.0","@material/typography":"11.0.0-canary.94f50b260.0","@material/feature-targeting":"11.0.0-canary.94f50b260.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_11.0.0-canary.94f50b260.0_1617635123016_0.6241581708749371","host":"s3://npm-registry-packages"}},"11.0.0-canary.a4009b80a.0":{"name":"@material/slider","version":"11.0.0-canary.a4009b80a.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@11.0.0-canary.a4009b80a.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"c1ec46cbf458c3d4a5c20c6b99774bddcc89b3c0","tarball":"https://registry.npmjs.org/@material/slider/-/slider-11.0.0-canary.a4009b80a.0.tgz","fileCount":38,"integrity":"sha512-heQwdcznzINlt2OgvTBmKgsFKzb13SAzG/NqN6R/L6hE0EINxBMR4He/dQN+4VK9sLUqAzX9TUvsUCwfYqBk0w==","signatures":[{"sig":"MEUCICtDjMXb6Gpj1pWm4jr8iIW3L6n12kMA0WNWM8f7dHhbAiEAwwl5SobPKgK/r0eR3PWGWudNhpLUnr0wKK4QB9A/4ME=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":824804,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJga4iLCRA9TVsSAnZWagAAN8AP/R6KkNTwwaz6cPox1g9z\nLdlTOp2XeIacxt5CHRRfsaArIeQ2sKHUS/QW/scaa8r5haMG9SNW5QqdQ5HV\ngWtUD4JpW3PgF1DPf/9wKosvXF2pRcwSJSVJzINa4ieC8VInkqR+l1Wqysib\nHV+/8j+V0Lslbcf42DiLjVH2ExvJ7nzWNC/ncYoxedH4wk2LeAenV1U67w6R\nLIEPuQV593YR5Eq2+Yvu+2qg+eW5l3T6O1fjbZ+nUqLQq2g9dYs478IaEDvx\nuCXfAUZE0EHy3pazA+8zq0pPSIiv+FLn4SP5CrGHiuSXFGCGetT/XE42sLmK\n5q6+7SJP35mKBT2QjKPN4MZwuvJTEXOiubNwCchmBWY+PgOXcZOh7PpnFmj2\nLb2AWv9gL3DSzZTRPuSqSjvX9YN0tpmXAhHHUPts+wiqz2sgxiwVwxSi/Gvv\nVXK3kNWBVPikblGPgxLyu8gppx1YsgiokPzouI9XQAA7SjnwzHb0nbUvxKJN\n0iLP6gkGbO9LB2HA+ro/USaDCJu5KjfxUBIiqiTd6R6lWAWVHGLfl5Ahikgi\nuuWVEZMVYc0hSaO78y5IPhdfSchq+VBjxEPsbSFTV5wnjr+u9PUo8pMwfJP1\n2seoSIla0S0NR/lqFALRQk+QxHf1/s0JSdgepM05ypfqvWJeTFj4OpL3xTv2\nBzCL\r\n=NB1+\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"35eef76af32a43b61b6a0fb725dbb83cfa5d3421","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.0","dependencies":{"tslib":"^2.1.0","@material/dom":"11.0.0-canary.a4009b80a.0","@material/rtl":"11.0.0-canary.a4009b80a.0","@material/base":"11.0.0-canary.a4009b80a.0","@material/theme":"11.0.0-canary.a4009b80a.0","@material/ripple":"11.0.0-canary.a4009b80a.0","@material/animation":"11.0.0-canary.a4009b80a.0","@material/elevation":"11.0.0-canary.a4009b80a.0","@material/typography":"11.0.0-canary.a4009b80a.0","@material/feature-targeting":"11.0.0-canary.a4009b80a.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_11.0.0-canary.a4009b80a.0_1617660042805_0.9539040957945557","host":"s3://npm-registry-packages"}},"11.0.0-canary.15604bd0d.0":{"name":"@material/slider","version":"11.0.0-canary.15604bd0d.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@11.0.0-canary.15604bd0d.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"8aa371d18f0264adca3319349a9d5d3afbabaf24","tarball":"https://registry.npmjs.org/@material/slider/-/slider-11.0.0-canary.15604bd0d.0.tgz","fileCount":38,"integrity":"sha512-1ue/V+YgpM4h1ow/K4EDZKxsBRlWwBzOFA6/ArLg0eIzGvL7EQp8bYcAILX3HB9ic3QjkKtMyjXL9n+vw49MyA==","signatures":[{"sig":"MEUCIAOyxyzD+7a4sfVm65MrusqIxtqjsrZR49j4vH9ISBOSAiEA6lSr6YQ/bvij9onQMOTI6P0il3YTCpZYyyiM6l8adpQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":824804,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJga5JSCRA9TVsSAnZWagAA1eUP/0bi81qfLXuRB10MB0R0\nBUtS7R/2hZMa/49RCH8hWqN6S7Eirm2fELqNiDFHdiKxyngXAtMNX1of5l8Q\n0azre7mFDKfCg4KfCOgX0DcqJxga3P9rK8ZA951nvHMJVhN3tLunMWKhIeXJ\neBag6KokB5rxMqhLsGTKIxAcH+NLttBnDZBmqDkz6Y/Dx5B61NWRYb/kCyJh\nqf6zZyaxlOYogQ6TXOU57BSt2ia1LarJr70LthsFDw5nnHUxP9wTEpP28HII\ntF/hu1P2JxNIRuUDmXDJBI/q4WAmcjYJKEq+02ESBrgeA7JDcl4JopVNZkB+\nZBTYfk0BP+5yaqDgr7jzuU//GTIxdGHdS88k9hCIPvpJTehK8vg4xW12zLVa\nqCen+7i58cbLrhXZg+Ngd7gX2GatewWILQDhUtdtJx6ejuYCyMlS5cP2c5Vy\n7aO3BkXtVPNjxwiUu/FpwviKdjcmD9JvH5etL2xCB/6Jg9nCWSMWe+CyKfpI\neqdqOuDqgGkipxUMF1RcM2TgyppnaGLVcjnrQjomrVfmm1WnM/cb0ubApTru\n94fu5U4HXn/E+AMYfT8BC5CyoNjvrD+7FCko4qTWSrnhu07p2boEpdCWq9Gg\n3U0zPDR9ANzeCzKEBk/+44hr9Fy2vKG1uwdzuBPoYIa21gdbJsdUFWsmUfBi\nT7U4\r\n=V/Ru\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"ea3949c02ab8da1a812a2127f1fbc7e7a3c98532","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.0","dependencies":{"tslib":"^2.1.0","@material/dom":"11.0.0-canary.15604bd0d.0","@material/rtl":"11.0.0-canary.15604bd0d.0","@material/base":"11.0.0-canary.15604bd0d.0","@material/theme":"11.0.0-canary.15604bd0d.0","@material/ripple":"11.0.0-canary.15604bd0d.0","@material/animation":"11.0.0-canary.15604bd0d.0","@material/elevation":"11.0.0-canary.15604bd0d.0","@material/typography":"11.0.0-canary.15604bd0d.0","@material/feature-targeting":"11.0.0-canary.15604bd0d.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_11.0.0-canary.15604bd0d.0_1617662546409_0.7271271796146381","host":"s3://npm-registry-packages"}},"11.0.0-canary.76da7876c.0":{"name":"@material/slider","version":"11.0.0-canary.76da7876c.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@11.0.0-canary.76da7876c.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"e9bb5d7002e4a2674b48002a03d2d8abf90930fb","tarball":"https://registry.npmjs.org/@material/slider/-/slider-11.0.0-canary.76da7876c.0.tgz","fileCount":38,"integrity":"sha512-fV7U3KR29koPNKL8TJG2R7UVUCEUqU3gpUy7n0lkUkjjRCmUktsSULDGHCqS4jF0VqeGnKRD+GTDeHxSLdOW4Q==","signatures":[{"sig":"MEQCICnYXbuf762nqia8mjTkf34aixNf0x7wA8GgpFiP2tSmAiA/NAARK7JJlkeKPaUX+f0nGPbKS9VbE1IhHRBpkghitg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":824804,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgbQ6WCRA9TVsSAnZWagAAYJEQAKKqCLdj9Hess1brkoJF\nbESPYH9rEpL8n0KBYiWaqxB5Wze8hv4y5yGdeswE6wmwJamJ6F/muafIVOVG\nsaZejrm77gTaBcnzry9IDUrRnGC7XhzEFzctHDGDcVFFFHAQg//+GjZx+MsP\nUflZPfv+TWhGXFLmqkiwL7WqMRdDkaNqM0Eb9XpwHRARodsKxOUOwls7i6RC\nj/PksCINwIMWfQ7vNkm2VMLh9JMLcoG1FG9Bjx3fQhMXt9aaYcjN0adyu2E6\nEyCoPh3akQdlwkdNC562jAne71dO/nD69e5Z5msr1RAwA+bxXh5/XZeThncA\nhnRJxZgWIcVCnMXEs3NclRWns0P4ozXWK3h0gfAMSBnKwahpA5FxUMLadS8V\ndXvNmiJeaKPiSGaGvCY4yZHL4ZIRmzAZ6Er166bHro1wkfpxxSm+biBuBmwG\nWMfgA4a2JktOQOzQAN4jnpPk/EDUSq8uQNC2bzId379DwLMSgoJje6M92Clv\n8BriJ9s0UTpdEFX3/HcGweC0Aj+iSoftdVHREtc7odbIFL39f8dgboYgFNwh\nM9Elax9w/nQP+VxnPcZ8fMVLEkDP6Gjfl1gQ/TQMVLgFzu96Z66ZeQUOFqCz\nWeJ0bZzKzvBCcgrH0ssOMC1WPw/rmPLH8qjw/+wPcJ627lO668il9RtoJAY8\nBna4\r\n=ZdTB\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"4bace63831a45c0c9e6f786768b2aad0d79087f1","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.0","dependencies":{"tslib":"^2.1.0","@material/dom":"11.0.0-canary.76da7876c.0","@material/rtl":"11.0.0-canary.76da7876c.0","@material/base":"11.0.0-canary.76da7876c.0","@material/theme":"11.0.0-canary.76da7876c.0","@material/ripple":"11.0.0-canary.76da7876c.0","@material/animation":"11.0.0-canary.76da7876c.0","@material/elevation":"11.0.0-canary.76da7876c.0","@material/typography":"11.0.0-canary.76da7876c.0","@material/feature-targeting":"11.0.0-canary.76da7876c.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_11.0.0-canary.76da7876c.0_1617759893601_0.8325306678646434","host":"s3://npm-registry-packages"}},"11.0.0-canary.6bcb6cbd2.0":{"name":"@material/slider","version":"11.0.0-canary.6bcb6cbd2.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@11.0.0-canary.6bcb6cbd2.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"e55c698905f8034bbd4c0d9684c48efb6f30379e","tarball":"https://registry.npmjs.org/@material/slider/-/slider-11.0.0-canary.6bcb6cbd2.0.tgz","fileCount":38,"integrity":"sha512-TnnEM5Ux1m24GSsMp1a3UAaUOZruZeyezu/fVzzZF3bscCvwitrscON7vZenWETIkigbPWBQpSQGoELEHFLalA==","signatures":[{"sig":"MEUCIE7jfXli24PDIr0GXR0xvUXF/xmhtWgCMijKjMjva+OjAiEAg7ZBqKsGqcJ6lJn5m5Kv8N4u2gN9g5F4Lsbq8kbehDo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":824968,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgbf/JCRA9TVsSAnZWagAAU9kP/RVhhOHzhSI2yr7KAZle\n/7doFVDophsvHcixpSYW2AkzI0X+SWA2WHwDlEsi6u4j39oQV8ScHFHKljPo\n37c66xg16OLpk6fk1KCTzVS6X+E6chhYpGdMd9SQZ5b2sCe4cIUmFdzxJ0Mj\ntLzchM/5KAkLkCllc+DXQ+A7l2f57f0NxeclAUJmqPowcQWpBolVJQVKrMIm\n+pkyCwSyDu4sDkNJMhx95G5t9xLec5k6h8HHavAh8zCfB2rDe70ryjBk86+T\n3iPMlKbmPIkq9mm1WMZVx2JrOaxGOMTz/aJKF6sFBGDx2qR9ABpfc0FU5SQ6\ns1wr6gDZLQvkktR2llY6EKxmKbABGm40n5DdPu67oSeBaMinM0ERZXmRv9BS\ngRsqubq6P9/ofXV1lkNIkaTl21LUpiiE3VFC3MlIN7KwZmdET2pJcXbdJMdk\nKZ+Ey/qiEiEVJsBJb3KClp6GQS07iwlay/oipFQczvf1B/vE3yMwUbUIPyRU\nyQV59/EXpM0QOG+VeLbS5+y2OxJ6zDnQr9psoYmjwamo80pQdGLQPEO1RBuv\nMuW12MEEzBirsREQifADNtQUyAVGWgrT7SrJveDGw2EechUSb+LA6T1AirwG\nkDtVjWSYinvItx6YerIMZDJACMN0uIIvu2kJvoFjENBHNlK0qVuhQXaF/JOZ\nzs9g\r\n=k1Cr\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"f3ec57093899a7f082bd51cae05b398c31619392","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.0","dependencies":{"tslib":"^2.1.0","@material/dom":"11.0.0-canary.6bcb6cbd2.0","@material/rtl":"11.0.0-canary.6bcb6cbd2.0","@material/base":"11.0.0-canary.6bcb6cbd2.0","@material/theme":"11.0.0-canary.6bcb6cbd2.0","@material/ripple":"11.0.0-canary.6bcb6cbd2.0","@material/animation":"11.0.0-canary.6bcb6cbd2.0","@material/elevation":"11.0.0-canary.6bcb6cbd2.0","@material/typography":"11.0.0-canary.6bcb6cbd2.0","@material/feature-targeting":"11.0.0-canary.6bcb6cbd2.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_11.0.0-canary.6bcb6cbd2.0_1617821641255_0.8384145479927516","host":"s3://npm-registry-packages"}},"11.0.0-canary.c91e8d141.0":{"name":"@material/slider","version":"11.0.0-canary.c91e8d141.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@11.0.0-canary.c91e8d141.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"8ba886abeeb0e983f23bc01dd8db3d0a424bc5cc","tarball":"https://registry.npmjs.org/@material/slider/-/slider-11.0.0-canary.c91e8d141.0.tgz","fileCount":38,"integrity":"sha512-aWU2TwMEzS4Nwfa4j+aMd/CyQv0xmMdjIot73He5z9cBDVRICYg3JRJDOjuU+AS6mZQEbYPlc5L2t18mT7jlAA==","signatures":[{"sig":"MEYCIQDCPtmY7MYFgJ/1P4AbCNUUFwBMoVLdyjLimMpx0OCBEwIhAOds5pL8Ce7C/o9gL5iYYpLrRRg0J20G0PvZQiXy1xob","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":824968,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgbgC1CRA9TVsSAnZWagAAvx8P/0XSvg3ZjlDgHgsPe9z1\ns6fwtWrXipMwe6cGaPyUBJ/3rSxph961OESsisD/a6wm9OXDBFcP2JEWR2aS\nQ0E7/7kFdFNDGb0ci4oUx9TFdanKsjlb/i2mQ8mI/8BkCeum/SYvmG6v4Yaq\nQT+r4xsnDffLpMTyvsOMY/zqBHTjCj6CGAKnA2EVKYTr5pDlEamda++6Pm3i\nmD8D3a0RW3gyatObwSCBTjkzKvt3dCH9ZfJcAarSvIyRw33z2WpCWPsTSBNk\nBEzKPsHI8xFW57WESxbGTQ2dmcsTvFxzryeu3ZzwjZ+SLfw98qeSzFyqUVNk\nWfKe4/XGM8uRUAcRiQngAv5WL7htHHuj0zF8hENMx3pP86jBVWjSYLj8feeF\nyrMUldL/XazB5lrwq/pqVvgPIHYKzgOXn8Eif4ajSO4pNEeN9VeIon8RUz1B\nHU9ewJnowDawO0MYTpkRBWlypoerckmW88zouL2mISLyQ2Djhs7gT/jFPpym\nPL849/GPa85IBGcf6kKW4uIw9Muru3iq9eLk8OTFusOv022XpVyrUZG01+Pz\nYbCyZUNsOWGRH4G6P6pdf7WMSFIaAg1aptUdwAiXjWLOwYpCapmeSk1CT3LT\nynEEx2Uf63ueSXKcOdv2RbAFUOKFHz8HEkPcB72xA/KyzJdZXVDaRF0vSDfp\ntEEE\r\n=K0P+\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"b13009a2b12843e6eefaa0c3ae66fc519af7bb29","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.0","dependencies":{"tslib":"^2.1.0","@material/dom":"11.0.0-canary.c91e8d141.0","@material/rtl":"11.0.0-canary.c91e8d141.0","@material/base":"11.0.0-canary.c91e8d141.0","@material/theme":"11.0.0-canary.c91e8d141.0","@material/ripple":"11.0.0-canary.c91e8d141.0","@material/animation":"11.0.0-canary.c91e8d141.0","@material/elevation":"11.0.0-canary.c91e8d141.0","@material/typography":"11.0.0-canary.c91e8d141.0","@material/feature-targeting":"11.0.0-canary.c91e8d141.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_11.0.0-canary.c91e8d141.0_1617821877169_0.7657021140895239","host":"s3://npm-registry-packages"}},"11.0.0-canary.f77c50860.0":{"name":"@material/slider","version":"11.0.0-canary.f77c50860.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@11.0.0-canary.f77c50860.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"74c9fde7ddce6590e1161063868f67500a98432f","tarball":"https://registry.npmjs.org/@material/slider/-/slider-11.0.0-canary.f77c50860.0.tgz","fileCount":38,"integrity":"sha512-mJfDuC5PtaWBFCUtsBb7N3RWJA0CjYffLrEx/Kz27zFH7RZ2PQT5fWsIjejZuChgrcqK8au4Q5OSGbEGZi45Kg==","signatures":[{"sig":"MEUCIGx54XRnajCZ8K5S7WWo3jtSzfGvyQ1yDPFloUQP/ypjAiEA+QPjnm+V4fR5BI6ErXE+x2gWhuw8E+kpaVWsqhkqWtE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":824968,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgbyLkCRA9TVsSAnZWagAAUv0P/1ku12Je3Mt/HWWJrMdI\nRKGymMKfb9/swRRu46cfaCV6hx0/QeLlYQ1EE89vNQzaDFiBeJtU4TeQwcFm\nFwnSaSsM+3pbkmunQ+JDB+QO/t5Fe8dcgboqT2QwWgkZE5pzHcMVnuK1a8WX\nu9kr+TUWTVcg+71hZ3G3KKaIOQ+oD2W4T5zWhzEUFMw7juj9AQ6wAHxkNMeO\njVKU4qMd14pDAyxxuFz2KQ8CmHBsTle9n9MlKDIe6v976kzwCVMCUfT+8XSm\n4FYs+oTyhyGYFbb5ClJOqLGSMBlQ2pAWgK/pZzUihA2npHLeujl2gfmTCE1E\nona50G+yrrftVR9upEiVuChD8liHq/M2vq/MAI5KNWLCFaC9r0Njde8D77Vh\nFKlzUDkd0pSgRLIWNsFAvOIt3zoyEpg/mjlV/n5YneluaUVS8dqqVkgiCZZS\nxCCugn6fANXGi+JtgTnluDPrnsZRmDi3kAX6Mdl1/69LO4M/bfn1NttPQfkH\nKHXC3jYEw8sD97QGEzVkzAjqreqHueP5estWvxWYjJTY9B/LR4wWCA3BbjwJ\nZ24BxB7iWbEE9fP1TuOuBRuEZ2VGVqesr7F8vMQNvgKKB8HcYFI4uisz+rF0\no+TWfM9/HYGBnu1lu/NjWhZ9jRG67uvN6L3AwPTBwFp8za2QxYxv1E+5dAEc\nFxSy\r\n=Q6Qu\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"d35db9665d4a8a4f385b134c9c1a23bda8668fa2","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.0","dependencies":{"tslib":"^2.1.0","@material/dom":"11.0.0-canary.f77c50860.0","@material/rtl":"11.0.0-canary.f77c50860.0","@material/base":"11.0.0-canary.f77c50860.0","@material/theme":"11.0.0-canary.f77c50860.0","@material/ripple":"11.0.0-canary.f77c50860.0","@material/animation":"11.0.0-canary.f77c50860.0","@material/elevation":"11.0.0-canary.f77c50860.0","@material/typography":"11.0.0-canary.f77c50860.0","@material/feature-targeting":"11.0.0-canary.f77c50860.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_11.0.0-canary.f77c50860.0_1617896163477_0.17774170683493118","host":"s3://npm-registry-packages"}},"11.0.0-canary.367d88bdb.0":{"name":"@material/slider","version":"11.0.0-canary.367d88bdb.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@11.0.0-canary.367d88bdb.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"1995d6d413ad8436822fb87c7da171b31bad716c","tarball":"https://registry.npmjs.org/@material/slider/-/slider-11.0.0-canary.367d88bdb.0.tgz","fileCount":38,"integrity":"sha512-caS4OQ4WWZytD6PZTqgMD8OCb9LdCEvYpq6GAjrYyibe3vGvWsPMgjmvM+w3b8XuiH+fkTn6p6/bxT01cABYhA==","signatures":[{"sig":"MEQCIDA47ClwABKY3VoV0fY0U3MnR9UwRHMKAV/CVLaG9YVQAiBqq/JXo9C8emTKLJnXsxo4H9iQO1DqiP8l/SB9yJQpfA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":824968,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgbzGdCRA9TVsSAnZWagAAmyAP/RNyiTTOK1G3N1WXyvK0\nupepGsO3YZvp3946+iQDk1w+8GQD8p0O0uJIMFUJo032xfmDcM5okVfxpES7\n+qUxSn0MQSWl/tcXmS21yAOI1qZNhMUhadCJFwSVStLM8w2SIILidbOkEYbU\n2ZA/GqgyimUb2oSgxPR8f6oldORCUfTw3fGK08a1G8PdWSEZSPkTbkeJc4rM\n2eePa1Dam+N7yU9x/TOaEE4/WFiEmES5nwUKs+HMAlH+RWuPIBBWHohuFfJu\nZTkFHbPLj7cntOX9Ph95qPYqdv/6q+17Ue9U7KxMhC7rJUBrPvQNEdkQsene\nAcyikXKf2gKrTSUf4yCdrUk6ieiuYn+RtkgujUn1d4e3bV3cD1AB56BkYOTO\n8k2z98ILBbO4aAuYphWI0uc0zwpc5rUEhRkFpFlO/uEaw5FdYhK5QwEipJtL\nwXcMJibEcPR8aRIja8jmAuBXwBNEKra6v2oiOuoCxrHbmCiecZrgbaEtf/ML\nO4jGBzIjepNVBX+DH+J6iGbbCWSrv1uRCZ9oftHtU0Mg8iVDAGOGv+gwUngl\ncfdPOnSNwvySV1LRn2UWRMfzZXPHnD/StcgpL+FqmNjV7g41wH2hvqplr+so\nGW7kgFO6upDhHCULOSyZghPXCW76fl9dKm2XkJl0GeWvnlpobFeeR1Hkckf5\ngi9+\r\n=0KUo\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"ba9cee87fe351c7e76ccb32f2572bf3ca91e88d7","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.0","dependencies":{"tslib":"^2.1.0","@material/dom":"11.0.0-canary.367d88bdb.0","@material/rtl":"11.0.0-canary.367d88bdb.0","@material/base":"11.0.0-canary.367d88bdb.0","@material/theme":"11.0.0-canary.367d88bdb.0","@material/ripple":"11.0.0-canary.367d88bdb.0","@material/animation":"11.0.0-canary.367d88bdb.0","@material/elevation":"11.0.0-canary.367d88bdb.0","@material/typography":"11.0.0-canary.367d88bdb.0","@material/feature-targeting":"11.0.0-canary.367d88bdb.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_11.0.0-canary.367d88bdb.0_1617899932593_0.8933544307431154","host":"s3://npm-registry-packages"}},"11.0.0-canary.0ec437d3b.0":{"name":"@material/slider","version":"11.0.0-canary.0ec437d3b.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@11.0.0-canary.0ec437d3b.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"ffc93f611b74ebd75c8c01abaa6892c2ee887401","tarball":"https://registry.npmjs.org/@material/slider/-/slider-11.0.0-canary.0ec437d3b.0.tgz","fileCount":38,"integrity":"sha512-/AAeX0uYErosulSY8ukg3gWFb/eZaUsDFpEw0Baye633EOs2TLIAx/k5wbVjPekalsGM25MiFdx+8ZAbFyAZ1g==","signatures":[{"sig":"MEYCIQDVxIEPXXAFW0lWkSo+oXdKAF0+ygm7AobA6Xvp6OF50gIhAJHnPUSgGQ+ylQFhEn7glfRSLANbrZDrVbEQe/jq885n","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":824968,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgb1sGCRA9TVsSAnZWagAANbgQAI1Zu0wHgY6i5elzjsa6\n3Nqmhrumt070iOxMFkkOZCcK2W9M5stGwAOKqZxGpZ0FAi9oacnmG2e1e5ab\n/Ty0d3ZmPTgD01Wo/9y8gUl5M35OpboOMcpIPdUI549vB4lc4aV3DGMxLn7+\nBXHNomUaAms9ZPnWQGL8BChJOYOxs0gJjH7+ZE4vVeYcGjtxv7limlqSbKUq\nWbST3iVcrh4dwLIcQhbbH2qPZyIZRTrs3FzQcLijyHbgpyYwPIOTLwUNbToN\nVVLfDxF9BRQZz62oRqQwPimhyM9iOXV4Gf1+oWSnsrUHXZW43f3L5PI01WoV\ncpfCAtE6n6RU20btNQD02Yj6dceH1jcozGZ0CMqXprhkyf83G4SQli3Gqm6n\nSWwsCCtPmwKmKBz1Ua53505BY9r2WiUyWXOm85s6oYTXFWJGnGLrc++EIUfA\n3s2+MKri1DEFygokSmJPVCs+9f04BMjhkbdumclVyU3yO7shN1l+F13XA4Ga\nrOIF9MKuJCMW0kcBvN7rBiVmfX3L1iPUAsWVa67d3lGMpbdv49GBEGGWaU56\nAG4aW1ldImfUNFN4inilqt8pkvxkHFN9u8X9RojmJywblP22yBovZ/6iav38\nY+iIRXFBX1c1KV7+tmFlFaZOJ5MCtNjiS6tehHHYp//u36DsnzryeoSOZOQZ\n3GNk\r\n=2ijY\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"50ed2429a570432fef9747a954d7c31d2dd11f0a","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.0","dependencies":{"tslib":"^2.1.0","@material/dom":"11.0.0-canary.0ec437d3b.0","@material/rtl":"11.0.0-canary.0ec437d3b.0","@material/base":"11.0.0-canary.0ec437d3b.0","@material/theme":"11.0.0-canary.0ec437d3b.0","@material/ripple":"11.0.0-canary.0ec437d3b.0","@material/animation":"11.0.0-canary.0ec437d3b.0","@material/elevation":"11.0.0-canary.0ec437d3b.0","@material/typography":"11.0.0-canary.0ec437d3b.0","@material/feature-targeting":"11.0.0-canary.0ec437d3b.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_11.0.0-canary.0ec437d3b.0_1617910533791_0.38596432519237545","host":"s3://npm-registry-packages"}},"11.0.0-canary.b2fa996a1.0":{"name":"@material/slider","version":"11.0.0-canary.b2fa996a1.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@11.0.0-canary.b2fa996a1.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"6e8719577c14708e8ab49e26ccc94d2ec0f68923","tarball":"https://registry.npmjs.org/@material/slider/-/slider-11.0.0-canary.b2fa996a1.0.tgz","fileCount":38,"integrity":"sha512-mvz1XGO5ya85RoqVc3a/JTKKC8q2ynNK4/d509lmfcHHjaJkacFl1NomefqcPwJZb2dt8lU0e+EvDJra9l5tOQ==","signatures":[{"sig":"MEUCIBTFOlug/2OAwWUR+T7N4FsoAGF7QC1HVg+VVwAC0cCIAiEAkl/brGfHGKpU4T9NZMkC3Jgefq715FKnySKNPhbudmo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":824968,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgcG6XCRA9TVsSAnZWagAAWqgP/RftSpTVyufrR45uS7bj\nyrY0NDR1bLEnV4nvAzQ4AJ1Aw/P1NSWEFwsc6pV+7MN5EKJwg5GmOlZ+COhR\nR+SbUkNa8ILkmIw1s0mGFRJL3WgaBbH9tKat+NaGIZent9xPrdDlNrZ3O7qU\nJKKGPy2lfrW5KxnKcWuYBhRhgFxz7fk9y7g0lPxlLKSyKtvQwov2uf+zBWFp\nhfurt5yIByAQBu2DRMpbsFCuNtYmplPZOI0Cvd25ir4aaP4tIwi6BXvnX87b\nnnp55p0cykgrVxDzXcTHmuSJYzjsgKMbXIa+tKhwS2NBC+VRZp9cPvhtXNt6\nMIk0PpnFt3aAIHIp7LIbUwqbY7UJPjUBp8B4MuxsIe/hIRvUgqhsq4i2IAZ4\nov4ipf0ee3Tzp40qEDLbWFbswvVO/Ig35lIGemcwz+YM6D25Zv2NQS3LTA7f\nPOoT+ImVh9DdVyjmpf0UEhkWDyqWhKmpa3B7Eb60wDkU13GYhPfuWpm3vGga\n2Of2VOkP7+71WbNfUTIpko37lkKfNaIgOH3L/AX6dHG+3yRj3eJRV0ETddlO\ngbVwN5feQT15KV0nQ6g/nq5Qu9V+0IPtiET/v1J1ntbMXHTybcey73NlXQDN\n/vQlOocQlV47VRJShvMXFSSPHOJ7wHYZmT5RVPlVp17D/wH7n0CjUYomM1ZO\nAO7S\r\n=mdQi\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"0b4eb5b2d30d6d9a7b20f57164a2beba3c20d65e","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.0","dependencies":{"tslib":"^2.1.0","@material/dom":"11.0.0-canary.b2fa996a1.0","@material/rtl":"11.0.0-canary.b2fa996a1.0","@material/base":"11.0.0-canary.b2fa996a1.0","@material/theme":"11.0.0-canary.b2fa996a1.0","@material/ripple":"11.0.0-canary.b2fa996a1.0","@material/animation":"11.0.0-canary.b2fa996a1.0","@material/elevation":"11.0.0-canary.b2fa996a1.0","@material/typography":"11.0.0-canary.b2fa996a1.0","@material/feature-targeting":"11.0.0-canary.b2fa996a1.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_11.0.0-canary.b2fa996a1.0_1617981079108_0.6222632661900391","host":"s3://npm-registry-packages"}},"11.0.0-canary.24255c408.0":{"name":"@material/slider","version":"11.0.0-canary.24255c408.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@11.0.0-canary.24255c408.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"09e33ab75928743c2445140dd72344bbeecfc1a5","tarball":"https://registry.npmjs.org/@material/slider/-/slider-11.0.0-canary.24255c408.0.tgz","fileCount":38,"integrity":"sha512-JW45k9EFGyt4oj09LdveghlAOXFv4lyHOGqH6RbHqh4tNPkSbFN0wT4Lw586sx0aXgsisAzK8S+aN5BFg+RT6A==","signatures":[{"sig":"MEUCIEWXzehRCiy1zKD0VCGdgxdLr4FNnhC1TOQFrng5WSolAiEA8y+MgJrkQm0V8LOwB5E1gB/7l6SKUnK8YOfVTpfwb70=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":824968,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgcLU7CRA9TVsSAnZWagAA6fYP/AmTSmLKhpP8vddTfJfe\nu0p8wHl6w0jjn1oidWZ7HLKkflpelwGBxPY1cHyKmtM4QA1O5zV/un+0el7e\nv94PBrLuGzXX3x2ywYPRo8RYU1tR1AvzwJmxJ7me1nSpYEL/s9QuIXCLFiBC\n4xHy8c1Bx+5psbkLvxGAK+3MfHjaXAeI/7ytYrAj/eP4Qe/sVezxgObJrAap\nYR0qyf/lwXTaU5hTVcGjweNAF02Myu7iTZMkyDo3dALrnL5I4uCbwFMu0SRh\nSdmQnNh2vhqYJ2tESQreQUJDIWf61ApaVLnzWQdu5LBa7/ebp5LUL6AmjOCL\n/xyoAJwx0Omm3f9H8100Pi4pV9MCC/V/84r+0U8+pGK7nPBiYnYz64dnfXWo\nH9+Ev7YOsrlTSAeGW2xs3ijJzAfbsODCCO4cA95T7NNr5T21wy8yBdcpF5Pg\njirazDIK85DnzQnQHNb60fIYE0VEVGaKD8MFw56a2lcnDyPeXs2Yx/y6H7lA\nowJxeAVBrha9OPR7veyY8q+C+YeKBGHfNFrS86hOJTTVgR/u4PTQNJxa+LLh\nt369NiqD26+Zp8WsYLlN/dxskAgP2bB7/s8XDNvWaWJWq/O8T+b/d+Cbs4FJ\nic89eKI9LtYdMZ6OA7nNV38uQ8v+WOkeJAHeMxTei6jaFHWd6rzS9Avs9iUp\nn5m+\r\n=/kKY\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"5cc224c5482fd736af03872db458f031901bb693","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.0","dependencies":{"tslib":"^2.1.0","@material/dom":"11.0.0-canary.24255c408.0","@material/rtl":"11.0.0-canary.24255c408.0","@material/base":"11.0.0-canary.24255c408.0","@material/theme":"11.0.0-canary.24255c408.0","@material/ripple":"11.0.0-canary.24255c408.0","@material/animation":"11.0.0-canary.24255c408.0","@material/elevation":"11.0.0-canary.24255c408.0","@material/typography":"11.0.0-canary.24255c408.0","@material/feature-targeting":"11.0.0-canary.24255c408.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_11.0.0-canary.24255c408.0_1617999160725_0.9474632456542886","host":"s3://npm-registry-packages"}},"11.0.0-canary.7d6a4bb72.0":{"name":"@material/slider","version":"11.0.0-canary.7d6a4bb72.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@11.0.0-canary.7d6a4bb72.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"eee08b8b9b74769fedff38ac858aa4bc9484868a","tarball":"https://registry.npmjs.org/@material/slider/-/slider-11.0.0-canary.7d6a4bb72.0.tgz","fileCount":38,"integrity":"sha512-Jg8ICRmJrKu0O8tV/1D/y4Kxo7ikITrgD6KvgDFx7cI1TottlbfWalwNaCvRhMKAwuxnuIROh0l6Kh/T/LkaPw==","signatures":[{"sig":"MEUCICPeELoiGiXWXzXdXhj22eGSuZ035yOQmxjBeV02qHwcAiEAwAgaVxLOl3Qnc/k9CIo7iyexfkAhXLQ5sGOCSEbgetg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":834801,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgcNr7CRA9TVsSAnZWagAA1D8P/jsSiV/jirUpu5GsRFTU\nZSg8QKWVP1TM54Sw2pIYvVcM9A3o93VFCzl9rsOa9t8uicxCkiCqo+scjXkT\nUOvI3kVx0DG0reLjivf9LxwVXr2Jyb7hXi8FK2Tlz3pfEihBvl8BfrbNmSNz\nj+tyikDHFmJlDHcmp1g68MkBa62X34A+U7Wv2tUdHBPdhH+mav9gcy0hD7Nn\nVFWt2sKw386KsfCCM/Sw8cA5BUj2Mz+K5ZTX5tfmicrM7uuKmY571ilA0/tv\nHI7Pl4zCClCo0H/OLDleynQr1sfioQ2ldk9rNvECUWvQo3OOPqwzCe8uG2Mo\nu+UT9C37AjiYl1Qhxx75ZunWZylBun5Nck+SzkX6fHfZ/dst4yEUt5oEKTgY\nB6+CQdX2wsZgG3SHz6JXt/MzJ1JVZWUkeBRF86dPTfHB/eJYOFUlUoSAFna7\nLXyfLVJ6BbCvU5E5NzcvL80d7PVrXmKVuhwZYkcaddWVohfqEEm/S7iQRYPU\nLspWyjyLBXeJ62X/CA44pwo5woy5xasx/QTisGkRbrG0XuhYr6d3xhIpTgtT\n0M05cu29xaS4TzLvulS4M13oTdWa3coauH6qxZOKP9Dqtk/6bBsERI8JrIbu\n7lllwjq8Rbw/piS7QG6Jgn87611GiudRI5xzjlN3bqVeJh3EUahlX1/fpWu4\ng7MG\r\n=RXjf\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"1e1f0ea898fe101863062b7a760600cfb1b095e5","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.0","dependencies":{"tslib":"^2.1.0","@material/dom":"11.0.0-canary.7d6a4bb72.0","@material/rtl":"11.0.0-canary.7d6a4bb72.0","@material/base":"11.0.0-canary.7d6a4bb72.0","@material/theme":"11.0.0-canary.7d6a4bb72.0","@material/ripple":"11.0.0-canary.7d6a4bb72.0","@material/animation":"11.0.0-canary.7d6a4bb72.0","@material/elevation":"11.0.0-canary.7d6a4bb72.0","@material/typography":"11.0.0-canary.7d6a4bb72.0","@material/feature-targeting":"11.0.0-canary.7d6a4bb72.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_11.0.0-canary.7d6a4bb72.0_1618008826880_0.03630316122257571","host":"s3://npm-registry-packages"}},"11.0.0-canary.352b295c1.0":{"name":"@material/slider","version":"11.0.0-canary.352b295c1.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@11.0.0-canary.352b295c1.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"6104bdd354169fe64a22f21baac9f10cc045563e","tarball":"https://registry.npmjs.org/@material/slider/-/slider-11.0.0-canary.352b295c1.0.tgz","fileCount":38,"integrity":"sha512-yr9M0lF0hj2Yj9v2Q1T5SJfn3czyWZZBFQ+cRbvgGhm3HLc5s90xYOVwb66C/UAiRZvE6EzjFm31N9rk6mE0Aw==","signatures":[{"sig":"MEQCIH2wG3I04hNmYf0k8xRl3lGHp9ouXG51tyoy8ytDfkvQAiAgsDDBPSe5aj/CKa00fHQxvBB6Bo07hKFy6TFYTwH6Jg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":834801,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgdI5SCRA9TVsSAnZWagAAnrIP/00iI1ENJynLDvt9tdY6\nbK1+SCsMmzx44f16UsGkZFvSnlBzTEKvRYhCHSi5ITX/npBJLTg1DDesexZy\nzRJT5rwhd0y0e0IsCfBG1GnVQd1kTTMGPNZvMRZ16dh12ReIANODSy6GkAfH\ntCQPAiFaWqPpyDDZ2v8ehD3rsv66rH70DqX//4gr9uI92iSja/4kfzYsRSl3\n07hmcf0CEMIQUBWXeszSXpXYJTvHJXGf94I5X/U9vmhALe4oboovGNbWbbSK\nOVF2q84nWwwvSkN1lX3B+0wJg4/r4YW/N8q545jfgERPQX6XdBIUY55liPUr\nmqInjcudvMwBuVcfvPIkQWvnUmaX09CwZrDcPlmlyqopZCLx1dTI4zxjb3hp\nISBw7/Ra3PQNw1n8AuVDUNj50kGvXXUvzCtLm5SW5LkHwKLVnoGIoQvYRS8A\nF4q5T5am4Fd4z3AaA8eVBuRGFS4rFVgrFPmm4Ul3Lgl+IJhmdMzfwa1mQMgx\n0cP9pHQxpPNV5OsjVXcCDILZcRvsvx/bg/tR6XrBU40ntERove8CjDX6/DcG\n2sFtNNxBxBkLOfpTOWNk5f0Fom6yGQMsAp2noZUc6P9o8CuljcMqpzIFQhDY\nqonrwUCO4KLCm93EYI2SDrycYCsRIsQdZWO6gF6dp4mk2YmRSeIx8UDm4b0v\nBZ9u\r\n=8LXW\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"472a00ecb08e85ff1b602e3bec15d38f2a028f69","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.0","dependencies":{"tslib":"^2.1.0","@material/dom":"11.0.0-canary.352b295c1.0","@material/rtl":"11.0.0-canary.352b295c1.0","@material/base":"11.0.0-canary.352b295c1.0","@material/theme":"11.0.0-canary.352b295c1.0","@material/ripple":"11.0.0-canary.352b295c1.0","@material/animation":"11.0.0-canary.352b295c1.0","@material/elevation":"11.0.0-canary.352b295c1.0","@material/typography":"11.0.0-canary.352b295c1.0","@material/feature-targeting":"11.0.0-canary.352b295c1.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_11.0.0-canary.352b295c1.0_1618251345582_0.7944064904747128","host":"s3://npm-registry-packages"}},"11.0.0-canary.ab99b8064.0":{"name":"@material/slider","version":"11.0.0-canary.ab99b8064.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@11.0.0-canary.ab99b8064.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"3c1c222bf8d4359f5ef0d465392579ec78c9c222","tarball":"https://registry.npmjs.org/@material/slider/-/slider-11.0.0-canary.ab99b8064.0.tgz","fileCount":38,"integrity":"sha512-9c5c2EK/8ZwszmXyHzVLSgeew7F76rAje5qvvIVp7jUSh1ols5joB+QNmKMSoHBZ9xp5kLLGdhRT7lUNZoln3g==","signatures":[{"sig":"MEUCIDsJKWw0YyS9LvN87BkUxDTWPkzynr8sXyKco0JyjfEUAiEAlWrUjenU6Of8jf8maB8EaOo66wJyRDdpQiSpYdeQEVs=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":833927,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgda4eCRA9TVsSAnZWagAA/QsP/A6o29HVA67UUY1IH/TO\nUj39vmXWL0V9hNB8dYXnlzLpEUoBYAaF0yxdx3FuvkwBL+QnkJQtURrYzah2\nqTuM1xCbw2oxv6srDek9wntou+ZXWpNk/0reWqAe67w+b628hmMsb+Z+tDkq\nHt7XrsJ97YaOi0Ubiu5PS+IXQHijcc+jhjuu51uCSVhKGRULw7s8xN9YQnxd\nQNAYxPaonY/EkbAYel+VSuQgK1mB6zQPaHiqSU9ySXibaphorp6LihfSrq3I\nz8QCpBYCyjsxHas3wOEdUbItRlGg7SwF3BJy8d2/IeFXvGsfonj24AHWttHG\nIXZ9rAn6yzcwEhTZf2VHqHfTmNjgLkThHXF2RqE/QRPNvqvdDJQ36Ql/fWPc\nJE5B5OHbZn+BPmaBItYCOgm86OUJ7fKK3D1VFzrW6+9na4aYyG/SRko/Y/I0\nHjRkTsDd6O2xDaSwGjg43ezJuUomg82TGxBaUGLhemSHqSAGH9jwMOAX8mTE\n0gzWkx/36Hn42fEuzyIXdlxi/uOyL4fch0k0tG85yle97uX7ZGAmx9tmtL52\n/T+h9yjBq+UIX41L8KMWLDX6Vg+ov/W0BUK13gz9Wo48iYMn85MCZJ6Klf53\niiMAwyviZxtAcmiK4+AtbaDrbjM+SvzZKxwJdA47XvGtZtnPH+mCUpqmSgrI\nwI39\r\n=CF/X\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"7a67c09690e367ad8ebdba2d551f6432c20ccccd","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.0","dependencies":{"tslib":"^2.1.0","@material/dom":"11.0.0-canary.ab99b8064.0","@material/rtl":"11.0.0-canary.ab99b8064.0","@material/base":"11.0.0-canary.ab99b8064.0","@material/theme":"11.0.0-canary.ab99b8064.0","@material/ripple":"11.0.0-canary.ab99b8064.0","@material/animation":"11.0.0-canary.ab99b8064.0","@material/elevation":"11.0.0-canary.ab99b8064.0","@material/typography":"11.0.0-canary.ab99b8064.0","@material/feature-targeting":"11.0.0-canary.ab99b8064.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_11.0.0-canary.ab99b8064.0_1618325021617_0.5842311821376307","host":"s3://npm-registry-packages"}},"11.0.0-canary.8f0a11e32.0":{"name":"@material/slider","version":"11.0.0-canary.8f0a11e32.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@11.0.0-canary.8f0a11e32.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"69f57c0680358caff5ad28c3c63a1f4d59c28c47","tarball":"https://registry.npmjs.org/@material/slider/-/slider-11.0.0-canary.8f0a11e32.0.tgz","fileCount":38,"integrity":"sha512-zUUr310N++rsNxXQJ0WT+/FNV7ZGeWd8eG3fpYLq7PBhF79Hc8P6ZO5Peq5O3MivGSoUqTM4LASr+iPAXUGSZw==","signatures":[{"sig":"MEUCIQDkvVBvPbxNs7fyc/7IDm4YUrKvE3UMV4gforjMwdp8kQIgUpNU/NdQ8+qhZMAh6+xQ6onnJf9byuqjH1kBHmADoqs=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":834035,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgd0qCCRA9TVsSAnZWagAAVV4P/1yaJET02IkW0aaR6SDh\nKecttBGvAN/hYwzeaJiqD9UXSDYfWCyti93wC8LXDrPUwUcErewO2LTzFBx/\n3K8zSxljtbW5NkAsfouFx3F1JzfMao9nl6E/yyivj/GfRr7dA5lPLSdvKbAN\nkCZoFR9C1XkV6qhhqcv+P1qUcSMXxEwtJQ/PvkovXuHZPqXWCdG3AYU38ut4\niGsvDWTMyccn6E5dLNxv2U8ZIrSjpGrVSRHZttgCY0hnsLDuQ634KhDpRT0r\nwmbQXzRVq0VPZzvF/fkGErdsQbfhr0k0LhmhinDBxeJSLiTfxDbDONb4gKkb\nIF7jAcrX/nyDtpxHexKHcXNof5N5igvfzkM/QvATsvfo0xw1NSIvxf8X11gT\n47ijCyx6eQvTD1F2YmehR9jF+07fLzNPwDVpIOFL8j9p2yll38anqn6i1sF+\nv2wovXnIBJLds18+2Qndb484xkK/mZIRz73w1c08Ybs/RjVQ0xllq2iuDEVv\nHW56bk7lT/SFaVfnnBv5ZC3Gi8kTFkAma9TCzBnJEYxUpq+Stfy4Q1/AI0b3\nIs8fIfWIyU0xqeKJGRz3QhH/yNwmKa4L/M4KQNbQWyESPHO6tIZTM+S6vQYl\nUJzJVFo5rpmz350DSVYN78a5+dtMFzARkbevGHfzEUVZbyNp89O26ZirqFy/\nw3HF\r\n=7K0z\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"f09b2c0c350e2f684e84766c95eed5c92b5afb0f","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.0","dependencies":{"tslib":"^2.1.0","@material/dom":"11.0.0-canary.8f0a11e32.0","@material/rtl":"11.0.0-canary.8f0a11e32.0","@material/base":"11.0.0-canary.8f0a11e32.0","@material/theme":"11.0.0-canary.8f0a11e32.0","@material/ripple":"11.0.0-canary.8f0a11e32.0","@material/animation":"11.0.0-canary.8f0a11e32.0","@material/elevation":"11.0.0-canary.8f0a11e32.0","@material/typography":"11.0.0-canary.8f0a11e32.0","@material/feature-targeting":"11.0.0-canary.8f0a11e32.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_11.0.0-canary.8f0a11e32.0_1618430594430_0.09194587497045292","host":"s3://npm-registry-packages"}},"11.0.0-canary.f5c6db8fc.0":{"name":"@material/slider","version":"11.0.0-canary.f5c6db8fc.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@11.0.0-canary.f5c6db8fc.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"fdfb9536dc7ef789e09334980bb8ac0cd95a0fce","tarball":"https://registry.npmjs.org/@material/slider/-/slider-11.0.0-canary.f5c6db8fc.0.tgz","fileCount":38,"integrity":"sha512-cdl+SjcdJX55C2zOS1eWWz9BkoSpQCbZs/T7A5ATluU6eyyglaXbaIFv1CVMuW/7O99ZjXoB5NMceheczvvGuQ==","signatures":[{"sig":"MEUCIFbNb7FEsftoL4/PThCW6le1ykGhyFm8IB9uJe9QUmhhAiEApKGaCATOwWjvr6PiYG+lIkLPAugkNSfbcXtnYeo+3a0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":834035,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgeIAlCRA9TVsSAnZWagAAoHMP/iPAngyd36NFszTaw3/3\nEpV5eHPpqqBmEFAS1WCJRMNLXQ5ZOCDMwceMcQLFcfqHcU8Z6ovjdxbMVwFY\noov9V4rZdcdm66NI/QM/D7RJnPu6XBbkNHDaZkugRXnMGXczVpgvHWnhEfPE\nd0p8vcQmRQhxkZW8e+z+FOElVu7neB6ElN36//M4Vz0yNuWg/ptv1B/D8Ftp\n4raAlL7w7lYq1bygGG9jqBL0M/Vd4AZeGxRhai/Ed3JvdFqGz1kCOJa08ty7\nOiRrLHVMoDvsUTLtCs276KOoYhxnvL4/XufZALkvYTKHnAc8NaPvNFZT5SgV\nS8KEFFn/HsNNZXLWXjhXbomDweZPvaEM40W15hCH5MkJL6qMSgHfUxDfseSs\n0SSF1riUwQ9hVRm1bzw2nxB5SHs0bBkPW5+aLFwGBL8o6yI8a3M+l9Lj+lUS\npRvmvuhMJrUeKehgvgQg3eKlHfEr/VUv75kta7IzGtiuk5oPXIV4psgTDttG\n77sYfeF98QpnHkbnNOTDUBJOHx9t4MR39kUaZ1xcO/fqcV4bRUKsItL27BnV\nbxYvyMgWY3kdhITS4MihH9Xs/MidQlQLLtNocPXUn0mCz3sAp4Vah+8/+Hyk\nruLTdycfG0sL8geJ9Dp8EJkZSdFSinMYuPTsjr9EXTWRWMFkxLmn6jljuLXE\nCqT3\r\n=LvNW\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"eddcbd64f4309f4bf5faecb13428405a28774f15","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"11.0.0-canary.f5c6db8fc.0","@material/rtl":"11.0.0-canary.f5c6db8fc.0","@material/base":"11.0.0-canary.f5c6db8fc.0","@material/theme":"11.0.0-canary.f5c6db8fc.0","@material/ripple":"11.0.0-canary.f5c6db8fc.0","@material/animation":"11.0.0-canary.f5c6db8fc.0","@material/elevation":"11.0.0-canary.f5c6db8fc.0","@material/typography":"11.0.0-canary.f5c6db8fc.0","@material/feature-targeting":"11.0.0-canary.f5c6db8fc.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_11.0.0-canary.f5c6db8fc.0_1618509860625_0.338298398830295","host":"s3://npm-registry-packages"}},"11.0.0-canary.3793a3143.0":{"name":"@material/slider","version":"11.0.0-canary.3793a3143.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@11.0.0-canary.3793a3143.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"48d15f8597a0a4d3a3efbecfe41833ca9f11bebb","tarball":"https://registry.npmjs.org/@material/slider/-/slider-11.0.0-canary.3793a3143.0.tgz","fileCount":38,"integrity":"sha512-Ji8/pyfanKc1BE1bfub817dooA5nNWOnIzkRSf/g3KdCjpOY9bVWWhmkpWFZtQLwKlITqqcrtLAkh7veX8dmJQ==","signatures":[{"sig":"MEYCIQC8KodJ3Lc01cbTAtdclsHbgBYzrxr+P1FhrnW+tK3gOgIhAJSkmVm2/JqDCCnwNOxdg9vCO65+tGd4OZUQYWi163sS","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":834035,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgeIaHCRA9TVsSAnZWagAADqMQAI+D+TiyauuQWx+gMxHA\nlQy6P6qvf71Q+wZt2vswN93rWjqwhUdnHjR+lG7JXIr7KmwsgZUhEkdE1g2S\nm3DnJVY850RRbVPi+B1+ZQJUBPBxOLUAdy9cZFD2YnUrGvfln/y8+bPaDhu4\nElL2mpFYQhPpIuXbmFM5D7ChayanMD3SNJpFBQvUnlvgvyTt29m03Cb5iZ6y\nceMcDs3GAbAula9f8haX5fwwNk13InPOiuEMG74GJWZ9FLsqIZg10tpbT+98\nBQh3885BjERj5zhmxxzfiILta9L1o4TzgHI5t1b/eiTR5gsnsUilYG4Xx6tE\nEl1tepFbuNbnGyweQ4gVXYkaUJY+16Ck9fi9Aq0sfPCqHyFg9v3uGwsS76vN\nHezZOOfIOSWqrQCV/KPyQnbOAYzbb6a/sV+HKEBQzguSYV5T6Sxj59aez2BL\ntSqC9nVnT/67AIpTLYnoVmdU6Na35P0JUJaE9YC/fGQSwXDOwms05FXzU4kE\nCHtbZObGZzQMiPfFIniIEWeDbZ9K1JNJlpDPaAQz6E2gNQDsf/wnYToCJI7O\nZh2C5cnkrQ/TIGeeS6cIfH6m5yj0ieJVpwfF9S0rolzNy8qE04jmOrpHyohT\nPyV0334OQwG3XwpFR0z9tZcfr24rdPYWEeGW0/6w025RzV6cVPW11ssyTS0m\ngDeH\r\n=0vcv\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"3cfbed34975d8f2990425af21414290a96e2240b","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"11.0.0-canary.3793a3143.0","@material/rtl":"11.0.0-canary.3793a3143.0","@material/base":"11.0.0-canary.3793a3143.0","@material/theme":"11.0.0-canary.3793a3143.0","@material/ripple":"11.0.0-canary.3793a3143.0","@material/animation":"11.0.0-canary.3793a3143.0","@material/elevation":"11.0.0-canary.3793a3143.0","@material/typography":"11.0.0-canary.3793a3143.0","@material/feature-targeting":"11.0.0-canary.3793a3143.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_11.0.0-canary.3793a3143.0_1618511495014_0.5517607568888858","host":"s3://npm-registry-packages"}},"11.0.0-canary.bc104bae7.0":{"name":"@material/slider","version":"11.0.0-canary.bc104bae7.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@11.0.0-canary.bc104bae7.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"de4b9f1da86f231cb002e47860d209cfec17152f","tarball":"https://registry.npmjs.org/@material/slider/-/slider-11.0.0-canary.bc104bae7.0.tgz","fileCount":38,"integrity":"sha512-Dhl8rWZvqdxl5W5FRJwVyMDxe11FgO0wfZLBK/r744Oxv1901MADvq34ImfST5BxXhf9sVVIm6eMHLthvSNq5Q==","signatures":[{"sig":"MEYCIQCdD/Vngt+7yOS0PelR1GJc2VjuRNYFvPy75eGsuhL3zgIhAJ0ZGFfhy158hhRuA6YyEV1RSP9YPXNKjuYgyV5RcwFy","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":834035,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgeJgLCRA9TVsSAnZWagAAakwP/RQYqDc20e+Zsjl0Yx1t\nIVmhg7PJhAX/jBNDMsZ8n+wEVPMx5KI1B6L2DhC53rbRmGmcFcs96LBmqCyp\nOtIqpU2YRYvJrkpO+oAts55/iowp0sdz5PpIMPcJgM6TdmqT/PttWAgFzC+Q\nyT7/Dtz04Vfz6FdfGpXhrQXmD+2odjm4JMvQ3yJZiWNZSRYAq+fQIBFMbmQ0\nYwrFesGWy/2V++SAvYrXUlweA0ykYdvyN2HZFm1U1HPcJJwWlJo/v/ed78oJ\nfLuy6Xc9JEWPGs/svyhDCJ7kpbSa3PiZrzGT1VPykFoACET9IFqSksiFKggM\nWWJnLnYFJMKIRk7YU8DJy86ajwKCzuH/bZ/eK3u7mJaCErHNBlIYqKgOSLIC\n+WtBuuMnrGqm9V3fKfYFrfFuEJudjC1sJ8Gmp3tjBG0JOs7foeFdmVahFN8G\n8fXen7SN/EakHlLvup2u7gK5zwHdm6MYxvXgss83fuTN90xe+Ho3EpBg64FP\nkh5S6O9cFyFylp3kTKTmYRf+FtwPj64H7dhtCiFHCzf7Kbf5gJ9FwKPXYpoc\npzgBq01Na5rjIhUTIX5EzSYZmK7sisVfBXpvOx0bzxHS3k8u4LD0Prolwfeu\nwITT+Va9ZJZ6vdFh4D1LfBegPUCaDmDjsIWotKNFEHy5IGbZD7bR289ENi2F\nAuou\r\n=mt+U\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"fefd0309d7bea91a430a20913f05f501364f2ece","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"11.0.0-canary.bc104bae7.0","@material/rtl":"11.0.0-canary.bc104bae7.0","@material/base":"11.0.0-canary.bc104bae7.0","@material/theme":"11.0.0-canary.bc104bae7.0","@material/ripple":"11.0.0-canary.bc104bae7.0","@material/animation":"11.0.0-canary.bc104bae7.0","@material/elevation":"11.0.0-canary.bc104bae7.0","@material/typography":"11.0.0-canary.bc104bae7.0","@material/feature-targeting":"11.0.0-canary.bc104bae7.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_11.0.0-canary.bc104bae7.0_1618515978759_0.13629294298688","host":"s3://npm-registry-packages"}},"12.0.0-canary.3f342c3f4.0":{"name":"@material/slider","version":"12.0.0-canary.3f342c3f4.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@12.0.0-canary.3f342c3f4.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"82a66e944c70ff000acd712222de59f378d97937","tarball":"https://registry.npmjs.org/@material/slider/-/slider-12.0.0-canary.3f342c3f4.0.tgz","fileCount":38,"integrity":"sha512-eRwlYRRE1YARLkmobKwzlYDBaGyPL/Sl+79ybDPibgP8T79Ry1vP5mPVP4Fkycx6PvXRSah4Uapcs60aY4N14g==","signatures":[{"sig":"MEUCIDADxhwyoiBiuke0Yh0rC1iilj9GBsxoiz0Rsch3rXXHAiEAzhzXp7Urt4sEO/7KmDEHb4RcuCwRK57ZYgp9gt9VrCk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":834035,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgeMQkCRA9TVsSAnZWagAAyaIP/26VV/8SxWYBxeZFVnFK\nZOqODA/yTNYOq07N7e/dX89ZxtlaK4IBMcIiT8S6dw7WOkM3HRn0hpxzmAMp\n0jL/43gSiUvQRpxQ8eKPZlOfmTpeHRiBF5kT8UNftZbwtuZvGXpK9jr/senR\nZ3lwRMRH1+g6vLc+HgIqaSkk6RGRyZOoBA3HSV9p4ZOU1uIvu9pBvgG8izsg\nc+EQVmlxngTPiRnli8UICbiRI8GN6S3i4CVr/xCirkEp4aBe+0VSMFQGKw1K\n8LV6cbkn6eYaopDz9frzrrU0LvtkHmvjSiJOLyNw+FSNvrPTfkoZnvrG1mNH\nn3vBgSAVQxDaXejvJwZjHQF2Kc3W8w01g9gDYUA0p05uczM9jdr2wrue4P99\n+2QnK8k0YS91OVKsOQFnH0dQCql7GaJyY5x13Kx9TL8uYFUVqlxcu9kDCYpd\ntgaCJbgDAPYB+ywjmRi/od5hQrrtjIHYq5t/9f57Ar2kMwsWXcsZavrztK7n\neGFu9/Y67KC9/H0QXnhi194AxOX4SME/PRwGXU4i9gcy6Iq0r/flDF4Bnlyi\nlSU5kZybe6V+mbSWtFKIrk4ubWhwlczzBOI9nfGc6iZKpVyGJljYUcS8eYcN\nsq5KLKw7tTcmO6aJde8QXqDcLkBrsTGUWhVpxNv5imZ6XadNTl6tDuBCuvQm\nsZvH\r\n=goQW\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"d82c002d3f314f99c3413389c77960016a48bfa7","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.3f342c3f4.0","@material/rtl":"12.0.0-canary.3f342c3f4.0","@material/base":"12.0.0-canary.3f342c3f4.0","@material/theme":"12.0.0-canary.3f342c3f4.0","@material/ripple":"12.0.0-canary.3f342c3f4.0","@material/animation":"12.0.0-canary.3f342c3f4.0","@material/elevation":"12.0.0-canary.3f342c3f4.0","@material/typography":"12.0.0-canary.3f342c3f4.0","@material/feature-targeting":"12.0.0-canary.3f342c3f4.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_12.0.0-canary.3f342c3f4.0_1618527268438_0.6554195968074792","host":"s3://npm-registry-packages"}},"11.0.0":{"name":"@material/slider","version":"11.0.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@11.0.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"602693ac057bff307b5d5b0c3921e3e53d64ee24","tarball":"https://registry.npmjs.org/@material/slider/-/slider-11.0.0.tgz","fileCount":37,"integrity":"sha512-EJqYV4hP6nUHEO/KyhlRZo7ZN+O5kVNdN6TRU8yTQiAVk9nwvviPhVDdHGj3FvnF1y86fnGvt1zS/MFCP923cg==","signatures":[{"sig":"MEYCIQC/2PUeILJRsuSp6g7ykVzeGoziQJBrFV7kb4VUERhc2AIhAO23YXoktpJOY1iTMGacxcQ3a8XWjzOhUB7XJ1CPQjtH","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":831475,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgeMUcCRA9TVsSAnZWagAAuycP/0l3T3BlONb2l3kqDa63\nFxQprfpnIzBO3Um9f76nuafe1hPxmo/UiJcALX0kWwU6qfUW4mjqBmyhEoFf\nH7pEhpjbzalBObzLPjnrRSdnaPWvOgFlmkOFJx4pvGMH3lWIVV0/SRj3G7Zy\nClN4dTdYMQRvHarPKDen9noqR9bhZN4kCn07RXqss0mmiL4ixer49Y2e8CYq\nj+iaycS0/z77s9F2TDPJ5G7lQilaV2Y3acMyMpVWGca0ax6OdRMvTHdx1wPr\nmIlkS/vixYLM8ekBL3RlJfnpp014OjZhSi2JFRMzDls1EhqJNVR5gPMWsQWl\ni/XDakzNy0xKROyZ7vpR30vTPWgiBCONInGcS4uBxC1BRglcCjEV+iMxKq+N\nqTioGvAiNR0VgXxdRC8tsP3wyxNuwP50cUZpgdnKIPEQBdzt5UQdtHzd7GdW\nh/eRXWBmZrN0IGaBPMKlBkGdtsaOUnRDm1fyo5hZ63i6wFHfLr0XpRQndixo\nosD0wu6Iru7jIF4QcFTBTpwnxNzOIPNdLPBrmJjur7kEQ/amAPz/zdSuUJy+\n6MVZu4J7Cq6Mt0oQq8/lxvxjgHx7/0UceOPBTRqdiZIxA40V6rduPdaYleYG\nA0vMgCq2NBxjHgFVpvDD6LGeNUTDgfz0obpSYWu8SGkBFjiQwHM2p7uSobYO\nKY8z\r\n=6SZy\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","gitHead":"3f342c3f4715fd3587f327ce4ea6b5dd314c5c55","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"^11.0.0","@material/rtl":"^11.0.0","@material/base":"^11.0.0","@material/theme":"^11.0.0","@material/ripple":"^11.0.0","@material/animation":"^11.0.0","@material/elevation":"^11.0.0","@material/typography":"^11.0.0","@material/feature-targeting":"^11.0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/slider_11.0.0_1618527516244_0.06956618058590336","host":"s3://npm-registry-packages"}},"12.0.0-canary.2ebfc5374.0":{"name":"@material/slider","version":"12.0.0-canary.2ebfc5374.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@12.0.0-canary.2ebfc5374.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"2aedff11bf0e26009f9d1eb9cb93982f5e0620cd","tarball":"https://registry.npmjs.org/@material/slider/-/slider-12.0.0-canary.2ebfc5374.0.tgz","fileCount":38,"integrity":"sha512-wJO8LOTYbrIuPHVVcyYwbARQT6bf16uvbXbw47jIqnmK3XdCt0xSOH/sa2xAkpI2EESexHNdaF9uTnPn/lVfhw==","signatures":[{"sig":"MEYCIQDin1tg+l8lfJDh93MXu38w27TbTzBRP/FUkJ+EfJvFkAIhAIzkP0IvSmakUMfFV9BTp3TdUI4FcMYcefl3yjB62+De","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":832033,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgefddCRA9TVsSAnZWagAAikwP/3TdRATsdM0+YpsnycgC\nC7KQFoKCvbCsPVrXJd47x9gfumPhS2XEC4m6q+ZjOMZAIBZCbN8ynuyPhImm\ny1TiUT2Fyrezqs94wnlp1vi6NL4iFGG9qFqoUe6A8L6wtyUPR0Ezro5LKr3V\nFUl4OtfWTa6GTWzVSFT6hm6KMKZWNOtPoh4P9cAGgX6hoboVgjPkRP1kz+yz\nBfIIiCFiCNJ8wsMCrUkMaMllZgDvFX8NZXl2cXaDWsqEvkmqE8JIpOfterFO\nlGLGFKjRk4mzirZEAVPHfEho5S94DOshJ2HlOKBLiBoXtkw4LYbvYBUFs9hh\nvWrORmU+J0/O+ieY/q9HSR/E0PFGwZvBdS5neToUGdaGtZTCNn+pyvc4Hk/X\nDkzNB+YiwtgdcL8z9OSFDzG34VBxo4L3QvitA152x4ToqDG5a6igPBXFJTQM\ntfGVobWoUVohbL5ngfQEINb9GldVCbA68Gb2UiQeLVrAVa4og++inPbOaNnp\nkd6PQ5HRWuQ2DSJ8uKasEtGkJgruQ3s30NvFQMVOYnyZbVS3EcJyKMPh7iBZ\nsgKTQI3g9tlv6LJfOXo/ZFj6juWwU1iRiSATaN3uz6WnrbQNubb6EESzzxYy\ndTAqrD1JttghN+zk5tRtr99DnLY5vx6FNU6DFYn/aPiOzkrsRw2mpXADsN/J\nDPEj\r\n=kRFw\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"603bba9493212a7e1b6350d2f12e7488ae1d9594","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.2ebfc5374.0","@material/rtl":"12.0.0-canary.2ebfc5374.0","@material/base":"12.0.0-canary.2ebfc5374.0","@material/theme":"12.0.0-canary.2ebfc5374.0","@material/ripple":"12.0.0-canary.2ebfc5374.0","@material/animation":"12.0.0-canary.2ebfc5374.0","@material/elevation":"12.0.0-canary.2ebfc5374.0","@material/typography":"12.0.0-canary.2ebfc5374.0","@material/feature-targeting":"12.0.0-canary.2ebfc5374.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_12.0.0-canary.2ebfc5374.0_1618605916952_0.4098373063038321","host":"s3://npm-registry-packages"}},"12.0.0-canary.5631828e1.0":{"name":"@material/slider","version":"12.0.0-canary.5631828e1.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@12.0.0-canary.5631828e1.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"6e15aff9d45819af3efce5b794756157678e8025","tarball":"https://registry.npmjs.org/@material/slider/-/slider-12.0.0-canary.5631828e1.0.tgz","fileCount":38,"integrity":"sha512-hyGR7m+uYwiGRX6jvkfduAbPYWLRPHU4B3wFN63x0QVYQMSJlv7E2FdYsA2HFw0kYcERk/siMPur8Lbb+ZEycw==","signatures":[{"sig":"MEYCIQCAxsEfsq1Qj/wdt1o348whtpTdcpmUv2H8lwNZvjEQsgIhALfVIvUFQvktqu8T8aopkWBLXt/iHg4tEK9z2zMzIQ7R","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":832033,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgepJ2CRA9TVsSAnZWagAAj40P/3AZiVAyLI1oYA4fQ//T\nIVs0vpiz5kABKSZKPijm75U+uhmdJ9uYGMks69BxSNg2mI9o/+sa/Gt8FQyH\ndNQeLXElHGTh9IcBuiUOdA6PYJZk/0gq8ZjDwrt2Zp/EpUg4d/Dm83GKVeE8\ngi/2iLHgQIgiIbvtW8/BiiuvB8m+llcAx2653fdwfnYkLFVcxEFYB4L6IDYl\nQIk0bZ4bzlh68tH/O0cjn5Q3n1ygJcLx8ovmxgEBn4kw6JxIF5Lsog5AeF3P\nJTid/Y3DPfCxgUzEXIsNJXN4nR8yzjEA/9Zrd4vAb/0rMKw2KRAW3YfM16fZ\ne/ZTJahZgxC12/5FmxhaHqXLqzysUFSyG5xF+QobZNjsgqk9EUk4G2EDF/tp\nhUBzdcCv5WAbkTuvw9wYLNSSJ6CtYzsJlT7dKTLTSnBOifMZwOAN8VDwqK48\nCZNlurAWboiIb6FDk4pZ/4KQexkSJil6N4S8ubv5R4CkXvXGtqZ+PN8vU2xO\n7ZWgAN1fxaTzbvR88cxk0y46j0KjiUsDYeruZKatHj9zWnziSh+Y0hpD0Mcm\nAcWyPf/V7CP0aq2OJOOA6cOoX1jx519Gg9GyUeKOiV70cFLDz5hUQ4PCTleg\nFKbaycixQDlx4Gpu69Qd9jcSR0EPCyHnTuP6ODtFWPMRlOyDRbZiofw7GS4K\nwy2H\r\n=HJxq\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"497e1a2527ce0368b4038766ea4893675ced3523","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.5631828e1.0","@material/rtl":"12.0.0-canary.5631828e1.0","@material/base":"12.0.0-canary.5631828e1.0","@material/theme":"12.0.0-canary.5631828e1.0","@material/ripple":"12.0.0-canary.5631828e1.0","@material/animation":"12.0.0-canary.5631828e1.0","@material/elevation":"12.0.0-canary.5631828e1.0","@material/typography":"12.0.0-canary.5631828e1.0","@material/feature-targeting":"12.0.0-canary.5631828e1.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_12.0.0-canary.5631828e1.0_1618645621634_0.4225291412916483","host":"s3://npm-registry-packages"}},"12.0.0-canary.bd685395b.0":{"name":"@material/slider","version":"12.0.0-canary.bd685395b.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@12.0.0-canary.bd685395b.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"a9785909498844c29fb51327ff80150e1f288074","tarball":"https://registry.npmjs.org/@material/slider/-/slider-12.0.0-canary.bd685395b.0.tgz","fileCount":38,"integrity":"sha512-22/vaZk9owvodhupZL8zfel6J8J+bJed7u5iGrBuQ8DxPk7TwIQABz6d6ZEotBHx8EEYdOtb4pLPw0yzRWfkiw==","signatures":[{"sig":"MEQCIEhHs3+Qovw31DmgH68DMrbeAgHsqJxXttmZUbP61CORAiBCG4VtWgbKX3rnrMlorS+iZp/NMp+ljrvh5iicXWqqXw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":832033,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgfc7dCRA9TVsSAnZWagAAy6MQAJYuNRUz6+/Pl2ruQGiA\n5B3rqfD77iGYkO+bOkZxj8RG0HxUnYdLqHDo/WM9xcSwCY40BFmJVP9yYAjy\nRSrLJOqFKsPj2wHrj1+g+nK5kfPXJakWsc8SHiIhGkPUk0qx1tcvjFi+/fnd\nsqoVcSYPoUhJ6exzqW5OnvqcFkUiCdSLTzDXd7EQeAtAEqSCbrPJmdIoTLpi\nhoR8Z1OqIZPNVN+5axvSd7YXA3U+qNfvXzILj8huesK5g/eEDgT7E3K34qAo\nn25OzMt8C+Z6PdSbXo1X00TL52U7Hfs7PkcwQt6XN1QbLgVh/YyNr4nmYvSD\nUQUceFOXwVQhPsIm+CW8KowZ4LSCLeM6kpn3pk9hXYuqYpEqSoRNrBcymtH9\nL8Q1cXdAFW0TREACi5vihPCZp989wvMrD/P6MwSAmRCQhWjeYKiVwyVz+ymk\n9yF5CNM9iPEn+4WEp7K7YK5jdqdiHmAzXU5RJELFtnlFXQiOinV0Poa3DJns\ncZrlb1Z9ml8yBdskQ26jRgv0cmX4Ca9wLjipH4XPNenYmeorx1Lb7kqAM+8h\nf5+UZdh5YufWVkBe4/BQK8p4MLlAj14Osl8o2tDVnXUFtPhzB5L5afIusRG3\npnAyeHO6fDBcezHiZR08pSKoSO6pMdIJXV3s29LIXcCkOCnQ5vZTD4YXwBHl\n0tQS\r\n=IJGx\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"69c7d9ec7c5de65144c3b2a9b283b6baf7af107a","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.bd685395b.0","@material/rtl":"12.0.0-canary.bd685395b.0","@material/base":"12.0.0-canary.bd685395b.0","@material/theme":"12.0.0-canary.bd685395b.0","@material/ripple":"12.0.0-canary.bd685395b.0","@material/animation":"12.0.0-canary.bd685395b.0","@material/elevation":"12.0.0-canary.bd685395b.0","@material/typography":"12.0.0-canary.bd685395b.0","@material/feature-targeting":"12.0.0-canary.bd685395b.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_12.0.0-canary.bd685395b.0_1618857692952_0.26865885821869306","host":"s3://npm-registry-packages"}},"12.0.0-canary.b52196498.0":{"name":"@material/slider","version":"12.0.0-canary.b52196498.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@12.0.0-canary.b52196498.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"66b94875be06ac6b59ec292da152f46f717c9d35","tarball":"https://registry.npmjs.org/@material/slider/-/slider-12.0.0-canary.b52196498.0.tgz","fileCount":38,"integrity":"sha512-qiHn1VQwmA0vSUKrckxeFYctDexLjjWNj7i3vsOyfdUtly9slXR4YGirM6hDvLSswYESh3w5NspympozpyIprg==","signatures":[{"sig":"MEUCIA2QA45CnLMOjeE1yJQW61XNOcy6Tgy3KXXabkhP1pJvAiEA2t3mX1KZQW4ro8Vhj0pksJucRMRV61VDdoN2JQfbGWA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":832033,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgfeDLCRA9TVsSAnZWagAAvEoP/1BO9m03wp+HLuE9gGSU\n1S3yr/2H55x202fiIEGkyF2nz+0lBG49fWHt/OAu1LMDiwvk5J/NwIXDfcnJ\n2Cg0QYbAZERAsjzsjkVLAF2p4X4/vzs9VfhaDSXLu26IjtK7BPRYdu7rxa/j\n/dxKglEghmdXg5wcSeHIXRq3QtCzQQyumBD4RcIF0mHxoHSckq5EvwPrPQ/+\nxmv44vPdqTp7ACDKqWFEHZDgkTICa11wlWpGKj6xqecLyOhMwOveSc0D8UzZ\nnArsCNgJbqmFBtfTITxcv1E8Txj/DUwSIudLXcilcAW6773Ip4HemkHtCW8m\nX6LmnmwGAwH8PX2qaiNZNrbAOGrS0kutsZ6ZDgeIgBNuqTGpH2Zx04zIpUlF\nOJpyi7WI784R6kNPF4zS2XPjmLqI5NeHb+7850WNk7j3OlwEUUhIFx5CdUdA\nMbeogoSbblIqm9Ueg0B0YzlEdJErJNOgxrEdyiM2GeURPEf3Wy1+s4fF7gV2\nbeA5ZDJ1lekUUZniM/kFdk7xhH+IS+VICoLWXYwMkiv8XgP8TzSZ22+qqzkp\nRFRQjmAK3W4EqmMN0fzP4QVe1WPMkx0NtxOylo9yFS1yozTUc9L436IlEqpT\nSA/rlYmNWQt9K1AG3UX3J+E387yswXOvOwlTuhf5zglZ/3Uwa9WiHEZzw8YP\nvNJs\r\n=diwa\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"953cfdd3bde4c66a4b6b90171d4ee702958ae1c4","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.b52196498.0","@material/rtl":"12.0.0-canary.b52196498.0","@material/base":"12.0.0-canary.b52196498.0","@material/theme":"12.0.0-canary.b52196498.0","@material/ripple":"12.0.0-canary.b52196498.0","@material/animation":"12.0.0-canary.b52196498.0","@material/elevation":"12.0.0-canary.b52196498.0","@material/typography":"12.0.0-canary.b52196498.0","@material/feature-targeting":"12.0.0-canary.b52196498.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_12.0.0-canary.b52196498.0_1618862282732_0.3068902337452557","host":"s3://npm-registry-packages"}},"12.0.0-canary.8ba3e298c.0":{"name":"@material/slider","version":"12.0.0-canary.8ba3e298c.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@12.0.0-canary.8ba3e298c.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"441bcce5625a3b8a372bfc027e24969e62e4e5d9","tarball":"https://registry.npmjs.org/@material/slider/-/slider-12.0.0-canary.8ba3e298c.0.tgz","fileCount":38,"integrity":"sha512-MZxJTlI4IBA2p3CWfLa3+uFhKSk7wUx/W7XHGvE7/BS+r4lrBBDupaQ/fAo5MVJSWrEctvMjR0696nAklR/4sg==","signatures":[{"sig":"MEUCIQDhs+qQzk9Yk0du/gbm/H7x554tAkuuzsuvxhnP49Jl2gIgMAQETLOPSUAxFP/JkVaB68lsiSB0UhN3Xe8w8+2tAKk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":832033,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJggDHwCRA9TVsSAnZWagAAegoP/A4TdjO+o+EQtMP5+XgM\nPIzAIqiTlwvHoNa+VqdGDYMurFPTPrDs2Qvf1Ki0wfPhfA1wDTu4jf5gTSJ7\nUUbtVnLxtfHTrYT7Sou5GWjGypTM3IP3M6zY1kgzzO7kYeWSfaj4KMr3Wy+d\nqzW4E/e8K/sFTkHR8H4um7fFQ5levcRW+EbIz0pvjFnP4GLv6GRIAvt0e0TA\n3q1LSzicIc14mT1wVZ+oNKtClNfgUfXZt+trckF3wdi5dkLrxS2XjY9UIYz5\nIvDwfSTV8HKfXtcJVRJmYnUgH1o43n7KMVr+Z5jH2Rf4rzYq8kYz4Rje5N+F\nZ5XGFlnIf86mbRMMjfWNVcnuluxII3PSE5vnjgN3xNhvJSnQI5DHhi/BVSKU\nkudgty2Y+LDqVDWkS6azl+BCMrr3Eo+h4MMen1rVy2X8vYPKsYlHJ4W3Rhz5\njv3gnfva+nCoRFS9QIPvFbDX8l5Bt2NesqRs43yxjgXTIVMVAgAtM29weBMf\nqSCPygKQP0b1Sel+QsDKEh+NT/J4oS+NaEeCor9hxFMl8Oj92cGNHNOY50VB\no59iWnk2IZuTQ030b1y3CXraL9apq+WnZaLl0iB+o3undgHa5Q6YKVEirkz1\n9BSY07zVG5akTFM78VGDl2eoXegzUgnflTmVcCZVuhCbFrgwwb5H/Xee86Ft\nOeIi\r\n=67uL\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"206fcb6cb686d5de97867cb4e4005926e2a94501","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.8ba3e298c.0","@material/rtl":"12.0.0-canary.8ba3e298c.0","@material/base":"12.0.0-canary.8ba3e298c.0","@material/theme":"12.0.0-canary.8ba3e298c.0","@material/ripple":"12.0.0-canary.8ba3e298c.0","@material/animation":"12.0.0-canary.8ba3e298c.0","@material/elevation":"12.0.0-canary.8ba3e298c.0","@material/typography":"12.0.0-canary.8ba3e298c.0","@material/feature-targeting":"12.0.0-canary.8ba3e298c.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_12.0.0-canary.8ba3e298c.0_1619014127540_0.49513256887490775","host":"s3://npm-registry-packages"}},"12.0.0-canary.c629eab71.0":{"name":"@material/slider","version":"12.0.0-canary.c629eab71.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@12.0.0-canary.c629eab71.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"91a4a2253024fcdbb5caaa15245babf0c442f3cd","tarball":"https://registry.npmjs.org/@material/slider/-/slider-12.0.0-canary.c629eab71.0.tgz","fileCount":38,"integrity":"sha512-fGHdF34wcrSL7YqLJZMqyaQhNqS0y7Ip4namytfkao1H1abk4djhvdw+v1M1C3vqUPvRkQRVfF65dQMX/QKuDg==","signatures":[{"sig":"MEUCIQCKxFZsXGKB8zSu2MjwPJJqX+iRpGvoFqUbGtSFGpIgRQIgf4qgrlipI8XiFJgAq5exPyCGGuLEzUT2ISxx9cU4oCE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":832033,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJggIOmCRA9TVsSAnZWagAA/B8P/j+iokTbt96Oy4Uwe8CX\nWmSm/oralmT5xk3FFcVFJZdQs0jRLZcULbXIDJcLs0rtamnXEYpb221O/1P2\n/uxP5d70yu90VeeNzMengNm37eNqeuMnKjhlCjp5bCilvN5qAcOk4wsX6LnE\nkslOzTQYI/ysVud4dGoR/KujWAwTE+jPkWvlEaLW5RdYCb84/ZqEKN+UKew/\nUqb43akHXm4aXbi0G9TlTUdtnHuXIUqWuhEnIB/jWJombra49KvmfWQB7QBu\ni/SSLQNeOZQ5VmSNXSY1hSDkBf93JV6cjAk9wxqdDxmrWUL68uBDAZjpOGue\nvMqZQ8A2B6ZrQlnwmvYSqi6vfOXyqqGwSTTX4VlYj7MwR8BoaDUMg23pkIE/\nOKzhBB0z4UxSgcZd0Uv5S6iYUU4LixDqHo9sRTwuIOTCLV2oAebo6+wqx2ss\n9DKjSKkZUGUZO2eNOv46v8y9LRUixQ8gGfPxt2zxaJe8gqMqTMZk1TF4QcG6\ntWHumuSqKtdgupNjcLxDHLYIRh/vRdu7BiJQZ0qfXDZJMJczMDq7KBsL/llJ\nryfWTAuvpp/6gMIJ/eyvyRaFMpqJ5xGG5fnAqkLIjwjTXkGZgs8lrP/t2mnV\nrQb9tCzKyk0WjH1ah1rYOqmYdw14ZMZrq55KN5jFXJnjr496Pk6uZyRTgrnj\nbfWr\r\n=CEVx\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"13ae4a821cd20abff4520de3f38c689af7cd0edc","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.c629eab71.0","@material/rtl":"12.0.0-canary.c629eab71.0","@material/base":"12.0.0-canary.c629eab71.0","@material/theme":"12.0.0-canary.c629eab71.0","@material/ripple":"12.0.0-canary.c629eab71.0","@material/animation":"12.0.0-canary.c629eab71.0","@material/elevation":"12.0.0-canary.c629eab71.0","@material/typography":"12.0.0-canary.c629eab71.0","@material/feature-targeting":"12.0.0-canary.c629eab71.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_12.0.0-canary.c629eab71.0_1619035045959_0.0767468991050766","host":"s3://npm-registry-packages"}},"12.0.0-canary.8ace3b810.0":{"name":"@material/slider","version":"12.0.0-canary.8ace3b810.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@12.0.0-canary.8ace3b810.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"a3dc4979497c7f2323778aa1c43f3fdb87e7cdb3","tarball":"https://registry.npmjs.org/@material/slider/-/slider-12.0.0-canary.8ace3b810.0.tgz","fileCount":38,"integrity":"sha512-lZ9swqLJMqSuRnSOrp0l7cDnZIXOgfJCt7owQvML0ZItfubBcznS4zl4WW37Fq9CLoocrr5k4ykIVj6KZJksxQ==","signatures":[{"sig":"MEYCIQCJafkhLZ0fmASU4q3EBF9H0bbRtXY6KOf/LO4N46zaJgIhAOAcH9/KgSM2dcBuVkVQC0qCNQBLh/BqtxvlyyLa6aBn","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":832033,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJggI0uCRA9TVsSAnZWagAAL04QAJ++8DSbQRmPa3lPikAL\ntiaRR6KSQE9tzTbTpGz9ep/NnfHjVw7fs37RcotzvHmCGSti5Iu7Uc/u3TPg\nv7jP0pMooAsY99heqhuueo1526NhLvYhV6UmtB40+Ov5/gzRTnO+/pxm2dDI\npYr6XNtnR81USgue3X07gXkx6aOpbrfkHs5uat2V9mpScNJ2Xr1Oiq5qebBc\nsSk5ulidltBQ08rJi9ebXPebk/bP7h1yH5L2rOx41f33XatM2KDtvjFWfKOa\nFRSr9ru25yuoDIj3kXGrp82IdElWuhZpt1aUWmLN6bC5Q3U/+JhUcyqxYTrs\n8bexd3jEm/uomFnvpgIHfz7zXITHEuz3us836KkFhn7zpOty9iTWOpzEzVfP\nsTzAn+zJ7XPg6B7V79WBH2x1gc75nRfDSmF1U0b7WoeagoKUc5iA6jtp+Vsw\nft6a0nvzM5dIaX/ZKxYhIA2SGDTjAe+gtP6F0nh2ONoQO7Ma4E3ZXvtABvD0\nK2mJkTSKigY95XtQc2y86KgRYDEgQBYp52AsXzObXF7EYo48Ss1LFUYdLo3k\n2vniSe8hBvXXROotejcv70q7FuVIcuZvfp6kSc/2nDr1NDiU5RbBNJsrBre8\nCvEzWSdbIPVw3wvEwvzlnbk8sSk5h3D7THvgHKobBMWe3CoijxyVH1bVWd0p\n3+CW\r\n=T96I\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"622173e8e2308a6104e06bf943b6423381a17e5e","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.8ace3b810.0","@material/rtl":"12.0.0-canary.8ace3b810.0","@material/base":"12.0.0-canary.8ace3b810.0","@material/theme":"12.0.0-canary.8ace3b810.0","@material/ripple":"12.0.0-canary.8ace3b810.0","@material/animation":"12.0.0-canary.8ace3b810.0","@material/elevation":"12.0.0-canary.8ace3b810.0","@material/typography":"12.0.0-canary.8ace3b810.0","@material/feature-targeting":"12.0.0-canary.8ace3b810.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_12.0.0-canary.8ace3b810.0_1619037485731_0.5599022744861502","host":"s3://npm-registry-packages"}},"12.0.0-canary.70beaf42d.0":{"name":"@material/slider","version":"12.0.0-canary.70beaf42d.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@12.0.0-canary.70beaf42d.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"8ef4328041f77dbc7e235e75ae8c6c0321ab993b","tarball":"https://registry.npmjs.org/@material/slider/-/slider-12.0.0-canary.70beaf42d.0.tgz","fileCount":38,"integrity":"sha512-X5Bnd2oNXCcXxL9d0Fhrq1DLBNRsDvsRFAd31ncf4o/2F8IcxITnudZT6KqgwXU1fVc913VWPm+w7AKZf87CrQ==","signatures":[{"sig":"MEYCIQDxijpmWoTWu3ku6KIF61l5uukcch+2kg+Zw13QResMOQIhAPEs6m5/ebAL8JSUa5Hm2Ieo0bKADnVWoei9auINGywV","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":832033,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJggI/jCRA9TVsSAnZWagAAHfQP/01sZEelyZDujCr7Ko21\nssmJab4DSgd6dLF7+vyti3+IccwfraHyIEd6WGjnNFCxcxZGQYVGUell7xvB\nBozqHE0RFcDrCGGaFV3LOHeeda6kwtauUH3CNuYFqTTRTJU0tnIiuwaqmuCb\n8bVi0iRx2+0v04lqR2ZzeJZdPgUVZ/LeRmraEko3PURIkJ2T1DU+PeSp8YRe\nNVvS9BPaJH7VskTLA1DrD6owEQjHS+kQZuQq92DyxS0rY3cLehpPG1b+FATK\ntbqA7Al3paNp+MoN+At3Y18wVlGdT77kM5PUMbIvIT6QX8zldRifFIzfnc2k\nOT69/hcqdesJ5bB0K16xcMw2E5Dueb6PUb7QY7aBWXzKCbMdQOPoUBi5i3mR\nt0CrBJtnsoH7PeRLpn331j5f6o9pcZGpYLmDU3jQi1Vv01lOI6MC33Fzt+z1\n93wCTKKHfwIIbFVwl0meleBacuEtIkVDFYnWjmovN4Tc/cOrU0dVd8pUWfH0\nz2ToZA8LAVK1BG7DzaiqlAeeaYYhjv5dQqTysJsYwls2TvjKeq20cotxo1ER\n9ArOde0NCq6jF9v2rnJ9r811Ya+A+wT8q7XaO5GDFK5GeS/5hKX4T/5Ya1N+\nNvyDc6mh/o0ij4deUipK/I+GDsCfyPFUday72fVQGEwbR1k+9FoXR+EXkGpb\n/bSc\r\n=MLP4\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"c5b29092fb8fcd0102b908417d8ed3d61c3448f5","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.70beaf42d.0","@material/rtl":"12.0.0-canary.70beaf42d.0","@material/base":"12.0.0-canary.70beaf42d.0","@material/theme":"12.0.0-canary.70beaf42d.0","@material/ripple":"12.0.0-canary.70beaf42d.0","@material/animation":"12.0.0-canary.70beaf42d.0","@material/elevation":"12.0.0-canary.70beaf42d.0","@material/typography":"12.0.0-canary.70beaf42d.0","@material/feature-targeting":"12.0.0-canary.70beaf42d.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_12.0.0-canary.70beaf42d.0_1619038178473_0.5405097004363617","host":"s3://npm-registry-packages"}},"12.0.0-canary.cad489689.0":{"name":"@material/slider","version":"12.0.0-canary.cad489689.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@12.0.0-canary.cad489689.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"a5389b8e82e816db11ed7ea88dc54df4451c9702","tarball":"https://registry.npmjs.org/@material/slider/-/slider-12.0.0-canary.cad489689.0.tgz","fileCount":38,"integrity":"sha512-9czEeon4JUFk5x0uaIvrO6/UwsY1BB2NI2F5vsLuE+bBw0KilG48/rPdfAxknJLID4dSYF/0XjwTNbQQBKMG8Q==","signatures":[{"sig":"MEUCIDSwU8wMEI611CQj5JZu7QeEDZds6Q1o2BkNKgrkA1cwAiEA7hHFxGS7VZxIyM9ZL1rLkAFXk3jcy1ggcLB4Ckb3KLs=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":832033,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJggakqCRA9TVsSAnZWagAA6JcP/jT8ANXxCqlMUCCeqgQi\ndUQC3bE217aaGxPJ49jFUn3go6LfsOc/tQ/ibygeXGfhwP/3YVc7/YATOPK0\nWpdBbE6yp6N4NVmY2EfkK2MmrQCm4P8MXmLDYxbWW7Ot2IkzJcSfovdFlTgo\nFnO6WuS2NRsMdmDS7BWtVeMtZYSP4vw/S3xb/y+UHFaQ+y+v0BQMK8IVyp1P\nV7PKBLXo7HG3QLsQbDtjj7X3YclXzXDz5IeUc0XV4HrE16G25vtl+sVbLEmP\nTLhOWKwGMwAL6MpMYBKJXN8OJHlcVGTkTx6xrPMsFxEqXEQYwmoNUbVYGJcK\njfZowGtIw+ZLsmDbz7bSZljQU6SIxsSAHkdwgTEZnLK1owAWeVJ6fSmwhOPI\nuhPV0tZvylOh+4Bf15hvLVcuv7knKUCHFOWtVPgj1wJQgP0rz44xoqdhzin0\nl/M4B8pbJHJezYvZzYFqpm2Z/TKYt4cyYOCWy7RVYVhpOBZD0MiTcKTc4Mzx\njlgmYnP7xs90McF1oKlkh2smRLowYD42WQO7HVM5bNzveG9ZWZjxdA6I7a2z\n4+0uDf9wY/Kd//XDGp9+4B8HU7uGKQWBCyO0MwFD7qywYVV37dOPRBYJUcHj\n03/jDUjGPkdGsIBARPjM7i+4dmfinAe/3x3FNMzEPo45718RFh07ayI7RVmo\nxVjE\r\n=5IMx\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"3e5c20e059b33965b63d0073bed7e300c57d5781","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.cad489689.0","@material/rtl":"12.0.0-canary.cad489689.0","@material/base":"12.0.0-canary.cad489689.0","@material/theme":"12.0.0-canary.cad489689.0","@material/ripple":"12.0.0-canary.cad489689.0","@material/animation":"12.0.0-canary.cad489689.0","@material/elevation":"12.0.0-canary.cad489689.0","@material/typography":"12.0.0-canary.cad489689.0","@material/feature-targeting":"12.0.0-canary.cad489689.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_12.0.0-canary.cad489689.0_1619110185535_0.1737574895363223","host":"s3://npm-registry-packages"}},"12.0.0-canary.d928692b5.0":{"name":"@material/slider","version":"12.0.0-canary.d928692b5.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@12.0.0-canary.d928692b5.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"d79195d832b6f9b03f87a78ab49a2c13da79eee4","tarball":"https://registry.npmjs.org/@material/slider/-/slider-12.0.0-canary.d928692b5.0.tgz","fileCount":38,"integrity":"sha512-Y6eAXlMTjJJgv+N/63T2Vypv+/6yArGI90rRWsXLrhPtsxpM5AafS7F5hkDlxDS3cpGeTpkk1OtSu+DbafVd8g==","signatures":[{"sig":"MEYCIQDl+bsjNtm6ULkNDMzI+7tLN/vCvScivepAupYBzx1k/AIhAN7ZzrpY2hJfUiRoEcTjRfHvMzXcCkpU6r7nFwI7krLI","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":832033,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJggwUxCRA9TVsSAnZWagAAV3oQAKP6ID8Rclkes5kMkxMu\n1tW6G2B7HwwO0u5xTFAwzZMCc3WZkS1NSXcK4dqIXVAjU6wxT2mNk1ErEr+e\nL6jkxGWjeNev205IoHvy7I67Al4z4ZxZdbhCZgFzHGb5KOuWGduvMO6xqB1Y\nWBqfnQbw8x9yy68bsnEPipv3zlvl9b1/CppCbpugLIIrowYGdS8qxcWNWCC+\nJJP4B0AlX3CwwhSI1zuN7+uiuyjusC0bjL9ncTPwUWOEQRivC6Ntz7Mi5bJ4\nYhmYdFV3yRlmoUmIWMsMFlI0O4CAxmzljl4eSiIdOJypKlmeN3KwNf6d2Vbz\nAkvI08nXDMnchv7NqV6V8uCAYoLv3qyGrxhTYWPO0Ff44Mz43mtQwj7FDMCK\nEsVLnsghG6jp88Da+UrPcutFs6+jycz7dh74UeB50vabw1tAzYLJ0kJXpB2R\n/PxRalCmb+qjN9wwao/bzqTFQ7/esanO3jNdI+Jo0zbFmmO7OrPAApy+GhSA\nTzl7D+FF+pusxzLYIBBwTqW3KBe6KtD+k7CQWcNMXYiKiHkERWqTQpQA8rQS\nXHgQug74LJAQsbFK7AglYq1bLVLA0S1nzM+acnqeocMCX/E831twJxhB9ys7\n7VMEag1F4G+MRbFUFnDFnJyny1PZBrKs9cOTbuXsiaSTaS9YwghyISEKMDTw\n2Q/1\r\n=UnLI\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"ced6a0237d36ed84c4d277fc25a11d9453108e12","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.d928692b5.0","@material/rtl":"12.0.0-canary.d928692b5.0","@material/base":"12.0.0-canary.d928692b5.0","@material/theme":"12.0.0-canary.d928692b5.0","@material/ripple":"12.0.0-canary.d928692b5.0","@material/animation":"12.0.0-canary.d928692b5.0","@material/elevation":"12.0.0-canary.d928692b5.0","@material/typography":"12.0.0-canary.d928692b5.0","@material/feature-targeting":"12.0.0-canary.d928692b5.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_12.0.0-canary.d928692b5.0_1619199281122_0.5202563492106762","host":"s3://npm-registry-packages"}},"12.0.0-canary.8f68de8f3.0":{"name":"@material/slider","version":"12.0.0-canary.8f68de8f3.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@12.0.0-canary.8f68de8f3.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"ae205f1c27ee1aa17a2487b716a5931c1dc85bf8","tarball":"https://registry.npmjs.org/@material/slider/-/slider-12.0.0-canary.8f68de8f3.0.tgz","fileCount":38,"integrity":"sha512-/uoJtwoJwRdZOprWwKKqSNUsVXXcQqbUtdA3JxdvTQqcd+7KXncBHwi+sefJcyyDC1aIDka0N2g+T+6xWkg5bQ==","signatures":[{"sig":"MEYCIQCHRgta4qfGhOHpetXda7GIXLDlXBLaRPt5MQXKSRiFmwIhAP4u3heE7Rl7qMc+2QlMhPIeQSR3waO4jpHbrFJMd5pi","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":832033,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJggw5HCRA9TVsSAnZWagAASAcQAJ5WaXU8CMBlEp1vf4YX\ndDeKeOPCbFhUK/rDRAYfON6OkQ/L5oVz9W9bZLrXxng/p71GhLBk9Hfk84N2\n5HPihFG4mBLlwKAZU3kDVloEf9pwJav1nKxsrUgtNRnHW8q3DonVW9TooOvJ\nC8O63DE8fJRMNw3YC75avcs0bF7qd9NDTa7bViNEsK1JPMcKGtR2VqXY6Bpd\n3Eh2OwSchLgdG7F5263Na8+cuxCXMpj9kjgNrSHMzbIyYuuHKpyTiDTzWyTz\nwFXWkFi5EZLu8TmpYmlzRhcMNg/r3cIdA0HRQSvvCXpZjFmeg89OP8W5YxMs\nq0omd7FQujPk42RyIiHSNdvhrhf9kjm6c14RIE9dtJJobzSUvHjxuALtL9JA\nG43JWp8SYtT3/YLFeY8cMX4QBAeUyUEWiK2J/oIAg8+JZKYr/Aq37XSzHNxA\nwV50KjDTbXU17irYXE4zf0bZjqG6qtlXkH5xSV6S9JQo1JPQdCCq4zKPmXF4\nFUeuUKK/Dn6D4HNWaRaIPeQTARMO9ZeNnSm6HlcV0l0L1TvhpnmiTkibUWZG\nTNPAzd6yXt6NzneImU0iny9xV+M72mWHiFIMQmGNBRpvmZOerIOafvxqjXvj\nis8p0GWG/o6DZZwfQgBLuykF8VWG9h+j3S4MgbLNri2prVVe5LY4SLB39T3w\nx/SO\r\n=Ygnp\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"5bf06e910f57a544c428d7559d72d5fc2a5f30e9","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.8f68de8f3.0","@material/rtl":"12.0.0-canary.8f68de8f3.0","@material/base":"12.0.0-canary.8f68de8f3.0","@material/theme":"12.0.0-canary.8f68de8f3.0","@material/ripple":"12.0.0-canary.8f68de8f3.0","@material/animation":"12.0.0-canary.8f68de8f3.0","@material/elevation":"12.0.0-canary.8f68de8f3.0","@material/typography":"12.0.0-canary.8f68de8f3.0","@material/feature-targeting":"12.0.0-canary.8f68de8f3.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_12.0.0-canary.8f68de8f3.0_1619201607381_0.3449345138116864","host":"s3://npm-registry-packages"}},"12.0.0-canary.05753cf77.0":{"name":"@material/slider","version":"12.0.0-canary.05753cf77.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@12.0.0-canary.05753cf77.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"83a3d1c0eca892c142aa6d6b0e89007d7cef0525","tarball":"https://registry.npmjs.org/@material/slider/-/slider-12.0.0-canary.05753cf77.0.tgz","fileCount":38,"integrity":"sha512-207jcUyHW3Js/vJP4EF92D9nrXBXVldneeQAgiJawq4uZiC7P3YoKaP0q0nV+lzBeADCZCNqXn+JDtQNImpqrg==","signatures":[{"sig":"MEYCIQDTIgU8CnG3py64wszTdJ9tjfKh9CU0CYK1oHm3nIPtNwIhANi1tkQmCLxtKgeG/mbamYI9yBVUDpFLEedxP1sjVtxx","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":832033,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgg1uZCRA9TVsSAnZWagAAG1cP/3e2fNmFNoM4gbcdjWxP\nuqQeFnfFp8zbAhhxYCD+BPGm5hmMwbHq+WVWdTkfGoU+Nf0gxC4r9YmqAIVq\nNvGfK6UW2lBdNRRVZI4e+KFJD4SRrvnIIOXFeTEA2+Kd+3jU3CdvTl9vfWph\npaW26GacSrn51b8Y23Ew6OTzuq3dstdU48waTSPjxdX7+6DSSkjM+PVL3dmd\nmjfOCogd/Dbe2e926ZuStFP8WUpO+ryESdhWBAOjKNRei3U1cV7ZIu3Th76B\nryFBMlSPfAzXUvm//ef6/Zc4ImWbD5TOWlveMAZI4qSP/9ASsQp5q2qTEzkz\n72vjVewefwGVig2IvDNDYRpksl/9l/6hgiLqZlk96FqSSlrvIUGmHF/GoPxx\nZjdT9B8Wd1KHyk9baAo7BkegW3eY0bvNUjrPAxhyJ1IKMsmzsZU+1LY4XYQB\n1BwADJU++fV6rSEonrDe4+oMmz94iBhs7ou5uaQHhfehlM6eUZwJyhRFPNCI\n8OJhzmPvJBe5yqyWrsRtoYiP61rCXLgHCX4eyiWrkJOCrPFk4zsbFGWQbKIe\nf5yweriJwnHVB+TChciH7ECOUsE79T9t6LLnW8VmHNcHM1mOHw6u12Cj3q7p\n5QE6ofm14pFIzC7Ql0Hi4prYHBfzdnRVk7KEIT/O305FOKjUwPDlrjTFsMUT\nHL+e\r\n=i1HN\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"3557c74d7c4f9400f0a8d2c88bc2610c1d600199","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.05753cf77.0","@material/rtl":"12.0.0-canary.05753cf77.0","@material/base":"12.0.0-canary.05753cf77.0","@material/theme":"12.0.0-canary.05753cf77.0","@material/ripple":"12.0.0-canary.05753cf77.0","@material/animation":"12.0.0-canary.05753cf77.0","@material/elevation":"12.0.0-canary.05753cf77.0","@material/typography":"12.0.0-canary.05753cf77.0","@material/feature-targeting":"12.0.0-canary.05753cf77.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_12.0.0-canary.05753cf77.0_1619221401385_0.3535098774372809","host":"s3://npm-registry-packages"}},"12.0.0-canary.ef43e6d96.0":{"name":"@material/slider","version":"12.0.0-canary.ef43e6d96.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@12.0.0-canary.ef43e6d96.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"5e1665f4f7cf45cff58f3d573bd650978c28b04c","tarball":"https://registry.npmjs.org/@material/slider/-/slider-12.0.0-canary.ef43e6d96.0.tgz","fileCount":38,"integrity":"sha512-6VlcTgUJ7GbcwWl5Bxt4cC6jtpu2WBfKrY83gnelCC/XFqiZsklROWTeLxqBWC+i750HLNXeujnnQRrXvJWWlQ==","signatures":[{"sig":"MEQCIBJV4t+4l237Pm7FA+y+XW8SP99dzlpYSfhtJ9xjBoM3AiBdGdF/4p5y0W4oHTPTyKDXr5l7lRqifm7+Od6MKUsGaQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":832033,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgg10VCRA9TVsSAnZWagAA7wIP/i1RhIpypMsoXGsiQLKo\n6LBhEjpUbpQwScu6/9lEdZ1047roT42RSDzMWQ+l048ql5u+PqqoNg+UXgFE\n23ZD56bNODgHXALFi8l0xoCVhteVaMGMfrH8pst2JWAqbHCsK17A58VWSn23\nUCxxPKuckfXzV+rTMu+nvCLERGQx3XMeBUGSP72YM4yvDQFJR0hPg2egHUug\nSZw/UYW49DlnpY4yi2p8AyeEnVG7yP93dpuOr9zDMN/BnIzdfegqM1FmPdT4\ni+SjwqY11Bwmawvi3OhCk6U+jBDkcCbZ43swleSu9ZuBhPL3Efme4LxndiED\nj2ufCuAePtaMF5leiStrYBtBsgj/myVk2FVEF4ciOZckI7OEKjevUv7V6FJ9\n3yqNFbwXuvu6S23+4KJDxUvVB4fAeaIgXUQ7/YooaE4b97EV21UH/yOLLSvM\nUzbOl/WdVY4VZ06MqQbApYrTGr9R0EBQfcGMqz4PylsOuaNYGKOv+dyRznZA\nV0Pd8q6qmwJKXXSoJn39R+vCveAB6AaxhdJlA7u55+bh1ytqja1HMumzks4V\nFrcknQmuzAUf/5iDqcekO/W+NZwk4ascdVQ5FT1LLJnD49FlyaS6nFrAmeXl\nEoq3bQKomzLUs9AzqYsrKUe9M7rDRpDMhKz2HqskTaNy53aaIAz9WYQVWgIU\nbKDk\r\n=PtKg\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"bf61e37f943b49cb1c3287501ad6fc31f8c88687","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.ef43e6d96.0","@material/rtl":"12.0.0-canary.ef43e6d96.0","@material/base":"12.0.0-canary.ef43e6d96.0","@material/theme":"12.0.0-canary.ef43e6d96.0","@material/ripple":"12.0.0-canary.ef43e6d96.0","@material/animation":"12.0.0-canary.ef43e6d96.0","@material/elevation":"12.0.0-canary.ef43e6d96.0","@material/typography":"12.0.0-canary.ef43e6d96.0","@material/feature-targeting":"12.0.0-canary.ef43e6d96.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_12.0.0-canary.ef43e6d96.0_1619221781404_0.7620247013761317","host":"s3://npm-registry-packages"}},"12.0.0-canary.197f64fa2.0":{"name":"@material/slider","version":"12.0.0-canary.197f64fa2.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@12.0.0-canary.197f64fa2.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"e4dd8d4549009b7d4112054f2d7e61a2f4c34069","tarball":"https://registry.npmjs.org/@material/slider/-/slider-12.0.0-canary.197f64fa2.0.tgz","fileCount":38,"integrity":"sha512-PvUgfr/Ff1Zf1zEysuT8IImYBT2U94qcnHtCIt9Omyt4FXiptDOEe4bqX4WouMDklmH/llBv8/B4/iBOAsavaQ==","signatures":[{"sig":"MEQCIDJv41SMd1GR6b8rWBs02Wg33vVo6TfrJhulEUFxzNxWAiBGIqhhWOIwLju4gbGBDDH3v3z5TsO+TfO3FNsQGLsyRg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":832033,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJghvPxCRA9TVsSAnZWagAAdc8QAJUAMfpqmMiH6S9MfCkO\nKrdKIFqdYHfFUn6JxoiQN8rhlzNsuym3AaHHpgSQAxnauyHLISk+8xGXLiEz\n4BevaI4/k8Wm0/tlNZ0FmLIgTBhH5yfi/XMDHzym/7ELhe7ITS8ef1R//UbZ\n68aXXxPbLw8bsPlZPzkdWCVDPmoOST1JB5rgET2+jWP3jwuJiSjoyvbMLxfg\nO2KVaULe/AQNs43DjCc+IhX5Wl1v9ips3pawbf8brU0FxjfUhZyi4sztoyaK\nQvqVaIVyVvg9DhcKpKqWCHQs7jRBZF7dbp7JTvBMbbPRrd5hhGtariaDnZjF\nHuV1hV9UVaT5qNFekI/FsGmUWSbbMDhgTnEEXy2hXCBFFdJ7swIs2c4FmSKC\nRrbkYZdRDrvYqSC8hF0ipk4sAx8dqXRfub6EM1f+X3K5tIzoIIzFMit6oiAR\nEMAKq962Rkdoi9sfwQNo4nx/IM89V3OwEfQvK/nUWlLKu+qj3nlbnHX5c5jG\n7DqVV0VLXmdGIJTWXdPhyPX725cM23s0XIcU2jeeidAhCf6/mYtFRloY92z6\nb0sE07TTMUgebzYMMpuijTQvSIkpVZ/MlKVZPcEZlVBdYT+eAJk+Y5H0m3rL\nXiu8hN529pOBOZHdp4gdDcr8j62sAXcclwUWPHDyHvTVTHkQqQkCqesVeItF\nOfch\r\n=8Ese\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"8ddcd6186c353b0d99439cebca29eb95eebc705d","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.197f64fa2.0","@material/rtl":"12.0.0-canary.197f64fa2.0","@material/base":"12.0.0-canary.197f64fa2.0","@material/theme":"12.0.0-canary.197f64fa2.0","@material/ripple":"12.0.0-canary.197f64fa2.0","@material/animation":"12.0.0-canary.197f64fa2.0","@material/elevation":"12.0.0-canary.197f64fa2.0","@material/typography":"12.0.0-canary.197f64fa2.0","@material/feature-targeting":"12.0.0-canary.197f64fa2.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_12.0.0-canary.197f64fa2.0_1619457009290_0.23073015357034388","host":"s3://npm-registry-packages"}},"12.0.0-canary.55ad2d7d8.0":{"name":"@material/slider","version":"12.0.0-canary.55ad2d7d8.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@12.0.0-canary.55ad2d7d8.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"b5143a1039f5084b887106d904c7eb7b9edbb5e4","tarball":"https://registry.npmjs.org/@material/slider/-/slider-12.0.0-canary.55ad2d7d8.0.tgz","fileCount":38,"integrity":"sha512-iw8UJgvb2WQKE092LsAspiP3Fffpj/cfbLiW9lJS6QCC/8K3OTDQTBhSt2IG3nwJ9DPYpoXI0uRhzJA7srttlQ==","signatures":[{"sig":"MEYCIQDGxSGTPopO5BgpuOsflucnb3ETDrX5QlOA6Ao+XO5DvgIhANbFgIpfeHq6lt1Vd2kTq9Tg67/qIYy9ovRYHHgpuw8E","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":832033,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgh2bFCRA9TVsSAnZWagAA3TUP/Rnr+NSesvJYJxw7OQ9v\n/Q6uHbQsvhl0YGFKpGjsTzoPtswwZcQ12Q7ALDOIdLW9lrYBZEl5HvxnpwbD\nluhQEI/YM+/BeXlqngcabnlDpe17TEaHyN8MvemcqgtRLLqobcKQ9ZpiXxbR\nz5GU+SQpYJv9poRUQLHediHTt2W7GkSXg+8iiOD0BbyoEB6oKIXCw4IeD8+j\nAL57xSxo80FSahJ8ZXokmYJK4M9wavk/q5g/gNzOXOITz6lTdhlLNvxn/+tx\nu08j4soA7fwlD3nBHN8hsbfBxWkCW46KTUweKE903KCwZn7jpURRqRdz1qt5\nZJkrpvyUMvE4i7Pl7P6rnl5B8hsI8BgXSrjCM6Jzf+uC9kq+mty/qvPDZnrT\nyTW+jaOVk9mLIUW20SPZxs5dYn+9gwd/6YRFzRpS6StiM/zyZ3ybE6eBMQ9I\nwKu7e7sbA6jXcgm8Aewhw24CNGwYRd3sqc/iTuQgcPzzT1epqWJbqCINW2T9\nc5MatnDIe16NlfORX6tjTZaa0k79Ld93FEr9ykhJKbR6JPykL0OeRhJ8zR1I\n9YqI/44144zHlzfjOzv2qRgh3RqVPtbHCrhCeWuYWRUA61ack1oHu4jU9XDU\nTJYmMgoNeJhxTXNX45YRozmnZTWOh8C7h+Pbd6CQhfV2iACwXupMe5sVti82\ntJqK\r\n=TUTp\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"ed8a5f8b1756d56e3973815a51d6fc7e51c366ab","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.55ad2d7d8.0","@material/rtl":"12.0.0-canary.55ad2d7d8.0","@material/base":"12.0.0-canary.55ad2d7d8.0","@material/theme":"12.0.0-canary.55ad2d7d8.0","@material/ripple":"12.0.0-canary.55ad2d7d8.0","@material/animation":"12.0.0-canary.55ad2d7d8.0","@material/elevation":"12.0.0-canary.55ad2d7d8.0","@material/typography":"12.0.0-canary.55ad2d7d8.0","@material/feature-targeting":"12.0.0-canary.55ad2d7d8.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_12.0.0-canary.55ad2d7d8.0_1619486404984_0.040218833411087784","host":"s3://npm-registry-packages"}},"12.0.0-canary.ec4ac5234.0":{"name":"@material/slider","version":"12.0.0-canary.ec4ac5234.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@12.0.0-canary.ec4ac5234.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"e1cbafdd5fa4571d9dae51aa32efabcd160121fd","tarball":"https://registry.npmjs.org/@material/slider/-/slider-12.0.0-canary.ec4ac5234.0.tgz","fileCount":38,"integrity":"sha512-PBJuuIS0tp3j6rQTaLpsZWtRfUgK3Ujckc1+PomHb8Oo8PW8meE2iSd+WtwgvkbhOc1JGR5gV/fmsXAY8s9Cvw==","signatures":[{"sig":"MEUCIQCMkVvt4f37R2AjN5DyJRqx1lGrf8B73FzlgB7gB7nSdQIgBANwZRNBk8CD3gSP5yDXtyZ7ULWVLGOV5im9YjL3t8I=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":832811,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgh8Q8CRA9TVsSAnZWagAAlZAP/1W2cVsAo3s74RKlfpnA\nqUeyLYB6+sgxe58k2Lb48c9Cgbec1yjBR3d5HwOoCx/vX1S0r5B/bngTp9EM\nsumHbQVpNLoDP89FJA3rgjgg+BBsQdeDRbUe9jJ9Lys8mRswmcNY+5N9Cp4u\nPOuE8BnmgSsXAq7rvfEi2QvbCxOx4CPjVXcRe2eZUOrSfxdJAPxWrkgek2F2\nblq+pBvrXNfVDBndl9gHXSnSxxgdxJ0rg1jv6NjuC31fVzcYduSttJFm0gCK\n20n7gwpQf176DPL7+tdXXcN2pSoC9ZHF0E/l8oIn8vEpDOvKVzAu8UriJnkL\nQ8v4sejZiwPGVr4tLqCuAf7wVUqebn7q6YRYKpgsvkQgJpkA0aYmOidoyx/q\n2u0wgAhiEW/FHeAeES7SFhKnJkvVcF4gzjoghHcQDZDGdPo7yI0hP6VAiPvd\n6NhB0hOlM2+kfCXjTpHixfv/2uiK12ISkoQ6D1KI5vIsVlIUcnVDH34L4o6/\nHfPhkhbK+4rFYDaB/5C2Rgv54q6nhZYMcrPjeeBk8alpuQAeF5cnGJUftoJq\nGEWW3YgKesg+K3exdk1N+oOGlmu2DlqtB02fb0d3O06k64GlaX9QZEGKBhvw\nN4d0aSm+fo0PIaIGii1bkqY0UQ+vyXomA0LOz/LL0IznESCiIYkdCLLlmqZm\ndP9O\r\n=4hDi\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"b189e0be8deb45b4e94790f21c377c3884f551b7","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.ec4ac5234.0","@material/rtl":"12.0.0-canary.ec4ac5234.0","@material/base":"12.0.0-canary.ec4ac5234.0","@material/theme":"12.0.0-canary.ec4ac5234.0","@material/ripple":"12.0.0-canary.ec4ac5234.0","@material/animation":"12.0.0-canary.ec4ac5234.0","@material/elevation":"12.0.0-canary.ec4ac5234.0","@material/typography":"12.0.0-canary.ec4ac5234.0","@material/feature-targeting":"12.0.0-canary.ec4ac5234.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_12.0.0-canary.ec4ac5234.0_1619510331883_0.6794418443103285","host":"s3://npm-registry-packages"}},"12.0.0-canary.b0579acdb.0":{"name":"@material/slider","version":"12.0.0-canary.b0579acdb.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@12.0.0-canary.b0579acdb.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"28e6c809325b436e8f927db5fd295f8195d32f0d","tarball":"https://registry.npmjs.org/@material/slider/-/slider-12.0.0-canary.b0579acdb.0.tgz","fileCount":38,"integrity":"sha512-YRXrdVxlB5FqIV2QBMVNMeXXEKUxya7mB/ypKfhxK4SPrWIwa59MoYflntxXyXSdGnC5olV5LFCmkaiKK9u/wQ==","signatures":[{"sig":"MEUCIA8TrIC3NSivv+E2UBcEMHLytQKBpGMGepo3nvjJ9rxVAiEAuJ2XZLdTf9khPSMJJWeVh6B6Jq1TSa1pU2XVZw7U04Q=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":832811,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgh80ZCRA9TVsSAnZWagAAX2sP/1xsq/dcJZrhIJfPrwW0\nzUjinxuHykApCuqhEq+GyoSvp6BS82OAXWyajEpxGwgiFfc9RCfq/AzxzdIH\nPY2RXQymD8OXwQ0UEB9yiLTGs43RCyucaz0dSvqMFBHO09UWoFrocVUwd78o\nyTDD87aolRab3cuTifosZVBbp2yneG/SiAOvZEO52tLWahEHyONu+Sd6Bnuc\nLpTSop0D+L0W2RTae/dRhXOVLcP4N2yymYS0S+8W4cCcjpD18rxGFHL8ZmmF\nBPZAvNecsFrJghXj/iUVP3zGKCjZcrWYYPGAjocu7USdS93ITtNEUdH5j7AY\nkR/0hyAPn34KdkMx9Jyf30YHKJnGT7f+VXjZWaswCt+HV26ry21+9WfNlCrY\nocOmfDF1C8CJWfi/WyGBDdhEZLciKfw0vN5lJa9hX6fEMlR5WDorWgB8l8g5\ntv8eWm7DRI5ee+2nVpwK5d9q/MuqYg7v6pwnxeV2NBaaRTHMHEQLf9LYiJ5B\nqo7IEGdr1NkujU1iuJdX/5DfJHIGGUzqhABqlUl06NW9i245kb58mwuRwjLI\n2BnNum5f4E7OXBW/NzRbdap9zKSRj3l0LprPDCV7vBl5U7zqFIsAIa6PDgk9\nNN+QjTrRbg1spXUpLezbRcl2czNoI648LRJZ/VhhlH4P6bw+45cv+30FLGUQ\nG46w\r\n=Uho4\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"d1f704610766e7d0c46b8a40beb1848121809a41","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.b0579acdb.0","@material/rtl":"12.0.0-canary.b0579acdb.0","@material/base":"12.0.0-canary.b0579acdb.0","@material/theme":"12.0.0-canary.b0579acdb.0","@material/ripple":"12.0.0-canary.b0579acdb.0","@material/animation":"12.0.0-canary.b0579acdb.0","@material/elevation":"12.0.0-canary.b0579acdb.0","@material/typography":"12.0.0-canary.b0579acdb.0","@material/feature-targeting":"12.0.0-canary.b0579acdb.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_12.0.0-canary.b0579acdb.0_1619512601067_0.76750824924501","host":"s3://npm-registry-packages"}},"12.0.0-canary.81e2d4ff3.0":{"name":"@material/slider","version":"12.0.0-canary.81e2d4ff3.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@12.0.0-canary.81e2d4ff3.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"8261222900bcef99352eca88e6c13d7e32f97846","tarball":"https://registry.npmjs.org/@material/slider/-/slider-12.0.0-canary.81e2d4ff3.0.tgz","fileCount":38,"integrity":"sha512-CF6zrcckxhbI2RVjCuHFSuPQH0+M3pCdgeRZGSZEMpydqLo1At6lEzLcHEDzNTCbIw4m5xJFNHz0r/0SQGf97Q==","signatures":[{"sig":"MEYCIQDyzSGr7IfrLeYuxxAbHpho6HByno4PtnGYKLCnw5pCKwIhAIlzReUVYLsh2kT3i4YQUaLmQ87Tbl8DVtXQkkvKtelm","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":832811,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgiHrXCRA9TVsSAnZWagAAkx8QAJn5+z5OM8feKkC3UiF2\noPYR8Xr9iQCJiysiqcOdxxNQxlzH6B7ZXiWdJjT8p8rdB9Sf49QbTVe/hWLe\neDxgKqvjYz9n1HIMEQtJERBzzfe9Cpkpv4FauvLztOlvDM+5TNHv6U1G2GZN\nnxlNZDwDpWGAwUkeXLcxRXXcf/+g4VHneCnG5T39L80yt9fdQjA8aQyZDTd9\ncFelhJyNUJ1anBIGKsxag2Ve/K1Fa4LihjMDZ9a8sTohhRvb4or955gA+IXm\nYmRVb0HNE2ci9yE8Y+XHu03XM4WeiX06fyJUp0e0GhJFlEuqMpNNpzkmf1g2\n7y+Bo4vff9GqB6wZg189dV2I69Hq7v22hER7HfpH5I4jsooFmS4lP/S63tDZ\n1sNfSrYDa36a2IXKkw5OoZM+ug7aMHs901u6bnDAp53TmUln0EnwebJzqXd9\nRWu/RauD607TNupbcbP3cFA5RG/H6Ojb/UlNz6ix3So9QMGoE/icXm1W775k\nF5xBki4OeCLw6nBkTuKQvZYSK1QnaNMveZi/laJXGg7e1AQ4gF3CRSkABHwF\nqYaadD86XO4FismaDqIgBZ5VpTu8gfXBgVBojfaCbwK7cfKZ5ZrXplBwhEMN\nzXlp8CfA3bAiDmUL6soksW3BfoW5BRuPJLCDc1hfOhgtbqDZHqrf6v4fHJdw\n5Cse\r\n=mpvW\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"f55512ab74610e3f3cd0db70822ad9b52b9cfefa","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.81e2d4ff3.0","@material/rtl":"12.0.0-canary.81e2d4ff3.0","@material/base":"12.0.0-canary.81e2d4ff3.0","@material/theme":"12.0.0-canary.81e2d4ff3.0","@material/ripple":"12.0.0-canary.81e2d4ff3.0","@material/animation":"12.0.0-canary.81e2d4ff3.0","@material/elevation":"12.0.0-canary.81e2d4ff3.0","@material/typography":"12.0.0-canary.81e2d4ff3.0","@material/feature-targeting":"12.0.0-canary.81e2d4ff3.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_12.0.0-canary.81e2d4ff3.0_1619557078534_0.8602900924595207","host":"s3://npm-registry-packages"}},"12.0.0-canary.c8edee52c.0":{"name":"@material/slider","version":"12.0.0-canary.c8edee52c.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@12.0.0-canary.c8edee52c.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"75fe16dd29b88acef1ed3527fe5f94b910f648f0","tarball":"https://registry.npmjs.org/@material/slider/-/slider-12.0.0-canary.c8edee52c.0.tgz","fileCount":38,"integrity":"sha512-Kx4kwqVIqQl+fXRGQQiBeV+a+oMUNbIIYHOvtAffaPyopxXVuaGZFmrf9NWbP1wwl/iU/0z8DOOdJ/KXJ5kFsA==","signatures":[{"sig":"MEQCIH/Mou6+dXqH6ldkvQ3vzYks85ZPyfizzNS+9VHTzDsdAiBPPgeYYv5IqAaNS1LvDW2+d0JbFEUUs9tkYElhmSWACw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":832811,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgiIYwCRA9TVsSAnZWagAAtuUP/1fmhJzyaZqpj8oDf+Nx\n47RXijhzqVGTqtXtqDrFJJEvKvnh0UEADzFctbP7i/4fTXEibjeSwlkHYVFR\nVqNLFTAQ2hyIDmtKuZmKh15DOxvNZsnAMdoE2GW3XBws4wSWSH0NZyLfydsa\nQgiQsAapWC7QWogCMr1bSJRyKthZIJsHTb4f1zNSXLOJMumVkPH3yzmHWmDp\nkyUB4WXNDwEvDIfpXjikGftnmXcfHjcICuyDQwkWP3Qv1T2JYEvs/b0XP2ti\nPMjk6HJJbTIRJIwetvVSuQe9bkfWl/fvXiH7OMchPqkOfiDDAhalspMudqQz\nTlsJpsDnPqBfILNRT2w7w1tAMmynGz+RiKjDhbSFIEgFHo3S+5ijr8N0ZLjN\nzjmu6qZZgFCe4QhqUMGmVaduEYFu47WxWd0ej3t/MpzB3eQoUYQqh25ZwNmy\nO8Sm+MKwZz2sSykIAJSppagE0aa2uU1pDKtu1+pKyTUJA6Vb0BM5DHz7+rSZ\nqLBpSG4kqwFyAhgq5+/i10iFKnkywQwUP0cI+falzGj4Zy3DYtxALCWluGv7\nS3wvfxbHi9hA1CsDLpmtqsZt/GtEOoVw6PoMeEmE0fR3rcH9IlB9Y8IoGBMa\nVHX9tNRULyD7N8qCZEKgfwimpHjv8R02NKMdogFqy7kq9UXgVXceEMVCub2V\nBuh+\r\n=bJhj\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"e8c7902721c81225e1c8b750094cbe6ac4666a0a","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.c8edee52c.0","@material/rtl":"12.0.0-canary.c8edee52c.0","@material/base":"12.0.0-canary.c8edee52c.0","@material/theme":"12.0.0-canary.c8edee52c.0","@material/ripple":"12.0.0-canary.c8edee52c.0","@material/animation":"12.0.0-canary.c8edee52c.0","@material/elevation":"12.0.0-canary.c8edee52c.0","@material/typography":"12.0.0-canary.c8edee52c.0","@material/feature-targeting":"12.0.0-canary.c8edee52c.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_12.0.0-canary.c8edee52c.0_1619559983724_0.24939601115619214","host":"s3://npm-registry-packages"}},"12.0.0-canary.f5b6110d6.0":{"name":"@material/slider","version":"12.0.0-canary.f5b6110d6.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@12.0.0-canary.f5b6110d6.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"39372a00c81c5b956b3f7308a97c7116b4931968","tarball":"https://registry.npmjs.org/@material/slider/-/slider-12.0.0-canary.f5b6110d6.0.tgz","fileCount":38,"integrity":"sha512-Iy4HxkMu9/f5rCNikFuzOgnOBMsBqjMNwC64+JL12BluhUXMHgrid9B/gdAklZoDR15kgp2lDLbNNTBf14viUQ==","signatures":[{"sig":"MEUCIBskzVfRGiktbZq7Kpm9IpfVreWVCCEZDqjIPHj8iwEKAiEAxWXY7Hlup9/mAo+xvi3vvSek231GDTQCscyWQbz7BIY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":833271,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgiIsxCRA9TVsSAnZWagAAnyoP/j2x+PjU1efNObqR+USB\nJZhJhFC1xiEb1R5+1d2cpVZOxPh8izmuDCgVAgd0L5+uy6KlhAl29csd8FlB\nIRAU+UB6wPEGJpJD8okCnlOaLOzeuUXW5of51nal3jARZjTCmOC6QbGloqCt\nOsDK5lmbQrEILK8tB214o6Cz6LDCL5aM6XgmKVE8fp+XTfJ8Gao1PpcMUi1d\nehDwrqUHUZELPZzI3NxExG/gNSAePOUcBP3pGQXg7TikGvsPRfrCVCBRmCeo\nuvKO/n7to9TrLkBaFmNBHqqdi9K1vqRiTQ8M73CyBXgQrANJx4LFVX1h0Zop\nC8A8q5XuDnNMTZzFOOAOP2lAVTgwvMnTZha1SLcea95j4G7qYe56bptGg4Ph\nmecBoQjENFzJYMkCEUMLLHG6MoR5NC6h6ckxxwJDcd0ZO2PdNcU31F1nV7/S\nZKs1MDrjkUcD0N03w0uofcE0mkyPbsKb92dqcGzN2qMn4MmqVCyhmSMMCyGE\niZ3wKRTdOcpljr3jxN67y+kTpvzVBOBjB318rnPZrRvdbOdO8B3xNFyBu6OP\n54rVSHpZCRwaC9FjZD5rJRbjirVX1ZDiDoAeH6w7jVAo7EUjNiREKDUlhoVs\negXRPZygZpwX18C0ruvjHa2VptyNA7QmLBDlZm/YCYksBaLa+8Xx1zgmvpTm\nWZTu\r\n=Yx/W\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"c7be6486c9ad6826105a70187add5afee2a6b50a","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.f5b6110d6.0","@material/rtl":"12.0.0-canary.f5b6110d6.0","@material/base":"12.0.0-canary.f5b6110d6.0","@material/theme":"12.0.0-canary.f5b6110d6.0","@material/ripple":"12.0.0-canary.f5b6110d6.0","@material/animation":"12.0.0-canary.f5b6110d6.0","@material/elevation":"12.0.0-canary.f5b6110d6.0","@material/typography":"12.0.0-canary.f5b6110d6.0","@material/feature-targeting":"12.0.0-canary.f5b6110d6.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_12.0.0-canary.f5b6110d6.0_1619561265431_0.7903088489301413","host":"s3://npm-registry-packages"}},"12.0.0-canary.cee9b9e22.0":{"name":"@material/slider","version":"12.0.0-canary.cee9b9e22.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@12.0.0-canary.cee9b9e22.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"50b9d047ef1cf254a50864a33d97c1ce0e6a84cb","tarball":"https://registry.npmjs.org/@material/slider/-/slider-12.0.0-canary.cee9b9e22.0.tgz","fileCount":38,"integrity":"sha512-vxftfMGfO5oRhKHGlZKN8lmSHO++93gDnE4mRi5/NUwBSPUf4gzYPZFnwC8Eo4EGpYlFMoUXLXWN3Vuq+S5gbA==","signatures":[{"sig":"MEUCIQCluYav7IBOFupuXieCYEi2IZeYcHp9OywL4+5fiddiNQIgCUmEjEq6XHXsoL1eqEUSCFT5J5LIHcJ01GtjrklEsYY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":833271,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgiKiZCRA9TVsSAnZWagAAs74QAIovr7R1uSu0qVIoNHcc\nmG1w8D1HAkFS1MXnEsJWgEx3BF4yUQPMYMxb/c7TNQ0IUBzNfNyhsD5SItLJ\n+/m+BfcyLUozknPakj+tqa0mk/DDFujgI6sBxRbg1PeCVJQsY2dD0S1NbPFk\nYXs5vxzwI0Y8U0pzBbjBs/xHsdlyLmLhONG2sEO4SvzXMDsDRHclHVN3V3Ms\n/QgVJAp4XN5rdwgzbRs4OeWoOzIKBHIoihIr4HZxC9BHU3ntgMz8jn7Dn6qi\ndL7xp3AYp5nfyvMlLdMeq2dmRZIJN+P9g0pW+Rm10HqSTIQ2DYtuL1cblTSV\nJTqerD61ui38pho+ouugNHb2cLwT0eMqoJAWCoU2Qr5n6EhW2LJbq5Ps1VMg\nrxHswnHD3JCXjBwXZhTmvewkLvgYuF6bgMiX9p2zTBMaURlninlNpMr4Jk8+\nVOIIxqHI4c+WyfULeF7bveTXj6pZp+fLNFEZSf6M/8pCPU/54xmrtfFiPb8a\nC9mzfi53fLhoMsTvat2ssIkxnKLhV1n2Z/3ZdEFZaURUG0Ucs4HYqzYQanC5\nkH7KRlKvtDW5LDWwU/srnxNhOAGYufx46m7dKafkd2xg7ub6eOSUHfUaJlqf\njP8KX2sTHfbt+Cxxf8Rc64ewGcy3gfOH2ssGxMCUF17Q/XxLPy+itFE14ZwE\nVqYC\r\n=rWqK\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"b0c779970f0809be4565910c1abadeed4dab0377","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.cee9b9e22.0","@material/rtl":"12.0.0-canary.cee9b9e22.0","@material/base":"12.0.0-canary.cee9b9e22.0","@material/theme":"12.0.0-canary.cee9b9e22.0","@material/ripple":"12.0.0-canary.cee9b9e22.0","@material/animation":"12.0.0-canary.cee9b9e22.0","@material/elevation":"12.0.0-canary.cee9b9e22.0","@material/typography":"12.0.0-canary.cee9b9e22.0","@material/feature-targeting":"12.0.0-canary.cee9b9e22.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_12.0.0-canary.cee9b9e22.0_1619568792528_0.928259682936039","host":"s3://npm-registry-packages"}},"12.0.0-canary.96e83fca7.0":{"name":"@material/slider","version":"12.0.0-canary.96e83fca7.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@12.0.0-canary.96e83fca7.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"48b0aa5e470357430c45742a3421e5430b926bc7","tarball":"https://registry.npmjs.org/@material/slider/-/slider-12.0.0-canary.96e83fca7.0.tgz","fileCount":38,"integrity":"sha512-CNsF0WnOggk9a3P0CvH9DhDj2glAEf7tPtB7IU23k0saa8EVJB51yAd74NdakXc282Khn+/u7nzlFgVpZW6a8w==","signatures":[{"sig":"MEQCIEMoq+f3skuJq9d1rd7wmuW2j+G1YoomW8uuvtPY3fFzAiAzer01hn0jqE67SyMMRUorOCTtH0GYhZLrAZb+lmFf3w==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":833271,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgiMzrCRA9TVsSAnZWagAAb80P/0P5Ewyir3XXdM8F7oLM\ny5E3t7ouXa5JjjuSq7EYFwZMlq4fK2dht1Q+vyobDow1uY/JYRtacEu2ru/i\nChjQ1Y391oaBxrYSi23ZqZ8LwtwI2GcuF3ZTR1XZ1Rt6x+6Lc02XX5PnIfKv\nAjG19hwBIS5ExOF8tSir68L0pwjkc0hU/zTwCDbe2e4exUQR8xFC0RGDZwFF\nZ2wK6QWnV58p2jIDbpcr1wjngpelmOixzpYPrLn6FKt8C+2llEpFrpquHvAb\nMrYM9xO2oANOqEhpWvHaydxLQXtM9DRPhndr3z0yqJIc+0ACrHEoXXXKpll8\nLPxWU1tdKcIWJ4npi/TtN/lKJAqz0YmvkBQFdY0h+mgTStis1cLPqDm3Aw1o\nGNdrUY/ZvihVR7QX/HQaQHl2c88aF0WvyzOfg8gHuPdNvtg1QfpYJqu03AOU\nY7rRVWD4C619wvwVf6NMJ56NbUxwMAfTXcC+ovJRw50z/DM69sBM6YsP+Ga9\nFYH1KbjvsKzZsHQYDukL59ZyO9hm2YGNjGqPYS8vNllHqOA411Sy8kV30k+P\nTFJI2Zy2i3YZlM4z+//lQEJDGF/RAqzvILmhQxXSocARPU02aWdADYWLXSqh\nB7mPm0QwF4xSKd1yDoI020es66aJ4U7l02A7p/xiEjm7i+GesiT207zDApu9\nRJaQ\r\n=ye7e\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"377f0025088676d544c1393884e5f27e96143f16","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.96e83fca7.0","@material/rtl":"12.0.0-canary.96e83fca7.0","@material/base":"12.0.0-canary.96e83fca7.0","@material/theme":"12.0.0-canary.96e83fca7.0","@material/ripple":"12.0.0-canary.96e83fca7.0","@material/animation":"12.0.0-canary.96e83fca7.0","@material/elevation":"12.0.0-canary.96e83fca7.0","@material/typography":"12.0.0-canary.96e83fca7.0","@material/feature-targeting":"12.0.0-canary.96e83fca7.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_12.0.0-canary.96e83fca7.0_1619578090759_0.08121068330307457","host":"s3://npm-registry-packages"}},"12.0.0-canary.4c497bd19.0":{"name":"@material/slider","version":"12.0.0-canary.4c497bd19.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@12.0.0-canary.4c497bd19.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"cab0ccd1ad8dd2a226e597bcd0c50155a607a0bb","tarball":"https://registry.npmjs.org/@material/slider/-/slider-12.0.0-canary.4c497bd19.0.tgz","fileCount":38,"integrity":"sha512-isrrrTrbn1sOGyNoRFqx5CpypPErPeEWildNBhhJQqamKHZUoFBOcwacjX1Wx2Vwf24iCIhWWhadoUFLl1G82w==","signatures":[{"sig":"MEQCIDyHcx8TIt2+CijzAHam53b1QeKSptS3J0iQAPCHIPF/AiBfqcFi4882/KA2LteyrdxfqNhLR2en1oAPG4LadoDjcA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":833271,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgiaEvCRA9TVsSAnZWagAAYygP/1AvLf+IZudee10yICE9\nG/EskK9UquRcC4lVaDdTImsYKPj13Q2xf9gvW8Vnlwm1Y+JYc5t14UTp6j4v\nwenr35lGYjJLjA5gVAclFukkNDomfZ6KfT/9BiXlINOW7uAFd2vVdcbnN21G\nB80MbvNjzc1DkABUQAV6p/wqiGf/woBA95uQnB84Le0+9eT+E9vU8lJxCbRP\n0SJRVsmIhsrz115FM0fR27ht4rclTqHFpQvvvjWxxAj0wbRxj4xO6R/J2KC/\n4fjvPH9JzfR28P02dAntC3XB61Qw55pGLrMLvS6RykJvgjeVFCB4y+M4BR96\nQvGBzVTpuQMOx06KH1ZCeHcHD8jVxBucwnqj4BSR/1eKTNdWAck0CmUGCYyy\nik/qVzRPdGjI0MyogOLsM72g+wWPS4yQVfaXL1574qiWP5CCvubgOfDcsQS3\nC0IUzq8+il6dSMLKoUEmqpI6vofSeZP0+7imPTHPTExmBZyBmSlN2SFch+CV\n4B1JFZ1VNJgCxBm34laAh+eLlssZnxlYbngf66zAG4Bpy2CThFIqPjvdBbMu\n3Ajo2rbVOD5zKjdpAEU5fjSBb2IaNwGaniWR8HulhW93iXl2v4DCw95L1iH+\nIo3cKlckSmnxmMiioFe/YxDksKWAMI+3Hl5kVhir+e9yOkfMdblzyc1OjoaQ\nx9+N\r\n=+iQN\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"beb4a14c8f43815a21024c26a96e3c53851a9b41","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.4c497bd19.0","@material/rtl":"12.0.0-canary.4c497bd19.0","@material/base":"12.0.0-canary.4c497bd19.0","@material/theme":"12.0.0-canary.4c497bd19.0","@material/ripple":"12.0.0-canary.4c497bd19.0","@material/animation":"12.0.0-canary.4c497bd19.0","@material/elevation":"12.0.0-canary.4c497bd19.0","@material/typography":"12.0.0-canary.4c497bd19.0","@material/feature-targeting":"12.0.0-canary.4c497bd19.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_12.0.0-canary.4c497bd19.0_1619632430965_0.7619186035728303","host":"s3://npm-registry-packages"}},"12.0.0-canary.105b15b96.0":{"name":"@material/slider","version":"12.0.0-canary.105b15b96.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@12.0.0-canary.105b15b96.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"3ec6811a4a1a668405e2142ba1f316e13e297b0d","tarball":"https://registry.npmjs.org/@material/slider/-/slider-12.0.0-canary.105b15b96.0.tgz","fileCount":38,"integrity":"sha512-dVt4+Blv+17DyZcDySgtINvZKqvYezUR9h2NgU1xjNnHqOryVldGu+pQL8gD1zO+q6An9Fpg1iV/rsOgJhFRFQ==","signatures":[{"sig":"MEQCIE6TnjWR9rY8WmYK+Ug03g+CFrrzrcU3q1dyYjZ4ZYZqAiA1NDnF1cCCUwRdpfjYNGlavFD6fYLGjiFO4oDNA7EwOA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":833271,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgiddiCRA9TVsSAnZWagAAt1wQAIAxdyoX/w2zJ7J8jbDV\nRZaylOaKgJnWbZ2n8HlkQotA/CMmqRdW4q0ZMlzef3QmghgeDI8s8fkUj4Z9\nD6KbvDGY3Njjoe7RYfyS44oE4i0SvX8YE1BwPXuG9qaT9t2Mkw0YA06aWbyT\n/82nxNgOe8FSNzx4zgFVGbBC6TJRzF6eQw2dCeNFpES0TZsXdkXjihPr/xni\n/nItVaqzCt2FO3RS0yaW/V0xmAL+R1IeCQxV6XYBw1RTLk/gRDqrXNZLnJeW\n5tIwbcFx9SysfmX8oL17ei6r5gqJcBAh3vTB5pPw1JxBFyGCMzBj+RGix+d1\ntYiwIhh53kwP0aTE8Jz67Ravz+wBczrjynCeFnOT5/udrZQ1Q7rEdP4jkMF4\necEQwQO3nZOJGh3Jq+EJZu831+P/DX35L39gQBSW9Vhhci0gDD9v50XF4254\nLLLc6z0y/EagV9Oyk8TAAhNHxdBdxuy978Bwx17fEfx3tN8CI5vp/7NaLcff\n6/EmOehnWNty4n5B1HZxbeLaYrYG2wcJ9iRiH1VJmcAnLFRsY7MVDBtBe+N3\nKVqmawsv6FEpyLQJROi41CUhlEysuPqZ/3fssqa5YZNnxDu+g8VUchdMl5qF\nJkcXl1wrqz8EV7ei58OjKhCFuDPwUN3h7xJljfP5pS2UzRNH5ykj0SgajGXy\nI0ET\r\n=KGJR\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"762e9351a26c1968c772104d6d64f7874c81528b","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.105b15b96.0","@material/rtl":"12.0.0-canary.105b15b96.0","@material/base":"12.0.0-canary.105b15b96.0","@material/theme":"12.0.0-canary.105b15b96.0","@material/ripple":"12.0.0-canary.105b15b96.0","@material/animation":"12.0.0-canary.105b15b96.0","@material/elevation":"12.0.0-canary.105b15b96.0","@material/typography":"12.0.0-canary.105b15b96.0","@material/feature-targeting":"12.0.0-canary.105b15b96.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_12.0.0-canary.105b15b96.0_1619646306153_0.8257382672571776","host":"s3://npm-registry-packages"}},"12.0.0-canary.6e20259e3.0":{"name":"@material/slider","version":"12.0.0-canary.6e20259e3.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@12.0.0-canary.6e20259e3.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"37c0f9725a4a3a210ad63cac15c76e10ceccea40","tarball":"https://registry.npmjs.org/@material/slider/-/slider-12.0.0-canary.6e20259e3.0.tgz","fileCount":38,"integrity":"sha512-FLewMpi8dIsR+y4OIX3tsc9eaA/uFaQQrsnGnXisJzhLQq5hlFR68Z1n0IiewQk+vWWBqWzVzyMsCU7ewrabdw==","signatures":[{"sig":"MEUCIEMfMkPLRQLK6fTyh3SLVjSHCXgb7irBrJsqs3nFlzRjAiEA8D09HPBRdy7yRXk9M3vKRtBUzJlOA4trxNg6AIoWbeA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":833271,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgidhtCRA9TVsSAnZWagAAPCwP/Rm8t4Kl3t05mSNa9Ms7\nDTPmXIPEmffeXWzE40MMQzgJkTd+hWVPCZYemYOdtD8I9egUDFylM/RNkl2+\n4CEQeC3sA8npnLhUBO+xgybYDs4u5nmsEziPXpH9cOcFe/RPBnjWzf80WbdO\nDNGySXuQ6GvX4dE2L5s2I62oDMfCv2iWVPrHrbq4crFBhC6KWjqYXVka9Al4\n+31HPZKkc4FzKU/HWvySmkSwGkTEyB/PfstM8aD8poBbw7Hq33hC/vNlOLUR\nO5wm3WhDln8Yfw8jEkPLShRSEyjd/Okb73sgj5/dgqUiqrUjOPhc+I0V+uzW\nOWlR3aV74k90qaLvyQk75SRKeEn1VW7Nwwfw+ieI372XsDxXT7Kf8HHjFXx8\n07aQ8Hf42GC/UymhWWKQ8kZnrJmx/0v5uN+FN8EfTzbK/REOQx+GMkL/4KSs\nc6hi6IYl1wj+J+u6ikM59Gugo1gzLMAJQ1R8ZsZhfxu0xLfIFsGzirFJ3TWO\nZKz9lL/zDBpivClpMI8OBk1E9NOF7HJva5qKjDGGF4C6bU3UC7DEd2+N202/\ny+y2V74liggv1mazwupL7dJbdMkjtLGMxdZyY1idJfkB+OTFWEthV77rUVsw\nmyqZ9A8gDvH4qJu354Kj6Io3ffycrJpqA7S+QQjacSWXhL+2Mlk8K3e8d3aE\ndsAa\r\n=ebxj\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"8e07864b42f463f977fbd0f9264b8930da72711f","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.6e20259e3.0","@material/rtl":"12.0.0-canary.6e20259e3.0","@material/base":"12.0.0-canary.6e20259e3.0","@material/theme":"12.0.0-canary.6e20259e3.0","@material/ripple":"12.0.0-canary.6e20259e3.0","@material/animation":"12.0.0-canary.6e20259e3.0","@material/elevation":"12.0.0-canary.6e20259e3.0","@material/typography":"12.0.0-canary.6e20259e3.0","@material/feature-targeting":"12.0.0-canary.6e20259e3.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_12.0.0-canary.6e20259e3.0_1619646572343_0.6935751693076977","host":"s3://npm-registry-packages"}},"12.0.0-canary.0f79a5d74.0":{"name":"@material/slider","version":"12.0.0-canary.0f79a5d74.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@12.0.0-canary.0f79a5d74.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"45bebccb7d8725e868b7f5017c556b8f5c184fb9","tarball":"https://registry.npmjs.org/@material/slider/-/slider-12.0.0-canary.0f79a5d74.0.tgz","fileCount":38,"integrity":"sha512-3Ec23aNkuRp3bKYh/qTb3xPW+qFFB2wHRHupf6DqYzUyZ6g1/51HTN7+QYtrC956UUR52hM3u/kMIMNQ+lVSPA==","signatures":[{"sig":"MEYCIQCJ+cVZ86uFx5iAlyEGH7M4DOdZzjtNkSM+POw1U1GyvwIhAM6mht6TYY3SjDZdGetPqCDQ6bPMoq555CxPQui2EY8N","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":837192,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgieUFCRA9TVsSAnZWagAAlpIP/i8QzIe5TEs+VhclTOnA\n2JRae60cL/b46+d3vHCMZ3D0XH9MYAQfLNpeFXFK7JkxmcvI5r7UFzkC+O4Z\nsHifNsFETRqWmcnD4IlVi4fkXZoxbpnMTKRZDkJTA827UaxAcMjXjRoDtHoj\nh8+DYQwrLTYEA2ANtVPq8D5RmUg/GGUOj/RjYqYKB5TLwagcUvozfOG9CRea\nOHF/s1Ifn6IKVf4Wrota77SURuqN4xLlok8SNfPrhVdMb4g0uZRTmUJQYAK/\nRkCYmoIojExeYSJb+eNNM2/ts8LjP+jnTJoOrFoMSpGI5oiwKnIhe2bxVVj2\nl12tUSMBq+WW0CEM7c0itsr8juT5u4TA9zxVuEXf0ESbmL/jBcS8bx5XjU2U\nuktdhMWWbeN2J2aMhd/JT9WThlSFZfmaqvzEYKOYl7tCrpP3L0HCiRRp7Ko+\nIXr8tsSk9AhShospz6jBWhxOc5O8VgytAG3pnCv9hIw3DACRxCOdSUI4tXBh\ncyLuwd2vJqruN8VX/5OC1iOWZEPf21jW+3r2nKVPeK+6FYk0Pt2tmQxbSN5A\n+THtzHJdtIik0qt9CtPbe6NMzVwVRZDAg/UHQmpXz+kwybGNQXFiXtfwD9GC\nC9xrs6l9hQVrrVdaYI8u7KXf3AtwMzuu9GN+v62mj0B7GL4ppNP9iSb9EVyK\naUyH\r\n=YcX6\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"2fcb990c07fcc62dc025eb258f87a8f04f08fee5","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.0f79a5d74.0","@material/rtl":"12.0.0-canary.0f79a5d74.0","@material/base":"12.0.0-canary.0f79a5d74.0","@material/theme":"12.0.0-canary.0f79a5d74.0","@material/ripple":"12.0.0-canary.0f79a5d74.0","@material/animation":"12.0.0-canary.0f79a5d74.0","@material/elevation":"12.0.0-canary.0f79a5d74.0","@material/typography":"12.0.0-canary.0f79a5d74.0","@material/feature-targeting":"12.0.0-canary.0f79a5d74.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_12.0.0-canary.0f79a5d74.0_1619649796750_0.12349456899877498","host":"s3://npm-registry-packages"}},"12.0.0-canary.84f3db9ed.0":{"name":"@material/slider","version":"12.0.0-canary.84f3db9ed.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@12.0.0-canary.84f3db9ed.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"25c0ad3e0ca56d3637511dd3037a0f08a97cf45e","tarball":"https://registry.npmjs.org/@material/slider/-/slider-12.0.0-canary.84f3db9ed.0.tgz","fileCount":38,"integrity":"sha512-yjQyhv6YLiLgPUsLMkI6ShmuhSIHnoS2kalwEUph/q2/vbzBGrkEdjxUE+0y1yY6WwQsVDBNqhhloxN4zsPMpg==","signatures":[{"sig":"MEYCIQCLPFu+hm/oQn+VElsmjw2wt0kC3RFBrxyvaIeIl5gtFgIhAJtGkDSDtNlVAbj1tqxNtTNZY2Pw8rAAHO1QN/Q9vxAx","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":837192,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgisArCRA9TVsSAnZWagAA8y0QAJB6z9R/W8iLui/wemPI\nL0cMI/W0U9PZ82YNdzycmQoYpPal/b0BPlobzhjmIsWXrBZ+F/v1Fl4mL9ob\nAblsrGuAUkQLv6dUIeX4lLcH6pVcL23CNL1ouqkyq67PeCWByR0Flbj0yUCJ\ngdWbtPQ3/1F0nnDCdQCfeIiD3KBghMtq32mD2pKtpbHZzrbRb648D0icPD06\ndZYGU6+hAvZK+wcLy7PgdYRLqcalcWCu+yevpx9kWxeDM//FWB+6BYSPw35j\nk32K0yaixXCCXnNFcmf3RsANi9X/qgfxImr2nzNVNY9wqhGhR6skV76suGcY\nU5OfgMBfQYVt56C5qkYB4xWeWNgr7Dzfl1sBf0j3z7Z6lE+nzoKcqqiH8vTz\n9aMS9GudWEfufzj/nYO6y/vYD0LHOeDx+tprhO8HkfJnRd2aczIaS8EbULFO\noxXw3EE0R58xO2LkYKile7mfa1DZPy5e37Y7Gzy5ic4lT9q2qwNJ0zmXhE1a\nU4dxFabokSGhRuoUy0tPMgqRCVbsmpy8ba4YuRa7iwdUHNXxCA/xj16wHa+d\nAa94CiQIp4zmjHg3pwKppInc22GSzlOanND7aSD4VBun6rucZDK3v2tL63ls\n8Ba3qJIU2Hm9cQw+E4eaTySoXzRB8vslJTzMuqu/A45KwfJvk1mD90e/yrfo\n63F9\r\n=iLBM\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"7c4b7e41edc7737412479194451432cfd33839b4","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.84f3db9ed.0","@material/rtl":"12.0.0-canary.84f3db9ed.0","@material/base":"12.0.0-canary.84f3db9ed.0","@material/theme":"12.0.0-canary.84f3db9ed.0","@material/ripple":"12.0.0-canary.84f3db9ed.0","@material/animation":"12.0.0-canary.84f3db9ed.0","@material/elevation":"12.0.0-canary.84f3db9ed.0","@material/typography":"12.0.0-canary.84f3db9ed.0","@material/feature-targeting":"12.0.0-canary.84f3db9ed.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_12.0.0-canary.84f3db9ed.0_1619705898548_0.9619289011235845","host":"s3://npm-registry-packages"}},"12.0.0-canary.8fc29273c.0":{"name":"@material/slider","version":"12.0.0-canary.8fc29273c.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@12.0.0-canary.8fc29273c.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"474623dc4b44a27412c7add08dd68e224d568920","tarball":"https://registry.npmjs.org/@material/slider/-/slider-12.0.0-canary.8fc29273c.0.tgz","fileCount":38,"integrity":"sha512-wx7qMR6t/obGsWD4B2XsmlgKGXbyecdfxA2hZnhBguzYTZ4WV3BUCvjZswnJ/pvANjkFdg8ZuH/gQvcUxbC9MQ==","signatures":[{"sig":"MEUCIGj8iZPdzZb+b2TCASZILqE48NLy2Hgkn55sVSSMxeBNAiEA0VspoGH8si8CgavsiO4pb8ZVf/3XaKiJmlfrMM1A0/o=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":837192,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgiyPzCRA9TVsSAnZWagAADEIP/2NrG81ne1nspJnnQr7M\nnfV4cOHk0In6FL4K8Y7SPvZboWJVPzR4GECLEi9wFDRcYS3rcq5JkrX/z9Lv\nojajBXNrp1h2SU7rikaX5bZ6Z9L+pPfqaGnObA/Nq0ezK3ZUYpK3b1CCKJdH\nlNCBsRVQ5w0QUdYo+TLyrxMe0iTeJRtfban0eD9UpmuzwyQYzU/lO1l8CIB1\nCDd30esrwatNxBEV/186fUKg+cf+b6PmuIPdlsUDkqPFWtQ8uH6l58+ttN6T\nz57xBuzu/cBsUqQ1jZX1/20zNaJmmuoRfwnAvWJ2RN7FyUDygZSRhsp5eAXg\n4FJJttCz2es+PRWIWoj0NhYZR+loYEq9Rt3c3ckVN6YpU5NMFZJ6f97gV/6I\nb++HyG7vgZeTFaniCJMri+35nfFVP6fCfVfUoqxvLi2GTMFvDvVyRw8XUWPU\nvgfq0AH45rESnDP+tU37EyA/HrrECuq8/IbTfen2G0lCJV+HEhXi4aSmDg+z\nJTnoI7HNB4aPnX5EJE9LtUNv7LmBi7GgQuRmfoCYG0vStimPrzxNMH3/xuKW\n/xFmlojCm8DLmuLT+c+mcRlAUAV5opE3Og9N6QF593uGwG/sv1XHuYjCbciI\nibyB1ZTer1ip69JtEtuEg0RIq8OxWJ4BHUmvqPKv11XC1cRidEzIhJ8JW69+\nNcMA\r\n=d+nh\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"fd877c3e50788fb95663fb8213bcd66f347cdd0e","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.8fc29273c.0","@material/rtl":"12.0.0-canary.8fc29273c.0","@material/base":"12.0.0-canary.8fc29273c.0","@material/theme":"12.0.0-canary.8fc29273c.0","@material/ripple":"12.0.0-canary.8fc29273c.0","@material/animation":"12.0.0-canary.8fc29273c.0","@material/elevation":"12.0.0-canary.8fc29273c.0","@material/typography":"12.0.0-canary.8fc29273c.0","@material/feature-targeting":"12.0.0-canary.8fc29273c.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_12.0.0-canary.8fc29273c.0_1619731443033_0.3696742715877681","host":"s3://npm-registry-packages"}},"12.0.0-canary.c50d20bab.0":{"name":"@material/slider","version":"12.0.0-canary.c50d20bab.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@12.0.0-canary.c50d20bab.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"1d9694cc48ea821ce244232e5f114c80c9d34c58","tarball":"https://registry.npmjs.org/@material/slider/-/slider-12.0.0-canary.c50d20bab.0.tgz","fileCount":38,"integrity":"sha512-as51+6TsHKHhf5obM5nm2qcWVFdn8JoNV0IjDdhMLJcAageLzcAz85yAZPkrpV/ho+oWTFni6ns8ppvmann7uw==","signatures":[{"sig":"MEYCIQDWK4+dDzIGfAgKl+KrSyvWEiFtV2cJxEwjeAdTnLHvJAIhAPCyo5JKQ1OCi1zG8CgqHWjtIDtNAFwXWJFJPLNgnZOi","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":837627,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgizr4CRA9TVsSAnZWagAABzYP/R00U/WYkV75iWR1r6Gv\nbu0TJsk26wzEIekNL0CtXFA+KZdxmC1QjMVOUDqMCxiztyk08K5vE2lSTsve\nbINeZvk0h83EYNYHUV0h7IM1GdERuejplJ8lXQ9tkkJvaK2xXyggut/xHS0X\nE/lhx9sVR8f/lsbw/PLdlqhLhRC97Wk5pu2W4wJXpMHAPydCaiZBkoHUuLQ3\nj5HI1DUjiXdrFvORLxERtVN92poHi1JOyTG1GrhG5LMi8fZ1ksyKfLV2pqdf\n1ljWjSH+DWFNi79GVvgJK+jpUUA5XJGyvdsVM7BGyw/vL6J/U/NH4iwggdqJ\nwbjhGFrQu/GJ6BDKPyzD/UCKlCKbYZ2gkUCi/Eu+GGtTrT0fwo3454FHcZE1\na7vE+9JQzPNB4OQTAtkh5LW7SxX/bhm4YURsGr0E1hoSa9p/kpR7MU7pXIlQ\n2ndIDsNoUk9DnQyHxvH0ZzKIU4fk9jFqXE8gI1aK9bWBxIixZXhSafrkK74O\n1CRAMDeNoIlDr294IHaLVIdO6XEE6rUPi8GHDYbUoc0j6cAJjXElT7c9rIby\nZe+MonqurHWL4BkXbTF3cs2K/sKvQW3PpSLlkWyVDTqSbmoLfWbTRbbOf5of\nbqcviCVuVflU7p+GmtKT+qGUPL2sasCQ3mrgtsZV18XJa0I5HabveI77k67D\nRUAY\r\n=arpu\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"2aee1fe5eaed5267b0e67f1610c29dd399d323c1","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.c50d20bab.0","@material/rtl":"12.0.0-canary.c50d20bab.0","@material/base":"12.0.0-canary.c50d20bab.0","@material/theme":"12.0.0-canary.c50d20bab.0","@material/ripple":"12.0.0-canary.c50d20bab.0","@material/animation":"12.0.0-canary.c50d20bab.0","@material/elevation":"12.0.0-canary.c50d20bab.0","@material/typography":"12.0.0-canary.c50d20bab.0","@material/feature-targeting":"12.0.0-canary.c50d20bab.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_12.0.0-canary.c50d20bab.0_1619737336028_0.9784634594022401","host":"s3://npm-registry-packages"}},"12.0.0-canary.474836ad0.0":{"name":"@material/slider","version":"12.0.0-canary.474836ad0.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@12.0.0-canary.474836ad0.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"cb8ad6ba87e2481ed969b188f549f8645d1ac006","tarball":"https://registry.npmjs.org/@material/slider/-/slider-12.0.0-canary.474836ad0.0.tgz","fileCount":38,"integrity":"sha512-h4mbOjalXKasNFIebdhbOhVGK/jOKlMIQgv201mRroGFuG7U5T0f4jeww7yoFxxSMfs4Usc557vOnbcV5/l3bQ==","signatures":[{"sig":"MEQCIGZjCIlTlEZafo+LqQsVo2CqgsRbmaPHf6iEs5WTybUxAiBbLytlvSWLgYjFai3aBMmj90gxkBYtY/xmkj2OGMTWTg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":837627,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgjM0ZCRA9TVsSAnZWagAAE58P/0dWzL+9k+1jB4VEJfLU\nkRzr/xg1vNP9e5QeyPr5/01zy+oCnm0CyUGpTRKXYAoB2iPvsGY8i0DpPUhW\nOoT154KwJbDJ4CaYjEA8/0HxdjjXcUSooEjRKVTbj9wz8swyWvCTmRmMsxdX\n8XlKgdSqSVylF3KK4KEjgdQ4GyOqPQUt8NL1YTyEljqua/rw+2bHUVvOhqra\nh/Jk03KEHeKqHS8MkurA5TW3k7oFYHeqgMwTAMZit7k9KJ13Z0bKPp0zwE3n\nRpp7NgCaoyrzfRLRkIpAzW2Hq+RKYwE1yQ2oCvRVJ/LXhm6onHWI+vD3HzYH\nlPFChEmH9AGzXn038iR5p4+pznzKnD2nMcj2jknFTgFIePH6AOk+xXjj1Ey1\nSBp4swb7XR9Dm0AEbxJpG62FBk0qBL5GHFtbKzAcwWoKg4vWYvQyj82l90Rq\nsIBa6Qfsnp5sfbk0+41RLNsL7pLxuz03Yu5w8f/NPkJgPvsFnqgX9Dwwnk4Z\nhc68U/JCxzj9/u0nu60eRj7p9hd4f4Rx5n3eGg8Lpl0dt4cwdOCb1J/e8Bg8\nGh3I4kK6OUlX/fn5dYg09HjKCHbeaHv/ZDYJWDGq4H/U0wjKZT8TdCioHBv5\nCBMr5QdpR7b++4Mei0odE0dX1HD8ra01aKFBKhDK46mU2+/nC4GGDq/6QdUC\nMaLh\r\n=pp+2\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"c9a6db3013566afb165bda88b05607f2ee398718","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.474836ad0.0","@material/rtl":"12.0.0-canary.474836ad0.0","@material/base":"12.0.0-canary.474836ad0.0","@material/theme":"12.0.0-canary.474836ad0.0","@material/ripple":"12.0.0-canary.474836ad0.0","@material/animation":"12.0.0-canary.474836ad0.0","@material/elevation":"12.0.0-canary.474836ad0.0","@material/typography":"12.0.0-canary.474836ad0.0","@material/feature-targeting":"12.0.0-canary.474836ad0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_12.0.0-canary.474836ad0.0_1619840281402_0.28742107693603636","host":"s3://npm-registry-packages"}},"12.0.0-canary.f5ad92287.0":{"name":"@material/slider","version":"12.0.0-canary.f5ad92287.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@12.0.0-canary.f5ad92287.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"a5fd5d46d5a0a7243544d47fd33d884fca41c6b5","tarball":"https://registry.npmjs.org/@material/slider/-/slider-12.0.0-canary.f5ad92287.0.tgz","fileCount":38,"integrity":"sha512-QQ0G30l/VmRgW9rnExkRHfFUjhhs5pcO+2KnrI5cnQ3AbatOnPuABoXU1zHwDd0HHjZ9s4x6cIeDK2t85S+uBg==","signatures":[{"sig":"MEUCIQCaJx8cqFxpieZcW+pCXhZdcumVdto8J9Ks8+ruBUAAmQIgSJFtEiV/DoZNdvu+fyzldI7llaaj0uDz817Yp7EIRKg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":837627,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgkD9qCRA9TVsSAnZWagAAJHMQAJ8cIiFUrIw9+69GOtGc\nfdndPZMsyDJG3ghg8Vdh4DUY45/5rGNHmmB501yijvALCOfFMRXdJHz1qxc5\nh0AS+5/b7j/3DOmipJxgTsfeU8TbmRDrSlmo0gQeJUYSUGxBrgZewc4k7XTt\ntoT2i7zm4srJGMrYS1rlUpOct39BnNYKLSIkDFKGMXtZsJlzXgpBkFIofy8J\nIo48yzFtG9kTeODQ7H3+sA6JG2smejFDGgYEYXvw9pUwdlrKXIJtQ8+JgX5J\nyri+0iH0QW1BVxeo0Ow0h+SKE7lQe9nGyib40Ae5KjrPkfRMChUz6pEq3rLl\nnqOYrjIh+2fQVDgA9Ppm5fLEyIUWfC1mOZrCzN10KNQwmSP6zt14op1/qvSq\naFTaMnLLRHGhfbfn5Gq/tPvvtpEHpHzS1knqCcpf/i3t9vgsxMFps1T3KD3t\n5EX3/JNMbkmxuLZxsWyA59TbPulLsgKa6nxtIiUqrC61xmC1huAn/QS57O4a\nR6J/6sZL5hnsApMfd026PaBDQQmChYlQxKnHqO4IjrHaDH77ckNHw6cQ2BkS\ngS6TOsJguYFkx2f9FvM8TOj5ue7ZBO+c0ThfVucV7vEr5sL7pZ7CK6wZZiOJ\nCbO9wkHNrgNXvFSD4kT9H6U7cj+dhjZA8zHmOrqjBQUjPJNmhhqju8KuER9w\ndQAv\r\n=qJrC\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"493c206bef4cedd10981093c61731e1c1547227e","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.f5ad92287.0","@material/rtl":"12.0.0-canary.f5ad92287.0","@material/base":"12.0.0-canary.f5ad92287.0","@material/theme":"12.0.0-canary.f5ad92287.0","@material/ripple":"12.0.0-canary.f5ad92287.0","@material/animation":"12.0.0-canary.f5ad92287.0","@material/elevation":"12.0.0-canary.f5ad92287.0","@material/typography":"12.0.0-canary.f5ad92287.0","@material/feature-targeting":"12.0.0-canary.f5ad92287.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_12.0.0-canary.f5ad92287.0_1620066154381_0.14549959783825628","host":"s3://npm-registry-packages"}},"12.0.0-canary.af453daf8.0":{"name":"@material/slider","version":"12.0.0-canary.af453daf8.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@12.0.0-canary.af453daf8.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"bff1e4daae9b2c02e8641de5a666b31e93604c34","tarball":"https://registry.npmjs.org/@material/slider/-/slider-12.0.0-canary.af453daf8.0.tgz","fileCount":38,"integrity":"sha512-MPjcMaiYcSlGOhWjr2qTRNaDBr37IyTdHo4Y2+heYm/5f4uq9HDhfbnqCHeotFOw83dNtgWDU1urOxuFe/ET9g==","signatures":[{"sig":"MEUCIQC78z34CPQi7c7Z+rV9RnmuAzRke/6dOV6MKEjoCE7dJwIgP0GxhZZ6VH2GQnL48GSPBqk+q1JJ7awFmE0FpuB8GTw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":837627,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgkEa8CRA9TVsSAnZWagAA9KAQAIzTqm3sfeMzBiJz1wmO\n8eKcckCYoKl18VyrQ6ZOLmhWd9AEjbJPz9Mg4Blr7EZBsCCisOfDS7SEQuJp\naOQPrcErmtVzR8ioC0jZjm0DgCqXDxcL88WA6Sxqxb6aG1x3JHogqw5nQAFE\njbyeRoD5yzswj+o+uwYAf4t/dRE8/LQH0/MbmrbFT0HffvboHaK89QtO8o4O\nX77MQAr6X6uRUnvRV/ZMsq+7Lj+CqggDpbA0IUU1dp2WQHZtsVj6ZcldNCcG\n4810g0DbdrV6r5JXJculBb60XUseOvgICHAH16NbVESFCe2lwyhyNC+PU/Rc\nOoXso7X2CGAP5pICEzMDzZonc5zYUXNOuULKEI+OslfKQyCNZVhpIdkCgWYZ\no0hvTKGE5l/enxQJ92HKm/dskj1Tfl3yFoc+qRSf9FqpFiHLLApLyERVotWq\nfDW4JbdN/TWa59zqVQY6F3GVObu+P2qTn+KCN9ikyJojovc7/apebjq78JBA\nvMGQLxos9Q6Xt6m5JcbqJ1yodU4rASE33nfNrfIpHiJpifO5JrVbJrfLPvjb\nMQDNM54xIEhGS5F72fJcGCza2xZjW2R6PqKf3RVzC5nnwZFgoJOY7kdAds+d\nLpQ7fem4frBkFfgJqNE21MPugMuapGnjJjWLJrNS8gbuipeDysmx31NFHq0G\njgF3\r\n=q4oM\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"d55347cda19a4d9469eff68955185d9d5e235a16","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.af453daf8.0","@material/rtl":"12.0.0-canary.af453daf8.0","@material/base":"12.0.0-canary.af453daf8.0","@material/theme":"12.0.0-canary.af453daf8.0","@material/ripple":"12.0.0-canary.af453daf8.0","@material/animation":"12.0.0-canary.af453daf8.0","@material/elevation":"12.0.0-canary.af453daf8.0","@material/typography":"12.0.0-canary.af453daf8.0","@material/feature-targeting":"12.0.0-canary.af453daf8.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_12.0.0-canary.af453daf8.0_1620068027678_0.6485081783831601","host":"s3://npm-registry-packages"}},"12.0.0-canary.1f1918c24.0":{"name":"@material/slider","version":"12.0.0-canary.1f1918c24.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@12.0.0-canary.1f1918c24.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"b81d00efe92d9d305fd75854a1889782f0246479","tarball":"https://registry.npmjs.org/@material/slider/-/slider-12.0.0-canary.1f1918c24.0.tgz","fileCount":38,"integrity":"sha512-3mLpi7M7POyQxShvSu7agEq4+MGT5Yo9nZbjU1LAFDUoXsEvpGzBiVBrJeuUXNTbVmybS4M75DFGRO/LmghLdw==","signatures":[{"sig":"MEUCIC1wWTF+b6HGBWFLeGzjK0k4dLYaT4ucbiko7qVtRVz4AiEAifRzBPkwJGpWPUfMbTb/n3g1wlq6NGGNdUX7ekQV+k0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":837627,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgkE2LCRA9TVsSAnZWagAADKcP/06YiSSkyBljyqr3s4b7\n4cgulH3Wh5U7/QywEMzf68eIX/lUf/DsUvvq1mBJzW8aHICy0mCpI/3CvOyw\nEiQqYhwJ+0zWj0kBehIWA60hH0P9TYaEgBqi3Rj9OqNV2MFn01eXgorIS5cv\njFkU6Izc/JklxxbSP2y5jZfnNrm60pLEFEF3TXsp68aooBMTn1qIBS4t2Hq3\nIsai0aTay8s73psNw0yDLeUWYsauXXbkHkBB+52XLGQ5t4X5HIAXSrJLy+6D\nzz4FgiXUqYEafpkliIONhQHIIJTjBZT2SiK7UEQLeTwu2BCxK6Mltr3SRonM\nfot1q7ThciBoLdaVTC9ZlrGqlJRqWguBSN6pARhHZ168GAuX5dEGChjN5hAn\nD8W0VZtmMERsEVEIywl2ZeN4HKCIpC4usvognzzq7BVrObwN9lQorTksrMew\nhCToGBFujTwL+RBMDT7TUieQwIZGx+bkIy5Zqdv23qsbaSz2NsEHEbgf4uL8\nBF2RZ3Z2CnDMBV6DYF2CtYTpX5J8AZ4+oxg7+3q6Ca0E/iJPTyc9gk8Qk1Eo\nkhdMCfVwHugXla+rSOsNK4wFM+CsloPgYqr1Va/o39Db0BgdVhHgFxkGzzNU\ngdW+5rJyzYpiwFmEiEznqsajF9ZZM+LV5IUTuXtLGqki2JyLDGSy7RmnkZDs\n2FMS\r\n=tdwW\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"cda2e786bcb73ac46385a1c6459a8ab7bd9ef6a9","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.1f1918c24.0","@material/rtl":"12.0.0-canary.1f1918c24.0","@material/base":"12.0.0-canary.1f1918c24.0","@material/theme":"12.0.0-canary.1f1918c24.0","@material/ripple":"12.0.0-canary.1f1918c24.0","@material/animation":"12.0.0-canary.1f1918c24.0","@material/elevation":"12.0.0-canary.1f1918c24.0","@material/typography":"12.0.0-canary.1f1918c24.0","@material/feature-targeting":"12.0.0-canary.1f1918c24.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_12.0.0-canary.1f1918c24.0_1620069771225_0.43342880024103025","host":"s3://npm-registry-packages"}},"12.0.0-canary.33148231f.0":{"name":"@material/slider","version":"12.0.0-canary.33148231f.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@12.0.0-canary.33148231f.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"56e3d83da9c6512e09c792ab3b72ddae08d7ac52","tarball":"https://registry.npmjs.org/@material/slider/-/slider-12.0.0-canary.33148231f.0.tgz","fileCount":38,"integrity":"sha512-ZJ8VSrxP6PcoUzsoHxjxHfg+g3VoJw4/r1QsJ7bNRRnrKsk9qvLJWPCsoAE3AJxBv84X4HfllBHXzCliggSPaw==","signatures":[{"sig":"MEYCIQD//x1XDRwGj2Wpds1aeF6ILYFedlTeFi/62rJQ9OSw3AIhAM+L6wy9dot991rulZPQ91lcO62u0QRhteC1MgPsHB3e","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":837627,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgkFFaCRA9TVsSAnZWagAAkQkQAIvI62VPohiaLvH8qOvj\nS/Kgv7zh8q9VyWp2w3jaE/SeE3/fE7xiT05vn5sfdoiGIFoTYrtenMbcBt5y\nwuzmu+jdQx4HfWoy68T/O7x4ByOAWTPq+ng7JgbbaQ+6thh2NvMza9A4OEjs\ns3yp51fODhYavfBOk4M/HuZ/W8Iy0ziYfwrdByR3d5rqsT1YIxZvHFjoLRqj\nkE0gFdgYkVOxjbLlm0Zl0am3M0vz4BB99ZU/BbhrE7NFyynLm1YT/14HxlA5\ndToGQLMTARZSiel/+9aP0D5jl4oTkTUCiZ/8mrfzq+6KrKpyyiQq9Yos/RJG\nltqQEA36SbFlPLrk2/9BXSknBsh4rz1gwMxHQhLO/i4ww/6wtCuN8h0avz69\nEWmcfpf8NgB7Cr3H9MuhCRwXFXo8MUOXbohxJA6Wt4oEktep7vtLmJIlKqm9\nn0CUugLzeiV7zBaVrM3G+pbZfFMFT8hzV56J21VT2/0mDyZSHWXDPSJYvcPC\nj6Gpv27iQUGFWLm/46gdQ+BEiRv9v6lIIgYv0nCvx0b4SmbwNjsXqlaBxoLF\n/bFLkNpzlrKDR+T5Tprjv6T0tMYlISrYXZ4Vibok//qTRoup0eQCM6jg6a7u\nSy3nYLrMD5YHQ09xfFbfp7R4uckTyOzP1r3K68EIc+zVu63SugOmjJ2hcc/7\nLfal\r\n=6DHj\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"bb5a14b15a74fcef265050ad96f737d0acf36987","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.33148231f.0","@material/rtl":"12.0.0-canary.33148231f.0","@material/base":"12.0.0-canary.33148231f.0","@material/theme":"12.0.0-canary.33148231f.0","@material/ripple":"12.0.0-canary.33148231f.0","@material/animation":"12.0.0-canary.33148231f.0","@material/elevation":"12.0.0-canary.33148231f.0","@material/typography":"12.0.0-canary.33148231f.0","@material/feature-targeting":"12.0.0-canary.33148231f.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_12.0.0-canary.33148231f.0_1620070746233_0.6973721576505039","host":"s3://npm-registry-packages"}},"12.0.0-canary.06b76fa74.0":{"name":"@material/slider","version":"12.0.0-canary.06b76fa74.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@12.0.0-canary.06b76fa74.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"dadb8b1e9c0e7634b72cf045f705a46888a579c0","tarball":"https://registry.npmjs.org/@material/slider/-/slider-12.0.0-canary.06b76fa74.0.tgz","fileCount":38,"integrity":"sha512-geiqRpFOwB/zzynsDyko4W0Q1pT95Li9XeTrrE2NVBa9XlLAmILPX9bgLgB8nwVneeG6hkjiRsE/yNmsz5no6w==","signatures":[{"sig":"MEUCICjBUdiQ3Zi5jclh/fXyAPLsdvM8Je58n0ZDLpfrndnvAiEAux5c/HSFr4j0n3KlDrCgk25DvwG0uZKi4ACs33pPXVM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":837627,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgkFMBCRA9TVsSAnZWagAANuYP/0vzxW6Wh8LgK62K/pU5\npna5Ifr4xGWAX92Jflmqffh0AYTQ0Tcb0HDjlCNc2SroXSTD5sBJlA4pRWYb\npV9v03MuVZoJyTLCO8Yt5zr6UHYyroGNGcWo7QowhRTyqtq2wIADqWVkplCB\n3SN4gRejWENGYQTU3VhngiZqIEPiM0sKrqnE+HwTOhHjfhYQuPET2SyUd20Z\neVk3P62YgoY9Wao6UqgTuXrTYJeSSdzsKLg0H6jcXHtKmYFGO4Fi6fHtYMC0\nP/0LUl+7I3UdIVPYQjQ28aS3RfRT2PRV2gEGACwk9hfEMRGYLVRNFNyEtRvt\nDsDuehOQQeRMcdnQRsr+odJ3A1Je4x0EqyD4g3QqWJSuv8ur4TfmHXXqmAdf\nXUDcROSF+nomrr1TXCchsIhrPYWVkIawGsn/qjszDTp67iRzSCo+/nBXaeqK\n11FSqh/w5Ae4xN1jahXxN0FaRWHeZ6VmDfLhTZsGYR7STZwhJfANnernBKcb\nqHk082CmNcNU0JlbS5twOuvnElwscB9BdJA4fjpWdrA89YtyoSbPg+f2UAs2\nQ7qPTDThydY+pbrLijEYb3RLkn7RCKQUnHViJgP71JRsVOLbUhiaPfobgJak\nW0IMoGT3oSmAY2UqfRATaTaU+fwJVC/RITcvKIUinDnx1HiLqo1okMo7k3Su\n4YR7\r\n=UHAD\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"6a6a73c9687e196677329640dc1ed025d13b44a4","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.06b76fa74.0","@material/rtl":"12.0.0-canary.06b76fa74.0","@material/base":"12.0.0-canary.06b76fa74.0","@material/theme":"12.0.0-canary.06b76fa74.0","@material/ripple":"12.0.0-canary.06b76fa74.0","@material/animation":"12.0.0-canary.06b76fa74.0","@material/elevation":"12.0.0-canary.06b76fa74.0","@material/typography":"12.0.0-canary.06b76fa74.0","@material/feature-targeting":"12.0.0-canary.06b76fa74.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_12.0.0-canary.06b76fa74.0_1620071168922_0.656235935333223","host":"s3://npm-registry-packages"}},"12.0.0-canary.7c5000473.0":{"name":"@material/slider","version":"12.0.0-canary.7c5000473.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@12.0.0-canary.7c5000473.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"3b4725c005947a6d435211afeb80d8f27b240b2b","tarball":"https://registry.npmjs.org/@material/slider/-/slider-12.0.0-canary.7c5000473.0.tgz","fileCount":38,"integrity":"sha512-mwue3gAGvDMCLAUt6FXoht/U5IKc7hgTqWUAAjaR7zSF8KO6yybDymoulbiF4VedAh4v+KTB9hOr7mzKiDPObA==","signatures":[{"sig":"MEYCIQDoJlkrnJaqXcEVGe/6tAoRaei3lMn257HzPEunbfOT1gIhAOYeQyxzSZ8BUQAr1f7tPfdc0F7x6nf5GQKd7XPEL5CP","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":837627,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgkHw4CRA9TVsSAnZWagAAD7QP/A57jdq0ROXn4ZfcEjOx\nCKRMhFysVH7dedROBaWtC8grl7seQQ7A2NiBx0OFRACtAPESAjMRiQOlW7Gv\n78EswUde3/c/dqUrQnrac34nCKuERnL4YuutCOR7w/wVBTUdMtIvdxs7pJe4\nZNxCdD7p3W7QQmZ5RskDKPOea9ky8zK2OcpumiIfYCH3q0ui474lsh5sQOM2\nOSJJL5VZAqhcM2AgPXu7w8lSD5w1s0UTppTcCcQZZaRIRZhThd2ZEOkpxSVp\na0jt4U62P5zTOSywyg/RXdzj7s1iZ3BLaScSbAN+W9RfG0OVwpgmR69yjnRi\nBY+zNLY8/MVgEBON7g0r+OCy5C8ZrbZXaan+RWDahqb4OuLuT/bO8EnmUhrU\nAWPHboWRIf7GA40Yw4B0sBa2ArJRWQOZDP8gIn108bn/lUxuxSEw4LglYD55\nYXA1SUou3KdNLim6h1TxR6jF5Gzz3kNUb8fG1ABqw9a4X9EKRO2b/zlOIZ0K\nLWStmZLZoSn0VjROCfvBccwugegQrWq8EAk9t2VHWVaRNGbuUoOPoE2F/Scz\nN7y/Z3ExbRz0RJjxsQyYpFx7DsUpe2aHfY87Y6Dcuuna0jBRjbB6FR0BZ3fe\n+JnxbemnYmWWpravTSy7hdwUFlj8afQLQnMueDgN1Sso1bFWSM9qEm8OJOPV\nEdxi\r\n=hjSq\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"d53e0032497f2efb6a42d541ce5cd2072711f86c","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.7c5000473.0","@material/rtl":"12.0.0-canary.7c5000473.0","@material/base":"12.0.0-canary.7c5000473.0","@material/theme":"12.0.0-canary.7c5000473.0","@material/ripple":"12.0.0-canary.7c5000473.0","@material/animation":"12.0.0-canary.7c5000473.0","@material/elevation":"12.0.0-canary.7c5000473.0","@material/typography":"12.0.0-canary.7c5000473.0","@material/feature-targeting":"12.0.0-canary.7c5000473.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_12.0.0-canary.7c5000473.0_1620081719896_0.07743995013314797","host":"s3://npm-registry-packages"}},"12.0.0-canary.de997644b.0":{"name":"@material/slider","version":"12.0.0-canary.de997644b.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@12.0.0-canary.de997644b.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"2cca71026ff1dc385243eb99a322df97aad949f4","tarball":"https://registry.npmjs.org/@material/slider/-/slider-12.0.0-canary.de997644b.0.tgz","fileCount":38,"integrity":"sha512-fp8KWYQlK8d5jf/ELtB4QOBcjb9bgx7NA+8tzEhKLBXtMghDKlX5QiqsLFOtiYnsqPgtoiXNVeq8R9fc5Xj+4A==","signatures":[{"sig":"MEYCIQDp6HtqCP58erPFqxsYPyuqaMpkfCW1zxw1OFtkZW1s3AIhANzN0B/nq3AP61syBbPqU6XTM2jVXpgdtJhGrXhDLhxG","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":837627,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgkYRCCRA9TVsSAnZWagAAk2QP+QET68U/WZAKc1JO7cqQ\nTuCxRMFILyusm0PfXLosgJ7lBF6V8CVzQMeIW6wB9ddmOg0JhqGjD3jdI4vN\nhT853oqyAKtHEeHt2UMq+/b4K5Ay3GRRd3kEQXI2Nd3fORr9cir2qIlUFZHg\n+cc7lneVEmlD6USP1V/GMlSCXjbWSasqS6KIIy//Z5BmzjphjNklMDqyt1Co\n8f8KjCDxv37nPdl8qakY2i2IGxdV1KMIMcFQOZ51o/4JxjOAiSr6TaTRfLLz\nVH2ESRi3Q+byZ9A/lxk7i8fZRvkKnK8j7jGgC5fw2dMPVRkfDfQmX+6bVINd\nMLdHttHDsLSG2wgapNErsyW8QppAGtW0Eh2SHaVFioqSUYCSeOPnPVfa31Uj\n5V6DHzcAMPMyeosoo6FvYjy6CzAIpOK5Srwm7XCaNcPLB9xIE14En3IiMS5K\nTXS46yhyQ8uml1VonJasujtr7PPIjdZIi7FDuZ8OTIO+FcBunvzHp5/M6Dmu\nWXREWOPOdUW7L4FVJ44/mJwrm/pSEVWrr+7pvxZLqaNjT1thyxdXyKVjRgPj\nJgKYcXLGCqRNwTkRqmpy7m65aKk7GAbGJRYoZeoMA9xyvYCw25HzVr+6df7E\nRZqz7t3H5exSI9FLN9UVGfalOnip6U/u9x4JBQfcJviAPPrNl4N5QG5ucZlY\nu1If\r\n=+aTa\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"efb97e2ef70bfc07ed9b429041e4f201bb0d3a53","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.de997644b.0","@material/rtl":"12.0.0-canary.de997644b.0","@material/base":"12.0.0-canary.de997644b.0","@material/theme":"12.0.0-canary.de997644b.0","@material/ripple":"12.0.0-canary.de997644b.0","@material/animation":"12.0.0-canary.de997644b.0","@material/elevation":"12.0.0-canary.de997644b.0","@material/typography":"12.0.0-canary.de997644b.0","@material/feature-targeting":"12.0.0-canary.de997644b.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_12.0.0-canary.de997644b.0_1620149314099_0.7634672214317659","host":"s3://npm-registry-packages"}},"12.0.0-canary.d4d7f1cc2.0":{"name":"@material/slider","version":"12.0.0-canary.d4d7f1cc2.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@12.0.0-canary.d4d7f1cc2.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"9f1c21e3da39c56cfb1bdd70f5c9309081ab6f4e","tarball":"https://registry.npmjs.org/@material/slider/-/slider-12.0.0-canary.d4d7f1cc2.0.tgz","fileCount":38,"integrity":"sha512-rCIxkNUuhLAHwlANbWXwTzo6yiiaCIN1izFRFKaJ78m/VYkeUWxdi17QvzA9q3Nd1BgS8QkQfe5aeobXq3ynSQ==","signatures":[{"sig":"MEYCIQC9BcexT4EdyBknOlQT+y+jrh7Q23jcM5TgLO/mreK5bgIhAJIs2/A4KSFuaLckh3yLWEjCD6do3r5EULAOD7JsRMfu","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":837627,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgkYqLCRA9TVsSAnZWagAA6hEQAI9dB/zICqaAL1TXIokj\nB85v8dndnDF+K8S2XfcD6yEnYOvdYqvOFipuwNQMZCAxlkU8l4Wsd2SbyM9f\nAMrCPAyZTp5P91uv9lUNiOlCFqoCNsth53UHf+0qML/VrvLAk8v1yWBSIrTC\nNDj1syBfXCi+7R+l2NBNpeXpowLWkRQ8EDEaikZmeEkyJkJLtiz3Mij6fSHG\nC8S/uELjZAIqGTA5SPU5sZnW6tKiEvj4e2ea5XtJ1blCj+d0gsDd/COLaIYe\ncNxBbc80LPNavhjgXxTEQ01kG5MuG74c8eiuy5XTo0cXlPApDShKgXVn7xIj\n/rNpXrFPjTvOJ9R+oCHxi5JF3xnPfLkBFpbDu/j1r4tKREsINSJVk/Bh+E6k\nw4ATE4iYxs03c+7baM6ktZq928O8ZaFHS1W0eLAvglC/gounLGMyLyUsau8U\nLl6M3dmUxNCKL1+t8CAbjUqQv0ssluzaWEWoJoWad6FT19DBvweXHkwCgYrI\njQ202lsEUEkK6DEdo3t2rlIapCdhu42bD16kJokovkhN2aN2gg6rFC+ZDOv/\nV95qypUEbE5ylWdJKHvK/SVrFlsNkrgDUnNndEe9euyU8nKIwfs6i7BejoXe\nrHvxHz7LxbhhRSnabkLROUbGkzG/Wg5P3JPcnrnFLXcgos1kHY6pd90FmScK\nH0ha\r\n=1cgN\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"473ac5e3a11b87616a0dcb004bd5a9411a271f6e","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.d4d7f1cc2.0","@material/rtl":"12.0.0-canary.d4d7f1cc2.0","@material/base":"12.0.0-canary.d4d7f1cc2.0","@material/theme":"12.0.0-canary.d4d7f1cc2.0","@material/ripple":"12.0.0-canary.d4d7f1cc2.0","@material/animation":"12.0.0-canary.d4d7f1cc2.0","@material/elevation":"12.0.0-canary.d4d7f1cc2.0","@material/typography":"12.0.0-canary.d4d7f1cc2.0","@material/feature-targeting":"12.0.0-canary.d4d7f1cc2.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_12.0.0-canary.d4d7f1cc2.0_1620150923235_0.10854890393314554","host":"s3://npm-registry-packages"}},"12.0.0-canary.be999eb08.0":{"name":"@material/slider","version":"12.0.0-canary.be999eb08.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@12.0.0-canary.be999eb08.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"e9200a9401007b0f19e5fab9f73ca187eb1ed0de","tarball":"https://registry.npmjs.org/@material/slider/-/slider-12.0.0-canary.be999eb08.0.tgz","fileCount":38,"integrity":"sha512-FCoMlJPnN3MHHi1sjU+rYYuuVyKpsUThV/Eam7NAFJOkUPRFZJ0N5vOkIV39PmpMP0nu0SRT3BkkOXCL7eLpPw==","signatures":[{"sig":"MEQCIFhX6Qzc7setpwVdY+c/vT5etAnOZa+94b+KbKlWbuciAiBqRR+9PCXoOR79gPv9Pbq6NijhMbsqAhGnhh9sCues0w==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":837627,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgkYvBCRA9TVsSAnZWagAACA0P/0uqfA8zCLLepeiWYhhJ\np3Z+ranZ9N71t6S+mjxegL6DQKGuyWfvOsoW69r8GX3wbAaDIKowYEOYVzNU\nzTpmSOdwWsueLaEcnoKg603UCk16fvj6xuY3PuI1doP0V7A5OwEZFqx7FQiT\nfk+vV23j7FXfVHzaXDo/Zf+t1v2JC3VG+YK6/iBOYolXPGalMDgzslGs6zgX\nUWKDcygbScYOIzAKP+dXLTwDBKciomK3pF0KfvGan7rSCIkyNzxyrZnWYvD8\nvuViSihMYfAsDgRljqVCCsVt9HoemhhcEW8qCn6pM5HMEFyojM9o7DReKZLh\nvD9mkdqWPlDT4s6WfivYaIFmEBlYWtJ0/ok3/RrdUOT+TONwMXHpU2OS2o4y\n3FfFIRd9nz/kaGs3CJVAq+R76G9/HRJQNCgXZyJA+i8yi4vuqBOQJMCQPnTm\nCHs9IRaj4AiwjQR0w8LGeuhqG5med1d+9yCK8ZPke4csxERGVhCyWI89qFkv\nZoDTQfc+ZLD2g+i8a1E76BGmYGGtLRSfQ/BqmVslFCpKnppWlanU1tyZBMzD\nT0It0uVxzs1QCbveKK2fykEWpB13W14lvQSi134PCWtSrJwTjMdZnHi1Db8r\n3oZ3i1bjaczwXgZogmeIv++b7GS/ctb+tyg1I7x3K2s/kFEantgmpaQaOYYF\nQXcy\r\n=oygV\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"78911f7ba4a7d68ed38f554357f8f224ec7a15fd","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.be999eb08.0","@material/rtl":"12.0.0-canary.be999eb08.0","@material/base":"12.0.0-canary.be999eb08.0","@material/theme":"12.0.0-canary.be999eb08.0","@material/ripple":"12.0.0-canary.be999eb08.0","@material/animation":"12.0.0-canary.be999eb08.0","@material/elevation":"12.0.0-canary.be999eb08.0","@material/typography":"12.0.0-canary.be999eb08.0","@material/feature-targeting":"12.0.0-canary.be999eb08.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_12.0.0-canary.be999eb08.0_1620151232953_0.37991225520655836","host":"s3://npm-registry-packages"}},"12.0.0-canary.eda1705fc.0":{"name":"@material/slider","version":"12.0.0-canary.eda1705fc.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@12.0.0-canary.eda1705fc.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"13e7306cd5df97c4db53baf0207da7be8fe1dc61","tarball":"https://registry.npmjs.org/@material/slider/-/slider-12.0.0-canary.eda1705fc.0.tgz","fileCount":38,"integrity":"sha512-zfcM/s7+47Rrk7UackOW4kshIUgXpavaEzktIYyMncce2MVf47FKJSmhK9UuTdNNODmjX25cyPEDjv3lGSzeMw==","signatures":[{"sig":"MEQCIHgUS5d++j9LG8IODq+CbffRlGp/HUIOtoyaQpla92luAiAGiuTXwozlJ0/8NPB2aCxDXBWXp3fkVLsJkFA5PpbZUQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":837627,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgkZw4CRA9TVsSAnZWagAA4vIQAIoaUdONGArFHSYdQOux\nSOoJDa4YKEK4oEwl7655M5OXXfeY40cSehUWc3WI+to7oqyUgHr0VLX4qPWx\nEndBfx+T5Ym/blhOuBlY5c4EuyC9vA+EHMgq06ZStn6jAdtOqvX3JGrYPGPc\nl5EF8s1PBqAuazENIxqSdXJSZBpfic//rdQ47gg5p7YqMH/A0diA53PfIZvM\nj3l4Z2ePaDIbt5kV0n6o8kskL84wdRdzjTRl63jXXeo0fOb+69zqKS1c7xOO\nzWygNAahUiC0oDlZzGcArmdsweqmOWd6v5MTj6NjIlL5dLUau0pYnFjBaa6f\nTPIyXUl0dJS9S+M6KUnJqzKF9XAHEuClWbuch6ddPGhPPb6g04Mk/SufvUsh\ndMJNooYx4TmnBx1se/mAcSo4/srf9cvjZgd7IHzx+h2lKtKGYf6TT+Fy0jvN\nYgzM2yVMSOprxGMrs8P5xh+1W6uq9nH/GjHuVQA3SNAWFL4jgEz95bZ3pya4\n6zjkmvcIZzax0dWwJ8oidHH8UYLBG5peiL47D0KoMu0cCV3dgKHemgnCWEEI\nRArRwaU7ozAZLnXnXlex+cO3Psbzeomq4DaF8kRwRJbdvwxgYDM6E1pcXPtY\nZloDx/j8hxZzdqO+zBA0u7qV0zpmMPz8kSpamrWOkrk6Tv/ryXb9MXFVZLBB\nERP5\r\n=MIh+\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"a4c7f355f27d26cb39ac4876510254d165a5645d","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.eda1705fc.0","@material/rtl":"12.0.0-canary.eda1705fc.0","@material/base":"12.0.0-canary.eda1705fc.0","@material/theme":"12.0.0-canary.eda1705fc.0","@material/ripple":"12.0.0-canary.eda1705fc.0","@material/animation":"12.0.0-canary.eda1705fc.0","@material/elevation":"12.0.0-canary.eda1705fc.0","@material/typography":"12.0.0-canary.eda1705fc.0","@material/feature-targeting":"12.0.0-canary.eda1705fc.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_12.0.0-canary.eda1705fc.0_1620155447500_0.7133054375867742","host":"s3://npm-registry-packages"}},"12.0.0-canary.718c90178.0":{"name":"@material/slider","version":"12.0.0-canary.718c90178.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@12.0.0-canary.718c90178.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"b9e34b8f6879674ed5fc359cf4a48efbe21a68b9","tarball":"https://registry.npmjs.org/@material/slider/-/slider-12.0.0-canary.718c90178.0.tgz","fileCount":38,"integrity":"sha512-UO4oDqD8pjWG8DOV07vJ0WqBlZm3YooTr7me9YJqmnunnIg84IMGwwhdYw/1WJgGQYw4fqcIc2gDBphJdd2HCA==","signatures":[{"sig":"MEQCIGAXPBHEhQeAYBRLZ5+n/0kP0qH073t1sGFYHcBOw9oyAiBzFoRtnHtsn4vjekFJahuSVdr6wKJCOtUD2Unoda0sTA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":837627,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgkaBFCRA9TVsSAnZWagAAbnAP/jAhCEy0qZOLiQmnoUPa\n7vLA3G3pnKkGNYiCW4T/PB7C4+0lxgkVuyEfCLIk7X16Hsvq1z2LWr8kY/pt\nbBMF04oHMtz2KOkJtFIZAONVmnPdAe8gGdToUvt69hu1eu5OEAvm634gt7Sd\n2cZH+kVS41h5W9/s48baxo/yyiAaGsq/Imgu4DVrPSjO1Wt0DsuWCkbSTxs8\nrFKjcGeOm1GZ9ph/a8BKdYOCPYiA7JPZStQi/mplvsJMTb5Fnt5hWFqlf0vF\nFRHqACc4BLBHPO1My/6Q8KkyP05xATcVF4uzZ9UcfdOMmQiq7ZTLLuJYYN9K\ndK2Pi111fxMLZ2v59DHCRsClawdzZpHzIq529wHiOr3DZRYKD4n/wP+gFmOn\nBUcMeyAo2ys51LgmGxyxdkwdZ5ty2aEMODI162J1Gfp8wTwnd0uMNpWpyHqC\nRbmOq5SWHiDVZTZgEZVue1hCUqER8B5shPiyhB3pnX0mxlOoTSVrQj2CDQ4G\nRNaMZwVEEPXFtKzCFw7RsZmbvP2DtVWPDmCYFvFKKR+9vzJnNPk6c4kH4n9V\nAIV72Ppa/sZrhgohkFReb+FPAZgJ+32FI1J3aePyY7F4fYu5ltP6xGkRyvD2\nlU+7077Qp7XooHw6Iv7xT7pfRUPxXhWRBP6TlOMBSG3T/jO9Tr9AtnhqQBSZ\nUbLG\r\n=y0gA\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"38bd77e93e567329d390e9784d4f591d6dd41191","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.718c90178.0","@material/rtl":"12.0.0-canary.718c90178.0","@material/base":"12.0.0-canary.718c90178.0","@material/theme":"12.0.0-canary.718c90178.0","@material/ripple":"12.0.0-canary.718c90178.0","@material/animation":"12.0.0-canary.718c90178.0","@material/elevation":"12.0.0-canary.718c90178.0","@material/typography":"12.0.0-canary.718c90178.0","@material/feature-targeting":"12.0.0-canary.718c90178.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_12.0.0-canary.718c90178.0_1620156484822_0.7512015515341142","host":"s3://npm-registry-packages"}},"12.0.0-canary.0e3917299.0":{"name":"@material/slider","version":"12.0.0-canary.0e3917299.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@12.0.0-canary.0e3917299.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"3d66e0ae78502b5c806f590370b42fbf0dea87a5","tarball":"https://registry.npmjs.org/@material/slider/-/slider-12.0.0-canary.0e3917299.0.tgz","fileCount":38,"integrity":"sha512-H8rx7rmtkHCp0Ig/ij7ZLzaZ9tpmFgPtlAXqxtFR1s57AMp329BdDO6HO407hatMMT4TVO7EwhPP4/PI1/PanA==","signatures":[{"sig":"MEQCICqleHozgYJr0HO/xg7ssqA0g/KcwIEoMhhcxxRjwB7nAiAuvcUuj0ogSaNhF4mCJhrCX3cE+IqqMTilVxSPI3+jrQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":837627,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgkaDlCRA9TVsSAnZWagAAthgP/2flh10NIJJdvZeV8UGx\naXyFbpOXZH6gEbfXgNSWwZzABLVyl71uvfpeCPb8fOmGFwUOXhQoRCkV7p5L\nxWxup4e8n7gdiIPT9Mzy7blgacgkG8JRz9S2OaLFqdjydYp2uU2pnBJ6e+R4\nQRi2SqLMhlZo/J4XJD6L6mb/Ac5P/o1fmT8NbNQ0eQXHmZZ4x9ULwzme75T5\nC8i5CZeEXGrZT6O0KeEI2PELhYBUr5+IzXANyeMWpgSa+AzNR8lMCrYoIyIs\nybZ9hM/HNLnfja+SbAwnaul+knlLKzo/4IdWoNiD+FTJMSU1szy6NRaQMJ65\nk4FdSwrgEpvFM00INT/5Cjdpi7g3mI2bTmPuKK1h0TmrEB/uvaKWDvRcwZUi\n838Ku/wOv77NvZ6AXO56SOiK0mpXT4jYr0BPFAVrjDA73MN0VE2dUaRTuE0c\nhCsfmL6VxlAsAxjzmeNhpo8StQhy0XwVdSqUybCtr1bJ5ddjjpe9+sk+b4to\n/Miq/oV14SO9DOwD1Ple5PPCYCq9g7fR0jCvP5Ll+mlAqPqwsj6QnDHocg0M\nI7ARCg4IwZt/HUdeDZw5vRxuT7acWSa0S1T6L5OMDk8gR11VSS5FASEbEFsV\nl6h0Wognsy63n4WppOcUm7yE8QDAbUSbAz6rCHSlY4MN7Nh/mgmQMQ1nJW1J\nSeKJ\r\n=dA5W\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"b53d9d2ca98f518aa071c4933f2c0046916932d2","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.0e3917299.0","@material/rtl":"12.0.0-canary.0e3917299.0","@material/base":"12.0.0-canary.0e3917299.0","@material/theme":"12.0.0-canary.0e3917299.0","@material/ripple":"12.0.0-canary.0e3917299.0","@material/animation":"12.0.0-canary.0e3917299.0","@material/elevation":"12.0.0-canary.0e3917299.0","@material/typography":"12.0.0-canary.0e3917299.0","@material/feature-targeting":"12.0.0-canary.0e3917299.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_12.0.0-canary.0e3917299.0_1620156645119_0.21731552382819408","host":"s3://npm-registry-packages"}},"12.0.0-canary.836b3c7db.0":{"name":"@material/slider","version":"12.0.0-canary.836b3c7db.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@12.0.0-canary.836b3c7db.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"41bb291717695f65923966a05f9bc3ee2d77b74b","tarball":"https://registry.npmjs.org/@material/slider/-/slider-12.0.0-canary.836b3c7db.0.tgz","fileCount":38,"integrity":"sha512-yHB/PhazL61zbHlL5YJY/aFIHEn7Me7cPuPAzHSBHUcLJ9CFw97TX1OR+aNiA3ay3Bg6GIMby6L9QlvzPVHQEg==","signatures":[{"sig":"MEQCICDckq7R/v30Y27cijvDfVrS6b/ha9KPifH9Z4uY7C4vAiAfm2cP4e5oU0Z/U+cgUhZ1kUc//ZC4+lOlVHJJBIwWdA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":837627,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgka/ECRA9TVsSAnZWagAA3nIP/2Orf48pWpwApmBW0hv6\nhQzy27AUAKro+/L/YBenlytn69hBka7f9jvayE5LP0G4+zKmmJ+hhLA9eZYy\nrWfzNDt0fhG8TW+6HJEdExCEWC55ytdFROai2aQXE166UkEHchptnHjmDpxr\nBoePjoyCNpnSd90vaHlXuv8Lh/oQ4V/5mefVOtPZHW/EJlosOH3haZozWRxV\nBkqN4rhbC4XQ7MBew7OTYqcwbRu8GNYy/wZFjspc/sOGxnZliYdnqpA3UeZt\nri74Iw0bVR/yCLjBWBoLmZl7nNea/WNfuPXAGj2ZpE15ND8+2bjB4jUzdcFO\nJgKKkAhWC0dE+n6Yl4QTLMGryuGl915hG6DzL0eonqH3N88LO20QNk5mFMUU\n+uylafolwosVxjQhKDgahsHXIQVD1fGHmrDkuTdF7vJTmSXf9Hd8PKeAUPOd\n+z33bsN/eCuvucRAsJRnQ192BPPZDQOdS6LKTwHr3k5CK/s71iXSaMVs/mHG\n1Qxes8csVxaMTgXo5OSNCf4C+pcoU9HvcHbqM1IRMBAy1cWZcoPMBzODQX42\nPdGQ6B3K9g89mfYcWzWOu3BKC4EHqKkyzPkmY7C/PqQO1wyd9WveZg5lZRyh\np0J1tz3oD/CtaRdoZisq2K378iKFEVgHKMeM/ZCmfNcSkkFYw8fIgXqijGMW\nbmvU\r\n=pizb\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"b39ef8f7b55792965f33ce0e4907f1811ba2b17e","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.836b3c7db.0","@material/rtl":"12.0.0-canary.836b3c7db.0","@material/base":"12.0.0-canary.836b3c7db.0","@material/theme":"12.0.0-canary.836b3c7db.0","@material/ripple":"12.0.0-canary.836b3c7db.0","@material/animation":"12.0.0-canary.836b3c7db.0","@material/elevation":"12.0.0-canary.836b3c7db.0","@material/typography":"12.0.0-canary.836b3c7db.0","@material/feature-targeting":"12.0.0-canary.836b3c7db.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_12.0.0-canary.836b3c7db.0_1620160452337_0.28299273222313515","host":"s3://npm-registry-packages"}},"12.0.0-canary.53d4e6d59.0":{"name":"@material/slider","version":"12.0.0-canary.53d4e6d59.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@12.0.0-canary.53d4e6d59.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"730dc13e6d5dba28f75879b2ba8113bdce8b7238","tarball":"https://registry.npmjs.org/@material/slider/-/slider-12.0.0-canary.53d4e6d59.0.tgz","fileCount":38,"integrity":"sha512-Bedr7kYV7bDVXvqLuWTFDqLkZTwuEwKkbheb0DxHEuIdanZR4g4f8KmTN/9zHEdWheFOZwCiQDWXKAKPIaRytw==","signatures":[{"sig":"MEYCIQDC/wKidzLJxFQvPU/z+CuFiGsrPLecLmKCAJIsKqA0qAIhAKjmxynTjSDUUWJqvd2Ol/7tQc37yQDIKlgXX6OqrbxE","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":837627,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgkbN1CRA9TVsSAnZWagAA1RYP/1NCVfrngy0uKW7ctsj1\nbSoH7aEQMtMnnJZ858AhJkpGiX1UgLgwWskXI79unG3I7PuV2DiFLkaL9cZK\naLDy502pSbjmkn+G3c8nvW77S2hHMzysNAqKDOJEvOqDLBmcZ4YKKehrkgYC\ndAI+eDIuCxjI9x/ODvuRn0UwaJRWknBe0dnj/oxLKXsQh24WKtmr4dItcVUL\nvDbZ3SdwCCfOwfujBIXQ8v/iAQ/AroH0jQCI0REpH/nLwkcVGjXnMPTlAVSR\nxL09lS1ELjwtVzhyzoyuyGok6dhn4VJbhWCxHL+FzhoYGTrqQBPpKusTzmK5\nx1vSbDocG4iROGUiB6V30h9iQKYmPr+vN9KXjgsveHmD5GNSj9Zh/9x6AhsS\nxoAn4lqprte3GzTIgWEJ3VJntqwow1kv8FaaqlGqu9eP81YnkqGAgLyvWiNF\nYkcUQUnh2hwMHC1e7XX+nhQDuJhog/xDM/60ix19J7pdvXIClWQHq0T7jYqM\n25g+dhBKr+B7uQO9Alwmp0i+RI/XaO9VSWo8orKP9nm35xtzBY+IA73MDZfG\nqgMbvzl9r+3p9K+Deub99B8Vsn46IZeFH78GpFlaJkKf8ZquE9RIBtPUgSkf\nLciBj3t56pA8sY/gJHVreB3AqZyrFyf2IQvTlTAE3i10SHhNOPyEFLLDOCmz\nSnIF\r\n=fYuM\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"a89a7c81034e7bfbeb469ddc1e1e463b018f7179","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.53d4e6d59.0","@material/rtl":"12.0.0-canary.53d4e6d59.0","@material/base":"12.0.0-canary.53d4e6d59.0","@material/theme":"12.0.0-canary.53d4e6d59.0","@material/ripple":"12.0.0-canary.53d4e6d59.0","@material/animation":"12.0.0-canary.53d4e6d59.0","@material/elevation":"12.0.0-canary.53d4e6d59.0","@material/typography":"12.0.0-canary.53d4e6d59.0","@material/feature-targeting":"12.0.0-canary.53d4e6d59.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_12.0.0-canary.53d4e6d59.0_1620161396630_0.12461445690127615","host":"s3://npm-registry-packages"}},"12.0.0-canary.18d147e27.0":{"name":"@material/slider","version":"12.0.0-canary.18d147e27.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@12.0.0-canary.18d147e27.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"c9e5e63a8d6e8fc911662f55609f3d6090eab7d2","tarball":"https://registry.npmjs.org/@material/slider/-/slider-12.0.0-canary.18d147e27.0.tgz","fileCount":38,"integrity":"sha512-LBjesx5AzP7/kmpsmGrOgLDDnLoePmlBTwDT56F9trFif4cq2UHmsnCXxfJzoK7buVZtUU7uPBf/jLmZ5dxSaw==","signatures":[{"sig":"MEUCIGU+qxBJq1Aqu9fGsofqdQhd//8aOaU9Yd2xuPPu2+bgAiEAodoRiGzxEP9rRjdcmzw+gBia6Gyz/Sbo5ZnZf0Y5Sgc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":837627,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgkbVxCRA9TVsSAnZWagAA8JAP/iFqpUdY4lKz/LZGfpOy\nOfXEPXSIvJMHDiJeVa0QfYvNQ00oUXElWsJyriLQdmQhsIFIiKDmR3Hz0HPv\nDmgrFk1DzFWelFby2QrFR8tvWEBIlpUW0VF+jXN6OmCeRB5kflirx9lf1Q5q\ncAlayUVO3R8aWDjqtaF5Y9Bq3kV6W7XBTLvc4OojlXa7Z2pFFCGV4bEIubou\nqTHj3ISm0yu53XLvvfYCtZFMAMRC5syl0mn6tlFE8Hl7x30/XCx4PNVw+aqT\nGIE2CeQKYcfb/QSYFdd8eafnDKBZMjtZH/qxpYbE6MKtpV86E3NnAxGrKYjz\nJaFE6Gs3nT92hheOkUY8YZa9W5nn3rHqV8KgyDGEJ5WsIxQ9kPVqe2bbp9XF\nhBhOV3IsnCe7+vSq0NM/Xh7mUFjfhY/e+HK47OmrZ6KA/HjOedyZ0nl94fKr\ntvA39Kq7L9J0+GA+qbhYUxoUQuK62VFT87LQFlg3yi9wP3FxwvOuMz3fBxsD\nFPPsS4M8UuqbytkiN6w8L4gODK5c+CuUOUVDEZ+EBaR4AKbpF+ccplSl5zKD\nHwVdz43kYERfRgys5aSEA7H6PdEa4+cHHGHNbaTJMJIL6nLRD9oPchtelPGd\nXQC8TJiuw3BqmuN2wm2RVnlHbUyDSjoUXOfwxiVYcQSsFZhHZV98ofl5Gqqb\nnRv7\r\n=i3tu\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"02e686390dabbb1590eba968246da65476db162a","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.18d147e27.0","@material/rtl":"12.0.0-canary.18d147e27.0","@material/base":"12.0.0-canary.18d147e27.0","@material/theme":"12.0.0-canary.18d147e27.0","@material/ripple":"12.0.0-canary.18d147e27.0","@material/animation":"12.0.0-canary.18d147e27.0","@material/elevation":"12.0.0-canary.18d147e27.0","@material/typography":"12.0.0-canary.18d147e27.0","@material/feature-targeting":"12.0.0-canary.18d147e27.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_12.0.0-canary.18d147e27.0_1620161904674_0.6916658814688206","host":"s3://npm-registry-packages"}},"12.0.0-canary.b9984794e.0":{"name":"@material/slider","version":"12.0.0-canary.b9984794e.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@12.0.0-canary.b9984794e.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"02530cddb2424e26d4c9f73f7043eb7d92c01b1e","tarball":"https://registry.npmjs.org/@material/slider/-/slider-12.0.0-canary.b9984794e.0.tgz","fileCount":38,"integrity":"sha512-IfJ5Fmrdx01aJUXUmP+aa9ZizXjKi4mr2itcPGIZNkHPVpCQNIKhwCDAQO18GabmUv5Q9iDJRUEDtrHS4ZWu6A==","signatures":[{"sig":"MEYCIQChHFFor3YFpJMZi5TPk4c36QibBP+17DfhIMGIawroDQIhAONHw+wZrepGV/omAVQcgVqIkAt2AUCFHmnaUGYfRluW","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":837627,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgkdK+CRA9TVsSAnZWagAAdRYP/RwMlb1EtqpAGrLoQbr8\n2JLVA/27n9ByL597U/IONAdQf9W210hrTk4/hiCvv38qvMS5Qqiu734CvUEA\nFLOyLMlmoxbCuyi4Sw8HcdUkf67XhcB39pUVl+SeHtOPTj2r1vjtvxpLMurV\n+qZnwuNuQKSqpHctjg8SS5cuy6fR4ipeS1zVsF1IMYZRKyOovgoX6EJOmVN3\n+btMbBxBQ8xqFBeDrBTRuu4bUX1WNnG9GaGppMUQmlYTbP3UED/I70ZdpwGD\n8LG+IV2ZG7B+yd3JnrrL2ID7AMLfk5kn25RD2aGzEHbERVZCz3NS0SmOh1d0\nVt6MWlfUTGE8qrtadZ07mGgLi3ciKDh0vYA57BThc9NjOHXyU9qvMi7A4NsC\nv1vNzVr79cu9AyAFFO99Ac2dHY5XQc7ISUErQz8YS9lSOiadLNPS+kg6ct6o\nTG5gUhC/GYcnOri7bCzEBKHgZPbFVHjhDjUnYjHgJOPbTfPS/iOSR5B0pnGI\niv+xmk7bXSiD9nNif1WY3MZDEsk4x6AgIGvzulFIn+OZzFdVw51URewdURJJ\nkBliTTGnbieQ70uucQRFyQDfG8FB1+eRD0YeBIf7ZjJZut34D1dARBpi9/c8\nQB1BcE2ARl36+/dbh3hJ+FNvNS/2TnRWKk5X05KwczWfw/z/wsIk8LpcwIC5\n6awY\r\n=OhgO\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"b9cb2c88737add4e6d3e04893ef4ca57b7848549","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.b9984794e.0","@material/rtl":"12.0.0-canary.b9984794e.0","@material/base":"12.0.0-canary.b9984794e.0","@material/theme":"12.0.0-canary.b9984794e.0","@material/ripple":"12.0.0-canary.b9984794e.0","@material/animation":"12.0.0-canary.b9984794e.0","@material/elevation":"12.0.0-canary.b9984794e.0","@material/typography":"12.0.0-canary.b9984794e.0","@material/feature-targeting":"12.0.0-canary.b9984794e.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_12.0.0-canary.b9984794e.0_1620169405975_0.5349643653097591","host":"s3://npm-registry-packages"}},"12.0.0-canary.b76f5fc9d.0":{"name":"@material/slider","version":"12.0.0-canary.b76f5fc9d.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@12.0.0-canary.b76f5fc9d.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"fd82bf4be4bf380992963124801e13d3d5131cfb","tarball":"https://registry.npmjs.org/@material/slider/-/slider-12.0.0-canary.b76f5fc9d.0.tgz","fileCount":38,"integrity":"sha512-xDSQhh6IufTqVGx2Pp93Tb8K2oZwgdlbaDha7oxqs4Pu05I1eS0XsYASHQfgAxQRZ4hR4g6x4/XYpV0OrHDnEQ==","signatures":[{"sig":"MEUCIE57+c5fAliYUW65eRwTAXmXE7VYNrlicz7RDgwO6k5MAiEA0PfgDjGaDMMLNHuLdCZbRqCL5zlqbbJfNiy2V/QIkn8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":837627,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgkdOOCRA9TVsSAnZWagAAEysP/RG2LZOjSfQTVMkTjFTZ\npXvXLREwWvD1eexQU/RIlZ8gBmmsi6kV1IZOLLgK67ifLd688yqO0FTEXLUi\nb4zGJKx/E3DcpBmfOcQ6o44uGZRPtfjNVDh8JNNslCswW5jx3hw2M6il5l0k\nGURI4A3apqbkl4uEDYYsPblX+EGSd9vU6c3LjZdmzlpDSbB2A4d2fUCUVpI6\n+D2+0U4RgB4VP+hrp/fKmxxCPEe/ueeXg7fxSWXtuwp/hHBgrZXV4BNmQ5DA\na8xTerjAoyEGUfIJXzhaf8dLyFoMhm/CK8dfhsV4ZYn0CCg2LFGgDQjiLRsW\n0msGsUdDYKjDzevaUwBsgApVEO5mKj83K3mAYqvn+XF/dsEgb7/u6gUk0+v+\n7W0FMA9e9B0B0Jkc1RJ4h/xuZdGtMhBGNPhSQmKDMTZ9PP4n2iI7/oweZTqr\nRD8+VyiCDtYgDZQml2g8esoetUomjUE8etfdZSwRtUYRXJyg1vsuqwKw4hv3\nUPkGwpd/v051tQQtZm7UUI/pGrLiSdKXF/5a3cHzkk7jPQ//PkZPs+ZkAC5q\nWylh+RiwdcXNVMU8z8I5nz62olRpMfJAnvzpKxdACrnlciovRt/pd16015Li\nOTR0Iq/HKSnXlAphZ5jemsE8na0agnRHXGA/dgsvPozdAAqfbmaQeKeGmCP1\nsX0Z\r\n=v4NB\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"219c30995da49f5c5f458aa1b983f09054c2d4d4","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.b76f5fc9d.0","@material/rtl":"12.0.0-canary.b76f5fc9d.0","@material/base":"12.0.0-canary.b76f5fc9d.0","@material/theme":"12.0.0-canary.b76f5fc9d.0","@material/ripple":"12.0.0-canary.b76f5fc9d.0","@material/animation":"12.0.0-canary.b76f5fc9d.0","@material/elevation":"12.0.0-canary.b76f5fc9d.0","@material/typography":"12.0.0-canary.b76f5fc9d.0","@material/feature-targeting":"12.0.0-canary.b76f5fc9d.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_12.0.0-canary.b76f5fc9d.0_1620169614229_0.5906407051739286","host":"s3://npm-registry-packages"}},"12.0.0-canary.055d4f10a.0":{"name":"@material/slider","version":"12.0.0-canary.055d4f10a.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@12.0.0-canary.055d4f10a.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"1c1518d09034d6cecc29a1682973c59dca3a6802","tarball":"https://registry.npmjs.org/@material/slider/-/slider-12.0.0-canary.055d4f10a.0.tgz","fileCount":38,"integrity":"sha512-wyryqoY2tyR1FmD+2ojnj5B0ifQdLTgBE6gS4gK+7vs5NK08SGWMiT3g+8yeLX3Hm7sX3hDiwxcy60Ll1LYVfw==","signatures":[{"sig":"MEUCIHnYNMB6e3pkozExJFzUs1dVnmZW4aqmN9XDZSTRmRe1AiEAwQWLtKkAv40SOBHPXSCMkkcJsz9UrNq3n/U+P2dBTqU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":837650,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgkdcdCRA9TVsSAnZWagAAPH4QAJ4G4I4QUHLKILv7/C7r\n9lUNuLoSnEIGgz6tdx7waE/Z3bAs1zb/4Sar+jzaub5yWObn9FSVrd9RE2c4\n4QYw1cAha3XwZGVISs/kIec0h14komGfTtu9klgcOqHzft6DaWt1bMSvAxLd\nAecQS3XtVsFMbiKMatlBcpSd7O8hx6lz/S76YLVCvHAv6pwYS6BIQzragLLV\nvkDfW9iVPeTCuFwt9nB4WLvHAOj95HN6NKd/SX/BMW5rTwn1+h13z+KPE1QN\nQtgXLJDsmUeP8L0RssyWnNawym/7Q9GNjSW+txulxmWKFQt4fx/FofntXEWD\nkAmoEjktAeZG9y2ukvVeCySgSRpzZJOVrxE1PONh3NNPVNhg+yZB6WVm9LXI\n3+w/5mLJ69Gj/u+vseym4CTv2+3+nCBs5lVepjagQU9PzIpYHguR7DmnG54E\nL/TzEtDHRi0+zWGv8UR8WhaYEoBgkiYfezZoJDUUQcFBnC7KoeL/uQyWGpe2\ncnhIV007nuqUzDOR3+9IZGCL3KwEjOefPj1mHDHuklL4E57tylc2NXmw9NO4\nj45kyn/CFgrwe3i/MRFFE0aqyp9sxd0p3qlcWdSiJU8XwUiEtclX8sbtNalP\n4D/QSgAqPyTxfKhA9uAmVTa2ZdX3CzykZ8cinG4dmYPlrZMAPVFHthi9il5U\nyj0r\r\n=yLOE\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"df8d3cdf52cca2c339c1fa1cd18129db35422c55","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.055d4f10a.0","@material/rtl":"12.0.0-canary.055d4f10a.0","@material/base":"12.0.0-canary.055d4f10a.0","@material/theme":"12.0.0-canary.055d4f10a.0","@material/ripple":"12.0.0-canary.055d4f10a.0","@material/animation":"12.0.0-canary.055d4f10a.0","@material/elevation":"12.0.0-canary.055d4f10a.0","@material/typography":"12.0.0-canary.055d4f10a.0","@material/feature-targeting":"12.0.0-canary.055d4f10a.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_12.0.0-canary.055d4f10a.0_1620170524955_0.088546291501989","host":"s3://npm-registry-packages"}},"12.0.0-canary.5b6a46016.0":{"name":"@material/slider","version":"12.0.0-canary.5b6a46016.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@12.0.0-canary.5b6a46016.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"0a1b4e2d28d8af16677fd1b98072e8b6b829a9d8","tarball":"https://registry.npmjs.org/@material/slider/-/slider-12.0.0-canary.5b6a46016.0.tgz","fileCount":38,"integrity":"sha512-Wu+7HvEOMKLTyzEYspkjsqWesbgdiVa+IUgJsGM3J46TwnEvUWThGFVmr59KzQG1280nnVxW9Sdk1HwdHdh1BQ==","signatures":[{"sig":"MEQCIEYRNn4J4S+TBG62REmdyzz+LeEmNShC8L92pWFeYOM3AiAVGMGP6rgKrfn6OGBLgDrvl/gYTvN/UPP8aLZtVR2uWQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":837652,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgksTmCRA9TVsSAnZWagAADt8P/jbAEjE9Zne7oGCivPGq\nQ5Wul2bS5C+W+/gQ27oyNlvq8BhsMYzea2Qtj2mSzhFcd/v5SRxl32+OCy3z\nTmCQkuWW1p1KCmOwbybteQj4U006O5MNFcS3htszVC1REv70jHDqQs/iOhow\nUqQIvutWX2XHIYymnD66QmIOF6sl9opk1f2G4M4pcEP0w54n6otFPKxNJOUQ\nSlVFHJX7EKtS5hsvHScQZqNugkYHA8NkwmXFGUxyjr4dUM46P3d+HTu4br8X\nE260Lqs3kKXFMOcB700actB3nc4lZJ1zJLZ1uXJNigI7BKV8icLzwABM5rrZ\nCiT+cHW6Za4f9uFM83fTvJ/OdSFi7YMeF8mvLx/wRammrryEvr4zltFNRbQz\nFa2fAQgWn7gRL+MTU+06IEd9iOFGZG/sCznjh4txyLLtEKvw6NiqU1VxxAzv\nGavHmtHzAQBxFnCjVRCL5495STcErjVF0GS9jC7EsCsYFYzX/MJsjhxNlyht\nEX3LDlzIfovXnUT7dbBPp77W3qLYp8oJjqeF4NbcvkwklZzBbRiSGnp7Gqf9\n74Ir6OxXgG2KB/6OLF/hryGtpHMjHUOMpejBncfgMxXYIlQGyj9UZw+YDOOc\nCEqBhaZS8LUAin2cbepshnXK3PXBMp79SCWIcgZ/8yq3AtlPM4N66fQYcb1e\nB3lw\r\n=I9Kj\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"3d9c7e3c179062db8b5bc243e8bbfbd9d9132e50","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.5b6a46016.0","@material/rtl":"12.0.0-canary.5b6a46016.0","@material/base":"12.0.0-canary.5b6a46016.0","@material/theme":"12.0.0-canary.5b6a46016.0","@material/ripple":"12.0.0-canary.5b6a46016.0","@material/animation":"12.0.0-canary.5b6a46016.0","@material/elevation":"12.0.0-canary.5b6a46016.0","@material/typography":"12.0.0-canary.5b6a46016.0","@material/feature-targeting":"12.0.0-canary.5b6a46016.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_12.0.0-canary.5b6a46016.0_1620231397390_0.3750793018138179","host":"s3://npm-registry-packages"}},"12.0.0-canary.33c9a737a.0":{"name":"@material/slider","version":"12.0.0-canary.33c9a737a.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@12.0.0-canary.33c9a737a.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"e9a059df8fae9a937cd1532dbcaeed191a306b0e","tarball":"https://registry.npmjs.org/@material/slider/-/slider-12.0.0-canary.33c9a737a.0.tgz","fileCount":38,"integrity":"sha512-LWlM6zPqcO0DpfPK3gRds/CUJGVGi+kNzznFshp3cOKe+kZAEqIvTBZvpaEbCMEJnJSD5aqbNt51l2s6TAXEMQ==","signatures":[{"sig":"MEYCIQCVsSZunEx9vjZ2LCWdBc/ER5pjV1zWxgb/Fyv+UoNV1QIhAJ84QT5enZxQ70dn5M0Dd+i1jit2CpJD+YDZoSv3YX0l","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":837652,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgktWGCRA9TVsSAnZWagAAkv0QAI9WEMDgIyhOKZFBFOJx\nfOncECniBnqPES9Q59GQE9X8h3ln85ptvZGU6UgDkH6MQ8FYvcfnRp32O7jE\nJzrKe7JjzOKlLn0AHgAGPKpPRyaYFaol/Zu1Oo/DPKRvAsFwCl3UJSTRKd+k\nVvzjWZkQFUGXzIRL6DTNpLoW33MOf9goMXuPkkmp3rD2TU6rRCCf7avjZY70\nWSoTRrHwURm2ybaLeUCkKI9BaPMy1jfvibxu0Ba5J1eKYefhkOLFch6LrjeU\nbmJNbiTq9veyp+6A8HbXEDhE8QD3p4Os2X1xs1JhjHKpNY5ZbzALa5d/bGVh\naPilMIAwHzVWrJT11nYvF+Enbuc7AEQ7Yr7QsxWCOqZWIxcDYGUZuL/D2gix\nt9fq9lM6qYg4UbomVTYCoFgRvJx4tgtz6E24V/xm7BP8U/ZawbZQLwG0UwEC\nzpsyol9KQyPoN+EVP/uRoQ955IawougNQWvHdrdvBJj7pWPDMEqTyvdXgm6v\nrJf0OxgEKdjmi0jWsogU7hs37YlOBwcLXnZGJpGB6jLRzNbSudNN3yaMubzK\nfxWuIfWKWAGwbboJirgdv4MEebCnYUvCL7sAZ4n9O6/O2HmejffCOv38NWxZ\nj0WMMtI/4ojD7quc42jhePh+K7CESDS7cGCmLQGpXZ7/mzO985HneT+Kp6Kr\n2Rnj\r\n=bm/E\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"fa5c97d28049bf03f5b138c0d97bdc267f43c363","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.33c9a737a.0","@material/rtl":"12.0.0-canary.33c9a737a.0","@material/base":"12.0.0-canary.33c9a737a.0","@material/theme":"12.0.0-canary.33c9a737a.0","@material/ripple":"12.0.0-canary.33c9a737a.0","@material/animation":"12.0.0-canary.33c9a737a.0","@material/elevation":"12.0.0-canary.33c9a737a.0","@material/typography":"12.0.0-canary.33c9a737a.0","@material/feature-targeting":"12.0.0-canary.33c9a737a.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_12.0.0-canary.33c9a737a.0_1620235654416_0.49527558217802015","host":"s3://npm-registry-packages"}},"12.0.0-canary.9bc0effaf.0":{"name":"@material/slider","version":"12.0.0-canary.9bc0effaf.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@12.0.0-canary.9bc0effaf.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"13104d21ba4833b11ac504d712a15da813ef0997","tarball":"https://registry.npmjs.org/@material/slider/-/slider-12.0.0-canary.9bc0effaf.0.tgz","fileCount":38,"integrity":"sha512-79TjsqVDdIvKLcar1SrTIcTXPT8yWPDX/XVdZVdDxxfc3khPh2t7naPY2A9LsyptYNzkEtCcrOFnNF05MI/LnQ==","signatures":[{"sig":"MEUCIC1Vkj6FJUGbNgcJKUGE6SCw5fEavkIFN3PyPsms5BRqAiEA5LVQF338Gqc8I2cIUbpS+Qq0Ktj14RPoJzAN2zOfBrY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":837652,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgkwdlCRA9TVsSAnZWagAAp58P/1DYRwHANw1Zr/qlKp8j\nu3/6jcZfroQPEFL9K/WJ4O4zytJZuUlf4BOdRIef24UlQtZ8vACe75pbc7kI\nLGzNx/LY7gX93X10+xWoBbXQK5F/tqcm0HXeP7LEUFEYX5Wh2K/ddgF8Qi4i\nG7vTlTSEhdNz7z9ZVN30eEX2+BZqBm7kLsvTv0KVLRx777Lz+1w8u6XBP0JF\njh+qZCnI/T1s4gKriQTCekmMIp3mfQ3PAwqHdlDXdJ/BE0J8m8H0A8eZa6vY\nLv9YxUFqnB6hIlcleokF2QRw1n+CVUZAWwVygxFjF/0YeVzJpzapnPNbSU5R\nNYvGkc4tx45AkM3GP36fBReTqzH2BX9qt7n5H4AJ6qAAr69mwn+4FaE5k7p4\njcKb8bsC3jj5wfQhJHMNpDONqh9FXGP7/2JGxP4kj1CWzXMu0x0Ag7UmwRoW\nXlWrku1l7UnpPnPvhoAltG3HW4KO3E2g5neexT5vwUJ7SkM0InIBAkeKaALk\n7e8eAOQ0riHlaQWb2rZ2ljR5U9L18c4wWbsOxKxxxbQ+XysWtPbnWLSFoFA+\nT57UuS3z55XqQatN5jg51MDur9XxtZOx6p/LR3/dU+XWNUy/JFfx6Dg7DJ/k\nzRP6sKodhJCHM9hWl7FlGwrtmg4VrACPsB+D06MT5PBoPc9hP7VV/FhCepP3\nAp75\r\n=EEx7\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"e671ae06efdf42f7ea0cb40bb6700fc57f6a35f4","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.9bc0effaf.0","@material/rtl":"12.0.0-canary.9bc0effaf.0","@material/base":"12.0.0-canary.9bc0effaf.0","@material/theme":"12.0.0-canary.9bc0effaf.0","@material/ripple":"12.0.0-canary.9bc0effaf.0","@material/animation":"12.0.0-canary.9bc0effaf.0","@material/elevation":"12.0.0-canary.9bc0effaf.0","@material/typography":"12.0.0-canary.9bc0effaf.0","@material/feature-targeting":"12.0.0-canary.9bc0effaf.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_12.0.0-canary.9bc0effaf.0_1620248421126_0.045202807757068086","host":"s3://npm-registry-packages"}},"12.0.0-canary.a1e0f2af5.0":{"name":"@material/slider","version":"12.0.0-canary.a1e0f2af5.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@12.0.0-canary.a1e0f2af5.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"5617fd9100bc4623ed48c8d6ae8c5fcf76388c7b","tarball":"https://registry.npmjs.org/@material/slider/-/slider-12.0.0-canary.a1e0f2af5.0.tgz","fileCount":38,"integrity":"sha512-rGAXoKDWzSEWzKdo8jFDRR6QNOmEZAxhra58aEGEIjArDvTflQDSZTA6GcejlEdvyp8Dn7M0BLyMZkHO2tUwtA==","signatures":[{"sig":"MEYCIQDUjQdzoczxU/uRKj5d7cpbWm4c6KTHWaYwBz6UoZlX0wIhAPx7ymuz5dIv9DO8075vy5CW3+y5rQGtvUn1z5q1YnWc","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":837652,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgkxEBCRA9TVsSAnZWagAAJvUP/iC3JwzfdvNbV3kQpU0x\npugzKJwmi05gKcF3R4TMFTNx4AaykqFz+68FdqOATi+9JeSmgtixDpYJHhhq\npXrhuSczmylMWljLhmOWDdJ2ThCs0tU80uTWjqiLE4XNWpw6Enl8hL9JZwRB\n/rU+apSCjIvl3P6PtZ6TVr+1twuNsN3Rhu6LuvTl5oY7Ja9a2Jame5hzOIMc\nOVnVzfXmwE3VqX+8ycNNb/W9XNLGcXTXi0pnw4Re4cPN3IWdeMgDvp5lr17h\neYto3Td2OraCCuQAtjwBVZWnmUOjLNaZ//4e5fRt8yiITMkI7fY3faKjbB+i\nrd5uzz5rJ9BtD2DJropr950DmdPNyP8r3bsEBhnFJTxTIh5T6r9ycIm5ZHea\nnYqVAn+GxJOpl5agpGHj7sCFRGd4GPJH6ZMIwDvI8bLcfa082ACtgIVMygcV\npK6ML6+XivRvESYtHjyPuI881VHGqqpJw5eGey8vaiJf99beHrrok9cfbQ2s\nYPoyJnjewTT4xrRs5iT3nh0oVSMR+X0ELvZ+kfHHDpiYxH+mZ5Ov7MM1VLrT\nUhqlVfpi50gr35wNbT5seXnFqjQ0uaOdQ+oGO7JVe6xcTnlseT0Qg7AarxhC\npb+XyAWfC8qEE1lJRhn9aJLWByZxHegKklHIWoJEDsuH1csXwU4pqAOdIReQ\nhUGn\r\n=ENNe\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"7e20a4b86d7cb59be9ebe12cead11b1e8c7bb63c","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.a1e0f2af5.0","@material/rtl":"12.0.0-canary.a1e0f2af5.0","@material/base":"12.0.0-canary.a1e0f2af5.0","@material/theme":"12.0.0-canary.a1e0f2af5.0","@material/ripple":"12.0.0-canary.a1e0f2af5.0","@material/animation":"12.0.0-canary.a1e0f2af5.0","@material/elevation":"12.0.0-canary.a1e0f2af5.0","@material/typography":"12.0.0-canary.a1e0f2af5.0","@material/feature-targeting":"12.0.0-canary.a1e0f2af5.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_12.0.0-canary.a1e0f2af5.0_1620250881174_0.39045668467542094","host":"s3://npm-registry-packages"}},"12.0.0-canary.06930c96b.0":{"name":"@material/slider","version":"12.0.0-canary.06930c96b.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@12.0.0-canary.06930c96b.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"93ee8e8375d7ba9b84cc1925473b4da95f55e80b","tarball":"https://registry.npmjs.org/@material/slider/-/slider-12.0.0-canary.06930c96b.0.tgz","fileCount":38,"integrity":"sha512-vGIdVhkcBozLXeUHvHOPtCNkfAIFq3aI/EwgszLQLAkwiB8om2qqDmnm9NtU0Ml4dzMhQuOmZ+Wty5alrMFBZw==","signatures":[{"sig":"MEUCIEhOI5dblIKQOhlBcr4wyDeNVWxwCc9kPPBQw4Wc1hZoAiEA65Fi8nR5mUIzVLplrPf0fELi0ursovb4NdB1uhQWE6I=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":837652,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgkyy4CRA9TVsSAnZWagAAkp8P/2S6tts3TI9aB4lflA3I\nueW9Jz0inajzYfQgHiBNQZ1kMpG2rFSxAZggezt0FMCNuLREOa13EwxIjHXf\n89ItHDP83GkXdnMN1suoto9K92B/5subz5zNqJa45OnnFT9H7ltjPDRWY1TU\n62EiZe9L5PXW7UVusjRULpzKoJjNsinttQ4MM/WyBy0DG1koueWwvIhNvArR\nPXGVsEB2EIae9sTW2QFMWKJRHXqATxDr+TDsxnce6SQqqOSZ/XBGwUtDF1RR\nMpI1yH4vi9vpuZZdGTXj3zxKaPCV1hoDhhGAlOATLFFkpC93Yz7fOBBYMSKe\nBsWzkmP+T5che74eb3nP2wOZ/sdstRnIeO/a8DuZz0F+Rhku/zT276/hktQb\n3lQJU5pcZHeJ6mWGtTSpHdJIL9hIQK5di4wGsujkhm5Cif9niE2bIxBQKPUc\nUWSODfbT/6PcnpuAAtck5zGUb20450wsCEh//Tv+4FBE0yO9ZY00jd3f3OlT\nj8n7Dkt75svW7xk4SwQwolacpSIgJAyt9/y8xMI9DTtYlSLtZkoCaGXUT0jr\ngDEAJRqxKpuXR73R8hs2RzyKqcfMuRTpSwMGvIPLbz2rh2vblLKH2Z31AV81\nYrD46ereAsOOAgaXyriDdHox9RhpaVwA7oYwfkSndb609Jmvdg//lbaddPhb\nXQe5\r\n=qwEA\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"aef50df6c5f49244a2b0e5a941794f4e3e4fd21c","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.06930c96b.0","@material/rtl":"12.0.0-canary.06930c96b.0","@material/base":"12.0.0-canary.06930c96b.0","@material/theme":"12.0.0-canary.06930c96b.0","@material/ripple":"12.0.0-canary.06930c96b.0","@material/animation":"12.0.0-canary.06930c96b.0","@material/elevation":"12.0.0-canary.06930c96b.0","@material/typography":"12.0.0-canary.06930c96b.0","@material/feature-targeting":"12.0.0-canary.06930c96b.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_12.0.0-canary.06930c96b.0_1620257976024_0.31930295732614833","host":"s3://npm-registry-packages"}},"12.0.0-canary.03f525f9f.0":{"name":"@material/slider","version":"12.0.0-canary.03f525f9f.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@12.0.0-canary.03f525f9f.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"422813e3aaaa28f58efbdd5435bed2634104f68b","tarball":"https://registry.npmjs.org/@material/slider/-/slider-12.0.0-canary.03f525f9f.0.tgz","fileCount":38,"integrity":"sha512-eWv7x0yleYLGO74bFLjutyV23BLqTIptz7Og72RwoLmpplAwq1rKxjH0XtQfOmpq2aMDVQMrkOWhqHTZpWM+ZQ==","signatures":[{"sig":"MEUCIGBtnHfmYRPVMZhp5IaQMS6F6qcVArQj1NB+WiNld2+0AiEAyJAS9BfAD8jIsd78Ls6UBqv0kSX3yKE+7thR2T8y/KU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":837652,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgkzibCRA9TVsSAnZWagAA6a8P/Av6wGw4g3PLAZBLhKVV\nU+fvsXXTvy+IGdwut2tzGqhYqtfbcbSn6CfZfXKJDlF14C2Vi+fShJfXAFnN\n3m8AwEXF2moqVZgg0/nYhCmxIvTYXPsHy7IiMLdvOdNen698BQwkVbhGt7rI\nctvM3we/CrkmMQiuCmQOrsqlNuRmLjtXlilZkoHEkoYSqwGZL0+LzF1+Giqo\nelHlBU4LYuMLXsOsGHBPDf7tZnV/72o5+/LSOLrs2lRHGt/abkQmsxLB7Q3k\nr7fYv4MX7fdHNUtE9ECkbD5ShU+A0r7LuHO9bN102Xfg1TS8tLLQO7yd57Ph\nu+phFDHwH6OJ9Lh2zhkasUNfBirnCC2FbcV5Em7Ck3FLqvRHB31cdOLkuvjv\nS3GuyrTY376lraP249zbVNjOSvhIMzFtASDsE00SVeMLBz+QKAhVWZj2vjpz\nQs/glhzUoChdQRd4pJDG0y40/taqfglhHSr2EuIuhyzLSc0hUli0HOeikC7g\nTpzZxu3rbm/YHpkFR+rTnE+LxFgHwqQ86Vs+/t58gETnci8K+Nf/vEi/psMr\nBLGyspmx7u4lpfsxuFZXx9/K03Ij/RFcJ/w5EiGBJT4daYPVQJvN3FbpY56W\nnWq4uE2RhO37vE/LRCtDTCpC1aYfHPFkNPuC/y4Mv8QhHgJnuZbvGDtZoi2f\ndfZj\r\n=gAb2\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"f9df1400e21c75e46fe6641abb76d5840dede67e","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.03f525f9f.0","@material/rtl":"12.0.0-canary.03f525f9f.0","@material/base":"12.0.0-canary.03f525f9f.0","@material/theme":"12.0.0-canary.03f525f9f.0","@material/ripple":"12.0.0-canary.03f525f9f.0","@material/animation":"12.0.0-canary.03f525f9f.0","@material/elevation":"12.0.0-canary.03f525f9f.0","@material/typography":"12.0.0-canary.03f525f9f.0","@material/feature-targeting":"12.0.0-canary.03f525f9f.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_12.0.0-canary.03f525f9f.0_1620261018715_0.2409468800830088","host":"s3://npm-registry-packages"}},"12.0.0-canary.e82ba2a26.0":{"name":"@material/slider","version":"12.0.0-canary.e82ba2a26.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@12.0.0-canary.e82ba2a26.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"96ec08dafb63a21c3a6c9a775d2ca80457983363","tarball":"https://registry.npmjs.org/@material/slider/-/slider-12.0.0-canary.e82ba2a26.0.tgz","fileCount":38,"integrity":"sha512-ov57pdqwkmfclCc0drVtNs9nZ/aZpvtIlZNkcWm2tsbdrF/uQ9wV0TiZiMzTE88U8Etnq5J3Toh8G0zldl7vdA==","signatures":[{"sig":"MEUCIBJkJKZJk3kz5Bhl3z//5ZS/N1pzWiXeLGQrfq7ExMD3AiEA+zD+CUCMZQH3mcHSxB4NxVyOq0SQH7wUsBH8afwF5Lc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":837652,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJglBG7CRA9TVsSAnZWagAAxu8P/2bZqXZ47TyBLEgGE2z6\nOa8/5JqVctbNKxdKMJ0n8tdNLq4BHYKj3fFiAIxZ+ky9C8tcwNS3jOWr0wzB\nGd+G/dx3472mwpXh4IAW8Q0osijr7eHdJe7P94x4nMFeo6Q4eJZwT42gKikc\nvODtQ3GLW8Lw/5k+0YRNNU21RHNJCWntfVFQpUanNDGjE0K4nVFUchyCP1gR\nUvaDYxIQ2uN5OZJegS8J5etWnHXIb4GXvk2sk1PUr1V7kJS0Bbby2bPeJFlS\nFNnffToxaSOcoNbTeAryLqnqw0NgmlWk19ojp6DVXw3utXVRKdWH/fQJw0iX\nxg202rqUPGh2cQP7Aj7Ato+oS9TaWCTp92ND792CuAUuzcQ0t9iww+MEd89m\nyg7A0szsLHKnDycq1txd2idY/W1SrTpSddbsUdHFrRwD+rNM08HeDT26TFVq\n9TZ+EIWVhlDFRnOmu6rkwIq5WbvG5BDJ8xJWGvHQFB8GJ94ymJOPm0QxJAFr\nifLmeaWWU/rmKh9c3+YeozpmGTYp9C6YgqnRPhRwKC9z4krhg1v6mFsQrFnk\nr8oc4wLhCFe2a6ox7nRKO5eFqeIlGzPEpRvdA660Ed08lRWxQiLPzWy4Od0b\nHdWnGcHVmlOVs+ANhpYJ08aOoz7Fd6IHtSFi6QYM/sOXkMx1PYb7LyKnaYNf\nJ5GO\r\n=ZJ56\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"c3349c46dc5415cbb89b8260a8db012f44f09eec","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.e82ba2a26.0","@material/rtl":"12.0.0-canary.e82ba2a26.0","@material/base":"12.0.0-canary.e82ba2a26.0","@material/theme":"12.0.0-canary.e82ba2a26.0","@material/ripple":"12.0.0-canary.e82ba2a26.0","@material/animation":"12.0.0-canary.e82ba2a26.0","@material/elevation":"12.0.0-canary.e82ba2a26.0","@material/typography":"12.0.0-canary.e82ba2a26.0","@material/feature-targeting":"12.0.0-canary.e82ba2a26.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_12.0.0-canary.e82ba2a26.0_1620316603176_0.37026919588522667","host":"s3://npm-registry-packages"}},"12.0.0-canary.fc7c4e5ce.0":{"name":"@material/slider","version":"12.0.0-canary.fc7c4e5ce.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@12.0.0-canary.fc7c4e5ce.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"9d0ab8d97e3a0ab9361ab9fab89fb439a639c5c7","tarball":"https://registry.npmjs.org/@material/slider/-/slider-12.0.0-canary.fc7c4e5ce.0.tgz","fileCount":38,"integrity":"sha512-nFsz7Aw8bI5cyMYayIrm4G1jVC2kTw9bQgR++bSRAEfVtme6EzrHLImQuHrrPFXLnEmUmJuR4VLPxeev1D2u8g==","signatures":[{"sig":"MEQCIB8+cqp0QC2ADNfs8J7jurDuBpXHPkRtiAI8MqsIZ9ohAiBDDmMBsfcEzdnZ5u9n+fTvwfMoAS9DqsvaqnXufn2Srg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":837652,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJglCeFCRA9TVsSAnZWagAAUqAP/jq0DGjhl4yVpyg9lznZ\nhVL/1kyD/IgqqwyAckQqBxGsbd1XehcFrnNTYM3hjlmbzkY8FR7NWFeo4geY\ntEjo70JRQvcXQwCe2e32akRcrTqdCf6JwA10cWsLCuiGXjOpNckwefUhubxx\nfXYJ3cc91f+EsCii8Ugy2JtqKpXOnrORMI7sInNgbV2PHal1M5b9PvWYxC1f\nGF1kWwvDBW9eaT2J0DdjtXLNtPGPSzUBJ3kCJKKUMe3m/Lg+y/cAUOdeFL6n\n2O6+E3+zPr6mBPOXiqkZwox4scVUWJJK5fpiuwWCOxgGKoiaDtS5d/gVoTy3\nXNr0ta/LT+Q6VTo1/W3r+uEb3+PthIiUtjh0007orFukFbB9oULaetRlxLWH\nE9udoX3cyk21VervLu6kth1t8eEB0aDdB+vLkYKqV3anPiPM6n8dI4NbyYHQ\nwJUTCCi+SxSb7vn9JzeJHpzsfkhqlhW6OZSOW4zzkdv5Q+1lQELQ9pPJaYZX\nseLQ6Bf4ZsNhIDS401r8VP/qO9h9fJrrDjWNcxLDW7BDb+kqM3GBRap5K1qQ\nL9y0K11ibiCyYD8mu+ootqWKwlFzNZfDW8Gc7iBR6Ri0MVOCAoA9L9QVzW8A\nn2UpBahHN/jN247lrosr53/qIrnOXGWENcHM62mJsQHfnaa191OGkhOt5Nhx\nRt82\r\n=906m\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"b549929c65e0a33cd9d427a600513c663c2dae28","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.fc7c4e5ce.0","@material/rtl":"12.0.0-canary.fc7c4e5ce.0","@material/base":"12.0.0-canary.fc7c4e5ce.0","@material/theme":"12.0.0-canary.fc7c4e5ce.0","@material/ripple":"12.0.0-canary.fc7c4e5ce.0","@material/animation":"12.0.0-canary.fc7c4e5ce.0","@material/elevation":"12.0.0-canary.fc7c4e5ce.0","@material/typography":"12.0.0-canary.fc7c4e5ce.0","@material/feature-targeting":"12.0.0-canary.fc7c4e5ce.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_12.0.0-canary.fc7c4e5ce.0_1620322181056_0.5174627930671023","host":"s3://npm-registry-packages"}},"12.0.0-canary.65c04514d.0":{"name":"@material/slider","version":"12.0.0-canary.65c04514d.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@12.0.0-canary.65c04514d.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"0a447bb6dd6b14ccb4a152c29f0d39959e7abe5b","tarball":"https://registry.npmjs.org/@material/slider/-/slider-12.0.0-canary.65c04514d.0.tgz","fileCount":38,"integrity":"sha512-cxMDy5md3V6Hv4OQ3dre8S9WfW4O7Hqxr5le4tyy2lB8zd1nGTKGoFALvHJMEaCUJprbDS9gtuCOfKRGaNHCpg==","signatures":[{"sig":"MEUCIQDDFjrWpQyuVkx8CSnLQYXVKmP1poLpIHg1XJ0DWdYZUwIgIyHMBEtt+hMkarJjXb7S2qUFdQel6tNYXGk1Ag1Uoec=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":838390,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJglDjrCRA9TVsSAnZWagAAACcP/j1kTjtLynO/MB0nzfJ3\nDyp30edjdjoi2HcmbFZ+WJiTdzKhgi184CfefbFETw+W26upOojVpr/jwF7N\nl+qSga2l0Mzdph2+3h5F0Ubilcp6SvFa3HrScGQ/SCHapzaxgLzvuTt16YBs\nK4imzeTJsFNgBrchcD0Bx0q2mhyoPIRs9ENA0kKbvhRrRNpGoU3Lt/TSCfKn\nlGjf9viJIrloixAnKeyIT8u7JEgb3DM+CAAaR2SrSbHiVmTp3lkjlFu+tAX4\naaBlM/gtvnrsNSGXdW3+5C+zaMCsSMP+ilTHLLolvXHMilhv/cg+eFGkwG2/\nG1eN3hUb/BWYJdHX1DEeNV/Hx5FoCYlqNRY5pSfpeNgsCzaEdLDy/TeVQcVB\nvTFoxALqm36BdRI1IzBO5NiDT3Nfpr1dEnhCXNZZhhAXHHxfHyEnwPXhqjGQ\nrFvW3KDXLrfsNu7rl87ppFBWeSbzv2cwx+z/9M7oMcBefB3C4OYFsgLOk02x\nb1St2iJ6TaL6xDz2SnRHPIJn9zX0+bk1YZvupaKUsqSbOMby7auBCdELuE27\n/aptCb3Jz2y7dOZALIOHnMOHMe54xKagauUhobfo4BECZOvHFlqISvIqLEG3\nXhNy41782/KMSQkFinA7ma944PVmypNUut42jDI5bHPuWaCYJHTSE9x9xPMM\nxP2I\r\n=1kIQ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"01ca5daeb81d99750f9020fc62e04bc76085858c","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.65c04514d.0","@material/rtl":"12.0.0-canary.65c04514d.0","@material/base":"12.0.0-canary.65c04514d.0","@material/theme":"12.0.0-canary.65c04514d.0","@material/ripple":"12.0.0-canary.65c04514d.0","@material/animation":"12.0.0-canary.65c04514d.0","@material/elevation":"12.0.0-canary.65c04514d.0","@material/typography":"12.0.0-canary.65c04514d.0","@material/feature-targeting":"12.0.0-canary.65c04514d.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_12.0.0-canary.65c04514d.0_1620326634895_0.14381978903548998","host":"s3://npm-registry-packages"}},"12.0.0-canary.c97779ca6.0":{"name":"@material/slider","version":"12.0.0-canary.c97779ca6.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@12.0.0-canary.c97779ca6.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"48347b8c23224c302c47cd95e74c6e58ce245c33","tarball":"https://registry.npmjs.org/@material/slider/-/slider-12.0.0-canary.c97779ca6.0.tgz","fileCount":38,"integrity":"sha512-qg1CbLT8Koycvn7TWBl7WEQAvSPqO5ITzGK/GihS0uEgVjDBBjyrXJp6Yp97xhdsn9JXfXpAFwtgB+EK/hEmzQ==","signatures":[{"sig":"MEUCIDpQYalyzmTLrX6Z62ihLn1ppFOTGTkGsXOSvhpMYOuqAiEAqE0ZlwAX9okWwOW02lnHgFnDvq2+8z5PhV5WJtbIPAw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":838390,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJglGMACRA9TVsSAnZWagAAKy4P/AxMFRlHepmPQwlOnScG\nxvLAFuGIOUB10NgbbuzT7BQAaALDw3CJlFnPum3Ng819A0QIYNH6jzDxm0To\nrwFsNCAgLpd64eCRragxdqM8mDAF5tLWNHmQtjAm6SWC6BVx+eZlIxAG5LDh\nIDhKbEexg1g+e4JwfdH/eMwbaun7G8n5RQGS5qUIWl0OgKwoi8gx7jbA5LwK\nIzG8Zuru1RmaK7qfBEze11NJyUTRQaxhU2kZ6u0Vxa1WJNs5k192HfQsqu0J\n7gABG7STst78Aa6+xzkDc32nuSSOxW4EKQgp41nbPA739PfHqsMY+MtMI6er\nMvFKySHVnfB7YzPyrGUWcdnDKoh2GOxNqWn8Ro7gET79h7ESrDM9KnnzGxDU\nv93DCta8kDIwoUrtfX1NEXWqMaBoBlXext+1wYqQdZu9SAtemYkZp0lbdDIS\nO2Px2E/2OgExlVjT/v7kYYSuKKFts39yUt+FY8/EobMykFDTZcA0VaGXwnvJ\nEoEqx7cMqWCEFIXH/Li7MpxearTi5GyutlUY5hRMJQsnYtBIl6bH1DNcBfKy\nSMGG/Fg5AzFj1apEY2eqp9VDg/O4tu/M1uSUOVXUXnUgErplDSUDM9fum/Xs\nxy/Z97zi+y/dNjk70Tr6yqcXBiz36bAqVlXGDg2RBRMLBVHIBVYEZd+aYuuh\n6J4g\r\n=OLWh\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"046f80118629481ec1af7c937a84ce6e0fd1f635","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.c97779ca6.0","@material/rtl":"12.0.0-canary.c97779ca6.0","@material/base":"12.0.0-canary.c97779ca6.0","@material/theme":"12.0.0-canary.c97779ca6.0","@material/ripple":"12.0.0-canary.c97779ca6.0","@material/animation":"12.0.0-canary.c97779ca6.0","@material/elevation":"12.0.0-canary.c97779ca6.0","@material/typography":"12.0.0-canary.c97779ca6.0","@material/feature-targeting":"12.0.0-canary.c97779ca6.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_12.0.0-canary.c97779ca6.0_1620337408012_0.5889610946050294","host":"s3://npm-registry-packages"}},"12.0.0-canary.869d890d4.0":{"name":"@material/slider","version":"12.0.0-canary.869d890d4.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@12.0.0-canary.869d890d4.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"de514679ee4913e20523414e98604bde2f0caf5d","tarball":"https://registry.npmjs.org/@material/slider/-/slider-12.0.0-canary.869d890d4.0.tgz","fileCount":38,"integrity":"sha512-kjlrnzSlZgUFW1pSSN659Vk0R6bRIybxZk2NmLF5gd+YwLNlcgIcGL+1DT3Ub7EjEc/HTRmmJ6d1GkjKRZJ9Jg==","signatures":[{"sig":"MEUCIQCqkCqtjll/b6l0hirsrdEUrnPCeDAx8bUPFtXOI3k91QIgAnGM+E//JZXrazy18sv1Xi2/+Ofum+Rz6AWPJyiK70E=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":838390,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJglVpwCRA9TVsSAnZWagAAa5gP/jM52Kp4UJLOXOgMHTGv\n44h/JecE7VkTm4HaIyjJVikmuhR9DooWCEYBlA0qLAblThJZy0G3l1BTc6/p\n2mJfjOZxkM4NV0WU5WTVzV5pdtvAc4HpiGDTGR4HPTMf4FEi7UbV0X15DtXI\nATaG7Iei3JVmwa2DQvgftPHCfYIh0rngVxFUfmXlOGdumYyKNmfSpHlLt2VC\n7XP7TFpEw5lUva3FkukoSr6H2tq2LBXDQ73cwVHMcxdVUmXut+XF4xaCbqOd\nXufbcmIdr+CoErgUd3e8MRgcrlNWE+78u/2/5OrYkB+KeOb+V+0+SqNgfMky\nqz3sraqeHId9eLQnYhtmIlyfcB2K57sz5+3PG9DKPxO9+YLIqkd9eo4vulRu\nP8Lh9I1RumodS69tQvvLNH5WVQmjrfFSmlFcDZHITfUHKvnIR666k84S1edG\n+OHS4QK0FobkPixapK/r5p+9kNW/1+SKDap9pzzaZuSuF/AhdYWiQo3Sfoz1\nhrLDLZ4msbtu64LALM+wvADI8Lx7AuwqULLF5nCayZ5vfJKE55UgQSw5DrOY\nN/NL/jpKUbzxh4YMI+5hrHlaL1PRC2shNO0uPP/ilnr8DwVw5RFp61fSMiB/\n6vaNofpORE6WqlWVaYcCp1qeaV+3nsbAMJOESjt5/r375PGCVfVv2gX017NK\n9Z2b\r\n=xWHq\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"cd73688a61b81573744ba9a03cd2952798eb68f4","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.869d890d4.0","@material/rtl":"12.0.0-canary.869d890d4.0","@material/base":"12.0.0-canary.869d890d4.0","@material/theme":"12.0.0-canary.869d890d4.0","@material/ripple":"12.0.0-canary.869d890d4.0","@material/animation":"12.0.0-canary.869d890d4.0","@material/elevation":"12.0.0-canary.869d890d4.0","@material/typography":"12.0.0-canary.869d890d4.0","@material/feature-targeting":"12.0.0-canary.869d890d4.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_12.0.0-canary.869d890d4.0_1620400752378_0.9147749482824268","host":"s3://npm-registry-packages"}},"12.0.0-canary.ec22e1da9.0":{"name":"@material/slider","version":"12.0.0-canary.ec22e1da9.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@12.0.0-canary.ec22e1da9.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"5b386e1c8aab57361f462107e6dbb519827658f6","tarball":"https://registry.npmjs.org/@material/slider/-/slider-12.0.0-canary.ec22e1da9.0.tgz","fileCount":38,"integrity":"sha512-MwHM9mAoonceUvCJu6n0N5OtUKpgzEqcfoobKeq7WkW5SSf+hQGoB98IMyTpbSDJr5edseC/k5/z7VFvC7D19Q==","signatures":[{"sig":"MEQCIGVkoCVAbkhs7Q9vFAJuy6sqGEdAQ5OPsLXnTbIdCDlpAiBTxKZFo2BkD6qCfCxfeXYYbrCmqbc+dve3vcp2GrQ69Q==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":838390,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgmXo1CRA9TVsSAnZWagAAwIMP/183ZTk0D1cZb8JEVj0e\n7QL/UF6+9sibswiQuwzRi6+CpCNotSjhvS46jB+xvTbc6h49Zb8WGtZ3uCND\nsxLM2BPfe3BJs8YAU6uC7zGMDmdHxSOWArYfivd6BacuBd6pNra9JTXg1Zix\n1inExpFq1mNO0DeBeNv0jLSG6/6UexiDxa5fkHOmLDpYUTHu28eQSkBNKK5W\nYEIk1f0T754V/L1Zconz2OVHGMy5CAh1ImxKR+4KJxbGv/dBCAwjqXh+uWoE\nttcMY/AGsVKnNWUyemWKv/vEWHi5B63VRrKhDMKSOct9Hwy0Dha1GvqbdfGx\ngsbK5Uv4ZGKxZdp6E++LjPufiZjkk5ryqtuo+EZOef8C3X0L/JNfLArLQiAE\nMTLv7AiDj70Gr+R6rS5QFQ9Ls8NCJv0jv/YzHfgI3juPsCK0aCkNaH4fgyV1\nRaFQPnoRjGw+uJVWKVUIv7s6xuZIRdwz+Lant97FOB3hrdo8G3Vzq7de0jc0\nWBbcC8PxW01ZSiKFRb87VrFdiQcjXHkcLO4GfMD1RM3ZTcpaTpYHSv1ZnFsw\nHYVWhmBt5NS65t6Pmm7lDKHlnsQwhcdoVgUpDBofAVNkILSM5YRiFbLTa6wt\niiwhUe6bJNb5fsl5+nxhubtLk0QeTTdexvznzDY5uOEadwn2cFJCS896u0HK\nIlTs\r\n=qV/q\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"273a15f546b8d5df597771686f431c3726397778","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.ec22e1da9.0","@material/rtl":"12.0.0-canary.ec22e1da9.0","@material/base":"12.0.0-canary.ec22e1da9.0","@material/theme":"12.0.0-canary.ec22e1da9.0","@material/ripple":"12.0.0-canary.ec22e1da9.0","@material/animation":"12.0.0-canary.ec22e1da9.0","@material/elevation":"12.0.0-canary.ec22e1da9.0","@material/typography":"12.0.0-canary.ec22e1da9.0","@material/feature-targeting":"12.0.0-canary.ec22e1da9.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_12.0.0-canary.ec22e1da9.0_1620671028683_0.9166802275956214","host":"s3://npm-registry-packages"}},"12.0.0-nightly.7427449f0.0":{"name":"@material/slider","version":"12.0.0-nightly.7427449f0.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@12.0.0-nightly.7427449f0.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"5213113994e95c0b8fbf9853c81e0c38cebbcf75","tarball":"https://registry.npmjs.org/@material/slider/-/slider-12.0.0-nightly.7427449f0.0.tgz","fileCount":38,"integrity":"sha512-80mKdBWwJl76gxHNx2PozbqB4XdeBfXnIp606oPSEGjbCPFRCqhd4GR85gljCaMO9F1RIDZ1Bf4/Y8JPg4UnAQ==","signatures":[{"sig":"MEYCIQD6H1wC9hWAudhGhd7cvygePq/5pkFBhatEixfspRDfpwIhAMDWlPL++FAkeRgSvtb3GyatjTVYN7LfAdh21aB76pkb","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":838402,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgmX8yCRA9TVsSAnZWagAAn8AQAJLg+Qj63F8WoPK8zxVC\nlf3bhNHixMyUf3wY5xDKU/MHhnFaOkDa70MrFK2HFYSndmoFH0OMGhL133dD\nsxOJiaRY8rsx/hoCeA+V5mzEW+9vwkS6j2L/18oskkpJDDfCtScnT3m+wTa6\nZMVz3HxSgpV/8J7c3hujlyyfI1/nslW74oKv6gsWU3gsWLKxYLyQ8eusOuPQ\nBQqagDdxGOZJdJPeWJhi6URfw7hVSIDl1rd79eQQ4CcEzdYrOoSWBZ67i7O3\n9ndYixw2tJtU7xL6TWLjjqHL/Li74h08K7oCpcKGh1GWWmm3OdLQ3p0jweLM\nDAG9Y/7tVJZh9772sD/AoJdLo5b1UzuipUuCPPMDQ6/unY5lw3H35NpDogfp\nE2CHXhN0T5+3rJ68HAxUmif1incDOJqgnCXLRgR8ZcoBvNxZwRvbejlVXSax\n6QXVDBb1sR+HvHf9nNq971o4xhoQ+Mx8pOhq9vhnl3MB3MBH8JLzF5wRPzMw\nq7YUVH3oFwMC9PdELSQ/n7BPeKC5KaPzJyBR1jrxMau2Idd3YQ18hxgQnhLV\nJowayEVaO80rPzCT70SaZjO0zwXwBTJEHrdEIokquqzWgr5taM4hnW23ixMY\nFuWSkUskbXk5ykwvbcBF1yFdNJJKyn5Gow1CXQD9EOc8IUz07PD4A9CjHz0g\nETwl\r\n=459U\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"7427449f09e9521a6deba6ba7da71038c2fc1f05","_npmUser":{"name":"asyncliz","email":"asyncliz@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.17.0+x64 (darwin)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.17.0","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-nightly.7427449f0.0","@material/rtl":"12.0.0-nightly.7427449f0.0","@material/base":"12.0.0-nightly.7427449f0.0","@material/theme":"12.0.0-nightly.7427449f0.0","@material/ripple":"12.0.0-nightly.7427449f0.0","@material/animation":"12.0.0-nightly.7427449f0.0","@material/elevation":"12.0.0-nightly.7427449f0.0","@material/typography":"12.0.0-nightly.7427449f0.0","@material/feature-targeting":"12.0.0-nightly.7427449f0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_12.0.0-nightly.7427449f0.0_1620672305499_0.9121489390959454","host":"s3://npm-registry-packages"}},"12.0.0-canary.957cc3bf5.0":{"name":"@material/slider","version":"12.0.0-canary.957cc3bf5.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@12.0.0-canary.957cc3bf5.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"fc94f8900e9655087831d6214cabc77ff8cb933f","tarball":"https://registry.npmjs.org/@material/slider/-/slider-12.0.0-canary.957cc3bf5.0.tgz","fileCount":38,"integrity":"sha512-wv84QE33Qh8KD/LJRXw0dgK3pDnDDUy2YE+eqHyQ+QGAXR6C8uB7JgthVM3bVgEbP2dsm/XMje2Dp9urxr2QUA==","signatures":[{"sig":"MEUCIAI8hv1Zk7U16FwPrPBQG2lQmxVMJDKPbrtfRjtUp10rAiEA8Lo0/F6Ke/e15QTUup+81Ip/8Bqxbuj4Bq3MnfiqFUM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":838390,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgmaw1CRA9TVsSAnZWagAAMuwP/3Pg+7aqbCG/PnQd9C7M\nSW200nZRuqFhqDUntyNVgUKRiMqVlyS2aW/OTcngLsl+KhTIaWjKQtH2ggkd\nTR53QiRyxdfSE8d+qI0KlnP139KVBp0BTg9hChzkO2M9o2OtokjTeBkScdsg\nM8Aif47AYoRaUtxxpjHbnH08ZHRCsCNbwcKryVkpzlcdwyAHgsgpygBI8lgB\nTmrchugXE+NbS+8sJDxC6Aw8AcEOPd0H36xIfKqtHs7YdvxeDmiX7cQ2PJ/B\nzCoMrm9B3RncoaemC59rGfgTpuySgtORQXPEZ++cdR4bAeHHv6NMQIwZgJF9\nqEDnQFXZMp7YMTS/bkz3sBdjJK0Qe5PFRmVwBje+CRu9fYNsfcGlxLcAJZKh\nu5ky9NlzkrBNA64jqKygF6gYEe1lQ1D8ckRwfGfZljw7u9kfDtgnfqkE5kf0\naKWamX4v5Ej6HUfDzuA862MNALwZAkPR3ETJ577SYNd0coRPcDFOEyoY9bUE\n8hdvNxN0N17IsCpAdQEP5fEAb0fFlUNBTgXT6iukxdvyVcpY/mMPZsE8O8e7\nuDjDcsTwOBCThvbay87flH7l0v/m27GexTrnyF7ZUXxS/ALMHged1aSlAEBP\nl9w4/tYFcI69xoikPV70MzyPZ5qTIxg9cxp7KrYdX/p9gYWNu+GpanzYnoNW\na+b3\r\n=Cx9+\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"3c29cfc65a597598e2a8e1841ef1af72450500dc","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.957cc3bf5.0","@material/rtl":"12.0.0-canary.957cc3bf5.0","@material/base":"12.0.0-canary.957cc3bf5.0","@material/theme":"12.0.0-canary.957cc3bf5.0","@material/ripple":"12.0.0-canary.957cc3bf5.0","@material/animation":"12.0.0-canary.957cc3bf5.0","@material/elevation":"12.0.0-canary.957cc3bf5.0","@material/typography":"12.0.0-canary.957cc3bf5.0","@material/feature-targeting":"12.0.0-canary.957cc3bf5.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_12.0.0-canary.957cc3bf5.0_1620683828955_0.7048699296417256","host":"s3://npm-registry-packages"}},"12.0.0-canary.88a33cd70.0":{"name":"@material/slider","version":"12.0.0-canary.88a33cd70.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@12.0.0-canary.88a33cd70.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"8de0af55110296aad60254eb9f292c4d66a9ead5","tarball":"https://registry.npmjs.org/@material/slider/-/slider-12.0.0-canary.88a33cd70.0.tgz","fileCount":38,"integrity":"sha512-TggQ6ECYu+o+YxZciuJVvQBsAksSpuoq8s2w6Z9YlHtVzS9iMo7rz9UHGRj+jxvm/AWcHZEIgjBPJNGAeseoCw==","signatures":[{"sig":"MEUCIDCKGz3aEcUVSNMctxp+SCBGSu8YoS2O1wEXFYsCg84uAiEAkypyqeWTf7E2DwjrN2t9ZV+D9OBEIK5l11qoQbIVD00=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":838390,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgmcsrCRA9TVsSAnZWagAA720P/3QiNLq6AQUsOvyNDDcP\n7JJA2exGT0whVAhFyHFkgwy30orUmH/VHbk97CW4/J7uHMDQ99A2K/NOGlxW\nc4+v8ZiLopKk6OnMphtN4oaqRxXu/z6XnNKktXDt0lC8YSGbDZBc6+dt70xs\nbDIBjzcHSipmiHMeV5CQTPuoUrxHgoNo3PfAaeh9ka40T8wpUe6u0cyi9jvH\nvjStEqU2Ew4KA5Ts0MxBrXFzeE6dl+gTJYEqHNi6G/aSxq2T5jXd7FhoZq5C\nE2ZAWzUduSNkVWMcTKNkW3BTm2WzTZ/53R1Jv3uIzOIQwCYXey5RjQ3lDyHL\njDS7yVvjzGLe/9lksYuMb43W9tlwwG8rXBHkrVvZxkr7fN5B8B+NwZLK+q5z\nmU7rz29J0OET8vpMZ2pRQmgC/ZyWGTb3GzaUVShRCOHj/O2B5iXikcAJ0/I4\nS4Uihql+zFrKeRiR3doIYuivLb4M/ku3yCTYO2H68g+XTw2PrAWnXtdFNljm\nOjqFfDq3A9aVwqWq2Btq+sBYIxqVMTSagKnq94L6ctYAGj68MNmKES9u1yEw\nU2ItUmgXb26C9GBWU/T0WX6vqCK3xySOnA6OqDh2+p9lpb07W6AC/JkTLLkI\nJX51NzVg+DBGskIosQbBVSFnx5OoCkKvbdk9HUlUKzgezkoKP32VjG8zYIaU\nQkZj\r\n=aIPz\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"f1d341efc173e89bd2770326eaeb1fbc581c9648","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.88a33cd70.0","@material/rtl":"12.0.0-canary.88a33cd70.0","@material/base":"12.0.0-canary.88a33cd70.0","@material/theme":"12.0.0-canary.88a33cd70.0","@material/ripple":"12.0.0-canary.88a33cd70.0","@material/animation":"12.0.0-canary.88a33cd70.0","@material/elevation":"12.0.0-canary.88a33cd70.0","@material/typography":"12.0.0-canary.88a33cd70.0","@material/feature-targeting":"12.0.0-canary.88a33cd70.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_12.0.0-canary.88a33cd70.0_1620691754611_0.04782751243914207","host":"s3://npm-registry-packages"}},"12.0.0-canary.d20dc6dba.0":{"name":"@material/slider","version":"12.0.0-canary.d20dc6dba.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@12.0.0-canary.d20dc6dba.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"9ee03dfe5ea932d488fa12a3bf00f87fb13e1d5f","tarball":"https://registry.npmjs.org/@material/slider/-/slider-12.0.0-canary.d20dc6dba.0.tgz","fileCount":38,"integrity":"sha512-8/uZPUAI6uFxJmH1nZjnptFmfaMyyUEztM8FCxq/mljzHoQy9E94gmQ/zfVyU08m8uomrpenw5mGzcQNLPNccQ==","signatures":[{"sig":"MEQCIFDdaGSxx11/JzrCDOskzFa9EFVE9b8MDKba+P+Qr3fnAiB6o+qAGAale2KX6fHEwH405UVM/OHszmmgIt5d6nGrWw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":838390,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgmc7iCRA9TVsSAnZWagAAKHQP/1lC/w+yyrAR23yh+bQY\na4QjYXzgRKvF8KUNbLCKvvGI1nwoSNa98nG8MyUW7GkLOx/JP30qMi93BD0d\nQgR8XUDL2L+/Iwu4EALwOitoUtH9D99eHJmdIflSYwoVerO2JqpT4eJXecco\n4wqb9LvLMmS44KgmaOnfRkYQAfNpn7wY/htdnIJREe01qXk3C4mny4t8Tnw9\nf/SYX49TvCmmWW2BYo9mszQM5UCltr27qKjUKbbJUYqYphGnwk3X/VEtCc2/\nyFNDM32cdcv5TFbO0u5JHCGFW81fzlJw4etOwjxHblYBc4zB4e5mdkQJ+Hje\nN9cCQr/wzlYC+H5caqrm+lCpWwKHkToTAwcCkBbSvoaXaUHUnKdfBI1uMe/r\nqnOPFnppgXx5mc24b+4avTAYUSqvye/gB+hetMxqE+K4jPQSp2P5gfNHEXj/\nA68E71gpz7usyWGFrGftgP1CoDqrrxnqrCtPxH/skPZG+AQGzGQGy4qS6Djn\nPVeVwFcNUUZJEdMKTu+JvTb+XpcHoRo93vfawe9kw+H+vcrBKg/2qnslzkaa\nlh6tRPc4UQp1TujplKPQalsPMjtqPMrI8Xqj086/dZ1J4hHyV5DiFM3JbDHW\n93m9N2VKDhkMKOGajWYNu/neg1FhkCqPYmvQfpLZRQTjHa5Gkt6rWmMrVwUB\nuWNU\r\n=Jb7+\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"f2980d3f7fbbd8d2e3b824a765f7fb03096bf11a","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.d20dc6dba.0","@material/rtl":"12.0.0-canary.d20dc6dba.0","@material/base":"12.0.0-canary.d20dc6dba.0","@material/theme":"12.0.0-canary.d20dc6dba.0","@material/ripple":"12.0.0-canary.d20dc6dba.0","@material/animation":"12.0.0-canary.d20dc6dba.0","@material/elevation":"12.0.0-canary.d20dc6dba.0","@material/typography":"12.0.0-canary.d20dc6dba.0","@material/feature-targeting":"12.0.0-canary.d20dc6dba.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_12.0.0-canary.d20dc6dba.0_1620692706268_0.556079859841613","host":"s3://npm-registry-packages"}},"12.0.0-canary.0ce2fdb02.0":{"name":"@material/slider","version":"12.0.0-canary.0ce2fdb02.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@12.0.0-canary.0ce2fdb02.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"b9e1294deae535b8ce9e737506d446f18bbdbb96","tarball":"https://registry.npmjs.org/@material/slider/-/slider-12.0.0-canary.0ce2fdb02.0.tgz","fileCount":38,"integrity":"sha512-2HkfBF6LFzv/5sZiF+i11Ffmx2QhuZnQDXiq7eVzYPTQFJrxekMWE+sDX9XhdNfTTh0tDD51bD4u5ws0ouYN3g==","signatures":[{"sig":"MEUCIDCF+CT5Jl3efFVRGnnxYQT7kPG1mt2dohquTyin88RtAiEAgDLcc+gi7OrXsHmqO/J7YkimjwJbN42e7ngJdmKVoB4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":838390,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgmdbNCRA9TVsSAnZWagAANQMP/1hhaUPrhssFarU1MJQ3\n3T3flTANShxqkjWx8dBFJA3oPjq0usk9QN2etKNiJQNQTg57ay6qPIfV7WLK\n5UwV2P53YVP4I1U/jUR38rZjNA4ulIe/y7DwmaD5XygxplCg1CZXI1/EmVLe\nD8dr/teDCnJeZgTuYysYmCMF/O5clo7XL4lAO80ZBTXnsXsqloeuO/Xysu/B\nN2XDOZ5pKaQp88NGQLGtCYXI4MZaWiIg/yY00cUs/gimIvCQC3YQPyvxj0Ai\n6QnTrVZL74DqwRLVSvomzzVTHe5VQDuGQufNOR9AgV0t2k233JiWU1p7Cdjo\ncQ9VYsa7y7LYjFd39ODhtDby0pU/zgWcSSv1wzvEIOxGuwPzoVRgVr9SLR8e\nJe1hIu1dK4Tth69QdcmiPRx2d50UG0wjYDUW3lsw9Mo/zdIpE6zKO1B2gXCQ\nDTfAj2gt841ejZyRVvBAzSVJkCuhpN4aYyM4QGjmNl4WYyI5cyAFwl5dVZa1\nu9jLaJgaUX5A3SK3NfEPpK24NAgczGn9eF4XI4UXS6I0MaOCFuHtEstxT2cA\nC44QJKW8Tycx6T1R6eedVzp1hW2jlAI555T95gS8ZgBmvyIvAqnemffBJxVa\n4Bq82mN+VR0FXPbxKZER3eNXzHrJUwM6TF0DEc01vFBZIqqCDCkHNHnOjZvI\n/hY/\r\n=1C1y\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"ee2139d87a1d755a50dc6bf0a6dd53a2f39548f4","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.0ce2fdb02.0","@material/rtl":"12.0.0-canary.0ce2fdb02.0","@material/base":"12.0.0-canary.0ce2fdb02.0","@material/theme":"12.0.0-canary.0ce2fdb02.0","@material/ripple":"12.0.0-canary.0ce2fdb02.0","@material/animation":"12.0.0-canary.0ce2fdb02.0","@material/elevation":"12.0.0-canary.0ce2fdb02.0","@material/typography":"12.0.0-canary.0ce2fdb02.0","@material/feature-targeting":"12.0.0-canary.0ce2fdb02.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_12.0.0-canary.0ce2fdb02.0_1620694732788_0.5951758492312589","host":"s3://npm-registry-packages"}},"12.0.0-canary.cb162da37.0":{"name":"@material/slider","version":"12.0.0-canary.cb162da37.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@12.0.0-canary.cb162da37.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"b6fcbf6ca4fa2136b151fc77714aa4cf61651b7d","tarball":"https://registry.npmjs.org/@material/slider/-/slider-12.0.0-canary.cb162da37.0.tgz","fileCount":38,"integrity":"sha512-UTJXV4NShARKjZ9oG5RXcs4blB97yX//fPeCV82ZaiaQc6PM1J2YupXYiQfIUfoWxMKQVfushYIuB0Q1RhFMUA==","signatures":[{"sig":"MEYCIQDIjfQLxVHX4Gv6582e9+CWAabDfQG/g1UXH0sx7pMHrwIhAOtlzA0xmNfhLqxul2ag6PXl5g8M1ZcIqgXVja1awYeq","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":838390,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgmeTUCRA9TVsSAnZWagAAoxsP/16Ny3bX62z2UM+hUwZt\nNgshX+hKEMYyx2CswoKdphea5f4n3G0cYJi+KdDcGK4XqP6Ykh+k9GZF5+B5\n9Qaeyn7nA8xxMyzSdhauNkmYMuD7SKVzAcJpDF6XakPNNNsPK3Gv/xF/8IFm\nHH1c2fc1dw/xrWEanzSBi9DD+EkTS9dbCLX3nJTYZX2t3bXKMZVrx1qFMglm\niarUVuZWASA5zJ0iZx45mhFCQ/8ejt4U7rixqiXPVp16uqPNK6CQsQR19QIU\n31y0AFXmkdBbXgYh0QgRZh/qlYwLceUYP7f2avnYxDC0lAOSdFe7gDiqfnSt\nh2zyWBaNvr4USTQDDO62Cy8IBiDMNmJHr5JxGiBDU/x+Hqp6gXbHjEItHbzz\n86LLsj5rDeTJlkG+tDwVeDJ3BB1ligbz29t5nqGL4a7CGSJIz+JDvxo2LkLX\nbZwLiPqYFRC56V8/EGn27e1Uvr2/UBdRYfd5SnhfJFHrywvL3/nKfuUmCia/\nn+oZ6g74dJwLHkedWxCkKH4DuATnZT6PeezYhKTasDje3sUh/KngXUjZDvxm\nsON95n3Wluoc1Da+sIdDcc4oVqMUrjikerbfgMot1mBL98RtLnOXG8OzNk85\nIxzf1pI7oR891ZvESiQ14U/ccVykKxc/fzE09Xbibr59KRwVLPLKWdn2t8yY\n95bk\r\n=7MRj\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"9858adcc9ed7b1111dde19951ba96847bad0beac","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.cb162da37.0","@material/rtl":"12.0.0-canary.cb162da37.0","@material/base":"12.0.0-canary.cb162da37.0","@material/theme":"12.0.0-canary.cb162da37.0","@material/ripple":"12.0.0-canary.cb162da37.0","@material/animation":"12.0.0-canary.cb162da37.0","@material/elevation":"12.0.0-canary.cb162da37.0","@material/typography":"12.0.0-canary.cb162da37.0","@material/feature-targeting":"12.0.0-canary.cb162da37.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_12.0.0-canary.cb162da37.0_1620698323795_0.9807975648880458","host":"s3://npm-registry-packages"}},"12.0.0-canary.573dc7ffd.0":{"name":"@material/slider","version":"12.0.0-canary.573dc7ffd.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@12.0.0-canary.573dc7ffd.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"e302dc1cded78b65b544d05dc43db0aeb8971d03","tarball":"https://registry.npmjs.org/@material/slider/-/slider-12.0.0-canary.573dc7ffd.0.tgz","fileCount":38,"integrity":"sha512-sbPvIKqeKhhlARhtlgGTqI+HsRmIe7xEumWCg0PUbcT7LHtSHqf7AXXRei3jw3+BWIx+Vs4FM6VycbpZBAgJSw==","signatures":[{"sig":"MEUCIBp3eave8rA7tWhQmYHW8/Y/Mgvcv15xovHHVTOSsWr8AiEA92s1abi9xwfO25BpQZ39cgr8DQLt4Lsw/Oq5G1bgZKw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":838390,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgmek/CRA9TVsSAnZWagAAudsP/0/h/bFopGMUIb/Ox0e7\nRHbLjVyFKJ95gy78LyzxBWqZwSIZFAQysGnPjdeymntladkNSGI2luj2a6hv\nDGSguUgHW32drD/2qDvnpIYokXtSz2HCb0XVk3sbBKX3QBDTJiHwKIyotrTV\nIZkt0CAsPxcwXl6hva9kRtUisSZJg6d2tyiJK/NJ5LUn539g1U7MjgskcHHH\nL5ankb2S/4/u6yMSEZ6PqfZh0r1/7mayiGzXDMOjoJ1EpQixHTOGRUrpQBL9\nlHwgJFORR/sLc4tTaXzyC+wvx+Ssf3olyknp3xa2r/UA90DLnX1iVveDd9Lf\nRpUYIrEBawS71Qtr6VyAZzygDbwS+L8bztu64+1dfsnGeOPxenSNrGcIH/2v\nhmx1f5DVk2HjzxhApvjswf8fAxuCjZ5yODgVXmdFtFe3d+QJB3PxXe4sWI2Y\nLFnCO1dfLNoQjQRfm2bmy/Gsps4642LiKcIOT63ljjvmo0poqXxpaF0U1xW5\nYdbUKJuYPSSQcS66wgPedGB9ADGr5kwL1M2bJgsjVDYasTzCfUUwE3grleWi\nKimkpEmXi61WkMey4LsHJcnYbpf1cAyIh2HdAKy3Q39LY9lo6His8fdguBAi\n/VPhA7e1A1Q6OGZcrJZeL973ordZGn+Uxn6BCXd56lFQnU/ddNC/tWw7Os5M\nDKlG\r\n=Nuwf\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"67aa299a5066425730ea2e8558f89c111a5ab156","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.573dc7ffd.0","@material/rtl":"12.0.0-canary.573dc7ffd.0","@material/base":"12.0.0-canary.573dc7ffd.0","@material/theme":"12.0.0-canary.573dc7ffd.0","@material/ripple":"12.0.0-canary.573dc7ffd.0","@material/animation":"12.0.0-canary.573dc7ffd.0","@material/elevation":"12.0.0-canary.573dc7ffd.0","@material/typography":"12.0.0-canary.573dc7ffd.0","@material/feature-targeting":"12.0.0-canary.573dc7ffd.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_12.0.0-canary.573dc7ffd.0_1620699454947_0.23212686047735165","host":"s3://npm-registry-packages"}},"12.0.0-canary.d5f6ad3fe.0":{"name":"@material/slider","version":"12.0.0-canary.d5f6ad3fe.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@12.0.0-canary.d5f6ad3fe.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"608d1844fd38ff50014d54602bae9e62573b5046","tarball":"https://registry.npmjs.org/@material/slider/-/slider-12.0.0-canary.d5f6ad3fe.0.tgz","fileCount":38,"integrity":"sha512-07JyiRQBlQGgzijFeus4EomJHo4CTvQ5iUGg4W0JTN1E8+iiyEZ1wBgNtHSNe2MpYUxj4e417EV3a/4eHMLJJg==","signatures":[{"sig":"MEUCIQCsuT6Q35+YFV6TSK/BWsOx7p968+G2lWNAdegm05qaBQIgLZ3cKQq1V4vFWo/v0k6YyE/yzTTnNvAVqsGFr0vDIcU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":838390,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgmxHLCRA9TVsSAnZWagAAVc0QAI0NWhckQ3PZpjaeBf5N\nT74h8R1xdyG8TYDCaPGoLX4OhC23YoIKA14CNce2+ZBUcSmCi0P/52FXwG0+\n6dPqfffbtBfBkdGcR8tpq8DHTtXBwnLC4GhLpguiAXVT4o0eEv1njhSKx3Pt\nOIuslhbN1kr5Gx6uP8xTTI0I4QUvY1LRP/mmMHG6Xlr+gIFCI4DJmwG4M36i\nkyzcHMt/FM4JYdCdcH70w6GLb66nlzuX2xRYW46fYS4KjrRB1TF1p4fgNvmM\nf7ZDJ7TeDrVFEeB1U+ymH3ehUIv5+xNdmz0eOZSs7HXribh5ZtVQTfeGRnjZ\nuAP+3kLBgfms5vdRdcS80efVWz6J5QIlGm7d0eutENMxVwX/OcjeZP3E+HS9\nJWZGH7wdo+hYgx5HkEJKeyi1NXeoe5zIR2j+k5tGQzSWqUEymIQNoiDqxGNz\nuFtYZWKZv91G/KTkbrvj0VnAlAlM40nj3adOrfPYs+LK1lkUWDzSNsMGB8v+\nozmlGgMdXuQ9d+0n7vOsRBnnC9be7MYgISOD6RtXJS4xM9ZrbeURAnPX/vBh\nhdU6cw/xGdL5dIT1bf6Bo7wSA9CCJy4mnEIuaidwRt5SyCvwfmQAKorDkwVX\nY9oAOiN/z3nBor+h1XPZVtsvOt/KQlDCz3OiYrx2KePJb31ZKckBf47KbLX6\nJI56\r\n=0y1m\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"c0bf85201107dc8a95576c2392f5b1771bb2c969","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.d5f6ad3fe.0","@material/rtl":"12.0.0-canary.d5f6ad3fe.0","@material/base":"12.0.0-canary.d5f6ad3fe.0","@material/theme":"12.0.0-canary.d5f6ad3fe.0","@material/ripple":"12.0.0-canary.d5f6ad3fe.0","@material/animation":"12.0.0-canary.d5f6ad3fe.0","@material/elevation":"12.0.0-canary.d5f6ad3fe.0","@material/typography":"12.0.0-canary.d5f6ad3fe.0","@material/feature-targeting":"12.0.0-canary.d5f6ad3fe.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_12.0.0-canary.d5f6ad3fe.0_1620775371240_0.299468271913613","host":"s3://npm-registry-packages"}},"12.0.0-canary.25751d2ed.0":{"name":"@material/slider","version":"12.0.0-canary.25751d2ed.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@12.0.0-canary.25751d2ed.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"2fb94a217a1fafa052ebff958688c2a2a9464195","tarball":"https://registry.npmjs.org/@material/slider/-/slider-12.0.0-canary.25751d2ed.0.tgz","fileCount":38,"integrity":"sha512-AB0C/YuSQSaSsHYWdpcgMZNfFjS2Nt4MiPOh2Q3mQAstKLpgYelTzRPF2OQdmPmfsfbeyfSPM6JQHrCEyDdEZg==","signatures":[{"sig":"MEUCICkCKMr2qWCorlqz7rj+YxFUwdLWFgjm9citZXF35YjeAiEAw8kcMq0AuoRqm12fyqEinA+A/a9gPqyybwiOOQLSuec=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":838390,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgnAAzCRA9TVsSAnZWagAA4WAP/3LCTPimIViD9wEutKA1\nYmPnhhsUCoNHk/oeTaqikyTZ7Oc9/WlVTyYurhnxPjc9kVH91ztts8L2lEK0\njy9AxGckfzb1BNRJY4+8Ze7qmy5OIombKMWCoEa8uuHTwMJl0Djr3Qxanpuc\ntFyBIgEXvSb67KM3jeCplHlDoDkPfb73Gg/HyHMvFOqUk47Mh1hocDhRLfp1\niQv8nyjQAitNHBADvdHvAN5sRCTEL9xDTsDVomz6mXeKW10cvLsth+1EKvxv\n8AMg/VHchWMc8HAWSOs8tbon2CqzGAvvDoT+vCGl9uB5TrwEqeBNCN0rS/bx\nsPU26tkFjFXysJFnbMThq27h0Fd+s+HsIm/3o0iBZQw7rPm6J3VyUJ3zWseP\n8nHSm1hWh60IoAg4mewwEX6JCYMdgh//sTO4SdWEw9ThuYAdf/GzglVcjS6X\n/sHLacn29XThFvCPe6+3PuyMy/zp9+LPwqZUOXVqd8WQtqNAkJctquyKdvUu\nvCE/xl6o08qUlhP8EX0/OgxPpVEyYcEFxkdoKvklH2lfcU2ecJTJSf4JPvzC\nc8A8TYJZjNW82czvQpavtJ3EkTecPIgA2RBGQrD2t4XA0oO4oA5hlugvYoOy\nnQsXjREItgzVAkxlneDXl+BX3ma7Ny0odigHxeZuvciyppNujZZKUUpS2SCg\nU/OS\r\n=u5ms\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"c38dadd226475a1dd91a992667019eefec273bbb","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.25751d2ed.0","@material/rtl":"12.0.0-canary.25751d2ed.0","@material/base":"12.0.0-canary.25751d2ed.0","@material/theme":"12.0.0-canary.25751d2ed.0","@material/ripple":"12.0.0-canary.25751d2ed.0","@material/animation":"12.0.0-canary.25751d2ed.0","@material/elevation":"12.0.0-canary.25751d2ed.0","@material/typography":"12.0.0-canary.25751d2ed.0","@material/feature-targeting":"12.0.0-canary.25751d2ed.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_12.0.0-canary.25751d2ed.0_1620836403218_0.030068316798619765","host":"s3://npm-registry-packages"}},"12.0.0-canary.a23ecb682.0":{"name":"@material/slider","version":"12.0.0-canary.a23ecb682.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@12.0.0-canary.a23ecb682.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"f65887645e9681569c37fc7f140a5cabcb147ee6","tarball":"https://registry.npmjs.org/@material/slider/-/slider-12.0.0-canary.a23ecb682.0.tgz","fileCount":38,"integrity":"sha512-sfUeXPG4kcpBLsW6vwB2qqkoQ4BjaCnh5/DNAXe6e+qiuHksa0LapOMA5IpdacaXPiBh6g1YWUTPvjtJKwXp9A==","signatures":[{"sig":"MEYCIQDHTXqSXeU3bGPpW4XqYO7tLjJ6Ury3sAnXE7rfvwL+4AIhALM+QkeDqTv+on4VxiX1Xz+OaynI6TBVk29Y4WJiQuQK","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":838390,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgnB0jCRA9TVsSAnZWagAAKB4P/R+LYbbUJWqJoX1uYc8s\ngOSJEFS2WA5BqF/L/b+hdAsxH3fW+FzMS6Wn/vscujtcSK6YL8wcro2dP7Nt\nK1IqLjnNuiPFogSIs6YH1n9xQ3jCAR8FdwkuZjRTPZoYU1PusBeyPbMCzEbc\n9M7m8ZIN+T9NvfPK8psOYdiQxPkFM0Z1XY+Dc3GZYOQpUQxM0ey+t4/+JAz5\n01O9NMkFIYo5+9+IDOV/2GxMpkF+RE6b/IkuWPeBvZB+TW1EeI5NOBAfRuOV\nUuIZEp/nKxEVooVfRLhO7H7gdjW+VrQ91aYG2H1WW9BAJxpAP/nMHccmPJJg\nV5OnqSyHmCmTimpe18GKmSp5chmSeBD9qLWCyZNNiTq7kIeaLa7WVr00NyTa\nMqa0tONAtgRvWRraJYjKywrbQeLrThBvjHzO4I8ZfQjfKKZXT8bMoEPPEqbE\nRG8+5tltX2w+M44uSymzvaXl+XE0e0EmjxjBiNVaxva4YWjlQufKtRDNeSPM\nAnpfHKtbfDwbqJTiKCdkMysYq+y7+7UbExEZRvro9ojrxcCpLAUGggzMcX0L\nIXnszCV61uJHSq7q4DlZANGxhtBgNgItklEFh6BvMg530YBRp46sHSfalHe3\nluFt7xo2hhtD+S2QVFAQyVy8LsrrunB5ea1qrvX/SJdv58RxDEyDJ6WJeL+u\nkxDa\r\n=ibPN\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"da78c3f024a21d0e0df18a30c887082b202d7269","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.a23ecb682.0","@material/rtl":"12.0.0-canary.a23ecb682.0","@material/base":"12.0.0-canary.a23ecb682.0","@material/theme":"12.0.0-canary.a23ecb682.0","@material/ripple":"12.0.0-canary.a23ecb682.0","@material/animation":"12.0.0-canary.a23ecb682.0","@material/elevation":"12.0.0-canary.a23ecb682.0","@material/typography":"12.0.0-canary.a23ecb682.0","@material/feature-targeting":"12.0.0-canary.a23ecb682.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_12.0.0-canary.a23ecb682.0_1620843811077_0.7843950842933063","host":"s3://npm-registry-packages"}},"12.0.0-canary.33a954852.0":{"name":"@material/slider","version":"12.0.0-canary.33a954852.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@12.0.0-canary.33a954852.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"d1aa3586a91c217cd87fb8c0881a09a4c67f87b9","tarball":"https://registry.npmjs.org/@material/slider/-/slider-12.0.0-canary.33a954852.0.tgz","fileCount":38,"integrity":"sha512-c9lnWEPMpRtkkIUAzECdGBQ4b2xthgDug5AXRmljOukG1bslTmtHVjW1C3BLKJ/dYWZOusZU8aUESSBIqgyHzw==","signatures":[{"sig":"MEUCIBdwg3nk3pSvtNjKrr06U+pAPRD6cLRYsOatcGDuAOfwAiEAwZniBlAVs6ju6zC9MUnCHZd4uA40qQtBGRhHtiUfIX4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":838390,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgnUDOCRA9TVsSAnZWagAAemsP/2jZPxQmEeoZ5d3sezVI\nhTno45cCAhKF2qU+P+8L5dPjG9IIYrRqTHo3PRhs+QewAZ/VK5h890UQ0oG/\n2vJihFPhDhFUuSJD1BDvvSfj3g6kLeXjHqh3hoP5xXOOMhgM+e8YpguOdghu\nzUyFgO0lPt5zGqLsIdAnovuCHj0+ziFJRx7DJASYxLZjgjG/AFjbHD19tlif\nokZXEnr50Vq/fKQMmK68Ofdy7bjC0yWCnNY1g7WluDCkdGeZUF5Z0wD5Yxrd\nLZ+lhOJT2D0djiTG7hxH01KzT1eCnkGvlalyxaBBM9bA64OXZ3dgclT1Cg8r\n8o/L/PDTx3bi61oawxUMcFI8hXvdjXZHDmak+VdMruR/g/pFs4CYaGdr9ell\nEtZmJUVemi5RpRDJXxTQx0hUVMr7hahqhaIKKyGaExbUicxV3Hl7ipMCrqoi\ndoQO/Q/GAwQV6oWP5TDn5oHUgQENskDPrCKeJwlyxQtgumRYMWMEO8KkBp+4\nD9iZk4Zj9XYS6fLDubPl4+FIpdN1j8R8fZdyva1RJGsPSnNy/6pkC2MUeKV+\ng+NHk+xmCoYSDTe1hxbKs+l2R0Id4UeF3ucU60kwV9kyqaCkr+oDoOIvxxJa\nCERdeEi0xn/js87IM2TR1U9bCtL7hIgUKud+/FM4Ul1d0P8yK1tocXY8RJJO\nh7wh\r\n=yY4B\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"703dd5ba6a1225efec74655d3393690dca1922eb","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.33a954852.0","@material/rtl":"12.0.0-canary.33a954852.0","@material/base":"12.0.0-canary.33a954852.0","@material/theme":"12.0.0-canary.33a954852.0","@material/ripple":"12.0.0-canary.33a954852.0","@material/animation":"12.0.0-canary.33a954852.0","@material/elevation":"12.0.0-canary.33a954852.0","@material/typography":"12.0.0-canary.33a954852.0","@material/feature-targeting":"12.0.0-canary.33a954852.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_12.0.0-canary.33a954852.0_1620918478332_0.0046699500000184635","host":"s3://npm-registry-packages"}},"12.0.0-canary.a4484849b.0":{"name":"@material/slider","version":"12.0.0-canary.a4484849b.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@12.0.0-canary.a4484849b.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"73c032c296da3174850dce836524841f8b9f82bf","tarball":"https://registry.npmjs.org/@material/slider/-/slider-12.0.0-canary.a4484849b.0.tgz","fileCount":38,"integrity":"sha512-dX9+NtblKTyuA8VCX6OaAsw0o0yGPaR3eT5UgInhPhWGgwoHt9d1tp1+h6/CnVM0+ablyn8ziXd+V6l/vVr2Kw==","signatures":[{"sig":"MEQCIEyLnIF28ztbdi9G1yZGhuwdYNrRq+2s59sMtpCmJZQEAiACRe/RVT7t0r2T8DGlzI3GOC3Ik4rwjPUQB5RFSu5BGQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":838390,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgnUZHCRA9TVsSAnZWagAABocP/1gv447OXHJS3QdZLoND\ntID6JoUDVRsOSOGC8ju/CA3p4I2HMtcDIXwB5ULNxI1tCvmNLanujaTNHKv6\nQg9Hsxq2CQxt04HAWzppNstgsZjslw70imJqdEPhEceizjYwvJXh3e3F1E5T\nsC8VgIFqYOBKAVeR5YMlk0kiKhEkiXPrfTnoYrp7Pkbe826tdmugffrzq9HJ\n4rpaN8plm+ohZ7xOLXq899ISuVymQq9qKCSeYyczgfSFL65LyvJf2GuoxXid\nM4aWcrpWrOgxPw50DnWdtK26FLdMizguK+mVRxy1etANr/7EH2inoeAT2P7y\n6T/0G4w+B2kX7omioSIhzwKioPuKG6VSOo+4EMKaQpzn9L3j/szh0XOBDx5p\nJmyI+dAnBjlSwipZlEllWH+wLN9a1Nq0UV3xxJxBEtOwHD9Y79JBB3dsGXtr\nVRD37Sbi3opVfnErYvvemOa0ck1b3ijHPMvPyM5jeT5lj+cTWd6Mn0b4LeRJ\ntFWA0tLbW0PZ4TZrvrmt/IjebTKEUJNgF4cUqtG0vCMwWbnkbx3QXSlGBTPN\nDVGXVblO65OsPrbuqIcqDhzOVJZi+KXHZ9Qdw22ZIDJCMTQk5LcYFkR3l/kV\nKFnIL5Of4JnUPiGs56HRcXDvCvPRsdzBZDxIEo4aeixSr0DPBK5l6WdfUaoD\njRyx\r\n=9HF7\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"7908229b1205198ad87858e49ed29ee3836cebfc","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.a4484849b.0","@material/rtl":"12.0.0-canary.a4484849b.0","@material/base":"12.0.0-canary.a4484849b.0","@material/theme":"12.0.0-canary.a4484849b.0","@material/ripple":"12.0.0-canary.a4484849b.0","@material/animation":"12.0.0-canary.a4484849b.0","@material/elevation":"12.0.0-canary.a4484849b.0","@material/typography":"12.0.0-canary.a4484849b.0","@material/feature-targeting":"12.0.0-canary.a4484849b.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_12.0.0-canary.a4484849b.0_1620919878842_0.13836042730971987","host":"s3://npm-registry-packages"}},"12.0.0-canary.b4c3f513e.0":{"name":"@material/slider","version":"12.0.0-canary.b4c3f513e.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@12.0.0-canary.b4c3f513e.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"4b9f5e301e8705c3e37074d30746827064a5eed2","tarball":"https://registry.npmjs.org/@material/slider/-/slider-12.0.0-canary.b4c3f513e.0.tgz","fileCount":38,"integrity":"sha512-mQdy1VHyD+w2DtNoQuR18Kl3r9neGFI5qVfE/JdHU0G8o+L+CYeLhWBuntHWme+SU7T02PJkx825yVZcIk0xqA==","signatures":[{"sig":"MEQCIByJpoI7bNYCwdifHHLcFkNfbgcxYvDkxfo3TQKeZ8sQAiBJQRtotB9wt+NhqeNUzCiUYl8ct5Lh687cCs46NzNsqw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":838390,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgnU73CRA9TVsSAnZWagAAMJEP/RFpK3yXFbwXrJv9OxYh\nf3OlYbNPgJdyd+gHbW4LPLoN8Y5UFT8fRPhbHOSvq3n66uM9Ll8AmtgJoRna\naFpW4xOBpTp76dwi+eFqmyBko0hO/uDT1Y5aPCZKwiE4qVLy/NmRgCEMCiYc\nT1UXQFAWNH76CdCtBhUjO/2uOen1exEDy3FObTGPi9yDpvLEPfXC9ywxGBkw\nxBG/C5YuOxOx93/il7JX+QQ0i9cU0cfduiGMVCMTIJihPNUeVkyzthhHEnI/\nvWldzM3NfeCVry/Ls6tFp0pBqGR7lB+WVFgSyGw0PQPNZjx/TNl7fe01rqZZ\nO6/0roTrYv/XnnMd5Y98IzaMhgddOFmNn+pSqqcRj81A3fYN+KN4JqEN/wxi\nCtcThSp6C0sCBpEVnbRRnTCWIiuPCa7jmQ3uyshVOg6e3DvkWaR6j+64L5nu\ndnFSAqy3P0XsPwtYSw5bR8XerF7K8aUsZLZQWaAOVHZjNcbrCFOkEO5dqoso\nFQ6hAfhwDjYSST1NVm2kyoQMaeYzJW+lYrjaiCKKT2MuFu2ZDZRfqRjLiVRK\nTizVwiDBUfnnGgi5tc6HB5u7HG1/EgWmbnTdQbsKkuRTVlr1pdu6VHEErfg5\n2uIgnc7B1dQKrOPJnIwXbntQXJJhjNU6MvqRbXiR04CFEtv62hKqjqOW0Iv6\nUV77\r\n=+9Aa\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"c2183e7caf6f0437e64e41b632f75d33156547ab","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.b4c3f513e.0","@material/rtl":"12.0.0-canary.b4c3f513e.0","@material/base":"12.0.0-canary.b4c3f513e.0","@material/theme":"12.0.0-canary.b4c3f513e.0","@material/ripple":"12.0.0-canary.b4c3f513e.0","@material/animation":"12.0.0-canary.b4c3f513e.0","@material/elevation":"12.0.0-canary.b4c3f513e.0","@material/typography":"12.0.0-canary.b4c3f513e.0","@material/feature-targeting":"12.0.0-canary.b4c3f513e.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_12.0.0-canary.b4c3f513e.0_1620922102268_0.5241355737205422","host":"s3://npm-registry-packages"}},"12.0.0-canary.1a8d06483.0":{"name":"@material/slider","version":"12.0.0-canary.1a8d06483.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@12.0.0-canary.1a8d06483.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"ced625ee670f623b1c4c93b43dfa811ddc80656a","tarball":"https://registry.npmjs.org/@material/slider/-/slider-12.0.0-canary.1a8d06483.0.tgz","fileCount":38,"integrity":"sha512-YfX08m+gGLT/JmAV63bj/36uNU2SEcLyLBWQd2wazdaU7xyUaH5kW8sOyt/5omk9Az63e51ABIWvwXOH+sA4/Q==","signatures":[{"sig":"MEUCIBF20Vh070DZWPhQT42EKip7b3I/BG4T0MvrKHm5+42BAiEAvMGnPWOiFcgbezJ5IAisVEfOhOpVO0HIVGwzb5ycP6s=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":838390,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgnVBHCRA9TVsSAnZWagAAVskP/0XX8mx0W8Klkzb2jxfM\nCbdwwYsU75nVS1f1mP3wtCBID7xmDv9rNWw7TUYkzoDsbIdEzGtnoj+ZuAMB\n8BtAfqLQpU4AWUHaL3Je/eb+EquTNVVRxaiPPNgjFfgSf0lRq9oOxtl+4V5Y\nCYcNT2yBmgh39rua/KLqAaSrGz/PwAFYE6+Tjlo+5RjHiI8h+fSa+eXQgjIn\nuPhUZ2soRpn4/4M3Gj8oJCDVxj0IHOnLzPqGa3dkBNyD/8l0YI9WtD5fjTjp\nTJl46UfNW6e61eGxChsOsH8QxnaoV2/1YeChLf+GDxrOaAgKOd0nbUkN2Ly9\nBAFbXE/HtswuPbn5yhv60X5om91hdFEwgs9+KdRbhRL/X0+tCzunsAaRhEuO\nN6gP29w0z1iE5KDaGURuwQ0qSO4eAyc2ISPRVL4LmpnrFQycsz6oInvvkiF7\nYuaEQ3XmZwOjsKzlM+tgcjZpcI/X8e85CPpXxKBeZdK7ZZgMjIxkhtPuDUCm\n+breBjpfKF5FfSAt5U0sRIo9QRwV4967ImeWSb9qf/scgkzxUH6TUVvxpxt9\ntB/J2DlkebJCxMny7Ck9i41FbIZ46x0Bbcm5ps02KBLYk/5dJycoXOfSNdTa\nIOHuQUe7caJsEi+KJiM2TrurlDHYecxTIoTwfh8UP9is39pH2sB6cLWe9aSd\nOpdf\r\n=7ZHV\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"4fd7ff5259e7910dd76488a7faab45af839a13b2","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.1a8d06483.0","@material/rtl":"12.0.0-canary.1a8d06483.0","@material/base":"12.0.0-canary.1a8d06483.0","@material/theme":"12.0.0-canary.1a8d06483.0","@material/ripple":"12.0.0-canary.1a8d06483.0","@material/animation":"12.0.0-canary.1a8d06483.0","@material/elevation":"12.0.0-canary.1a8d06483.0","@material/typography":"12.0.0-canary.1a8d06483.0","@material/feature-targeting":"12.0.0-canary.1a8d06483.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_12.0.0-canary.1a8d06483.0_1620922439123_0.13423185598097187","host":"s3://npm-registry-packages"}},"12.0.0-canary.8e6081836.0":{"name":"@material/slider","version":"12.0.0-canary.8e6081836.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@12.0.0-canary.8e6081836.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"0ed7bcef98d730b209e0a5f900480337ec83c949","tarball":"https://registry.npmjs.org/@material/slider/-/slider-12.0.0-canary.8e6081836.0.tgz","fileCount":38,"integrity":"sha512-5hNmrTtnpJ8RV5FSA5W3gmX3h8gs0F9PEJRxdCs/RPAxFP0wQrjYNaNHkmHKg3R0wqK6grX8/RHHXKi54FKALQ==","signatures":[{"sig":"MEQCIFcEnJFX2n0oAXrY1q1Wm3qAa8IWBdHUK0QLW8WVkt9PAiA7Nma9SoyWYALiBYCP0NAM3ttodyujrAMWcKM7r7PJOQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":838390,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgnu5qCRA9TVsSAnZWagAAnGAP/39l+7mv6Qp0u+Qe77qo\n880pB4aww0/XHXe3wavqpd6dO5tKVeR9VKECpHVN0R3HVQeSgeeHDOIiHiZ8\nlBvBLrjAGXB4c3atlIGSqmzoZLz22fi6+itcyMFdvo0lSLd4LZMSP5vNtGoE\nzQxU45wrKbhVoGLsCMASYp5BukCSaZfZudkXb821ZbLajdxAxlr4oflEQfrS\n1xTwHo352QB0So7fpQyQbZs0aPoP0utJKB119mUcM/KJDhd2VQ+BdR1osMu/\nad9Tc+6eHgaVvzohw15fzefxMupMMVRlNOTmkDH9qA7iw3GCin2BBxyR958u\nAGYcPpAK0wnB9zfcVhhKslETy2jjpHYia5Bl8jWs7S7FnCIynMElq47Fwpua\nE6bef0A/hr3hvd0BNyHlzfC7uP7MEKpnqPs5zShpccWpsQ5VgwIDkOvgv05s\n5u2m68s8rsjp4f9CLgmE3yW1CsLHC6YRU/GO+2tlWDHV83+dl2/fpeAmHTBO\nULMAhn7aBJQs2O3QnlsTdxy2VA+akmd2FmDhw+vECmXL8ym8a2f2wzQo9CgP\nTD+DPqhggc6oGxgaHHVUoM7VyKDbCtQwW0ksXkjUSgOvVF9lPn35Cw5VC7EE\ngV/VbYbRXlYaAJoiWH5eTefzGd2ODcdBkSQAT3dTmUOD5aGMmXJshxOtW3zr\nSWMd\r\n=LzGN\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"e648805eb34c990054d503fd3f70ed25e40d6d9d","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.8e6081836.0","@material/rtl":"12.0.0-canary.8e6081836.0","@material/base":"12.0.0-canary.8e6081836.0","@material/theme":"12.0.0-canary.8e6081836.0","@material/ripple":"12.0.0-canary.8e6081836.0","@material/animation":"12.0.0-canary.8e6081836.0","@material/elevation":"12.0.0-canary.8e6081836.0","@material/typography":"12.0.0-canary.8e6081836.0","@material/feature-targeting":"12.0.0-canary.8e6081836.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_12.0.0-canary.8e6081836.0_1621028457550_0.8342214013124567","host":"s3://npm-registry-packages"}},"12.0.0-canary.a2b0f4cee.0":{"name":"@material/slider","version":"12.0.0-canary.a2b0f4cee.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@12.0.0-canary.a2b0f4cee.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"05ed1d2e564beb69339d2077acdfe10b7b825c8e","tarball":"https://registry.npmjs.org/@material/slider/-/slider-12.0.0-canary.a2b0f4cee.0.tgz","fileCount":38,"integrity":"sha512-YD431vkm12VrBkUKDaxULrxrC3hzUHaZJkr7lSOGfUs7+lidPpER0h6fW6RGV7b1/D4uo4PWNnNPSMtJrwRYDg==","signatures":[{"sig":"MEQCIA+SsQB1KwxtYp5T5qPGeZDuZT2YvSYqA38poidyvwSBAiAj8Ak62Iap7qaOxTvpWnV/sSCHKh4Zm9kI9Dwip/r/pw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":840824,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgnvGBCRA9TVsSAnZWagAA6YgP/1HaQZBTiBchm3ZTfx5c\n0W32/1aJTK9X1teurOUh3X2ENFOED5pXxhDwVsGAXiOUIYpXiK99U98YHNFr\nfEf1vF6ccszByGxiORdUaqOqPsLZc7m17mn4oCdSJhWZ9VC5Q/HioYeV6eSs\nJgmxZfiSIJTtikrO3Qnc43JbCoI1PCZpdeafrG963cVYS89v/6Zs/5cHYVcY\n150+S1oInWxxWvv3fvAjpz7tGrCQgnQ7eOo1R3fGHJYNqvHYkSH6Vb7kt5kE\n6xQD1naHdh3kjo5bWjxiqJ94oXnTNiITiDiIbKHl5txJW2JCW2Q9WO9jxzKi\nTlCvBzkQUbCUUhBiZOfmmQEQDww7MxQsOwmjwRcbb8/buQAFZneia9VZjHsj\nwhg97kEVh382DetZ+caBgZV5nHAS1Xc8anTJra/O2rdV5MjazEPrPzRksHJW\nwcdrXT2Px3iQS1/MR1lS0cTbzfBbh6A+f1fP4w35Z5PSqhzyd3Z07KzPptyr\nn8UHoD1U5g6AuHyBNL8LCimSrj9Q3MDvo9O0GPF+naWnbDXGezvHqwuEEwQU\nyuJtJykQ6bXan7vi1XrGwTg6i1jljFJhFjtv+6orSgXGYUlGcW/PW7VsL9Kx\nx3eprsoV4fB8K+iOZxm+i0VUBsQG3tclF1q9cp2WGEKhgqPB8T8y6JtMEqQw\nvxYY\r\n=WMne\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"67c2d3cef073a380a13ddb6bbbfc90886c7af364","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.a2b0f4cee.0","@material/rtl":"12.0.0-canary.a2b0f4cee.0","@material/base":"12.0.0-canary.a2b0f4cee.0","@material/theme":"12.0.0-canary.a2b0f4cee.0","@material/ripple":"12.0.0-canary.a2b0f4cee.0","@material/animation":"12.0.0-canary.a2b0f4cee.0","@material/elevation":"12.0.0-canary.a2b0f4cee.0","@material/typography":"12.0.0-canary.a2b0f4cee.0","@material/feature-targeting":"12.0.0-canary.a2b0f4cee.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_12.0.0-canary.a2b0f4cee.0_1621029249010_0.1313305851474038","host":"s3://npm-registry-packages"}},"12.0.0-canary.e8e39ad19.0":{"name":"@material/slider","version":"12.0.0-canary.e8e39ad19.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@12.0.0-canary.e8e39ad19.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"252463fad9b81375fcd6a5da1c1f58674c140b71","tarball":"https://registry.npmjs.org/@material/slider/-/slider-12.0.0-canary.e8e39ad19.0.tgz","fileCount":38,"integrity":"sha512-NzEfUNTqMO4olVkEGjrfzikkWBEHd+nuhD0dUVUx7tyq5FwCf+0MhUjr9MHb2lFoTV4+lHH+XxV9flEXLGPSkw==","signatures":[{"sig":"MEUCIG7MFUt/XaOlvaIRYKscd0hk6Jj1HppZ5TFOn+97NubiAiEAya/Q7CUJLxXJfHZZJpjabXGLGwm1/IUzPDfLom1/MS4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":840824,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgpB/nCRA9TVsSAnZWagAAGSsQAJUw8MWUAXlnWDYoRGNO\nrF/K20B2AvrLy4T+aq5wKvIf/SelCzoYXYuhEz1luGvE0k0gBfOTljZl59sU\ndsDvTnEvQfDDiqF64Wb0VQwZcuf5QvRdkPU+qyc0PsEqdTU2aaoQQBAuVG8U\nRIPHiPDd+BVqNrKyPIiiUTvL+MziDF9+0hOoQKVgjacmUVuzSsWd2qPlqd4Y\nBuu3gWM0KQ4oMHvX2HDKN3DsIjIwpXfGM3yqEz6q0GWI8rzsEDNR6XIegEQx\nY0/pnCOPxg6S6sFMhpgikpO8jtjWf/PMOC6AsPX/YU+d9Mzrm8B4FP4MSuH3\ntbO9A6IgU9Yjirv/uWUyPrUEOR8fe1m7STbBl0QYhn7g9Kyv8/DM46Ep6RAh\nln6O63KpTUKL7vPX6nCMJ1d9g9VH4hFVc0/cu0d+rqF9ogJEO4Kzyl7pdqi+\nrOaWUIAJeJo4chNMYFNplBp0rEqUdgy4bo5BCZtE6R+Yoc8nXvIJ1DznND9l\nKABSFgH/Gsl4WgIXWz2uHNQMMppBOnpUoni4fZU2W5UVadx5pWJJdLYvvSpg\n9BqwLQrf9bu6GDVAJ2AH4hiJ835IMF7hckHKuBV13Ib9UQAGpTBXb1ll0z6N\nlriSawuqJw6WxaT5FBhEj6YPWxSfhpSg2CY1b/w7vpwKHe+FLT7cnMxlc4qx\niovo\r\n=qeNx\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"2bde63cf3be6363eb1508c4d7e1747acfc51a761","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.e8e39ad19.0","@material/rtl":"12.0.0-canary.e8e39ad19.0","@material/base":"12.0.0-canary.e8e39ad19.0","@material/theme":"12.0.0-canary.e8e39ad19.0","@material/ripple":"12.0.0-canary.e8e39ad19.0","@material/animation":"12.0.0-canary.e8e39ad19.0","@material/elevation":"12.0.0-canary.e8e39ad19.0","@material/typography":"12.0.0-canary.e8e39ad19.0","@material/feature-targeting":"12.0.0-canary.e8e39ad19.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_12.0.0-canary.e8e39ad19.0_1621368806412_0.13624822291743421","host":"s3://npm-registry-packages"}},"12.0.0-canary.4bb5eea2b.0":{"name":"@material/slider","version":"12.0.0-canary.4bb5eea2b.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@12.0.0-canary.4bb5eea2b.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"1169336ab7ece8f08836ee0bc1d135ea2cca352d","tarball":"https://registry.npmjs.org/@material/slider/-/slider-12.0.0-canary.4bb5eea2b.0.tgz","fileCount":38,"integrity":"sha512-6SV/Lb9hADEdmZV5XyJutCcyYoGFUx5QpqLqOdS63cjWokIzU2IAXgDl54Q0+vi6G0DHG4PHS0sCtI3wt0PuWQ==","signatures":[{"sig":"MEUCIQCsAy5hsIOEuiarsNJx/LUQQrBuMptuMWCZ7SzqlNdk8AIgUlZOxYhwP/+VOUeGE+yQyJhDeUM28iYcQ6u9LghJt0M=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":840824,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgpS6kCRA9TVsSAnZWagAAaMIP/28By4KRaYBnUX0y4dqe\nfG3RCXGMHGRnmNorb/Pzq26qdU5d++vAu1Jxcu1ag11ksiZUzUbpe58R36rD\n8/zMsDdvmNENF90jMbnr1G6BxHOjWKUgwC9KgrWFlCIpV9Uwk30kgYIglhGT\neT9rehqd2pgMnEV1xgG3c0SFbHZ28ARvOuhj3jarSZeZN6vkS6wYcmYJdv7R\nMNK2OoRSm3ipfXXs74WyMRW4ey2iga3NwllEtxr/LJwBqWc7EnZSkXS9WiH2\nhCXWWHnf/amUoS5RcHT3OUoS10c5my8xPtMoMaQ3TGnqR2GmwpY6JxlkYsh0\nof9AlJImVWbhEqQqesRLHXVwK9ZdbnCkfH84b5W/STrSwLjKI1nRv0kLadWK\nePLHYvFk80kVVByGbCgpdtGbyh84Un7cEuy4uX1g3f/dhtSp42Ce18AZeRxQ\nNiRgzxtpCH6SZ8QFgEiDaPWS5nPeIg3gAQeyUAZh5DpGLJhg4IFS74F/WcCr\nDZRBdapEvFgcVZAsau+eg8uF+91sP7NKLuvqgMzeyWg7sDNylsnOfZAixi6q\nciIT7un36o6fskFLhgD69ZZkmfP37Y0R8hlvPIh16wnS3Xa7xGVEdN/72UFb\nQ3M8dgElr9qZWxugz5MbxdzlbnvWeOBYUsBHPy2jKwqHfUTqQXIw9HDP2Pu+\n3DvU\r\n=OQ4m\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"9abe3ad555ba3e9ca70f37ff3419acc2edb56676","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.4bb5eea2b.0","@material/rtl":"12.0.0-canary.4bb5eea2b.0","@material/base":"12.0.0-canary.4bb5eea2b.0","@material/theme":"12.0.0-canary.4bb5eea2b.0","@material/ripple":"12.0.0-canary.4bb5eea2b.0","@material/animation":"12.0.0-canary.4bb5eea2b.0","@material/elevation":"12.0.0-canary.4bb5eea2b.0","@material/typography":"12.0.0-canary.4bb5eea2b.0","@material/feature-targeting":"12.0.0-canary.4bb5eea2b.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_12.0.0-canary.4bb5eea2b.0_1621438115564_0.0861088794062903","host":"s3://npm-registry-packages"}},"12.0.0-canary.ccce99cd6.0":{"name":"@material/slider","version":"12.0.0-canary.ccce99cd6.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@12.0.0-canary.ccce99cd6.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"520dfe7b79047de21398e64b8932f486c118dfd3","tarball":"https://registry.npmjs.org/@material/slider/-/slider-12.0.0-canary.ccce99cd6.0.tgz","fileCount":38,"integrity":"sha512-N/SzRXOyssbJUOmX4ZS6WtxTKvWXJSjvRNYW6Z8HwpI6KxNJ4AUF0pKFgi3DREpD11o30Zk00LoPl8gVv9FgIg==","signatures":[{"sig":"MEUCIQCzwHSN+q6h3hWowN2LyH6ObU9wIsTT2JOtuuKOmPqeyQIgIt7I/rHXAnfEjATCtX/yk45dXiDssDxmnyZxSVe1KlM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":840824,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgpbPjCRA9TVsSAnZWagAAbGUP/R3eqyFZ0UjBgDcOPKvB\npZVSmB5uSa5d6OJZ9f98kj6buBcPr0ck6E0bSiSuYxfIOxFphpbKwPbPiSmK\n7DbjW7zHOLFNtqklP3BaztEma5ed85QPKwqam9bOxy5NCni4FiuUF0s0It7b\nDyM4qP/qoTCc034VyreBZQw8XTK8471jBoLVae7KY3rh9CkOFuNdfx8MT8wW\nsG//1rHxZCxYyQsnTR6F59G2bdJDR6IHYOc+M6SqlvkV1p1HGaW+lLHJoO54\noq4fW7cuSjFmsD9wOpsJzNozyVCrBAvl5Nxm84EKoQ6VOTaIWVVBDQz47Zcm\nZzDVaCgNTBCU1XqgB3JuFW8mZXRdqnRwimpy23H+NgPX1uY+csZAPbvlS2GA\nGbV//jSP7W8NjYoi72vkeONpuOWDu2x/R3cZbIUEtaMWA1aiCIXLec8MSvXR\nUwdW8vx+ji7t/rgwAmST5OVKW6+gwa+dMOIQZ8SGo8y0j/nkTn8RN7aqZi+K\nYGSvlwJpewnnJ/VZd5TgCuB27DwRQCiRqIYj7iqKb+tlEknvkQS48mjStslk\ntCZTwSUQnkBWVvMVc+cg0R1dg27nbwZXxb8ImJsZi4kdP6pZbbp+GxnPBj+k\nuYyokWhrk3ntGrcvEOZ1wMH6h6YJYMkDKZP1d/BoCFGDUU89FIlgzEVSphe5\nPjFf\r\n=pyeu\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"5d475a1522350d9dadb5fe3597683fa7f4851b83","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.ccce99cd6.0","@material/rtl":"12.0.0-canary.ccce99cd6.0","@material/base":"12.0.0-canary.ccce99cd6.0","@material/theme":"12.0.0-canary.ccce99cd6.0","@material/ripple":"12.0.0-canary.ccce99cd6.0","@material/animation":"12.0.0-canary.ccce99cd6.0","@material/elevation":"12.0.0-canary.ccce99cd6.0","@material/typography":"12.0.0-canary.ccce99cd6.0","@material/feature-targeting":"12.0.0-canary.ccce99cd6.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_12.0.0-canary.ccce99cd6.0_1621472226841_0.014016187119872292","host":"s3://npm-registry-packages"}},"12.0.0-canary.14767a8db.0":{"name":"@material/slider","version":"12.0.0-canary.14767a8db.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@12.0.0-canary.14767a8db.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"be4e637a97194f9c864ccbb1e535cd45003642f2","tarball":"https://registry.npmjs.org/@material/slider/-/slider-12.0.0-canary.14767a8db.0.tgz","fileCount":38,"integrity":"sha512-1uYYabl494xcuaKl0M7CXib4DKh6sOHYo8xStivpbE+VZdy1qnwnlBSfRHA1Pt9Y5uBNkPIJ0rOZeyc8hbOz9Q==","signatures":[{"sig":"MEQCIEu7jtxyfGMN4IhVdb9rLJ2IjCSJf3TIv9OOxHdoEDqpAiB9TuhiFvVP4DpfQNfwNYGIMDnjEVHCrOMAZd2HetlnAw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":830811,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgpsvICRA9TVsSAnZWagAAi/4QAIChndxTjyHnFDYwN5lb\n3ylTIslAkWpHAubU9Wk+JmVd3NLWpvEd6XJa906ZLRnDzk+l7STbfB0PV+EI\nmp0QxVx310RenYGOpS+7DPMS/Nsd6IJQRzqBMMw4mgPqcGgQPMyH7wXQyuVa\n2YQvAQW5V6THXTMLgruJ/YoNlR8ePOI8Vr54HacxgetDmJWxvOBd6P5xQ0dy\nTadJewc9y0AevTVOe0FXULgivoHjOgCHdz0OQGARQYr5PicEERNDPB3ve6hP\nhMCwpgTZtp1xfEs19gCfXyzEs0YkAlhH7tMwg4ZUSY/WmY2pLwmPtJMUHLb+\nT0axqGdAD4Yls0PVJ1J+4C1vNEJbqs9nogYkZWuipVHcRXeeHOLN3JO64567\n97w5dIyd21NpSSsmCPI4cz0mPbqtLj35SGhjydCg3I1vmMMoOScq8v1mXDCb\n6Ejr6HHi27WfOLfZl1Zo6k5NYDen3mDNSLnuhu1Eu1l3RPRWTVg7BuUzS6pD\n7kB6O/fwA0CGgJ1klroO3YI/Twpxg7kBrqXjdgqESlpXVFJ5pJhqYh8t4fJ6\ncIbMwyj6cl0YIXzkzQuVidThutu0puwYP3MceRgU4avEBDclatKQNluL9pEC\n6Bi9ZXeqyJqbimzJnLcJ1lqHOWogcxZTakVvLcmaFhmg/uuc/tGr47KBtkF2\nMhih\r\n=psE+\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"a324b91ce28769039998a00879c6f441cb1159b6","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.14767a8db.0","@material/rtl":"12.0.0-canary.14767a8db.0","@material/base":"12.0.0-canary.14767a8db.0","@material/theme":"12.0.0-canary.14767a8db.0","@material/ripple":"12.0.0-canary.14767a8db.0","@material/animation":"12.0.0-canary.14767a8db.0","@material/elevation":"12.0.0-canary.14767a8db.0","@material/typography":"12.0.0-canary.14767a8db.0","@material/feature-targeting":"12.0.0-canary.14767a8db.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_12.0.0-canary.14767a8db.0_1621543880125_0.7600734565957146","host":"s3://npm-registry-packages"}},"12.0.0-canary.22c6dcff9.0":{"name":"@material/slider","version":"12.0.0-canary.22c6dcff9.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@12.0.0-canary.22c6dcff9.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"8d32073c459814a4b36ae7296366f6edc545429f","tarball":"https://registry.npmjs.org/@material/slider/-/slider-12.0.0-canary.22c6dcff9.0.tgz","fileCount":38,"integrity":"sha512-f2seufl55xIGZf/Yhopv36Ib/UXfZ75cepODK9vlcVQe9M7duS+LafYZcdLkHfwLy0kygLim+awBTZBGJOeYNg==","signatures":[{"sig":"MEQCIEAkUFD+NOejv+x/AbU0I4p4XOo9Dilat/aVk55D4ulpAiAFcwCtDdwE/71DdWFdW3WBkSVrNX02mKUHz831R4abSA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":830953,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgq8PiCRA9TVsSAnZWagAAcx8P/R9WHIHbRt81vIGGWbCE\nCNdJbgenCyOMPbPBy8prRD9c6WpKBLARj+Twbjp9OGtX3MQgdKvrA/t965xv\nXqGbsrK/Fo9DB4PFwh70N8I27UYOwillgGGS956gunBcHbKWwtr6vStGW1Vf\nvfVKR7QmTlAhFSQecH/6ITYk1nhe3HNZ8pO22+m3TsTlLjjjNmMLi+D+eZIH\nPrIxIUpKm9ITN4iacv94dITH9c71uhqigXMJhmIeiRMmdmyRzyMU/nJHFcGL\ntFibQcFKaWDrRqrLBF2pNfegx1wWhJH9eOkMvwYYlhB7+c3jK57tUcLiNq1Q\nBaMpWACA5nj+DBUs+Riq9y/IL56H0H1TYTsBPetC2D6n1wKP1TpQGvynW1/v\nBn4naC1nUKlcVhb11PmemPbk479rR+7YqJmD6yYPM4db5cavaWj4wkzkO2yr\nrMY3Ogv9UiYL22CW7CWzF0oNmi2BF1mMtCedA1qKSgu3kDsDqrzi3hQlsCrg\nq3svkhGk3J0luht9COPIRH/rJ/BBF/+0tgshfXLZP8ip3N99gvkXtCMSeyJ2\noLSm3kfPEwtNGlNDeosgIfvVsKcO8Bx8rVxuP1iRW1VMe3Tqb68w+bfoxDyR\nbZ8NoUJIP7d/HghB9NFHut9qp3a5J/G8MJto2D5WzTMZ+Rr5A7taoiV+aOel\nQT+3\r\n=IGpR\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"74541e300384d800b9cdf492ff70ba20ffc583dc","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.22c6dcff9.0","@material/rtl":"12.0.0-canary.22c6dcff9.0","@material/base":"12.0.0-canary.22c6dcff9.0","@material/theme":"12.0.0-canary.22c6dcff9.0","@material/ripple":"12.0.0-canary.22c6dcff9.0","@material/animation":"12.0.0-canary.22c6dcff9.0","@material/elevation":"12.0.0-canary.22c6dcff9.0","@material/typography":"12.0.0-canary.22c6dcff9.0","@material/feature-targeting":"12.0.0-canary.22c6dcff9.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_12.0.0-canary.22c6dcff9.0_1621869537700_0.3446127119158613","host":"s3://npm-registry-packages"}},"12.0.0-canary.fadab3372.0":{"name":"@material/slider","version":"12.0.0-canary.fadab3372.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@12.0.0-canary.fadab3372.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"5faaca96151f0e086c2cc768545c788222bc5e0d","tarball":"https://registry.npmjs.org/@material/slider/-/slider-12.0.0-canary.fadab3372.0.tgz","fileCount":38,"integrity":"sha512-JF7CzQ7RS1/bYuQXt6xeIpwY51Nb1izw9xYNW+77e+cbnHCQTVS06z/SFAVEgf3dJ342Aco9qEJnjTteIQaYtA==","signatures":[{"sig":"MEQCH3wPLk3sjwKPUAcqPxyugLpKc1hMy9+UyINaRjvUlZsCIQCBmkJMHvUx5p/MbUjXDy5ASMEi9X7cb3oqMiSld142Kw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":831295,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgq87uCRA9TVsSAnZWagAABsMP/j+io1qMu/h37tGs1DOY\niO2XMr97K5mSzpzJgzl/3Jk2xwh5FAL2kRHsw8gBXFotPxFKjnD/YLHE6LFe\n++zXg4bu52914lL2EJJ3NHRBl6wSrcb60y6MEV7ZNo7X5f+LMC6PyMyznecz\npMWxElHoNLdtADzKvSQ8LYnQdYswL4O/TRtZtbwKLYtcsJTVvR0SCLxQocyR\ngzZVUuOblYbYiqYfIWOIHouwum552hEYQFaMLmvxEoNrQCT9vr5TBlMzfKy0\nimr3E6J7/bjJvRoaMg15PXUM2WWIchANhdGRnyxgC6y3+etJqqSm6Vl9ZcxJ\nwzIHFBzfTPLA0jKq6WBzMUlAjwiq6zpzwTV8eBW0EoZUsjgb/gYDrsme1MzC\nU7BQe6N6rGmdROYA2XwgAK1vT1WBoZZ6taTOkQXbwSxEc48rx2wXqRKf/KBb\nO97AYZrHYgVzVRPmJGex5rpKmR8PwVG3t5PHJaAS+Oewj3EdaChblWh4l/jw\nk7JLtb3gXiu/iZ1bqFCUzkOpOfGUynEQgIxhxw66yiXSd7t+3cU9Qo2ZHKxQ\n7+6jXP4U/Rhls2fMdp2Ta8wwAYfE05jmY9qUnuBapKNsF/TS0hjhk9XhRjq+\noajjlY2pnVqwFlU8K2OpcCygnUtAN5qlynGknunT76BrjIufryz8RVT+AUd1\nUBNG\r\n=1YuT\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"d76e611194693a7270b5e10fd87906ada48c7af7","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.fadab3372.0","@material/rtl":"12.0.0-canary.fadab3372.0","@material/base":"12.0.0-canary.fadab3372.0","@material/theme":"12.0.0-canary.fadab3372.0","@material/ripple":"12.0.0-canary.fadab3372.0","@material/animation":"12.0.0-canary.fadab3372.0","@material/elevation":"12.0.0-canary.fadab3372.0","@material/typography":"12.0.0-canary.fadab3372.0","@material/feature-targeting":"12.0.0-canary.fadab3372.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_12.0.0-canary.fadab3372.0_1621872366351_0.35719020049057426","host":"s3://npm-registry-packages"}},"12.0.0-canary.caa73aeee.0":{"name":"@material/slider","version":"12.0.0-canary.caa73aeee.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@12.0.0-canary.caa73aeee.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"9e210f036c1e3b97d94db9417a8995ac1ff4b611","tarball":"https://registry.npmjs.org/@material/slider/-/slider-12.0.0-canary.caa73aeee.0.tgz","fileCount":38,"integrity":"sha512-Gr8nz6q26vCcXVetmx6h+tQ4QFp5o87PFydlRlaZ9h6H3vPk1u+/jyoymhjINCMsBdOAsPVKqrVO9YsHJLTmpw==","signatures":[{"sig":"MEQCIDTcq3xDW2mAREmGLTdHNHVDmzjHG5xd25txrGvc6LPuAiB/xLSsRxd3qPCZTOZVyvaOlMkBoiXeZvrTud/vcGxQ1A==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":831865,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgrQZUCRA9TVsSAnZWagAAJFAP/2Ua7Ty/oC0E3/ft04nu\nrNnxyz48zm9mM43UnknUz580/bDjR2p7L9E6qqBPi5FQFD85xtr78Bk9Ren2\nT3g/VsrKFN6OmRV+sVjGTgU3+o8ZkqIzsHRW4rBrUOCJNdKxD8mtWuThY6WM\nOeiFCmRKBrqlRhOqANLfmvd77xqzSTcjuk/x8Pr4/NqNMjxo0E5CcHv/6+S2\nxD5aEhHh0L8JRXTWBooYBPEhOVJvpt3AsjPDuG9o2ejeIMRWTpVLJaoNeNUP\nRJIjyddrjAP999mr/m+jOJ22AXOPpQLLEuFMq6u0rzDs26PDSaH4BX2ENwe3\nQYCfn1EmvXUhl14375yA0MKnJLNu6EuHZkrl+kHhBnFU8allxTDCRpNfAgRa\nlTbWlO2IB+V+NPmpJeusf786LJMmiPAHNLGFDYBMQJsylkawGuq0HMef07DP\npSB82CEEO2ptKWh/Ampr4/3QYTlzOifCVXmbEbS/uvpOHC1w7+udtri98QdY\nUwbvwsTiNPl6TGTN1QQaaRftkIRQ1rPQApanTCPAYLONkiO06/Kanni71h9t\nvkobbXOJ5NwqYr+3QdezTDrWJRN2AoKqYl8oBz5P2qVoh2T7wGFQtoRAkk20\nFvmwJPox+gAcGsdtDH8tYRPyUTzcemry0gZ6Urk8rD/kkvqX3guhN8xeXWdd\nxInJ\r\n=XQMU\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"dca5692fda23e55426458f6b0c56c2b6dc9e2dd8","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.caa73aeee.0","@material/rtl":"12.0.0-canary.caa73aeee.0","@material/base":"12.0.0-canary.caa73aeee.0","@material/theme":"12.0.0-canary.caa73aeee.0","@material/ripple":"12.0.0-canary.caa73aeee.0","@material/animation":"12.0.0-canary.caa73aeee.0","@material/elevation":"12.0.0-canary.caa73aeee.0","@material/typography":"12.0.0-canary.caa73aeee.0","@material/feature-targeting":"12.0.0-canary.caa73aeee.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_12.0.0-canary.caa73aeee.0_1621952083834_0.24972997284327425","host":"s3://npm-registry-packages"}},"12.0.0-canary.ec31ae1ed.0":{"name":"@material/slider","version":"12.0.0-canary.ec31ae1ed.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@12.0.0-canary.ec31ae1ed.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"14580c0d2bf9b25a6f4084d17320f8bce0cbf6b2","tarball":"https://registry.npmjs.org/@material/slider/-/slider-12.0.0-canary.ec31ae1ed.0.tgz","fileCount":38,"integrity":"sha512-vXc+YdhQ86ZC3g5K0quHi673XYI5KL3ysazGnRXgXEJMkUALbFqpeqkqSqNMdzxlvU/HFjwPmBvfMUgLFRA/Ng==","signatures":[{"sig":"MEUCIQDe6HtFeD4g/uZyQmwALcg7E5n8a/wWVYYPANps4gpT4gIgCkH+doe1b9qhdHz24NRpw/3UGzuQESjns9gCx3do+z4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":831865,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgrV+dCRA9TVsSAnZWagAA+RsP/i4MGiBLYn+aEJwbNvbc\nqAHSDTT5VkREydskFFqm53pISPcpvp0bjy57nq6gnwsDNzqFj2E6RK+xHXlc\ndCNNo9G/BQm6GsatWv5t2t+hhVhg+20ngoWzu1/0Zb+0fCeVquOtqBdjzxzS\nCmFKEEAHC6eZ7YoawZyHBROSggcofgYG1nvU1se3AbS9y5GiQHftyW8f4mk5\nBSe4LSG0sdU8BdouV4tXHZKFEzgwLV/G/Ob1p2wfhLClVB60VT2+CNYUoOBk\nKJwQFpL9sYu/VH90b0+CtQgTxRlQJqbGqOADrDWR/PvNacB9Rr+fKBBFo/2l\nEIJ/BsIekoX9elJb0ZD1moJZyIXenG1e0jB+aewVi0uYnvrJRwDlwi/KDW1D\nuoAEUsEUZSeObZwCoTQY12TqjlbgdO9ALT/xthBF6u/NzgMm1NtoX8SkXcor\nnE5ahaC/oyH2/4YPNINxGJr6b9+x04064a6NHIg5JE1HydnG7vRD0D8W4xvb\ns6IlnDIJggAFzI1oNyLyCHrFHitnUHjJz1eoAT57Ef6pTxgj/AUmxswgtuHL\nA9Xp4HzEyLvMXE5oBgwoTsKPmPOk5UTMlTAgI6mdwCaNAB/e4e5wYjbIcXOf\nMc3DUgbmoogIqEoRdiaV3NBqw7Ai4gytnuDuXItJVnCrMgCgE9WSh/iQjFRf\nW/rD\r\n=ud0G\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"f9db084a3aed73c844554c3b223d5185727b6d07","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.ec31ae1ed.0","@material/rtl":"12.0.0-canary.ec31ae1ed.0","@material/base":"12.0.0-canary.ec31ae1ed.0","@material/theme":"12.0.0-canary.ec31ae1ed.0","@material/ripple":"12.0.0-canary.ec31ae1ed.0","@material/animation":"12.0.0-canary.ec31ae1ed.0","@material/elevation":"12.0.0-canary.ec31ae1ed.0","@material/typography":"12.0.0-canary.ec31ae1ed.0","@material/feature-targeting":"12.0.0-canary.ec31ae1ed.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_12.0.0-canary.ec31ae1ed.0_1621974940470_0.8018927311314468","host":"s3://npm-registry-packages"}},"12.0.0-canary.8530d3514.0":{"name":"@material/slider","version":"12.0.0-canary.8530d3514.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@12.0.0-canary.8530d3514.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"cc1b77986c726ca310225faed465f0517d84ac07","tarball":"https://registry.npmjs.org/@material/slider/-/slider-12.0.0-canary.8530d3514.0.tgz","fileCount":38,"integrity":"sha512-87ahT+E/agah9k7t5Vq94NBia2fY8PphaDPHwgnIKvZtda0cSj6yMSraGqu7rdTSTdLdmPn5gdunEUUsVP7A0Q==","signatures":[{"sig":"MEQCIEJdU9eFgPxmPViroThkD4QT/Rtqs0+BTxN5SSqki/17AiBvYl9TkEG53KfyBAtVDqbO8dYBd0VJUgM+WqSfvCJ/xA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":843150,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgr8M3CRA9TVsSAnZWagAAdTEQAJnp86AI8gwjzg3SNuAy\nNBJJMS0C/u0eca6/vwvHOtAEBkgo6RdCrvb0mLruXRMMAWl0q0N2rCYwEZgH\nBTZOYK9TNM0S3oQdqsL/bcaIkgMeU9v8+eyExirKxKn5LS4WccdveM17HIsf\npXozhWumcGi6HMAb+olbIi3NQDyd8SmC9Tv9wdxQipaZb0d8KzqNfNiTC1GI\nZbse2JndVbFIC6xRxu5X1NgBH07Q6FAKpWiF0oODfFF4CfMYtaKliDq8SqvU\nCd8sBUaDzaCfnRW3srmf1LhxJ3PcvvBX/6WzDuXeMLDRoYqLf57lrd74mI3y\nfh0M+suRNBoM+2SX6D6TJEoJLi4EIGqWVjegWUwA501eohvbDcZD2jwcIWcX\n5c2J+DH9Zp7Ubp38gYabZdTpKA8/9QFHyIvfaCkbokkUr37Y6GTbeN/VaDcz\nDBCppK8hElhyQKqDUNWeLePdZxesGCWnmk/PkWTr8M9GliEX/IFpM0JLXDC6\n4ES9NWEfb5eZvECQ31ThkedULQCFmxPO5w0gblwiDCdlM98HtihdUorNot85\n3/1+a9cIZ04g5qNwGaSKBU1M6Qkg9p1C4ZgbJal3fAyJamr75QDVAtWVTOWq\nNz/xXol9KX2CQwHeGStWfaC0iL3zeM83j/RRdiOVONFk4WXFXuzqqfVN/EEn\n+3dA\r\n=Vxyo\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"e32508a69db8bd9ce4383a14f2c576d35950566c","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.8530d3514.0","@material/rtl":"12.0.0-canary.8530d3514.0","@material/base":"12.0.0-canary.8530d3514.0","@material/theme":"12.0.0-canary.8530d3514.0","@material/ripple":"12.0.0-canary.8530d3514.0","@material/animation":"12.0.0-canary.8530d3514.0","@material/elevation":"12.0.0-canary.8530d3514.0","@material/typography":"12.0.0-canary.8530d3514.0","@material/feature-targeting":"12.0.0-canary.8530d3514.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_12.0.0-canary.8530d3514.0_1622131510721_0.8248515754443027","host":"s3://npm-registry-packages"}},"12.0.0-canary.00b5899dc.0":{"name":"@material/slider","version":"12.0.0-canary.00b5899dc.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@12.0.0-canary.00b5899dc.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"15825cbec01fea8b689b5511e5a1fc8054be4585","tarball":"https://registry.npmjs.org/@material/slider/-/slider-12.0.0-canary.00b5899dc.0.tgz","fileCount":38,"integrity":"sha512-RsYvgBYKqfRw/pSc7cEVwvHElqoohIuRjlVfYxSJMc3ieN+ZuX90jSvHO0kjgyazd86JzJKo2mAoAfCUuYgVeA==","signatures":[{"sig":"MEUCIQDkthJb3jfXL1akX43kVtBcj6s0/GGJy+s2QGu4c7ZtsQIgWvGpf/OUDbhgb3ucZ30tc5+lTh35luScanu+5I9Yjuw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":843150,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgtrigCRA9TVsSAnZWagAAACMP/2CwvIGXBInhENA9dqd4\nNWSBwdlH5gJ3ITwR9N52acDGsrqio+VwTrNjQUItYJ0kJ+cG/5bHMiM0Mn1j\n51W6WywcnWDv/WOZVMuYZXiYvMpHPEijJjDb5tdFIyKDvtmvvMsiYV0ruF2l\nZp9U0Flem4BDL8LDoQmqLqCk8Xtrgyo6+iQKlvW36gWSerUpehSpeKNTpR+t\nL3x4TdWT5tgM0U7ZKub6uOZuKVbw41/MJZ6n57vv1Joq7LGkp0KTuFLuZuwU\n1EeH5ZzlYTThCYMerm7O+5Astf2bP/msmiFipYzx0txb/VDG+OWzzFlTuUp3\n9Jp32ZOYF4hJSLZ+QcQp80EixfCmIOmGyZY1RFlqtdgl2wsArnRhgFGqFD/V\nyfPRT8yibg6U1GgxKXkVeY8bxa9/SphdGLhZY8LXk0o9mb+xohap7MKUxONf\nt7jFBPgMJWtUl5tXp2jm7HYWxcJU88ufaTM97HBUeR4K7PY80vTckd5KgJYq\n4hHfeOfeQeA8E/d0cvRXtMZF1gAG3HYazigOyB/wICg0hvAvnvusKIfRNo+Z\nQ0t2vjfYhqqT+fYc1Cd9M5zKnGYiMFc+3hXE4yIpVmxrnMMxyPnG3qX76i/3\nM5GXiifPPVvUo+QZnKzEurXwAuouTc2xlBJDVlwm6z1STC9xfqPMsq1NNIrj\n85UM\r\n=4uMC\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"19ffd4cf15764c62ec7b1dfd76483a2919f6501d","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.00b5899dc.0","@material/rtl":"12.0.0-canary.00b5899dc.0","@material/base":"12.0.0-canary.00b5899dc.0","@material/theme":"12.0.0-canary.00b5899dc.0","@material/ripple":"12.0.0-canary.00b5899dc.0","@material/animation":"12.0.0-canary.00b5899dc.0","@material/elevation":"12.0.0-canary.00b5899dc.0","@material/typography":"12.0.0-canary.00b5899dc.0","@material/feature-targeting":"12.0.0-canary.00b5899dc.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_12.0.0-canary.00b5899dc.0_1622587552207_0.4746950587024352","host":"s3://npm-registry-packages"}},"12.0.0-canary.f1525ea3e.0":{"name":"@material/slider","version":"12.0.0-canary.f1525ea3e.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@12.0.0-canary.f1525ea3e.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"fbce24d9b180b3246b2cb68bbe5e6583acff847f","tarball":"https://registry.npmjs.org/@material/slider/-/slider-12.0.0-canary.f1525ea3e.0.tgz","fileCount":38,"integrity":"sha512-ydGJmz6XGjD0czNZeeNYWb0R5R2FmL/WtYSL57SuS5/8XDLZ9x1f3sCCR0wV9ACwCvnil8xbHatfCzILJmFccA==","signatures":[{"sig":"MEUCIQDOLpndX9DOBGd9EDtu6LAE/QYUWbACyQTMwyAm9NnxPAIgNPX/qjfFO/fwGfUePltOERAFehD5Py/I1rGZ4KcGf+o=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":843150,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJguN8hCRA9TVsSAnZWagAAc3wP/jcSbEbw5wKypYsUXmR4\niWmzMqwB/zWNNZYtBbBjiOANxFSh6Kh5uulgltC1lRbQoAbHt6Quh8aHf8fs\nAthBOo+LpZWlM+FGtbgw3v9FIj95KQF5MykekcRaG4BjeOLC4GVpjwQaVV1/\n2rmFTCpalML0sswz44TU/LN9zhy4G1Y08f2zipncC2gzD9KfumHTPd/WNgWk\nyuUjGc9sHKyufvsY48EoO2JFsUBAuj8324vv5lDqLMq8fleGB8RH51LI0FA2\nl2sgiw+94Utj3+aGJgGn3/o9W3ihzsTel3SzkkA8j3v5FaqRSO0PukI0SdIA\n1dQrFyQxVwNYZAAv1spi6fJQqc6Ic+BTCx2heS1S7sl1wD37lD4reqsu12At\n3prVufz0tmhkNwDx3GyJ/d4pxBwjmIAiTQYlz33eoB3Y6cubyM+cPKLDt3c6\nCpp98Qio9pzI7Hww4K4490hC48QLLZFBdJKhyTHogNLso46zzrxF0uP/J4g/\no9O36wcUfJO0v6n9iYkgrMc1kZ4o6ZshxHtJzaO5ktsSUc1R9nzVimnG9YhX\nlJyPiIwVAEkUzGbil2fXlgQGDXdtsZmartywtfMV04WOugzhIZ//0IHIlXGN\nrcOSHj4xVrkO/XqLiwtg6FKJ5OA6j+0x5Cmet3PjqUQy1dxHH4tECSRkF58l\nlntf\r\n=srKf\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"97ff3c2e33330849b0ca447ac6983126a385d845","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.f1525ea3e.0","@material/rtl":"12.0.0-canary.f1525ea3e.0","@material/base":"12.0.0-canary.f1525ea3e.0","@material/theme":"12.0.0-canary.f1525ea3e.0","@material/ripple":"12.0.0-canary.f1525ea3e.0","@material/animation":"12.0.0-canary.f1525ea3e.0","@material/elevation":"12.0.0-canary.f1525ea3e.0","@material/typography":"12.0.0-canary.f1525ea3e.0","@material/feature-targeting":"12.0.0-canary.f1525ea3e.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_12.0.0-canary.f1525ea3e.0_1622728481628_0.7639851364489134","host":"s3://npm-registry-packages"}},"12.0.0-canary.464a00286.0":{"name":"@material/slider","version":"12.0.0-canary.464a00286.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@12.0.0-canary.464a00286.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"4e17fd8d9ef7cf11bceedd8035a640d23f8dc780","tarball":"https://registry.npmjs.org/@material/slider/-/slider-12.0.0-canary.464a00286.0.tgz","fileCount":38,"integrity":"sha512-uSyT+znTwELoZdsYyGora475Bv8iZvM4AriL+GYEHpjhcWJcb/xKSqHXxXbojVmyDVfwQgN4hH9FJhNi7h5fAA==","signatures":[{"sig":"MEUCIQC9vJ5Lf7+cS61fYj5tdtTpEJ+SX3GxabFSMeSIjio8CAIgGc5HtnndwU6RELGhZyEKt5Oa/1wzLqPYUs/JL1W9HGA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":843286,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJguOtDCRA9TVsSAnZWagAAdu0P/jVtAYNauRBwm2ZM7fgC\nOu+sH0vmqfbco1umaT9SWWn9y4xoAIkWV+esIaxQbipatQCvxsbtF/lFGaFy\nN8yz8NuAGZGHWP6a04lQVzPlchFhElMYO944U8n6u24NY6cP/kFiQhHT5nIC\nPtrLtywkXH+V4lQ1VKkHjvZBh3IktsRQSVSht/XA3HnEMdIb7eLnqIIgkzR8\nMrQXVIcEC92Qs97fcK49Olrxd0r2umReyHsNNtJj70m9BEd3vKA+z1hUBbbL\noOe12uImVN+n1+jHpwO1o0/tmU9zVh+yt3/tN2b5ZMhf/V84CCwUsGdyZa1h\nLmxMEbelc4fXm5Ggsgew3h/RKix/rntDNiYREpQ9+jpg+dpnBuk3+32UQ5Ic\nAcNXoMpeDHKsIVJzvr2H0MTtasitghkNqhbN0ZhqwG2RqFtwCQwAeplRuR2l\nJsC+Ii1rhP+PSauxerxIBr/nyofh7c7bHo662gkdD2aqionntZ9MduXN5kti\nH5Ld+hZQV2iytCPRl+arrZO0IrlWgoNavSSzsGh39q7LVR7G5DFytlkMyOXu\nrwc/HEl8FGAfZ0izX5DPhBEuXIrYSPvAewME2ouI5V/AkugejVgQjAQ5Tvik\nPOZG9ipriRYfxaqTj6sbDgmJB1/b7wIZeKdfS8C/KeTBlFkRS19iQVxib3Ax\nXy6z\r\n=X83u\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"ceb43f7f74f7db77edbe7a13d3b92e853d599d6b","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.464a00286.0","@material/rtl":"12.0.0-canary.464a00286.0","@material/base":"12.0.0-canary.464a00286.0","@material/theme":"12.0.0-canary.464a00286.0","@material/ripple":"12.0.0-canary.464a00286.0","@material/animation":"12.0.0-canary.464a00286.0","@material/elevation":"12.0.0-canary.464a00286.0","@material/typography":"12.0.0-canary.464a00286.0","@material/feature-targeting":"12.0.0-canary.464a00286.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_12.0.0-canary.464a00286.0_1622731587572_0.06812464752866809","host":"s3://npm-registry-packages"}},"12.0.0-canary.474de7878.0":{"name":"@material/slider","version":"12.0.0-canary.474de7878.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@12.0.0-canary.474de7878.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"d011eb96ff0ec6e1b200996a953634b1cd85a91a","tarball":"https://registry.npmjs.org/@material/slider/-/slider-12.0.0-canary.474de7878.0.tgz","fileCount":38,"integrity":"sha512-wxVYWdtSsK2yV5EtAGz7at/3iJw4lTbmK62T2GOpfohW5iA8PZHN6fCnsueu5bnGIP0XETDzabG5OGe/qX/sQQ==","signatures":[{"sig":"MEUCIBwTMluCE9Z+fH7X7rQIzRy8UwcXNJ8DKO1/KgqHfRQAAiEAkvzs+6JiMHC1m+Zb4zTeTDnv/D8S0ENR26NEdYsEa5I=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":844830,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJguPHXCRA9TVsSAnZWagAAFJ0P+QCGi/iNQS4AjmdD1NNq\nA+2O9iQhEnfFtHA4w9Kkeijt+sad2qVhdXuDO3363lKNg5h6CsXTCAl/N1pK\n52yZdQnDRZrbULZSdhdZobQv4mWwJFSVlbs5FEgexUDiCP1U8EskDlkHdm5u\nhOcqtkqpXs/ixKkFReOebho1JLON7cNeSjSlNURkm3NdQqpCslGicqa+AP+i\nHj2OPEzW/bpM/3CjKQ40TQxz9l8/j+9vFadSh+/C1ecKNfcdjYulkE5Ai272\nR8XNzsYJrndQtFJguMZayT720/asp2VDbT2mxrnmVtGwidbkus6/e79Augmc\nz2mTrmyHHIpCvCRFLKD6a+z09RbFtFAYrfDTeHNBQG7Nm0JY6Zguc0GDvK5l\niQ67oT/Fxdtqw/yUzYjMqrPB2jz1NmoDRFQtvxoH4HkKJPyJ7efmw3aCA/OU\nasdb26weWwAbvux9lxmDMm02fMnZoGsZ26VBeLnQnYyLj4sBmlB+X/IcWYx6\ncDUmhDPPwYuEpYHNd/TV0nMlMAkcVUAqlfs1+mOWuYzNGzJXRHf4uV62xNZ4\nUg42IDdMHnOAiYiD4l8bgDdzYxyKKwotYgiT3wPSErSk0FQ+mvTVyN7CtXy+\n6ZKUrHTKZxD/3lqaHDgO2Nag6r4TWb4Pm2hvtSmONWyPVJTjF2ehsZlo31Rf\n6Mid\r\n=mImW\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"67d604ec9cbaa0dc385eb36be35e0adfe641b244","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.474de7878.0","@material/rtl":"12.0.0-canary.474de7878.0","@material/base":"12.0.0-canary.474de7878.0","@material/theme":"12.0.0-canary.474de7878.0","@material/ripple":"12.0.0-canary.474de7878.0","@material/animation":"12.0.0-canary.474de7878.0","@material/elevation":"12.0.0-canary.474de7878.0","@material/typography":"12.0.0-canary.474de7878.0","@material/feature-targeting":"12.0.0-canary.474de7878.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_12.0.0-canary.474de7878.0_1622733271430_0.3182408843121649","host":"s3://npm-registry-packages"}},"12.0.0-canary.b87ebf74d.0":{"name":"@material/slider","version":"12.0.0-canary.b87ebf74d.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@12.0.0-canary.b87ebf74d.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"267c6a52d572422b22c26ea78225288f4dd958e0","tarball":"https://registry.npmjs.org/@material/slider/-/slider-12.0.0-canary.b87ebf74d.0.tgz","fileCount":38,"integrity":"sha512-GTSnBW/Kl/ZwN/8sJmbU0s7aW8zmZGjmXsjr5JSEFja5wtFB2V4wlbtegXBo0494I2BkH3QpiWFbEGDPvSh73Q==","signatures":[{"sig":"MEUCIEe9A8JniI3UK5xALNSaExTkiWsP7nQAV/+qVmpPl3E+AiEA78H5CjauN7GG+o94SQmHtwgVbUZALxOwAfsFyxy9ID0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":844830,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJguRV5CRA9TVsSAnZWagAA3u4P/0EQtwHo8+6gFwTRB3Oo\nOuVs74cv17DpvfgQ2jRaEba5dF2O2tdt/ea8kp9wvBKbahfs9x3ZL7deWmrR\n27oLzdDZkUl2JMSRB8ZVZKq1EeHs1+cHbBWp6bIgb8h6SSlprT1aTRMIWUkP\nPJC0vfTCOZTmrEi5ciNIre81J84yte3QllwX+gLWr0YaKEIbZ2oa1nSr7kX7\nNV/uX/Ge9nOXClC2EfR4Zr1XbEwghMG7GtyC2GunZfY2vLhXuCCzhUQWxRgH\np6JMlySrTvAJyvRg95oJJmH5Dz11iKudhVGL93TZhyJhpmYfDAFh7sTQ+8/8\nrBQe5p9ZHx0RxUU+j3J9s2vJCtLBuwfFOtz4xlZojoeSZrwDRrOhpxSoKClN\nykPufsRPA+BxmI4w48HBLuoOZTDBBh1gDvDYpxWeN3ntQaVCN66JsF1tcz39\nWKdi/2Rh19tPCk2M9b7nnwNpAgw85vuvCpf7OelzuAiSGZau+XBdI90EyeCm\n9pr6WymUo3nuYFAQtf2P3QxR4SUdj5+bu/b/zwsELmi73iYkeGfYQMU49mXE\n1JRrUNOewVPGLLUtn2+xKVCQLXTKXvm3/+HsUp/V88K92cST/icRPugo0i1t\nEIQARNv4v1PnRdwIDti6tB1BsTlGQkdn8AtwTE+28OwUc/it7lmwwllEsWUi\nQdA4\r\n=PXU/\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"d3567c6dfa0fd347d2141fb92460c63fac28b46a","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.b87ebf74d.0","@material/rtl":"12.0.0-canary.b87ebf74d.0","@material/base":"12.0.0-canary.b87ebf74d.0","@material/theme":"12.0.0-canary.b87ebf74d.0","@material/ripple":"12.0.0-canary.b87ebf74d.0","@material/animation":"12.0.0-canary.b87ebf74d.0","@material/elevation":"12.0.0-canary.b87ebf74d.0","@material/typography":"12.0.0-canary.b87ebf74d.0","@material/feature-targeting":"12.0.0-canary.b87ebf74d.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_12.0.0-canary.b87ebf74d.0_1622742393363_0.47878967215445223","host":"s3://npm-registry-packages"}},"12.0.0-canary.2daa49b35.0":{"name":"@material/slider","version":"12.0.0-canary.2daa49b35.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@12.0.0-canary.2daa49b35.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"52f4d1ac8411a561662d83ae4699d9bf39d02d24","tarball":"https://registry.npmjs.org/@material/slider/-/slider-12.0.0-canary.2daa49b35.0.tgz","fileCount":38,"integrity":"sha512-zUbzVg+K54SXZ4lJrqeEBNlRbDsFznl/XvA2p8WShN9u5e8HvOzZQI9mT02OIz5B4yUC/cL3RmaPdQWDYEa/og==","signatures":[{"sig":"MEUCIB3KHd6V72eVY6p2LgNYi25B3pAx7BGt2gChcqalvst/AiEAjkWgRMUvRQoaUKOS7uwngMrMXwYMH/CkoboSW1Bi4Qw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":845216,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgulFgCRA9TVsSAnZWagAASoQP/iU5riOELKDqWdc8O96C\nZIXFKp4+LTJZcnDe89LlbVwjGpX1SpB7ihEntSccfykk5mgtMWCs7fn1crkP\nFAH9Iosuo3G85OKLaFv6RenT5R0sJvrA1OUtzo2p6cF09XilbMWkJhaclBx6\npyKo4/byX3KEkSXwm00pSJvpsgzvRuaXbd5jDjedcoEBD+rO7Yqnv9UywZkF\nBGTtuKLqbMoDCWzv/lvN4nJtuuazHOsgm4YtNx6j943HB6aSUZnn50K+TjNV\nf0BQ8mYyGeCYI7oIOHbjwJ/Oiq9ThMMnp0mEz04iGb+9lH+cftRYUHGegT40\n9FtykUETf2+5cPiGAtxTcHY6rO9+wAU/nNzu1+yMHLG5sZ541sL+pvWt5vlu\n8HUzDTk01d71MgOJUql1R0BkVHxDdlqpqBKZ9cGcGyNAwVVtjE5F4Zxp7417\nIYBw/QDWFRcFnCPJHw7fXtsr1c8g2UziQUg0FwZ9qmS+Rhdr9uGT7qgmN/Xq\nxw3ImOS9dRTinkeasXYdIQkfso7Ah+MWLZjqDddB6qiq3pHNpYlvj1zt8B8B\nIScFuRPNvY4xs0Ai1NJ0VSlzd7q+9vzTwWA2sVrfrCOqhmMdzJwpfP+Y9wyt\n6ZIfzq9Qm1s3WQj8BtlpoK20rWcHywvPr+6AkXkjypgQv9W9X7hHkhhwO21E\nQymy\r\n=K6nV\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"3e759afe4116e5fb3941df918249b1b1348fe684","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.2daa49b35.0","@material/rtl":"12.0.0-canary.2daa49b35.0","@material/base":"12.0.0-canary.2daa49b35.0","@material/theme":"12.0.0-canary.2daa49b35.0","@material/ripple":"12.0.0-canary.2daa49b35.0","@material/animation":"12.0.0-canary.2daa49b35.0","@material/elevation":"12.0.0-canary.2daa49b35.0","@material/typography":"12.0.0-canary.2daa49b35.0","@material/feature-targeting":"12.0.0-canary.2daa49b35.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_12.0.0-canary.2daa49b35.0_1622823264084_0.23011950753727972","host":"s3://npm-registry-packages"}},"12.0.0-canary.08db3d737.0":{"name":"@material/slider","version":"12.0.0-canary.08db3d737.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@12.0.0-canary.08db3d737.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"c560fc958a62a1a312934843e0e820cb8034c3b8","tarball":"https://registry.npmjs.org/@material/slider/-/slider-12.0.0-canary.08db3d737.0.tgz","fileCount":38,"integrity":"sha512-rOcK+dfkoce+Nltcpm96kxwW1GweOwZtP47ly2JUiG9fIfMlXybVR2UAGXaTAPfHRWh135lsAVnOeT+7t6rWLg==","signatures":[{"sig":"MEYCIQCDMRWcs8Tx/tqGb+PeJL/4cmxZla4T6Y+EM1+hjLMDJgIhAPhuQVKCWRn4WnPeCGb6wPR+M1gpnbvgepz86pH+mZkA","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":845216,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJguoIHCRA9TVsSAnZWagAAvNUQAIQLSkbrz4xvrZqG+gcu\n2rsMBzNqp9s6xCvUhg6AKBPKhe9EzFFcr8ky9gSY9d7pQDZ3zvYNAKZQ9r8V\nDgheE9wLnTPGO6kMvBpicovAE0bjBcKWzgqRnSDwUxlMwslmmxu0vzmwt/ka\n2O0wA2cd931Mw1DSBW9WxTAXSgLieXgtF2kihd1SAti97O4gmzWzHCRVZgfg\nkjqixjoRGGisutW/Hu8s9WY9LArobwl15ZXjN6IpOnGi+WmZiGvovQJEeKxI\noAEiiRVcc1w2G0RcmgDlZS+5o7pW826ypDhgi6ROPfWwWvzAR3MR3hDB2lIv\nMJivvRF+6Rj1SLcfFy/gr3U3W+mq7e4pRY23vIWQTXuLnYQRIe7H6+lJpuZT\nEy0jdf8GE5oRyjGAppeVpbba0RNna7q/38EfTAPwegdDBsMpWSpcCk0J8/5V\n/sYalnrKHo2GFEipiPXawjZ38ekktWHvp/Z+SbJ6TA94dA4w/v4DSsCmtKNH\ncd8qxd/+A9KKgb+BDePKq6RL5XU96f7hoc1+EBTTEqR4MvYhCR5ckyEFWV79\nXcQEXLl7LUzdHT2S9w0+PsM9O0qo/7+RSQVooixyfaWoitrziy6D3y6forw/\nOOV5+XNXMIQJuFtx7jwoxeCUyMcWewdO99VKzVdSPKHqaQF/lg0eZw6TLxDn\noJrJ\r\n=EgVU\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"0175b9a3635a8e6c8c6690948618b55f39ca1ffb","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.08db3d737.0","@material/rtl":"12.0.0-canary.08db3d737.0","@material/base":"12.0.0-canary.08db3d737.0","@material/theme":"12.0.0-canary.08db3d737.0","@material/ripple":"12.0.0-canary.08db3d737.0","@material/animation":"12.0.0-canary.08db3d737.0","@material/elevation":"12.0.0-canary.08db3d737.0","@material/typography":"12.0.0-canary.08db3d737.0","@material/feature-targeting":"12.0.0-canary.08db3d737.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_12.0.0-canary.08db3d737.0_1622835719073_0.050879114665210334","host":"s3://npm-registry-packages"}},"12.0.0-canary.5823407a7.0":{"name":"@material/slider","version":"12.0.0-canary.5823407a7.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@12.0.0-canary.5823407a7.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"5bd502cc356552a625421577df60b99fa1c2d8aa","tarball":"https://registry.npmjs.org/@material/slider/-/slider-12.0.0-canary.5823407a7.0.tgz","fileCount":38,"integrity":"sha512-lm+EhptjHi6Mk0mVg/qCJzoqDdDRL5IZB9REEiW7ZThpfio6p7TPqTea6ZaLYwRFqLpydDJc4PKRMXt1dyrjOg==","signatures":[{"sig":"MEYCIQC66sSYhDacOeW7Reck3UFeNOZyeJ64XbEEuRTH8HXPbAIhAOUC8zHk7QIFviJK0eci7x7SXUwkw6hZc5QnVwYuJNaD","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":845738,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgvr5oCRA9TVsSAnZWagAABesQAJLgVde9AIIFAkkYL7lc\neQ0FsPQN4EHh7xOFy488kCXMh/aj4Qct6w5j6ZtVSUW8FTNPyNSpxz03L+b+\nDBHJoaGVAmSRzxxnabo9ieKXzJi6OTgA3uDqZFtUphrDPo5lBVw4m+NiZ5mI\nyzNPOCHzs6bYhB3r98kuCWGNhy24mQH6sysRSQk1wVBMmIFsNOg6KRNZU/h3\nhA+1DL/aCty8T7WzbQqlh6bJXKoljk8OpoLc4T4so/KAqX2zsAnBVC3+HtvD\nmLIgrz7SOcIciFKob2LN2XbA5+UXiyIDC1sXeZDsBgI3mOuRmnjYBilSbNVx\n2uLzbybMtB5f1XsZCQf/6xKnsp4W77l8k/EMMVee+gg0QTwNPmT9Tc2couaT\nqQa8Ynn01A36vwCfhk7Q0NPdiUXQmNsc1V3uebKO3BFH2oY1vysR+ufvWpIX\nbk8Ktwx8/0ucfje7K7T0Pe9ZpvyeSoYQhWxHkkZEsfOdJKp5OfJmz48w3yHA\ngZXtrwkIyhPZmui/wp1Cy+V3RXB8Ons/Tq3d3FUwrpyQYf6zmar2cQ4JWzxc\nkgxeQr70EezsRKG7W8Lv4XsCIEng7X6+omwQsYKVm2FQABbNdU+JOg+QYMCI\n+g3DrUmYZ5Dq3Wekd6pNCQZXEh5oArUjHRun4SNLcVgWHd8WouVSblcy0dzF\n52Z+\r\n=ijuN\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"dd3ce4590e0d881d04e885d116e10e680b6c01f9","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.5823407a7.0","@material/rtl":"12.0.0-canary.5823407a7.0","@material/base":"12.0.0-canary.5823407a7.0","@material/theme":"12.0.0-canary.5823407a7.0","@material/ripple":"12.0.0-canary.5823407a7.0","@material/animation":"12.0.0-canary.5823407a7.0","@material/elevation":"12.0.0-canary.5823407a7.0","@material/typography":"12.0.0-canary.5823407a7.0","@material/feature-targeting":"12.0.0-canary.5823407a7.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_12.0.0-canary.5823407a7.0_1623113320307_0.785726657363274","host":"s3://npm-registry-packages"}},"12.0.0-canary.23b0c5e22.0":{"name":"@material/slider","version":"12.0.0-canary.23b0c5e22.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@12.0.0-canary.23b0c5e22.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"4d3997a61277085e6ee0b268065fffc9a6855b6a","tarball":"https://registry.npmjs.org/@material/slider/-/slider-12.0.0-canary.23b0c5e22.0.tgz","fileCount":38,"integrity":"sha512-COH8yojI/yZyI/qJmYhcRixB/8EM3j18IsDlLq00PIrsrKyU62QDJD54BWQ9NLal+AP3xwII9ly8+dtWLlnkLg==","signatures":[{"sig":"MEUCIQCqWCDJYzTJyvwe5+bcjsj1vHYU4L2Xpan5n6hgMjJHgwIgSkAh24FN3oQHMtRB/XDN22ntQK32qbBWFra5ikLA7p0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":845738,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgv5lGCRA9TVsSAnZWagAAhdgP/A9tW8OnxI0kJ/lvuQyq\n1gBUNOkgOJv4HkADEKIN0ZU7anpnZ5yB3rOP0Biz79IyLK+LIo0WTiU6BrEL\n6U8F1AbKjL43vreUNc6doXgMysKVtsvAkBEyEIYTKYAwQL5Ia18YV/+TQlAE\nUy8Gjzgb+ewHJnPWge08I1oSwKjQoVdbaMfHv/zxOSiDCLFvgokDfu3rJPaa\n6Kr+5mHGJk9UDKRh5KunWVtfgdo3bGZLQYeukqvu9+2B+bLzHt8VU5gTOx3c\ntTk3FhDEqxs4WGtyhUhaNmEq4uYn/pQYkE44+J0xEFyimORZws6NokXkRAnC\nnJ+GNgVdfuojEw+ap/Qj5zMhEDzfNL/k2He5hNdEcEgeECAdGUxXAmELnMm0\nlH3J8VcN1MUPlEoFPUQxNBKwlYEodrg/8cpDOaiAGhpMrl5M2dJZUUS9nSza\nH9K1F4Wm2377/+bX5AC3FyvJbwgdo2Zaatlogtqq6PbKZS4nLWGXus1r0ekD\nB1hYzr2oSZBYT2qH5E2F0DW/JMl7GNhfB5LlPvP+NNGv/XIg4bZ4e2YqX9SJ\ndxMSqZArEd2b9BKUk3Wny0YJZGl+3TXzS+ba/JiufXNs5ia2AVH+LXIhnOuD\nvjfMrueXZbFGAmmGYxaXAhHvLFu/8SviCPkB7UryVKRVpmn2WCbV4mnsQTuO\np5MQ\r\n=opiM\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"fc55a497a3b0d48a691942de987d781555ef9d82","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.23b0c5e22.0","@material/rtl":"12.0.0-canary.23b0c5e22.0","@material/base":"12.0.0-canary.23b0c5e22.0","@material/theme":"12.0.0-canary.23b0c5e22.0","@material/ripple":"12.0.0-canary.23b0c5e22.0","@material/animation":"12.0.0-canary.23b0c5e22.0","@material/elevation":"12.0.0-canary.23b0c5e22.0","@material/typography":"12.0.0-canary.23b0c5e22.0","@material/feature-targeting":"12.0.0-canary.23b0c5e22.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_12.0.0-canary.23b0c5e22.0_1623169350489_0.33588602648518906","host":"s3://npm-registry-packages"}},"12.0.0-canary.2952c6a76.0":{"name":"@material/slider","version":"12.0.0-canary.2952c6a76.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@12.0.0-canary.2952c6a76.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"669901a1f5fc998d91ff03f6310caabcddc532be","tarball":"https://registry.npmjs.org/@material/slider/-/slider-12.0.0-canary.2952c6a76.0.tgz","fileCount":38,"integrity":"sha512-h3AKI6HQRoDUmWJ4+OFCnOAxXEBO2obcvjM3xeKGMkQJ6FXQcgXW4wHRwC826vBs5Ee41xUIo7flQO7cN2dMrg==","signatures":[{"sig":"MEQCIGcOp7UcluHCpeoS1NnvEmBEhdOs3VQsXwVAN5UzGqAJAiAOuOdLIo94kTdwAh7o6QpHdncJBkeZwRDHCoTv1SeFEg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":845738,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgv6u1CRA9TVsSAnZWagAA7Y4P/1qbyn6XhmPx6RsTVVlE\n7w4vczTtIvp8tBVmD523ejRRKmtCpEckXZBuxUswikITVHQG59l4fGdWiQ91\nqFXaJKxLdvKMjmH09yo04wE9vc2S3gpZP2ZF5ynvVPEjFQ+msnurvm+bAOmu\nCa5z8u36/ayxJ8wYgCW1prso2UZ+fpRNB5Uf/1RPlpA6Rnv8ThakepCZn02k\nzTJ44B0aMhLQ56X0/JlC3ShDr122D5OxLHSnJyWvZTRIAYKcnWVBiXNmTL+i\nxEGg8PGbhMJcHJxA1WY01j0aZP2Swom0yFmL82cdif8heDXspn+PArosItz3\n0wEF1mPx4JOQjE44LiQHNbzPR2u/cTC4isfz0H37ChkOH1sV4reOl0h7jLcs\nZwGJsQCxv+KhHfJkJdnnVS4IoUA9uRR3rEYr24prqZ/WQGw7iT7SVigNF/yo\nbpKPqWY5Zn1VeqrZPwrywZuO1mtM56l51Lcs4L6Xd/x73lPqXEstK/AgA8ee\nZ0Wn1lO2/gGWKaJDO+TfOGZgNAh3rpkZ7v6nkF7x6kD3haqPh2NCL1iov+ov\n5odYnjRu2wd3I87KGimSjy6+N+UwGdYLy/IVrcimJOHSVtOVmeGtrxSYnvjd\n7f5zk05KrhgQpMtb85oTPdFdLzdooPyDkW9G7BWd098E2sHXkigrCdF/G0Gv\ns0sX\r\n=kopC\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"c1b0afec5d55ef54d74fa1cea1899368fe5c7180","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.2952c6a76.0","@material/rtl":"12.0.0-canary.2952c6a76.0","@material/base":"12.0.0-canary.2952c6a76.0","@material/theme":"12.0.0-canary.2952c6a76.0","@material/ripple":"12.0.0-canary.2952c6a76.0","@material/animation":"12.0.0-canary.2952c6a76.0","@material/elevation":"12.0.0-canary.2952c6a76.0","@material/typography":"12.0.0-canary.2952c6a76.0","@material/feature-targeting":"12.0.0-canary.2952c6a76.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_12.0.0-canary.2952c6a76.0_1623174069571_0.5483617997218999","host":"s3://npm-registry-packages"}},"12.0.0-canary.f12425f88.0":{"name":"@material/slider","version":"12.0.0-canary.f12425f88.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@12.0.0-canary.f12425f88.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"7c3eb95c3eca8e6df5296597d48ef5762d246596","tarball":"https://registry.npmjs.org/@material/slider/-/slider-12.0.0-canary.f12425f88.0.tgz","fileCount":38,"integrity":"sha512-RcxiWagUiRl6A3TsQoFJyIFJgngohWGrr3QUQRFf3YgofOUOnVi/TodXaBh2YT1ESxD2AbpIKyn3j5rLW2EGnw==","signatures":[{"sig":"MEQCIHkSCnhIF+V7jt3MCE/q7Yn7uca7Idk3drjOavDz9QQAAiAgc/dsqcywu1a+mDCERLZAJvcSFl+b+HpMTHURoTHaug==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":845738,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgwWWWCRA9TVsSAnZWagAAf68QAIsCrZV7PxSDFy1gvsIB\nKul1Bgcdxk6WMI/Xcx5IjqaJg/xUh4XmwWP01c90P1fj+FQjuNN9HbC7K2Ke\nh8yqpnkE/5guM5SuA85NCBB6OzVdLhs30oX3d3qqi8GTsvJcviVvI/2u30ZM\n9Zc9XAvnGM2Covo6pW0CUROAKRvgBCmkPE2eeJxplGUFo3uKRYW/SjlzR4QX\n8gVL6gEtNB+NpJt7C6ox7gZrs/k/RvgWQ2nnyu7jLUCTjRmYm1Y5UyMWUI9M\nlxaeWeXZbwJ/ZMhFg/s2oomKudfJB7TDMiiZVOpzsVKiJ3rEg3ob4yH3D9gw\nOYooEL+5WsKwl1V86x19CYbHaf6R/yHm/no4AycUrLTNxDcSviSXNZJdaubL\n4UcDqOT2KC9u+X/W27XAVMjMVW4VFKdYUTKD8h1bSXggTtKQvpi6GXKpz8ap\nHfSKUSopZjCou3FECw5thKBjwkoBi/KY4WhfWcJLzUiRlMWeXhEbu3DhzkAc\na9XhvrgJUD9tq+xrsjxT64012iUGu5h1yGujTsd1OrbEMaW2LAFcW52rAYHE\nFwJHr3AxATiin7YpLZ2x0NYkzSwZmQqSjITliBIR1CiG7sZAaBLCijJRQCo5\ngJNx2vMYe55jYZ55fGkE2oDXczv+triKzFfBkIwkU/gHh6k/o4gaLEuXdFBV\nhL+C\r\n=3pSF\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"c8fa3a7d372e06e42b474eed4ef3e4105dc43301","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.f12425f88.0","@material/rtl":"12.0.0-canary.f12425f88.0","@material/base":"12.0.0-canary.f12425f88.0","@material/theme":"12.0.0-canary.f12425f88.0","@material/ripple":"12.0.0-canary.f12425f88.0","@material/animation":"12.0.0-canary.f12425f88.0","@material/elevation":"12.0.0-canary.f12425f88.0","@material/typography":"12.0.0-canary.f12425f88.0","@material/feature-targeting":"12.0.0-canary.f12425f88.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_12.0.0-canary.f12425f88.0_1623287190563_0.8873056158219848","host":"s3://npm-registry-packages"}},"12.0.0-canary.e543628c3.0":{"name":"@material/slider","version":"12.0.0-canary.e543628c3.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@12.0.0-canary.e543628c3.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"3ceba43ea12d47c54634ac5a636e4646c193787d","tarball":"https://registry.npmjs.org/@material/slider/-/slider-12.0.0-canary.e543628c3.0.tgz","fileCount":38,"integrity":"sha512-BWEQR0s/PW+Owm3gP1p1cqKNf5IBgEIXkY4IY+DdjDnF0kGR2Ba2MHDV57OocLCeZB4gOi/npsFLFRrp784TEw==","signatures":[{"sig":"MEQCIEsGwerRPbA7XeJaStrt5fWfnICY9XedjZwGNO5ElIhnAiBgNIdRac0e2Lz2DUPsUsoIEHYFMbQLOHwPKC3mXI0VYw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":845738,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgwWXSCRA9TVsSAnZWagAASZYP/ib8OGmABcOssAoPlVtO\npabojoia/nTWsQmQzZLEZIbaXdPYIEN8IJG+IeLNStn+kULxWE8B1pjwnddg\njG3boUPyGARG5IuQOpP7rpfqzT4YVO+RnLstM8CzL75PRqxyx8KZr8UDi442\niYAogDfrqjM3+goskQNhNUTPOH/+BoEDS7YhrcZ0DTpbdzaxGYEzZ6XfKAbu\n/R0bBoSbqfzxX0SegJ9bztbbEf+9Sp8tJsAt+/fjggJOvrOJH0QmD5o7/LHl\nRvTbGPEXaAXS2m1uezo0YJYtKQ+pVRLWjc0KJK2swxjphsiNkeb/EbRVZBEF\n02Ljxlenh5iyX6qqYfjdePZ7383Fv3SljEUnbRP3NE5Mtvbfa4+N9xzmX2wx\n7XQNEMP1qaJvnofI8t8LSMJMxcpql/wmwfN/iGTE8WrMZgq2F2LXucMYHbbF\nyj05X3gHW9fdXKCCR7KxeJd+r5mUQr7uZ1+5E9eT3ot2Fao4sj+D2FOVwzAD\nKHPRtTs+liEvVuEuVFbRdzVLcJza7NsCXJTs7MLnVZVq4vQLlgswFJ/XjM2B\ncvG3lZyIHb1qx1K3/Wgl4uOHutUPF0lyd0FvY6qEcpPSWoMgGUrkBKrtv75t\nt/Mhz+4xqkwxx56FGTRa0Jho+XE9NGxhuRyesxUoQV8dYZsuhojAjFlRx+Q4\nq1Py\r\n=wjfp\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"6e28195a46e3b2108c76ee1a6a9ea9416276ce52","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.e543628c3.0","@material/rtl":"12.0.0-canary.e543628c3.0","@material/base":"12.0.0-canary.e543628c3.0","@material/theme":"12.0.0-canary.e543628c3.0","@material/ripple":"12.0.0-canary.e543628c3.0","@material/animation":"12.0.0-canary.e543628c3.0","@material/elevation":"12.0.0-canary.e543628c3.0","@material/typography":"12.0.0-canary.e543628c3.0","@material/feature-targeting":"12.0.0-canary.e543628c3.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_12.0.0-canary.e543628c3.0_1623287249964_0.6542487282991873","host":"s3://npm-registry-packages"}},"12.0.0-canary.e0c346286.0":{"name":"@material/slider","version":"12.0.0-canary.e0c346286.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@12.0.0-canary.e0c346286.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"adb336808cfad102ba5ca646ccf57e6700da596a","tarball":"https://registry.npmjs.org/@material/slider/-/slider-12.0.0-canary.e0c346286.0.tgz","fileCount":38,"integrity":"sha512-LcN5syua+MmSRxx4PqBIJJsXr5c1+AWIXxgpcwpl8l5Be2ti060ThjREAfzA34KveHkG9gP05pC23SGuLPDDDw==","signatures":[{"sig":"MEYCIQDDbAwp19KrA0wHMA7NM4zl1dLHpARpiTxZQraipu0nwgIhAP6sF4zvE3XSz8TRixMy1BRRIr+75h8eqd8K6A4NpyYo","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":845738,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgwj93CRA9TVsSAnZWagAAga8P/0Hrg+/VKCC7ag7dNVRQ\nv5uQ7tQ4WpRv2lyqV8K0MFJ7zflMI6yg8txptvt9qpNBHTPT9m9zB12DT3ET\n17s//ycq6vAFw1Fndmo0f6AnYxWoDgt9Ti6CnB9VD4hdP/8B4ps+kU30RC5v\ne0o1qlG+Zwf6lzE3UiVK/hksys1YX02EYhwanUBRzjFLtFAg7gqv6TFeNTHK\nEgQbs/sspCH6J16RLt7VXPbacVbdZr1J3ac6eK086o7P9NH8lM/7hXDjbrzd\nS7RpwfGf8DTsmy88pbZEAUWmnXnDLbJxIjm0HR5I8I8379nqhn2oioxqyvIY\nMyqyZ401BKXNjOGDRAcgej8s5Q7le7yWpMnjVYG7qO22OCWaFVmdgxwNFCGU\nM+sn+5IbZAc8SKbxZ//Nd5j6DUGUATYTYpYyY/UdaD0sj746+l9aNN4TiSaY\n3wJRC0oG5/ZK1zehVgnwQI3Z9hplNmp12/wGEDOQDz0SHfjdvh/laBxMiW7J\nPRFiap+BI1PKzLZDns2Z6uhvk3G85Qe9QquXBfRGA9UCMZquFQzhzAkagi69\nFBVjeKK5I2M0vTABaxTA2CbI5Hp4+CYqFBtFN2567CFGDRXHTNaxVy4TcPyL\nAF8aGN/CkAj5sKMUnPo8IVNkIlgvVyMQTRlQ83tHEPi9T+rFQhKtF772sMj6\npJ1n\r\n=+v5W\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"405607237a611d804caa0b022897b683aed90ccc","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.e0c346286.0","@material/rtl":"12.0.0-canary.e0c346286.0","@material/base":"12.0.0-canary.e0c346286.0","@material/theme":"12.0.0-canary.e0c346286.0","@material/ripple":"12.0.0-canary.e0c346286.0","@material/animation":"12.0.0-canary.e0c346286.0","@material/elevation":"12.0.0-canary.e0c346286.0","@material/typography":"12.0.0-canary.e0c346286.0","@material/feature-targeting":"12.0.0-canary.e0c346286.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_12.0.0-canary.e0c346286.0_1623342967233_0.70404088265277","host":"s3://npm-registry-packages"}},"12.0.0-canary.f43af5633.0":{"name":"@material/slider","version":"12.0.0-canary.f43af5633.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@12.0.0-canary.f43af5633.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"af40e464c72599c84f9ce5345262c452e87577b2","tarball":"https://registry.npmjs.org/@material/slider/-/slider-12.0.0-canary.f43af5633.0.tgz","fileCount":38,"integrity":"sha512-fGsUDOI/98oOYdoJWCCJ8cF7FvuXeVlCXV/3c1Z/NJd3HOfdHkE/pxi6yEqRmtFisODvRBRDIurqFGp5xe5JPQ==","signatures":[{"sig":"MEUCIGpv1DgjeK7L97+2K9UEqkyFMQs1YfOPMQ76+n80CrANAiEAxXVhw8nyMOjvIZIhthp9HrBBrDoePik6KAUsrO1vsTE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":845738,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgwne0CRA9TVsSAnZWagAAGY0P/RB5FN0m6lcNCQs/gFdf\nTPH2CwMdh+YuiLciVkWQ9F4RB0eLSgginTtL4m35xZnGX2M7hC48h1pUyJjN\nUUhG8jNDPHJkh1+p9CepAggRNBcXLGbZOj3b9fs1QRHfpjyaArOhO0UiZzoH\nzzR1UAxS22bn83iRlev0q7xpZMyqfpNYA/unfFzj2gu6Cz7yOQRTq8FEhZx5\nW7D/5AnlwNB84c7nj7htNvMN7QvVPvWIjFtpOEfK6Xi5vUXj1as763dzVWvm\niFVCSPiWq/J7cDzdYstWHIwuKO/Gl9ixDEK+9JrlcZlv5m+4Czt5W34CrZ+E\nzyEXCYzAVKj/8IicQszf+xU+cDcPMn8SvwJhM19MjESN3Y4JLUyjOOJWJGI3\n8V8RKvzbnGV+gfnd65zTNweiPedYthmQP80akKXvj7722GzucMhuQZTgTxoo\nk0UCnaSqQJCNNY++/ayR3jOiXkLTf8SytqSMgf4LCbcXqnSh7JmDBs/URMt5\nsxxufft3FXzhsu+uQsRDdYNQiD8U9SyWdYPpfbyUNdINT6Y0Ox7xu8R49FNA\n3/TEN209ENNTqUgyxv7j/1eXCORyL3DpCRYj8b/snTAH9oaS7dhdTizFgv4L\n8OB1Rz91Gs4PuJ51lu/7Naxca3lKkbcpkdQWLm74qFCao2y6qWWPZHCPz7R9\nZHgI\r\n=5XDA\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"6889f0098642c4b4f3987ba353e17a9a22de856b","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.f43af5633.0","@material/rtl":"12.0.0-canary.f43af5633.0","@material/base":"12.0.0-canary.f43af5633.0","@material/theme":"12.0.0-canary.f43af5633.0","@material/ripple":"12.0.0-canary.f43af5633.0","@material/animation":"12.0.0-canary.f43af5633.0","@material/elevation":"12.0.0-canary.f43af5633.0","@material/typography":"12.0.0-canary.f43af5633.0","@material/feature-targeting":"12.0.0-canary.f43af5633.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_12.0.0-canary.f43af5633.0_1623357363853_0.313506043092348","host":"s3://npm-registry-packages"}},"12.0.0-canary.8415ae585.0":{"name":"@material/slider","version":"12.0.0-canary.8415ae585.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@12.0.0-canary.8415ae585.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"b8318c543344aafa6a3bc05710368c59ed01a730","tarball":"https://registry.npmjs.org/@material/slider/-/slider-12.0.0-canary.8415ae585.0.tgz","fileCount":38,"integrity":"sha512-nr1TSh7KUDVX5GFr38VQgLz4GazHXuPDySCuTxHGBmGQubbX5S2ebEbaBr0cgw8Ob5O8W5roRy7V59LG9UYO4Q==","signatures":[{"sig":"MEQCIF9dGn7seIyotPlTlq40xYLQ45WeVA5UIRPsrGp+BhfCAiBh2JZu2AUtHBIm/+aFeuCAmpbG2r89fWOmyMgeXC8mkA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":845738,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgw4nxCRA9TVsSAnZWagAAC94P/2NxpODfp/mH5t5BuWHr\nr+zFACRp00TTscaUgyo9PEHOOSuiADR6Hiw6MJVH3tl+2vuyNqAzr7NAHZDz\nIQf4m98uzqCxG+rJL90T1ylBqyMcObfghvyQU9i6LSf1e8qngjXw+sksmq5O\nUhyuHEtHp/l7+83BFmxT10aXre6yaRYkfyOH7ZeQBQ+WOjOoiHvQAo9QjsR3\nTEcwxqzb8KwoPr/DbujcxqpXGL4+ezOXAfNoBPmABCLf/B6NTNCplqNG8ouO\nPgKxKds6W/eDeHJqgC8GygNjBeU2nR0iHoysRiCbWfVHV6ddAgfkxBsM/rc1\nzjmBEsVRTkRh5oeXbS7YKs8hEgvUVLlZhY/QAk1d+oUBKpMZ1PXryiC4jIFd\nbyeDRZW62NuHt6c2zDir0p4XIaFYCGIbAv536ZyQW+3aNp3gKwTbP8v8B13S\nqY5KCe7F3fwWev87RkXpJItKMNVBFq9SUDY6HUBpNY4x/dtCATF6mK/z9n+L\nsubrbTzaq2lfo9U+MFXC0LxgEB/6e5kOibnjWLQHRXsm5By4XbgK24QEzOta\nogf6WkG5rcgXl7VpKjY+H9YsLlZ4czEBIRmtNSC26EBeqRNSc9aIZVvlR1k2\nK/qOwmPfKtZhVF9dYbMYrvWAqJvyydG4Y2lydc8oQYlWStLbBH2dRi0vMH4z\nSZjK\r\n=uKF9\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"d00f19e41330e3956e7355a23ea132e5ff37403e","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.8415ae585.0","@material/rtl":"12.0.0-canary.8415ae585.0","@material/base":"12.0.0-canary.8415ae585.0","@material/theme":"12.0.0-canary.8415ae585.0","@material/ripple":"12.0.0-canary.8415ae585.0","@material/animation":"12.0.0-canary.8415ae585.0","@material/elevation":"12.0.0-canary.8415ae585.0","@material/typography":"12.0.0-canary.8415ae585.0","@material/feature-targeting":"12.0.0-canary.8415ae585.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_12.0.0-canary.8415ae585.0_1623427569006_0.42197560305373316","host":"s3://npm-registry-packages"}},"12.0.0-canary.598fcccc8.0":{"name":"@material/slider","version":"12.0.0-canary.598fcccc8.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@12.0.0-canary.598fcccc8.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"3008aba5dc0d47e58d19a54b31b7f80e997ae95c","tarball":"https://registry.npmjs.org/@material/slider/-/slider-12.0.0-canary.598fcccc8.0.tgz","fileCount":38,"integrity":"sha512-QX015XEzpNCquyjB3A7wfo5qoLHlddAH2gA7Eok2tRXCCqofUPmP13Hu2ywPJQvejgnMikmfrro5Any6XRfz3A==","signatures":[{"sig":"MEQCIByNUc6EZT/KIzUxoKSRI1LiuXIoCPaK2/YiJ9bQgbMGAiA9FW3bp5qy68QU/FObXTppKizNUqc8Nz/SNiK09rfiBQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":845738,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgw9nCCRA9TVsSAnZWagAAlUEP/2x0nuBeXV2BuO1vH/kn\ncYz4ru4MVnYRIOAqTYQRDS8qMqEy4rnpjXh0WHKYJdRGmX38otsMsQ6nKXhC\n9oauVP0P3t+F1C/t6U8zWRM4nuyNC27QcJOOvWDto9aTpaLZEIS/chNkC8lG\nerSQXZAepArKXi9wm6lPzUuqmAoUD/e23qrmtI80beVvOUFMgBZqWcpm43HP\nNW5sN2C7GX3D+Svivh4H7Gv0uuV915VgQPsMa+/vSkuZtrzcv99nZ4dg+idW\nwwbzTNT9F8rbvZeyFuJaRA/QVOpPY6FnsDHOJqllAZQ0BwuS762Q6zEqYReM\nOxU5YTzUg1pcsgK1KKofkRd9XZyxTvrSxUjTH0UxmgUWigeHUJ5RJAi9um/j\nuzEycSfgHm8XPiDmHEN7kkTRxcDwqQ3wBhnNLThs7wIeY/i1eQY131RYDtd2\nN9MAaPnEpimhD752dKQuO3fg7QFhAaq5B552b375jxwD1dK5LNrLky1rEz9g\n5Nl28jc3ElDJWqALjRSgZ3J7NSHcDQib2eh3dcPMjV/jH2lGoaBRG8e5mQVI\nNFxqiJXNkwp2qDrqDdb0dboPIf80lrpGv9nR12Z14eHQVRvUujCQhVoKPBoZ\neSmPAEKNaCFatFE/fiPltlW9f8D5vmC+0aWmuYXW1Sp4b8XY2poN5eSf05Y9\n3SiS\r\n=STCw\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"ccbc9ce9b0bfd89a7b5d57d3e0d6bc2ae297f66c","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.598fcccc8.0","@material/rtl":"12.0.0-canary.598fcccc8.0","@material/base":"12.0.0-canary.598fcccc8.0","@material/theme":"12.0.0-canary.598fcccc8.0","@material/ripple":"12.0.0-canary.598fcccc8.0","@material/animation":"12.0.0-canary.598fcccc8.0","@material/elevation":"12.0.0-canary.598fcccc8.0","@material/typography":"12.0.0-canary.598fcccc8.0","@material/feature-targeting":"12.0.0-canary.598fcccc8.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_12.0.0-canary.598fcccc8.0_1623448002301_0.49244551859771857","host":"s3://npm-registry-packages"}},"12.0.0-canary.5d0605188.0":{"name":"@material/slider","version":"12.0.0-canary.5d0605188.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@12.0.0-canary.5d0605188.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"d77719eef6c0494c656b59397228a498dc63c8ea","tarball":"https://registry.npmjs.org/@material/slider/-/slider-12.0.0-canary.5d0605188.0.tgz","fileCount":38,"integrity":"sha512-nVyJNozGW0IpvoH6bFLD8SZssUkJkVcevQW2pFWFVqmm804mNZOuSV/zSfIgKrRx9YK+ox/wSw7VJhoJNSrPMw==","signatures":[{"sig":"MEUCIDqJKU927bwIWxy4x7cYdhOKtJJS1u+kMQgXupbogs8tAiEA7tFg9pm2Xf+VWaZNFTgflXh1cYJFsXZdkMpaFm130gs=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":845738,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgx5RLCRA9TVsSAnZWagAAfN8QAIekzoQg2B6ZHa0Q+NGX\nuGXxUPS2u8e9vHrhWQ+zj9ceBDI/KG2KQZMX6eJnIdk8/IXvglTvW5D8ta+X\nG9zBikYum/LnHRv5QqbpAJJNE7DuXHOWnruwML9qbg8JyJEKvymjxpncXkJz\nvPJo6gJyHeu3+kmEI0u0efignNsl5TyYuFXem1M9Zzg3lslkOgcGCxMvoC85\n7OGFJni4bD6Dg3NMCGfj9LZtOuElDQOCLlGN+r8oE7JLI5HeTEB4WkHgwgfQ\nLJSctga/EIzlCjZk+Et5S5tszKd0nK3oYT2MZADXruoHpCvRmM0swwU90cXf\nHX4NDwP3ccj45veLWzqoDhEp058UdnGZjABcbl90JcumxOu89RYGq/Q+KrMB\nlm17b90fVZXDZxV+KyYdmPvzQjIkk2GZNsz30n1LkeooJmhiHafGR0X53OqO\nxY8LOrZETPf1kNzafsNer4dshEkl0WUdUzzIaUxWd0+W/PohvdMQYTVbc/0/\nQiq26ytzcrJaeW8xm2weTymNlI5slcnkVdtwSGMgXaWdPN7Spis46ZNoQfY5\nsF63RlfghDjGKrcYX6fqyafTxw+rusEasl8vhS/Ovyur0Ysj2eR6TQ05P1F8\nOcbeMv96ugns0jLfqfdoTMf4J5o6RttSakPkuVZ7gorKMnyxRuDPphGKOMYu\nBVD0\r\n=uNsZ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"0ecd220c6043621c1d471242f32f317475b671f4","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.5d0605188.0","@material/rtl":"12.0.0-canary.5d0605188.0","@material/base":"12.0.0-canary.5d0605188.0","@material/theme":"12.0.0-canary.5d0605188.0","@material/ripple":"12.0.0-canary.5d0605188.0","@material/animation":"12.0.0-canary.5d0605188.0","@material/elevation":"12.0.0-canary.5d0605188.0","@material/typography":"12.0.0-canary.5d0605188.0","@material/feature-targeting":"12.0.0-canary.5d0605188.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_12.0.0-canary.5d0605188.0_1623692363565_0.2650346452709189","host":"s3://npm-registry-packages"}},"12.0.0-canary.f147a2271.0":{"name":"@material/slider","version":"12.0.0-canary.f147a2271.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@12.0.0-canary.f147a2271.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"8b018221d1e4d9062429336e66245d4e93d67929","tarball":"https://registry.npmjs.org/@material/slider/-/slider-12.0.0-canary.f147a2271.0.tgz","fileCount":38,"integrity":"sha512-0x2Vuiq1qfhs18E6QndA3lowSipGJHQU0iLdbUhb/kSdXkMoPkCQSFW4jhuFBwa1fIEIERcOQkaMZ5JbOoRMzA==","signatures":[{"sig":"MEUCIQChsC3F8WsGeYs7y6L65rO+sExNfSqUVNlPKtc2r2sCxQIgVpRVS/oFIReWGKOvRPqKPZu7IHHuhW6qHBEH2fpdSks=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":846148,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgx6t+CRA9TVsSAnZWagAA5SAP/RS2KbESuJk6KjAJerdY\nu3VIxlYT+47y3kEXCqUJ2MzW0RVLQTHY5UgJ/v9Ny8HYb2DdCZta2zzxeNjl\nVUKHP/TIw1OTYjEip8IMIi7szamWq+cEza6VmwTr8BA67MdJoh8fyX+9rNme\nbKgAhxxbVSZWlYohH+NkRpKd8CyceIq7lyC61I9UT85CuZPt2cZi7JhBSOz/\n2HYb5tUUgVic4nzOP/giTAjpV+j+Kv9Sn96nv4NKQfYzNQAbLZZRSO5jzFsH\nHbMCAytLbrF/xKMMPBWdxyrmRq2gUc/HvzK907FBIVWMUoUONaHOAGrOCFee\nUiqaycS+gICj5xXvMr3y8DLjzAQImOaN83TKhxg6H7NOtnv+ffUaP+0tAvBC\n7u2iRMFIfXMdTjmJpXe+2vrd5wdxfys8epKbIT9VxOuYSfxZsQuDT0hPOOGb\nA6Ebcrf8ALTc0wfPzd7RNAuGVjdkjvF9m114TFCReTKZ4kkjwRawSlHw9LEH\ngSqi6mGhM9G5+TzOtimohwPzOhVl67f4TazULP5MwiAdThFS/+f697CeqFhB\n4FGPqXtEKoTuIf3eAshK4DQq207Ogyfexhhj54zltWm0WTiYcGw+VOPdmPdw\nUV89sEp6pqMWlxe/hHdb/nDMGKgwPg3LmZxQ9RR1NlpKM8rJzt3SwIvVLpX9\ni4Mb\r\n=13ip\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"70b871f06c34302277b9eb3064110dd70afb181b","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.f147a2271.0","@material/rtl":"12.0.0-canary.f147a2271.0","@material/base":"12.0.0-canary.f147a2271.0","@material/theme":"12.0.0-canary.f147a2271.0","@material/ripple":"12.0.0-canary.f147a2271.0","@material/animation":"12.0.0-canary.f147a2271.0","@material/elevation":"12.0.0-canary.f147a2271.0","@material/typography":"12.0.0-canary.f147a2271.0","@material/feature-targeting":"12.0.0-canary.f147a2271.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_12.0.0-canary.f147a2271.0_1623698301649_0.10169284614468466","host":"s3://npm-registry-packages"}},"12.0.0-canary.33579e00b.0":{"name":"@material/slider","version":"12.0.0-canary.33579e00b.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@12.0.0-canary.33579e00b.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"7acc150455b24a38f4dbd1e3127a90b3074473e1","tarball":"https://registry.npmjs.org/@material/slider/-/slider-12.0.0-canary.33579e00b.0.tgz","fileCount":38,"integrity":"sha512-R4VFKLe7xUDq06MoXS8d78hqvJDNi1CndxkaMDpErEmxhThIZOM9yHnmJwzfmDxLqBYrElVvQ1a7eqnvWaU8Kw==","signatures":[{"sig":"MEUCIE45AYS6PkWorX/o8wsjp+aF2kzzdfgeGFF5qdQ+dVAzAiEAhzJhxP4OutyO32S0+azO3txbdzd/p+fGCcQw2izdQAY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":846148,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgx/K1CRA9TVsSAnZWagAAWjkP/ix/FwwfORVZzjp4SepI\nr9vqed+Up5bWWyFDA2HF+hYTyJjdlL6VtEjKNme1x8Vo/D/4/RAQwM7xU68h\n1OUG8mht1lNsdB0IrKU60WyUtO4rb0WYlVeOdgs3KUbrHnD9TPh71L7xH1pF\nHsRaUPLKKbXzDCrutC7homZmUGob/W1zpQACkEluYpDWnz1H8uLFh2+PPMxV\nSEoKk/uqT0I607DZbzc8LN1jwh8MMebIRAhu73/CayVdWi0FqOshataFhNn6\nMg41kG+pBD5TBt4N4SiiCunXXuegw7KzmCSWrdp8TgeAoIRv4KJtKWcHgQUR\nEZ6SZ+TxcW0XOFEduVaOyZjObguEjTn+cZYOA/svvHDtEn1nlytvF2n7XvY5\nc8/nuUjn1JBHcAqEhjTaprCZOrWIMiXl8VdnnP4jKB1rMQCFIRSRC5kbQZKr\nJuyVzUuZtFb1jSRe7CX2HT5l4ryauTjJV4o0PISFGCgumXZhG3n2AFn0AkBp\nGhAiP3fZHyABMcEddcBikdn35Lo+gf4tP23oTE4wlEsL6pj0Zy8zs4SpqHcQ\nowKDVjRSuwtAMhvofbnN+XKX6MJCblgujFX2LSCG7w7qI645EWPCUjsI9D5S\n2/xbnL/G6dQVZjlN+0AIyahVxMg6Q77oQ3X1i10nHbzRPgy1tky+tLW0Bq+5\npzhd\r\n=uYZ9\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"13a815cd8b945d23ba7ba2ebd6730088fa195237","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.33579e00b.0","@material/rtl":"12.0.0-canary.33579e00b.0","@material/base":"12.0.0-canary.33579e00b.0","@material/theme":"12.0.0-canary.33579e00b.0","@material/ripple":"12.0.0-canary.33579e00b.0","@material/animation":"12.0.0-canary.33579e00b.0","@material/elevation":"12.0.0-canary.33579e00b.0","@material/typography":"12.0.0-canary.33579e00b.0","@material/feature-targeting":"12.0.0-canary.33579e00b.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_12.0.0-canary.33579e00b.0_1623716533384_0.7803552639977789","host":"s3://npm-registry-packages"}},"12.0.0-canary.a6909c0e6.0":{"name":"@material/slider","version":"12.0.0-canary.a6909c0e6.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@12.0.0-canary.a6909c0e6.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"af84787886dac70157f3c2f1e4b554dcfa3a316f","tarball":"https://registry.npmjs.org/@material/slider/-/slider-12.0.0-canary.a6909c0e6.0.tgz","fileCount":38,"integrity":"sha512-rroLvPW2uarAiLe9YMaPsNklyB2U5CQg7v9Xcl1eeHsOX2xCQqHDqOY4RKXTu6zOSptdeg17bLjMtlAJSzQNrg==","signatures":[{"sig":"MEYCIQCt1p8EnWJxno9ysnQw2Xxu1xW9jZXfOSZF6/NL6wQjNAIhAM4H9aXrsB57KSjEJV0jtlQcFS6RWrxl9fQ8ixhjNzVy","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":846148,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgyPG/CRA9TVsSAnZWagAAbIkP/RgOeCw0hV/fx1IwkXrb\n/+4iC4PXO49kwkuRPmLIIPFa5P4z41e3Xbg0qraEXUa/2fXegdzgWuzCJSGZ\n5BQJhOjmIdBRRAdUwke/aMlimyQwTnnru2cizaYr94M3x4aur6hnVpJcf4LK\nARvPDkr4z+9AyGGLe1NFmmZEjW446tUc+9ZAjRVzNcLiKUOgTOVZnUoepBrz\nm7jXqBpeIfqodTRWmk6itMmhEotbAV27tiZqUpmsLeXhUA+DYrTlOFrEUKXO\nmS4hNiFVVzg5DzNpLXZr+xZCWgIPleoQH06nlkFPhvxn95edtkfm0Yfg0s77\nw1qlub/wUOlaQ1/qDDXggAkmp8xVBaI4Qn5fSoVW//2lrMpqLz1oxagwTLxE\nSrAh0KXp/XUWPiG0t8h6Aj9fakTmMHfjCtMxQsTKw0uQT9btOztGnYPAviK/\nZGKwhaNbZVSliRmKJHpvqBxiomuraJhoz9g21Bf9rgwmT6xMyGeqV1+e1G8c\nZF4dVT1czCHnDexPQPtGYcj32jelKeEMkrFefwAs+ohP1jOgG5sBbQ4DRxGz\niSrrYjOSzZqLc4tCVHBdG7hxDiYH9JFdCnTn8s/cw2Tteu+Eeuv/EW8HjGaz\nSBlts7FZTSJdhbIBQsqFEH1HkW0dZIf0IeoVtAYAbP4Bxsy87+3x0e9W+MuZ\nrEfN\r\n=nswn\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"f4852598d008bc1750e5e9d2a0e828aa8804f87f","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.a6909c0e6.0","@material/rtl":"12.0.0-canary.a6909c0e6.0","@material/base":"12.0.0-canary.a6909c0e6.0","@material/theme":"12.0.0-canary.a6909c0e6.0","@material/ripple":"12.0.0-canary.a6909c0e6.0","@material/animation":"12.0.0-canary.a6909c0e6.0","@material/elevation":"12.0.0-canary.a6909c0e6.0","@material/typography":"12.0.0-canary.a6909c0e6.0","@material/feature-targeting":"12.0.0-canary.a6909c0e6.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_12.0.0-canary.a6909c0e6.0_1623781823482_0.06685227046114428","host":"s3://npm-registry-packages"}},"12.0.0-canary.c18b5925b.0":{"name":"@material/slider","version":"12.0.0-canary.c18b5925b.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@12.0.0-canary.c18b5925b.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"aa14d3cf90d7ad911e90eb7ddbdfc81ac17cb7e0","tarball":"https://registry.npmjs.org/@material/slider/-/slider-12.0.0-canary.c18b5925b.0.tgz","fileCount":38,"integrity":"sha512-6+ytF+oic9yZox+q/pkzHVDZ7JE0btqHar4/oXAkeNJVqfni7nOL1PuV5jEzdUPBE69WNuTOmmxUj5zzQuAkFw==","signatures":[{"sig":"MEUCIH41OvSmoBp8qSLEz5Nn3PiHQ9/E34H/qkVjtHNhSxpzAiEAthSUXsT+EAxH+qv1uqY70G+BEqxI8Gx7PO2N7R6ifwE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":851564,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgyRW2CRA9TVsSAnZWagAAvecP/j0LF2aW4Xnjbuo2a27s\nw8srIPD6PamMnuAPmlgrRQAu5RwA+bLjMRtmEw/8QMCjJ4UB/wV+q+2r13O5\nRTfsWXdLvtOr2rBw+nToJ4MHgjf/rE7Sgh4YyNEQ8EXfjSnm1Qc9OykSw8PD\nwuf8kt+V4MmQH1/rzj35hNx8z2/SZzKyfuBGj7QMXYblTIvrgRSn7KhjXH2p\nwrgw9Q2h+gk5SEspo1QFocKDoOsSOfMMf47xq39QxHcXBFaTcNyYyBUXIL8+\na8aUN+cgQ1KVq96jFJ96b9+2NU6txPaoTUfiIynDdbh7LeLvDQ01Xs9p5059\n5MsVDlZtAQqiM/6NzMbIMWIvTjy1aM/EXCDe7mhymaaurrmcUPHzFx5Yf6Vs\nzt5C/4+AtoeaxUcY97XCH2Lk2NmdLaAl80+kp0MWKP0D5fJlmg4lU6rTllyY\n05z8sIVnU9P/9hJzwwtx4g6ZSmtz/bMzASNzpvEKVL9VG8ttIvWpN1OT5MSz\nPqGe/TVTZqGEck/iG7I6WA7aBB71lBExoeDT/+bhGKcqPhMYofWuyqsyjG4I\n+QRXSBvA2QwR1TnKwHzYTPgkbZTpjY/CVQ9Afvj287nrycDE0oEuGvIqpzcE\nSg8ZfRAQ72NJQuRhD8hfIKhLstzuU9VaVn3tUdFyXgoS693Dv31iSiaWiX6v\nEM7g\r\n=PQoX\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"bc767c077b93ce415f2505e54f329042c80b0d3c","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.c18b5925b.0","@material/rtl":"12.0.0-canary.c18b5925b.0","@material/base":"12.0.0-canary.c18b5925b.0","@material/theme":"12.0.0-canary.c18b5925b.0","@material/ripple":"12.0.0-canary.c18b5925b.0","@material/animation":"12.0.0-canary.c18b5925b.0","@material/elevation":"12.0.0-canary.c18b5925b.0","@material/typography":"12.0.0-canary.c18b5925b.0","@material/feature-targeting":"12.0.0-canary.c18b5925b.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_12.0.0-canary.c18b5925b.0_1623791029842_0.666818300234084","host":"s3://npm-registry-packages"}},"12.0.0-canary.271fff902.0":{"name":"@material/slider","version":"12.0.0-canary.271fff902.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@12.0.0-canary.271fff902.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"031d9a39cde56aa38b787d9cced18e517b82f115","tarball":"https://registry.npmjs.org/@material/slider/-/slider-12.0.0-canary.271fff902.0.tgz","fileCount":38,"integrity":"sha512-5eH4kBIiidmgFXSfKL6GT+4tIS0SWA5Lh3zPiXhN4VJaZIJDv/AM+wM/w/I57+N0rvljNEUvL9SASIrcz9is5A==","signatures":[{"sig":"MEQCICcDfqE7ZiDO+tYQy5mD+RfbgW3LbvSf5ptBx04YEvMwAiAG0RGPFo9UZr35EGwFrKX1P1z9DSjMkVTAOSD3Ysixvw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":867476,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgyS7pCRA9TVsSAnZWagAA8AgP/2ZxfX/BPB2m1v52sSQB\nshJFQVprHujMZsAoY8ddl9A9E+XFU1VGN1vCRwW4CKwcB8R2Ze9eIbdQINTS\nLxYu9B5ayVw/Rx44AurgHCm7LJOu3ok5XIsywJg+iQo/+bYrsaBbKQXQ8vbe\nain+s/ERt8H2pSNkkwKLm3dzEmsmSoMyZB6zFsAi+Zf1bwVV81Bw+uctiOdM\nDTmNM4phSyggQnd8vxBuLUTb1hf5Ub6cELQ9n5uW5ymSLAruby1SspkRju/O\nm3Ob9fmys5tS3ZJHjgYG5Nk8fYz4u9E3ri6umJeXcjpkHpnMwl1/CHvsPNbM\n97c7BRPRvid1lWndww5pEPHpf8VuSuDhq0upcSfaGhrbBsWcGV5ndm5T37J8\noOE2acrNW6tm2yOlrS3Dqh2cMTsUdllm5Kst8vRpgSXGI3Mv6dB7aURr8BLm\nYfiB5TfR7nbGvk43uMw0WM1B6oLfH5pfNW8aD4qXTj9nD9Q7n84bKg+QY/Mk\nyX2lSrv/urPfG0VsVN6x/D7YVeSQv0GdrYvu+2Nytvhu2oO8ep9JyRN/04Nk\neMiviLinskEuKRKkHSRdK/pO18tDeUdlLOvSA+9MUjXmaFRWLP0yg48B7fXP\nMf9BoT6zbqR6qKRjk85lljx6sLJ9t9q2g9TqIoEzElUZnE4LuJz5F4tFlIar\noKZP\r\n=q643\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"4306227bc7e5f014c5e961178b436b394f0dee6b","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.271fff902.0","@material/rtl":"12.0.0-canary.271fff902.0","@material/base":"12.0.0-canary.271fff902.0","@material/theme":"12.0.0-canary.271fff902.0","@material/ripple":"12.0.0-canary.271fff902.0","@material/animation":"12.0.0-canary.271fff902.0","@material/elevation":"12.0.0-canary.271fff902.0","@material/typography":"12.0.0-canary.271fff902.0","@material/feature-targeting":"12.0.0-canary.271fff902.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_12.0.0-canary.271fff902.0_1623797481043_0.2868836766582863","host":"s3://npm-registry-packages"}},"12.0.0-canary.7ea2e830d.0":{"name":"@material/slider","version":"12.0.0-canary.7ea2e830d.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@12.0.0-canary.7ea2e830d.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"1460548a7ac9ecf5fd4b191a84ad0702ce986e62","tarball":"https://registry.npmjs.org/@material/slider/-/slider-12.0.0-canary.7ea2e830d.0.tgz","fileCount":38,"integrity":"sha512-Z9UzaoM8fmtFcrglh1PRVvGi9eRZosCjjIN/k02OP8xH1G2wDGgGSfvHcZszDW2lHMROJSZih/b4VAujvTylLA==","signatures":[{"sig":"MEUCIQCjnLPM1fsAzJ1JkoyWAGsf78nssSIUvycDYfO4ShjpQgIgd1pKRNsxKGBYZzlukfpm1V5CWFXe7gDkXYB4KYA3hS4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":867476,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgyS9JCRA9TVsSAnZWagAA8lYQAIjhsv/9ICT7wzh2vq8/\nobDN7g3DHLeOFCYnMv+6YJQ2hr1F1aY1qME/y3q7ppPMNUDqPITaS/nuxdyG\n8SpgIKg9YNb5mPwFP3aztaac5hZLlcwOCYsYqBSKY7ofnX5/O3zBF9B5Ua4/\nxde0nTcmY+22ZXSE2vX6yoMYPv7GavrQiwef7f9ThrfaUV9P2SAZikacmS/M\nMEeiG9NRqrZtkCPiI4FAS2W2YlZP93KlSXhMcMfqwukCULvHaTqztp7Oz1s6\n0d1C0el2KWhzEtHRLU2Hg1Pkl4/n22Zy2L5nuNHgPwc08QavpQoH6ygpz3an\niTBKfKm+Lchl4k6sDfzkLWEQKk6gFj1Zfi/IGIkIVJnmIY6QX1V60MM6O2/G\n+f7bdX5kH3ncx40nprPpJ90hPunQulT3Rpmuoqit/5e2aLQ/RwtvQggBvjGX\nHQZutU46R1kTBEthB1BgHJdagAa8TJ3yBnLfHINY6iGONoPszM+35ZH+NLKj\nmNrEqz+JAOBFMptvTbroQgxEweiHKOm5BJun53C0wVDnIPkP3BFXleWSlGkv\ngq7eYzNPXb1SFTGyHIFrdroHWc81uRzfXYjzx89b/BGXhCB1cuYCNpqlQhSu\nJfxi4TLJGIOHN1vUbajqz1t5ICTkqSgRM6YHMYW8xKxPA/4HJD+MooBMDE8a\nzyvY\r\n=2Grj\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"e1f3cd5692e7f4572664681a049ec1ea1548eb15","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.7ea2e830d.0","@material/rtl":"12.0.0-canary.7ea2e830d.0","@material/base":"12.0.0-canary.7ea2e830d.0","@material/theme":"12.0.0-canary.7ea2e830d.0","@material/ripple":"12.0.0-canary.7ea2e830d.0","@material/animation":"12.0.0-canary.7ea2e830d.0","@material/elevation":"12.0.0-canary.7ea2e830d.0","@material/typography":"12.0.0-canary.7ea2e830d.0","@material/feature-targeting":"12.0.0-canary.7ea2e830d.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_12.0.0-canary.7ea2e830d.0_1623797577197_0.02046216092917308","host":"s3://npm-registry-packages"}},"12.0.0-canary.d96f0a1e0.0":{"name":"@material/slider","version":"12.0.0-canary.d96f0a1e0.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@12.0.0-canary.d96f0a1e0.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"af418f8ef68f74c4003728d3fd58e9349249332b","tarball":"https://registry.npmjs.org/@material/slider/-/slider-12.0.0-canary.d96f0a1e0.0.tgz","fileCount":38,"integrity":"sha512-2LanauoXIGt7dEvvptKAF/S5VK719Z4GqoC9+3g+emJZh4lqyeNA5M7osPG9T8/JTNZ8c4o1KiDuV6E4g2qdFg==","signatures":[{"sig":"MEUCIQCeLpwaErpb4h5Ij22LUmB9T+Wcpfp4hswK7EZut02CpAIgaEfJuPMJsiheYMPXfNqOVkJybOypxncgGnZj6Wajr+8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":867476,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgymfaCRA9TVsSAnZWagAAJMYP/2a44OY1ZZGbDhjSr1wY\nu1XOWnEd6ZDHop6R9jXzqzpsWhJaCz41bJsNtXxhyMVnuwDjX0lq16enONPn\nHtZfIGHJgUW8KdJOwXnKNEoYsCmt7YjNw4gc2X5ulKonz5pgWpNBSNoqp9Kg\nF2Kz4poKt67mubus2I5AhyHV1bPOk/WZij3bdicqQyMiylM1gsI/DzipL5Ug\n2NtHkK5olmqDtd1ILgelNDRDBU+nwix0y0uhr0PlNJMzaJJuKjIzhWlr7Gil\noG4BtiLG3rPX6cIfl5vHO+a66iAJXzRkQB/d+GxgDqa8V2tp/or7QWze6n4i\nXQuvGkWVErrQTcBorhZkqptsdghadcz8PQ4RlJ4ND+OnyDWL4gKMQXU1wo+u\nWeGhaeu75cUfaqbqHvH5rRwn/joQF69pnrahKdJS1tewtPT1FjhdOo6H+BHH\nMkFLchqTMYH/akIUdwYJLGnXSzR3eQ7VkF41aR60d+NDDkEbQd5FM6R+h+F6\n3Y6iXHLyBa+jNh2avz9zsZDMRr5LvVj9r5wjkTtPhKLbLqXiFTpiLtNNfbDD\n16rYFVkqPp2Gih94VPd7z1bV+XqgCpBkOyDENGZWuYYqLlsosmTUdEklfMgq\nVlFT7x5crwQPvIzp0HWQnv33pNzzGLfIAjbQXNLcaYaBWlCY3N5v5Riby71J\nowHj\r\n=KmRj\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"32470ff9121448fb2599b2985e276f51563ed4f5","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.d96f0a1e0.0","@material/rtl":"12.0.0-canary.d96f0a1e0.0","@material/base":"12.0.0-canary.d96f0a1e0.0","@material/theme":"12.0.0-canary.d96f0a1e0.0","@material/ripple":"12.0.0-canary.d96f0a1e0.0","@material/animation":"12.0.0-canary.d96f0a1e0.0","@material/elevation":"12.0.0-canary.d96f0a1e0.0","@material/typography":"12.0.0-canary.d96f0a1e0.0","@material/feature-targeting":"12.0.0-canary.d96f0a1e0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_12.0.0-canary.d96f0a1e0.0_1623877594189_0.04728391845580937","host":"s3://npm-registry-packages"}},"12.0.0-canary.a6183801a.0":{"name":"@material/slider","version":"12.0.0-canary.a6183801a.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@12.0.0-canary.a6183801a.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"c45c4f8c31edd5738c69b46fd31bc21d8cf0f7d2","tarball":"https://registry.npmjs.org/@material/slider/-/slider-12.0.0-canary.a6183801a.0.tgz","fileCount":38,"integrity":"sha512-e4/Ewpm6F9JkZV/pqTVC0pdXFMZhKbOzcXCnM3yfO+o6iU7TlModAQPtPAfQOLShzqLnNhcaWFE9kdspzJttOg==","signatures":[{"sig":"MEQCIFIiP1dDGbof45ofZxkoKEyu63l/nsJz6wLLlvwgywVTAiB/dS2haIb0yKk94Bn1UIA+kb2O3kM+iZ335LzlzYJY2Q==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":867476,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgynW5CRA9TVsSAnZWagAACuUP/iRLiMkcMQ34e7l7Uhoi\nzUfO2jXr5ANUpaVPWLqSs9/pHheDrhVXaY/VpW2VJJH71PZJdJWtp9oWzCf4\n5cI9zrGS7yFR9QhFJzsSOsGXGAqDIZEwIKVreT5qlJTEqXNwFOUoWFUM5R+O\nG6mM2BZvuk0Snw7KdHTPZfay7jumq5JhROkh9FscEkKxXbz9L1zKICA10Cu3\npUsCB//8QhPhLGfZEAZBOPUzx0DHINSK+Pzux7K0jOLuACUzQS+5jEJDHJ+S\n3yyoryYRHqHBhUZhJtkZ+QPCH35+wbJ0FEzdbfE2D8D3JpSBvzrfaubVTrMK\n7oTOhlBoerg9+MgQnRw3dYTn10VYr18ji69MV1viohLkFRKTEPDhrB4sxXxt\niTBc8gtL08ewPGtTCcwkbT+a1LAvHGeBuNaByqvtEfgaRcB815JG3lDbap+B\nC7fZkpm7HmX7WbSbYFVedYmIyxzY3Ow79ehOE2ICBaYwqRzWU7RFLFFf88QF\nnrN1x2DqLzeHowMfCsRkYhTcEWPLvdhHXvkpwNIaaGfl24MFo11kzfyJ+ftT\nT+B5co98LjQxhJP5a/5f2qLxrxDAEOm6Gew4408e13DH8u7FrZ8gMHcxxsSH\nPHCuLkZo2eUR29BV/6tbqTTkFIEGAAzRizsBvaoBLFaCg69fpmipbZy4l3QE\n7Pp5\r\n=TExR\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"b5eb42f66e2a670e1f9573b4feb1a600a95b49b7","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.a6183801a.0","@material/rtl":"12.0.0-canary.a6183801a.0","@material/base":"12.0.0-canary.a6183801a.0","@material/theme":"12.0.0-canary.a6183801a.0","@material/ripple":"12.0.0-canary.a6183801a.0","@material/animation":"12.0.0-canary.a6183801a.0","@material/elevation":"12.0.0-canary.a6183801a.0","@material/typography":"12.0.0-canary.a6183801a.0","@material/feature-targeting":"12.0.0-canary.a6183801a.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_12.0.0-canary.a6183801a.0_1623881145042_0.7311476553511902","host":"s3://npm-registry-packages"}},"12.0.0-canary.940550232.0":{"name":"@material/slider","version":"12.0.0-canary.940550232.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@12.0.0-canary.940550232.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"470a6006a02acbd5d061e82a132d0e8be5dc2071","tarball":"https://registry.npmjs.org/@material/slider/-/slider-12.0.0-canary.940550232.0.tgz","fileCount":38,"integrity":"sha512-QrgCoc0Ry/WpzwkkadA2fXofmeXJW1dLe8mwe5tm1/pmYfPX6i19YatzTwLuXGPVzInAC7MSHehhuKSyrdUCTQ==","signatures":[{"sig":"MEUCIQDsAtLvmzB9L1jrRxfTRmvQDXfado2TLGOg/r19MrqC/QIgPzzqB+jjt3i1aUtp5GzyE+A26Qw/03GL4+zR6RjIiZ4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":867476,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgy6UuCRA9TVsSAnZWagAAXA4P+gN8H/r46fETZIG00XYS\nXUWqEns2hZ3uzlI6iLggvdvksEfipMw8J+/9lD82k0Y7sOeEZ4ve/MZPv8AY\noNeeLU+6P1yjtXjfcnN5X2p+HcELkRdZjpVSMKsTHQhtTbstTYOGZVADPC+G\nucyF6UAzCGe0dPELsgW8+f8YDdWvUIzjirtqbxOvY4NcaOISWXmL5FNxH/KW\nLYFrMeBAzgrU5UFZfeZ/R9fe4p5Tde7viG7Zc/FxjRAyvlZNK4EMtz5j7Q4V\nbe4QDfBQ+ynLII2VR+MmktTALEVGWpn+mv2N0Obo4X88DOeZnHdfTAVFa3wW\n5K8/KftKLvT+dEBz+CtpExZNIe9PGztpqbcGPcq2VSifTcXYHZW238lMaWpA\nMyGaVjA5zha58bsqnjB5ZzZxmmTh9GTuCwE+bX0iNOR6c5RchG8bJ1RAIG4E\nX6CywQjIqysRPszLSLxRvRCl+QzPs+7B0TehGnpn/E97iGkx0KIbTAvNR90x\nMBtw625hFiTa4KwCX+8wj/zTSZ+gt4RwfzUiq+l/qaqH2lF7O0kzXl7BWQs+\n34Itz6LSw+YFrL/Apc6tELzPvThLjdsZjjxktE5iwXwTGdDTZqSIZyoThhcD\nf/MSQpCEsuDRIAPUOiq/+Wyq0DNbeKU1mzZqq4Fwwc1Z+C6WCIhyGrbNeGHM\nF/tg\r\n=TR9m\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"1d6560428828a2c7ac90d050a744265e63c8563e","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.940550232.0","@material/rtl":"12.0.0-canary.940550232.0","@material/base":"12.0.0-canary.940550232.0","@material/theme":"12.0.0-canary.940550232.0","@material/ripple":"12.0.0-canary.940550232.0","@material/animation":"12.0.0-canary.940550232.0","@material/elevation":"12.0.0-canary.940550232.0","@material/typography":"12.0.0-canary.940550232.0","@material/feature-targeting":"12.0.0-canary.940550232.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_12.0.0-canary.940550232.0_1623958829725_0.7000901032505007","host":"s3://npm-registry-packages"}},"12.0.0-canary.f705e8048.0":{"name":"@material/slider","version":"12.0.0-canary.f705e8048.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@12.0.0-canary.f705e8048.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"ed23e1b7232c16531dd353b6e77c2f801bb2bcdf","tarball":"https://registry.npmjs.org/@material/slider/-/slider-12.0.0-canary.f705e8048.0.tgz","fileCount":38,"integrity":"sha512-2Z1S/0O7/71RDtU6THFccb66aSD6YIatuct7uYGQXvR+XyUIkYXQMepgno7vDn+2J19UKc09RbalEI4io4N19A==","signatures":[{"sig":"MEUCIFKN0xMrUcvxTFZcqWupHGKyq4ksJCRdAg05HJWLI5qXAiEA/fhZ7obgcWDoKUZBz+PIYK/HWiUIq/O3qfmrtmTFVRQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":867476,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgzLrACRA9TVsSAnZWagAAyFYP/1OC6jWLkdvBek4qCa44\nurO9KRve6CLlsfCw6c28XDeYy5Wl9t6PMFjdguk3MWPL+mdAO1WACPjLm0i8\nkosNI94qaX1FdBJ8vfjA8DY8Wk0i8Yxw0PhZ9d4plS6jPEUJWRNT+vWfkUyh\na30SiyWGnFBWU/DifL6BZZzVc6/+ZwTKDiw0KXpLOsZVozSaie8xa1KjPDcZ\nbqFIyqP5gVJn+gYCttqqZitPF0Sirx4zd3JUwQBH8AeevvFyEDRpwQer5TH7\nEjR7VxphhiQDzVy4+33le3+FUwi3Xy3uA/VCylab7obDRglXnPdX2QIAHxvQ\nrF8ilMgHL9+3ICUG0CAOFbUdNU0Xh7mxq5mu1xLtcqolKWEo/f1nICbQsxxp\n4FEx4q/YUg8aQDtWhDS3N+6GFQp+ULtX65Rch3CUQ20kKRId9yqUhMNQR0SW\nzpSZbFJjP4xZ0KQMjs0Sw3F1WoD/0rEj6wJDrPgeSCDu7R9agjvC5XvqUs+L\n1fb5drOXeo4znMHnKAqtx0xY53rpOjc/ovqIf8uu4SctaULgG97fnI0ouWj1\n/nufY7nLzTfCSsu6lUek45QS5LwRItI/42qgypzWPTnBjujqTcPyNuYMl8eW\nzW3+eYnqzjWgESviU7waZKXw6rhj7/09MKP0/GGfXXRnfRT7JkSybVrTng6Z\nrsUb\r\n=Hvvl\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"65fc1ee152f3abef35713b70962e3d5b848a5e78","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.f705e8048.0","@material/rtl":"12.0.0-canary.f705e8048.0","@material/base":"12.0.0-canary.f705e8048.0","@material/theme":"12.0.0-canary.f705e8048.0","@material/ripple":"12.0.0-canary.f705e8048.0","@material/animation":"12.0.0-canary.f705e8048.0","@material/elevation":"12.0.0-canary.f705e8048.0","@material/typography":"12.0.0-canary.f705e8048.0","@material/feature-targeting":"12.0.0-canary.f705e8048.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_12.0.0-canary.f705e8048.0_1624029888040_0.5435431997190314","host":"s3://npm-registry-packages"}},"12.0.0-canary.08d791f37.0":{"name":"@material/slider","version":"12.0.0-canary.08d791f37.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@12.0.0-canary.08d791f37.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"0a57a11d6fc0eab609e3e76a0b8dcf0ee9bed992","tarball":"https://registry.npmjs.org/@material/slider/-/slider-12.0.0-canary.08d791f37.0.tgz","fileCount":38,"integrity":"sha512-YZrdzAKYNVlwwe7oeiImqzkEq2TngWjSXdGX3VIoORcWE0nVgxLr6mKjZA1BN90VAIe7xE1ULZYhHq1Aw2qi0g==","signatures":[{"sig":"MEUCIQDWCIwMRyG8JnveB0jjA/R8kRKiwxnDUol5cWeckyQ9ngIgf11CbINf0V3omo/JGM/YL+To1loePozuNJ3jOKI3AmI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":867476,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgzQwhCRA9TVsSAnZWagAAT0EQAKG/J2uEgB9Diz6P3qCd\nuOEU3FTgOSwEgb7HBL0aKSGCk4fRePgADxNfpupmMexapE6utkaWZl3IvQza\n1MGW+r4I9yQLaIIJJ4jrIdEfoPHlg8GtTWmuDXpW3Rrmmquq9Y1DYklLuMpQ\nqd4I++/4Zmbeace/6qVi3/UXRPUpgCiexI8DXhPcJ1meMAh+o8zo/qQxN4AU\nLcEbZFIJu7KTcMUygdIplGVW1nl5F+qM0Mvvqj7TODCJGdKzWbeoq4GQBqhl\nupihU6xbjl5YVpp50/JZpO1LA3kSMPinuezPNbneaffnmSG1x/JZC2hNlfrM\n82jbI5W3PKU1ykxxRHG4wcC4F1+MrHV9HM1CbdmUTISzz/NgeHYesgAquyHM\n4irfSu3gum4ah64WypiNndtk0MyMuh91YTEASO0VSCfTzC4nV/VLA/C8Fb2g\nw0CX2uFruqR44x5QbmhHci/d2El3JwyyHPu7j15KDMAdhFSaaHGs07ssp3/l\niZUZP93Nb2ZKjZUovxdV5agTNhZ0McpwiIe2sZuoveapkRGsoz4P41Xrqewi\nfYgJET18SCwD5uZZrzADa1Bx5evCtzCF+ABqkv/6ZYhNNqLc0ZEOUpTEh/5o\n73iKLarjHLf26hkRZPjWcm/Mk+dGishfhIo9PiL6q3+uStEvtdI9BpLKGfSt\nqoP3\r\n=bhSs\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"854f301ec7183c3cbd2e62f9ab541f21aa6a459f","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.08d791f37.0","@material/rtl":"12.0.0-canary.08d791f37.0","@material/base":"12.0.0-canary.08d791f37.0","@material/theme":"12.0.0-canary.08d791f37.0","@material/ripple":"12.0.0-canary.08d791f37.0","@material/animation":"12.0.0-canary.08d791f37.0","@material/elevation":"12.0.0-canary.08d791f37.0","@material/typography":"12.0.0-canary.08d791f37.0","@material/feature-targeting":"12.0.0-canary.08d791f37.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_12.0.0-canary.08d791f37.0_1624050720499_0.6967372519543409","host":"s3://npm-registry-packages"}},"12.0.0-canary.e38d7440f.0":{"name":"@material/slider","version":"12.0.0-canary.e38d7440f.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@12.0.0-canary.e38d7440f.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"13e722f738088bf4829a41c57bea116f5c9f2970","tarball":"https://registry.npmjs.org/@material/slider/-/slider-12.0.0-canary.e38d7440f.0.tgz","fileCount":38,"integrity":"sha512-EbZcg/z1yTMn7ma3sKZjRs33Tk9Fm7i3xo4qwAzU5qyapv6hrdn8Lj2Qgp+MgV239pFyuBylUUUJlJW9qRCsyw==","signatures":[{"sig":"MEUCIHMVX8dT9wbRpvk/Yk+Sz1X92Qc8dNYIeJr8F1tbFIxfAiEA9mRmiugPyWVvzNnt+uTMGn8vtH1EEB/YMtr6G8wyej0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":867476,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg0M8eCRA9TVsSAnZWagAA5Y4QAKTtqItpVJDeIbtGkIUN\nEHB+9u66X/uMmplv2lLW+ZoX0knZT8b+CLUW05H4YkbiZF7nM7ctrZKNON0E\nu1iWea+yqdP/A9IbdgG6ZYnd4jJqNz6KjBCKnDdhXiOg6KVCgcJ8hRH95o0F\np+HvqtWjIBk/TI26qKs50Ad+RbwF94BZ7TYOFRTGpefrNHokjJBi3u/pD0FI\nBvC11tWR5qaLfA8iLeTAjMSJYy9quiqSe5nycz1gBgGldPyomfMA0bZiBu6X\nQ4UtpJ5MegBpVBXnwdt2iLI27isXy7NTbkNaz8jhkJ/z3M/XutKSNHV2JA/L\nZOeUoQcP0+98gemxhfxFTJCY1g0KOaz+9uM9wuhP6Zos8j0Fy+vJdWrjaf/a\n6BeHl0XhQOD8W0h2j7zafbt9p+TO9kDhSnLeKgc7mcaTujryw9FPiNVbtanR\nTNJDwTjGfz4ORNc6ilP9ntqyTnb3TBULh3zuTurTB/GmylANowVKuF2xBY91\nillXyVGffeD20WF8ZC+m7+W/T3rOiE7INgv9anX5yHcO+hIrab682mWO6H31\nqkAZjZ0vCdPW7lZu+1a5xDtr1ht8li77JuoA2q5V5vjVTXJ5JDROLCEP1DF3\nJQRGXLkIue6qPiufnaBKifHG58FA79OFAjZlc6icyTJv5GZbTl01sUwAoShB\nnbMG\r\n=Ta1u\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"1d46835e968c827eb3b359624ebb85f8e3ccf528","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.e38d7440f.0","@material/rtl":"12.0.0-canary.e38d7440f.0","@material/base":"12.0.0-canary.e38d7440f.0","@material/theme":"12.0.0-canary.e38d7440f.0","@material/ripple":"12.0.0-canary.e38d7440f.0","@material/animation":"12.0.0-canary.e38d7440f.0","@material/elevation":"12.0.0-canary.e38d7440f.0","@material/typography":"12.0.0-canary.e38d7440f.0","@material/feature-targeting":"12.0.0-canary.e38d7440f.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_12.0.0-canary.e38d7440f.0_1624297245887_0.03147332784779078","host":"s3://npm-registry-packages"}},"12.0.0-canary.75900a5a9.0":{"name":"@material/slider","version":"12.0.0-canary.75900a5a9.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@12.0.0-canary.75900a5a9.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"fcf5663031542039ddab020faeee54a70381c106","tarball":"https://registry.npmjs.org/@material/slider/-/slider-12.0.0-canary.75900a5a9.0.tgz","fileCount":38,"integrity":"sha512-QtSPbInJu9fRnevgqVPQsCZ6d463C+YEmdYQBoLbq4iL2e1g7x9tt6kIu4tGWkjYCpl190luVlVHcMKFDDKk4g==","signatures":[{"sig":"MEYCIQDNU33EShUYrChJJy3gznrAvbdMzPcvvONDfEeHRwtiFwIhAOIhIeWqNkaL16uVrzXBAy3fYmUBQUlJojjrSBfHAhqB","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":867476,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg0NxdCRA9TVsSAnZWagAAGfgP/jUpnwcAZbUn+f6Pbyic\n04WsoxANmeYPBG6kgFs9gW6B282gUKlKauerhlCSNeVAC4Xg9k6C5a9fyExO\nCVWdkBJucso/7bOKsT3no+t+utZEbSlQcSeMCdyLcGdW1/XOx21leB3IW1aZ\ngagrRaljcNQfZxqp1f2eVPabcvTQwBdlueSC9ZuZR8iZd497blr2YC3AfiEn\no4lT6bfiOWiHs+1i2ONlBsHc8DvxS0+n9pvFOnz9wLlGcgXlz9qzWCjeHEa1\nRU9RtfCjG6Z7L1giw/lOm6mAvuxLV+w+fq8lr1WZM9wXfR0R9CZ5I5vNUxC8\nMjqCg0Js6+azH3Rxrb6oJ5M9KPMNwjL67CrEKz+Y2JsWb7rWTLX4vEz3DRkJ\n+Dvy7Nscu+eptmrWujcsN2rnth8SAC1FfmdugSzWfmxPI305xZgUz6+VWBK2\n2Thbi9tG3Ti3miP+AsCWGNx7x8m3J4/SPx+SbbbxMKo0x2rma7OFuooVY7ET\nRSK1Wqc/wDNGYdWrtgG7oYM3FQUcDs1kiOyOSISpkJCdtxOlKm5F30gxOf3z\niHtp+aVBsSX8PGvfHKFoP+THmndn5z18fKL/fEFvzPKPELhzpTTD7ce0Rid/\nlqvxA77SswfR5W9BgBtjT+TVyHGb2wNFMrB39lzfJ1Kydl0pbEAvwsd6e45a\nwzag\r\n=BKmO\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"f08daf05a41f44cbb5e5c07039e1e165d123c405","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.75900a5a9.0","@material/rtl":"12.0.0-canary.75900a5a9.0","@material/base":"12.0.0-canary.75900a5a9.0","@material/theme":"12.0.0-canary.75900a5a9.0","@material/ripple":"12.0.0-canary.75900a5a9.0","@material/animation":"12.0.0-canary.75900a5a9.0","@material/elevation":"12.0.0-canary.75900a5a9.0","@material/typography":"12.0.0-canary.75900a5a9.0","@material/feature-targeting":"12.0.0-canary.75900a5a9.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_12.0.0-canary.75900a5a9.0_1624300636700_0.25821102699240983","host":"s3://npm-registry-packages"}},"12.0.0-canary.33e6f50e9.0":{"name":"@material/slider","version":"12.0.0-canary.33e6f50e9.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@12.0.0-canary.33e6f50e9.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"980e5a5f1dff04f5154ca75577df0d908a361f21","tarball":"https://registry.npmjs.org/@material/slider/-/slider-12.0.0-canary.33e6f50e9.0.tgz","fileCount":38,"integrity":"sha512-62zm3M2vBBpGqDvkfC7Hki3ZSC2MZyTmkSUkcu5Jxu3C7fEuo/sm42tMQ1LOx2y37AVGR18vDTwtBgDAAmkw0Q==","signatures":[{"sig":"MEUCIE+1Rau8HgZwtL7mZqS6y1hCAwmZ9idVR/P6klWKpxXHAiEAna74BRa++zqoyJrQpUGuRLQRmDH91pc+G6T2HYAcBcs=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":867476,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg0nxlCRA9TVsSAnZWagAAvrAP/RUptLAWsNW0CzOe/cdN\nDPiHrpp9BwBuXA2/O1AqgGTLJIs2ye7kfjw5ZGZqG1cjtU+MORl0BbW3q3HV\nt/74eSiMkyed7TyGvvgXsx05GUYAP2vpUHgbqR3EZtnSRNn6s6CD+0wMZUsM\ntyq8TM6W5RmeUzy1Edh+QWfa0jQy5GvE2J5bS4KorZJpjED0ttCDGAazfPAS\nrAJiC0HxRjrf4WYyZm3UcNqgblALNJgVBk7zdWuYPmaTcpz9Y/1ICBuaGt/w\nyiBigjhx95Z/BQs/PiKq4Ud4dWs9XpdlM3rEje0I87kxsyg/3LsZDVhfjP/n\nC5MRoT7Zv/XtdF+zIOMSbiopY73NJvae0Pd4FWHvZMnkD3UMe3BWTKbRyXnC\nFbXr1qJgl3uNkp0oeAxwBRJqXDIjxnAGpqfhdNZq0w3MsahLoWrqcjOrZyR6\nUTrEY31T+5oploniZ9yvz+/qrMUEVw2xCje69+z2ImF04REy7FdzileAHaPK\n9Vq7GnYUAb9tRnTI5aXfXIIli/8fKjjlN5sM2ExKl5u6ADRjbuFgKHS7WyFI\npKL4lj2zswY/7wvI93DQU2x+zvcKmS+mmqTYKs3sQFmjZXFnp1UT4Jqv4IOX\nys4EHcPuZzzhzRs4DnG21ir5Mnb1oMuVudtkdM4JJkEYSqCNXJI9SIAgIvFB\n5dD8\r\n=cGSP\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"fb208c22fe558f863d851b5bda74038d5a3b09d6","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.33e6f50e9.0","@material/rtl":"12.0.0-canary.33e6f50e9.0","@material/base":"12.0.0-canary.33e6f50e9.0","@material/theme":"12.0.0-canary.33e6f50e9.0","@material/ripple":"12.0.0-canary.33e6f50e9.0","@material/animation":"12.0.0-canary.33e6f50e9.0","@material/elevation":"12.0.0-canary.33e6f50e9.0","@material/typography":"12.0.0-canary.33e6f50e9.0","@material/feature-targeting":"12.0.0-canary.33e6f50e9.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_12.0.0-canary.33e6f50e9.0_1624407140903_0.8587773089998341","host":"s3://npm-registry-packages"}},"12.0.0-canary.8c685301d.0":{"name":"@material/slider","version":"12.0.0-canary.8c685301d.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@12.0.0-canary.8c685301d.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"11e8d93ad123043d6a4846ed09f15c74409eecb3","tarball":"https://registry.npmjs.org/@material/slider/-/slider-12.0.0-canary.8c685301d.0.tgz","fileCount":38,"integrity":"sha512-PHppdxLQUQCS2SCe26onjJDosjMDYdVkEqYuw0CuppYcv8tI+E7OcmsbnIt9p2sY7qiddPtF/rzgpcLziu3P1A==","signatures":[{"sig":"MEYCIQDeTi4Jf5CXVP+lgeh1mbKcBjzykGcLsQLFyr22MMOY8gIhAPKQMMWna2i2wnT8ouqS7NhIRyZqKfU3U0i+E8QMhiVH","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":867476,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg03x1CRA9TVsSAnZWagAAN2sP/jybWR0VywiOxrfw5+5r\neXGv/Q+bvsf1T5r+uAiX8iDi7UTRVbinte3Ra7KrVBhZDbZRISD/6jH9A+OJ\nZNjdGFJHbMsswGrbH9IolglmmJGZUY0fGxpeq9+6wLivXqZy0w/62XF7y3/A\n3L9SZDd5ssWawyN/ZjCrqBsyIrL7/M5uUS1zKNMwBLIS5B/AvOrJrWr8VlOv\nmzVSW0PTtKFyd3nED5+ZZFq9Ici3E52En0aB46kwRuW1JW/vIhQkWJJA/JSb\nyC0kIBkAYQnb1Nub34YJMuLY+rd4sczpim848xG8RjhpFxRBm2lHMHbSe+xd\nTtK4RNeKwubPhdZrrL8VVguEeDb3K8MM65FEcg/n0wPbd+Pqv2kRtIFvOu1E\ncrHH7kQr20X3QxnSpRp75Q3xwRqBFONPFdnQbolEfExmYOsmHKnsbAXU5BDr\njTHVHo+6pye9TIHLtpr4I9HjvTy+NbjQczRtXqWyuVX1qSoAG8VeGrGExMHs\ni3C+4pxEE2PY42iuzBy6yAZd1VNOObQUmrdg5FRfRVTTaEZ97AKFHxb5uzFz\nIRWewru0bFagwwx8Qt/1nuroeOP2C5O3ivNJYuCexsKvDlS7cVvNyRoiTTFW\nfOmqblL5kxVwlRINQI6mtk+kP9UlB3nRaZtJP3dE353olv0Lzuu7G+C1i69I\nxw54\r\n=2ICZ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"43d0ab810254e565375b55ae118522d89b7e9254","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.8c685301d.0","@material/rtl":"12.0.0-canary.8c685301d.0","@material/base":"12.0.0-canary.8c685301d.0","@material/theme":"12.0.0-canary.8c685301d.0","@material/ripple":"12.0.0-canary.8c685301d.0","@material/animation":"12.0.0-canary.8c685301d.0","@material/elevation":"12.0.0-canary.8c685301d.0","@material/typography":"12.0.0-canary.8c685301d.0","@material/feature-targeting":"12.0.0-canary.8c685301d.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_12.0.0-canary.8c685301d.0_1624472693349_0.2065378442223369","host":"s3://npm-registry-packages"}},"12.0.0-canary.8c7d994ae.0":{"name":"@material/slider","version":"12.0.0-canary.8c7d994ae.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@12.0.0-canary.8c7d994ae.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"61039cd677b247435e8cb768d6bc187142015fda","tarball":"https://registry.npmjs.org/@material/slider/-/slider-12.0.0-canary.8c7d994ae.0.tgz","fileCount":38,"integrity":"sha512-5UMvSlWM7i+vRDAEpTOKInstycSdKGXxA0N277eTEaigI9Gy+59bphRo0Qxk/s+pfJV/Yzizaa74w77nA7vDmQ==","signatures":[{"sig":"MEUCIAElZKQLCuLRMJEm5a/NU98UBohN24p845ych50aGSWRAiEAxYUIj7/GalZMVWcKQr50Qu91OfGRQCg2h/TTAXNQgnM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":867476,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg04stCRA9TVsSAnZWagAALLYP/RquQfAaQUwgw2e5F/qP\nZyEfN7KkhZc+dQZuOq5nXaZ27yxokSJ6T6Is4ARwu+rAlcWrR6v/KKQSyLrU\nkNUTHl7Vslr0WZRvffy5UN3NBNE/5VDuGcInVieVqo4qhVMzQFnfIOvafRVH\nKwjdji+2e6p+YPATQfvGSfC5BUw2kmIKSzBsqfSKf5egI82A0jqLNGCuojXM\nzNjlgDw3hyvyObQNVRvLKuormOBLQMRbGqlyb0ztDhQwH8ZNKpP+LOPDlzAq\nZZIkdlFHEmoIt0PKAeDeL6o/aOel0ZFO+oHvXXoudo10Yky/MQvDYOF3Eb7F\nKemztZ9Q7j1qSbPUIXz7PNfgdzxyMIoKUWXEMA/wAeJVmKO3AEoYpKd0Ezx2\nGpLT4aK+R4TSDN8pI12M8ruxNQjo7NULZLIlQf0lXmnTlJdKNnYFdl99u/Fq\ngq+XKwG4iyjB6PC3yQeUMRMPGaymX/nccnhjkp7kYBZHgRyRNXWngQ/9fDr+\nvex23tFREJQiP+wcxOcfkaq1lrTQ+MUofCuKws9eZhvNNn4Hbce8x/m1C1I5\nVA6nzoknpmaH4kqDcAHcKVMxfMXLNf3zSIIMRwUk38s2a78h0scy7ZQmW633\n8k7rw9HmHi7/FHaJwvDwdy0E2mv4SFRQA62UH7SNox33Q/9jJ8yHS6XjlaIN\nYUBg\r\n=dRRc\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"85693f86d68563f451e95113f3d03a29fedcf142","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.8c7d994ae.0","@material/rtl":"12.0.0-canary.8c7d994ae.0","@material/base":"12.0.0-canary.8c7d994ae.0","@material/theme":"12.0.0-canary.8c7d994ae.0","@material/ripple":"12.0.0-canary.8c7d994ae.0","@material/animation":"12.0.0-canary.8c7d994ae.0","@material/elevation":"12.0.0-canary.8c7d994ae.0","@material/typography":"12.0.0-canary.8c7d994ae.0","@material/feature-targeting":"12.0.0-canary.8c7d994ae.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_12.0.0-canary.8c7d994ae.0_1624476461409_0.3169917740380537","host":"s3://npm-registry-packages"}},"12.0.0-canary.4ccd39bdd.0":{"name":"@material/slider","version":"12.0.0-canary.4ccd39bdd.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@12.0.0-canary.4ccd39bdd.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"92379a6271cef28b3774e0c04f8cf3e0c2777ca7","tarball":"https://registry.npmjs.org/@material/slider/-/slider-12.0.0-canary.4ccd39bdd.0.tgz","fileCount":38,"integrity":"sha512-bm3QRW8UeITHZDfUit4ZA2MWep1y1QnmC+qNOE62lKVassJHFTiDaK9qAno1EEfU1Mqd2F1B5pZciy5siRKgJw==","signatures":[{"sig":"MEQCIBZeZyaeSLGSh/aF9vHfEtQ0AL5czCee/OxwAoXDQjBsAiBobh7yMVJHGIFdJ3QHGaamqbt4kT+IphefHleX7xRr1Q==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":867476,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg1K+QCRA9TVsSAnZWagAA93MP/3/A6EUL45A3ab8HnJTR\n6Ues4KNmId85gWrxZiMbmW78SrrMMOIENqJRUwSjYPNPoDzhrvS6rxAaJ4CT\nROSx9+ELv8h1SrvHtMv5NmfeMFysC9dNqsyW6TMNGG66JlZCXNrGNtJDO5L4\n3kXGfyiyBrQK6IeKiYgqHRj/6dPrDGFOUkSgf9pUUYdUUlpdE0h5MBiGpqsf\nIK3RX99u6cDHfjxEy1hvfOv4A4bD4yua3tudTrTtITsavrS6FYTkuym7BZcT\nWEhqdRtdwl839ahZjBJx5wtTAAY0LTRRF67ImWIkVZUJ3dGlKmyIMf6ZBwpM\npKfpT6H7feGKaKXH4Xv7kEngVJqMo5ohjE0IuqFxZLLHN4pQ3BhKmRI+5TwK\nEaQO5RHod1fBMHYQvxEvl12WK4Bi0YSZwISUwYyrzLSlmTvWLH1pSO6sNnsj\nRy7Ela1NeeZdVGPq9jI+rJg/YFn2f2PtJUXVMBOGi2Cxl5KMYyprMnwCDE7Z\nKXvArTbAbTZ5rX5LoBB7jMWJ1ASgMPyI8st3gJfi8vmCWvYYnvtYn084RsOA\ncmoUV+EixmvPv6Rk2k3qTmZ7dp/a5CIUeeF/tfY068DlzYFe/iAhRJnGUcZE\nKfs7QbFCGjvL8Beyd2dSYIX2vaYmbKpRfuwan4J7b4hGh8HCFluSfJiLspxL\n4pPw\r\n=zol5\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"0954a36f2cbd31614158e8425662a4969ce9c299","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.4ccd39bdd.0","@material/rtl":"12.0.0-canary.4ccd39bdd.0","@material/base":"12.0.0-canary.4ccd39bdd.0","@material/theme":"12.0.0-canary.4ccd39bdd.0","@material/ripple":"12.0.0-canary.4ccd39bdd.0","@material/animation":"12.0.0-canary.4ccd39bdd.0","@material/elevation":"12.0.0-canary.4ccd39bdd.0","@material/typography":"12.0.0-canary.4ccd39bdd.0","@material/feature-targeting":"12.0.0-canary.4ccd39bdd.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_12.0.0-canary.4ccd39bdd.0_1624551311975_0.9882511704187054","host":"s3://npm-registry-packages"}},"12.0.0-canary.17553e9f8.0":{"name":"@material/slider","version":"12.0.0-canary.17553e9f8.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@12.0.0-canary.17553e9f8.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"e874a9401bd357592bec7c106e4430aeb6e06d91","tarball":"https://registry.npmjs.org/@material/slider/-/slider-12.0.0-canary.17553e9f8.0.tgz","fileCount":38,"integrity":"sha512-UqSpoxGPYnKid1JB05GI7u4cah9M3Ra1Cs6coYLiC67jnxf5h2EerU+F2hqqjgvah+wY0ZE4FtYjMVKbzV37vg==","signatures":[{"sig":"MEYCIQCDCT/MbeI5jSCfyrJgdTvw5nzVVFymBEa6Bem/qageRgIhAJ9+nPtlrp1WF512P2GInRCXu0gwYF29AGoR/y/KnWcj","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":867760,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg2lLDCRA9TVsSAnZWagAAhe8P/imFtEacCVCcsUK38Hak\nfuglG3bMMO5tZD9WKcU62h9XqVFFWEmyGPKTPAXrTOlyEi9viI7/3SBaFwdz\nRqUFEs2QTuK+hwsZJLlDFw1cSMaHvI08xfBR/8vzM8lFYGYgHFph0OWYzDC9\ntQ1xAWxA2Yo1gFSm0n+IqjmDXciHbZFA5ebRuNJ0M3lPB2BT6sl4YB90qZu9\nvoe3DO6pAd14CHfXly6jhE/Xs3BG+J3SQ14s1Z7qD/NYCEp7IYnSEUpMp3pN\n65o3bxecmZjZrSyn6rXo3s+k6OBktGpHvxbb/4XhZk0/io0R6RezwpnFaAm2\nnPJm8fNN1KesCpjEGYiLZt1sSjEMxtWUtUiEqBJ+1h7LHRzVW3O9UGiXQQHp\nlsvy56peKdnHk73TQiyUu/DqlAMSMAj54MOxqWiqiiDpNbXxikgYkAU5Ymqq\nccwQZYcy16x7CXHvt2tJH8KW0CJvKvqvM5/LppzC3kWCBvbTHq7HiofpnGPH\nSbc959ZHfBM4iMvwxwVNrmAjEJDQFCvKL3vCUFbDCarfGhPLbcR3R14RTxJ4\nDU8o6BS38HSrTMDeiJp0YO54FVAuHQ0d8wLpc8RXHyXzLbqhdXGjMriLsAOw\nha7LqG5vbI7/Jc++hDvgZkxuyR7GcmVdfU6sSIHkSSY5sAIaI32H482d9eRU\nmIdh\r\n=d+Eh\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"bbd7dc5fbee09c82081517ffc14264d4834209ba","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.17553e9f8.0","@material/rtl":"12.0.0-canary.17553e9f8.0","@material/base":"12.0.0-canary.17553e9f8.0","@material/theme":"12.0.0-canary.17553e9f8.0","@material/ripple":"12.0.0-canary.17553e9f8.0","@material/animation":"12.0.0-canary.17553e9f8.0","@material/elevation":"12.0.0-canary.17553e9f8.0","@material/typography":"12.0.0-canary.17553e9f8.0","@material/feature-targeting":"12.0.0-canary.17553e9f8.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_12.0.0-canary.17553e9f8.0_1624920770771_0.12331537031053563","host":"s3://npm-registry-packages"}},"12.0.0-canary.4c80072fd.0":{"name":"@material/slider","version":"12.0.0-canary.4c80072fd.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@12.0.0-canary.4c80072fd.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"047f2664e47359714f8f7aaecb5f41b4f0ad32a9","tarball":"https://registry.npmjs.org/@material/slider/-/slider-12.0.0-canary.4c80072fd.0.tgz","fileCount":38,"integrity":"sha512-rKpFW1OrN9rUlD9czNkKAXVFZu3qRF8bd3VKwjfYugkjH+NsvFAzD+qoBpqUeNWUh5mpWrMOtftwWvpbznb3XA==","signatures":[{"sig":"MEUCIQDY5qQgGuL1jGCqZod0uRpzlrW8y7TIyfqHDKr0uov84QIgS89C65nQyhJkI+ou5pWB5fLaiT6XdRfubyzwe/VK94Y=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":867760,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg22lFCRA9TVsSAnZWagAATwMP+gIXYxs6WoGKdau+W6i6\nS2llMAYMFxTGuHVCq0rq1t3+KTsWj0JBkV8Bv6FuaRr/rguw6AuEVm8wjR/I\nb6gN9wNi9pYZnPVxq8quLamMtB3tOg/uIBjVXCqvkIV6ZU4LMiA1hE4iZ8yt\nfTG4HI+h73wPK1afCVBpCKTSQoPULSr4xDnPYmbNwtAfmFJ8fTfQ7VKKQw77\nFQwg0cZqldD83bJKDCMUyqNCxpH1TpYavmV4qFa9Hqo5B0B0fZobCpZ10qcq\nIlDC50+9jGqe331fYMBY12vJ0SkwEF2EpXxzJexyoZP8fKgRpobvo86CYK82\ncJpfzQ12wEWXsKn3tnw00cRXcTuBs2cMG937sL4jWWXQsiX+Kjxu7WJEOyFs\n/9Szc4FzBobOwDhwYJZahy6VMYH/MR9vf29svd75vFgl19fELv4D5u4itAYj\nhCzouMxO5CLpDdFk5J9mU5ONiSo7uXcuevYe3zoQ2s6sN6DLVg49P2n98X3m\n4Hix5v7yExqc2V66CxMtRvpUEs5SBzP3tU+fO+Pyif7TlYnO+9xhnD/6CW/Q\nIs18yDaSHkFJVVecVBX3xqxb7+Hm7u4M+HtH6oTF9OXbRihUFZO9KwfpW1IL\n9BE6B19SMDfLXw9KoiBogWGnrveWdKMdhrhR7Z081BsmO8JAvvEpJpHKANSe\n3Awc\r\n=WyzR\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"9f6d10da43c6e0fbb1366c1e37fbca58ce00dc12","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.4c80072fd.0","@material/rtl":"12.0.0-canary.4c80072fd.0","@material/base":"12.0.0-canary.4c80072fd.0","@material/theme":"12.0.0-canary.4c80072fd.0","@material/ripple":"12.0.0-canary.4c80072fd.0","@material/animation":"12.0.0-canary.4c80072fd.0","@material/elevation":"12.0.0-canary.4c80072fd.0","@material/typography":"12.0.0-canary.4c80072fd.0","@material/feature-targeting":"12.0.0-canary.4c80072fd.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_12.0.0-canary.4c80072fd.0_1624992069373_0.4810768162422725","host":"s3://npm-registry-packages"}},"12.0.0-canary.796811db7.0":{"name":"@material/slider","version":"12.0.0-canary.796811db7.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@12.0.0-canary.796811db7.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"807e8a034c0f90669d123ccae950e96046fba461","tarball":"https://registry.npmjs.org/@material/slider/-/slider-12.0.0-canary.796811db7.0.tgz","fileCount":38,"integrity":"sha512-2Auz78qTH/loVSP8ps83sHUe0cDJeUdkJHrYiAib5rdQMHInbn63TqFyLEftXsiBGNkscs4nXOfT5TS/oT/VBA==","signatures":[{"sig":"MEQCIGlK/B5gAIWDzPKuHIaUOXIjD9wtH8jr+3md8uLXo5LOAiAEpUO2mGu/wW/QQVL2tA5G3Syv5Bffj+f72UyD/eJ68g==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":867760,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg3QZeCRA9TVsSAnZWagAAHHEQAJ0nAt87nfnV1Rq+2iWl\ni/Bd7bPb359t+FeynXW7ieND4PghgloyxzEDT/NzfsVmxSI9fRboDVpMzDgf\nUe6tCT9kc2hWVqDMaYaI8yXZufMZaPjXrKOYXG2PO11jG3n0MU5IqfKsa+2/\nz2fsGYPGytMSAmuZ13Rhv+yUxI1Eah/7bm/dUnuMSuWcLX2wYyb/1AZTnlpe\n0WEffEQcRfAl2CweUkaGrGkGGIdAOim9pBUHnivCpENT944mkD4GMEPGRHiT\nge5R+bdJnNpM82m5dkq7KPA0ixhxUxNn8K/He3xqvA8AlPG5kOcHDvTnxBYL\ngGbGBfwD4rrMxZdFw9cwfsEzXefURtNMyJqEApGJMaoOi07lXA3VGf9zZ/HS\n1jeZ1bpSEz12Wam7bY8if9jQRCMT3ovWOlGe7I7tPROga45T70zsEHSHpgqb\ncwCRlcZRh6CMfIbRLnLmlTlmoS4hqms6/Yb4+M6EzIX5hMjW/bnYq6WTUBYT\nMC+zEPvPJoNKn/Y3YCLwo9VLZmJD+xwTdqFruatVQjBVPGIHR7PLfThkafzK\nlwy6RBLuOweH8C3nMNLSyEeMudzK9Jg7D5+kVzQ2hl7aSkTWzgYN4beMlSMJ\nOLiHMI97Zz8LEYO5yJbKr2NoJT4+eXFUcC75QB9M1H/XETcpkKEC+uDVvXVs\n5dbP\r\n=Imoi\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"b02de77dcf32bdce7d23406dd395390b35e386e0","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.796811db7.0","@material/rtl":"12.0.0-canary.796811db7.0","@material/base":"12.0.0-canary.796811db7.0","@material/theme":"12.0.0-canary.796811db7.0","@material/ripple":"12.0.0-canary.796811db7.0","@material/animation":"12.0.0-canary.796811db7.0","@material/elevation":"12.0.0-canary.796811db7.0","@material/typography":"12.0.0-canary.796811db7.0","@material/feature-targeting":"12.0.0-canary.796811db7.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_12.0.0-canary.796811db7.0_1625097822250_0.6976549866611734","host":"s3://npm-registry-packages"}},"12.0.0-canary.70e1efdca.0":{"name":"@material/slider","version":"12.0.0-canary.70e1efdca.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@12.0.0-canary.70e1efdca.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"c168d9cf8e502c7e9846a843b918584e40e20679","tarball":"https://registry.npmjs.org/@material/slider/-/slider-12.0.0-canary.70e1efdca.0.tgz","fileCount":38,"integrity":"sha512-42tZo840x8gyufoot80R9dNV4RxXa0aGOwtQvmWrGH1jNtEp3zoBqOiYtXGwre/oIxzZ1B2qj05c83KiKsZ3PQ==","signatures":[{"sig":"MEYCIQCqSM1XkqgDBcEFC0C0nOXmQepzM7mEMRwaNWhjCDoX8wIhAPN+Uhjc6XflnLpvT/nWrVRs5mi/1/SGVal3dj/PovRl","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":867760,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg3fYsCRA9TVsSAnZWagAA10EP/iUqHt0VZQalrLDCvKlS\nflb3BI8pYLFKGN/8JHUO8QRICRVDyS2a4uE94HSFJovqJ2C2yh/erfWqYb5h\nI1CtAzCjutwea70Ra0Niac9G9dSClfMUAQoXjrV0tognRUEc+lpzINfETuUT\n+cfUa3IvjWnDSbAT+JEpGRYjN8UAn3hR7GvJkkZ6Jz75PfSkeRzzCTZAcYyD\no1iDN0wVMB/b2QALdrmVDQc3/Tah4bZTkTg5+v/5Id+LIxbPMzwfEDh8pzzl\n9aQ2AoKmTCpcxVSa2lGu1mJLU0xtCzl+TznQm7kNiNfnmp82Jp6J1pnBNU7S\nc9mfk3ksK7EftoSPGRVz3CCa3k0+3ZqD4nZVJ180+Kl+1hS8FbnDhmtkxzyf\nvW2reCrQCuD8FGfVYYgSw44rHwqB53puvKurpBchPVKsyNOBM0GZbMkpW/PF\nrLM09zAmlKnUPi+iH4e45eQvypGRPGcyCTNkTfjHVa/3lw9mZrkinqqwH4sj\nkAulBNhy2wd4UDwL6Yj8AATtb0c2t46difhNDlScbaWMo7ZLRNoNo4ds7/9w\nTxHEvDTOqO8xPkNauLAJS8/Dx7p0I389k4668s0COxxij6FIYphWTQqTJOL8\nBOrCHRiYbzlQMLLyftkwvvor8wKUV0RS4JpoGWxeAlFMIjWcF1rlgdxxqgar\n6VSj\r\n=n+wk\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"ab5924ae38bb3ce40d3b1c303e1ae6d175b844ce","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.70e1efdca.0","@material/rtl":"12.0.0-canary.70e1efdca.0","@material/base":"12.0.0-canary.70e1efdca.0","@material/theme":"12.0.0-canary.70e1efdca.0","@material/ripple":"12.0.0-canary.70e1efdca.0","@material/animation":"12.0.0-canary.70e1efdca.0","@material/elevation":"12.0.0-canary.70e1efdca.0","@material/typography":"12.0.0-canary.70e1efdca.0","@material/feature-targeting":"12.0.0-canary.70e1efdca.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_12.0.0-canary.70e1efdca.0_1625159212065_0.4410530586617618","host":"s3://npm-registry-packages"}},"12.0.0-canary.435866d32.0":{"name":"@material/slider","version":"12.0.0-canary.435866d32.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@12.0.0-canary.435866d32.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"ba8eaf4aea567a91b8c0b11f58df91637151d622","tarball":"https://registry.npmjs.org/@material/slider/-/slider-12.0.0-canary.435866d32.0.tgz","fileCount":38,"integrity":"sha512-w3AxzvMkI9mESePtwgPtReR0rTxXBq0ct0nQt3ycHNS5y5UX9hcLQDeF925Zc1WV8P6aoJf3M9SbM83OyTAKpg==","signatures":[{"sig":"MEUCICBq2W7vIml18OqfUUKhyHqQOcf/aDnA7wqqLuNn2aPgAiEAqqL6GEhGprnWclrXL75/c+cxD0CvernwiWWRFzUazn4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":867760,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg31kpCRA9TVsSAnZWagAAY20P/RDZEIUiDNn4Vj0qXWi+\ntjyDsFL8U7nXLu8wCQ7FErsGPv9qxoi+sve0V3R5kATV1G5HvXjYfMPxMTTS\ncw+UaJrNiHgHFXM9sYQF3yuMs0SNavdRkCP4jgAUUNen8yOUSkfeWLeB0KrM\nirb9M9xlCpZXk5sVIsSx622YPOJiJTe3QCaxef2IHeW31fy4UBb7b1cN7jrJ\nH8anmHi56LpTuQM/PkeQ/NETf1feSpSZNAIGjJR6U/cjX8EXzoPcrJ4aT2OU\n0SQpva++whsBKXxyd4KYa+wG2rVdSq4NuQxZIpitA4v5wCci0kGWVEHb5UGw\nvseR1DrwBU39f25MyAHc+36VAYZ2es4Fm8uHDYCd5zn1TSdmKawo5/vR1THB\ngP9mduoxjgbG+QDvfasDiQ4SWXitTE4iAHkU0d8oHEks6SgEpO6ZmF3N5xMx\ndaCWYF2/1qdCBmscjg/BTS2RdSx+AbXWOuHjilj0p6MhXZuliGW/RmBhCnQK\nDOwAdlw5H7S8SsdUjuSIe+QvISQBxMpqQlnUNC9Rbg2c7WDlB8FhBJrUZgiS\nuIV3LDq0YGA3AoSxbpUzgMSj4jUbKHvMqOT5kVVwkUW7DOCt10Vsgvb7c2hV\nPdXuO2USjnTIw6BF1EeF7V2w1xpUY476/sDDzF8pNrE6JXOuipbHundJCSUG\nRCri\r\n=OgqP\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"ecf68c368bd1ea5571aa4da569d6fe6c4b8b8caf","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.435866d32.0","@material/rtl":"12.0.0-canary.435866d32.0","@material/base":"12.0.0-canary.435866d32.0","@material/theme":"12.0.0-canary.435866d32.0","@material/ripple":"12.0.0-canary.435866d32.0","@material/animation":"12.0.0-canary.435866d32.0","@material/elevation":"12.0.0-canary.435866d32.0","@material/typography":"12.0.0-canary.435866d32.0","@material/feature-targeting":"12.0.0-canary.435866d32.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_12.0.0-canary.435866d32.0_1625250089487_0.6638636788556787","host":"s3://npm-registry-packages"}},"12.0.0-canary.d0f9f3f2e.0":{"name":"@material/slider","version":"12.0.0-canary.d0f9f3f2e.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@12.0.0-canary.d0f9f3f2e.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"e109b8e9f2364aad694cb7812ecefc2f5e3d1839","tarball":"https://registry.npmjs.org/@material/slider/-/slider-12.0.0-canary.d0f9f3f2e.0.tgz","fileCount":38,"integrity":"sha512-f+KtkKJgyyjoaC7nvVzVsrsUqz7/8IeNQ1wf/YyqAhTmOdSJQ/i/vA1CB/XrbRKJMVUmpYwE25zFQiUwO0AAUw==","signatures":[{"sig":"MEQCIHjO4u9FAQ6BqeSBQqzpDCXb6brbXxDtS9YhDpZyCG+6AiAA0Uy/ctgB1/kL71MnB3Jhd7763Quc5j/fBW8hA+WXZA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":867846,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg36iUCRA9TVsSAnZWagAAPakP/ArkvyDxIxVv5B9OSDIZ\n8kVIj4FJvNb1csjxh81blsJsAfCP0Ss4dZ15fnKgpevy7BxmIk8tdelc8bnQ\nj1pgOlwCrhApoKX0MkXrD8O2umbpfAyTpB/fkLgc40D76wJTRlgSDwqQnblQ\ntNjGBmwU7X4PU9BBoNatYrFrD/uuB2XVa3U121fGMX8lj741qGXNySZIREyu\nvsrcLJoTeOJeT2otctJ6gS5sHa4JGJUKN72/EUVFk1CuFQPIBERhLxI/u8R6\nm9+Nz3mj6r1R+ClBq/kt8bs6mJZILHXluv/OQtarNIhuGfVhIdRH5nYZ1x0o\n1486Vf/V2g68a+HYdsu216+xR8FOPmfbqkLZLbBnlcPOCm+r1V/Ubyc6GYUu\nsviuTQUBQoyOOSxgRMVTYrVRTyAYpMSXw38Sx9LLH4mjguO95XQE3JdE1g42\nyRVUQ2IIrVcFtokyjHqMmdHPmQWVYNNhNnwRLRdtN/RLGkR2ISMg1aZGhaUa\nI9yOy+7xpPXNzQp9HcAXCJhqzB4f7vcjbUxqpGY9LmWke2tyMdD9M8F9NxcD\nX1Aeh1hyWB1gKlL2XxiDmef5eZI68nI+G3l1JQMTcvE5OXy8RjytZKtrnW2N\nz2Z/t4TEn6oYUSYmcJUfs7+kCDPxmW9LH81j2XxMRCH4RtIOCKh3kOtZg2yA\n+iM+\r\n=xLRg\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"ed31c78c6a84cb24353ffd1d406693496f090e29","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.d0f9f3f2e.0","@material/rtl":"12.0.0-canary.d0f9f3f2e.0","@material/base":"12.0.0-canary.d0f9f3f2e.0","@material/theme":"12.0.0-canary.d0f9f3f2e.0","@material/ripple":"12.0.0-canary.d0f9f3f2e.0","@material/animation":"12.0.0-canary.d0f9f3f2e.0","@material/elevation":"12.0.0-canary.d0f9f3f2e.0","@material/typography":"12.0.0-canary.d0f9f3f2e.0","@material/feature-targeting":"12.0.0-canary.d0f9f3f2e.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_12.0.0-canary.d0f9f3f2e.0_1625270419769_0.3641038915299033","host":"s3://npm-registry-packages"}},"12.0.0-canary.adeac0549.0":{"name":"@material/slider","version":"12.0.0-canary.adeac0549.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@12.0.0-canary.adeac0549.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"d076a573d0ee394d96fbf049176fbe632a4dad53","tarball":"https://registry.npmjs.org/@material/slider/-/slider-12.0.0-canary.adeac0549.0.tgz","fileCount":38,"integrity":"sha512-a8yZ7KxuZG8UJ5BqA+EFKX7MORzHlrWTVZLxcxGsdprIkIzOODjj68OZ1oMzPdAgBDb/VzyIC/tWNIrPdn8SDQ==","signatures":[{"sig":"MEQCIC5V9mi3JodHRFDgS6CA1zVLxOOO3GZBjtBpA8nk7qm/AiBvHmfSOH5L4AVsp4kS+1pf4gSIBTi8gN3GISeh572hLg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":867846,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg5xUtCRA9TVsSAnZWagAAYO8P+gPmBCHkpaQqpkzu/TjU\nTDfiQNHWGtzFAxMO8hpZELg+7bAMuo5e1c9NyQ4RCeNl0wJhrjYgwaf9joKS\n1TKDtiZGk+q/M9BgQEcnHjoHBpVxdERb7BZCT0bnVQ/SYkubcJPSnQ7VJnc7\nerq17c78Q+7anaJKikdmzsF1PM0aztYCV5/X5ITcVHlZLaxtwK5L5Ol8zJRh\nv5nQFe2OsltuZb9+YcKBow6APkSqJ/3YV528KX/o8cViOsxF1RDwTPdodtvJ\nAcgujm+7+lmE4vM8VcrrI33C1zDlrtDTjJzaC59ugfLfP8xq2d7ngVB6kGSM\nMUXoBbml2EXEWLk//G5u6sLvHNzBayMMFipbIQnqv645lzpN/DkprgaQ0lkX\neAIEfN/lqLt02s7h64z7D+yXiCfKWh0G1iJ3pJ+wTsrxzZCN9QJh1so+9dbs\nzBwrrx6H3Bx3ZSbzVhd/+JZURQACBoYsx/yK7VnygmAkHUkaOaDycEP/2bsl\nW0MGZfrtsN4N0lgwDMTefOWuglfSNINBiM8UuKRNmgKvu//CfTMPS1Dq+abS\nrcCHU3d0oUYNJjKB4tm2SRXRdffUuaj8TerdhRyeuq/0VnXaMMbVOM/8TT1v\nPNUyacPEjR3Mr1AXY5wn4cwixN2gU3Rnu7BiPL7V83IdKz4ttNMdikGAeiuY\nHrlw\r\n=VRxG\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"a189bfd7e13b17660ad97870e074af0ee245e36d","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.adeac0549.0","@material/rtl":"12.0.0-canary.adeac0549.0","@material/base":"12.0.0-canary.adeac0549.0","@material/theme":"12.0.0-canary.adeac0549.0","@material/ripple":"12.0.0-canary.adeac0549.0","@material/animation":"12.0.0-canary.adeac0549.0","@material/elevation":"12.0.0-canary.adeac0549.0","@material/typography":"12.0.0-canary.adeac0549.0","@material/feature-targeting":"12.0.0-canary.adeac0549.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_12.0.0-canary.adeac0549.0_1625756972866_0.022235973717278368","host":"s3://npm-registry-packages"}},"12.0.0-canary.068fd5028.0":{"name":"@material/slider","version":"12.0.0-canary.068fd5028.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@12.0.0-canary.068fd5028.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"fab190054932d302be0e91d11345d03a5b17f7b9","tarball":"https://registry.npmjs.org/@material/slider/-/slider-12.0.0-canary.068fd5028.0.tgz","fileCount":38,"integrity":"sha512-YV9kgpj1HHwQmZgDqF2Ol7jY6PyJyMfpf3OdURDz0FlXtyZH8cRayYV9cTocF3BHFH7CL3QXRKnJETFB8xkYhg==","signatures":[{"sig":"MEUCIQD5J8LZ2DQNlKvHAEkKtj4KqAFkPyblk+fm9/oTX7dLMQIgbPHlmA7LI+PM43u2tOYtMmFN/epYlUHHnURcvQDYJ9g=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":867846,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg50wfCRA9TVsSAnZWagAAtm8P/3P5T9pVYxvjxEIiqoBl\nEPjWVpe5SdM/vl7rUMx+EtuKU8hYUyIHUy+jL+3uczli4+2JEbhWqx+oLlJ6\ntzYJYJJZvk5ArVXaeG09A7172JQtzmvIZRp3RkliMxh5nqhF3hyWFXBP7cMK\nY47ENW9ZCd+/nJptOKYCkuBy8C9UBhhqvzqemaLs3zWW3MjNr4kQVmbOwB/B\n0+j0ZMx3PGjXzpBMPRG66ben2Q+OJXYZbOT7laIelI2jNonGvEPjNEsUQB1r\nwncHOT1hsS8S/IPoMNtx0/UCdoQh/VXKcLX1ELg168l5pJjd2Vzu6yRE5EkK\nW0aEcWxAPX46SHBuBxEFnTvVHc4WK6e98aW2gb4lgu2Qe16lti4Xid6i1tbQ\nU7ae9B3vmZkGBx/kSQqF9iummh93o4I46rmTmi3RM+0S5PnmDGDeANZe18IL\nMW6MQ+L580imlv5KBtmGq2r0kcK2WIyzH7GO9snyU8vBPGz8xkyIdp3kNkI2\nGtUUVhFsD0t3vJjt3R/l4tlZOelX3rtVTyVKxOBqt2eC+s5CYCZmgS1+xU76\nXqxoWfvkhnWNc+/HrlHTVuaNfaLm+2bClUWPDC8HZ8Bl5nBEHqaL6MebwO4X\nonmlnHCLFJHIT/jcURa7X6k0bw96mM58A+k/qaAvFqy+Wp3nSH3Epzb5SsvO\niK8w\r\n=ClYB\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"daf6a798ec3c54ddba492f33c939c41a8d88655f","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.068fd5028.0","@material/rtl":"12.0.0-canary.068fd5028.0","@material/base":"12.0.0-canary.068fd5028.0","@material/theme":"12.0.0-canary.068fd5028.0","@material/ripple":"12.0.0-canary.068fd5028.0","@material/animation":"12.0.0-canary.068fd5028.0","@material/elevation":"12.0.0-canary.068fd5028.0","@material/typography":"12.0.0-canary.068fd5028.0","@material/feature-targeting":"12.0.0-canary.068fd5028.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_12.0.0-canary.068fd5028.0_1625771039305_0.805981221196447","host":"s3://npm-registry-packages"}},"12.0.0-canary.5dfec7a14.0":{"name":"@material/slider","version":"12.0.0-canary.5dfec7a14.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@12.0.0-canary.5dfec7a14.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"2ca2580e1383e065aeaeb67b547f8ef604d6c83d","tarball":"https://registry.npmjs.org/@material/slider/-/slider-12.0.0-canary.5dfec7a14.0.tgz","fileCount":38,"integrity":"sha512-vW/z6yL1IjKsCL45gmNPQ4gju3+NeeLG2JVAWCab/XGsjzS7kyNbgJRExHU+4gjNTspaX80pM3dlOKVeNBA7ew==","signatures":[{"sig":"MEQCIHVDwvnMQms8ybGhQkyWEoUATLOHpdapgUc60laVooHLAiBt1xeU8NDRGmcVMu1iW3yK4CQn3g3NLM/rX6RMYpV+cw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":869890,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg7KBNCRA9TVsSAnZWagAAxtIP/A77lHPFW54vH2hNVKP+\n+QrLSfC0WefSMjb3949lnhfUeurUC2CCDUG+KiOKJv6WyuTKJbCQjZ6w/p7Z\now7YukqVxhJMhpgZoK88mQFPdcE8tfy9G1ftNkQ84YdiVJCtjfOeOVAx2sVZ\nZXxQw7C1Ma/XtyQF00LA01EIOpPrpO9khUTc8yErh/+QvfX7saGqmAlJ7mY6\nVhaJEVK3Eyzcqzb+el9rD1ZPQNNHoSomuScciFOcywKUkIC+lVSyjz2uNvXD\neKCAsntWuRjZ3xxG//N50UKGTBwK4yMVGVFKID+p7XGB8hJljJlLTYZXrVrN\no0u6rv81UKrnfmp4YqhunW3iYDfUdn1ROcfTQgp5/4vnBEPp9FTjDVDVZaI1\nuc2i36daMzIxfoUaeJpp0vIvjGcrR50avHbw0X2M81eZ5eZ5ak3R72o/he9q\nepk7yf35lb5dPJ+HZnmpdZ1a/L63Of4SbBiYix+i5epWBRSH4wN0LONV7uak\nzT/SjOb4kP4CSxlm1/1vaU+aIuzer+9Vhx8xlyjRUfD4VYLkGKJ4tOMgzE/X\ngNmUjzihJAkK3JDT8l+D4FEAsYGyOBH9QDuUuPS6nu30MjiMsLOxqIHODcDx\nZucrBUA8/ECXtoG9qnD3MSM/GKMixFs79tSCT1WSRcPgw3yjpH/lnwEbU1B2\nlZzY\r\n=zyPS\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"7295656b25be2c03cf7ca7ca800e7dbec4d9b531","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.5dfec7a14.0","@material/rtl":"12.0.0-canary.5dfec7a14.0","@material/base":"12.0.0-canary.5dfec7a14.0","@material/theme":"12.0.0-canary.5dfec7a14.0","@material/ripple":"12.0.0-canary.5dfec7a14.0","@material/animation":"12.0.0-canary.5dfec7a14.0","@material/elevation":"12.0.0-canary.5dfec7a14.0","@material/typography":"12.0.0-canary.5dfec7a14.0","@material/feature-targeting":"12.0.0-canary.5dfec7a14.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_12.0.0-canary.5dfec7a14.0_1626120269334_0.7109443044741774","host":"s3://npm-registry-packages"}},"12.0.0-canary.07a73750c.0":{"name":"@material/slider","version":"12.0.0-canary.07a73750c.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@12.0.0-canary.07a73750c.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"287bbf01f5f3fcc5e65a37057701c78f61a01cae","tarball":"https://registry.npmjs.org/@material/slider/-/slider-12.0.0-canary.07a73750c.0.tgz","fileCount":38,"integrity":"sha512-fnFKPhXkCzRr8X7E/nKfZg3dOkqU15E7AKSCTUaj2v4J93gmuRn43upNvzuVUslT8pp0RUSHbESdM/4gWSwoYA==","signatures":[{"sig":"MEUCIQC9xUzJGe+z6OzBjNPKY7QMlgeFQzQOoeAhmHiRKMuDtAIgfGPJt7bNraAViFhmDUsi0XE+tfshkPDq9xgWLger3sM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":870662,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg7KVNCRA9TVsSAnZWagAAS9wP/RqMXWwJcCGtBV624LPW\naAvNJIR9WDad40M4znGR/vg6rBP0TMNzGLOAG298PY2i8xGyKovVIAGOOm9u\nsbgpKNMMEoJIu5kod7QfYBvPXh8NfBLReUEx4hE6UuYyOYfPgtGH9ZH2kaC/\nsAzlNs78OxqJAdjyGusB4d+ZrM44VFO2LPA9XpJ/E6Q1fteWfm8Qs+tEE545\nVLUUrR1QqPc9l0EByGwec2YaBsPWdr3PUG54fn7WFQ5nG3diaQxxSeqM1rNb\npEIsmR9fR3OIsOSDEkEFJwMGMQt31cPkCeSdSVIsHvonNZlrDHd7+9B61++s\noAtK3UxKIeVnsGHe8EfNFpeCBXg4wOApRh3d2mwhK/LOjloGmSKFTYF7g7h6\nj/TkslBHstg3Zhp/upk6zLGYxOkwrO2dh14Ha5+ej/CW0c6sKdelDJoNVjaP\nFV5jyJAVJk+Mn/FPRJrazPmL/IBXegkM9wmZRrzOOlNSG7BFG742mKRAf3eJ\neT8KN8HSH7CgRmHVLYCjKWlD9Qe6O95B9kV/Et2yWIzrAprxlR1iv3EQNKaK\n88aKUVKDkXYPV21IVNTQkLzsZ2fmWoFHgWTouv1nqZy+vKWpRoNORNqvuT7/\nlpHOiW0YgxhASNF3Pk6dry46MEu3zxaYdZggu6p2CKM4iT3a8cVDwQ3490s0\n9fax\r\n=LMWm\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"3534c8199752b92a52696d2065e73b8e4a997195","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.07a73750c.0","@material/rtl":"12.0.0-canary.07a73750c.0","@material/base":"12.0.0-canary.07a73750c.0","@material/theme":"12.0.0-canary.07a73750c.0","@material/ripple":"12.0.0-canary.07a73750c.0","@material/animation":"12.0.0-canary.07a73750c.0","@material/elevation":"12.0.0-canary.07a73750c.0","@material/typography":"12.0.0-canary.07a73750c.0","@material/feature-targeting":"12.0.0-canary.07a73750c.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_12.0.0-canary.07a73750c.0_1626121549342_0.05427538059127679","host":"s3://npm-registry-packages"}},"12.0.0-canary.3e4c6dca1.0":{"name":"@material/slider","version":"12.0.0-canary.3e4c6dca1.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@12.0.0-canary.3e4c6dca1.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"b307f3de343acbacd75a6f72918d04ece5dbf450","tarball":"https://registry.npmjs.org/@material/slider/-/slider-12.0.0-canary.3e4c6dca1.0.tgz","fileCount":38,"integrity":"sha512-AIzbYaN4+DOXIovKoRm3W/jMa1K7tgC9Lhw4H4Fkq7t3hG1VuPhpjomWKsM5iws9I2KOHOPRGNGHoKo1dDrR/Q==","signatures":[{"sig":"MEUCIQCK5kDeDbicbqYTcH+LBJgbueyM8ZYbBxiKAZ0g2EW7XAIgT+EGlz8f+0EHEq96HfIyKrKDfYVpYUpSfsy/2FH0BGc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":870662,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg7PGrCRA9TVsSAnZWagAAcv0P/RGLARk5OOxRiurMNSh8\nbpECI2lNs08D1IpxuNohePE/Jh9GiD043774cBgwVN/HKzB3ZkvFLiH2O0RZ\nOIc2cxx1MV8pqhFDmylW8I4vMWqEGA8c6//nBKvY5HggXmdLNH9IemTujxb0\n3oN/wsRwMn3DrBHCND0QP+vNC65ubtfMP4+WBSU1j95b+kmhC4FhrA+Yi6ic\nZHYhQMZzWQL8wjLx6xal17b+CaTUvqFDRu2+qQDJFyT/P0Bc+dNUNel6LNew\nP3HnjyVaRLLeVx6qsXHSlkJsSgBGUc/E7QSd9w8z7nh0K4rmpCiyLsycUZgt\nlgB+zL3QsXUBx+A+eV01PeXZ5zUeFVXpoYeCO0g2jHrlz9OX21UU2jVkiL7A\nyZaRZvoFP+PvqAipbEAGQXfJ3Nl89LQRqGzrFZVSAQnyCBCSzYhhBJkXZmce\nlWKk1C/ojmE1qwO5XQLbvf61Tqofs7PyV/GCfb8ECALIDzrXoquJSFGQNXT7\nt8g/+ooPNbDEFlDQFwo1Kna/aOljs9alvV8vBVq94hukeTg2tEG+ejUsG7nL\nZI5OdzwNH7tB12GF7nE87gK6QKEZvnatDzX3GFFhsFwUjpvFeR163dnCfVL6\nULdjTr+0SagUnJqqxHnn7U6IvB7+TGWiT9vSSei9/zV7ErSTl2ymWYh5YFyH\nzZ9e\r\n=Jwf/\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"1a6a8bc529062b0303c0df830b36d3110a389f4d","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.3e4c6dca1.0","@material/rtl":"12.0.0-canary.3e4c6dca1.0","@material/base":"12.0.0-canary.3e4c6dca1.0","@material/theme":"12.0.0-canary.3e4c6dca1.0","@material/ripple":"12.0.0-canary.3e4c6dca1.0","@material/animation":"12.0.0-canary.3e4c6dca1.0","@material/elevation":"12.0.0-canary.3e4c6dca1.0","@material/typography":"12.0.0-canary.3e4c6dca1.0","@material/feature-targeting":"12.0.0-canary.3e4c6dca1.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_12.0.0-canary.3e4c6dca1.0_1626141098955_0.37613016818946043","host":"s3://npm-registry-packages"}},"12.0.0-canary.ea77795b1.0":{"name":"@material/slider","version":"12.0.0-canary.ea77795b1.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@12.0.0-canary.ea77795b1.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"8b0f2eddf366d4109d6352e0337fa6606a476c67","tarball":"https://registry.npmjs.org/@material/slider/-/slider-12.0.0-canary.ea77795b1.0.tgz","fileCount":38,"integrity":"sha512-boF5X38HvVXtPJEbYKQQC9LjYpWQOXS8MyHE6dFYOhQ6Xg+hJT68OzzBSm7pgmK4L1c4VkEuo+VGh41E2YBITQ==","signatures":[{"sig":"MEYCIQDUnw6NrJ+ClD7Lf4/PKHccH1QCPcjh5epHgVaZtV5iZAIhAMZau91n2Hcq9v1ZpPytWJ5a5+ycTPiJUBS9OGsB4bBd","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":870662,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg7bYUCRA9TVsSAnZWagAAHOAP/0UOqZ+0lf48Eg1W80ZH\nRv07FyoIbxXcy5OjyKM1NPlxBoGnI6PQtCzQNPXoMzLG00SprgHCYciVguTG\n6+DZgemqL8n6pgfg4Husv8da9QBI1cPYO7nKnAgdDtRWx3tJJoKArJb6yQO2\ntTEUcq/H7eDQav+nES1Cciuvp0LIvvYyB6O7tRnYoL8QxOPo+lNLMa1MUp3L\nU32AsJkCjUHojv9oLsw9tfqlINuMckvAxRyJXx6JTVTX3ODYxS5dqQMIbBOn\nVcQfGTNHHWJ2Bqq0e/fpUPShhRP8rB9Zokc4BAcKgrzlZpE5EP4y6vl7o2YL\nrVPWpix5YlxiIatlbnz/r63cuM96+5gBFHUe13/O554klTSsYCBMpUWi0te9\n/DtWHYBNZDKpjDKnsTJjSlbueMWqUgbHiF/Uz3kTZ5C4YE2uRrEHUIGshjLR\nRJBsD6sLcMGtYCsD/NjVxnCYnuzwpxzz4bpBz3RWTWjCquXtC5IV22TEE4WF\nK43eW1RqtmeLlKP9xyMnSFKtPiuytBeJczlJ+EfS1Q9VHBHKkGcZgdyAQGdv\ncHvog5WLdhRZq2UJX+BhM7vB68rE1dPu5wPNS1d21CAgZQ3o0NwKkX5807NF\nmYoCEA0sPmF8nQExdBP1vgxUX+G6yinCgJZWMxQQE8nJZ+PGxhmF3a/S0yiP\niuFD\r\n=ivTV\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"830444e6567decdb85bd9b22a92d5f85b103f107","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.ea77795b1.0","@material/rtl":"12.0.0-canary.ea77795b1.0","@material/base":"12.0.0-canary.ea77795b1.0","@material/theme":"12.0.0-canary.ea77795b1.0","@material/ripple":"12.0.0-canary.ea77795b1.0","@material/animation":"12.0.0-canary.ea77795b1.0","@material/elevation":"12.0.0-canary.ea77795b1.0","@material/typography":"12.0.0-canary.ea77795b1.0","@material/feature-targeting":"12.0.0-canary.ea77795b1.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_12.0.0-canary.ea77795b1.0_1626191380169_0.2529060174296094","host":"s3://npm-registry-packages"}},"12.0.0-canary.15a179fad.0":{"name":"@material/slider","version":"12.0.0-canary.15a179fad.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@12.0.0-canary.15a179fad.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"fee48fe833b56b92142809592e2c8a4e91d64627","tarball":"https://registry.npmjs.org/@material/slider/-/slider-12.0.0-canary.15a179fad.0.tgz","fileCount":38,"integrity":"sha512-CSWji0rgVGObERKLsBhs6dNF1fxGjM1DL6D07qIUAXcT5DGHy4JArfP2M1fpfZGhFDev2ioSM3jQVrccGh8Dug==","signatures":[{"sig":"MEYCIQCSQR6EYLAe+TW5NwAgHMAW/yEKk/5RdiLBDIbjIdbzXQIhAJEMFfl+Yd8ZpFuOimpbuj+jLc1BubDQ8br0ZBtBYRk3","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":870662,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg7dbkCRA9TVsSAnZWagAA3AYP/R03+AIyWEhICmwdMonR\nRKOyf41i8DE0yMLvZBAvofJ3xbxqyKUChBMx8bVzsR2I49HCesYXJ+MYlxT9\nbp+LPfmTFLHoxtvKcZ5YNucOPXMKVz+3yRgZa55U/QZ9e3UYVWpBkvo6PeQn\nC1f74zynUymC3bQltkfGHMrNyZ279//zqGZXXqgtmF7AnBiR+sP19mWODdGy\n0OWxVlEJmCvs5qO7GhEHMyMlDwsOO3wEhPVQFsPJ5kxeicHtOnQLd1CP2L12\n+xJDKTjErcZezkP1+y1R6SOHnmxgLigVXk8ImGJx5d5aYikLnLqgck6g+ZSy\nuwSQRTawe4WfErRl+d8Qda9HG7bMgIg2OH3tJlw3M6Z0dJSRV9k1mpsPRMmm\nx/CnJ491AZ7kWOYhRb+I57olMNI2/q+eyl+Qj5JNBJyVpgdu6Ed1jhBh5cUQ\nNEtT1veuqE8gln69EAsLimgr6Fb09uLUUrxZNgSQarEs0Z/xBa+FQYk1t5f/\nSkHHSeDTfDp5mW8V9CaLDyEdOrex+6bnu1yMvcO4zRbCPudFdRb0w+P6MPk1\ntzpljuntkSq1AUnwyIIaj3/ryvG4BtjF4lyienV/k8zZ8lZuml0yPdQ6JDgq\nO+0d/7XcPachlGNj64Hh4ddsQIeDtO1sW0PqMzyon6HuPN2i14qJQLUeJeRZ\nwAc2\r\n=Py8Y\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"eb659691c3a77be825ea082c434c0b24c53cd610","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.15a179fad.0","@material/rtl":"12.0.0-canary.15a179fad.0","@material/base":"12.0.0-canary.15a179fad.0","@material/theme":"12.0.0-canary.15a179fad.0","@material/ripple":"12.0.0-canary.15a179fad.0","@material/animation":"12.0.0-canary.15a179fad.0","@material/elevation":"12.0.0-canary.15a179fad.0","@material/typography":"12.0.0-canary.15a179fad.0","@material/feature-targeting":"12.0.0-canary.15a179fad.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_12.0.0-canary.15a179fad.0_1626199780048_0.5702379079399011","host":"s3://npm-registry-packages"}},"12.0.0-canary.c73142a1b.0":{"name":"@material/slider","version":"12.0.0-canary.c73142a1b.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@12.0.0-canary.c73142a1b.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"ebdbdfa0632ca8e71e6aaf43a3cfe194017170f6","tarball":"https://registry.npmjs.org/@material/slider/-/slider-12.0.0-canary.c73142a1b.0.tgz","fileCount":38,"integrity":"sha512-TY5ln8WrBTuoALMFiu2KtA38zVnxlQyjSXDFoMZ1uo6F78UUiLZTfXu3wt+Lg/92wDQEHbB+Uyv5dkkfHjJLhA==","signatures":[{"sig":"MEYCIQDDJgluw7aT2vsCRtDNqfC7H93Jggbr/15VYErsmfXwGgIhAMnJChaXpyfSmb0umE3X/bn2FHZYPclLXaSGXNAkyB2n","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":870552,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg7d8RCRA9TVsSAnZWagAA0L0P/3bBZ/i5BrQRg1AghKcq\nm0LgNjUikKjnBkIHUeQe4e1qoGcmO6q8/aL5e1DBk8ptS/K2ZJXRJlSshaCj\nC5u8hl9vjOyK+yvqpaWHLOkIL2Z2F+cy5JNaHXNaQTl79wFJs+4eB0GXzxf4\nqXnf4lGQavIBkpBdaqs9p768Ol1ZBExWK9GPGWHXxmR5Q/YjK8gQBqHxZPJJ\nF8hDmXyYYLeQha+XqKibGA2DFCTDFkLT0QsEaHAIZKpWAJIeCE1uTuPNH9cV\nFuv+bse5/MP/PwoXdANbdf53pf46/ycdqQYwI7HcUkPFZR9WZ09zK6A6jJAo\nYws+snPRNvIU3QSSGgq2ygMr59NwSzhq3vblGqt7/65t3J97/a5InNO0Xi1Q\nX5p62h8VBNaBdfYXFq2R2RaNwBpC+QnzKqK7T0V4JwhmMSICbnMetaPsS4+w\nZgmQd8ccjQgNcl+iliY9wq2H6h9yg7hqe1KlRGHv+24c9RWvGhY9ZGWl2FVk\nvn+8y7q5j0v4dOrR6bdW+2xtSpAhnIFMQPk/9KpzVT/ix4XQyVR6B5Qo27FA\n3o3Jxw4khkp4g6e58t8WyTocyD0Bms4bAHMkKdUfNr6iily+LDu212bW97z3\nEmD6xIwrjBV4MujLFlXALqf0NlXJeMtvBl/bwbce4KuKVq+MMo1sCCagMYCr\nC5fZ\r\n=YKmi\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"037ccc3828bb7b7c6f3375754059c10c231a6b60","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.c73142a1b.0","@material/rtl":"12.0.0-canary.c73142a1b.0","@material/base":"12.0.0-canary.c73142a1b.0","@material/theme":"12.0.0-canary.c73142a1b.0","@material/ripple":"12.0.0-canary.c73142a1b.0","@material/animation":"12.0.0-canary.c73142a1b.0","@material/elevation":"12.0.0-canary.c73142a1b.0","@material/typography":"12.0.0-canary.c73142a1b.0","@material/feature-targeting":"12.0.0-canary.c73142a1b.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_12.0.0-canary.c73142a1b.0_1626201872789_0.18008964647161085","host":"s3://npm-registry-packages"}},"12.0.0-canary.d923db73a.0":{"name":"@material/slider","version":"12.0.0-canary.d923db73a.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@12.0.0-canary.d923db73a.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"3195cdb51ade154d5f47d3b9840eca7ad4832168","tarball":"https://registry.npmjs.org/@material/slider/-/slider-12.0.0-canary.d923db73a.0.tgz","fileCount":38,"integrity":"sha512-4FHe+Z7Lv/fRgNeKA4m2mHNBITVSt+Kl78OSOWZOXLHI6IbjrQJfYz8wzfnkuDwH/YtyKw+0Jqnl2SPLHX2Tig==","signatures":[{"sig":"MEUCIGXbj/CQNydG20nXDJSr2f+R//GFl2uR+rA1JPbZQChKAiEAv2yMXkhCH2I294vEBjFVO0pL43iK1CC2/Op32ceF/iQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":870552,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg7f13CRA9TVsSAnZWagAATH4P/3222PHk5WKddLt3+YTo\nTRMeeZh6gkTiEIGg3viG8SiqnhUmux/TyXqoAjIgHukKbr97PqUh8dB9LyS1\nyT6eD1IhgMbo0Zy268g+NVhl4x0NfKSr9Ly0gQ3f6MyMyRC8S2mqNJ25CqjI\nN7JF9GHwQ9olKATq1JR//5Z5DRhgwMOgZTQ84Rgo1Zm812j+ZcOPdQ6bRSlR\nQZy8+kawokkj19iH9CLq0RVn/AmMQXAC1h4mDHNLXi0ZRFcVvxX7RA2jatsl\n19eyPTDedNaDNrgjqxBNbAJd0wnttO58jD0ZCJdkxzTo3n/K+RWB7ZuCrEVz\nH6YzC0IqBoh8sR+QpVyLKF6qIC8lqnPg1dybRNGPeif5dcTtRiv1koruTe+5\nbfR0+/AEOOCUwpJi0UOX2EhpFY+qY3PVyR7xvZpWzQ/9OlbqhdqKEZDAhHu+\nNNEo/vuU0oC5Mh4k3IUoA/BM8A04NMnEQBiNw/yXChsQDKArj4V0s9OEPRKN\nfyAFVXQ+y/20ujw4Ae6c19+JdTMF3nK6TVs3mJspjwihmx/pAGRJxAxZe6K/\naf2UB7OjsK8IyeV1VgB1IRt13hkCVrAIP83lTS4zWEjb5oN95MYPbRO4nFsi\nPa8C7fXgAUp8oyczJ3KgWIxhUyhsgKJz27Udry/Aw433WHV2Hp5QCnH9Bpr1\nMtJ/\r\n=2Q80\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"ae010eec116ad324d7e442d7ffac5c8ddcb9edf6","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.d923db73a.0","@material/rtl":"12.0.0-canary.d923db73a.0","@material/base":"12.0.0-canary.d923db73a.0","@material/theme":"12.0.0-canary.d923db73a.0","@material/ripple":"12.0.0-canary.d923db73a.0","@material/animation":"12.0.0-canary.d923db73a.0","@material/elevation":"12.0.0-canary.d923db73a.0","@material/typography":"12.0.0-canary.d923db73a.0","@material/feature-targeting":"12.0.0-canary.d923db73a.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_12.0.0-canary.d923db73a.0_1626209655187_0.3402856139511954","host":"s3://npm-registry-packages"}},"12.0.0-canary.22d29cbb4.0":{"name":"@material/slider","version":"12.0.0-canary.22d29cbb4.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@12.0.0-canary.22d29cbb4.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"288c1add81f57af77af80f9fe03904ac8ece6ff9","tarball":"https://registry.npmjs.org/@material/slider/-/slider-12.0.0-canary.22d29cbb4.0.tgz","fileCount":38,"integrity":"sha512-c/bu2ByCv1nBT06yogPDf0iy/gh2fnhREAdNtTG6QzhxUaDplglsVh4IO0cRYA0Mu6fUZ1BLflFNZlHL+nX1TQ==","signatures":[{"sig":"MEUCIH/F5FmYIe1I0ClseFE25ACDnkJ2lSs+40/Znek/cfQHAiEAzDYHLqIkb1vTx+FsRx6zJrX6E2Hg9DsoPPyDOrln9JY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":870552,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg7hjLCRA9TVsSAnZWagAABqgP+QEneE84y1Pt8/0egYaU\n76cBW3uIg0w/+Vq8v7NHDaxS+kAfbvKFZlaBslobofr/3dErp438cvjYhXCt\nKO9+B5tSurfsPEkX5RPcNrGCLBLSKtvtayFEILYNRXOlrpl1sj9F6IlPQB6m\nv2R+bLkmhzT254bMaqtQXNdCyVTCp3eG0e6zQC76PRjG2yNvZ7lGjN6xO5pl\nStxcYpLcDs2WMvtsoDhstVY/Ym5RsGnGJteiLsV2KXLey4uSl0U1sI9ytaAK\nja/n4wnYlx4ji0daVW/lc2TScXzGdrtFtBwlDca83PWjh9NByGEgBQ0KrUZT\n/gAVJYhxIaXTEW7Ga/1PatBEk1j/TaiAz8i4OX6aUXtQS8eaIDuwCwc3Jsn0\n7+tjgLP9EUXSxxinIKqtDLTszV0VgE4qrqsPc0BvKjJgF17b4XlJLgyWfR4T\ntZIUk5FfZjbm117W3gQWNbGY1PJyn1A5r5CUL5vVDQJSHKtY5vHZ0oMsSnnK\n+sN7UAxdVhnUmK3VI/IM05uKYB4TMPv5U5B+WKNV06n5W9f1ZseAWo4yBdQ8\nI9hx2WOzQYmCa8QSW/4QqNObv5STHPwcIsIfCGQ5kKJELJftO0oZQ6iuRAPw\n8vOLzFRap+x2+eKsePaDprTYLJgd0zzf+1H0mGvluNsdYo2g/FaTc18I6V8W\nHwxe\r\n=JDgN\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"b37054450964af349924b81bae43ec6b3beb2808","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.22d29cbb4.0","@material/rtl":"12.0.0-canary.22d29cbb4.0","@material/base":"12.0.0-canary.22d29cbb4.0","@material/theme":"12.0.0-canary.22d29cbb4.0","@material/ripple":"12.0.0-canary.22d29cbb4.0","@material/animation":"12.0.0-canary.22d29cbb4.0","@material/elevation":"12.0.0-canary.22d29cbb4.0","@material/typography":"12.0.0-canary.22d29cbb4.0","@material/feature-targeting":"12.0.0-canary.22d29cbb4.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_12.0.0-canary.22d29cbb4.0_1626216651366_0.59785753414018","host":"s3://npm-registry-packages"}},"12.0.0-canary.2749604bc.0":{"name":"@material/slider","version":"12.0.0-canary.2749604bc.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@12.0.0-canary.2749604bc.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"3cce60e0075f593f78de718596cce19ef455bb60","tarball":"https://registry.npmjs.org/@material/slider/-/slider-12.0.0-canary.2749604bc.0.tgz","fileCount":38,"integrity":"sha512-fdeVIkiVOCpbggzA0oqFIZ6yU63VN15cgj5ZV7t/OVU58VAmvyl85NQkaSsjQfdN/Wq4BxjhdgfpCik9++GiPQ==","signatures":[{"sig":"MEQCIEyUD/9vzezrXR0vodvDgfv560usERSelNHr28JRGvNeAiAanscHvOYOvDDM5S92K5pf7tVrsI0Tup5GWtx3UbXaHw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":870614,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg7w9WCRA9TVsSAnZWagAAbNwP/2m8vyMJtuHIA9JfVd5F\nkK8zw7hY1BdR5i+6tHhj9Jny7kyn0XFR7hua2OEM+pMSHbtZNT47HYde5Iw0\ngrX3YyaAGLkge40CDdDfxMM/ERqK/3djpnuE14RcgJZut/O6UT0yKCXL/1h/\nva+2mZNQazIw7UmoK2NahtlWlKGxwz08vXJCjpJ6bE5OB3mhF1vcmA5/fINf\n8nno6PrEldfwEelBn+ARj/8O1WRaa39ITIlbtnqFk78ZCMSydsE7aUmxL/0C\ngBvWv85fZwjCqdW0r8SFUe5egXeUWwgNG8T6F2Q9orE5kctp2sWlRYrUPX5e\n9g+06JZ05hgby+rJvoHdYEEY9sEi6k4ddYW6/apKJKKtaQQxH48EoBQCQJfv\n9uH9QfsCHUxFPoOxtSBd72ReHHq/3hKKDe6xVt0qH/1YvjHKK+DKamlB3dmh\nVu/t5kDmg1y9HDUrr9YWoQsQudBK2TP5gSjZvHj3925GezoF1M9CG2Qk0Whv\nbnb8el/iAFuGiAglQvkajJMoxjWyr75uClfgj6zQM3Dr6uU4EW94dugrhMZ0\nSpso0LL2xkJFx8Lfg+k5jyqBQHTT9+jCOUQ4qp4KnX5pcAvVu7PL5VuClbGG\n2fi6eVAdiUJa7tHAwtg1cGwpQXIVZUuA1sTVPl55bjVJirJiiNsYlfyBwTPI\nloAU\r\n=yBeP\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"58ae4287239fcccbe4c5dd9259164a0660c76f85","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.2749604bc.0","@material/rtl":"12.0.0-canary.2749604bc.0","@material/base":"12.0.0-canary.2749604bc.0","@material/theme":"12.0.0-canary.2749604bc.0","@material/ripple":"12.0.0-canary.2749604bc.0","@material/animation":"12.0.0-canary.2749604bc.0","@material/elevation":"12.0.0-canary.2749604bc.0","@material/typography":"12.0.0-canary.2749604bc.0","@material/feature-targeting":"12.0.0-canary.2749604bc.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_12.0.0-canary.2749604bc.0_1626279766141_0.8552260707645496","host":"s3://npm-registry-packages"}},"12.0.0-canary.e1703bed9.0":{"name":"@material/slider","version":"12.0.0-canary.e1703bed9.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@12.0.0-canary.e1703bed9.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"82ee5cd12e5fc6ee9fe35608cbb767d9777028f7","tarball":"https://registry.npmjs.org/@material/slider/-/slider-12.0.0-canary.e1703bed9.0.tgz","fileCount":38,"integrity":"sha512-Oz27o6mYMk+FVtGuSYDbmJJLSlDoz6jMxMq9ES4rqsLK5pdoVVR6qahWjkxQHsHLn7iY6habPNuVMpFxsBLfaw==","signatures":[{"sig":"MEUCIQCNsiPqcgEtUhqjOLUqSIo+qJ1xKMaEgWIvTTsVkNYYTQIgWcucaRBKBtFJf1TFhRYOrTolFqnYLCUqIuZ1rS7XW9Q=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":873094,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg71uqCRA9TVsSAnZWagAAnVgQAJSIMSThGOYlFavvDTlo\nUbRaqK3A2KwPfgxQQspABak3wPFxS2uoU/q7740zprJuPymLZnLMwRUIrikU\nSv3U/AanZvZVkH3KBmnZ7X5Bgmx1XpesYc7xaLuj4IHl2YHi2Gj+irGYztk+\ntzcDmTkqdVVzHGhpWOpXCM6iK8cn+uzB0MaJ4eF2WJdw1gMVf886FFV/A65p\n7rl3c/Sn2tZzgZMR+P4YCeFrNZuPH7mRTs5fYKu2rpzMi4UaLVlT7fL5MBNZ\nNtj5933jeCqL3us86q9dLlS7U08Xxps1aoW1OP+JH2qpNAGFuFhiqXvqCQoA\n5BiEi6emF8wmiWuajoxAytlzEM6E5VQeRngJ/37zpSS/Pfy34AiOwR3XjUzT\nY1ZhTw/tLQkNPQw3yKDhap9/b8cWJZWckZlP/AQRjTK8qOv606NfRjl3UFrw\nNqge1uIj30tgLBwJtFNyrMYI6ZQ6Ji4zqNT9F5VTaHzjDNCuTfny1fT9JEzG\n0pC8nxczh0xFuXgJava9RkGT6T0BnqgibmciSDTlVprCu4RcPqLoFpDMJTKC\njNJD/PmXIQnlKdngrJjI6wXoZEcnXitlx0FJZAgKCZxjh2KF4hvbYthvyVUL\nfLawzIpNR6ZF6Fvpra894h0Tu6Opwk0DmmLzFCrLeL+b6eRWq8l3+tUIwanq\nSW9+\r\n=GP07\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"ca9075f939dcacc82290fe2b01214639958bde93","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.e1703bed9.0","@material/rtl":"12.0.0-canary.e1703bed9.0","@material/base":"12.0.0-canary.e1703bed9.0","@material/theme":"12.0.0-canary.e1703bed9.0","@material/ripple":"12.0.0-canary.e1703bed9.0","@material/animation":"12.0.0-canary.e1703bed9.0","@material/elevation":"12.0.0-canary.e1703bed9.0","@material/typography":"12.0.0-canary.e1703bed9.0","@material/feature-targeting":"12.0.0-canary.e1703bed9.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_12.0.0-canary.e1703bed9.0_1626299305766_0.66524318138375","host":"s3://npm-registry-packages"}},"12.0.0-canary.de48eff0d.0":{"name":"@material/slider","version":"12.0.0-canary.de48eff0d.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@12.0.0-canary.de48eff0d.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"ddb8d2894854886b78fcf8c2bf7c0b5e581bd182","tarball":"https://registry.npmjs.org/@material/slider/-/slider-12.0.0-canary.de48eff0d.0.tgz","fileCount":38,"integrity":"sha512-OJvv1kppU52wH+Oo/e3aHvRclfHITP5omvgs5/t5wEFXdj/KuMWZBZvKpWVMM9OXCe3jFpDpnIxQcJ3MGuxZLQ==","signatures":[{"sig":"MEUCIQD+7atlUakwawD37ItJCkl4Weolzlmcq5cXFWFiOF9F+wIgDL5mNuJ16YFDn4h4zvu/VqbQ/Nrir4Ush7SAn5HWfIU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":871460,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg8GuLCRA9TVsSAnZWagAAD3MP/iFaxle1NrKdEL2sIuje\nwApSAW/w8BmVj8hD5kv8gL9/btN9szeXDZYu+QmMvQc6J9EI+mqwMCZao9qB\nX9P31GKPxjh1qUWT1RuhsVKL0m/xOwaIZ5HYzR/qdOSjK3IkIXBkXy3kYlUb\nfRvPVGj6POl63lQg8Ghpw2VCNk6P+oy3tf31jbjxZ2kfAaJMTMW2D7ySpdlZ\n9mmfaP7HpuiRYVEK/PWBj5s08T762jtiGcZmFrScIjeYOSHDw21AonGkcWMr\nN5YNpMCNhJ0P92dHaYEc3UGl4pNQ0G4LGBF4pmCz/31yq8QwV1jDKTbsqzre\ns8WfD6yyuNTXYD0dPGYlZIDioQkxS79H2knPc6h8AX3ynSUD7YKMY0z1O0P0\njeas75Htrab2MzaDBYUHxOxdmc6rDTSU77mi0fw7TaADWjy899HHtD17MLQR\ngS9J3wWnhA79XoW2rZX5hDTA2P9iQIiO9z8w300WNTXDYt+T+7aMk8zb3A3X\niFVqWi+0JdXanY0FAeawzucy4/Pe1mxCG71uWxqG9QEyMA8S3U3djKz9mESv\nvVPow/EA3HhpxepohYwS5lz5tiiWDYYjeOLP/kP4mk3TwbNwI1cz6l3n5kiS\n2hAUMeNGYFjVIqGSZ+/09Q99CMxhdJmjOpuixQ/bOfLP6fE1J/UyIZyjphOP\n9FMy\r\n=sauN\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"121530dfc073c7b24dc1cb75732a0d4c0e6a3f28","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.de48eff0d.0","@material/rtl":"12.0.0-canary.de48eff0d.0","@material/base":"12.0.0-canary.de48eff0d.0","@material/theme":"12.0.0-canary.de48eff0d.0","@material/ripple":"12.0.0-canary.de48eff0d.0","@material/animation":"12.0.0-canary.de48eff0d.0","@material/elevation":"12.0.0-canary.de48eff0d.0","@material/typography":"12.0.0-canary.de48eff0d.0","@material/feature-targeting":"12.0.0-canary.de48eff0d.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_12.0.0-canary.de48eff0d.0_1626368907021_0.6717146560402745","host":"s3://npm-registry-packages"}},"12.0.0-canary.4f060adc5.0":{"name":"@material/slider","version":"12.0.0-canary.4f060adc5.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@12.0.0-canary.4f060adc5.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"20727474da2b4c25acaa93fdb1d78d194ce2c31f","tarball":"https://registry.npmjs.org/@material/slider/-/slider-12.0.0-canary.4f060adc5.0.tgz","fileCount":38,"integrity":"sha512-yoamv6NZl22r+n4czz1dQSxYGvoYeuTt7+H2GIM/xFNsDf+L5/n0NEFXUmjbw0JhSq/vmwzFw88BHfpLgIWzYg==","signatures":[{"sig":"MEQCIAyyYE6pj09uD71E6ns8MzCiYfGOaxw1uMgRS2dlY2weAiAsdyH2b149bZfurUH8vtrFW5/JMMRWzD1R3fn8ADxtOQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":871476,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg8IrkCRA9TVsSAnZWagAA8jIP/ArJTwCjYo9PjRn0Rcnr\n5ULE1T89kR/ubvxiFeISE4IMmPGvE+wQLkRizl8GlvPYjzoHH52pPs6TpF88\noYMIRtMfsL3YO/Zw3JPsdJ5rt+mMKaqun1UDpP7qx8GFNQkQR/q11DXuGbRt\n+yqlWtQleVWgIv7a6icrU27+8V5//LZ0b+WOmysyenLOx4UbpW2QLHwlVTgk\nbOVu8LJupHNESx0qDtnHIXNSFa1Ve+dVWqujZVo7oOG5yWOM07LXhKsj+lAC\n2/uwyP6G53uTln+ON7VigpJeA3PU810C52i5t2bf0LKaA8J+ryc3tJLjKjkF\nBJmx1ZtovO72BOyIn5EyXMihmgop0Oo5n1DcW+MOcuPgko/b9IlB+AThNdgc\npKcrpy88SMLcawJnXQELS41juqPOeQ6tJAQgWmi1S7fOoZkAVdOHoP0FWsv1\nYiL5McwCJpB+n5w4T+yXSWT1TDQpMayJyfNHYWMwbp9Y404tlytnT0ekofy2\ndfG+GnVBmgaKanGgSf6dLWt9wmEezwJ+a77ZcXSLyKOZBc65jfo2eVZj30Tv\n8V9CYOadyr0fC279Z1jh4rh1pbcNVocM84L5x47v84b9uafys6a8KOAoRJaS\nChc/PzYevaWdoWQxqhkmIsA+R6K85dDfxuUdB76mxBqKBam5zCQTad7fcUR1\nLWgf\r\n=Hbxt\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"2e70b8cd653f195a01f93c3e9928feabf39fa87e","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.4f060adc5.0","@material/rtl":"12.0.0-canary.4f060adc5.0","@material/base":"12.0.0-canary.4f060adc5.0","@material/theme":"12.0.0-canary.4f060adc5.0","@material/ripple":"12.0.0-canary.4f060adc5.0","@material/animation":"12.0.0-canary.4f060adc5.0","@material/elevation":"12.0.0-canary.4f060adc5.0","@material/typography":"12.0.0-canary.4f060adc5.0","@material/feature-targeting":"12.0.0-canary.4f060adc5.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_12.0.0-canary.4f060adc5.0_1626376932570_0.6541503554756705","host":"s3://npm-registry-packages"}},"12.0.0-canary.bd25779b2.0":{"name":"@material/slider","version":"12.0.0-canary.bd25779b2.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@12.0.0-canary.bd25779b2.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"f4c75a58433179b0071adfd15766e65f2223d25f","tarball":"https://registry.npmjs.org/@material/slider/-/slider-12.0.0-canary.bd25779b2.0.tgz","fileCount":38,"integrity":"sha512-EV9jmquaRd+dHykAIZYxXqo1HDw6stL2G+PFcz/a9zBXZdDXxzKpxffbJNSrzrqXUZORUKkzB8Oum0VRV7REgQ==","signatures":[{"sig":"MEYCIQCO2C1V5uLgBp2vqcMnV7gyoiNslGt+/+l223jNAEnumgIhAIDC9p/DFLWR2dUzziwm8C00UrYEg1Ek/znPvrZTIrZ5","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":871476,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg8J2+CRA9TVsSAnZWagAAF0MP/RmsVGVzBTf9ItqYQw3T\nv5gx/pNGkMkQx1il7x5rC75fH4ESwqY2SqhBKbZg6rESM9z2taMzRuWPn99h\nZE+133A9kNFJmAEiAiw/x6jCqg60GhDA8cdEmtcW77CekHhjZ92KWuAySnh/\nYvpup7wYjjVkS25dAuVLeXOS3uOPjg+GYL7u7W0n4v1132jcEPQzZGUScxAD\nU8DjIhtXZddJo2Udutlhyo41uYjaU5lETfoN1Fso8Hq8mawqYLYk3fh6eA1o\nmrreWG13mAQxqj6iBA7zkgBNn5EeQaUwqdjWm6bFvgiQns5sazvqh44UltnW\n/bk/EOnXpCv3qmq/3UONiORJJZ38vGDWhKrx2T7v+P6PasPrx2g/PdDBojni\nXjuU4zAdW57k/iA2AsLRTdpgXbmhntnejnVI7RlcVqmLgC71+6Cp3PVreV42\nJdrX6cwx8DYcc6oRGzzRJLwggmTfvyqRx5ympF0oE9qdEpvunXTghvLHf2tu\nLWjJGt/DkNbcqMSQ+v+WZwPlWZPZwRVtuu5y0SFg7I2A9ykBrb+iDdqUU1Hb\nx0o/DrVM/v+JGKWBf3Rs+YqwXNF6T55w3kDzvOabQZc0tDaNf9LYH2WxgRCb\nu6J2f/HuthMAjlsnKcny78zJn68dZ6RoVLpCF6Lq3oZqRXxe+Ps4axe6zDu5\nrOZ/\r\n=oxIt\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"3ea8422325f9bc5f9a356842191da47e282aa4dd","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.bd25779b2.0","@material/rtl":"12.0.0-canary.bd25779b2.0","@material/base":"12.0.0-canary.bd25779b2.0","@material/theme":"12.0.0-canary.bd25779b2.0","@material/ripple":"12.0.0-canary.bd25779b2.0","@material/animation":"12.0.0-canary.bd25779b2.0","@material/elevation":"12.0.0-canary.bd25779b2.0","@material/typography":"12.0.0-canary.bd25779b2.0","@material/feature-targeting":"12.0.0-canary.bd25779b2.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_12.0.0-canary.bd25779b2.0_1626381758653_0.7146817559650367","host":"s3://npm-registry-packages"}},"12.0.0-canary.9f68a932e.0":{"name":"@material/slider","version":"12.0.0-canary.9f68a932e.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@12.0.0-canary.9f68a932e.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"a6bba33e05c29fb08b2446211c68244f1a664f9f","tarball":"https://registry.npmjs.org/@material/slider/-/slider-12.0.0-canary.9f68a932e.0.tgz","fileCount":38,"integrity":"sha512-PeUp/kIY1sWjpOPeF/fyWzdEQQ6BUMgqwOpNFO6uZcjBModtw5dwSF0ErOFkCJTQ/Mlb/axZqezMDs+fNjeM/g==","signatures":[{"sig":"MEUCIAn7K8+d+2ji4yKPF0B3cFlOg8CZc9lneq/1A5MPK/RrAiEA+7kB+wwc0Zu4GeHp6nDyGlefjC4cYRpEa7ab5DKJiFg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":871476,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg8LGiCRA9TVsSAnZWagAAGY4P/R+a7BW05gcfEBKmqfhT\nLGGDkMhK6bLplgGaiXNq08UYtiwblZ//t5zsTfy/3tA2j85oLfGruVTq8RwT\nY/XrhRVuF7/fVHQ5DIm7qBShFK5N1ffH8mRDCuy0/FhA/yB+NMdzJkLiB5Jo\n54CQCEVwWxMrXeajHNWlOyeUYkVXoZ2YRNOrSb6LrxAnWPOHyGBc7c82Od4W\nx+Kbg9WBxsNjah20wIZF/nbukesnAKXlor5/nwyp0KLLEImvDOO6R+um49NE\n8RKn8HIRGhRuAng2elg0PLSyn+oqhHqE+VHG/4qxQpHXNsei3VJ+5OafC7oO\nt6CAfrAPpBobCvJDWlgs0BQgIU4yCuBYf2S8bcRkgOItNv234cOgbVxPhWhi\nu2+MU7VLpuqJHWAB77+EzVVVh8EUWUIYjVahgVIKyZ7egGDSQdyiO/3FiiIG\nr37IkrNYY1IU4ehm/MUHIUg/nE9TzM7zaDH2UVtN7hXxtrMP8SXsyt8Azpvd\nGbN33vpPFD95MN+UPUpPjIuNmDT1TWBJ6qefgGNxdRkEUeM9/kfOe2TfehSN\nEfezK1oNu88BCzG5a0nL47pNwtXdXdABAPrvN8+wEtR/RQa73kg0j2dy0BT0\nxaUYei0XSasc95GpUETnTERTK/4z295EuZE5uSGO/cQTJ7u6KWd1m2cl+ufp\nruX3\r\n=qZ/w\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"34b4e5801eaff79707e9f2c769df2c1a34bbdb11","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.9f68a932e.0","@material/rtl":"12.0.0-canary.9f68a932e.0","@material/base":"12.0.0-canary.9f68a932e.0","@material/theme":"12.0.0-canary.9f68a932e.0","@material/ripple":"12.0.0-canary.9f68a932e.0","@material/animation":"12.0.0-canary.9f68a932e.0","@material/elevation":"12.0.0-canary.9f68a932e.0","@material/typography":"12.0.0-canary.9f68a932e.0","@material/feature-targeting":"12.0.0-canary.9f68a932e.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_12.0.0-canary.9f68a932e.0_1626386850197_0.3093662056036066","host":"s3://npm-registry-packages"}},"12.0.0-canary.4eecdeaf0.0":{"name":"@material/slider","version":"12.0.0-canary.4eecdeaf0.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@12.0.0-canary.4eecdeaf0.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"836c4a056ab16ffc83fb82db2f458ba648f8d475","tarball":"https://registry.npmjs.org/@material/slider/-/slider-12.0.0-canary.4eecdeaf0.0.tgz","fileCount":38,"integrity":"sha512-qYxOi/6NEysYZ5+waq1dDnDlOpSA0D9lv9BV2hDhSxbGq+5WNO15ysA2mJiE+PIR/lqNv+QWAZfb5pPHqBOXDQ==","signatures":[{"sig":"MEQCIE7iWyJsvZcaNgm3lWipZ2N2TFF2zpbIHQmWoGw330fyAiApv/3qRzO63JgcILmTDNg4b9HGS8OR1+xRtMtKgUrWVQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":871476,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg8Z6ICRA9TVsSAnZWagAAlb4P/2n9jM6e5yeJzoldILRe\nTE0oNR17HPMzwd+TyKUTT8lOKCosHRYOhU6bBirFViZkevLf4c1r9xhqGksv\nAfB721nv77r1oNdEKBsuFh49blrVFb0Fb6yd9qO2cNZwNdYitWj9guZUaMYx\n/fIOtuJZLfvnEOiUwleLqkSRco5UHOWMuOE0wVTvROqLeahutGGzOz6P2Kev\nBC6y5MmyWR2/Jq522nkC755WltXsBsmtFtjqkmFppYN0OfD3R4Gjd8zETXbY\n9KXweO6G8lgtXSRzxRBvXcLNXKvusFfq6eU0wXRDiGJULTsA2lX3r4v2HLgH\nDp6fvusOIS/5OvbIXAyFOHbiJXSnsj/mTtPZ3nhvRrFq5x9B/QStFjr4O1gC\nEfV8AC96gjl4uqirdSBH/06u0rzou1f4NoWDmYkK5lTB8JDapzDSG+yoan0h\nxiDEk2K+oegrNSMiHl/x9YeN83aKQC6GEkEMIgIglsoZjbQQWadwl9BqxPAP\n60MSqeSsosgqqV/zBqkRhNQZF+X6fZRx2sDhdIrVpE425cjMKfIG/ikK/2FL\nO8GruAXf4Qsotj9/BkbeoD3rAR3gfYmtod57ppcYuWQRxbKg60e0KoGKjjwv\ndocDhbpADS0oJ4oja68K9CeWmbDTbuibXv+e4e3K+/+Orc5M8oei64biN4Hj\nmBcL\r\n=Ni0z\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"89a3faf78d32cadbed38135c9ae10ab1f3c8e9a6","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.4eecdeaf0.0","@material/rtl":"12.0.0-canary.4eecdeaf0.0","@material/base":"12.0.0-canary.4eecdeaf0.0","@material/theme":"12.0.0-canary.4eecdeaf0.0","@material/ripple":"12.0.0-canary.4eecdeaf0.0","@material/animation":"12.0.0-canary.4eecdeaf0.0","@material/elevation":"12.0.0-canary.4eecdeaf0.0","@material/typography":"12.0.0-canary.4eecdeaf0.0","@material/feature-targeting":"12.0.0-canary.4eecdeaf0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_12.0.0-canary.4eecdeaf0.0_1626447496261_0.41804915761106676","host":"s3://npm-registry-packages"}},"12.0.0-canary.7239684d4.0":{"name":"@material/slider","version":"12.0.0-canary.7239684d4.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@12.0.0-canary.7239684d4.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"3ca4ad6aa3b4347ffbc8017238003fe261bbc74a","tarball":"https://registry.npmjs.org/@material/slider/-/slider-12.0.0-canary.7239684d4.0.tgz","fileCount":38,"integrity":"sha512-0ALp/PtmqIjLbiq6PB03bWpRSqVHAynwkd+kwqitjpTow86Ohq9Zde1xbFtZtuFH8GbMFuWdjLlgMZZru0gtcA==","signatures":[{"sig":"MEUCIFyw9D/SU4NwOgLK8YtM1MYicRdN+cmo6hYpTjfVSGxkAiEAi0z8ZNJpehuAFagNMYhsXj6cyqRMk9n8l8i89AEfP/I=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":871476,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg8azgCRA9TVsSAnZWagAABPAP/3+Ya89Q7WjtDKFJTw0s\nf5rSS7vmsCiPJUesuPL94izes6ITrqGjBSWPJo/E3iNElKiCucaz38NuAmKy\nEWz+fvVHxFd7VPYgaaBGNzthjwZJ61XfyLJEE9/aTIa3lrP2zw88YamzkeeZ\nu33Uyz2pCwpl5y3Gc8O1g6iLjLOGv4NMRS0hN63gX1z+6l4MdAPb6+iw1K5r\n7Wj02Fr5FUPBDqTlhNqp7cOTpaxYiFtgEbR7Oh0zpJm3tOLRSP5yjqPBt6le\nwSDtbwFEDnqQRM18b4aWiTsd/u+pLyOcAgtEOjDhZ4P0Nq2fmj7K+aE+5ysC\nsHVwxZHeSxP3VvhNkOwobzxDwA9Xtb70PUKZDrh+OjO5+TrEboS9ZSHn7WvL\n1lFvnnGJquPrvZ3/iaWhyBHpjzrlxI8GEXO7rakZN4tF/K2/iXgx/fwXQW/q\n32n373i7a6KBY0BPF8vcG2n4YdemedolsQxX9Uy6+lBnZCLNUmlTzvY4OjFv\nObRxSR/+tiamFE3kVimz8sypQHkVPA00LkAHSxomBlQebgpCEtUCxBn1tRoh\n/0Qytdx2ih7PAZNLBldWp75zrbOObrBey1uiXORcKTQn8pxtVI6+Penh/7QC\n1/3ipthag5ewPxtnGME/vPiSPxSX5A69gudkClPM2oPiJLxKITY5GROMRkU9\nmZ8N\r\n=BQyD\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"4b35543a488bb22a0855f6f0d00b047fa76bd623","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.7239684d4.0","@material/rtl":"12.0.0-canary.7239684d4.0","@material/base":"12.0.0-canary.7239684d4.0","@material/theme":"12.0.0-canary.7239684d4.0","@material/ripple":"12.0.0-canary.7239684d4.0","@material/animation":"12.0.0-canary.7239684d4.0","@material/elevation":"12.0.0-canary.7239684d4.0","@material/typography":"12.0.0-canary.7239684d4.0","@material/feature-targeting":"12.0.0-canary.7239684d4.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_12.0.0-canary.7239684d4.0_1626451168864_0.9633735002403425","host":"s3://npm-registry-packages"}},"12.0.0-canary.d5f1f7c72.0":{"name":"@material/slider","version":"12.0.0-canary.d5f1f7c72.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@12.0.0-canary.d5f1f7c72.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"ec0da86fb5b33140a6ee5e47c9df564afd4efd96","tarball":"https://registry.npmjs.org/@material/slider/-/slider-12.0.0-canary.d5f1f7c72.0.tgz","fileCount":38,"integrity":"sha512-/FTw2mQBf9b9hOnjchPunM3xCXTMIgOXeb1MDnBIuz7pX6H2Juusyn8yMtOGr38OFMfl52JjuU2L2JbhgBa4Kg==","signatures":[{"sig":"MEUCIAsgCPYaMXNMGsyg/euXrCna7TVaHDZQn3wbYWVeYXi6AiEA47QmFDR9kM7FB/Fkd2acNsbs6DCkfQpcUHWY8kQfRU0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":871476,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg8bBdCRA9TVsSAnZWagAADiYP/1bTWWg/noZ6yOyQz4Vc\nGGnMIlFGz8BlyG4wIRD6wsZo/JheNZEsADej1FDdi4K6ftyn1CCsJYSzOeWs\nzQLBXjABze5+1ovTcsWtltYVmtj6aH/S5yY8Z3YIcss3ea5OCf9vmkp+cLC+\njw1BM1TDk9Gq0nbNW5nxClvMMKjtdpr21wljOOoV3we+R7kRKoAsstKV6mfK\nI4+wF5WgTaoPGpXuoLBhfUqjNNhu+WPkdLtRdVAisCVYlxRmbRJ9o3a4tHbD\nm9wQpW3FdV+rx+N7hvlRcBpXLZmqW7HZvMU+oCceyX5kcul3ky+PyLSrescH\nvuDffxnZLqX5huaehkpFl4swCf7uCGwFB+VxAQCPyUfsuexesF1qq1qBH56I\n6jQ3HNsr+HxggvQM8rAhFe0RNl9Z83E4aeqRpxMnUcDeqlXCZdCwcfXBnPPC\neMwApoD2eOyhF/y2WHPlajOqlorjAb3PEl1nDfrwzbgQWoLHWqmns5H5bHem\n5839SUlMiMYuzV73+owHe+WlabnBW0RUKKo2TuwDrvIvhrKZQZHkPBpzMA87\nsfAiF1C4S/ZaIuXEYQCfCDZduE0cw70sDyVK3gyma6P25aDU3G4PqKF5D316\nQY6AK7Yv9lduobJj+b++QY2pjU1FLmDiLbIrOnVGUb2loVqrFJ3HzSs/30Og\ni8Eh\r\n=ttBP\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"ef327d93f5a591e88ce5af94a2bb181d97b58472","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.d5f1f7c72.0","@material/rtl":"12.0.0-canary.d5f1f7c72.0","@material/base":"12.0.0-canary.d5f1f7c72.0","@material/theme":"12.0.0-canary.d5f1f7c72.0","@material/ripple":"12.0.0-canary.d5f1f7c72.0","@material/animation":"12.0.0-canary.d5f1f7c72.0","@material/elevation":"12.0.0-canary.d5f1f7c72.0","@material/typography":"12.0.0-canary.d5f1f7c72.0","@material/feature-targeting":"12.0.0-canary.d5f1f7c72.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_12.0.0-canary.d5f1f7c72.0_1626452061376_0.5034882631019792","host":"s3://npm-registry-packages"}},"12.0.0-canary.4d95812f9.0":{"name":"@material/slider","version":"12.0.0-canary.4d95812f9.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@12.0.0-canary.4d95812f9.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"d5b84db1d1c782544ea2a18db31182e08e8f15a7","tarball":"https://registry.npmjs.org/@material/slider/-/slider-12.0.0-canary.4d95812f9.0.tgz","fileCount":38,"integrity":"sha512-5wyKs8WaEuFLQbhod7axfC4P3NAHbnYAkggo7EYITqkgJZ0lgISGQeSqblSKEhxixzw/fnKk7+k/cGI+V79hRw==","signatures":[{"sig":"MEYCIQCZuzysLYXfPAJbXtN5ynLKtbICo13nlCnTH9KXDof1ogIhAJeWZhvc1qGKJQ5DcFQnM6uxTlZ9I1a9eykN5qt1WV4V","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":871476,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg8eFfCRA9TVsSAnZWagAAVIAP/R6lXbfc+R3C6vnigVMe\n14HWpDeDwUGEKnixtmQOP4d54XGcSO0X5OUQtQqwpyYMskZ6sBhIJ2S8k91M\nH3bs+kAANKaCp9qrVaCevR2DKHsqDADB+lHLoZ8bE8ngitonLgCeUeJYLfNe\nL+4Fz17yJLD4HZchxoTbeJzOMHQALtNlExculAIC8G9UXfu6I6UNgTpjhyRo\nDDGW84bcjCWrREIVgHuFhVmBc0/lq9FkOK+61LdxkASpY7HUIhhViR0ikn6g\nazfH+M6GpPEVsySTewvc6LVp1VdGHrFDobsXkTayk+4KCDUllY3vMLn0YDF2\nrZNafItjeCyp1r+2ijdmYHDpYyux2AFRVYJ2EyefGmx1upwhGCoQqfptG8DN\nX1hstw6nY5xv+ZOs+NVl1RWr/OfvHPuKUFvv1qpj5Me/RMA0pQC9289zON9Q\nMjAt82yySU9XNNLTTVFlD/W2tvj0Lf2IJCW5Koi9faT4brQilzwi2BR81jqk\nKQxIyDmocKyExgFk+YtfQ09DEQAj8rlLQJgKGI5VyB4SQVXCM9M+fzZ5NDLV\nUdwpQ3lMhqydggWgFBNN9lQ0SQHnTKqwdwLcdijlw7NNkqxqqxINVFxYSE+d\niEy2i2spJnxVQ9aE1Hxim9dktCbp3DfLDpHHOxt+oxm789jOcxruzdfDK1Ou\nqikj\r\n=VFRa\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"34bd44726ccda77331fa29afdc1d5ab7ff0879af","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.4d95812f9.0","@material/rtl":"12.0.0-canary.4d95812f9.0","@material/base":"12.0.0-canary.4d95812f9.0","@material/theme":"12.0.0-canary.4d95812f9.0","@material/ripple":"12.0.0-canary.4d95812f9.0","@material/animation":"12.0.0-canary.4d95812f9.0","@material/elevation":"12.0.0-canary.4d95812f9.0","@material/typography":"12.0.0-canary.4d95812f9.0","@material/feature-targeting":"12.0.0-canary.4d95812f9.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_12.0.0-canary.4d95812f9.0_1626464607550_0.7702282811687045","host":"s3://npm-registry-packages"}},"12.0.0-canary.38d1846cc.0":{"name":"@material/slider","version":"12.0.0-canary.38d1846cc.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@12.0.0-canary.38d1846cc.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"cacac37d4ada8afd7556d94dc5b3b0a845d06d2a","tarball":"https://registry.npmjs.org/@material/slider/-/slider-12.0.0-canary.38d1846cc.0.tgz","fileCount":38,"integrity":"sha512-YGLC+Fu4h9usTQ2C5jzpgXfE++c3Un4jaIBVL9dNr+wp5+JDDjNxJW7iASxkS623taj532w2figBtqYDTWKj7g==","signatures":[{"sig":"MEUCIQDF+QllmZDYdtVd8KEFh0MtlzxuI7CiFvHuRc7Ua0EzmgIgQQdFA9X7p07A6B0/CsX1XnMSX/oC4zbDdfhdGIsr1Uc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":871476,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg9ceLCRA9TVsSAnZWagAAgAkP/2rzLvekGnRcFdPfNfw7\nmvqImipjiZFQFaczLwjfuQAiStP4DWaJ03ElaCu+Tmbxt4+hZ+/DoTtEa+Er\nKC8PO6qmtCNd8PGqiEO+Vbea44wdoa2yFFJC8gdtEFE98Z1irMgHhqQHWSe6\nb32G6JQDPM5yGB4qp+V9yQr7rS7NMd3Vyd9/xiRjFpNBjqXJnXPQHihkkvdq\n/IEWSwu3Rj94dEIZM6c4RXBsBJCQ4tO/KjsZUA3Lo8J+XIVoOclcjlQhNN0B\n0VKxy3oBj56LLhUTSEtttiXcVVrFOSi5AxYRW09sSypPrIZWBT8V+tCpFAQc\nOwmevjbEkE28bzHhmZjt3YgPByoUpcktOVYoZRvKHNVZv2gmJeVyn14jD8No\npi+g4eO+Z1zCswjX5Nq32MW5bF47FqX2aHa7PAxCglGSGoH9Vqgaz3hmm6dn\n2pvC9oWspNMVby9GJmVoNqfbB0Yk6OSDqtmOuENlp1u4vsMmTGg4FI+v4Vd+\n9YxkKpb4NRWqqT6Z/FWyzsl8M5+s1mfA05B/AKucksungG1f0wTvjSnFgFck\n3AEmfuAMUENbHPB3LQf3RGd6BOCquR/MtoCkuZqh5/K3s/nu3pgjarTeBGwR\n1Ul91AhmunlTQNO+w5XrfqZzUL8bttiWBzPDRXjUPWCqxsGJreSZ3u5MQvyC\nvW10\r\n=oCCR\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"77a8b2af56ebd184dae02df9198e75b16f4db385","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.38d1846cc.0","@material/rtl":"12.0.0-canary.38d1846cc.0","@material/base":"12.0.0-canary.38d1846cc.0","@material/theme":"12.0.0-canary.38d1846cc.0","@material/ripple":"12.0.0-canary.38d1846cc.0","@material/animation":"12.0.0-canary.38d1846cc.0","@material/elevation":"12.0.0-canary.38d1846cc.0","@material/typography":"12.0.0-canary.38d1846cc.0","@material/feature-targeting":"12.0.0-canary.38d1846cc.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_12.0.0-canary.38d1846cc.0_1626720139152_0.5914080546098586","host":"s3://npm-registry-packages"}},"12.0.0-canary.3f691eccf.0":{"name":"@material/slider","version":"12.0.0-canary.3f691eccf.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@12.0.0-canary.3f691eccf.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"fa7fafdb3f26b0c421721e23268b78edc43fbe55","tarball":"https://registry.npmjs.org/@material/slider/-/slider-12.0.0-canary.3f691eccf.0.tgz","fileCount":38,"integrity":"sha512-DyhAqX7yg0JiBQy7KdBsdSycCrpjs3j2b++0qtM3GbkavQwSvQGuc5StYvcI+eD0wiS7Mibt5JtEL4Mfywz8Ug==","signatures":[{"sig":"MEQCICFY/YdniA5UMUYnKAVy+Qq4aOZ0yxYmAmhWls9awiMbAiA1FNeXdzH+UoZiH04WxQngzmemMiH6v66WkNR+9QkW1Q==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":871476,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg9vUiCRA9TVsSAnZWagAAMswP/0n0s4jn4h29cVigWHQ4\nEd0LB6N+SFnGdpylnN/z7tUAu4o0b7ceVkR0ln5iowtiO8qqXCm22tVQBJmF\nv/MgRG2u/kdYr49JSqLzZEPZjjMngMWARUFMcjxWqGx3Uwj4hzzZ2Wdh/dt8\neiE+aq7S7oG8HLkI+e/ymXl7CXZL3Hn6+3HFgdHIeHqTX5sLAmIBb2NKDjsa\nk/zStATIpaTw3HcT+qQ45Hcn4Na8SbX6q16bL7LIvObAnmtLBcC/R5B3dgid\nq95QUkAnbY05G96BfI3/Nb9D+DcDNUWL1ZpU56XDeEcMUvmdv/iXWdq8KDqL\ntpH0wPLSFM6G9L+NB+oiA3XWZsHyrLVZwm3jv4Aa0L+kD25fRu6SIEe4Ze2s\n6fVWxEqGLMIJnsqCvYts2tKlKBWS+Yo/WRYXP7BGDas2yfplPyvPWkBL0tZW\nJy74y6QnS8xD112Q93EWP1eVD5PaBWThmUhz/UZrtlQ2G1wn9ALVxnarc5Ua\n+geWDvgy/L30YuuwV9Vi7BV1LNh3EevEZx26Nm1TbLF3qxmxqr2md8hoKKeo\ntNQGPMa+3pKHUhwUl5UyXXqZlja4E1OQ4i9E+Vwliwno5KfUnkOpNdmAx44q\n3T5byt6dAI7lw4JpBgWXwY30eDb56M0if2hPA8xDJnnC/wJ1zMAuaUTuLh48\nqfm/\r\n=7D87\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"58271219b83ef8db16c68153037e69345831b4cf","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.3f691eccf.0","@material/rtl":"12.0.0-canary.3f691eccf.0","@material/base":"12.0.0-canary.3f691eccf.0","@material/theme":"12.0.0-canary.3f691eccf.0","@material/ripple":"12.0.0-canary.3f691eccf.0","@material/animation":"12.0.0-canary.3f691eccf.0","@material/elevation":"12.0.0-canary.3f691eccf.0","@material/typography":"12.0.0-canary.3f691eccf.0","@material/feature-targeting":"12.0.0-canary.3f691eccf.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_12.0.0-canary.3f691eccf.0_1626797345957_0.7696457438383943","host":"s3://npm-registry-packages"}},"12.0.0-canary.ebb5c73bb.0":{"name":"@material/slider","version":"12.0.0-canary.ebb5c73bb.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@12.0.0-canary.ebb5c73bb.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"035aa01e83a8c5279f420df8b6904749ac71fa7b","tarball":"https://registry.npmjs.org/@material/slider/-/slider-12.0.0-canary.ebb5c73bb.0.tgz","fileCount":38,"integrity":"sha512-VLoF8gNVR5t7c1ZPGGCpLIV7y7IwX7WiPnEdxnxeQMsTs1xa++Luw5//DzV/hMSXCzpEUu8r+Yw6xxneRFVaRQ==","signatures":[{"sig":"MEYCIQCX0SuoBCbaGWYb3/3vsAa4ocmDEQeJC+7rtBtO3oRwMQIhAL6nSFegp+DAj3fkSJbBzxMslD+x+auXkH8MEcuQRGGJ","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":871590,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg9wBlCRA9TVsSAnZWagAAftkP/2rUb74EKADvyCbwZdJZ\nqmRGoOtMnZbAD9+hdcprjk7iD1h8Vcl9w1Wa/lR0wxzghb7GaNpmq4RzrF7N\nlwux72wIoEbrO7xo3xZPpX0cVMUv5zYYHsjqs89PjfJLKWdwIB2GIkRBUmw9\nptJhiw1J4cAhLtcExui8koxohgiOh7E0iJCI0/a7IkixPTovG8f4JjFDQQgF\nUqjcv/VIa0H7jtEw4dYqe+Vl6qNjXqCWGZdb3pe+94aDmE6v8CkdMRLfadnu\n9TrSN1ek3HfqFUKgDtn/7MSIBgWgBrY8BRsyYbb1wbp4xQOVPz0875jd+05F\n9SkgmDYrz22A/BQIk/hDCDTG3fsqZZ3LrSDGQ2O3M6ekAH54Kv6IM6c8AeX8\nurT7YL6D+OCflwLR0ysJn3QuffuwHZsWmYuM21ic+338yqIc4K+YSMSz5Abk\nUoFK2SbmQolKLG/3k+id4U3ykVkQLSHkP4DBugku2k65a72TvjiXZquHFJm9\nXiWCdbnK+zLd0/WSgv9EcFhKtwD60Dl8S/vc/kC/iyvNo8enCjqPu1m2muyu\nnDWB9ZkIqDlUvBCTpMYldomZKvduqdvrrCfKxuIltf/eM/eG0hd8JnOgOE86\nMwNKWNq4KCJgni1Baz/s9hnpv2QWG+TqpDu+Zo/rap/X3jQM9YePDWTTj8dr\nDJIn\r\n=8ULd\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"b37a38f7ce62c0d87ebbb4bafa0f1fb02aedb050","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.ebb5c73bb.0","@material/rtl":"12.0.0-canary.ebb5c73bb.0","@material/base":"12.0.0-canary.ebb5c73bb.0","@material/theme":"12.0.0-canary.ebb5c73bb.0","@material/ripple":"12.0.0-canary.ebb5c73bb.0","@material/animation":"12.0.0-canary.ebb5c73bb.0","@material/elevation":"12.0.0-canary.ebb5c73bb.0","@material/typography":"12.0.0-canary.ebb5c73bb.0","@material/feature-targeting":"12.0.0-canary.ebb5c73bb.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_12.0.0-canary.ebb5c73bb.0_1626800229432_0.6637190645648936","host":"s3://npm-registry-packages"}},"12.0.0-nightly.778a0e8a.0":{"name":"@material/slider","version":"12.0.0-nightly.778a0e8a.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@12.0.0-nightly.778a0e8a.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"349ad288cac5e91f01ae8db389fe75b7513cafbb","tarball":"https://registry.npmjs.org/@material/slider/-/slider-12.0.0-nightly.778a0e8a.0.tgz","fileCount":38,"integrity":"sha512-NAgbTK0KkV9ce38IRs8pC6TqYsfg65qNmrN97baZwlD/QC48w6ZGkB0Cn5pAuvB8AKSFS/Fj/zuK6JtbrWZHhA==","signatures":[{"sig":"MEQCICAU2dnt6ZQexMxUh+mmhOcltgy+pnZZ5VZl/f313bhaAiA9GD4cHJJkNipY7ffCWGs5glwTCiaEsf1rPqZrrnbixQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":871479,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg9zqrCRA9TVsSAnZWagAA3YcP/jBmNTC+e9q1aXKV2cFo\nXKg+brWCQfcFmn0PDEIKbBBlCrC1TKVT8Jwd6ggDGK6BnbM0s5C38vyFkGAa\nspTkuOjQFp2kO8t7ns1rj+fqU4uVZSfJX9BKRuwtYHDtYu7DVt3dqQm01Ld5\njBZx0FzBvaeB4xKcbfX1fijDcP2HNhSALV1cfBlQY5yCWuGJHBWOtggQvDxX\n7PsRDFPs5hjOnWM8IQc94C+7I+PUzsZY0AzfVymBs4ToHPUOo9mOalQobsf5\nahTNXrVDKte+BlX8mq/Xzpp8T5i4mwfr8SeIeYLx+C6aImhq4JNs1YwOpfbb\nkqG2+YCadTleqqx8/vzQY28jIczo1nyI5Nf5o+w48KLW6TXxERhJKn2JSIW4\nHdwZg6DvFFMQXnvTrE+S+lo/2lg4JoEeV0iUkzViWsq0ajCPLMY8tXJcVTH+\n7MBAdHochjVvSytplccHfdriCniD/qQnyAk01ISO0sLQaJUk9kfeFC1RN9cq\nz+LTu40jo5h+boUoo14+wXqJuC4BD+2SG1i8KAFqY4Aq7xBwgsALKA2CXBTv\nAZr3eTQDpi/9KFYEmYAMChDq4PvwMGN7rU9ZlGBnx7yduiSVQ6FAys844rQd\nBlrIV18Im0RQ1OkbGpo6Wwzqp/v4+H143x2fP8OBk2rd6EeiI7YwpcyCSL6P\n8DzB\r\n=yX6c\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"d86234d661f09ad766ffa2f82c69582e585a8fdd","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-nightly.778a0e8a.0","@material/rtl":"12.0.0-nightly.778a0e8a.0","@material/base":"12.0.0-nightly.778a0e8a.0","@material/theme":"12.0.0-nightly.778a0e8a.0","@material/ripple":"12.0.0-nightly.778a0e8a.0","@material/animation":"12.0.0-nightly.778a0e8a.0","@material/elevation":"12.0.0-nightly.778a0e8a.0","@material/typography":"12.0.0-nightly.778a0e8a.0","@material/feature-targeting":"12.0.0-nightly.778a0e8a.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_12.0.0-nightly.778a0e8a.0_1626815147386_0.9749203150195698","host":"s3://npm-registry-packages"}},"12.0.0-canary.791311bba.0":{"name":"@material/slider","version":"12.0.0-canary.791311bba.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@12.0.0-canary.791311bba.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"8f4e904f0f78085d21f30781454cd4a878e15b2c","tarball":"https://registry.npmjs.org/@material/slider/-/slider-12.0.0-canary.791311bba.0.tgz","fileCount":38,"integrity":"sha512-0CuAljpxVBddFnDE8SI9cFWldKfzwMsYnYFm73ruVPjvXWDwIftCzDE1znKQpVjbzvIF6V8WMO8GrmGpExRcCQ==","signatures":[{"sig":"MEQCIDihsySYgi/87r16F2ZPeG4QFQehyi5nDMLT/ICK41v6AiBEVgnxpCOLjFF+J1fYZYExgFAKg/rDTabUboHtIQdkrg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":871590,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg90k4CRA9TVsSAnZWagAAVcAP/2Rm41hnuUsiEWRFyg2r\nRAMa3K/Co1XuL/BQCQ3/8vBGskYhx/ECnQpZQUQhIgxSFD+FgFn9OoX84Tkh\nOUGIix1499WT4lE371pehenGB8Yb6ftPk+8RHaG1UYwecA48Ou8aDpj5mZ0j\nnpYavcut1OzL6Ro9rkpA4J7+9PYyxdUmemlfwbLTROTDabJw0jZSubXxEDvI\n6OXofqi4RzV0XjP/xWL7cICSTpdxRMSww2P9z2gbNTZsYVAUGD5inWJEnSpi\npUJqQeoYmOlbeS/pNbzmcL4c1QMGwqhvee77r4whFGcgUUDSPzmLrFxOK5bt\ncC8MrGwKxOOw6rJHqSc74hxzViydeFaV0On1wAB6ElbVYAaYsr6s/+kPr/fb\nvHd29QaNvQNNfS6MYHifUlh2r9wTqqDowmG6SAtYQ8z72MxsHRuZIkIq88Ck\ndbPEbAu5P50sc+g1w9Zxc0Ol8oukc3SjuLLJZbBjNCvdFC4OnGYJe01H46WO\nF4PGIUQFQbKLYD87CefI5jGA83xj0WqTa6xX/G0mnEu8VZc7wgo7jd+TUacL\n2KTIG8lYqEdd6GjNRSfF/CCsUA+VI3IR0WEL1BhojAfR8CpR99PV5teeW4iJ\nwBVi5WGxtHS35nYnErlI84c+DeT4PTAcjgbJRbDEFjSgBCROdSFH3hZZmXvL\n1ouj\r\n=VAa1\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"b915b82632a30b60ae4dca5d12fc23d5a5df4d4a","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.791311bba.0","@material/rtl":"12.0.0-canary.791311bba.0","@material/base":"12.0.0-canary.791311bba.0","@material/theme":"12.0.0-canary.791311bba.0","@material/ripple":"12.0.0-canary.791311bba.0","@material/animation":"12.0.0-canary.791311bba.0","@material/elevation":"12.0.0-canary.791311bba.0","@material/typography":"12.0.0-canary.791311bba.0","@material/feature-targeting":"12.0.0-canary.791311bba.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_12.0.0-canary.791311bba.0_1626818872259_0.3759654416894844","host":"s3://npm-registry-packages"}},"12.0.0-canary.85e9a6ac3.0":{"name":"@material/slider","version":"12.0.0-canary.85e9a6ac3.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@12.0.0-canary.85e9a6ac3.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"f1f90aeb4120a825c0ce045898ef4a5d269b0295","tarball":"https://registry.npmjs.org/@material/slider/-/slider-12.0.0-canary.85e9a6ac3.0.tgz","fileCount":38,"integrity":"sha512-8wq01563YMMSi4doeCIJ7ssAizs0kiFjH4C/lhQ1NwFhloIEf5Y+Dfewq2dxMv2zLgjNur0GUNJd7EyXW+ru+A==","signatures":[{"sig":"MEYCIQDewVn+z6/w9ALEd+akJRyyxzjbMSSZr3KMKlAVfK1BEQIhAOj7xyXWp2Rb4IlPK87dSf+B0Y+xp6r6w6z10zr8PtY0","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":871590,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg+D7wCRA9TVsSAnZWagAAMBEP/04pr2hIMnVQ0tNsPlX2\nd8hE4Tn/+RBdhlZ9lVPpO1n8K0XhkpX4Sr8tkcq3I5mgTC/eyhYuTDZqdapI\nkXXWmfoRI7xrDZVeh2aKFdC7XkSap42iNV07MXNp/+bBlTs/8o1u+cRO6tMf\nqSqfpS9eC/qoYSzFkYM3NeKRH0q7bNzCLUDSNMgNGr93pOQIOEgcBtE9SKMP\nGo9EyQ9GkuD+1s1mF6CbFE80XT7GK7Kipfq0huC2xNenKl1NIVIMn57cUD7e\n2wk2+Qfvo0ujxiZrjoNQsjNb3OEmlllEmSc+vdy3unbzoEcP3lEHysn1Y+Xc\nFZlOi54E44gPz3J+MKUrR4x3n7wegZGS4zzXXc5s0qtH2aIgWHr3yQ7c+fly\ntdwYcIMDo7dXk6fn2vb2ulyT7g2Np3GPQ4JrDXpBUeyHyhdUbZerOV6RSiAI\noLKCOOeGpSq+Dh4m5zNp9ed7q0bKd3sePgZYqGamCevOHzBtbFGSWSid86DU\nfRebZ6sZlGcyJAyx/LXML0+zx6toSzxl+PYdmHXVckemH49Iut90LRyS2lCY\nhB8C2PEb1F36XzVOQZ//I+sh4WrlnqVo/QFvMVIMnx27F/6pY+RoKnTTLztc\nXEXY2vuSu/o+qjCpAVMeB7R8wlTMxiTwp8Xsd8MC07J0/1zqv6AN6IvW6nte\n21xC\r\n=kkI1\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"651354325ad21ac082f791ec2abb0aa32b3ba936","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.85e9a6ac3.0","@material/rtl":"12.0.0-canary.85e9a6ac3.0","@material/base":"12.0.0-canary.85e9a6ac3.0","@material/theme":"12.0.0-canary.85e9a6ac3.0","@material/ripple":"12.0.0-canary.85e9a6ac3.0","@material/animation":"12.0.0-canary.85e9a6ac3.0","@material/elevation":"12.0.0-canary.85e9a6ac3.0","@material/typography":"12.0.0-canary.85e9a6ac3.0","@material/feature-targeting":"12.0.0-canary.85e9a6ac3.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_12.0.0-canary.85e9a6ac3.0_1626881775938_0.21010398601726044","host":"s3://npm-registry-packages"}},"12.0.0-canary.6b0442278.0":{"name":"@material/slider","version":"12.0.0-canary.6b0442278.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@12.0.0-canary.6b0442278.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"3be2ffd2c61d11f3191405c382a7c7bf46eba887","tarball":"https://registry.npmjs.org/@material/slider/-/slider-12.0.0-canary.6b0442278.0.tgz","fileCount":38,"integrity":"sha512-IXXl/mcoFRElYtgdY2EkYTKumrOgDzTMdFN0IRZqqhLqNLt0NroV84V+Qr9Ks9Iu5I4F+rVDRAE6wjW7cAHeKw==","signatures":[{"sig":"MEUCIQDasCeEUAVh1uX1Wi6b/HtFiLQ+TfBlKsvng6MwSeHWNQIgaJhTLLkWe76+12UTt9KncksZnQ9InOujw6KnQEsvfg0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":871754,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg+GxlCRA9TVsSAnZWagAAvY4P/2KVVsN2HLjknlZKjQ4F\nbnu5meaYu8Y9MbygAHYsG8YpwiuiPrXaZrsjZg4grpePi9IxMZbfzcC33R5o\nzxgi6Zl8yzKXcEKFYszM604M6zhoAILZ1hZ7ZjGQamzF8sEkT8RRejOPNk1A\nCXgyxT5Qf4ntEvWA9KfrEgY76VhCV7gI/s5TVlna/ER33bluhkZY3OWmAw+P\nKrfwZN76JiuJKG8RPk9t+Uo8HXECH8mxnkYbCjIWJt0iS7WPJf6nc8Oha7qJ\neVu3BovjFm1r21XcaDK9/T0+7XJhSB0PKu41kv2EZehFHCn09ZZVSkg2JvTK\nONX++0UQmz1XKS8KlzDgFSLtP5upi6qGv5/pthf6ePPtc8npawYeMYCE38N+\nle3XZ4XhSKsnGQnUEaPJr32/v9jwxciGCcTrDwei3K76M7GYB+JRWf9C+uGu\n9IH5xOQk0YRd2bafv7Xu1ZDsQHG8baFpstpOY/PKr3PNciJxnDEcLuhB9MNV\n8Lxhy+0FiP5Whv7ykeMbVYdaVC667zbHmw+poQUQAAFanEorbHE4CcXJ3ufL\ncE+R6QA0rU2FuFTLka7V9p5Z0deOZ5CZdmL/vmeM9EVzTert4dFMvHKFl47x\nR21lYTmQXraSrQjVHbLodiq/6rXmGtYc5iH54miuNtg+8k+p8WN44lif4KES\nP7Sk\r\n=hK6O\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"fefa69e22f9083ed30aa4ea05114191682b45a14","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.6b0442278.0","@material/rtl":"12.0.0-canary.6b0442278.0","@material/base":"12.0.0-canary.6b0442278.0","@material/theme":"12.0.0-canary.6b0442278.0","@material/ripple":"12.0.0-canary.6b0442278.0","@material/animation":"12.0.0-canary.6b0442278.0","@material/elevation":"12.0.0-canary.6b0442278.0","@material/typography":"12.0.0-canary.6b0442278.0","@material/feature-targeting":"12.0.0-canary.6b0442278.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_12.0.0-canary.6b0442278.0_1626893413356_0.15089654718542644","host":"s3://npm-registry-packages"}},"12.0.0-canary.5f00e454a.0":{"name":"@material/slider","version":"12.0.0-canary.5f00e454a.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@12.0.0-canary.5f00e454a.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"81bdc130d5cc3db95a3736eb2d5fda369355850c","tarball":"https://registry.npmjs.org/@material/slider/-/slider-12.0.0-canary.5f00e454a.0.tgz","fileCount":38,"integrity":"sha512-J3inqbXBLFrUBTtgqbdru/TRkBhnJq6hro6w+88TO5rM7ovD47ULIGximxYtCaYmML/agtwEaHb/nnY8IoWCaA==","signatures":[{"sig":"MEQCIBZ8QyNH1Xs9GE3GgkGg2NPsGB/NxyEUCM4NnTrFnAArAiB8PZDzPY7YTz/S2nps+LuGJbR9PdLsPGyGlRW1fkK6kg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":871815,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg+aWlCRA9TVsSAnZWagAAIfQP/1QmmCICaBRYJJVHJ909\nQ7y6MeOTHGJqlT1VUb4sn49yTv4cQMMVItSrOKXeq3KHEo7fXgoz5lv8p93u\nHND6qgXRFsduud3JBiZcRKG3GHfOXInG4PBDRmC943WlZeSnTTH0e1cHt+oV\nGKbYLSIme3b/NMvhaxfAW3Gh9vGA1sj0HkJurFjhqdc/TpxjBv0c4hpLzB5E\nxRMiFslJu2gkhSo7w7+ufNmu2utGzW4v+znefVibVmrOHQKFI40Q0ICTSjVz\nzWaVQP6kkCx8s4mcFhOvXeyGPNUruZdbVUfgB1plmnVuQE8Budi0WVYTsB7K\n3QixZp6PLJoO6bVxUXBig8soE5fmZgR2HlvnOyeQoedznzZDzXeS3b6x03ap\njMD+aL1Roi77OljY5X6eWK4SMo81qLsyDJtbJk0/wZDfS2qLuu7xouzg2Tfn\njF9V8QLGc/9NaDq/JHz+kHZ0mVnuCx1YeprhmluTKnpcFpT/RKiJanRLRffd\nFfth16dJnw2fwlAUbB9pz5xZOMx5v3u9s+eqES+AWV+41VVWrB4GP5tWPyCl\nseIAToGyV9FfW9Vq5sAIgTia8FozwBu9i5iEDewSeWBdugXiZJcC/rOutaqv\nptVDbSxyGdIFIXvynzsmYHmqt2bRT5vDM+IA346+SSAJBtW1vmFOJNR2MVLr\nco5e\r\n=YrsI\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"b9c8a5899d6bb5475fc5fb2c76a300d4a28f0ffe","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.5f00e454a.0","@material/rtl":"12.0.0-canary.5f00e454a.0","@material/base":"12.0.0-canary.5f00e454a.0","@material/theme":"12.0.0-canary.5f00e454a.0","@material/ripple":"12.0.0-canary.5f00e454a.0","@material/animation":"12.0.0-canary.5f00e454a.0","@material/elevation":"12.0.0-canary.5f00e454a.0","@material/typography":"12.0.0-canary.5f00e454a.0","@material/feature-targeting":"12.0.0-canary.5f00e454a.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_12.0.0-canary.5f00e454a.0_1626973604593_0.9088326745599211","host":"s3://npm-registry-packages"}},"12.0.0-canary.90e08fc6b.0":{"name":"@material/slider","version":"12.0.0-canary.90e08fc6b.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@12.0.0-canary.90e08fc6b.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"d7ada4a323e0cceddd8cc266c83bf77ba4aee508","tarball":"https://registry.npmjs.org/@material/slider/-/slider-12.0.0-canary.90e08fc6b.0.tgz","fileCount":38,"integrity":"sha512-igH2+DfOZntE4QWYlwte+3nnxuxvVjxUpVJXTsE2eG2YeFOsrhP88HjGjN6te6xwCpnsL7wPmNQ3FPXl13beVw==","signatures":[{"sig":"MEYCIQCrfXhnCsG65VIIYqXQJaMSn+MWPCmDyI6Jwvcuf/UcLgIhAKcsvAfn+7kaBUiLxQTaErIR78fZaiQVrL5aHRJ3WZxD","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":871815,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg+gF/CRA9TVsSAnZWagAAgcMP/i+brr3V+DmJRs+SnySP\nYzoZSDK9x1f51Ikam71d6BHAo9yrMiI5QijDCLxFyb2sqSRUSUvsiokfDyb4\nuB1Qd02yDIwrZgPCGFNsDEUOtOBMAo/7qNAIpCunOt/HARB1r7z9AGipItTk\n0ZizK/ABX9k2+AaxS4DvxCWXfVTwIz12ovid47KfjF51MvVhjNP86Yoh4cUt\nwsSg9NvgqJynmPrABrntsw96S1HUs0QaqofyX4yhNawPKafMuIXxkhhxYI4e\nPQekP4/0v34b5aLcvZm09CEOsPp73m7oSNboXIIZBL+Grm0PFesm3WgKxC12\nAAoQphov9aHzZOtCtUMtRDjkbqLZh5LVLoAQSwj92VZWkhQZnZLKdC6IDBbO\n6pN2KY6/tTavSJcyNu36sPFdVxwQd7j4PsfAf8dQNfDxSNI3BMb4+jD/f68J\n4ajXCMTae/gLd7HiVRZErWftBgqzHlE/EJ9G+jMZQ1Hdmf0Jo812EcOeGwEg\nH8wro1x8r68cdYrkxf2Nj6jqhKjNqk0gkZuJzLhWRTLwACPaLwmYZFx7lmWz\n7+bZpTSSZwOntGAkct6HtQxVf4+9Fdde68RQCEN5BfirdLHJV07LFy0CszjT\n4hySj8Mf4/5mWeSsYWUx3Xn9YsCVTAE276EAcpLJTEoWzP+dS/2v4r3OGtmm\nhEc7\r\n=Vl6B\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"267e307e557cdce4bda13e55c34cb0d1aa0d0b8f","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.90e08fc6b.0","@material/rtl":"12.0.0-canary.90e08fc6b.0","@material/base":"12.0.0-canary.90e08fc6b.0","@material/theme":"12.0.0-canary.90e08fc6b.0","@material/ripple":"12.0.0-canary.90e08fc6b.0","@material/animation":"12.0.0-canary.90e08fc6b.0","@material/elevation":"12.0.0-canary.90e08fc6b.0","@material/typography":"12.0.0-canary.90e08fc6b.0","@material/feature-targeting":"12.0.0-canary.90e08fc6b.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_12.0.0-canary.90e08fc6b.0_1626997118964_0.17201520839017337","host":"s3://npm-registry-packages"}},"12.0.0-canary.cf5b9eb86.0":{"name":"@material/slider","version":"12.0.0-canary.cf5b9eb86.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@12.0.0-canary.cf5b9eb86.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"204fad258da91aa914e7c483d34cf5bbfb5c4f4c","tarball":"https://registry.npmjs.org/@material/slider/-/slider-12.0.0-canary.cf5b9eb86.0.tgz","fileCount":38,"integrity":"sha512-oedJjVgILhu5AcaMD2inehl/N1a+CT0FTILAllTa3EStmWLMump1kwWXXzO9Hs9hr57L5fKWlwXHleDh3CC8Jg==","signatures":[{"sig":"MEQCIDZ4hQqbX2VuIL+13H6aMnHVwhrYEGhj4EYm5DPz4v8bAiAPrINvxhCurd5RdCrMIaYTXjF7+NgMplC1ZigGoWKweQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":871815,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg+waSCRA9TVsSAnZWagAAD+4QAJFj+n5mcud1SBjSQU1o\nHMo/lFOBWUXCj9GprQseKrzA473ZBNinlHomBaWyNz/W8rfDuN8tU44eQjWU\nwXRZkMW7MOLa0j2aAWblgnsuSiFUteNPFizHM09bJRSMPF5uGYbOHuB8dRSu\n2R3i0RgQXP1uv/JGDfIMz5Y3lDuR+4q8wJoYxF08oz1MQCgTjLNTqQsS+HjW\ni9DvGryTWv8S998wlAaHzivFB06dPOsYoCCYUPAKVKncwUvH+VkH/z8cSn8e\nuzoDixXKEQZQyU/ErXY5wnU00BZQlOUpybpzP+cDOfOyNEHSr/1kZt6930VZ\n+zKHFw7yhsTvtS0z9AKhZbyAWA9tPkATwkwdPInrKFjrfe3C7R1JJAgKU5ut\ndInKM+hyAVKYmSwVIIgi758Y2ogTLMeuXUAmQfkSx3/gf4rU8kM4qodTicxi\nRG+7iR4Tt8xw053wizh56t2htxuCboRYkd4LPR2/wf0Sf84kS2ZrDsqgx9Tk\nRy6PHq9I99qkuLjlOib0fIaIpxKN6904f75h9+U6q0i2Thdt3u8f0st7cuuO\n8WUQVuCjr8a9jk9IE1KV9+0sNjP89Gpz4Pz44jHwtlIHu+eWQumksfoZhkQC\nwOVOa/sZ7e3AdxWdUo0G2rmCIKnyfUT1/hVPnMcyO3OHJJbuGdRTj+M7Baq6\nCx7L\r\n=xzk2\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"8447b42cdc88335a4d5a37bb048f5babc1c5bc82","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.cf5b9eb86.0","@material/rtl":"12.0.0-canary.cf5b9eb86.0","@material/base":"12.0.0-canary.cf5b9eb86.0","@material/theme":"12.0.0-canary.cf5b9eb86.0","@material/ripple":"12.0.0-canary.cf5b9eb86.0","@material/animation":"12.0.0-canary.cf5b9eb86.0","@material/elevation":"12.0.0-canary.cf5b9eb86.0","@material/typography":"12.0.0-canary.cf5b9eb86.0","@material/feature-targeting":"12.0.0-canary.cf5b9eb86.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_12.0.0-canary.cf5b9eb86.0_1627063954508_0.6751783832302412","host":"s3://npm-registry-packages"}},"12.0.0-canary.3f36ac75c.0":{"name":"@material/slider","version":"12.0.0-canary.3f36ac75c.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@12.0.0-canary.3f36ac75c.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"26b21120f13ef2ec244db63122d1ac3600e4ef71","tarball":"https://registry.npmjs.org/@material/slider/-/slider-12.0.0-canary.3f36ac75c.0.tgz","fileCount":38,"integrity":"sha512-RZAp1gkB0pZfaiWXFfIW4Dq4O937EjMGJakXbKulTy8UdP7GQhNDU9nR2q2tWsUy+EVIRYQr/Qg9vttfTVCOoQ==","signatures":[{"sig":"MEYCIQDQc953OTyeWV2hFiBRJdpWkMK6d0Pd2bmkMEU95jVG9wIhAN4lH1hUkGBi2m5I4QJSskS5h+Mz7XVgSyFkPu7ookVu","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":876120,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg+wtACRA9TVsSAnZWagAAXvcQAKKI1znZH3oowGSBqGgv\nyt70kox8gZOT4mfRCJaLKvoshJsMTjXj81fjweVgNh48B2eNlM/ZqPG8R28J\ncsmAue/UuOmspaJnsTzfN7LCqvp8oTiuUBbi/mwzgwyJ+mwQaot12DM2T4sg\nPjzJqE4ZGQ13r5VQSabq80HlLjIEerjF59IzVfQXtQ5Zdpr1bKVq2k31iW2q\nJU9D8y9G+5abb+AY5ypxfIQMjh+jfwgTftEf2XNHZFAuwscZEc5aLfqN/qpP\nj33IU0AL26XRih3FfKfB+4s00/LI3nTWnE6CBBxwy/mD4DXPtfpDeXRcZFGW\nxuVAikY23q8WpVOfxd8cfQDMe4xPPDNum+4ylckSlJTOBiaeibybQDhunP4B\ndJtPRUS5WmPlZuh2/yE8NGxLazJXCoXegBGvn/rsWfkvp8VLL2DJnILKD1Ca\n8hJDIXNp7UOrhF4BlSClm/cAja70hVipvuD0cLOJlYqhLt1XCs62ObvYI2Y0\nRfkRMCU+RxE7qLDaBZOynvekRp6e5jV1ggnLH+oqMawfbV3OB1mwJq3QhBWM\ngwavLu0ExzM+2p5ltcba5PuN/BEqsM7sAZf1ajhDXjtegB1wXj8Cmk7e5uJh\nHup6WJocZbdC4ZplhS0MEMiTGLvFTm4610Iitnilql7pfHQE8YLTuu0PDn5Z\n/Jsi\r\n=72u+\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"b0f70c5fff2a6f188b24beae7ecdf708b5bbdcb4","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.3f36ac75c.0","@material/rtl":"12.0.0-canary.3f36ac75c.0","@material/base":"12.0.0-canary.3f36ac75c.0","@material/theme":"12.0.0-canary.3f36ac75c.0","@material/ripple":"12.0.0-canary.3f36ac75c.0","@material/animation":"12.0.0-canary.3f36ac75c.0","@material/elevation":"12.0.0-canary.3f36ac75c.0","@material/typography":"12.0.0-canary.3f36ac75c.0","@material/feature-targeting":"12.0.0-canary.3f36ac75c.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_12.0.0-canary.3f36ac75c.0_1627065152092_0.6143890283011932","host":"s3://npm-registry-packages"}},"12.0.0-canary.ea1e1b850.0":{"name":"@material/slider","version":"12.0.0-canary.ea1e1b850.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@12.0.0-canary.ea1e1b850.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"8aa9bb17616bead6b1643522fa167afc9026737f","tarball":"https://registry.npmjs.org/@material/slider/-/slider-12.0.0-canary.ea1e1b850.0.tgz","fileCount":38,"integrity":"sha512-+vi9aHW+Ql8SzHxCa7miRFN6sIGoDqQHOkJjyKJayp16P+mu//L6wRU+d26+4sE6sBOz5KT6ltfiFa+OPfvzTA==","signatures":[{"sig":"MEUCIDZUPuvxLBgmy+wN8+5fhlhNscZaa9W+A29OWp0UK7bkAiEA67q7GKmszUmPiLIy7ir4SufAAsfxCIlf/ChwspgYt0Y=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":876120,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg/H5mCRA9TVsSAnZWagAAg5QP+gM4YusAgqifVoS2PrSX\nSGh2lI70vFjuUElO7auW+6pxjlsIzQsCOTmcEC3P5RdQBLPjtB0k7kQScEHK\nTGi9GUsi/2N911N+pziLG+qL7+VT40iqD+huHMCq54tUfJocz6FDsGxA8qlC\nC/fhQGfgeSnOxUPqhcbQqAGt5HVWC2EZF9icf8tpYfHatvdAvKcXN8Pld2Gq\nRxTves7/J942xP4CTnGYWJlUZqS9KTYzOKxRivJrgvfsOU0fPybvIwSgm5CE\nD47fdB3/BZOu083Yn6ST2waXuxp1f/hgM89thT6kz9WPZg6g8m39f9u9X0Wn\nQttGDkpKhV6XretF7DBw9Afqd30T3/qlJ2NjQg9LhlSblBASfvciBjZ+OjyH\nVuGDvVpP4uoiHnF2G3wUoT5xgRt2AVJScAeU8HiPLgrI6vNFl/5aWhUaBPnM\naILJbFmHGNu3wLzaaU7JMsn1eyWZQSJ/TwpJJuluU+A73tezXFMrkfbRh/Kq\nvWp8hXHWSBIgBU1CA7J0d+xf7kVTJ6NPbmQ6mrbBwr4tBEYT6Eq/4Rh+EXUE\nRSd5iUF5kBU8x3BdGZIYE+afuuTJViZ5wY8uwu7dG/xF3mOzZIjZeLY5jCsY\nFsNJQ92NxLHs8cKMxf7sUFh0UJ9XCF6prFghvUe45wcNwTRvXsrpl9U5Ii7s\nSBPN\r\n=PK5L\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"7c296c6f9b2c20eb32b0501c98b6415bd193dc46","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.ea1e1b850.0","@material/rtl":"12.0.0-canary.ea1e1b850.0","@material/base":"12.0.0-canary.ea1e1b850.0","@material/theme":"12.0.0-canary.ea1e1b850.0","@material/ripple":"12.0.0-canary.ea1e1b850.0","@material/animation":"12.0.0-canary.ea1e1b850.0","@material/elevation":"12.0.0-canary.ea1e1b850.0","@material/typography":"12.0.0-canary.ea1e1b850.0","@material/feature-targeting":"12.0.0-canary.ea1e1b850.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_12.0.0-canary.ea1e1b850.0_1627160166495_0.8646771781073601","host":"s3://npm-registry-packages"}},"12.0.0-canary.22f390c43.0":{"name":"@material/slider","version":"12.0.0-canary.22f390c43.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@12.0.0-canary.22f390c43.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"6dc8c18ba7ac86e4d5f3d471d6c06cab90f0f6ca","tarball":"https://registry.npmjs.org/@material/slider/-/slider-12.0.0-canary.22f390c43.0.tgz","fileCount":38,"integrity":"sha512-2JjClG16ALBe9f4hGXH2O+rOoLDNH8Wh5hk2+cAgmpf0Oj3CitHFhPRn9iKLMSgkQheJ4+COoK728S+lPG0/Ew==","signatures":[{"sig":"MEQCIGGuj1XLil1IiqCUhEM/pi91MBW0x1dJcpgJ3m18qr1HAiAxxQXf0AYev/FT6zgR2V2xlhr7EkUJqTV1etCndF+DSQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":876120,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhAFe9CRA9TVsSAnZWagAA7csQAI6Gkxmd7w0ypQOud4d4\nVesNuiZcWqADufk42Y4BGb7iDjK6N9lt9FUkaWiQcsRx77iYq9lphAqRdgqM\ni7auyQybqx6bOzh3Pb86sUPXcCrTvIZNaLIamZVmB1BuFhlYdHHPflJFyv9j\n46y9AsZk8gnkXCoYIlhpsJDybg/gt5bK7ppb3qH4Uo7xAnHstGvm5yUuLoQy\n4iqCBoUqC0VwXc8biByhywEzMmVpz+cfpIbp66YRtaaHVKtDFsKp3SakAOvE\ntEN1MvBzHaXJ2YZSNfU8WPEdI5jmTOVBJhEQzy/pXNXjz6YGIebSIAI6nyp5\nTYpTNM4ubBlOkDMrMjaPCWVuWnMcyi3T7uUj/4VQqcGPbyBlCTJAIBNlAIGX\n+BviWPvNr9sdb7NE8nejUdchwkH10vGUmnTndXr5gCsBNF+LBw1iHV5sABE7\nQJRL7Julzk4nviAbznMdXRevDaRkIy3oFB7aijPxM9l2uLbaqtDvbQFJRava\ni1mKP2OnrkS7ZfAckN7tly5j9/vNafnq/Icnt4WIeiWBXnIO2MjrYvnjY0Yh\nKIBlIN97BqDEZmyS4s+Hzi5uaSBUFsMwvP8EKcv3VGWWVIHGty2oquvQql8E\nIkGZLumgcVvXU1At5QGg7WmC5HSjD7pXVcpN6llKC6wYXEjaHTXpgcoMKSwB\nvK5N\r\n=hS1K\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"2eba31ea1c3ae3c0e3497f3dae6cde368675a496","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.22f390c43.0","@material/rtl":"12.0.0-canary.22f390c43.0","@material/base":"12.0.0-canary.22f390c43.0","@material/theme":"12.0.0-canary.22f390c43.0","@material/ripple":"12.0.0-canary.22f390c43.0","@material/animation":"12.0.0-canary.22f390c43.0","@material/elevation":"12.0.0-canary.22f390c43.0","@material/typography":"12.0.0-canary.22f390c43.0","@material/feature-targeting":"12.0.0-canary.22f390c43.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_12.0.0-canary.22f390c43.0_1627412413449_0.7168260700314923","host":"s3://npm-registry-packages"}},"12.0.0":{"name":"@material/slider","version":"12.0.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@12.0.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"61222e809280c76702c1e122035af606e14c04ba","tarball":"https://registry.npmjs.org/@material/slider/-/slider-12.0.0.tgz","fileCount":37,"integrity":"sha512-B02xWlGzTEgR1j350OgxbC3S5Nt/hCOHl4zvd1uDwF0fnbgKQkL5+tFVHJkK8DDX54f/S5TVeKk3xgYJmE+/NA==","signatures":[{"sig":"MEUCIAaThSu7RWwF+Zot/55vcfusLxbMA0Ge5lYh3WjZSIJrAiEA8iUMhs2vtka5Ilh2GyG9r/zuqwL6y8V7tpqEaQHcmlA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":875400,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhAGN0CRA9TVsSAnZWagAAZHcP/AzXj8n6AalhkaeUj+Ff\nlEsBeSBlWFnlZFWuK+Q4q/q6puuYfbwK9sssWBTnO1y58vG79Hfy543ZDzoe\njcgRahfwHun0AwTzdT1Yf6rn0RxjojoUf/EjlBt0sciRHU1SNbS/ux31B32J\nKb5mppBnm9vNcem1w3Ej90NVdAqwQ8FPp5hh2gwYmk+HLfanp6eU4VpFkss+\nogjf3v78ajMQfaxpOfAiD9u4byHSWd5DZauau4agjOjXgmLffKfagFlmJDhH\nwfbaMcNjd3n/KyRg/QRLDJB+4kiwF7nn0rY6xFa/Ok47mSe23Me3xZUmCQ3M\ndGW4WaYSMGNiNbOgG1mO3V91Azo7AN6JjC31Je7YvlmsWIIDxDoNkwki/+W7\nxDid4NSnTowsKiar9ma7p5DKZepDvMqn9JdOItFqV1TBqbUza7S66RepEKiY\nbfn65SzpDKgOm/oE/HG2vhdCZprpZQTVhN12n3He31C7H5D2uSkg/bL+ToGb\noaVdtSQosLRGpDEgPVgfFwAysFpuJ/3NfqOhq4uppJfbQc/t7FyvjW+73UEB\nEGJae3guFZIDM7GEOMyxok5X8D0vKvIZm7NxhqLko0Jx+Vx/rGEEp+qqlYSQ\n1bjkT4C441M4lsFSUxv6eyktqyXFRilWLyHMEMK5XJdz3p40IZQLkV8rkKE4\nj8ay\r\n=bc0A\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","gitHead":"ae85f7eba0d72f4fa5f3e8669cd316336b3e6828","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"^12.0.0","@material/rtl":"^12.0.0","@material/base":"^12.0.0","@material/theme":"^12.0.0","@material/ripple":"^12.0.0","@material/animation":"^12.0.0","@material/elevation":"^12.0.0","@material/typography":"^12.0.0","@material/feature-targeting":"^12.0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/slider_12.0.0_1627415412263_0.35806905945542167","host":"s3://npm-registry-packages"}},"13.0.0-canary.ae85f7eba.0":{"name":"@material/slider","version":"13.0.0-canary.ae85f7eba.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@13.0.0-canary.ae85f7eba.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"3410b34f35501e6dba7fc06a8babf8f0ef765218","tarball":"https://registry.npmjs.org/@material/slider/-/slider-13.0.0-canary.ae85f7eba.0.tgz","fileCount":38,"integrity":"sha512-zxXfm101DAgBPNOeZ6pBdVyAL4OqyPjH24we3/4Hbv7c9op0t30kCQhcAkFYpArH4cf6nZ22VsEq4VubwaMLUg==","signatures":[{"sig":"MEYCIQCeBysr1BS4V0IUPo+qq8foTHRHzs08SSEtk3mFPdbmKgIhAIbX4F650tjdMzWN8VBNm7zePyVIf+EbD/09ADefsb44","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":876120,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhAGPVCRA9TVsSAnZWagAAkNEQAJfh9aTxAWzn3T3GbQc2\nFa+JW25w9MamP5Me7BeN8i0O9OQqdbMiJIbwvILqP7663ZFM6l2hR2i7jJI4\nnj4d9XD53w9/Cc5PcYPpOa3eNYZhg+qjDKs/8kVvOTB2WM61jTb+3x5w+3aJ\nhWY7PI7kdGUosYkmP89dnvO6vdmUuD/E3NrzbsOuTNtsss4BlCUjtDcRwjwV\ndmnDN0mpqCW5DTygN235yeInNIboCOwkzc2oB2G9Fapg9FPAElujr+6k/vYu\n7evSa75XFx7ic/3cob3icm8ya0j1M4Ngc+IFfwqoJ6cf8nWHHcd3IKMV1s7n\nc/S9zALFup0feJj5MGmiT77Qd15EPyr/dMt8UcsG4svCUoUroCjcd9ZxXmd5\nNFGamUAHbWYSJZTu8ysiTVFQa61gPGeNQASmYzqjuK0HHjScm2IeKIly+n32\nXnq4iVvShjPZeeFGKTPoOVrWUq0H1URnoMQcBfpv0BoEVBS5u6lmOug1jgsn\n0+HGXkb84wOOHySrxJ9CqrBYQF9vMicGmVoo9CfX8W3DB41/YxPeqF9SGBS7\naCVckp+j6rWM8uRFCvcxrxqp30jXPku6vskQyZEkaST1b8sXGAlSrcYObCv6\nrdAIYadMs1kbM5fFWz3XS/dZW/Pomh2cQGr5wgbDCyhSCeGMJHccXARNieje\ne3wg\r\n=PiSO\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"087c731cd84ebd8c578510bd4c8dfb5d11e8c574","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"13.0.0-canary.ae85f7eba.0","@material/rtl":"13.0.0-canary.ae85f7eba.0","@material/base":"13.0.0-canary.ae85f7eba.0","@material/theme":"13.0.0-canary.ae85f7eba.0","@material/ripple":"13.0.0-canary.ae85f7eba.0","@material/animation":"13.0.0-canary.ae85f7eba.0","@material/elevation":"13.0.0-canary.ae85f7eba.0","@material/typography":"13.0.0-canary.ae85f7eba.0","@material/feature-targeting":"13.0.0-canary.ae85f7eba.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_13.0.0-canary.ae85f7eba.0_1627415508945_0.20687199043393445","host":"s3://npm-registry-packages"}},"13.0.0-canary.5981207f7.0":{"name":"@material/slider","version":"13.0.0-canary.5981207f7.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@13.0.0-canary.5981207f7.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"ce0d582ebe81a711e01d0d8f661c577ee0c0188b","tarball":"https://registry.npmjs.org/@material/slider/-/slider-13.0.0-canary.5981207f7.0.tgz","fileCount":38,"integrity":"sha512-45CxO5LYrbyGbsyxShDdf61eGnDzmEfU3VMOkR0oUNExxbhW/QZgBX/WiMstCVhxiV0QRoR6TrGkUOz9FczB3w==","signatures":[{"sig":"MEYCIQC+qtvwewCddUH0ubow0mefgAEk6w1SNEZg4h8YquiTdwIhAJaYDdM5NgcJ1BjxUzP3kKV1HROppwWt25eReYzkwb1T","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":875958,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhAJRHCRA9TVsSAnZWagAAXokP/1ebnFw37mvyGF7qAFNO\niHZ5dV8gC9r1bXy3ZsY0TrtasNPS3h2sP6WyHhuqcvN4Y0xLer9B/Gu1vPb+\nnVRL4JGbdZ5bPAH8kUz88iG/lMBPPmF1sy8In8EmN43czY1r/0Mhw6Zw/Dz/\n4E+MNVUyU8GdiQvnrmfAZml8KQSmQQfhVExUfIULy8aJ+nJ4/GexScNSaxTp\nMj82D7TchwUC+Tmtq+M6qxgsYEvBPuSCHcPAV1M4OxRVxgzteWRjsmhOadP3\nuK8Nc9W9bIfv7jB2pH+1sb1Y9qbFdWb4PZvbYpBeDWb3yrT4hV6NFIdQRy+g\noagsaQpUg0MGXFYYr9kiOEOl34kEedH8d0ioQrA8YNfp/cX49+bc0Edqu8ru\nNMvg6TIcppPj7/IzCYVc60CytjWnQp4yWiBoRBZS85T+TTdAKGZMB3PjIHYn\nRvl20cpbCl2i/DaWTRyTVLOewB9m5AmHG7n0vWuLqgaxn6tYYfQZpNNovzL4\n3AxOv/jsspU4SGjBD5yIPcATxTlo69SSrpaIJXpI5DcfutFFYafTwj8+BAXZ\nAOSfu2MsU090SfOr9yX3BJw1fJgYP5Joqlc9aurdmkxaftSSL0eCL28qOdt4\nPGH1DibwIMjfksloivD7EIkg8UIBGYkj2Gk2JMYlDwMp8ooOlQqj81PqmJX4\nvXjW\r\n=dUlO\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"8a8b67c19b2a9f80923dd162098b373bbf34b58e","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"13.0.0-canary.5981207f7.0","@material/rtl":"13.0.0-canary.5981207f7.0","@material/base":"13.0.0-canary.5981207f7.0","@material/theme":"13.0.0-canary.5981207f7.0","@material/ripple":"13.0.0-canary.5981207f7.0","@material/animation":"13.0.0-canary.5981207f7.0","@material/elevation":"13.0.0-canary.5981207f7.0","@material/typography":"13.0.0-canary.5981207f7.0","@material/feature-targeting":"13.0.0-canary.5981207f7.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_13.0.0-canary.5981207f7.0_1627427911610_0.39031328908022433","host":"s3://npm-registry-packages"}},"13.0.0-canary.83bdd0222.0":{"name":"@material/slider","version":"13.0.0-canary.83bdd0222.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@13.0.0-canary.83bdd0222.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"d6bbf26800866d5d54f45fff1debc9b368103f81","tarball":"https://registry.npmjs.org/@material/slider/-/slider-13.0.0-canary.83bdd0222.0.tgz","fileCount":38,"integrity":"sha512-QMkew5ei5hts9bjuIA6XD2gY4jkyvgYV1qe2jdpiLeozCzbiLL8Nl0b/PBYh2cBdwerkxwpDPPg5VR8+yxF70A==","signatures":[{"sig":"MEUCIQCMiphst9gi0SYw14/9OLn4qmPJBfLTnTgaCcL/jOkdfAIgGBEqdGUXDGnZQKLnGD+VYeqfVBiOmJ9WsKJOjtAI6Eg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":875958,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhAZMzCRA9TVsSAnZWagAA9mIP/ihOK2kxoQ8XIGAkzkXZ\nHflp5fIRyJLdQNSitB5Cm2CLXRNikswId9MpvXvBSvPYLyCyniYoucfikKEE\nVCqqxRuLbJUt1PxwwtbdrvkEW6DyzeVO/Xpsaro1I3skEL9YeybvnJtLW+un\ny29Nwq3TVTLB8ipSPY94LQRtcIqJB0HEQYXjsTddUwUFUuIAeYb5aCOIta4+\nFD8EX67eIBzdDwEfDm7vi6RGB87oG62wDmVhlUZOypsJm8ExImUvoKUoGn1M\nIMqi468Xy3GSLL+ImCSe9jaTLPSTTA0+Ch7WMqFocnpsBNYbyi2D6NjZV4lB\nOpB+XHxVVNQ0RzWMlpFuH4RzfxXKkNmu1HX/fnSD2VQmb3LOzRKt1EJQC1/g\n//YKbehmf3u7v8ziqu/qpPzVqJIz60logeQs3kfC96WsCWbC5X/iOC/G6DdK\nZ4heIaPWlRm3BQ1R/us1JCZuVz7uQEUz8gJKwcAbA6ZlwrvDtkwK631FsSSJ\n1QChaYRxgI/vr3QyLRkVbtyxl5udxQgIAnEhDHHkWKiWXxFOx26OrnO+GZ1E\n0Il5tf6tZfme6XDStY56vNBWmpYeJFoSRrBCyAWTuVWA0U/Jd1NEl5KifN3t\n2OzaJIsRwsigS2KuhxG8nVJm/Gpfla5Yyu6NqXnMAZKrO83y1DDNx5o5PS1W\nnNS0\r\n=Yf8U\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"1f2b23ad4bf20ade58cc1b10490e9ca3f9469405","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"13.0.0-canary.83bdd0222.0","@material/rtl":"13.0.0-canary.83bdd0222.0","@material/base":"13.0.0-canary.83bdd0222.0","@material/theme":"13.0.0-canary.83bdd0222.0","@material/ripple":"13.0.0-canary.83bdd0222.0","@material/animation":"13.0.0-canary.83bdd0222.0","@material/elevation":"13.0.0-canary.83bdd0222.0","@material/typography":"13.0.0-canary.83bdd0222.0","@material/feature-targeting":"13.0.0-canary.83bdd0222.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_13.0.0-canary.83bdd0222.0_1627493171126_0.16506148442227908","host":"s3://npm-registry-packages"}},"13.0.0-canary.28656298a.0":{"name":"@material/slider","version":"13.0.0-canary.28656298a.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@13.0.0-canary.28656298a.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"2c5f41a714a85509c3dce8cc267014fa18a8eca4","tarball":"https://registry.npmjs.org/@material/slider/-/slider-13.0.0-canary.28656298a.0.tgz","fileCount":38,"integrity":"sha512-n6x6kwrwofGiivGeWPFFBlofYYSI77bvfJsAxtdU+HKdzgcoewnVm5XVDnd8uogs4Kzy2Eu5AxY6PGbS3rZRIA==","signatures":[{"sig":"MEUCICLADjcWEHC3qvEoTlrJVC2RaPknY74Wf69jsz3yhAqeAiEAgx3Kr9qFyVJAdOVPBgpeG5URlYFTeP0QfnrUwxaT2k4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":875958,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhAu/ECRA9TVsSAnZWagAAXpMP/RqZ2RaogtQ9P+Vrv7PZ\nJ21IkohScRaiNa9aY7yWWrEENpCeIDoalodmY4J3JrDLX6w1PUMhCxQcotZa\nm5F3CNZHBv/S2HbbmqFRUVOy1eclTO6Nm7xtEYxJo8l3i3PgOLvETIL3sMPY\nSrCJHzBTJXdz0JkNF26mZV/T8lTHpto0ve+p6orHrQYUzgUnumTeLS/DqKeJ\nunAOmPTcuxBuB9jpoRXeZb/D0vgu2Tn0GMp1SmUf2n7RElIAN3CRKRC4bBJ6\nZJCJBVYBYLxh0b4i1c0XyUzwAvPUBiPx1sJpcG9hkI+tQTLyhcEAZpvZQ7TU\nKQcP/KC0nCC1zFeu2m4Hs7sW/0qtQfE+gotBbrO1DAA4TkTDPt7SOSnoVuWd\n5EdA79TNPdtmHD/Er5jPF08+g3UNADA9PggauX3izwYAO18424swy52mnfYx\nl5zQKV7q6GAc/xQRFEhaApCDz9doeQkVQBaqGwbkmMX5I1CsZoFqdp09VCFb\nQi6GPz8s9SA9BW2Idvlnh7WIIi+5r18CtVd7UEA9yWuVzOen7LJFTOx/Vzol\nGWtvXXlgGDxwrSlkYkIEtMAAi0ncCL3u+yvJr+01bqx9lS1veZjuF0aroC3R\n2WtYQ1RS3hs9w3w9ObJx0D4T6nEFyNF4saQEWBvMTLV+8DZUDmV09hOnorPd\nXoJD\r\n=IeD/\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"5fe3e7fec89669c56504c13aadf80a71a543df78","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"13.0.0-canary.28656298a.0","@material/rtl":"13.0.0-canary.28656298a.0","@material/base":"13.0.0-canary.28656298a.0","@material/theme":"13.0.0-canary.28656298a.0","@material/ripple":"13.0.0-canary.28656298a.0","@material/animation":"13.0.0-canary.28656298a.0","@material/elevation":"13.0.0-canary.28656298a.0","@material/typography":"13.0.0-canary.28656298a.0","@material/feature-targeting":"13.0.0-canary.28656298a.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_13.0.0-canary.28656298a.0_1627582404628_0.4667308867900586","host":"s3://npm-registry-packages"}},"13.0.0-canary.9e797daaf.0":{"name":"@material/slider","version":"13.0.0-canary.9e797daaf.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@13.0.0-canary.9e797daaf.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"5e322490ea905ca1153aeba59e99c090bb1acf6c","tarball":"https://registry.npmjs.org/@material/slider/-/slider-13.0.0-canary.9e797daaf.0.tgz","fileCount":38,"integrity":"sha512-kjBULcwHA2uQ0Wv8riP4kuPIctOH+WjobVSxODdhr2XE2EvoMTXApA03B3a5PKlRKyN8o98C2oXtvMf5zRs2rA==","signatures":[{"sig":"MEUCIQCEFi2D3nGccvnNZLCY5P6OWgtV7NqlZQBD5LrJdVgA/gIgBRdqeW46fe7WV+XsDHEiMpYBKINBZ7bnwcuoQT+LF64=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":875958,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhAvT8CRA9TVsSAnZWagAA9nUP/15qIQjctATF84Uj1nZH\nIirAQEl8Ly1qc3VTBqloFRoGWAnx2zN7Sw4bkuIvoMR97hvPpzu+9uEXVvTH\nnZbMU26x9NGka1OwnbJN0S1WYPqWZRbNhzKWeG1DtdEo/ywZMkLThiWcAlO0\nI3FVc1TnpHALkZ0K0ZWacY7W5iT4U1hg3WKvW90c51n5oe8oHjxLZrY5YU1C\nCbcMSoBYNDQSuNM2TUuNTPafxk2tv9tfhtti03bEf4aL7rGPWC4JWiQNbZYn\noklUNoyS2Z+kuh0/LmO2Ej2vwSAkz+J+JOOwBKWxy094E8/ZJ1SPWX07EtPZ\nJ1T4qRf3mTIQzkpF9IvGNhKBfK2xpUye0FaJPNTneZCbW+YCuNmFSNsugUdd\noKHYnIE3afufRhIiiycw9Td+fmM4Nj3gle7D0VvS3yaiRRFj0EZAs0pNihsx\nhe/4rP9vu0x7Xnk37bWZJLF5OpRtcwGEOU6dxPTPBNUSiOyWeUk3aKtjDOR3\ngRv9yCQs/01BRU2skJdCkg0Hsx2pOmepYP3NEcDLmkK8dpA4svpbDl/A40uY\nGFg0//06rqkEqzQ1HfW9EErZahUDhITax54pMmIEx9ynfCfcz7SacyDC0J23\nQGZOy1nMQ5HzzBFVigiImggytY+ZXN40FLCKYb+qeMIYSmG/JixOSg69JHR9\nTRLq\r\n=vHKf\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"cad664597e3cc10ce42dff721f26f40b986db48a","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"13.0.0-canary.9e797daaf.0","@material/rtl":"13.0.0-canary.9e797daaf.0","@material/base":"13.0.0-canary.9e797daaf.0","@material/theme":"13.0.0-canary.9e797daaf.0","@material/ripple":"13.0.0-canary.9e797daaf.0","@material/animation":"13.0.0-canary.9e797daaf.0","@material/elevation":"13.0.0-canary.9e797daaf.0","@material/typography":"13.0.0-canary.9e797daaf.0","@material/feature-targeting":"13.0.0-canary.9e797daaf.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_13.0.0-canary.9e797daaf.0_1627583740731_0.32755116819900887","host":"s3://npm-registry-packages"}},"13.0.0-canary.adb9f1ad8.0":{"name":"@material/slider","version":"13.0.0-canary.adb9f1ad8.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@13.0.0-canary.adb9f1ad8.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"934dd0e6ce717029cc1e2f1a1d9e9d96f413e5ef","tarball":"https://registry.npmjs.org/@material/slider/-/slider-13.0.0-canary.adb9f1ad8.0.tgz","fileCount":38,"integrity":"sha512-S57ItW1hYkcPaO6wvf9mQE6lkJSNVB0U7FAGsFw2QMrWGx6sBpfWNcKQ1HQoKgF+BaGfGjLL652DTlyT4MMptg==","signatures":[{"sig":"MEQCIDaaa/7GXd1qs064eLcGPBYsiGtLNh47fptadTru4z/AAiBVie5hTyaSquz/53s+FfUOcMlFwVXB+5Kd2GJ/MtZ4Yg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":876586,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhBE10CRA9TVsSAnZWagAAABQP/RZY+LVLHR00MZ5sH8Qn\nIk9WQ18weZ8CVvKVn+UJzxy980LVvKEMZkzlhpPpGlJETeRd2DelKTzpb1pU\nmHsWCNxBSBvI9ukuRAGQ1WDv1sX1j5z1NNC2erdmULPXU3wov5SXrMMjYkQg\nForSzoBRzahbRNNccxdD7+xyEtkjEluQhQqJprgVZhfrwk05ruH9wgFLKSBQ\nk9aCjmi4/YBWCKhFVjiMtGekVZ6WC8Z+TD5kb7sQJTUh2DmGXX0dUrcCEjaE\nDgjg5GhbC7DSE30znnkEYX+twpkyUhJTXsMrpwFHZaIj+aMovorrgHPCmTRG\nRh8Kn2O3jW0jAAdl9FwOefk9g2uny6F49t/k63leJKUunICnoe7cv4+xQfu4\nIRmPpt1+fM2ua4oVh2zNvmSGrsGzz3rNrH/p7e7ENkGcwsVoCxIbff5eImIC\nL3F0mnAV8WSXzplnGiykzpGTNrgaiWB4BwUqFQV6RxuJHWeMEIurNZpnIjR1\nbkzTmYRqwZBAHXTzBO3NNJlLj1KuxEaal4wzjXqgR0ttW/bAYgDdmGpj9PoX\nI09TG5wgVhXVnjqJ/9VLr2MkEEtXon1iYdImgHXOG66OwdDEg+Op3RkXu2Hc\nIf5cuwSlSTZAt4NzOSNypjDxed8QK0R8lMj1cE4QL8+pMuGqxp3+tk8eP+Jp\no3RA\r\n=BsFd\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"db010696805aae457c8d8c9da8b394efff28ee35","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"13.0.0-canary.adb9f1ad8.0","@material/rtl":"13.0.0-canary.adb9f1ad8.0","@material/base":"13.0.0-canary.adb9f1ad8.0","@material/theme":"13.0.0-canary.adb9f1ad8.0","@material/ripple":"13.0.0-canary.adb9f1ad8.0","@material/animation":"13.0.0-canary.adb9f1ad8.0","@material/elevation":"13.0.0-canary.adb9f1ad8.0","@material/typography":"13.0.0-canary.adb9f1ad8.0","@material/feature-targeting":"13.0.0-canary.adb9f1ad8.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_13.0.0-canary.adb9f1ad8.0_1627671923869_0.1312501070943537","host":"s3://npm-registry-packages"}},"13.0.0-canary.cc5377458.0":{"name":"@material/slider","version":"13.0.0-canary.cc5377458.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@13.0.0-canary.cc5377458.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"289bbada8ccead232b89cfced07fb81c989629e9","tarball":"https://registry.npmjs.org/@material/slider/-/slider-13.0.0-canary.cc5377458.0.tgz","fileCount":38,"integrity":"sha512-O9IUNc0EIvAE4Pda5NouM8r2RcrSGQL5fw7NCtTr8S7Lrf1zLwYMmp96Dk8znQagCc9p1ISqN6xF5VPn15yORA==","signatures":[{"sig":"MEQCIHM4uN5UCPCDpbbppL22ZY7GIxxR/GkSBRXSH2Nc5fHCAiBwKWiitVoIISyRIW+gBqUzPDKRSVmuGHyJoSssRRCQDg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":876586,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhBHA2CRA9TVsSAnZWagAAhJEQAI9WRcVuZyIDUO7mD2Vz\nT0RrrQQmIY1cJP9i5oYgZ8nAI/k/RJEmkMOMnBSX/nFdd1u0RmKSBBF0aaB9\npWE8FWEOEg/AokJM/Kw58eDwvhWYTZYqZlukW/EWDcqs6MutnWYYUCixNBeE\nll9b/6yEVp7UtsOtj9SI0+AmzTX+nyNRzeooEQPXR+KltsJ+tmHOiyOZcrv4\nZUQ1iBYmBky8vJ/TZCD9JxrMxEkUnXLQ7SzLSxDMQ3eNvb8IlLAGw4MKjciX\nbDEAJESWQOMX+vqauHrQoEP1GYk3dJ+KoGe/yQWT7RgeHs71KB7n0fpKUfwG\nzRxoMp7uggO2y/AGvqDDxF2oRO8wydCWVwcifxnKzLi3+9NKH5HPwTzCfBUf\nJOEOHriDOI3j69Smy27yCSE5T0hcRmxd+TirZWIDgglpuW64O9XbRN722Udq\nA8qxL8iTeRKHH/ez4kDB8yLXaBjL/i7oc56d9CjuFxr07x+qxBBdaT2eqyGo\noeSIM8clLZjVkIEX/i+IvfNvFy1WHGUfIh2dsLA+KkTGYfxIiZ2PNP6EWzJA\nWoQ7Rw6pM+iFp37J+BApBlvHykgffBkDSB88xu6sGmYUhr++AIBx96HOFEN/\nUpTr0Az3KfNmnoJilN+uO2NTt1l9uUa5WCQTxuPfB9mHf9llDDWvO8ZpXx6h\nwfhs\r\n=rkcK\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"f4f5852cfac85d68dbd83665da839943c29dd866","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"13.0.0-canary.cc5377458.0","@material/rtl":"13.0.0-canary.cc5377458.0","@material/base":"13.0.0-canary.cc5377458.0","@material/theme":"13.0.0-canary.cc5377458.0","@material/ripple":"13.0.0-canary.cc5377458.0","@material/animation":"13.0.0-canary.cc5377458.0","@material/elevation":"13.0.0-canary.cc5377458.0","@material/typography":"13.0.0-canary.cc5377458.0","@material/feature-targeting":"13.0.0-canary.cc5377458.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_13.0.0-canary.cc5377458.0_1627680822761_0.0324036965363681","host":"s3://npm-registry-packages"}},"13.0.0-canary.a395972cf.0":{"name":"@material/slider","version":"13.0.0-canary.a395972cf.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@13.0.0-canary.a395972cf.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"3e6d67a25a998d292162211238c32927df025b76","tarball":"https://registry.npmjs.org/@material/slider/-/slider-13.0.0-canary.a395972cf.0.tgz","fileCount":38,"integrity":"sha512-PfKY/l64ZaXMyKygCdAdoxmRXk+zKH51Fsc0+5lVxHmZK7vloEW7ki9709s+EnJgIhtYUqnRvDpDVj4FAVue4A==","signatures":[{"sig":"MEYCIQDXUYX7zR3zBFxBT40cmPnToiz73LKwfTeb/wgM5tZrJwIhAPoDmQR5BwopW1SCVU4gLwiX9HxcZtscu3ym5ZRnnbL5","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":876586,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhCbPcCRA9TVsSAnZWagAAN5YQAJgPciA3Shhgj1aiByct\n+eAbkEQztvPRJXqDEa84ooT9r8UkgSshhHzNBmCEJo++OGtnh+SlN1hQpk5R\nZxJkiwox3gpYncnPxYcW4lmHWB3Xp0euG9rId2VHnMKJT87kiYsqYsqu07w2\n1Aw7UH3a7lkvtQ3XfX0H45290uDSTDBQZo4B8OxcCr6AYWqBLPCXAORGW8On\n1CNhCAh1DEIx3q/1N7umBHWEJFfVMVy4mjGAeQT2r4bv4H38Jge+FtQN+uOU\nUAS6PX4XA3cHhM4IZRvW56MA6GyVGgiBtZiD91M7vlKe74UPBa/U1hHQGe+r\n2B/9Hek9/7KrxtOZuN+TseIgRtWRfay6WtH1NYILLU/ORvLQGVewBnNynPCa\nIZb4KiM+mAIEH1213R8gAbdyF06gPeM0SiDQTW88hiVt09ms92DgUpmfl5N8\n967zmPXXPqUCoHh6Q6U4NViW8Cbo1zQC9taBPFeQPgxLd0678NhNR8qkPPji\nbo/Dqyx1d3S5eLHy+JbchrOFxyf/mIaiI/HP6Eg+M3wSsWTq7eEdvvQwfpjM\n9mIaCLQoCDSMwpC7IigDrYgCHc/3vPvrPshwchtEqQwtI/t2jwzHEtrfUPgm\ncMwAqNG9gkSvkw7eknqPIvd8M4r4CgT0vc434NgDd7iaK/pSR44V1KBhLCsL\nE6BW\r\n=op5v\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"00a6b6110465620df99cf5f775d52a1054c91cef","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"13.0.0-canary.a395972cf.0","@material/rtl":"13.0.0-canary.a395972cf.0","@material/base":"13.0.0-canary.a395972cf.0","@material/theme":"13.0.0-canary.a395972cf.0","@material/ripple":"13.0.0-canary.a395972cf.0","@material/animation":"13.0.0-canary.a395972cf.0","@material/elevation":"13.0.0-canary.a395972cf.0","@material/typography":"13.0.0-canary.a395972cf.0","@material/feature-targeting":"13.0.0-canary.a395972cf.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_13.0.0-canary.a395972cf.0_1628025820508_0.5527024935948361","host":"s3://npm-registry-packages"}},"13.0.0-canary.7c96e6b98.0":{"name":"@material/slider","version":"13.0.0-canary.7c96e6b98.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@13.0.0-canary.7c96e6b98.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"345177c51ad05f0fe8b301425a13b34ba1fc77ce","tarball":"https://registry.npmjs.org/@material/slider/-/slider-13.0.0-canary.7c96e6b98.0.tgz","fileCount":38,"integrity":"sha512-Ws/w4Huvgh1rPxrG2FPZJtloSK/s/oHlWA0N6vS633BPSRMoibPfN9rWDHjfDVDgd++eztIixUTub9AOHe7N4w==","signatures":[{"sig":"MEQCIGSKbmgU/tUrbpuhLg+7JRjrQApXwqbsAipKuKY6eteGAiB5qY2H1BKhcB7Y4ZjwLoQ2jVaMRLl+JxxOqiqOU8Z8AQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":876586,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhCb+0CRA9TVsSAnZWagAAjjcP/RWUjSoxu2TerFaPPQ2u\nVq+nJi2t/y2P9dJy4Uvnf0rLnHe5T4Kx+XnPQFwTsNUSv33H+Hm8e3d7KaPo\nOI+5azpaVAaz9H+19NYl05Z58l2HbqNbsAkEBvSFbq6r9U5L1ZqqRvZXAkEc\nTcrx2aYDLFMWcd0QrzYlXKCrPAwyGHrNvzDtFn2Twm7DXfJJSPoqvWtDPNq8\nu9GtMs+nSPYbjPKIYCPHCWKXhoCB+qnFoQ6quegKgKe89qjLzjNb+XNEhXLq\nt7Qs/uTVs4D+ZM+uG/Jtxj9f47aYrKbqY685UBf56pA3mFNkiWYk/nwYcF6n\npkfTML047YMIomSDWNzvzs3UKpYna6h0VMpbqzHUbg+v2z9s7hzUTh9WD3sr\nrDfg9ThmSAIPqQsykFQq/pYp6N2H1YPrjcH/TWU50o5Wac3+32I0xt1iY1Ym\n7MSEvmQWX03lxDULrqo1v5HynFtDCHvBZ+c+L8qAnHKHuoziiZMErE/2ZfhL\nKJKw+oT/mY6XxiTy7aeDGpuYpf67v/Apx87gGwxfie5flhP1BtwaxKTJK2J8\neTFRhasl0om4VtqnEGqv3QI3c9iC+Ww07/6wJ4I7y5CFX3qzLcbhYCXnj0cZ\nqRitfsHKHTIwyCndltnlLLyt1UmJmRgt1UIPMYYVMk5gLHJFV7AV6JEpFUG2\nwRw/\r\n=zm38\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"38c48bd580ff0facb66c28bf9caeebbd2a6a4033","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"13.0.0-canary.7c96e6b98.0","@material/rtl":"13.0.0-canary.7c96e6b98.0","@material/base":"13.0.0-canary.7c96e6b98.0","@material/theme":"13.0.0-canary.7c96e6b98.0","@material/ripple":"13.0.0-canary.7c96e6b98.0","@material/animation":"13.0.0-canary.7c96e6b98.0","@material/elevation":"13.0.0-canary.7c96e6b98.0","@material/typography":"13.0.0-canary.7c96e6b98.0","@material/feature-targeting":"13.0.0-canary.7c96e6b98.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_13.0.0-canary.7c96e6b98.0_1628028852595_0.5007915595065897","host":"s3://npm-registry-packages"}},"13.0.0-canary.a80c8b2c2.0":{"name":"@material/slider","version":"13.0.0-canary.a80c8b2c2.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@13.0.0-canary.a80c8b2c2.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"14478ab781dd7a0d76013852a21c4c804f3ebdde","tarball":"https://registry.npmjs.org/@material/slider/-/slider-13.0.0-canary.a80c8b2c2.0.tgz","fileCount":38,"integrity":"sha512-OfY/1pHNI2Uprf/B8Ber/UMCzJQrCxHaY/wZdd6G22sRlvxv4mqq6z8bect1p0iYQ7vHUmKBrNS1n7tOW8kbyQ==","signatures":[{"sig":"MEUCIQDCHlXlU27/6m7rMq33R+c6/OVKPOcTYLhpFEODHJSSrQIgL35yc+j0Hg8BwOn2C8i90mYcvFwZDn6vGrLgyuWBEEs=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":877054,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhCyoGCRA9TVsSAnZWagAAsNQP/RyzVw8K6kzePspRdtaX\n5wP3tBiuFv6Vfq9i+2JTr59LBFKIgjXu/CG9kSE+bP+zf3laNEaKtsOJMctb\ns9XVGMtfLpY9DVv0fTZs+a+dvToon5KESJGqh/4ob3sKieYuu2Xe1+KicaHR\n2p9pQvr0Q9lL7TxXLWXOVWlxGPzb5ZPU5jKcOyMECb4RVsD3izMaRYD8a5h7\nEgGwAtGg4vyBeOSCyiEcguc87SdD7501hENF3EGL0btXOIQ1n5nqIR/GcQ98\nQMcqaOsxNyD22qmh7xm9RNf2jZVUVj2qJZYmvmK+xbAFpaLI5WukiGYTR1dg\nde6DlyL0rkQDg1yR6cQpz5Yj/wjUc8bophFF4faNtvX3qDW3glsiHfqAmQdZ\nQXcxtpS3y7oz0XjTv6iqt3RLB7Zj7TLjFxjQTflNbqa36X4RTpsjYrtLU1PY\nPqijRCwnxpydI3rqdshF3rvRr5NV1lda9/J7M43XVcjZ6THh++9vb0JnM9Kc\nLZKHxgQQ7e3Xs4eL6S/fZnhGzXTmzEwuqVa+PKQ1laXVzgmR6LSJvvdW5ryQ\ny76m8B+Vex0AKZYxcffYZWNJEln+qAuph27hq3Lk8XRDRfG/TKb8XmHy5DUQ\nYD7HnUZ6a2QpnMyTkAmBpKowIudHHWBeNPZcHy0XRxlAzu1QFd/vRbyG/2iz\ng1Nt\r\n=dPEe\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"cb4d3f1d1d37c50939ed5269748eebb96f798601","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"13.0.0-canary.a80c8b2c2.0","@material/rtl":"13.0.0-canary.a80c8b2c2.0","@material/base":"13.0.0-canary.a80c8b2c2.0","@material/theme":"13.0.0-canary.a80c8b2c2.0","@material/ripple":"13.0.0-canary.a80c8b2c2.0","@material/animation":"13.0.0-canary.a80c8b2c2.0","@material/elevation":"13.0.0-canary.a80c8b2c2.0","@material/typography":"13.0.0-canary.a80c8b2c2.0","@material/feature-targeting":"13.0.0-canary.a80c8b2c2.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_13.0.0-canary.a80c8b2c2.0_1628121605904_0.26548054426234624","host":"s3://npm-registry-packages"}},"13.0.0-canary.3dd611091.0":{"name":"@material/slider","version":"13.0.0-canary.3dd611091.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@13.0.0-canary.3dd611091.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"0d271d2afdf78ae57a49de01246b942b6182a7d8","tarball":"https://registry.npmjs.org/@material/slider/-/slider-13.0.0-canary.3dd611091.0.tgz","fileCount":38,"integrity":"sha512-Q9eoGsK4z7QikW2E2ttvEDJhPK2lOvg8P/Y07xzzlgANOnfVpaCSHmq6It8Jz653MwXMPi9nCcISO0C3nnO7nw==","signatures":[{"sig":"MEYCIQDUot639evXnSIlFHWWh2sk68dyclzHDyjWk9uWIYDNuAIhAIlacfrBfMwqTjDHSk5VsBBiToxLDMCsklcxJnSuMltK","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":877054,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhC2F/CRA9TVsSAnZWagAA8rkQAJ1zFcsZdxFNmIjD4bQc\nQf4Q89Bm/taYqStmtbFhqui/LfHcSCyWjL41QPhpQC6yRj4EHvLa6Iv6+w2e\neiavK8Y/gTZro7xi1f/hfFlxEkO9pT5tb2v5BlgqNzjdFBuLvyOGHNzmVeiB\nO9JSsgC1ny2PrsGGmZ6xz9teLnQM0LJLz78lyN1q2dccKuNmRpNz5VYVgz5A\nYammdwyLEeHPIsml1UVdnorRIy8lBQE5d26nFdNlLzRd3E2pOVeHFtI5YYrA\nfrj5wrBGv/7LiFB/hpAIKncTCKVW7C8t4C83Tq9t0HiYm/M+NtAZ+IoFUy/3\nWjSpRY+57Ukw4LO0y+bDlPC1jYbcIS3Nw7UggT14drtLAwrTT8emY/n/xDYP\n90P414KGt/Ai7mW1LKnKD4UpQ2f24urMnS7m/caUNSwcfSbS7XOORA3b/NC6\nxi0x3FpuGKC9NpY8xAip0T7XiENBysOOIE6VUBe703+35/ReqJ3YO9Ne3qqv\n4o5Om6gOxmzzrJsqkZxe8SZV0tTVy64/oogPe+U04dej/fuj1ZbInhHE/gsY\nti9pslKNcnHHq83/NXz/hzdJ8wcC5zP4H8nmVsEMXgOqb8QcYla1fc5ApdUS\np03xLozEuTc37lrkAi3B9wpy8R9ApVs8t6I7isd2D1qNj224n705lD4bB9EF\ntmBU\r\n=BVyh\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"fc6a6a59d9c86ac1f85efd94a4aa6a8e4c27c379","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"13.0.0-canary.3dd611091.0","@material/rtl":"13.0.0-canary.3dd611091.0","@material/base":"13.0.0-canary.3dd611091.0","@material/theme":"13.0.0-canary.3dd611091.0","@material/ripple":"13.0.0-canary.3dd611091.0","@material/animation":"13.0.0-canary.3dd611091.0","@material/elevation":"13.0.0-canary.3dd611091.0","@material/typography":"13.0.0-canary.3dd611091.0","@material/feature-targeting":"13.0.0-canary.3dd611091.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_13.0.0-canary.3dd611091.0_1628135807225_0.6908116377484121","host":"s3://npm-registry-packages"}},"13.0.0-canary.5dee37ff6.0":{"name":"@material/slider","version":"13.0.0-canary.5dee37ff6.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@13.0.0-canary.5dee37ff6.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"c7bfab92be6fdcd38441088e269a655b55567feb","tarball":"https://registry.npmjs.org/@material/slider/-/slider-13.0.0-canary.5dee37ff6.0.tgz","fileCount":38,"integrity":"sha512-e8gSFpe02Q5ClMGiAaxOvFPP5BoTVXXwHM8ATUesewR2rvE/JEuYFpqM09dLnEQkI5EFJPz9EgHVyRk8fted9Q==","signatures":[{"sig":"MEUCIECLFwLYsypuAIKzeS8qKRWzGf1siiZJAmbcuWVu51viAiEAs1AbH95ZDv4M07O35SlgaNiYYcHOoh20cVUVxtrNzss=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":877054,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhDCMNCRA9TVsSAnZWagAAAtgQAKGM8oU+dsppoBLXjqI/\n6pPbWncFP90ypEhhCvzu6nPRyb8Z2LKiqGBZOCv1ihoM3vOE3h55t5T/26hR\nkIiNMdWrgm9t3ey8L/zn5CTeLzLyNabiRPieVzq2VJRLCtQapdsnyc+C9zoV\nDntqXhDMhYp6Aqal+tINHZIaEHkkSO9lgfmTpYnoatQp1HdM0qgpduF2AYls\ncpzlib7MdVPJI8J5iJ6907EkfnC6R9cjS41J6Yu8Ouz32AdJQ+rQip2/Pw+m\n1PtKzhxi8KX1vf9+4pbwlhz6tvSdujZLTJ6DqSbaCpGinAnX136k6+A7H9tt\n6X6KbSc7iBg+fc08Owb++whsc0CiU2c0Io/NJNuUl+t9r8w/M/QKesDHbQje\nk3ekYWHUwnYTTpXzhAcCiih+ABgpXA3d9nJ/cn5sLAtAXkmhMpqzFx05na5s\nzun/WGqqzWRtJcDDAJyz0519wY+WFLHvkaG8gWUMfAN8RXnhmXrV+PyusFfs\nkFdfzm0Ehh96EFPGYMzQ/X48GNyqsUJuy5jb2B1Zo1CVitrLvzLFBjdB14gr\njq+kZGW4ZtP7v7Y58RRsPB2QHmonkskfMAw/C2OSoQNcyqOV3DaHqc7Od57+\nZZYJmhbBBV6AX7EgRocHfaBF32k5sLI02fMKqSpu6QBGYNinjgDBXCqte109\nPyqL\r\n=EPIJ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"a7b521f6e807878ddba15c813505134621ef85d5","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"13.0.0-canary.5dee37ff6.0","@material/rtl":"13.0.0-canary.5dee37ff6.0","@material/base":"13.0.0-canary.5dee37ff6.0","@material/theme":"13.0.0-canary.5dee37ff6.0","@material/ripple":"13.0.0-canary.5dee37ff6.0","@material/animation":"13.0.0-canary.5dee37ff6.0","@material/elevation":"13.0.0-canary.5dee37ff6.0","@material/typography":"13.0.0-canary.5dee37ff6.0","@material/feature-targeting":"13.0.0-canary.5dee37ff6.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_13.0.0-canary.5dee37ff6.0_1628185356885_0.2426327496663896","host":"s3://npm-registry-packages"}},"13.0.0-canary.bf405d22a.0":{"name":"@material/slider","version":"13.0.0-canary.bf405d22a.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@13.0.0-canary.bf405d22a.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"5bd3fa193a43a1cc0845669ec797df64407e6b54","tarball":"https://registry.npmjs.org/@material/slider/-/slider-13.0.0-canary.bf405d22a.0.tgz","fileCount":38,"integrity":"sha512-7cRocCR2IksqZ0XHQTJVuCZhC6Rlaey6bm4eQi3s8/pN70X7V8CWUheCdd6KMppoyob2FUFWnTouNTFRCUqgKQ==","signatures":[{"sig":"MEUCIDLZYt2eepl+DzBN05bKNLogwyte4HCd62sqDPrMQ2g9AiEA6a3UYPVnqHfzLmujL0xiYvg33rcvwiQRFr31RNqn6sU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":877054,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhDEeVCRA9TVsSAnZWagAAU6kQAKQtDf2fpc6cpMELTPL1\no63/NspCcEi8lw5KlYBTtsNwKK9z5GmwGpckLAeHgusoL5nvYpCeIvsrDPRc\neVV6kA1XInhkSSstsSHACnsgDNTF5uCLeu/OT7FmI91rlf/tY1uCdLuWNDFq\ngU/SaXtTqvrGne3HpjCG5dEsbYZIKFchWsxq4mFVwWQ0LXJpzh/uUOFbKqb5\nR/jeKaNCirVKz2ocunIRfHiElyKaD0cUKbyZNjNqbZe2SeW3ThSdz+Obqsgi\ns/x+S4XNg/ZrWXNHTsQQh18F2Y+v5+kyH5jrEqgS8OHQ1lds0Vo7M9sk25aK\nvr3IzFjr7xpTFNsW3CDO2wpNA5UyWwOuDZDEWi6Q9z7TRyq6QNWuryh7sPDD\nBD6zGxe9IAm94JavFcWudIiHP9qs5Lf3JLbP7TMjh6hleFygxWmtCqhin6ZQ\nbNivN8pSZfMiaAiXq8I1yTPhgoZOKIwdUbQKa59d4b6vrTb22WxNrzpAEr5x\na23AgAQUgJnLhbZaZvXoVS7DUbXFJmEXHYmY16qO3ESZbjI9iu9bYAfQe8HM\nowOIaBUhsA1kqRFQ/kCbsZVkOdurhBypQZZGPIFeqFajQCzSixoStIVvvSjS\nlkCKMM3fRbwbl5pgfDIIJcpnqOJKX2fJOh/wHWm5A8zLv7UbID0G9UFP4uhs\n5ERJ\r\n=1YAo\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","types":"dist/mdc.slider.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"00ae15a245c6a46fa0a13aa61a02e5958c0eddbb","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"13.0.0-canary.bf405d22a.0","@material/rtl":"13.0.0-canary.bf405d22a.0","@material/base":"13.0.0-canary.bf405d22a.0","@material/theme":"13.0.0-canary.bf405d22a.0","@material/ripple":"13.0.0-canary.bf405d22a.0","@material/animation":"13.0.0-canary.bf405d22a.0","@material/elevation":"13.0.0-canary.bf405d22a.0","@material/typography":"13.0.0-canary.bf405d22a.0","@material/feature-targeting":"13.0.0-canary.bf405d22a.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_13.0.0-canary.bf405d22a.0_1628194708877_0.41275298657216064","host":"s3://npm-registry-packages"}},"13.0.0-canary.b47dd37a6.0":{"name":"@material/slider","version":"13.0.0-canary.b47dd37a6.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@13.0.0-canary.b47dd37a6.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"7ec937d41bc21cadb5b080176a70eda60ff7113e","tarball":"https://registry.npmjs.org/@material/slider/-/slider-13.0.0-canary.b47dd37a6.0.tgz","fileCount":37,"integrity":"sha512-cEoyVKRXOKar9bAmNbsot4bQhFXx6mkALev1COsYzHgHZepFyZrVqUeF3A55hKS2pHNVo6Ot++VtiiCgStN/NA==","signatures":[{"sig":"MEYCIQCUDOBwlKjPBdLgjARjfSBL39hzJDZdRTFphHhrtNdgVAIhAOfcDzz2QcCYJECCwtmLnZvjg+/RCQc48IvpEIfZ0Iot","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":853112,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhDE8GCRA9TVsSAnZWagAADOMP/1i1GOHCaUKS3/tPqzK/\n0zrv33nzM0q8ldXfuyLY2leDFfEiFCs3bxCDupsvRdcbuon0h9Ui0w/sim1T\nieL216DgsTzkZ0rW54WlgkaXekyZHh+g0TB4X3eoYOByQhKy4YWpnQylZSJp\n1Tkr7Mu3FFE14zKiVX3Ht51vJCrLvO9diY5/nKQtxBE5oSbS30aqU0epAZ7L\nbQv2jZpeCpbdzAbJATrhuRllVtNUwrPI5agxbeY6YaltADTK4racQoRpuJCN\n408NDY0JOBnUhTPHTtNlq1S9Il/DLBai6w4iSnjWA/Sr2ENdhq+PlCDPx9jS\nooa7ihPR17eTAU8bGoyMfF4AVo803ZWECpb8HT0/YdOeCG9Jiiv2kZPUbUvn\n7Cq/F69UbgU9ww4Y85R6AY+pKwhW15UasxufDSRZU7wJVrXYUbFLROpuTCci\nVMHpEV/DmgcTBpQcdMdJfMBtmORm+KkETKEy1ZmjNSW4NnBZEAU/n/HMcpw+\nu+b/CCZqdSihJIbSn6CjDqyobeaJMDS2yhkVeQOM1QDYCmc6R5K1dcppt6yF\nXwHQ5kIDaNtKb/tT8ETpgqqPSWXywJQIFIvUVzG2HjiWzXgPmrnLQs5pOedz\nv3+s0+7yEUQqmGssddzdQwf/TnXaTIGzuyDjMcA4J6hQGri7ccUe1uw0hmZQ\nlk4d\r\n=Nbq1\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"47f67e5fb310c13dac39b9beefbd6b53fa54d1b2","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"13.0.0-canary.b47dd37a6.0","@material/rtl":"13.0.0-canary.b47dd37a6.0","@material/base":"13.0.0-canary.b47dd37a6.0","@material/theme":"13.0.0-canary.b47dd37a6.0","@material/ripple":"13.0.0-canary.b47dd37a6.0","@material/animation":"13.0.0-canary.b47dd37a6.0","@material/elevation":"13.0.0-canary.b47dd37a6.0","@material/typography":"13.0.0-canary.b47dd37a6.0","@material/feature-targeting":"13.0.0-canary.b47dd37a6.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_13.0.0-canary.b47dd37a6.0_1628196614437_0.38605027534013225","host":"s3://npm-registry-packages"}},"13.0.0-canary.6c82b965b.0":{"name":"@material/slider","version":"13.0.0-canary.6c82b965b.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@13.0.0-canary.6c82b965b.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"5b199af2924738d79f307d744cc100403984b04b","tarball":"https://registry.npmjs.org/@material/slider/-/slider-13.0.0-canary.6c82b965b.0.tgz","fileCount":37,"integrity":"sha512-auwK95Bce1n2g4NPIcBFw2sve4YqT5jbzzks5DbzuPBfTvJ1PbT9N03BCRwHTobHTSTBHoO0RHUfc/dZJ1ax4w==","signatures":[{"sig":"MEQCIDVSbAOL0Ag1sGs2xCM8lg5tFYFlCwS4Q7BOfIZAhBXcAiBmWGAqc8Ay+gukLooSa8WV0ryA8PjJUFpkeK4obellpA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":853112,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhDWARCRA9TVsSAnZWagAAjEwP/iKUvqSljRaXnOQG5k6q\noPWTFnYoFnfgfdDUUCXWzwmchPl/pNS1JDCCHiRS3AdZ1aU3ufDJDPtavoQp\n4nn1nOm7LNddz415Zn1WoAArUJD+hdt/1QLIr/cgd5iW5GyQsrntDhuiehKP\nL+my8L2kOw2FX+9TjEufgj7nd9xqmccqgA0dSTwPxYz0jjJnm4b9CeL/y/LW\n0U1MBqe5R7W5HrbjFdgkjCBh2LJoVKrHSu7z2cUg7/dgsuKRPrBbn64B8Lvw\n0Dvs/OGKANvKPCXQumn5LCcI+EPgcBKrpemagrfUXL7PpIktHyun3wMAJDpm\nvgtyLxnyfmuwTa6mw+2xwE8jq3mbECZ35Doca7rDubTHCwAx8/nxLDU5+xxR\njPZocvyX0hEc53hTnLjzpXCANPQOZb9iH7J/IIWiklHX1ei3bzKClrDQFL7s\ns9xzwx2FruVxsm528Nc4GO+0CxH/l74svyvLsZ+lZGmDLVHJZ13D6A03EIRb\n3H/uhUcF7urbPwZZOBqnMevNDCE9sxy48j0TJd+bQTzB2nsUU2UUpKtTgZtw\nGmbWk04ndCeQBITKtNfpi1rPbOHrxx+zU5bmPg9KX692CVlDE1SQJ9e49ON2\nS6qRJ1AujMWYBQv7qOgacKSXAOKPCD72h2UHvrX8fj6MXtL7FnUJtF7HnNQs\nTUwG\r\n=QJmp\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"434420b9fc9470dc77940d2240234a564be58d02","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"13.0.0-canary.6c82b965b.0","@material/rtl":"13.0.0-canary.6c82b965b.0","@material/base":"13.0.0-canary.6c82b965b.0","@material/theme":"13.0.0-canary.6c82b965b.0","@material/ripple":"13.0.0-canary.6c82b965b.0","@material/animation":"13.0.0-canary.6c82b965b.0","@material/elevation":"13.0.0-canary.6c82b965b.0","@material/typography":"13.0.0-canary.6c82b965b.0","@material/feature-targeting":"13.0.0-canary.6c82b965b.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_13.0.0-canary.6c82b965b.0_1628266513006_0.9455963751414083","host":"s3://npm-registry-packages"}},"13.0.0-canary.4ca11fe76.0":{"name":"@material/slider","version":"13.0.0-canary.4ca11fe76.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@13.0.0-canary.4ca11fe76.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"8ae1a3a69398e022d1580e57612471b1c409a123","tarball":"https://registry.npmjs.org/@material/slider/-/slider-13.0.0-canary.4ca11fe76.0.tgz","fileCount":37,"integrity":"sha512-AVC+q3G99rMQtWzMqXZro+aqB6nGo+YThFw7i8ibDVEGdMNCaRUuniXEoL/6IBk0WxhSh9ySts8qlyw/Yzm51w==","signatures":[{"sig":"MEUCIDfE4ICx8SVGmn/wiLAXS6TQG1OKfL56Mo9sY1Pr4H7ZAiEAxb2QMxTpvuNkb6O2+qP449kxdPHqp3wDXligF+FkV3s=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":853112,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhDWxjCRA9TVsSAnZWagAAdYAP/2QMlPtRh1+4u1gmIOls\nZsLPX94cdlKG2Be/SoVIxCuLTQNtJYZf+te+DrWe/fGXchimCVPWIJOYZbf9\nv6e54mxU1+bv/6MU5d4vIc4+O+n8puwRo2H2mRqNooqv6+1KuyNq4aV9ALLy\nmFDWErV4aoh6evUotE8a5NPxc+icjM/X8R2Zq3qh+KdLbKAad5Gt517CRmq7\ngbsRV+QWHZjuzGxa1q3YFEaCK6xEbAqBG7zkcXEhHv9AXbseO7Hw04EaOUyt\nZVv/k8WMgbNau6N4eQ1tWxOp6uzY3+6OIWLPbuYict8sf2kJ5QzaqJbEvtCt\nRmBsEBpwuA4DDY0+ZnR3e6Ye/063bAZwtK+C4yUgnAXKLMf4lQ7bUwHtybfI\n3QKOHGh/ExLTDtChe7IilKZGGptIU4+i2qGjza9+sx0AJdGGPxtQiafto5+F\nuFI+WhxwkbFI+DF6I7rJr1goDSiYNz7ZF9gEef3iH3rB/xOY5JP5PbC1KTHP\ndNZhgqPKgJTszJsB2teohExswCSpzeadReqiyVVM4nXYNbyyxaF6SlYVTHk9\naNbOEH4+M3f6Ub9CgBalLs8An3t3/HrmwdkT3OOd/UEMYisuRdi+bFMZD/dI\nwu9UeP97yU328Tj9b9oh9hhf5w23PqkRrzN50q6uCPpOv6OHlefnW8vCjJZX\nnL5Q\r\n=KnQg\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"f012412147804a7e8c4bbcb205a7a48a045cd694","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"13.0.0-canary.4ca11fe76.0","@material/rtl":"13.0.0-canary.4ca11fe76.0","@material/base":"13.0.0-canary.4ca11fe76.0","@material/theme":"13.0.0-canary.4ca11fe76.0","@material/ripple":"13.0.0-canary.4ca11fe76.0","@material/animation":"13.0.0-canary.4ca11fe76.0","@material/elevation":"13.0.0-canary.4ca11fe76.0","@material/typography":"13.0.0-canary.4ca11fe76.0","@material/feature-targeting":"13.0.0-canary.4ca11fe76.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_13.0.0-canary.4ca11fe76.0_1628269666901_0.42027531548950225","host":"s3://npm-registry-packages"}},"13.0.0-canary.510cf90f2.0":{"name":"@material/slider","version":"13.0.0-canary.510cf90f2.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@13.0.0-canary.510cf90f2.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"5fabf9363d1611aee13ad4fc4f4d5eb5f0028a62","tarball":"https://registry.npmjs.org/@material/slider/-/slider-13.0.0-canary.510cf90f2.0.tgz","fileCount":37,"integrity":"sha512-O0L5qGOzHSXvVIvihgMXFMZkc18HaVqrcmchpcf5v5/HCM5HeAtYMQInHOXqxTSdCGmhVC53I65MeKa73lSBTQ==","signatures":[{"sig":"MEUCIQCHNSLe0DtC4e8NBKPdYp+wC7KRibwPmo+7Mz+NgI4aywIgfgy/vhBo0ld3e+REuK3Ylox3sF3SycKQpMfyxGtSG8Q=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":853112,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhEWMxCRA9TVsSAnZWagAAaiIP/in+lsC4VJrZnBJEgaep\nnN1nruEaIaGCXq6IpZiOXR0fdsfuKqzlbUD2TYxsD+sY5exp0bGUBhfMCPJm\nBIHJcbfK7TuueW3yhvvLGpzFPZmFg50+2tjKvFps2TSv8xH/McCxiJa9l5YE\nerYEfQO4qH06GQt9GLjY/mPhXuUgzy+xGJ8EkuPvK5/XdlufE4LkUVj6b8vS\nZB3XuLeo6jW96fmRfX3Byge1moHtI4Hj93mcGFxomRVP3c/WpzUx1Fh4pGxt\nHMa5PMVjngt8VftN3hbItGcJ9JQM4DipfCW8up+1v3nxLrwvGVbax4u3Jm+N\nFqcKbjh5/RMKdGxFjMb0ple57D/tZlaIKcB9qvNWKAs6C/5WGDWHFkwimbl0\nQCY9nmmqzTj9pv4wKvoi1YX7AiFpD93iMVA+ysftWj56WwD4MxRI8psvo6vU\nhfIDHwm9h/pdCTlN/c6ORhfgTywaG9fRKza7InYOYSbAQp/LekD2l+xN716Q\n4K0OsWRtEOF0eulaDh5rpNhufA348BPw8y7zJd/BmnQ4MoMIqpdrQTFq4MLs\net/v8l3fjkFVyupDtfv0/z9kgPTO6Zt3fMib4RqodNGLmq8ng7IDNbTd6acy\nJExjyyBk82H+2OzazsRZSG1rPlX+eGznEnsaIMkrNobP/6yGJkLkBd+vh4vm\njy71\r\n=Dxar\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"1e11d1f2c4c830419dc862b62700d4484604a3fd","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"13.0.0-canary.510cf90f2.0","@material/rtl":"13.0.0-canary.510cf90f2.0","@material/base":"13.0.0-canary.510cf90f2.0","@material/theme":"13.0.0-canary.510cf90f2.0","@material/ripple":"13.0.0-canary.510cf90f2.0","@material/animation":"13.0.0-canary.510cf90f2.0","@material/elevation":"13.0.0-canary.510cf90f2.0","@material/typography":"13.0.0-canary.510cf90f2.0","@material/feature-targeting":"13.0.0-canary.510cf90f2.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_13.0.0-canary.510cf90f2.0_1628529457730_0.13486078856413308","host":"s3://npm-registry-packages"}},"13.0.0-canary.17580ebf7.0":{"name":"@material/slider","version":"13.0.0-canary.17580ebf7.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@13.0.0-canary.17580ebf7.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"50240484cd29e7cdcb1136e87736c428dd80f9d4","tarball":"https://registry.npmjs.org/@material/slider/-/slider-13.0.0-canary.17580ebf7.0.tgz","fileCount":37,"integrity":"sha512-x1ZwQ/lkK5Ff+Sd+nCYbJ1N2/XxrAMrN130cLyvZYJSnsnZz9hjVdtn7RX+0vz3+RUaB15M8CX0uV60eFP1u0g==","signatures":[{"sig":"MEUCIHRcJs8OyUmVhcySxyqMmFqW/96xSXZ9z74Y//zwKev4AiEAhz+bib3icKZIgp04eNXOtqeisLCYiji4p4t4mdTkjAs=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":853112,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhEXFUCRA9TVsSAnZWagAAo7QP/3YEKN7PU48cjV6bEVDW\nGmywu1CzbleZ2UAzfWGXVoY1lCe+AdMh3tnvTk5p/pjQe2zZzQr/cEJp9MuM\nJjan5tBtnTXg8b8gBBnXTxbC9g/iNVK7YUEzq5Z9XWBp8K3L0aU18sDroMZl\njN4+PiMeGEozbr3x8Ql95YychrZX9hc0R1f1pjHzCwoEvS4U8zsOedUq2Ntn\n7sUexf0WLQsN0obdWl+DT7bus/sv/UcfwvAGbCECdR10O8uz3jfpjYKwRPgv\ncFJywFqzyVQZo6bfpMe78mRDu3pPs6gavNrTNKIKM6NIJlZwAfOpDQ+XV/VT\nK5UnwIc86mr6IVFFn8pAgSLgxUF/qyf/pjxlQhpPw9/74J+HWDaPZn6cYSrr\nIWWsgKAce5x6b/bOK8Eaig6LEBlI6Qq8EPowN3gHh/eGFSlp1D9ScGlvuVlw\ntQBLB+83FHG67KuqXg7DNSYwvgROA9plOBIfSPrD8QThFJCp16Ejb7n64L9N\ns3U7ymuswdW+n5p+JLH9Hmsy14zr3WzX2ePz5q0MSIM/hbpruE5478cHr6Yz\nxRkbAm6JcimHVjSyydMmmjRY7W6gWHfr6XiHuK6ec/iVYDOhFWF01VtQwMO1\n/uZ/83/kuY6/q/DVmJdLFhaeDvnNpcqGcKRbWwjtR2/UxfgAi03vK/aM8Ip5\nvUey\r\n=CezK\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"5bde42052101fa1fdd48d89c3dde8b9e99bdd1b2","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"13.0.0-canary.17580ebf7.0","@material/rtl":"13.0.0-canary.17580ebf7.0","@material/base":"13.0.0-canary.17580ebf7.0","@material/theme":"13.0.0-canary.17580ebf7.0","@material/ripple":"13.0.0-canary.17580ebf7.0","@material/animation":"13.0.0-canary.17580ebf7.0","@material/elevation":"13.0.0-canary.17580ebf7.0","@material/typography":"13.0.0-canary.17580ebf7.0","@material/feature-targeting":"13.0.0-canary.17580ebf7.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_13.0.0-canary.17580ebf7.0_1628533076302_0.020302991386917713","host":"s3://npm-registry-packages"}},"13.0.0-canary.7249a3060.0":{"name":"@material/slider","version":"13.0.0-canary.7249a3060.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@13.0.0-canary.7249a3060.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"0f588e5563282c8aa7272677618f1465c27eda53","tarball":"https://registry.npmjs.org/@material/slider/-/slider-13.0.0-canary.7249a3060.0.tgz","fileCount":37,"integrity":"sha512-qQ6fSRi+avrm6q7xiVVJ1IzT9wMQkzlYWFWhHQZb/FnXbJ9fh+fhCSUyb3yNENSlr66nGv/S8u9cp7xh4PpvwA==","signatures":[{"sig":"MEUCIQCukTz40+pK33z+swJvptC+xaOt+1QeAh1zLn1EKpP4QQIgJxzgEqSkUfJIXsCDuaG+s1lKxjYaqUP6vDfMccsdBc0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":853112,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhEXJCCRA9TVsSAnZWagAABssP/3kYdPyAxFoM18TXJ9sc\nNuuirUCh/GNUW1o3wxfhqnizW3et+iJHQeX3DG7B8TXIi/lCm7PAcjJxibnD\nuxLFPxdVBmEivg2hHtnkV8xVO3R/qIE9ssEc8GnRiM9QqH3XcwOGcY5PiWLQ\nUCkaorA582w/957icfSgFb6hCHN/g+veNmYddNdt0/Fz3BGOqLYdKjwhC76C\nxkpjwfY/VhCvPA7ha/QNvsHGfRAD9AVOQG6JR+P51XEkiv5C++BElxMRjiVs\n8pGEQkhOrlRsHTD3JeIM0pt6unUoBECSXH3cIoqDvRzIOarEVk8q3YYH42jt\nKZ0d9wRBA7leQiHlGyBDpN0tH1BogeXsy+f1cujSJLWY5jskgzkqV4Sa/gOB\nTgU0d+DCEBInxSWvC3X7fOarcLjalVM9iF991L0pVaKcwRX+E9an53u9sQVy\n7JeHQV9mbwtbcKDqqDx+K7LuivaMfOAaBCbNb6H6YnRHotSHzOJ9E4IvfC0J\noXkYJkVJ/NP5ABGBZcmY5mwABscFKeM2nWgK8hepqUjMZ3ONHbVW4v6HS/6/\n6ZLDa13vUy5LKoRktyHsIztwCXYHFa/Wj/5L2rJHcWZjE4BthpQWJ0sb0S4T\nFVkUdmRIOrG9DX/TAphRkKz2NnwqmT+InhUUHxPqWphM1lGKVSGoFcvavAB/\nzvgo\r\n=E7lN\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"3412ad644836acdf464e70d019c36080ab377321","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"13.0.0-canary.7249a3060.0","@material/rtl":"13.0.0-canary.7249a3060.0","@material/base":"13.0.0-canary.7249a3060.0","@material/theme":"13.0.0-canary.7249a3060.0","@material/ripple":"13.0.0-canary.7249a3060.0","@material/animation":"13.0.0-canary.7249a3060.0","@material/elevation":"13.0.0-canary.7249a3060.0","@material/typography":"13.0.0-canary.7249a3060.0","@material/feature-targeting":"13.0.0-canary.7249a3060.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_13.0.0-canary.7249a3060.0_1628533314336_0.558538198381554","host":"s3://npm-registry-packages"}},"13.0.0-canary.4c405863b.0":{"name":"@material/slider","version":"13.0.0-canary.4c405863b.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@13.0.0-canary.4c405863b.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"c4cc8ed4fad8c492fa81701b0aaea3aecf281a80","tarball":"https://registry.npmjs.org/@material/slider/-/slider-13.0.0-canary.4c405863b.0.tgz","fileCount":37,"integrity":"sha512-5F/6gYt40aSs4mp7VBk0yfFuOZvwAZdM6INB3t3XtcVvmZOwTzjxQWmJmSMmb2kfTsgC3arO+cNQeT7XaMznrQ==","signatures":[{"sig":"MEQCIC6Vb4yxFy8/gnA8ywVas1rlr+CLklfVAsJUAaNhXFCNAiAEDBgPISoka8nrdEvanCUuUBiVfkthG72H/Qiy97/jlg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":853112,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhEro5CRA9TVsSAnZWagAAsJEP/iocygUM6L2rB5baVvYt\nF8mI2kRDUwjW50vzoiZnfaJktbyr63FY7ac/RRUF1XqPYHVUuJRLuuWdOcdh\nyyGxcHsEptZLZzG5QLDoRaQy9QzO1G6/23qeOa+wEQqsYRM/uZsVMT4wfHyb\nklQVMwP9/E5xHR2ZFWhbN/9rTfGCRfCj1HJpOA+lqCqwXJQNcZIvOulcp6rK\n7qKFj3H8SLq1qpDvnX9Sp3AMtUc0VY9T8lsW7dJEwzJBLEoB591JikcP91w4\nutviTGhC6+dqxgxykd7D7DxR5lEbiXMLeOmn9je7cqegWfQ0/G/1PTOVsmi9\nbgLf9wmR9YbFiSUKsRfxfVs1BLtHztevTYb2Frau4eZuPgTL/Cvcj67uf7En\nap58esmyJYAT1KYyzDEFyG2D7Xfxc5rS3S6l1qnFodzcV1dF/pyunJ8HkXER\nrmQjmPhLEkaBP0gK1GNXQCHblCrbV1Q5llX4I5YTlpwFq92Uep15Jr7H9dZr\n5mPbrs78EWggKwJozTdNswVmFWGjLiO3KdwU2LzCWrv+n9pWoiYkoi7+Rp4K\nXgT8jGHEd4mBJuC9UDGy6ynWni6p0h0M5ziASFYYLC/vem78o17Aahv+GLik\na8JdTzoZMUL7Vgbp1KP6bpth1ZUoiVriz7uFSZqLkgE6jrMfwabEVl2N1c6Q\nfRqz\r\n=xo5J\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"b3861554313a19a861a5f6850f9df33ae5bc42b6","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"13.0.0-canary.4c405863b.0","@material/rtl":"13.0.0-canary.4c405863b.0","@material/base":"13.0.0-canary.4c405863b.0","@material/theme":"13.0.0-canary.4c405863b.0","@material/ripple":"13.0.0-canary.4c405863b.0","@material/animation":"13.0.0-canary.4c405863b.0","@material/elevation":"13.0.0-canary.4c405863b.0","@material/typography":"13.0.0-canary.4c405863b.0","@material/feature-targeting":"13.0.0-canary.4c405863b.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_13.0.0-canary.4c405863b.0_1628617273539_0.4693331151394693","host":"s3://npm-registry-packages"}},"13.0.0-canary.f4241a42a.0":{"name":"@material/slider","version":"13.0.0-canary.f4241a42a.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@13.0.0-canary.f4241a42a.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"e45b025b1682d180cb0556d292c835a924e0c008","tarball":"https://registry.npmjs.org/@material/slider/-/slider-13.0.0-canary.f4241a42a.0.tgz","fileCount":37,"integrity":"sha512-2Wg3o1lSjCEhoRsPlprPZuDyaUO+FAZwPvBJJ1N2+aMzuWI/6ftnmQObxgJSop50NVv4t6FJ2zfcCoA1NrqEhg==","signatures":[{"sig":"MEYCIQCTStHFb+1u2xg+DVN6zJ6QUPzc1bnryKxgvVKFLhl0sAIhAM0U7ChWR0P4Cyfjc4hxs8mKzvsH/X44LypXO84Dgeay","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":853112,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhFAILCRA9TVsSAnZWagAA/hoP/3tHSa0++vD3mvWLdxLl\no2X0jKT/o7MPDA+2W0U5z9oyIlFxg9cUZVt2BmBTCJa0dT8zOMqY54U5F+lq\nBgRR8nM1qY1pUAZZhI1IySkBrE6C5pc6tHFNk0uc6mMdh/WWQOfK4P7i9ESB\nZ5DTq5mru1xJAeft1IIrd2McOhuki1kKuxhKrr7zRE5EOEX72PGSSokbN2x3\n/JYD6V0qxhc99naPGd+n2GfUIPIwym9NYss8B10L32w7r0Pfjq9IZ/eoGxho\nFk7acZoHOqcmbaQH5LPq+/73tV2UzwjiBRqjmm/MLfOUpX4uXi8Xuhsfpugu\n8TsWIMTZmjIHAasgWUvpQLU/JrI8APQrVowrz83sOSUlJvQMpxYzstlwzOV6\n+iqUxbw8jmh+Buyxm611JleWMYkBICs4E7JwszGepclWUyt7/E/hjsFvHNZa\ni16Zok66xB18FpCenUDsa+jC3cu5YDRmHJ652i7+Jx7mGjpaRlx9/x5dFC1c\nKRh6juu7Re70BuSEVuVWpj0al9XNyAk8gBzTT0bXYA72wlt4RV/IYK7ZmR+i\n+epQ4P5LI7bhrhnMGJYpoWwM6gbO9ceKEvA4yUwvFyx6gp4xnWe3zFVRs5DD\nJdPSD7VKsfFCf5pKxUsVK4q5dMyBlsy3sQgaaGU6skaJKRaEI3ePsayfM4Ws\nTpXh\r\n=oGTX\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"bd97e42dc6a97fb74d92a9cb04e919c5c8af4da6","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"13.0.0-canary.f4241a42a.0","@material/rtl":"13.0.0-canary.f4241a42a.0","@material/base":"13.0.0-canary.f4241a42a.0","@material/theme":"13.0.0-canary.f4241a42a.0","@material/ripple":"13.0.0-canary.f4241a42a.0","@material/animation":"13.0.0-canary.f4241a42a.0","@material/elevation":"13.0.0-canary.f4241a42a.0","@material/typography":"13.0.0-canary.f4241a42a.0","@material/feature-targeting":"13.0.0-canary.f4241a42a.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_13.0.0-canary.f4241a42a.0_1628701194687_0.13269826556982212","host":"s3://npm-registry-packages"}},"13.0.0-canary.0ad12ed3c.0":{"name":"@material/slider","version":"13.0.0-canary.0ad12ed3c.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@13.0.0-canary.0ad12ed3c.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"ca033f13b7928bcf8d338cb02c85d02e7312e47d","tarball":"https://registry.npmjs.org/@material/slider/-/slider-13.0.0-canary.0ad12ed3c.0.tgz","fileCount":37,"integrity":"sha512-ZcCK5R+Om8ANZnCMWjEkLJj/4gxCITBMOuS7SfRpvhamqbvBx6e/VXJEVtd4uUn6hPoTdNBzvAl5422QgQ1Crw==","signatures":[{"sig":"MEYCIQDxoCsSF4NUwR7GXLPrvq11SSCT2p0reEfNqaK0I9m1UgIhAK1U/gejaxpo4io2yw/RN59FUcCYBdAVEZ76OfMD+jEx","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":853112,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhFEEjCRA9TVsSAnZWagAAj0wP/3zWo4SVIsor+QAIJ69m\nbKC63l73m32pacFXhOFge0RgjNWQhhozOTSgnWLGpTKCawEjqkDa9a3K4ah5\nwBUMHp9HMZ3+72oPl0/GlRVj8Bv2Y7LArUlJriRmiWZt2YSbxG5+Er1yP13m\neByZw1SHfEsJf44sE8+VQziPdzgsjPhZRXY3KIfad6Y6/fd1fcdCO1hV7yYc\nM6n1FZ6qwpl/3zfSQ1X2xOoxeYUr5F7bBycgjcIEwjoFa5X2dkLnb+0LY4Qs\nXIVP36YxNnl+cq33fX8gDND2Sxa/+PeI5UkcJPKkNi2SqukoUwFvT78Vlh+V\ntuGMEiDIQaDyWDz9CT/btUWs2Ir33QCYNesbK4AB0OGKn40IClDKKicSMMmT\nqmgvO7iiagDIWoNbaFpOfUNpf49BIyLj2kL37lUxyCSonN/Qc6M4ik1J2PT9\nMEhAm83w5mhA157YMy2MYUACNWQ4Sbujw9GmKSjcuYnZslPeqTMmR78UUnnO\nUUaGaMJ3vzbuamWaWb6Eoyfjg06hE2QIhjItD1r8O0LWSGxAcHLAfYR5McMP\nLVfKJdpPkJEQh6SZ1BnpHXjU3pUPtFrsTVlV9N4OgfkNdrvZvAYmWQtAz4c+\nb4kVnqe8SD0vIlKQwjdK+nvddFQR2GX+I0KLNAIY6s1lt+ReL3iOY4+Qh3Q+\ngtLQ\r\n=6etm\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"db28e7f3596365b1d41f14b53d656a743eb28bf3","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"13.0.0-canary.0ad12ed3c.0","@material/rtl":"13.0.0-canary.0ad12ed3c.0","@material/base":"13.0.0-canary.0ad12ed3c.0","@material/theme":"13.0.0-canary.0ad12ed3c.0","@material/ripple":"13.0.0-canary.0ad12ed3c.0","@material/animation":"13.0.0-canary.0ad12ed3c.0","@material/elevation":"13.0.0-canary.0ad12ed3c.0","@material/typography":"13.0.0-canary.0ad12ed3c.0","@material/feature-targeting":"13.0.0-canary.0ad12ed3c.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_13.0.0-canary.0ad12ed3c.0_1628717347294_0.2067650954043565","host":"s3://npm-registry-packages"}},"13.0.0-canary.077dcfcfe.0":{"name":"@material/slider","version":"13.0.0-canary.077dcfcfe.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@13.0.0-canary.077dcfcfe.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"342e055aef4921c7841a3725b52b024d6879f573","tarball":"https://registry.npmjs.org/@material/slider/-/slider-13.0.0-canary.077dcfcfe.0.tgz","fileCount":37,"integrity":"sha512-+npYh4Ccwi6BmzwFYLVk2rho5aameWauALEhbYrUpvo/vmTdWJBBqEuOKWj6VXDp9k5We+/jl6WYhXMCXKiqgg==","signatures":[{"sig":"MEYCIQC5MZUnh4Anq3+hl9xD1T6046V6CabU4etXdMbfEBBKqwIhAN2Q2MKSGBcTmBIRYh1eGdDuBT/1thUheHAa5S2/57I6","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":853112,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhFWCcCRA9TVsSAnZWagAABHUP/RY9uwv+GH4W2bBbIacY\ngpTKpb4oIARM08sR49umSjSdBCbulaWNVMxYNGpauJIgvww8xu8jwo68TE2r\n0B2iBhfZf0YzxaTxihu0Up9VwE0TmN/7vmpsk9oOp1azu3edh0TtCRwM2US3\nDIbESxdNCEUxCLqlpMNJ2BtB1KIjGzOEOR+/P5GIJmg5iiWCytD6MZzFr1Sv\nG/Ap4n6nRR1iDyR1fAaksFFvM54zWlfCA7Hvb1nyjcHYy/3dbRfidPr/0s5D\n2zw27c3LsbjoSjh9DJRl3BFMjJwSjd8cLwMAV/MxoxaR0fvsNLgv9jkoH5xJ\nCRpPLK3Np6nvVH4eUvQr8yZRwyKskFqvLybtXpPYKRNvsEahooPPP8sOz8gU\nyIXgw7jiOXvOl2dURDmiA/ibNesdE8lzLA/Me4EQhBEuCMbnxmhJY+rZLEcb\nAIAYj7uLGUrwTn5yZLYlj1vXxnCuuSPVNI2n+/GsxQMnXVSKcrFReXIXgQ7J\nfWMSocy9kz+24GFlY6QLtBcdx4seqZHncU7n8ZjOC1RTThPK06zwqWWOkFyy\n8nCZCzgvGuILaa+gjpFcSJmIb092UqJtHhvjBD930TqGp+24e1lzPmt/RsqE\n2pEUpoXl5JwIRkhmDdmYYRA5/rZOqkcrP2452ekrcHPf7+2RUp48y246BC2c\nBTWP\r\n=ajFR\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"0ce840a62c702182bebe1a5f2ed037bc002472dc","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"13.0.0-canary.077dcfcfe.0","@material/rtl":"13.0.0-canary.077dcfcfe.0","@material/base":"13.0.0-canary.077dcfcfe.0","@material/theme":"13.0.0-canary.077dcfcfe.0","@material/ripple":"13.0.0-canary.077dcfcfe.0","@material/animation":"13.0.0-canary.077dcfcfe.0","@material/elevation":"13.0.0-canary.077dcfcfe.0","@material/typography":"13.0.0-canary.077dcfcfe.0","@material/feature-targeting":"13.0.0-canary.077dcfcfe.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_13.0.0-canary.077dcfcfe.0_1628790940544_0.24826210606036714","host":"s3://npm-registry-packages"}},"13.0.0-canary.e3346766f.0":{"name":"@material/slider","version":"13.0.0-canary.e3346766f.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@13.0.0-canary.e3346766f.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"7b6b5727724e80663f015a495b919dff03814719","tarball":"https://registry.npmjs.org/@material/slider/-/slider-13.0.0-canary.e3346766f.0.tgz","fileCount":37,"integrity":"sha512-7e5Z+Uy9Zrz9RWPGR4z9srI04palsqm/KICRD5+msHwnqjlv/sKtmns8UzDggXDyWmMDn3/Bkxn39u7gbbGL2Q==","signatures":[{"sig":"MEYCIQDgGyMQKhRcOJ5OLThlc+XsFL9GTFealMKnJzLv+ovRbwIhANCy43viOLp3+7luQu2BCryG6c825lhX9be6DIvo5ZQt","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":853112,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhFsvkCRA9TVsSAnZWagAAJIIP/0OknXsyTxz3S9cUA4Pz\nrgiA1QrKRWwV7BnYRgxnmdtQo6WlAyZlyAfbCIS02Lo3gdP5Cg8btg9vutMh\nxrdLy6Elf4ZCxSbkA5YvHbDUkY3YasaJOsJG2QTox51q4TMW4prO0ECHfGr6\neS4P0bZxZZJGfvrOQ8cHf0rDpH/+hDEMRKFjb6NjH++e73C1RPpMAp85E3cU\n8IsaPolIa0eeuLZZ+61fD4yFbCdml9QvsXtKOU6cwZjdOfA9cIOfwvf7Xl0F\n4RTJAyUUg2Q/VdrZVLw3nEScXvwsAvqcCgs2VU90qqGei91M2wZupieLKiCN\n4TEkMD8t8w/y6B8Bb24P2tF81Ck62YcRh+dIP/43MCIgpiyPRrW8QSKxpBPT\nPqo3EEco+biZ0v5HLAe4CqAZFXcJCIPMrtQOgV1xyzqyQr8p1DCefU5QRX7C\nq/mTtbS6yDdYWZKugTyFLQyqLI9D260Y0+NZa4LWSJaIt/YfQQ4i3HUhxSFJ\no2DQtyx0QPms3XK+s/UXa6nwr9dCdjWSDOdFFycp2OTJHZuqiSJvIFWYSS/5\n2oRPnxl8WapIqer3kRwlKK4xeI53mJ6H8vkyBshravDdjyVr1HT846/QqeCS\nDlLbJB6sr9iFkuxHYDvb+oCawKdveCkH0P3WBslGZR3DzIntipnA5BwLs5u+\n71PW\r\n=wAyA\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"03da616c76c8b7fab07a24f82209f171a2fec41c","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"13.0.0-canary.e3346766f.0","@material/rtl":"13.0.0-canary.e3346766f.0","@material/base":"13.0.0-canary.e3346766f.0","@material/theme":"13.0.0-canary.e3346766f.0","@material/ripple":"13.0.0-canary.e3346766f.0","@material/animation":"13.0.0-canary.e3346766f.0","@material/elevation":"13.0.0-canary.e3346766f.0","@material/typography":"13.0.0-canary.e3346766f.0","@material/feature-targeting":"13.0.0-canary.e3346766f.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_13.0.0-canary.e3346766f.0_1628883940168_0.28253230199137924","host":"s3://npm-registry-packages"}},"13.0.0-canary.2fb068fb0.0":{"name":"@material/slider","version":"13.0.0-canary.2fb068fb0.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@13.0.0-canary.2fb068fb0.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"66850c62da5d6e04275bf8b314eb09e139900d53","tarball":"https://registry.npmjs.org/@material/slider/-/slider-13.0.0-canary.2fb068fb0.0.tgz","fileCount":37,"integrity":"sha512-wbC9PXS6DW2EHhAPZAgyiIdgDJNqKir28mkJWCLtTjxkiHABD7kbPkjR5PG1owaLb1rH6LcojwddWY51FQ4spw==","signatures":[{"sig":"MEQCIA6E3A4J826PdJjyczHxMojcJXXIMIrw9xvmQMGjQ91JAiAZa/YedRNbM0aYII4rGD9tAF7SDXrvEU0gyp/2PaJj5g==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":853114,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhFsyjCRA9TVsSAnZWagAAn9MP/jPVO+J4RhUCHT8FjB3X\nABWm3GHxxkqAYeLwb/pWnKGZ24bPRbMpm0ZpV+UwLrjTI5rTZD/nUUTlngGq\noV7sOTtQTUcvU0FY2Yei4gfOT60uy9y2na77oMCyUpp84qaaN7L0FBFiRoaR\nG6pOulbH1gFcCkzi2BR5CUteapVFHfIKGEg/xN9dP/EpEBxs6ZLy3jg5odZV\neIPm931rjiZerILLqUo3fIV0L5O7VVTA7BivauQLGETAcSXM10UlX7XmymBt\nBCWXxs5jcys60kRTjto8ixW0NfP67Y05Mw2opEMQAA+lRIa9IaCps+lmu1e/\ncsbamzHJOtE4YdqwD0mQvq/5eFCe4kWZyYs04Xe2X7bT3HQQWoq9pZd2SViP\nVf04QApYRtFjcAy5dTC5cmkqaDrDl/1awKAel17AN04/Lr07YpUTcRXhLfah\ngF5kcMh+wSwxR4IRxFr7ewCgITrdPsESVFe6EYk0Mjxt+8ciKsy0UaxqxW88\nLL8adhKSyochA+Ts92JEzQcyZdo2inA4og7BF3hn0LtZJ6yLYPpG89wpL/Zr\nguqE+R9CcvdruHRMQoZJzzz19ZSqOZm88hvU/Rnn21vMaHmbVV05esL+C3OX\nySSbierW+pMTBVZ15fwMUuu87ndOyQDMn9J1Nq5OdFydRaClbu2kFuUpFwwP\n9BOp\r\n=Dlvg\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"cd1967c0a3a80639eef1dd76a8e579a4456fee90","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"13.0.0-canary.2fb068fb0.0","@material/rtl":"13.0.0-canary.2fb068fb0.0","@material/base":"13.0.0-canary.2fb068fb0.0","@material/theme":"13.0.0-canary.2fb068fb0.0","@material/ripple":"13.0.0-canary.2fb068fb0.0","@material/animation":"13.0.0-canary.2fb068fb0.0","@material/elevation":"13.0.0-canary.2fb068fb0.0","@material/typography":"13.0.0-canary.2fb068fb0.0","@material/feature-targeting":"13.0.0-canary.2fb068fb0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_13.0.0-canary.2fb068fb0.0_1628884131050_0.4622105550884237","host":"s3://npm-registry-packages"}},"13.0.0-canary.fb76c5069.0":{"name":"@material/slider","version":"13.0.0-canary.fb76c5069.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@13.0.0-canary.fb76c5069.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"ced2d966d7ef9866b86a452b011ac2b2abd2ce8a","tarball":"https://registry.npmjs.org/@material/slider/-/slider-13.0.0-canary.fb76c5069.0.tgz","fileCount":37,"integrity":"sha512-LdLHdHvyhWsKSUjtADTBUtKvvkLN25Cm+PrwDemIO9zgjRkHQQ1MR7dAAzI5RDXcVNYZZ79kpql9RoDvJ32Ciw==","signatures":[{"sig":"MEQCIBDw7yXHAMnFMwtjMlbyGRZZBt+h92XnHv4cwle0OVKIAiBjP8c9K2FLoyDPHUNvapYw6gEQfrGViI/PzR4guUQy9w==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":853114,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhGsW7CRA9TVsSAnZWagAAMUUQAKLpxyE1nFBmVZ0XEjUQ\nc/8oXg7CpUV+SlPivN8Vpci+pu4koLaC0ZXAfuF39CTV1W0YxFW6Aj78dDtA\nBiBzJ6qniZboTvceYhTj9ZmF4ytKqKBlVlM6mn/FVWF+ptQleSghmSrcRLZ7\n3hGExYCWSKikU5MSm47ppjEY22nI1K+mbS95ND5xjvjfgZHK2fAyNAaAr75p\nAj3BWtf3maFk1wRai+EtQoR/vd2a8ULN7tATTNXNflv9ZA+GUnath8fnDKlF\nuPfViOOx1Nb1NhO3lmkpqbJC/pT6i+bkOTkrSWmXFApAYUK5H7wA6PdKkZwg\n+VNX67SFSilWeRDAr7OIYSBnxH8e96k36SXCklpQAa+3jt/xRU0PLOi2jQtI\ndjNUg1SD9WbYuUWoiJyLpUZ2bILMvQqCyLs8dVlBiEXUZtqXTxTOGH0Kj6Qu\naRBWRsrm7kyxcVRLe80XP+xgSIaA/3wzHKMv6qIsn+dD7/skwlj+q+AjPmvk\nTFqColgrcgwCmvtdd0un0ucPitKoOb6LMEOlik1sASxQxzR6kzE++Ao6iaeo\nIVjq1iVM0I+AdHa14hYgrJVGZrPbwC2/wQIM8zuIjKI8/YgsDttvt01MAJA2\nX64e1hGL8IkyX5aD6SMF+pKX6OAsoBUs4KRzI5HuRP3oFxqZQBPo2Oo0Y2IB\nSIgO\r\n=XOA7\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"8a969624431e3c1b8d80c2e2a37e5ea5af6bea4f","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"13.0.0-canary.fb76c5069.0","@material/rtl":"13.0.0-canary.fb76c5069.0","@material/base":"13.0.0-canary.fb76c5069.0","@material/theme":"13.0.0-canary.fb76c5069.0","@material/ripple":"13.0.0-canary.fb76c5069.0","@material/animation":"13.0.0-canary.fb76c5069.0","@material/elevation":"13.0.0-canary.fb76c5069.0","@material/typography":"13.0.0-canary.fb76c5069.0","@material/feature-targeting":"13.0.0-canary.fb76c5069.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_13.0.0-canary.fb76c5069.0_1629144507528_0.8633402338894314","host":"s3://npm-registry-packages"}},"13.0.0-canary.457d89aad.0":{"name":"@material/slider","version":"13.0.0-canary.457d89aad.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@13.0.0-canary.457d89aad.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"16eb96641728e705c7a4debb21e654d5ddccb966","tarball":"https://registry.npmjs.org/@material/slider/-/slider-13.0.0-canary.457d89aad.0.tgz","fileCount":37,"integrity":"sha512-w4HR8f/NAG9+fQZmIgDftbA0SvzXVUII3DApR0A0V9nS+B16CbTSZ4dfTBRDYSOhxLDlDK2FO/CzY0BtYI6n9Q==","signatures":[{"sig":"MEUCIG8jOT+f6azXe9nn4VXghOh2+14yBbS4ZUbUl6NQ2PqeAiEAhdZZMsbL8e8rSZGywqiJapE8VmMlWFhPbFEUKX/yPDE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":853114,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhG9QkCRA9TVsSAnZWagAACTUQAJLH8VjFP0Q9+NFFp4Fq\nyIigbF71RYT9yLe2juDfwJra5ECXCWa3Ph91QpP/KEm9hAzxTxQjsRA4zChd\nHgP7PyUzpdx+BClU3zdkphxn6N1yhkg/ofjZHLenNMnYUWNoTc1WvpuX/5j7\nPqJ2yS58n+NIf37Y43xFmJZkxL7Ile2tdXsgWSFlYHb2gzj7B2Ah1GXucWCR\nDPMNrqgrIwOw2AbuhAhxCyaQFl7e4dcSO+4zv60ZBjvPCPoc9l8hvIzrRGQU\nvt0cHx1/dkWxe/ogpJUbCnxzCfTXUFNlG/AkSZcUk2dzaZknOX3zYsEbbd5L\nZh93WXjK0ge7r+DsDGy02X9hhR383GrJj929qZnwd3OLmNXbjhezlxr8GWRI\nAVRo49YbR2L2uYNLxwsV6oXwOJcW6cvrqduN3oiENLjyepLHLE11uG/3e8o0\n3STZahUk6LxKzdWYkDGMUCAnXyEEolTV/5cgUxqTRnopII71MAlglTjZrJR1\n3xZbrpSv/avAESzQ2epZMpPNudggZ+oWuBlshMJEqXympErWDvQiaUsd4fWl\nTO1jq/j0e8vyHYdOKTyDYYN8319ohJrl9SOiotDnGccjmtCA/IzkKkYep4U0\naLF5zjvtMZ5UfnXkepFzXPIyZYGc1n2iQ9SIVOmyAsphgZmsjwhOdQP6wff6\nScHT\r\n=54KU\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"e1aeb9efe0d3f4d8670a6ce174d17d7528b34438","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"13.0.0-canary.457d89aad.0","@material/rtl":"13.0.0-canary.457d89aad.0","@material/base":"13.0.0-canary.457d89aad.0","@material/theme":"13.0.0-canary.457d89aad.0","@material/ripple":"13.0.0-canary.457d89aad.0","@material/animation":"13.0.0-canary.457d89aad.0","@material/elevation":"13.0.0-canary.457d89aad.0","@material/typography":"13.0.0-canary.457d89aad.0","@material/feature-targeting":"13.0.0-canary.457d89aad.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_13.0.0-canary.457d89aad.0_1629213732071_0.5274511265383592","host":"s3://npm-registry-packages"}},"13.0.0-canary.0de2f2edc.0":{"name":"@material/slider","version":"13.0.0-canary.0de2f2edc.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@13.0.0-canary.0de2f2edc.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"026d7e476025feb6074e0824ee0e883a17a0eec1","tarball":"https://registry.npmjs.org/@material/slider/-/slider-13.0.0-canary.0de2f2edc.0.tgz","fileCount":37,"integrity":"sha512-QDJD6KI2HcxSm6K5cgc0Ib6xp00zVH8zTieI8pxT5yFc1xYSCEpt5RHAxY17A6qvWSkDzAY8sK5EuDehtMsKUw==","signatures":[{"sig":"MEYCIQDsGQDNARKbrsNjHHCwZomxUZ7094vJgr9TJ8TBqBIucgIhALt5MERnC6svxdOGLXwJMthO0cNCpEdA22PJ7gO842d1","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":853114,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhHCINCRA9TVsSAnZWagAAqzAP/iQLoBvcFpWhGF+k7rMC\neT8OueHbNfHAsU9K92UUZH6uuPxxqQr1uBOIoeXTFSPHrl3MBTunquVPGyjb\njMpNb2BfPFJeF2L5hhyIqY0DRMb+hdAPB4GrRFfHVM3xeIfJUs1SyjdoNlBS\nTWMBsQAUaWYn+XsRPB0Jg9859ya6cZTxgkezD9s4gjdwf3bS2XiLrmcXJnuf\nysx3LV2dIldBwQnjzzOu19fu9TVVzeSRGcuFIzkKkiHydOy2PeiJVQvuGWKw\nf8VfsK248QS4BSSqDcy+pxVGjDlRvGAe9rTzFTpDdnsCc3/faqxF9M9dZnuw\nw6VEXgK8yLzsCJWWxdHaYOqqhV2HmadbQnzwx97XAZyTwE0wLZ1cdSTjCutp\nF9jJwqLkwZsHPuYpJeo36bOMlD1RdxIto2KzsrkoKQwyZHuUwXqnod6oEj/9\nnox/jYktrlVrlI/7qhdAF9Gd7jx1/nlVWS8plh47F6U76daK4/f4/3A03RWR\neNd3YUhtBoNqxOridOgYy4QP+OjAVo8SfaRqxzgob7NsVHC6fqi55MvquQLu\nhrVmCwW3fBRgMp5EFSX8HDSKSH+kfNefGUp5e97H/55B10QjGjQKlwZUzieO\nKBpCRbiTs+jI2jMKPHt4AZlSoGEW/JDet+XWwlhKu/ZQZNAgHbwcoFHE0TE8\ntJax\r\n=He9Q\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"ecc5e8dc0157f612d4cbc7b03507e3779919d5d3","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"13.0.0-canary.0de2f2edc.0","@material/rtl":"13.0.0-canary.0de2f2edc.0","@material/base":"13.0.0-canary.0de2f2edc.0","@material/theme":"13.0.0-canary.0de2f2edc.0","@material/ripple":"13.0.0-canary.0de2f2edc.0","@material/animation":"13.0.0-canary.0de2f2edc.0","@material/elevation":"13.0.0-canary.0de2f2edc.0","@material/typography":"13.0.0-canary.0de2f2edc.0","@material/feature-targeting":"13.0.0-canary.0de2f2edc.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_13.0.0-canary.0de2f2edc.0_1629233677010_0.5058721661059034","host":"s3://npm-registry-packages"}},"13.0.0-canary.1f9259b9d.0":{"name":"@material/slider","version":"13.0.0-canary.1f9259b9d.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@13.0.0-canary.1f9259b9d.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"c50cd9851d28e30ef8598c6f0f6a45150f57a055","tarball":"https://registry.npmjs.org/@material/slider/-/slider-13.0.0-canary.1f9259b9d.0.tgz","fileCount":37,"integrity":"sha512-/bhIWi3L7xUkTk0k3VcJaaQDPPkzsW+jZhR+DJJcuKHiskDEUWJ/KbKZh/48WQ7TnE9K6qQ/t+u8uumG+/SIbw==","signatures":[{"sig":"MEYCIQDRXUHZ+vORph4zDQZ6d99smMWM88v13CXssrTC0+OKfwIhAPwU1+9nokurwYqPeY/+zNOd41Zd9UhkD+bDBkHKoAgl","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":853114,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhHDTPCRA9TVsSAnZWagAAehgP/R1v0Z2PPHewijsGiIzS\nyNuyJz5vLj44iDMZqFsruDJ8olEsdZASdyuZyY/+uPf780z+/P0w8uNjjLoJ\nHD5DurHWk8iEOLGUZsW/vHyF0A1tOxxZPvK1FiQsfB247bZtHmj/AixLpFe7\numa5S8PdqWZiIS2edd/3I5bO54Q92CpSQ+vNlGHEBAPKRwfbsgtMi4n9TI+L\n22LqcCT3IDdN+hGUjnHMGwzPZ3WXOXHzECVBn4/y7yyqNkgQbMG4RWbFqZzp\nkLd0QQW0iYh0mB5tEfnRbXrb2udSeMSUNCeUYgMFZfeSii0jRO1vTqkljqvu\n2gFeMP2mSFIe0trGdW5x+7UWKh/RT8FRZr+9lmwPQXT1xbn8fFgx0w4d39UH\nzMxJf9mFJ7TxJACpZM1ERrDbyqFM8CMsIqzk3pSz+3/gzT1zaPN8YwHOLiXV\nl4WSRje8B1B34QqtA7H9aThztaF5k3YnXVBPQ05KmBN6p6Zi0v/W1s7wAH4t\n9g2Ob75rkGc0KuaRdq6wDff4uoeaic51xcmf8eR76nJvGx8u/fc8noXhNl/T\nxWq/I+PiiWCwda7lTXHodqIK6wO26u5axFmQEhtWRRNEnzIyacN/+pFUtduX\n4on69qFuJOtObsrjJcQvu9MRw9PqEyBo6srMBeGZ1BFgGGhD9RjFKDVDgAFV\nIFTl\r\n=3QLR\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"4c2c9aa7510a4854abb7f568046a44631dfe3e7e","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"13.0.0-canary.1f9259b9d.0","@material/rtl":"13.0.0-canary.1f9259b9d.0","@material/base":"13.0.0-canary.1f9259b9d.0","@material/theme":"13.0.0-canary.1f9259b9d.0","@material/ripple":"13.0.0-canary.1f9259b9d.0","@material/animation":"13.0.0-canary.1f9259b9d.0","@material/elevation":"13.0.0-canary.1f9259b9d.0","@material/typography":"13.0.0-canary.1f9259b9d.0","@material/feature-targeting":"13.0.0-canary.1f9259b9d.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_13.0.0-canary.1f9259b9d.0_1629238479049_0.05190514906730703","host":"s3://npm-registry-packages"}},"13.0.0-canary.3b9290351.0":{"name":"@material/slider","version":"13.0.0-canary.3b9290351.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@13.0.0-canary.3b9290351.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"fc97927d8aab9277b975d2bf84ab6d6af6d66ee0","tarball":"https://registry.npmjs.org/@material/slider/-/slider-13.0.0-canary.3b9290351.0.tgz","fileCount":37,"integrity":"sha512-bvwCrmQnbq/ntdOnyRspgxzebaSwhgk+O6xQo+vMzLAw4zbUOKSJ1XuUeopzPb4NgkYeX4KCksPIPPq6/MKrLA==","signatures":[{"sig":"MEUCIQC4uvbaJbzXjReS7H6lh7xBFJoAGs+X4eaiy0EdVhMX9gIgDOGaA6flVoicnsNQhra3xy0MZlkjo3QptbCenMCmqxI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":853114,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhHJluCRA9TVsSAnZWagAAtygP/2nAjKPNt0tbTmZGlQEL\n+P4oQuYfF67sN7WQ3fXGKh7P2vMdK7FzX1KXGjr5VN0H/r8Ip4lCZ4GKMHCN\nD1B59KiSDbb8BZkBQHia8Ul3ChMhQ5EKW4YAaz5RUFF8e3rfAcOnxI7cvTwR\n4MG9J4Z3m7KtAT0XTcHCwG6+RV8DUI4bAh+y5B9WspS6XBeDLsCSP60qDyNW\nqdxL7yJIyRcLdfCALW1DekN055C9kFTRXELsVUSlVcYTik60BnVsevsESq7Y\nn5Cd5LVF0eUA1JsDzALCQxSpqjrGOfuJFI/QOs6ZEIiEXGlEk8cRqyKfomdO\n3K1pHSGvZ4eZEy/7Z4ygSAcPkercPZoQVyQaPyQWJP1sQk8NSpyg1cLc8vgB\nm0hSS7/KEW9TWMJiNp2zsBq6b494f+v1MJovMnKG0sP3X+t85fxMnl4ttI8B\nVPCDHe9h9svO0fEe9yHz+rvxaM+p3h4Mc1hN/QMe+zvSWzDmLHiDB2Z4OZaM\n7Qw4SZRR3NCqAotL1egO3kXlLZyHzat0/twoHKhteQ7rxLOoa8P2sc47Hpyk\nYZCxQ32pwjY2g7NnilxFvmld7AWAM3APOPeZMeUpltzMr4CKCZlf+t3m6pcs\nSYuSFE30BCuCoBDowwOAfZzfZkH1N0o1YODiz33dHzrMXPJoeajT/ntUSbHd\n3YWy\r\n=uixz\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"15fe006947f65208dd0e450f8cad53d361b2930b","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"13.0.0-canary.3b9290351.0","@material/rtl":"13.0.0-canary.3b9290351.0","@material/base":"13.0.0-canary.3b9290351.0","@material/theme":"13.0.0-canary.3b9290351.0","@material/ripple":"13.0.0-canary.3b9290351.0","@material/animation":"13.0.0-canary.3b9290351.0","@material/elevation":"13.0.0-canary.3b9290351.0","@material/typography":"13.0.0-canary.3b9290351.0","@material/feature-targeting":"13.0.0-canary.3b9290351.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_13.0.0-canary.3b9290351.0_1629264237804_0.8850326822663852","host":"s3://npm-registry-packages"}},"13.0.0-canary.43d2eed2a.0":{"name":"@material/slider","version":"13.0.0-canary.43d2eed2a.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@13.0.0-canary.43d2eed2a.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"2cd59f124458b10cb75caae6a5af38a1bccd15b1","tarball":"https://registry.npmjs.org/@material/slider/-/slider-13.0.0-canary.43d2eed2a.0.tgz","fileCount":37,"integrity":"sha512-at9/ja51Bf+EiM7y0/Y6TCDgJUjZRghdLql6xOJgnv+eQEJrv8o4OWUwXpL5tZZehA94ybJ31C+4qI1MBhIGUw==","signatures":[{"sig":"MEUCIQCM96dWVBub4CWFjamlPdxN4kpMojRbyUUT7ebiYef0+AIgdht1urPYmb+suQ4xMqJLpo5UDu0BamjucbjRUuXvl1k=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":853114,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhHS8cCRA9TVsSAnZWagAA0ZAP/0blwS355PgU6L7XRGoY\nNZQCan3PRvSvyWw0kV+RxAwmZxhO+xXfksoic63e0VXTM1128PhbgVyxwWJR\nLpEv4X7cnDhvvx0qt61K3lao4cN10nNWazKI1Eafuf/GKJmkKmPP70Gjx70F\n80XziRIlhHEnu+cjZlybMIA7QLNeyfgIiWD/Hmt8juPlDq+0nvDn27kt42hP\neNoR6VrCRAt8Sk3MCrFMzPdhhkNOKKEUB3WyEDFS90T0FqElsP6AP474bZhX\nAyNeeCyMiemmVBKqsq3Kk6wF7nNph4MN2RJslS83du5RnVGesLuSL/5df9hk\nuarRhCrB6EbJB65wELOnjSQKfRaNLN99GmJAzowgACFVU8lfc5ZDFGpWtgtg\nL6uZemwZSKhRxEPrn0k4AeNNV63i6ACulzeSKe16dLKqqSssKWpRENT/1xBi\nzq8DRvdhpKWgcV1rJniWmnVfCKO02vJo6i1hBq+t7IKdLJQpT8TXZQmq91Mm\nNyLJEbBZMDpAovGEekC6mTg5SqEivBdZ5TNtVkYb4aQEVi1cs6jVAXQ7o1Co\nMf0PzA3e/WoxWgJUcZMfXSfJXlLwY4OJCSqSBPZaDf1g4juoYCHeSjA1ecZD\nTe3lfPaDG9J4Ho0KCG/Pyl0q6z3or6f2LFXYexBXiO6ZVecT3r1UHhZ+gmuP\noQdK\r\n=qZOE\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"687e2389ae76da9a31b26968c0cdd837208d3359","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"13.0.0-canary.43d2eed2a.0","@material/rtl":"13.0.0-canary.43d2eed2a.0","@material/base":"13.0.0-canary.43d2eed2a.0","@material/theme":"13.0.0-canary.43d2eed2a.0","@material/ripple":"13.0.0-canary.43d2eed2a.0","@material/animation":"13.0.0-canary.43d2eed2a.0","@material/elevation":"13.0.0-canary.43d2eed2a.0","@material/typography":"13.0.0-canary.43d2eed2a.0","@material/feature-targeting":"13.0.0-canary.43d2eed2a.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_13.0.0-canary.43d2eed2a.0_1629302556397_0.3758438869201173","host":"s3://npm-registry-packages"}},"13.0.0-canary.0a9069300.0":{"name":"@material/slider","version":"13.0.0-canary.0a9069300.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@13.0.0-canary.0a9069300.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"c6641622010583a3cdabff46215c4ceb964eb01c","tarball":"https://registry.npmjs.org/@material/slider/-/slider-13.0.0-canary.0a9069300.0.tgz","fileCount":37,"integrity":"sha512-XIWUTZy3qGPbDxKmjwH+cm2rBDi/ZfYcfa/ejzo/9Hg0Ti8xJxnR3ManIeL1k1pchn2HqcgXsYVG7HlcGbl8xg==","signatures":[{"sig":"MEQCIGYTNaiCy/y7IU1HryzxgCuUyrasDk6E8lea0H7oBPoTAiBWBiMo64ajKtlHI15U7VvjvSZb8wbCpghAOuZotaGNAg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":853114,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhHoQ4CRA9TVsSAnZWagAAaqMP/jfIpIHd+d98THYZdclT\n6BoletkNatspbDkMFLrHW8DsILGZlDtJtmOneonOwfTdXN3c9p4gLyzbnU/G\n7Wi61EW+7qRUgdpw9TrmIvT/DkANhXTgSbugWyYH6k/mUyNxxTvdHjHHhymY\nsU/OZlEMqI8DthH11qkDFzDBZ1tqU5iKUOXp14zf844LRxdTuyfjyLJMKeNP\n8+occqAxmXyG2PcNnPP4mk2xDfiqotxfwPlk8ZUUuNlKOiqyzQCmE9luic+n\n2HBmro7/MVGczsXxPlfbfz91mH8+Jk3rC67enpUxr0wd0OJxSIaLEeywXz8v\npkDPy7IxVMjl2diclvxO2Mc2JqdzlyWBCk4qc4mhsTrcWsHn9yAIxD9PZLQC\nBq/4jcVpd+jzo853Hn+yWa+FpkKRmZFueah9LalpeIU5NCqziduYmAc8q2Ni\nSj+Z+RakeOyTYqwKa/2K4YpEYPu1MghLURkpwKtTu9qYXCIwvSlauDFltsv2\n+ko5P/1wiIaA7iMGRyEAeXp/4b7Cgw1iFCsE8+iqvyBe5FHckdHrGB65/QlL\nMewv/IlDbu3p+/KrCGZoeD3G0+noYunRsI8S8ilzltTCz0EJZwHi3SvOHgdV\nMzHHOq5Y1WpFQXOCd3oojJ8cz7Hv07C+Fqtq31Msq3p4n45wbjpNsaL0EHPB\nCus5\r\n=Bq8C\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"a7249c6c2dd2d786b2134e129bbe3b4ca596fee1","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"13.0.0-canary.0a9069300.0","@material/rtl":"13.0.0-canary.0a9069300.0","@material/base":"13.0.0-canary.0a9069300.0","@material/theme":"13.0.0-canary.0a9069300.0","@material/ripple":"13.0.0-canary.0a9069300.0","@material/animation":"13.0.0-canary.0a9069300.0","@material/elevation":"13.0.0-canary.0a9069300.0","@material/typography":"13.0.0-canary.0a9069300.0","@material/feature-targeting":"13.0.0-canary.0a9069300.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_13.0.0-canary.0a9069300.0_1629389880161_0.32305680905632506","host":"s3://npm-registry-packages"}},"13.0.0-canary.7da413ed8.0":{"name":"@material/slider","version":"13.0.0-canary.7da413ed8.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@13.0.0-canary.7da413ed8.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"4f2bcbd3ee774e14981cc4c9de0945af6b20f789","tarball":"https://registry.npmjs.org/@material/slider/-/slider-13.0.0-canary.7da413ed8.0.tgz","fileCount":37,"integrity":"sha512-LyGYh0vya9TIaiTBmW4oO1X4dDhMOeRaxgPAexH/VsTLPQV/hxwl2ywdD+F6oi/8YdDJXRvFpeJI477HSnqfVw==","signatures":[{"sig":"MEQCIADVpyImHE0zcIahpy4B6jQX22kdBD3kAbbLEQatmUS8AiBNF5hX2M6wZgSvF9og6ecIHvqvx8xF/Su89hWSPeXo6g==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":853114,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhH873CRA9TVsSAnZWagAAC50P/jVZCw6t0Kf7ZWHumG1E\n6oSqHtDTyNRve8PzvROKdR78RXpfrFenTeNsTQFg9lK/Idx9vnGyJN1jrOLM\nFTuWX7ZVRoGg30T1ublinb6qxICF/DTw1DBnnZ/b2afjhgGKS5UinTls5y/o\nJXmiTjrlqlRjlOxltHqliAxmmijm6PI29oUiMaC7EPHpERcp8+ro5xoZUfYG\n6s0jU2CC9OUvB0MSZ1ps15plv8Y/mng+qlEnMWl30OjRkpN54oqIm1WaOX6C\nT00Ig8P3xF766Xwd1vSVhskbmHBeFEPmQksQcyc3gqcGfddpKGlM5KBe50Lj\nTLfa5AvTE9ur7zGYJG5xbGlZgt1rKsnZv6rAIUd50rNuU3BnqxgWkkHmGtHr\nALDz8hyX7n3wOsyxiMAN29Ez1Biw6/yjT4ceDpvJr0VLMdRlK/BSekizp00B\ny+0NL2cCktP5byMkenp6NyOXUEVSpx7nTOc3x5OnXVQMunRYmeoGtO0fGWOg\nksJWG1c6UI9nWfw3Lg6NtDTZpFwtv9sTvhHMF5yMBLMuxnoOw61yx20B87PS\n7lHX3uJRxE2fc4k6zDu8lFtRrja+5AbHv4Op+s2/c9LjxAygbmgyOpYgBnP5\nHl/wlbhDsV/ZuDs4IREHWm3z2wY4JPEonRGALayLvkPKZ794RtmrmG0zCxKA\nqrvy\r\n=LihW\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"66fc8a91fb533a43e898483e7c4e1fac92aa0b7c","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"13.0.0-canary.7da413ed8.0","@material/rtl":"13.0.0-canary.7da413ed8.0","@material/base":"13.0.0-canary.7da413ed8.0","@material/theme":"13.0.0-canary.7da413ed8.0","@material/ripple":"13.0.0-canary.7da413ed8.0","@material/animation":"13.0.0-canary.7da413ed8.0","@material/elevation":"13.0.0-canary.7da413ed8.0","@material/typography":"13.0.0-canary.7da413ed8.0","@material/feature-targeting":"13.0.0-canary.7da413ed8.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_13.0.0-canary.7da413ed8.0_1629474550163_0.4511432949481178","host":"s3://npm-registry-packages"}},"13.0.0-canary.e1e69fd8e.0":{"name":"@material/slider","version":"13.0.0-canary.e1e69fd8e.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@13.0.0-canary.e1e69fd8e.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"4c368baa95a1f2ffa53c349e454cadb0cb165a10","tarball":"https://registry.npmjs.org/@material/slider/-/slider-13.0.0-canary.e1e69fd8e.0.tgz","fileCount":37,"integrity":"sha512-a+hu9Xpdh3LV4VZlnFBrR+0dv7oHuZcidKCwgbHPCgv6G31MqvfZ/cCGrGT2QNKVqH7u2RLjBWyOKD6iaIHJ5A==","signatures":[{"sig":"MEQCIGgp+2mYwIcgQ3XYzGWugvfb41Gh2y8XsPZf+U96lGUIAiB2yGTEAK6n+BYVlhREhnqFoA1ydZcZXq1H+NCL8Fp/Iw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":853114,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhIANXCRA9TVsSAnZWagAA3HkP/32i7cp2SOLqEwNrWG31\nczVYT2XyKXZjCKHdjMU59zGyx8LH1xxsxbLFCtX5wYbEXVg+EqZrfAXqKm+B\nQVT50D0XV18f2IpwOyBt9EJvSTwgOXG6dcE6uUXda7nzMPoVTLn/iRAmji29\nkhKhjsrSdgiJ7sZV/hqJA3wi98xYaTNlA8qapH9cKF7Jy7O0xaf3OJKHAyea\n+V6mXbk3uxiYFuFKoLhC8a2IKWFTsYyBoTAHpxvLoaYYT+Kn9ECfqJtguBl2\ntOgh5vlLcs5YFoOy1eE5GW1X9x/++lqlWqx8ebZqqedN0dh8dAM4pZY4icQS\nF+wza4T30viT3CKgh8kNXT31mh4N+CERTU2emKmU9yU3UjVryKghzH5qfwcl\nHMF6OKHybn+98m56aT+WhMTwi1Dcb0yNdbMi33Tu5eZthhDYxCCsqkzBvGlz\n32Lk6EJ86NF6NWZLs42QHGLLNy6ZGYgpq1a4/NAI+w/z0bN8UzOE9TJUFXaQ\nkpYZR1Sx4B+DcfChFJzCXdp2WIqvG2aE2oZfqi2HDiXPwrQ6iJqptMi+PGIQ\nf/+k39LAuz2OZeVEKOA5Pj2Ev5+aWLVsBfz5bYq6GCgQaRZ+3BAjgh5R8Vbe\niQMQrHbl9eLYe57FNLNcmRleDhBDuJKgqmZDaeaT5tCH9EMi3vNhSbZd0JLR\nUDks\r\n=V8Jx\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"e400b9052366c6e1d6e27533a72ad00199b6313e","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"13.0.0-canary.e1e69fd8e.0","@material/rtl":"13.0.0-canary.e1e69fd8e.0","@material/base":"13.0.0-canary.e1e69fd8e.0","@material/theme":"13.0.0-canary.e1e69fd8e.0","@material/ripple":"13.0.0-canary.e1e69fd8e.0","@material/animation":"13.0.0-canary.e1e69fd8e.0","@material/elevation":"13.0.0-canary.e1e69fd8e.0","@material/typography":"13.0.0-canary.e1e69fd8e.0","@material/feature-targeting":"13.0.0-canary.e1e69fd8e.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_13.0.0-canary.e1e69fd8e.0_1629487959177_0.3219747859258737","host":"s3://npm-registry-packages"}},"13.0.0-canary.f5afc16df.0":{"name":"@material/slider","version":"13.0.0-canary.f5afc16df.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@13.0.0-canary.f5afc16df.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"acdf2a32907eb0f26bc77bc2058950d086483a9e","tarball":"https://registry.npmjs.org/@material/slider/-/slider-13.0.0-canary.f5afc16df.0.tgz","fileCount":37,"integrity":"sha512-bNEWE3DFzNBKbJKpWyQXh+IkMHy7ESICnIdH/d/Yx9gj7qXXEOb/wgSoaP4yBjOwHvK4WKa1en5bsx6FiX+8nQ==","signatures":[{"sig":"MEYCIQD8RLBWolmTocfbzY3FrVsqOTHRLmJvdQFFkK+fzzJ0wgIhAIxBD/fuafD/XuTnoEMf9ZwPJ9BdHBYX3AzAbYXaSkpQ","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":853114,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhIBAVCRA9TVsSAnZWagAAGc4P/3jr3VTgc1KrmD6nE8ad\noMS+Jp30kAkez1iFJyNzB3NoCkGC4xi8Vh01dOmH3/uJIOBns499m1Vv7aL/\noOk2rkGeK2CrLGS1GKk4BX/+JZLAgUcoobUsaYDjx/gGNJAO+7yVbk1TLZAW\n23ASXOKJZXM18Fv/ClbPbCEODXhRbmlFCohBz9iMKLFFWGubE5UzneQUoHlF\nwzu5vGVhTpKQEWv8vrbLD5zkXJwqOJvuTx1+kLpddG+m6vmBUUO7x69TKzcd\nokIn7xIOW5mZdu1mRRRCNJdVLws2OnopdbyWOkHuVBV9WK6AdWr/vhBiv2Ma\n8vMGhOPlZ5gl9nLylJf8ojIhbAjgNgUWkGNtW6kQD6MbJGmcuh6o1+DjGSty\nbLbHUQzGlpC94KsQe+74NLuZ0334HCQ/mdIxejUm3srb5qndTGiOEgr0jixr\nBAV0OzWyRnsqhwdFrkpJB3jxWgxd/+NZdUL3hGFCv9inlu64IVYBMU2WrlnF\nrj4UL7fVh5MLYDheZ1nJvyMMF8bBMsjxuRIYMO2tNGosYw4L4jORj/6ubkUy\n9JKjx8iG/YJ2uAYlwUNrwrvMYl7jxJHzwO13LJ31SbsJcKZLVUvPe39jk58H\n0KRKgCYLnyMk7SiD/5l9ICvQpwnhUYT9nwiRpeyu3a7N7UlVDGhy366wvEFl\ni07v\r\n=RzUK\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"9a5934ef5d223f46f61452bee68b0b45a21e20d6","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"13.0.0-canary.f5afc16df.0","@material/rtl":"13.0.0-canary.f5afc16df.0","@material/base":"13.0.0-canary.f5afc16df.0","@material/theme":"13.0.0-canary.f5afc16df.0","@material/ripple":"13.0.0-canary.f5afc16df.0","@material/animation":"13.0.0-canary.f5afc16df.0","@material/elevation":"13.0.0-canary.f5afc16df.0","@material/typography":"13.0.0-canary.f5afc16df.0","@material/feature-targeting":"13.0.0-canary.f5afc16df.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_13.0.0-canary.f5afc16df.0_1629491220939_0.7857958126527407","host":"s3://npm-registry-packages"}},"13.0.0-canary.28d0d75bb.0":{"name":"@material/slider","version":"13.0.0-canary.28d0d75bb.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@13.0.0-canary.28d0d75bb.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"4dac09da17fe9ac59dcb16c0527c6cf361b04baa","tarball":"https://registry.npmjs.org/@material/slider/-/slider-13.0.0-canary.28d0d75bb.0.tgz","fileCount":37,"integrity":"sha512-VgR4XYWUVxaPARv1tBUvcDN/B7NsIIUuDKJiAizjNGm0zeck3l5Qgh9ABmq2jg6LQxqyL99aIX9zOT3NgItqTA==","signatures":[{"sig":"MEYCIQCPjeE32jfqlfpdhf+iKSgK3mJcrVUaAsTW82tJFgVZRgIhALM0vJP+eGjrCNMRLyzocz7+bGiWhkDEhe2F62oXh9Rk","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":853114,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhICq8CRA9TVsSAnZWagAAZ50QAJ4hjDNZMssCLp425PT/\nQqlM594uZG3WVVuwsEyAoXlcngEwDvunjVuUFoBBNwM82X9w6S6PrIo5ToR2\nHTJ474rP9YqHD3VdFkZXSvRfCJvm/j06WIVnOWGLacyzLIp+ozKudgnIuE9A\nFh//1iAj90iyJSLXLKAZac+VPSQPtf5DnJcpSRLU/aZPdpghjwqlSQCwGXN7\n+qnVh4k08N25w+WV9uBeppydhPbCPM676jUR5c15rIANfKr4QJ+bYKIrvAOQ\n9aBh2wgC+JSXTMJ1dTUDIjRcdUg5XcFoKFS66ju5Doq11kZotC1v9sbszRoy\n/0H4vqCK+WeN7p2idmzwrYSeGSSztwNKFusBm6fzhc4RqPaobcoOeGU+QC+p\nQjTnqabvr1LwfmjdAiOIHssWdaHmWD3ozDODSVzee7w4u7W9xSGy2p4lmUmr\nlXmjiYybIWMv9UOc1/hhwsM2pidjQ6QdOgxmRR0DPULr7RZW1HtxoMS0pi3H\nHNVVCHWgaNKANMsZE8G6/7OH5Bp1aqiXEmv1m3V6UVmfaUVuQPdthvgL6jmp\n//tlakQ7YULOiEpRWwCg+fDcZale1E9s2js0HYXzplUy9Z3lOLIbozthB+rA\n79T9ns7Ima7f50FRGslGzxoWbStR9DhONb10qEoqwyJrQzcdU5yozm3cEtzu\npiG/\r\n=PE/5\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"4becb1aca9e878d432cf8308ec0f14cc50e9699b","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"13.0.0-canary.28d0d75bb.0","@material/rtl":"13.0.0-canary.28d0d75bb.0","@material/base":"13.0.0-canary.28d0d75bb.0","@material/theme":"13.0.0-canary.28d0d75bb.0","@material/ripple":"13.0.0-canary.28d0d75bb.0","@material/animation":"13.0.0-canary.28d0d75bb.0","@material/elevation":"13.0.0-canary.28d0d75bb.0","@material/typography":"13.0.0-canary.28d0d75bb.0","@material/feature-targeting":"13.0.0-canary.28d0d75bb.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_13.0.0-canary.28d0d75bb.0_1629498044114_0.01817634780583477","host":"s3://npm-registry-packages"}},"13.0.0-canary.21ece5360.0":{"name":"@material/slider","version":"13.0.0-canary.21ece5360.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@13.0.0-canary.21ece5360.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"ff1f8b94eb3bda94ce5565dba1f478c0c3e58c0e","tarball":"https://registry.npmjs.org/@material/slider/-/slider-13.0.0-canary.21ece5360.0.tgz","fileCount":37,"integrity":"sha512-b2RunOw9icu+ejc+lPmWM7YhXu8IMGAlGIpyZmggrKyMuPF2lUTpmiOViiwv7/GEXBMB5qIDOMLuNkQd4u+0vg==","signatures":[{"sig":"MEQCIC0CTBpdI15LpCULd49UIq2XB0sU6IJLT6RTnQ+0lqkQAiApq7+BWmbF3I4fxpcyeEHE7Bzxg6atzJND97VoN9b8aw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":853114,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhID5mCRA9TVsSAnZWagAAa9kQAI5YSVioPSI/H+PftRhG\nj8HSYv7W9XI3sz8iSYgm4srKE1qHgoCQy4ds3+Vueb0BCQzPHMy/NR7fuMTZ\njwRC0oZvPmfX+6KBQxTuX46QoZjT54ZFz0EzpLBpwdwYheUKm/IeHpuNqsCJ\nGJmFDlXzk7ledPBN10FvDrmn8SMDMjXtzdYgnA33p003d2ixRMQMUJCaxNtE\nerc91/rvMXNIzsRYgj3mJ4CTRwwXgeqDBb1IBoBhbtq8qFoiapNsvU358jJf\nzHlrOTidFvFBsIumg3CWO4uW+ejGW72WAFNM1BgP22AxPq3FHtLV1wd2qtIr\njGp57VQV/VsPP7UCIPqrbLgnJq76/reAJvf0ghkZk6qMfsRO42VnCH1hwk6g\ny5wkyk7S5euMUOS4vjAebLq6lMEQagZ6DeQvh5OC2Mvk0dMEHDEYZYtkB54F\ny3ESaoobx8O7QRUbLwavklAYNSreVrsReST2srEZfxEgELDmC9D7jzB9+rpv\nw87XT4p/9qcYVaVYGcjP/mPSzLKnOv4jYlImcsVHs7GWcszmv+wGZLv9hrZX\nNe7w53FPVnCdk+osx2Q164N2gdokqNmUaVxutZszSnXSYit+/ehstfRiW1Ws\n5CtpBXvK/GSCOahwDXPVjriDffmO9kQ1mcDj5L8f2dJ5vqOVgfCjsF7T1olI\nr/re\r\n=vKJB\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"9625caffe59fe4a84aea358993c2811ffcf33e74","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"13.0.0-canary.21ece5360.0","@material/rtl":"13.0.0-canary.21ece5360.0","@material/base":"13.0.0-canary.21ece5360.0","@material/theme":"13.0.0-canary.21ece5360.0","@material/ripple":"13.0.0-canary.21ece5360.0","@material/animation":"13.0.0-canary.21ece5360.0","@material/elevation":"13.0.0-canary.21ece5360.0","@material/typography":"13.0.0-canary.21ece5360.0","@material/feature-targeting":"13.0.0-canary.21ece5360.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_13.0.0-canary.21ece5360.0_1629503078481_0.35907340502610663","host":"s3://npm-registry-packages"}},"13.0.0-canary.8de07c02a.0":{"name":"@material/slider","version":"13.0.0-canary.8de07c02a.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@13.0.0-canary.8de07c02a.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"814bd87244f073c00fdf80cabc6d1633a88a68e2","tarball":"https://registry.npmjs.org/@material/slider/-/slider-13.0.0-canary.8de07c02a.0.tgz","fileCount":37,"integrity":"sha512-nbXc5cmCGHlFU6iWS8NmKldg/AokeKfnEN3j/5eaWIEuR1EoZjPG3teGcwiF+vphPojdo/K/rGw/OTn8Vm8W8Q==","signatures":[{"sig":"MEYCIQDOJ+dlJZxiuHHRW8EzhQX+NVveo2tmu7w+w6ZcrNf1MgIhAJl8gEGNJINiktzPDhgeLdhQ7JYenw8TVxUVov/vM0Gs","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":853114,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhI75HCRA9TVsSAnZWagAAjRUP/3lntU6UwPHtkHAbt3Oj\nSk9DTR6gvUdEzWfNkeD6QIBuPO+MccuPFgeDrYCalZxZcVYzZfHoUAc1V9/V\n/S9G240ORdQDB2S0WLJoHY/TdTwNM6rQOmCQlRVNir/9LO5tCF+pAsOghE6F\np0d6lNZIWxyw79mZeGg1f9kqxzqtV2Qtr6uPuf2J3DD7iCrDb9WslA4qAxp+\nwBf1An96hM64vFtPzWCXj8Ty2YzPOeeK4cXct96zK2MAKdwF8IyiGC8N/h4f\nl2+JXjNjRDkoVjSifUeb7YQMSTxfkkx3UQ9DskfyK+eQ5KIJVk5NAoCmMjgy\nAkTDaI0bmBj32NNzumhUzI0eo4j8Vtxnx7dOPbdf5KcBFi2TI0xM+o7+T3IT\n8Elq/jpuOdGWf3eXh/dG+FQ7ouFPymMfHd2JxtGdMBET6W020j+ip29+u6wa\n6hlaMbdcACJYBBEXXfACLlocjOMYqe+udDnGeW0ALRWq35juXyFaRL6ZAQvM\nkeOC4gdpc14tEwTwaDcT198B2nnuOQ7RCBmQnzzkt3VJnGezZRaEKMhOYvOH\nH7cT9bEDOJXmuqVWBm5nln3cMnGBP8aBnr5gNyRJ1QiBYqCH0xml5abQ9pyq\nKN2c56UwrvOz3RF2hD59Qjfb9U7EorZ8KnNZaNYux0qqPKxVeudyrfubUwnc\ngq93\r\n=vyaX\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"e55081eb44f85de06afceb7c0d189f0d358ad60c","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"13.0.0-canary.8de07c02a.0","@material/rtl":"13.0.0-canary.8de07c02a.0","@material/base":"13.0.0-canary.8de07c02a.0","@material/theme":"13.0.0-canary.8de07c02a.0","@material/ripple":"13.0.0-canary.8de07c02a.0","@material/animation":"13.0.0-canary.8de07c02a.0","@material/elevation":"13.0.0-canary.8de07c02a.0","@material/typography":"13.0.0-canary.8de07c02a.0","@material/feature-targeting":"13.0.0-canary.8de07c02a.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_13.0.0-canary.8de07c02a.0_1629732423680_0.5795112156266728","host":"s3://npm-registry-packages"}},"13.0.0-canary.65aa63b0c.0":{"name":"@material/slider","version":"13.0.0-canary.65aa63b0c.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@13.0.0-canary.65aa63b0c.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"90ce40e922a488dc44e6b435babed46ea842c44b","tarball":"https://registry.npmjs.org/@material/slider/-/slider-13.0.0-canary.65aa63b0c.0.tgz","fileCount":37,"integrity":"sha512-P8LJTJou5a6UDsOsFAxFa34wW4Ad5HSnuOKJL4zU4RxR93sV8aYuplSOHKla8YCu8QgfJq1j/XyG0JJXKry+nA==","signatures":[{"sig":"MEUCIQD6rYLITLLDmNSFO8rvHz4cegMKzpnCFP8o+NPEOONc6QIgXQ8S8lP5GHJ7776q6jg6tydJkYLy7LTkHMpzhXUXepk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":853531,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhJRA5CRA9TVsSAnZWagAAvyEQAIotZ1jdsKGTI42gM28Q\nr4zhqkGhZVdeuYumECgcgfLNHENvZQQ+5uegFW7zlWc91PHAVlDtPeExdJbw\nItdZHKAsvnXQWPqagryr8a00sTrZzytBrC9cY/MbquXwyHQisfmYhyWDot0c\nmtkhT1Jg2xZLezNstnOWNEt/tcnWfpvna5ldlmG4hty6+N6PzFqKZLlJV9T3\n4/EvQw2tgrIzx82GK2Ks1tD8cQNTZFzqssTqGJY9/k2rrOIWRBHmgwRgDFvS\nGE60MhcVayi/eBA7dw19U+oe5IFHTkkJ1CfSCWuQjB5yEOiMl1cCcqh8BQxL\n5WyQjEnO7Vx/0TSHI27lRfiBxbLVXpB+t1WnMg9Jbk5tP36OCKOaeErn/UoO\n7j9jflPUY9K+zqCy0vk3pFg58YrwSVBXx2TjGb76GsxAOva53jVOOw9hA2Uu\njRv/DrMzPN6arKULpgANY5mmUSEVDB9SSOO9MQnvzr2dlJt5aN28S+FhVd0d\n+Ddzb3TmECIxJNh2rWqfxmDnc0FMwMEQqSeoLCHpMB/YHcp8ampCHTJBvyLd\nU6sUaZBCHJGN/bVQIuYPK8ndzKu30rQokPVjjzv7HA/u16jiJSGvsjLL3/dm\nSJr2vjg0L/fVUy1QKgRKFTFeCMyrr0duxQRh4RMeeceJ5K54EzfOrvrBx6Oc\nSRBe\r\n=WZpr\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"0ac2dcf03064da43ca7eb352045fd4da0af02200","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"13.0.0-canary.65aa63b0c.0","@material/rtl":"13.0.0-canary.65aa63b0c.0","@material/base":"13.0.0-canary.65aa63b0c.0","@material/theme":"13.0.0-canary.65aa63b0c.0","@material/ripple":"13.0.0-canary.65aa63b0c.0","@material/animation":"13.0.0-canary.65aa63b0c.0","@material/elevation":"13.0.0-canary.65aa63b0c.0","@material/typography":"13.0.0-canary.65aa63b0c.0","@material/feature-targeting":"13.0.0-canary.65aa63b0c.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_13.0.0-canary.65aa63b0c.0_1629818937694_0.21083790718527973","host":"s3://npm-registry-packages"}},"13.0.0-canary.15981e9d9.0":{"name":"@material/slider","version":"13.0.0-canary.15981e9d9.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@13.0.0-canary.15981e9d9.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"056425a2e971427347b2a4546747e65c14d30a32","tarball":"https://registry.npmjs.org/@material/slider/-/slider-13.0.0-canary.15981e9d9.0.tgz","fileCount":37,"integrity":"sha512-dE0MxSvNY2ZGBOH3Np6qscK1pxRKDTNmRy8DnyX6a4GA6M1KBoTVIht+/YOkzM0xD4FKtR5nb1JjMmdS9ZWicQ==","signatures":[{"sig":"MEUCIEw6rMsybQX5o8iNMc8SkfouBO7PjwhfX6MbzbEkzaZTAiEA+Upx4yTyt3WSx/RZW5ON1pn5+1BKjAEJMlZaFNHN5zU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":853531,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhJRuUCRA9TVsSAnZWagAAbskQAJ0qi/0HqPGEKDoOdwis\nBkFzjA4kpV/GUqBUV+E4eFQkRupLQ5++62X4oHa1xC3oLu9SqAM06/fnsNuV\nM5fulTEHmIFn0b8IohMm3MWFRJvHar2MBR6VC0+TsnoIzYQLTPsbsBxewf5d\nbR7VVAL5YRSLTe4sq8XVEgXHSSOPpvRMQJHGR6X4f5FrrOgKlDiKofZEHBC6\njveG7q92VN9+eZ6u43YJ7uLFu7Js5Wu3u43WFxfEo+kGwGodcVokFQ0RrxJH\nqVu0ookc5dwTyucFXuZCkQcdAkBajf7B17gtlu0TVbglI7w1CeOx76n9FHb+\nqEhO5JMQwce8U5GLWg5uNhXPn+3EpHSTToeZ24u3Hd9hOQtwcbUGb78scbv2\nY+4KKAd3hW7Kml3gTyhaZj4Fiup4k9UfZ1/NiGXXvDRFc7z4KV2+u8U6rMvi\nm4/xbwxCl8oSsuwWcX7xThPruP1HBLlcicjxAyT4gMeGemA60WPAXlQywJZC\nP5b8QLk+41X19lFBuyPEukgxUvqLLUXv+uaA8w2dmyzlKaI9eT1OKQAEuNwf\npa53iRLASxwHWtH2Gl6d5Cr5yzTLMjv1iPiEFx0rY5wr70ua4ARtcYIGe2QI\nr9IpBkJvMtr1x01Nkw7vl9oAY3Y2kgxOJoSRkn1LRuB9/6mETXKHiC2WHm3e\nrtuF\r\n=wTJT\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"93acc5a9963b30cedb03f35eefb49cd35c93656b","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"13.0.0-canary.15981e9d9.0","@material/rtl":"13.0.0-canary.15981e9d9.0","@material/base":"13.0.0-canary.15981e9d9.0","@material/theme":"13.0.0-canary.15981e9d9.0","@material/ripple":"13.0.0-canary.15981e9d9.0","@material/animation":"13.0.0-canary.15981e9d9.0","@material/elevation":"13.0.0-canary.15981e9d9.0","@material/typography":"13.0.0-canary.15981e9d9.0","@material/feature-targeting":"13.0.0-canary.15981e9d9.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_13.0.0-canary.15981e9d9.0_1629821844494_0.350822159377846","host":"s3://npm-registry-packages"}},"13.0.0-canary.fa7520f62.0":{"name":"@material/slider","version":"13.0.0-canary.fa7520f62.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@13.0.0-canary.fa7520f62.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"228f75679278b4419c077170705451ade8302d8b","tarball":"https://registry.npmjs.org/@material/slider/-/slider-13.0.0-canary.fa7520f62.0.tgz","fileCount":37,"integrity":"sha512-lPddBdX0XPzcnsXYWq/d8I+radms/LFN2TO4I43SNGFIA+xatum+UbmvbIL2SGFiExq/wxxwkxDobb5FfGPrNg==","signatures":[{"sig":"MEUCIQDXnPCksj9aOIdloafdLwLAX099YW/+2nuhrPa2FmxwqgIgHbvHQCUsOKaoUDcClVICMgDutATBMGQzVOJ7R0xgpZk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":853531,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhJXJ6CRA9TVsSAnZWagAAzgoP/jymMflyBAxlX6/C1fwH\nlb4r44TQ+owuDM3881WKIkhmtdlAqgpvL8Q7duhT/mHVxONER4PSi5ELAGPl\nrbeVYW0yO3SrYDcToBEbsfA8Yv1Yr7jFAJBtkS1HUh+CzcgwXQxawwmT8NLa\ngNArSgqZMAXMWfm9Sf3HoENxtchwBWQQL9zArx36dQByiQvtKglJ7YmiUjAu\nKULDJUA6SWQFutoWAX2rzzLkIjV4x62i1xGDX08QrIttFZ6o2WWUUx0iFYFJ\nD65eiMXnCk8P5BQfCTNYf0rdfPqYiEnhock2qn/bICqms+wRoP3FC/DH+sE0\nVH25py9m/XNPd1C8yk09SEs4Flu3Wd7e0nxEqrgIEVYsuxYtiDiCPwBlT3Rm\nE5Jw+ipi6X4LlyzC23pqWvLPSgXEjSe6wro/uBlU0RL0LdLCpnvAa6EM/gtf\nGghejQSlJtmRB/O/BKxRi2tlNV9ecmjDuETIWnjaCPL2y5/vM/uTxgcAJIZ8\nXXYGnYk7TPlykOCEid5Zoiuke2su3GAMcKOZGef3sKwU8TW8HoPt5MoVzLOP\nmiobJqdfZTVof+u82ak8OjePqKu+oiPqiBnj77UCCPzeh1ZoL//4v4JDJeJJ\niQMCSHFwMKcRIuRzfkvtcML9e82R2/BJRxhrIjrQaZBpVHMigG9mWDKutPwk\nIbOV\r\n=EpCD\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"ded8a7ce355618969092a7bffde0da813aeec162","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"13.0.0-canary.fa7520f62.0","@material/rtl":"13.0.0-canary.fa7520f62.0","@material/base":"13.0.0-canary.fa7520f62.0","@material/theme":"13.0.0-canary.fa7520f62.0","@material/ripple":"13.0.0-canary.fa7520f62.0","@material/animation":"13.0.0-canary.fa7520f62.0","@material/elevation":"13.0.0-canary.fa7520f62.0","@material/typography":"13.0.0-canary.fa7520f62.0","@material/feature-targeting":"13.0.0-canary.fa7520f62.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_13.0.0-canary.fa7520f62.0_1629844090367_0.3296791787931377","host":"s3://npm-registry-packages"}},"13.0.0-canary.ce25bc3ec.0":{"name":"@material/slider","version":"13.0.0-canary.ce25bc3ec.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@13.0.0-canary.ce25bc3ec.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"3e488b9c9993a77de92556a900f2c784775379c7","tarball":"https://registry.npmjs.org/@material/slider/-/slider-13.0.0-canary.ce25bc3ec.0.tgz","fileCount":37,"integrity":"sha512-mi9/n95E5pbDIg5iJ4poQvXvZ6CfijxZbtGneSr34oXNvt8VXwBSrpO31IiwaNjaR2dsaYqoCwy98jFofKA9YQ==","signatures":[{"sig":"MEQCIHUgxakTfWi4I//xF+rqz4Zx9ZQPm/SioJqHN1ukc4mGAiAYPWBpOVMSca1rV2uVTrCgw4K66Vc4+9Q+53YiPCR7hg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":853531,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhJXdRCRA9TVsSAnZWagAAwIEP/3IrK8sfoEisu350chpM\n8oGq/fYhhLiHCNcGnBUD9ifMB3cF6er3KY23zn0ycCZNI8AYEVTuEuicTfkJ\noQExvECEzhqPa5k1aTuNO6ne7jSt0folPA/6YJoEYhXIatsFmWX7gEeZyDdn\nv8EIl60yXBqT/6uUnF4bRtqjpmjOBpN5iFytIrJXPo7YreRjK0A3PQyVSnhw\nCaNOBqTyy8blh4F1h8KOUJeVppGVVRQZcqSZnYVMuOZlikH0z9UXaIJNEwuB\njPxytDGGe5M3vE02T2WA/fTJ/a139VhMv4s4ZxLVWHkiwuSt/rao6Gdgo9XV\nj4DBILiKuUUXWFUb63FIIlDCmbYLnhkATEp+3GsnTuyFs53JEeRfyX0JBXXW\n/8LepLXT8bi6lCF17xiwFaQBif/1349Gx5xRsIfT73oYKcXYRmM0eIR1AEui\n6VWBsWdv4qBCxsougTh/xJrPfHpfN+brq3t8HTDnDWdzdI/PEDYq9XoaZYsh\n1ZMO0MCVxgTlmjYLUXVvJlK2yBpezDwaEzF+zQnpV3gjgfMs94y/IUnfVIfN\nzKxPeGzBv+0MBmIseMJ+JrZgszXsCZoLqVmUliB2CndKOsfAXjzrTWYuNKnN\nl7LotCgEbMVe/pvcZ1VpUA+epwFE1bPG2doluHmUGQ8yk4B59tIUiQl7ePvG\nK1/I\r\n=/nyr\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"5296a1abf91023fbe0806f06b5b5fce528c40509","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"13.0.0-canary.ce25bc3ec.0","@material/rtl":"13.0.0-canary.ce25bc3ec.0","@material/base":"13.0.0-canary.ce25bc3ec.0","@material/theme":"13.0.0-canary.ce25bc3ec.0","@material/ripple":"13.0.0-canary.ce25bc3ec.0","@material/animation":"13.0.0-canary.ce25bc3ec.0","@material/elevation":"13.0.0-canary.ce25bc3ec.0","@material/typography":"13.0.0-canary.ce25bc3ec.0","@material/feature-targeting":"13.0.0-canary.ce25bc3ec.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_13.0.0-canary.ce25bc3ec.0_1629845329209_0.1539151241833281","host":"s3://npm-registry-packages"}},"13.0.0-canary.12f5622e1.0":{"name":"@material/slider","version":"13.0.0-canary.12f5622e1.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@13.0.0-canary.12f5622e1.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"31489b009182d6af0084933292809fb0e81777b3","tarball":"https://registry.npmjs.org/@material/slider/-/slider-13.0.0-canary.12f5622e1.0.tgz","fileCount":37,"integrity":"sha512-76xiAf2/Xp7pyQKh5M4bw5wgpRPf33APlYX2FQCkghTsf0eC0qhPnczjotNqV02xnQ+OfgHnaFPIaK+2xSoqPg==","signatures":[{"sig":"MEUCIFwLSFiYwavVSmuAqHlKOwfhrwk6sMXV6yYHf9vKfIfyAiEAp36TtiRkLYUt7O+EmftAmJFAp1CQwQxoFeEQi1RlH/E=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":853531,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhJX5CCRA9TVsSAnZWagAA8P0P/RkjDxx5ygcmpkWI1hLd\nMUgsbfEi6yQUY8EkFaqLCEsme6G/RXQYomqTBdnUshy29tG26mTFbI0FVhxx\ngjzHP47eW4TI+O5mRAsju26pJjtSLqZiYYcGXUwMqs1yG++raPQrjRznUtS7\n5fLQhGDQbdvKY8aCEXt38cBOYFUUFTmdrO2DduuiQQWAgWN9mFXiVxmJ8rpT\nQrWvVUUzifQxvj7TDNzxmm7kDGCmgDN6mdwfFeXchAV8dwT52cDl1TphPgUI\nfCho5iVqAAVlRg22EtmQWWxeWbcPBElCD1NwqhlLlbt0l1NqZCIMezC8O0oL\nrYlVohACOeKotUW9sodNQoQiVhvTPioDzg6S5waczdX1qMpW+ZtPlDi7vVUt\nrWCuNV2MiVkL3cY7pAr3m6Niqy/p1J9kuJAgncjl3GMYTU7YSurXSTPVln1M\nnHIrVc0Ki/56HyMHKG3rMrCUF+uTvGT2O6aGHjllSHuWK1akklO+JtDRedgE\nu6qKAaZwreS9jQ6c5tsUbsS08ZKl7x7xOEmhJLS5MZc/Tws1FDdjGBDAByuN\nvJzOdIPqb78TF66QtH2ReQNnNDN+GGQQH5j10Lc30PJGPAIq1thZVRPzFQnb\nvA2TMcy9VYgImGwJbCzLpqLdOaCBmJtFu6uNPj84N+HJM70Cp8F+qO94mVfs\nNsRv\r\n=4MOr\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"2cfeb72e6002a5f3cf296794da5216b3114fbbc8","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"13.0.0-canary.12f5622e1.0","@material/rtl":"13.0.0-canary.12f5622e1.0","@material/base":"13.0.0-canary.12f5622e1.0","@material/theme":"13.0.0-canary.12f5622e1.0","@material/ripple":"13.0.0-canary.12f5622e1.0","@material/animation":"13.0.0-canary.12f5622e1.0","@material/elevation":"13.0.0-canary.12f5622e1.0","@material/typography":"13.0.0-canary.12f5622e1.0","@material/feature-targeting":"13.0.0-canary.12f5622e1.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_13.0.0-canary.12f5622e1.0_1629847106432_0.5251211829870106","host":"s3://npm-registry-packages"}},"13.0.0-canary.d97f8f133.0":{"name":"@material/slider","version":"13.0.0-canary.d97f8f133.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@13.0.0-canary.d97f8f133.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"359fad3b88f6c8f513b73a7b445ccfb13bb2ead2","tarball":"https://registry.npmjs.org/@material/slider/-/slider-13.0.0-canary.d97f8f133.0.tgz","fileCount":37,"integrity":"sha512-vvt4KiWYJjmlPimEs0O75HhcrrrjuvKEQxW24JZFLNDEPq0sb1bUoF/U3DAVvSzcdc8ZP3bTNFmhGCYl/CRYjQ==","signatures":[{"sig":"MEUCIFkY8Bvxl3jan6h25tTKKhNbfsX6LQQyavhnSFHiFH1sAiEA0fuiMu6DDZ5xCUN6XvmOBrvrC8p4ahsnIWhe5DRo+RA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":853531,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhJoz9CRA9TVsSAnZWagAAWtwQAKCIK/ndeshT5AGtAqVe\ns8Y6/2P/q+0yruXO7FzXxkHIotXfbU9a3ZW87mWshON1Nivh6ZhjKXtDScMW\n7GpJ1SzLc55Wh70Qn99uj1WHtdNUXZtDoFYE9JpDVJZwSkQCX6yB0DKN7Wa0\n//IUi4WbVAju7W28Rg0zlJUTQEpAhNtondhuf4QM0cP93zmnMCnzENwRakkO\na3Jh7OtqOfU1LG/dPX/xXm5gUyKCqXv8dW+iVswJ/WxccErZmH+7mX4EEeZE\nOLDFk8S9rswJnOVjwnDT3hCVpcX4k7+5nuctnT48/C5OODzACYJVJLYGOJPC\nNBDpmkCK0APfyvskHkVA5W0Xoy+aPI98Q+fmqLQwKkBcEsi+kzJN0L6xOq5U\nFiJ3psUIH5iKhY49lPsECwNemtsTqQ0Pe+ivbY+Q3jrgmRrfRZrV0BDkRN2d\nVCmEHAislvXfSqRZPz+GkPlOUAjWfe9n+60hluB11X9KW2SwD9/QIlqHAtOX\nMoe9mStlDfmwRKXwn/s4VA1B/5ZVCqwT+lsctCFDcWgCK5oRC86xuZDgqfJi\nHDpL80gL2jDMVBem/MPB4N2Mw0x/BEpunQIUUcZFATro+h/fjf1HjbJWjtqE\nMRWoib9zWcTf/UbgrjjP5MslN+GhDmfWZRmvqyEZ8RU7DCUhOnZ+7sH4Fhwq\n0dmO\r\n=+t+f\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"e7295f4786bb26bbc05939b4d6e3e42f011cc033","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"13.0.0-canary.d97f8f133.0","@material/rtl":"13.0.0-canary.d97f8f133.0","@material/base":"13.0.0-canary.d97f8f133.0","@material/theme":"13.0.0-canary.d97f8f133.0","@material/ripple":"13.0.0-canary.d97f8f133.0","@material/animation":"13.0.0-canary.d97f8f133.0","@material/elevation":"13.0.0-canary.d97f8f133.0","@material/typography":"13.0.0-canary.d97f8f133.0","@material/feature-targeting":"13.0.0-canary.d97f8f133.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_13.0.0-canary.d97f8f133.0_1629916413341_0.8109454212517366","host":"s3://npm-registry-packages"}},"13.0.0-canary.d86fb6fac.0":{"name":"@material/slider","version":"13.0.0-canary.d86fb6fac.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@13.0.0-canary.d86fb6fac.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"8787e111a0404877fbd188cbbc0e58d5f73864fb","tarball":"https://registry.npmjs.org/@material/slider/-/slider-13.0.0-canary.d86fb6fac.0.tgz","fileCount":37,"integrity":"sha512-BTWL9XI3+i+D9iRG9G+nMSy7qgpagLVkSXFjhMNAc0VTshn2I4bPw7gW33cRuYAluxHauljfniYbP9JGicBN6Q==","signatures":[{"sig":"MEUCIFrbxtqZH/ydTGWjlucmMqIIvjjxKtugAxVg/HivPqbfAiEAiUabxkzfQp160uTNjO6rj25IKRCQaRS2OsRj7cch1zE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":853531,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhJpHNCRA9TVsSAnZWagAAdzcP/i07YAf3vYS4O7Sjqilu\nUrPGsBQdCuo3oRgCKdrH5yOGWye2YZg7fvAF5uwSelnFYgdU7cT2e09fbrk4\n52eTSQ4ieemFmig3np3tY1eyNLh5bnkIwyVr6ApGaVCs8CO8pP5FhjcvzzJk\n4GC9uwxRlD0D2uRFjXECJHAVNsOXuAmemObErTKSmRXhmAqb+VJhPx1Oze0h\nV3rl7Kw3UMUtxqDL4G3ey1zBI6ar2MEcSOx1iJPfmh007Y21bFSH5NWRc06S\ncwtZNozkRuBFwm3l10o27kNBbsnxhwTysdITM2FYW8Lo+Vf3Iwi315QXMXwr\nNdy6k/9GyBpdzYEXitn2HRAlfViONA/Glzhih7NKr7Vzh5nqPQsmFZI13KCD\n8jqFfBihtoDz1Yd2UXKLPfX9MhgTd3qdln7symc+ew65k3GUBLh0DU+SM2P6\nBfFzCNqW3yLDTQRNUPuMfegGQ8KCngMwippJ+YodvwVyNOJvGwnAdG5/q+hO\nKPAiL5UdfmVYxBpGhgTAxZYpiZDcI5HIviY3lgh4TiqM4vBZP0oTA1SKYduh\nuV0KxSvg62tBJZokWFxRayKBJxXf7wj1zX6kypqIweJYGWZG3fD6l+vbVNj4\nznDLhHDn4Lb6ixj00URtOWIEX6+CpMwbr6E/ehQefjSv+JhdLEchTKFCX1I4\nPX9f\r\n=G5Ko\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"35d13d1a20fe14c295e8589fe5960bc9b4da1925","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"13.0.0-canary.d86fb6fac.0","@material/rtl":"13.0.0-canary.d86fb6fac.0","@material/base":"13.0.0-canary.d86fb6fac.0","@material/theme":"13.0.0-canary.d86fb6fac.0","@material/ripple":"13.0.0-canary.d86fb6fac.0","@material/animation":"13.0.0-canary.d86fb6fac.0","@material/elevation":"13.0.0-canary.d86fb6fac.0","@material/typography":"13.0.0-canary.d86fb6fac.0","@material/feature-targeting":"13.0.0-canary.d86fb6fac.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_13.0.0-canary.d86fb6fac.0_1629917644975_0.7621375978218621","host":"s3://npm-registry-packages"}},"13.0.0-canary.e8554dbbf.0":{"name":"@material/slider","version":"13.0.0-canary.e8554dbbf.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@13.0.0-canary.e8554dbbf.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"3876835ffd1d6627d799ea60a228b7c48cd91629","tarball":"https://registry.npmjs.org/@material/slider/-/slider-13.0.0-canary.e8554dbbf.0.tgz","fileCount":37,"integrity":"sha512-IUTFxnmadBbBhqUBstngVHOp/WCV+8abpsSoFwjQ6yZS2Gd3GON6fMZOAY1WdeQU6VdxosiV/gQYXGXxAJzxMg==","signatures":[{"sig":"MEUCIQDIDUQhY9IFFHF3y6Xx5Ipa5uTcaHYbp050GKlAuNqongIgMuMZbLhMs/wyfFe4KQWwyDKKxLVrRVDrmOXnK/jrCCo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":853531,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhJr1PCRA9TVsSAnZWagAAMpYP/AtcsSuQ+GW55hGabSOs\nPsUlNxPt23hIXUo3BrOCt7BaXDQrkyHbfd3PeFV7jcdQ4QcCX+z3FL3irV8w\nvC5DcEYwCNEwJkSKhr3WlUcpk/8FJReWl19SGdDYpmeIKdeXE9KIC6QOUs57\nwk8IW2wn8p5iSc/ayJxKobd2/5ONnS1Wtg2HjIny57p7i9smyqSytMTgEtYx\noqKGS0h+mX3yJ1lgncIw6t1p0PmmmRg36+uiuye2bKlJSxuTO06wBwiekzKp\nf1seGv5T3HfFd7r7db+V2uVkHlF8r5xOIaCUzUVAt7OrZ6BARtTGlDiv7M0j\nL2pMTUHa92Vn/0wOiWiwEZ0LFNGYxPNszbLu7stjxnefNsRQHGf1gEnBR6H3\niRhDQLxvtnVA8A1vV/IJ8RgEw1m4FZ/ECHNpbPJYPsh44FVvc5USHMpYsTIY\n32GJnc93yk6HJ7yNtuAlcKiD6EIG855fpceLxgdrEZ1PNlL6vYUPZfSjsL/K\nCXIroDfPdfA21bcj8EEZ8fgGQs7gtDXn9df+/rPuSv6sTjx07I2oLF0I9Ajx\n7orKzSeU7LP/QE3dunc2s4dsB8anOyq9L+f5M/qkud/Pdh83bRnq7yzfbs/v\njvM3vzeFD8OQ+7iVN9LkSXyc+A46PGFCr3vWQPmw/vurPXJjCgIdBvh8keWS\nWZnn\r\n=AJjw\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"da636a8d32198c6289df3bcef39340bf76cf8265","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"13.0.0-canary.e8554dbbf.0","@material/rtl":"13.0.0-canary.e8554dbbf.0","@material/base":"13.0.0-canary.e8554dbbf.0","@material/theme":"13.0.0-canary.e8554dbbf.0","@material/ripple":"13.0.0-canary.e8554dbbf.0","@material/animation":"13.0.0-canary.e8554dbbf.0","@material/elevation":"13.0.0-canary.e8554dbbf.0","@material/typography":"13.0.0-canary.e8554dbbf.0","@material/feature-targeting":"13.0.0-canary.e8554dbbf.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_13.0.0-canary.e8554dbbf.0_1629928783718_0.32520922303922184","host":"s3://npm-registry-packages"}},"13.0.0-canary.877e3fb0d.0":{"name":"@material/slider","version":"13.0.0-canary.877e3fb0d.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@13.0.0-canary.877e3fb0d.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"e0ff5cd1a7a1e5135b565d56c80307c51230dc98","tarball":"https://registry.npmjs.org/@material/slider/-/slider-13.0.0-canary.877e3fb0d.0.tgz","fileCount":37,"integrity":"sha512-XT/3ZcigoXd/VhGNWVoB2V8oi2CF67+l5W3KPt+d5DHLoRBlWiUWadBhhXtMeH7pBFrGjJNwii60IG5FIIKEHw==","signatures":[{"sig":"MEYCIQCCB576BSMmYsLf63Ypu1qQpAWzLkWcdb4O+9GPOtT59QIhAPn8XCA+8dZZTnK3tq0tprDcof0oG1CTAaWet7T3YiPR","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":853721,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhJ7VxCRA9TVsSAnZWagAABX8QAJ8qESPymY2bjO5TvgtA\n/Hb6yblkUnVz8FyQbAEuGcBoHT85CsSZmXa6e/ACrAUbyypeHiV2/1vV9Mni\nf8DtkHsTT9LRJ8t7IdL53VrxFmdfX800gpEdlZJwrRV5Fp6g/6/kcklD0wwt\ntap1eS+r5IctI3R/tekXjIkOjvVdu/KD4N0Fl5eBEoJrvBZL9+AC1YL7MbwT\nreM65V66fUy2aBdejRWuZeMR3L67jWxZpvg9OKm+kdCqrOaizRd4ynOhDQZj\ny+LoRXHbZ66darejYa8M6qMKXxBC0Walrm6hOAshYV+aLFbGfihtQ5yKqKWo\nmASB/8n5jqweRjF58oh4jj3wT2WORoKPRamaZmMmXuzUuDz3ki04t+FwuaFU\nH6UCvzdhGQAIdYkT68d5TFN8f0daDeT7/2G3nL8mCvrdrTbpZ7zblq7YE4a2\nQ75CVNteob9YEodLheDQtQdxJxetFbznFuLUXw3YVrBBHJVKPL1RAooeCU3b\nZWfVoopiW570hhXNFPllA4QMnE156tT94cS0XTe3/kGfBQTbgijuzyChYflZ\nw4/IPQRCZXuH8aatNu7vcmttnqBbakU8OQDKT3Bl8E8i3Sb1iznmvDdGIyDi\na7hvhG/gOobSA04TRFahx66jAx0a5QAaRklOHQT+0FF4g2eAYE9abDwuzZ1B\nKO+N\r\n=sCfa\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"849a956f7ad3e0da0840469b917eb66537c875ff","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"13.0.0-canary.877e3fb0d.0","@material/rtl":"13.0.0-canary.877e3fb0d.0","@material/base":"13.0.0-canary.877e3fb0d.0","@material/theme":"13.0.0-canary.877e3fb0d.0","@material/ripple":"13.0.0-canary.877e3fb0d.0","@material/animation":"13.0.0-canary.877e3fb0d.0","@material/elevation":"13.0.0-canary.877e3fb0d.0","@material/typography":"13.0.0-canary.877e3fb0d.0","@material/feature-targeting":"13.0.0-canary.877e3fb0d.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_13.0.0-canary.877e3fb0d.0_1629992305678_0.25632012041196983","host":"s3://npm-registry-packages"}},"13.0.0-canary.6236f3576.0":{"name":"@material/slider","version":"13.0.0-canary.6236f3576.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@13.0.0-canary.6236f3576.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"bbdcb399bab897d251ac896225c942cbc5b00459","tarball":"https://registry.npmjs.org/@material/slider/-/slider-13.0.0-canary.6236f3576.0.tgz","fileCount":37,"integrity":"sha512-K+i2MKaDVRehnDDFj1z2CTQ9CGOD1NdEWw2mc0Ladr0OfpAUka+D5HNiysZlxTTKV44DL3ddQiv8HA97FSH+Ng==","signatures":[{"sig":"MEUCIQC6idPDs3QOPa+FtFWIS6tz1HHvHg37y+V1s87vhRzq7QIgF24F80TFgH2v8EBmYzISTeR5nq10PwAOdKlos2OG7iQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":853721,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhJ7v0CRA9TVsSAnZWagAA1h8P/jbx4qMNavbctrNktP5J\nNToLx79VRkUhhYULymW7n3a2XPMUEtxwlF5PoK9DxwikkDwHdYI1+ENK+HOE\nc3xFihEOJzFwwVMmh04IrIRps/jRNLDjnFzu3TiDSy58sdAg2vWfQXtfmHHZ\nvo43OlmcvjpnvhbWiWGPJqKwePaT9wwiAzgWsANIXU3MG5pptJMjfPF/qHDj\nQHgUA9F6Gyc2QSnlVXrBGtUVnxFOGosGHN27PeGcmFynHYdf5Z5nBRPhgB2W\n4kFeMEWG0z7t5iuYrFhrqWspo3IzrwcorfeEnkSZ6Uo2c0UdnnN5UOQ/bZ2+\nSeB+vszfXqCFJV8XdhooSr30kouqDvR58NE5T6jSUsdrvf/wlsFZYuPaKKhO\n7wBioUH+uPcun37zz9idqE/Jz0YyHOLQaYvyZT4mQnmwUC8Sja7mARpBvp+b\n8J4qImYBf3IRsMyI1WGthw/Jxd1dS6dwTAPCxBlzRyGn3sOShKdV3gssoz/3\nk+md5fF4y887Kn6Uk7JUvIzqgi6OsXvG4uJsgKhuX4OlI+0tuMNH6XJiOxfW\n0GobgS/onUqz5JRYi/9PL58RE8REiJ6awQCEYLTTz/Z+QA2wr3XXN242+ND6\n8tLb3HaoeRn5998TVarP2l+JRRxhKZ/16+9zpWg76CvULF90XvPImKke6jDJ\nyGbF\r\n=x80Q\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"27220fe16ebbbdcba193340cb99388e30976a2d7","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"13.0.0-canary.6236f3576.0","@material/rtl":"13.0.0-canary.6236f3576.0","@material/base":"13.0.0-canary.6236f3576.0","@material/theme":"13.0.0-canary.6236f3576.0","@material/ripple":"13.0.0-canary.6236f3576.0","@material/animation":"13.0.0-canary.6236f3576.0","@material/elevation":"13.0.0-canary.6236f3576.0","@material/typography":"13.0.0-canary.6236f3576.0","@material/feature-targeting":"13.0.0-canary.6236f3576.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_13.0.0-canary.6236f3576.0_1629993971837_0.9683121400193502","host":"s3://npm-registry-packages"}},"13.0.0-canary.1d19158a1.0":{"name":"@material/slider","version":"13.0.0-canary.1d19158a1.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@13.0.0-canary.1d19158a1.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"1ed93ad27a2b8ce1679fc12d54c5896eeecd42f6","tarball":"https://registry.npmjs.org/@material/slider/-/slider-13.0.0-canary.1d19158a1.0.tgz","fileCount":37,"integrity":"sha512-Yr0cAesXEo8Xpi0zG9CEbwHaqSMDTVs6LXcrmxHW1sKQzY2nGmrpc71ARqJjZWkDCh6fC54RwoewUyuei6uIwQ==","signatures":[{"sig":"MEUCIQCabiO7K2XSonq26Idg8MQzBnVKxjGHgr4y5V+97syuYAIgHa5xWglRYqQHEvNOjHspvcMajMOOzqljTksOz4v2y9Q=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":853721,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhJ8q+CRA9TVsSAnZWagAAcPkQAJXIMf4ERgvzvgw9B4xE\nOLLfycYv3w4YaYP3/jtXzO7eVm5y9rhcyPGENznViWdMDB2irH5Ih1Mncx+3\nveVzyPuEh6JibXK9FmQc4dM4eI1xsmmnq0pcQrL/Vsl57aIGWzz5OeD2LIcF\nHAoSMcJMvD7tmQ6C5hO+kQX7XBJnqb/XbqooBjNPnRk9DBMWRW0LuHWDN5JF\n/eGpb15n6tvtERax/O0eSZNJ6BvUElgZYyIGVyVkxxtFid3dXu4N5DAFGEhP\nZZc/25w8afc/uNLSUBv4DURor/utiX/7nxFLPY8OIjxJpJ6F2mOCOYyz+PLS\nZ01NNMsKT5qOqEnkF1JssNM4+q5t9b2/pyUAixQh7CRL2Abj/AscDH4pnuxt\n4WTHjXAmWEwKAZyr6Kc40ZIVS1OEWcu1XoL4Lui7bl3DnqWJP2WVr99y6Muy\n3m9WDxp+LrjOwqnNexLMx+L8SeXn58CJdWx0U+PW5dl9W+/T8n+TvpfTyQmq\noGWErr3BwyHKU/kxMjZYUXopfKXh7V8FRK1xhoWpjPVPiUzZHTMRaBbdruqH\naL169yLAsHx7Tru3dv6ul5/ksQybeuPxHNcEz7iphQcnOWz6cmEMlXZlu23x\n2DlcCwt5HZrXAEN0i6LjZGn/L88bsrpQ8ApwgCV6Ct6BjYpSiNGFcePcAPvd\nEEj9\r\n=9uTM\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"451d11fe02e89db73e3ac79cab01741c3da63ab6","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"13.0.0-canary.1d19158a1.0","@material/rtl":"13.0.0-canary.1d19158a1.0","@material/base":"13.0.0-canary.1d19158a1.0","@material/theme":"13.0.0-canary.1d19158a1.0","@material/ripple":"13.0.0-canary.1d19158a1.0","@material/animation":"13.0.0-canary.1d19158a1.0","@material/elevation":"13.0.0-canary.1d19158a1.0","@material/typography":"13.0.0-canary.1d19158a1.0","@material/feature-targeting":"13.0.0-canary.1d19158a1.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_13.0.0-canary.1d19158a1.0_1629997758821_0.408924188816727","host":"s3://npm-registry-packages"}},"13.0.0-canary.6adc9e83f.0":{"name":"@material/slider","version":"13.0.0-canary.6adc9e83f.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@13.0.0-canary.6adc9e83f.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"365814062ad0a406938ac57c4aad9ad29a4e87e6","tarball":"https://registry.npmjs.org/@material/slider/-/slider-13.0.0-canary.6adc9e83f.0.tgz","fileCount":37,"integrity":"sha512-uPKpTo4pPd1lBvSDrdTpAr+ALejkZm8753MwRKYK2W4Jb/vWhT7NO/khXCaf+KtByHMAdR/onz5QaoBQ0O75DQ==","signatures":[{"sig":"MEYCIQD2Af2RpOh3Cgcyl9ObMv6i3Oq+qx90h9FgGGRAGhr7swIhALeUW6cTFxg7AOm24SOHJeDYwZJiz1PtKEW4vjPoAESV","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":853721,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhLV9VCRA9TVsSAnZWagAA98cQAKBPUhk+kp6hykj8Jbs7\nvpDAiaKZOUZhAFNAnCrT7aHKVFciWtxRBWjiuJkJx6VuGhtIGIIqamCglL6C\ns7QFtIOaSBB/8aRMZvv/w+AgQJ91szBTyjPpfQaNx5oxTjsSLQtfzHcu+Anb\n1+YpYhe/4zJjpWnuKu9c2DnFzHQJZMIWj+zqiatTtXirXG/rAD/NMjQN5KBD\n3E/GM5zpc48XlfEVxOWDKSyKVPqCBC2vazDJchcPjrFq8cdxfvI7Xn5TlgHD\nIeSmMaNIwLmZF6FqdVDt69lakQr7T3cauMsqfYHOIgfepjnKGO3Tc1IguvJX\nnsxQiJZluOP7fIs5zmGQ+753Pu9DkpYp0eQp8zMB45VE8HqMLrnNPEf34lkK\ni47pfqpwYweUQmF5hQ+M+9F9dhccvUfLYzGQWB/RUb03VTVpXwGcO0u5wcH6\nxjqD9P1LAo6aEAAvfd8jhjgfVSVAbNEACJc++CLf/Vye5Ewa7+He1rumKDz+\nAe5jNXFrvnHe4hr8+X6WMvMWjqPraTRsIKjvC92zaduu7G/XZbW3piU1sOmG\nyxIcn3QUJX8t3MZLuioNAF4lNRa5zZwqwF/Pt/zKUfX6gC3Wq2r2Epire4px\nLdXtmKtobVoiBUwOKaVpQSSReWPIPvCatYgXgk+hAOABcEXB1Acj04JH7MPp\nc97N\r\n=h5N8\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"d3d9f017c96584c46d77544b9f0dcb6e22eeeede","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"13.0.0-canary.6adc9e83f.0","@material/rtl":"13.0.0-canary.6adc9e83f.0","@material/base":"13.0.0-canary.6adc9e83f.0","@material/theme":"13.0.0-canary.6adc9e83f.0","@material/ripple":"13.0.0-canary.6adc9e83f.0","@material/animation":"13.0.0-canary.6adc9e83f.0","@material/elevation":"13.0.0-canary.6adc9e83f.0","@material/typography":"13.0.0-canary.6adc9e83f.0","@material/feature-targeting":"13.0.0-canary.6adc9e83f.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_13.0.0-canary.6adc9e83f.0_1630363477281_0.015529281580216159","host":"s3://npm-registry-packages"}},"13.0.0-canary.d082790f0.0":{"name":"@material/slider","version":"13.0.0-canary.d082790f0.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@13.0.0-canary.d082790f0.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"7176b0d5d3e25ead3953fffa69b83a54b6dde2e3","tarball":"https://registry.npmjs.org/@material/slider/-/slider-13.0.0-canary.d082790f0.0.tgz","fileCount":37,"integrity":"sha512-sj5JZc4fKPNUIfV9TIbXhkxW0YG4R++Ki9V812gfPxODScn4sAmetpuzmRseQ+y2wUmgQzf38u4s90yXqc3Kyg==","signatures":[{"sig":"MEUCICeBIzTKAMTIhKfIJWE9n3K0q2RaWa8iGgxSpa7cjrEUAiEA5ahFGZLrrN8g0Jir7L1fLizMfqKC8CdikiLlc7Mqwfs=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":853721,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhL/afCRA9TVsSAnZWagAAPlQP/3g7A8sfqqnyCf/UAT2O\nKz6Lsfq7iTqGNGYHiyNcde8knbzzrfsWNMUfMT3uoaqO2KvAZIijSRUQc2M2\n2N5RLNOiWxqL1SNvdMChSfhCerqtlxcmjEJtrtpgqUXj0HbqJ4m0ZXgqrg2F\ngNopTp6YoqbD5+fQZRT4ipE00HLyr97UhluuowK1TxBYUZCrxpxpKnik9Dlc\nwpFUcK17v/7WAIo6Z/TC2i5jFhQAtmqJMc9P74WPVXGRJ8PO9FX3QCQ3H3Rh\nQna/UQXoRFvY6XAsHzXIXROsGcF6lyb+fyv3G1suewmzwnPLRYRrQYl562iz\n6N1aBJrkHBbil2wYQy23i99oTxygJZtSm8l6yGCVl80GfP1yuZAk10oI+nhB\n5KogmkFJGhKHAxbZctDrCZCXEp9qVl7NmUNcT6ACCm2ys5ruRX9WLq3EJWm7\nHWLspxKeFWZFja7rQf0Tn2zucEDd2//GsCWeeDREtFbggzGGfWQ6yHSCL0ub\nNux7r3KfLbsq8ujSMGa+zw+E86Fzs5r73J+Ksb56GhUGXno2s2MiJynFmK++\ni2lxu8mr6klNk4LI/80jPBeF5uMxKiYQx0YyxKL48mTLMf+dKwXej8tuhCj5\nVhSI12Z5BsTPtGN5sYHCHe++4QTq0zhiwxdsyrgK4CL8XIX431G3EJhnxGSx\nW7Db\r\n=aLA5\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"77212852cf39af4379f15c0daae076eb8b562c15","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"13.0.0-canary.d082790f0.0","@material/rtl":"13.0.0-canary.d082790f0.0","@material/base":"13.0.0-canary.d082790f0.0","@material/theme":"13.0.0-canary.d082790f0.0","@material/ripple":"13.0.0-canary.d082790f0.0","@material/animation":"13.0.0-canary.d082790f0.0","@material/elevation":"13.0.0-canary.d082790f0.0","@material/typography":"13.0.0-canary.d082790f0.0","@material/feature-targeting":"13.0.0-canary.d082790f0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_13.0.0-canary.d082790f0.0_1630533279119_0.418208252779362","host":"s3://npm-registry-packages"}},"13.0.0-canary.e2c4f0196.0":{"name":"@material/slider","version":"13.0.0-canary.e2c4f0196.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@13.0.0-canary.e2c4f0196.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"3c5319cf8fe64ab1d2c16c9b83bfbd638002e2e1","tarball":"https://registry.npmjs.org/@material/slider/-/slider-13.0.0-canary.e2c4f0196.0.tgz","fileCount":37,"integrity":"sha512-I2SV/2Ux/BNIVu2cQBGwNRsQj+ICw7dVQlYmj/j4YTx9s6erQQlaOSwRDAX3t87TgsxiiUpkhEA5WSDPIDW6EA==","signatures":[{"sig":"MEUCIBOOW9fhN8vjAEitA90xnsvKqBFP3Vab6fOuwGh8T9l9AiEApI+VqXmFmlnD2NGGUAnBZBwm0NWnzm4cG7QY397FwZs=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":853721,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhMDLdCRA9TVsSAnZWagAA6p4P/jyG3SJ6INd3RNvwLGrH\nixJfTa/4TrtYxdhfyge2oLnwlggWG4zkz35HJHpY6vii3vg7bnQIMgOaD0Cd\nM/2vvZg3q0vyKD4eolUEuOh17CnbQEr8a7aUtrHHrOzIvsbaENeTiQbZxRJw\njTSCzZ1iaFJNJ8hLfrqExDHS3m7iJZ2tk4uF6Pa4pNxihguWbOlKPyuRYox+\nyej1umz3JMpZXFEO3ZYY90/7PCxa8cxEXxj3SM0Zwke+e2SehJZ1jI9sijK9\nLry96XlLB29ct5cuFVlzdJ1pvZ+z18Zbx6BEQnBOkYJ2/OEq6/sLmAlZbcqb\nwhS044DayCcfmR47BPleerJn7MsZivCVxnhcDDdvSlvYOQbTq9Fz1fmdHw4E\nz1aEV8GlacxxTEKdpdv+t0Qeq0lRWiDqdtivaxAZRGRuoUoCMuY4QlvzDWLN\nwHtcUL22Yud8o7IuCH629HKJ8iJQNjruILmyNr8X5YppfDaK1wA1t9LHNwYr\nUOZi9DHUAV7y1q1+tGDkDI/FcNQCGmZ+2WY+gR1S4PwhnpljYEbIXpfldvdz\nHhZzHww2ZBdTu7OTk5FLcJ2s4ExxD4yI0fGa7StiKT2a/bjuwaXWDxEeEeL+\nG06DgnDh3OUCKVbgR26bLLt3cX+BqoUwtxkTthh+Elxv6OyHRnFGgdW9y0o9\na5rB\r\n=e0Xd\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"2100e21debb7fbebda0966c953fb24e1964c19fa","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"13.0.0-canary.e2c4f0196.0","@material/rtl":"13.0.0-canary.e2c4f0196.0","@material/base":"13.0.0-canary.e2c4f0196.0","@material/theme":"13.0.0-canary.e2c4f0196.0","@material/ripple":"13.0.0-canary.e2c4f0196.0","@material/animation":"13.0.0-canary.e2c4f0196.0","@material/elevation":"13.0.0-canary.e2c4f0196.0","@material/typography":"13.0.0-canary.e2c4f0196.0","@material/feature-targeting":"13.0.0-canary.e2c4f0196.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_13.0.0-canary.e2c4f0196.0_1630548701737_0.9432910979758478","host":"s3://npm-registry-packages"}},"13.0.0-canary.611db508e.0":{"name":"@material/slider","version":"13.0.0-canary.611db508e.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@13.0.0-canary.611db508e.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"f4798e314d4a39f5e8ac4e2a9687c49d0e6fd08e","tarball":"https://registry.npmjs.org/@material/slider/-/slider-13.0.0-canary.611db508e.0.tgz","fileCount":37,"integrity":"sha512-5V5EcE2QZBHJytF7xuZhq4QEy7VqxHE3gmMMNxR5Q84gQBWD4rcSc7qoDYzctRFGf4Dg6C+z4gRj7uoqByPhVA==","signatures":[{"sig":"MEUCICyOJbjQvFrgnCHlvNjmsVHB2SKtZG00bIjG6ghLyZwDAiEAvnFtUoBrPJpQlgisfb2MAw8UF2sUV7b5U0teY5cCMO0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":853721,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhMEHLCRA9TVsSAnZWagAA3dAQAKMejp14uRzBCMjTXNr1\nTsL+/Gx1ywIvSedBsIqrLlq079bygSYhpMh5XE8SOMVn+iuXoA75mMKYWLFE\ng1BVpqLoNbPtTra8HJowxFMePon5l5xcrU/JIaKedD1Ib3gkL537T4PWEQhv\nhJF476rUOPVxMeV8kH8AJ0m5j4/JXSDxzXSexdR67MwSwrp5G8MtbCS63V/8\nQOP0Zd02bwXfGgDEwro+EzjYMNLb7oRT064C2YDiQVLzwnyCYcG3F8k790+Y\nPBcjXbfLgfK35f7HqbfeD3AD8wwzNxxe6WZ9rdaUfsjEWBO+j5SbLTC2pezk\nWa6N0XsP4cSs9AmV7ALH6DLzTebk2YXKdUUeGaXJVOn2tdKao/TbqJdUrey2\n5P38q5E6aUEeeZnEHNP4bjiO2PxW3mkgwdtiXiwNW8Y90fqPv4eKeDrv/8Gt\nzrWLk00bj/TOy7RD4ay7yFckm2r9Dn9B2PCqd9RVHMdODnEPJ7lSVUMzGMd3\nnce1PlH3AMqCQEZl8jw5FYQJax6V/6rK5KTwgsoj9d+0juPTmWYNVU2MmW2D\nZ1BDiw57P1f0qrBR81vLeA3+u6oSbDZ92+IhAekab3Rkxt3PvxlhMEbTOx1q\nEgEjf0Xz4bkvim+Q138qywNudKa7LlrOE4qmyQi66NBTFxf0vH/wkcZMExyu\n9iRJ\r\n=OSJp\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"5d75be4b0e067fa5d6477869a053c630a67cd643","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"13.0.0-canary.611db508e.0","@material/rtl":"13.0.0-canary.611db508e.0","@material/base":"13.0.0-canary.611db508e.0","@material/theme":"13.0.0-canary.611db508e.0","@material/ripple":"13.0.0-canary.611db508e.0","@material/animation":"13.0.0-canary.611db508e.0","@material/elevation":"13.0.0-canary.611db508e.0","@material/typography":"13.0.0-canary.611db508e.0","@material/feature-targeting":"13.0.0-canary.611db508e.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_13.0.0-canary.611db508e.0_1630552523007_0.493359986149815","host":"s3://npm-registry-packages"}},"13.0.0-canary.d4706933f.0":{"name":"@material/slider","version":"13.0.0-canary.d4706933f.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@13.0.0-canary.d4706933f.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"251cfcfef9e2678e7fd199011b1b3d64bb06a391","tarball":"https://registry.npmjs.org/@material/slider/-/slider-13.0.0-canary.d4706933f.0.tgz","fileCount":37,"integrity":"sha512-ajZ3GgLWqaCtd9FCW01mB1L2MnSeGYzQiV1UUfPQXXU9eR3MjyUJMJQzBJCwysEdBQjysyJGH5H2z4OK5wP5Gg==","signatures":[{"sig":"MEUCIQD3ffJHomgI7p7YTkNE4KkMnfy3bzB5zIbcmEvvuEmOwQIgSB2PetEDIySYuDhmhFP8YDddoOqJgQrHIBu0anJWxGI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":853721,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhMO/cCRA9TVsSAnZWagAAOXkQAJRaFP0zxJvByUNfSQM2\nTOZY6W8FMlBeJpAfVqgU5MjF2vUD5AFu56nxYi1KZbNrrRNcjv8l0gssO+8f\nMWWPMyHorgzLpSgWbTlN9Q6yd7ES6fXWaVNHSPYBh5cv6wqrd35ITZb7Mxnt\nDIHnhpE7PJ2XYXd7aDJR7sVgFa5HLkEB2KQv7Z6/F5Penr6ObNlGNvA1Tc+5\nwxmmsshLAQ3J8wgF3InUUaWxq0wndMu5Sr85Ta/4occTfQdCFh8PNqvcSKZS\nvm+vNki99x8OCqgTi7i6rZ4xgknEeRUQ/3MKmOypwOYG4q9MBDgM9AGKcmAA\nf7Wyo2po4d/bdlRmUIZELU5WniiqZb8pEBxMBOJOJ9GroCpODcx1nCB9aYC3\n6Kn1/i3h+9ZXj6juzqXoqBfI4DiFx8hBeWnz4UuBE08w0ZPgNZycpiEhUb02\nigeRRmo9x1brr6cOf4AGt31zdsf/rkStKib/AzgX4Oh+0HieLAjnabHRji0b\nHSEsIyd3iGraJ/g3qpjtaSRj1ls7d/gpHc0JoNiWPmFTojpi5Wbh/c5Ef9VV\nJ4cEkTgSbbutzYwJf8aR310FlbO9sKsqXaCEfZ8gscY2mzLG+owPTzy3H4y7\nJLFrt3fQnYRawVfeeVFh+LISjSQ9bDwCQS90lylzqXkrhA87Y+4cF6rTnUG2\n6CGI\r\n=bAlb\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"9e7edb1e0621060d55bf2765cadc8f2ffcfa0f30","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"13.0.0-canary.d4706933f.0","@material/rtl":"13.0.0-canary.d4706933f.0","@material/base":"13.0.0-canary.d4706933f.0","@material/theme":"13.0.0-canary.d4706933f.0","@material/ripple":"13.0.0-canary.d4706933f.0","@material/animation":"13.0.0-canary.d4706933f.0","@material/elevation":"13.0.0-canary.d4706933f.0","@material/typography":"13.0.0-canary.d4706933f.0","@material/feature-targeting":"13.0.0-canary.d4706933f.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_13.0.0-canary.d4706933f.0_1630597084379_0.6516636421607036","host":"s3://npm-registry-packages"}},"13.0.0-canary.c16fe03ce.0":{"name":"@material/slider","version":"13.0.0-canary.c16fe03ce.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@13.0.0-canary.c16fe03ce.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"613fd81f6fcbe12f74aeec452c8a61907e8e46cd","tarball":"https://registry.npmjs.org/@material/slider/-/slider-13.0.0-canary.c16fe03ce.0.tgz","fileCount":37,"integrity":"sha512-65uTthH3+pDKGPwiSXLgw0xqY/MnGlstFvx4qKMJ2mXXvynEhCP+HtYfRFI9YzzTDaff847uLYebrIddxWhlpA==","signatures":[{"sig":"MEYCIQCxVx/FJHIiDQPeOo2g5HeiQ8D6MFjER/xH53J2D1kkBgIhAPppqizH5cIM1PkWnZfzNoK0bAk4g3CP0Xz/rLvZSUBq","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":853721,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhMQ2hCRA9TVsSAnZWagAAq8EP/ii2BmSFpc2k0RrPMxY+\nlayrB0Kb3TTUGJNt01gNRcLVIrb65xGC9ZzsJuumyg07qHezUkajNHEbmpjg\nyikEsYGgXg/zH4qir7awiX4wFhgpz7Bxo6RYZw/aRw50o8yNtxoABECyjTaO\niEHYtGLPbOloyuopPMKoBq0LC/0r8tN7NLNUDsOSsxmNC9UlpNlBLpqxVxX8\nMMWQykC5wdVCq5DNZt/0kVeqcpD07SlnBKzgXINMZATN6Y2E5CJSJIn7gWuH\nhul67U19yg4fCbzSWn/M1HlLiVfErPj0KBsKB5er9UiDZL7T1m/mw1VN4d2l\n7I19A4sgNDMOGNCJghIcrv2uvagM5AwcdDm58DJnfFLJLhCw5DEchE1EzvfI\nz72AFB44rGYnHaUhy1VqVoVgpFiZe9w48Qwlg7K1JqMRE73dqUGhLWk3bNtb\nBxUfSd9TP4TjRGZ4pSSmvSni76BuRdeLDOYrTTeRAte6Bt6//GO5O8Ro+kRl\nnUk/tDFI5WGrQIZ6GgJw268fEcGQGirElyZlyQ+1VUa519zc2aeOG/7nDMWx\nja4asF/EHgxpm1ay/ZaaM5G73f/SrSMbh2LRFedD4gWxXQ6AE3TawGehEbfM\ng9RvlPlFd6naFQcf8Mbs5Qm2Msx/oUy6jD7pWl0rXFmy2Vvyx3na+dMUv+B5\n7hmW\r\n=+qY4\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"28281c91b41ff8002401a21d1210e0fc629d55ae","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"13.0.0-canary.c16fe03ce.0","@material/rtl":"13.0.0-canary.c16fe03ce.0","@material/base":"13.0.0-canary.c16fe03ce.0","@material/theme":"13.0.0-canary.c16fe03ce.0","@material/ripple":"13.0.0-canary.c16fe03ce.0","@material/animation":"13.0.0-canary.c16fe03ce.0","@material/elevation":"13.0.0-canary.c16fe03ce.0","@material/typography":"13.0.0-canary.c16fe03ce.0","@material/feature-targeting":"13.0.0-canary.c16fe03ce.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_13.0.0-canary.c16fe03ce.0_1630604704757_0.24344583900167627","host":"s3://npm-registry-packages"}},"13.0.0-canary.9203a958a.0":{"name":"@material/slider","version":"13.0.0-canary.9203a958a.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@13.0.0-canary.9203a958a.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"4dccdc9245cf4167fb10e38ff4fa0247b216d917","tarball":"https://registry.npmjs.org/@material/slider/-/slider-13.0.0-canary.9203a958a.0.tgz","fileCount":37,"integrity":"sha512-d1oZH52Mb0etYuSoEsvmqgp47B2M+IMZV3/zxtB54o0w9qJfg1AMg0wd45KuPmGyTT0kLY/Vtn3tvEUtGdGRmg==","signatures":[{"sig":"MEUCIDZEVR+10AKGgl5+YLtAYD8gbp1RfEHEYpHj2C/rEbqmAiEAk8d5XUQ7CGIASh3+H+QJ1yjZYm2oK4YJAeshv3VLhCc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":854919,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhMWJZCRA9TVsSAnZWagAAdxsP/0YT/gqsY08W7w60cFBx\ndJdyQNrXAIb0HY5jMG5Fjjp1HUKm7Rv0730wt9eMkXtqPEPy+II0GjEe+85a\n2WJ3M8S6rcwunSNG9FiLr01x9JtPAImWDSgWMOli9yMLI5HbShm++9dxEGN9\nI2F6Y3EYjJR3aE1jbbf3odMuRVGqnm3z+wrnrgm1MjRgw62Pm2G9PXBxJxRK\ngAb5U4H/HgTPbFd3tDZ8kniwkURArvBLTpJfD6N4Dkwm2KUfdF3w/fyF+sIo\nQ+3ZrGz/jk8PHtSwlTAq/R+hRK848oMS86YHKpfW6JgvxmsOEfLGqGBSQ+XA\nExH118m22EwxahYk8W5hyfQeYkIegSnaTtOaY5YKSp5MD83XucQ+hOk76Bcx\nrgUeXx3Yq56PDn+8ks3SGUNaBrGc/qGZNaGnUjMC06OGtyPpNf5FAMlGZXYO\nlLTEq5Wtqb+2OqgxHOtxy3C5VKNslUj3Xa9mxA5wsyRssBt2ufe4ocK2X59N\nwhyd8w0oqW3rRsYYvZoMJZGgS0bWxAZBANj/MaWEHGtRTUddAbtYM+GeTDK6\nCeuwJyW4kWumnj67SG1WqkFu/vkVWwoDhVDAcghDqbhbWIlrNRXfGLEqc//A\n8mwUpVqT1vtLgOZCdAZ5+F5q8wovCP36uYJ6KjXtHtBO1b7dKGzkRDvRYGOa\n2/YU\r\n=DXaG\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"2e0f9de34d700b0d1eabd5186c5b5cf8080eaf74","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"13.0.0-canary.9203a958a.0","@material/rtl":"13.0.0-canary.9203a958a.0","@material/base":"13.0.0-canary.9203a958a.0","@material/theme":"13.0.0-canary.9203a958a.0","@material/ripple":"13.0.0-canary.9203a958a.0","@material/animation":"13.0.0-canary.9203a958a.0","@material/elevation":"13.0.0-canary.9203a958a.0","@material/typography":"13.0.0-canary.9203a958a.0","@material/feature-targeting":"13.0.0-canary.9203a958a.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_13.0.0-canary.9203a958a.0_1630626392987_0.33413494937519883","host":"s3://npm-registry-packages"}},"13.0.0-canary.fddd5ae93.0":{"name":"@material/slider","version":"13.0.0-canary.fddd5ae93.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@13.0.0-canary.fddd5ae93.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"80353e267d162e7008d5df1a8a07e13b7d06b2f7","tarball":"https://registry.npmjs.org/@material/slider/-/slider-13.0.0-canary.fddd5ae93.0.tgz","fileCount":37,"integrity":"sha512-HIFH7pvwt7belsmuEPFQ4mXG1pJQ9He6Xz1zY6KHwfJNo4FWwfWxF+4ochkRTWysbvHzD9A3svNz3xXkkm0VMA==","signatures":[{"sig":"MEUCIQCcCDKhFgNNzy+ELmCH3WaY1+6KZCxef0apYoQvxAO10AIgTWzqxky3aRSghxlXUiVuy27TQUE73LEm3A/cRTfVj+o=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":854919,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhMc78CRA9TVsSAnZWagAADmUQAJM8IzXT3qbSSD1VjsPU\nEF+cEgbC/VIILhalWlG8DcvACOXRd4FxDAilfnk8uzhJ6UZh1aL12B9jZU3g\nOGFaPDheZ3s99ZdEB5OVV05OW6gLRyZ9LmLZlzGIIhLx7+e4G7pmyWf2P8Kb\nqCp993fNkYfqgI3tyrBzT8YPVNyMbllXgXV0eylpdFhdGkrsAQga88DDKRwr\nX13SrSWVz+y2LVWErR9PmzkAkIB4MzC/QXWKsr2ruHQMp1Ci2Hx1eZwPiMxA\nVctlYeFxLLZj0w7k1R7UbdWhPf1AHfoA31p1haW9U6C97q/U86eANMlkTdi/\n/RpAZh93L7RcSvZwXAEp70mGeXYh1oK2DrMcNtd4efByxRj9qh0OvXyHePnx\nwvd2nwZZPVvwINK3SLTb9RpQPif0IxATziTpAEEwHr8HyiKFL+HO3643ofLo\nhqeqIgD50scUmodZxFdl+JYn8h40Dgym1+N93aoqlXrBGDIaJXm3ztHP752y\n2MT7PQMK7Zm8br1XBsrfcXbrv3QAoFPn153Y46A+h04/SjpbezZSZcUytr0V\n9rDCzzh2dNImdS9NoHL5wKJe+B7QNQ8PO4oiGEO4hJRrgPNKFati42tLs5/w\n1/+U8etxaIOczKesz9JF5P/WUimtkhiOfqb9FLg+gqGKMeLakPmbArtpkZ8G\nlaaw\r\n=Z4fE\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"b5407901afd7b18f851e64db0350e0c38797ae29","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"13.0.0-canary.fddd5ae93.0","@material/rtl":"13.0.0-canary.fddd5ae93.0","@material/base":"13.0.0-canary.fddd5ae93.0","@material/theme":"13.0.0-canary.fddd5ae93.0","@material/ripple":"13.0.0-canary.fddd5ae93.0","@material/animation":"13.0.0-canary.fddd5ae93.0","@material/elevation":"13.0.0-canary.fddd5ae93.0","@material/typography":"13.0.0-canary.fddd5ae93.0","@material/feature-targeting":"13.0.0-canary.fddd5ae93.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_13.0.0-canary.fddd5ae93.0_1630654204337_0.4587459468884756","host":"s3://npm-registry-packages"}},"13.0.0-canary.117599a8b.0":{"name":"@material/slider","version":"13.0.0-canary.117599a8b.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@13.0.0-canary.117599a8b.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"72ea251e1eb1ee888121b586cee9875a2c076066","tarball":"https://registry.npmjs.org/@material/slider/-/slider-13.0.0-canary.117599a8b.0.tgz","fileCount":37,"integrity":"sha512-NMb53cCOvJnD/bMnyv2FDcTpXVZfL8OGSt8GjD6GeWtLV+68drQowwi7FzwecXdeUpYUGpc7DgM45k+9Jau6Dg==","signatures":[{"sig":"MEQCIHDpczBEK4yy0+iLy8MNBnDxMWOUZCRDYMvZj+n/XjHrAiBgMTWho0TMTP1DHweMg16pPT2wXVi17rUImO7U2l1jSw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":854919,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhMc9cCRA9TVsSAnZWagAAF/UP/izX061/9JlOc9F2cN2v\nRA5tqGY/+6WaYQupkFdmfP6fANySlDdlHMTqxPDGp2tjsJEdNzdVQNPwmgZT\nf0JTgn6E9qGiClz/5DCMhGAH+sxkZ6QU5xhBj5n3kp5r9CRwHM1bYaASE/RB\noMrr6WgJWAaWwz03OG9xoItPrm+k4S10lvAimuAsKEbF4maglcFHEIj0N8WD\nGYhWiV4hEaPMrH9OebR+6GA6LJQJAuk3aUXGNBZ4QvGoiOnZ/n9pGANme++E\nS7yNfvtK3ScCjmGl6PKWN4tmGmnr7k4c+YwxjMVAJROb9P3STB6lv0Sss7x8\n/3/jW+g/Qkl3Gp1dQ8h2bCxYUR7QHhNUkeJvG/qxVDXjkKNnp6w6CNi6G0Xu\nz7S+XMJl/APReqb6RMfP7V12Xrce94vg9dluivjKntm0x8eSrn23QFldWr5+\nAn/zpKzNjnCqSDImAD2ediR+1uKdk0tvJ7RDM3MPVVbkM7gfcs/futJecoEC\n4epa2ct6eTVr0onEyftNMiSsxtPhBsYpMMu9g8ZLqxarA33CQ3UuyiVHMaND\nGhmDUx+OcswBGNl89B3sn4kRZ643ymHyV8kE/ZAFlXgCkgAnuj5T9DB/B4+z\nlKuHU8/xpXvQ/Js+MnWI8Pv6sz423+KVLlHkaxRYQIG+DltPUhG5sx5y6b/m\niqdw\r\n=8jKd\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"3dd17eaeb796b36aeda593de120f16c60ff06a0f","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"13.0.0-canary.117599a8b.0","@material/rtl":"13.0.0-canary.117599a8b.0","@material/base":"13.0.0-canary.117599a8b.0","@material/theme":"13.0.0-canary.117599a8b.0","@material/ripple":"13.0.0-canary.117599a8b.0","@material/animation":"13.0.0-canary.117599a8b.0","@material/elevation":"13.0.0-canary.117599a8b.0","@material/typography":"13.0.0-canary.117599a8b.0","@material/feature-targeting":"13.0.0-canary.117599a8b.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_13.0.0-canary.117599a8b.0_1630654300560_0.4352002383903453","host":"s3://npm-registry-packages"}},"13.0.0-canary.e4180d07b.0":{"name":"@material/slider","version":"13.0.0-canary.e4180d07b.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@13.0.0-canary.e4180d07b.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"be153bcb5752898a14d1f4a449e22eee3cac1cf5","tarball":"https://registry.npmjs.org/@material/slider/-/slider-13.0.0-canary.e4180d07b.0.tgz","fileCount":37,"integrity":"sha512-7r5rKsloICNjmnI1aGdpzy+kKq5UkaWbxgD7qlyNiQ3Ejjagapisx1R060CRFsUBXz/bC8M47giVx1jmAcEVUg==","signatures":[{"sig":"MEUCIQCvp1JuWg77TZMxYst2bKhE0vlAfUTRi8EhZnW6Liz+LAIgWcvAz2zh7PTZWBzx11verMTtVlhgv2+Gb7OhEQ+CKt0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":855132,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhMc95CRA9TVsSAnZWagAAhqYP/0aLIJqvLsfVg76poBVc\nPi+g3nJewRjy/ohgKpafKzEFYrwGCjn16Sf8KHTWRAjDssFG4CDuKXhc6njH\nTq/xo16xu6P98M/hZvc3MtoXFxr4f5zBI+M1E+Slgt4n5aCUBXqnFkk/QQom\nC6/oyi787bibDFue3nowZX+8UXdlY86+wrSczvzBsaJnrNjvCZjKZ8Ync3Od\nu4+sRFLgSXGMnscY5jYOf29RA0gHgv5tfypsLNDXYEjJgMTiBCPumloxALx1\n+Ny6Di0j0vWaFIPWXg7y93Ihes4eYBe3oLJo+SL54ovZu8STUoKmBRLqKNY+\nX3QZDCJ3hJ9UrHVYyNPSPZ5x45gu6CH3H3EvOpnA6yzixEFtBbbR1huLDDtY\nx89X6w/B/jp7axeRyId5XkBsyBqg99x0/hSpJBrHYLnqRVhUfQO0H11GNV8i\nG+QJceAqaanM9mrRJnbcjoEKWyC4jhDQJEsNEktnZ974gxnbD0E1xsDUSZ+y\nd7CbFD3nEd94YZp3WPzBDlTWzZ7d7ZE/qtJXjBuMp1mHM4UlzUhI5CBXy8c3\nmhgfz1Wnav5DUAKNZ2qkdAo1yZ6Y7GEAgrNfY9VIeStGwqQlhP0F2w0w/wHe\nXiQ9qG1DvT2TDWTf67L35Atl3HUolqvFDXQQrIn/Po/V3Tl28HjodI0AzpeL\naNof\r\n=vsvN\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"3b94d02f75df256cd0543dbdf5062823ee527d4f","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"13.0.0-canary.e4180d07b.0","@material/rtl":"13.0.0-canary.e4180d07b.0","@material/base":"13.0.0-canary.e4180d07b.0","@material/theme":"13.0.0-canary.e4180d07b.0","@material/ripple":"13.0.0-canary.e4180d07b.0","@material/animation":"13.0.0-canary.e4180d07b.0","@material/elevation":"13.0.0-canary.e4180d07b.0","@material/typography":"13.0.0-canary.e4180d07b.0","@material/feature-targeting":"13.0.0-canary.e4180d07b.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_13.0.0-canary.e4180d07b.0_1630654329277_0.21897015370983008","host":"s3://npm-registry-packages"}},"13.0.0-canary.42d175efc.0":{"name":"@material/slider","version":"13.0.0-canary.42d175efc.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@13.0.0-canary.42d175efc.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"66c109579c424c3221ef803e8a38a511a410a1fc","tarball":"https://registry.npmjs.org/@material/slider/-/slider-13.0.0-canary.42d175efc.0.tgz","fileCount":37,"integrity":"sha512-w5ynxUT4h3QGybKvAgOrzCWJQ+bPupo2BnIzQGdCIkM+Nh9nMTV9bH/2//sNESpyH2kSfQ2HYgQS/wxyJWQSdA==","signatures":[{"sig":"MEYCIQCDVtLsix0d36QsMcbTeT1eVXEiI1BJBUhqY7shAyj9nAIhAOvjnc33ev6HmrGbjZf5bYbHY/syHuhovC3iIaymhdyp","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":855132,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhMkKDCRA9TVsSAnZWagAAFWoP/RvxIvwkieMkfSK1HFX5\nNwOh3xr3lSlRhDVUArjaPmM0zFZGgAm4sGrTUU2AtW/ZNsqGPaX7LU8Vqaem\npQd1j1E+hfL2kw0vbe3X9YsKy4gpFIwCQX+vDxQjtcvUndaeFpoWK4CC0Hoy\nS3LSMCsdSRr69plMAdn4/YJPERdm7dLO+rsBfA+OQxXBoKt8WmeYEh774/Ln\nYG8aSImiI3NH8XQas0dqdZof/D3ZfqZzpPS9njRrTIeWLd2q9apxgoOHx8sE\npirqOV+x3VXX/DQP/oV1AyPx50kzxOKN+O+7tmBEVEiaU4PuBRG96FQqSgIJ\n/26DHdlmf/2PoGAmGCjUEw5xJYTcJXtI0NwTO3IR/95WMLVwyTbwgIcXIEKv\nEtp3X0j7u80kbvDfechufaYXd4XqhM0m6GColwt6A1gxPOuFlci6qAnSyLiy\ndMFSXQGCx1/h6Pw3abQZHY4ZVBQ6Z7xYxN1EAxOYRpsF7nENGmifEyOxR6qm\nW9xOtJlsMv21BxroD0LE+Tgm4VNrhguduRPgGVnu5+NvICiQb0wsPIfVFtzr\nXzJrGTWYxe1YuCotW1GCwIr+wtJdGP5KdvXc7jrwwPB6WTNT5qLBd0rhgC2o\nc5UNdPaI7N98QlS/os/CG0+28FrGFNa5sgqIsSlglBEHliZfRT0kVAclHYNg\nP0DA\r\n=9UUf\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"64e749d9e76a60e5559d8b19e4b57da1f44ebf0d","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"13.0.0-canary.42d175efc.0","@material/rtl":"13.0.0-canary.42d175efc.0","@material/base":"13.0.0-canary.42d175efc.0","@material/theme":"13.0.0-canary.42d175efc.0","@material/ripple":"13.0.0-canary.42d175efc.0","@material/animation":"13.0.0-canary.42d175efc.0","@material/elevation":"13.0.0-canary.42d175efc.0","@material/typography":"13.0.0-canary.42d175efc.0","@material/feature-targeting":"13.0.0-canary.42d175efc.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_13.0.0-canary.42d175efc.0_1630683779543_0.7873738175778704","host":"s3://npm-registry-packages"}},"13.0.0-canary.72464476c.0":{"name":"@material/slider","version":"13.0.0-canary.72464476c.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@13.0.0-canary.72464476c.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"1ab15435aae22c1aeba74969e39959c17cb657c2","tarball":"https://registry.npmjs.org/@material/slider/-/slider-13.0.0-canary.72464476c.0.tgz","fileCount":37,"integrity":"sha512-XIXzqxsoQPwuFeaLCH8wEniLyzo0w3fgykewfNVcEaF0llsLMcfA1iRsWRgfVzbwPdTrj17Sb8jmT/X7ENpKXA==","signatures":[{"sig":"MEQCIGHNVT5BxnIKBJksgNsKTqN/At4RcmCQ/466ftSr3VW5AiBB67qcnSFb3iug+Cy3LoF+1N1KKiXtl+M/2mYi/0ClhA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":855334,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhN4Z+CRA9TVsSAnZWagAAsFAP/2Zt5iMmfQYZ/FQgXCe6\nFk46EZKAfGYEhSjftlmWJRPiCGs/xzHxxME930a2W78r6lafx6vhnNgyrvkp\nRFjTpOiaRFtMv9tz3m5yKUP0WsitB70J4gPISuAK5GKNfKnN1qWxyxKpQeC3\n9wiVjFuVhghIHcw1OSavWywcPYO2u4elWICpciiDb7Hv0gU0c6dybc+v+sV9\n+R6rdwqpxyZCngeVdUHLrLvbmd/PVYtMLn9kfQD9a8AyOXOw+XMzLAuLjzCg\nK9iBzKjw3LmhvsGsZjdmaHpgQnSLkVRLelRNbXRxxnu4GNTZGPlQ2NEcHOq5\nj/dxBGHq1cxsaPhfzF5sLyMcxuRSm8GTboR+eEgtLnM3lAIIlFTtH5cw0MbW\nY9Bi0TiCxivRNukCrdg8xIZyLXP+iFUBpEEPm1Cuzl3TCkdHyh9kcLySH9+X\ni2GGMPfE8SjNAHwPYhp860GIeR4ZbZBO5OwNJ2YO5iLX1R7f4JPz1EZ360vz\ngUCyUP1nyX1OUQArSJHifOMq2gLKkL3kIejn4A8/ZbatycTlZQErF5N662Br\n9HJFMnBOswlWzP5yJi1Y9fw8bsVS7vHT/51701a4Kn+hLawPD9gHqC0DgHJP\nY0l3+3lkcR2FVgif9Ur5vEO7e/ClmaPASy1oN6m6n6Ngug5zDFfgVDKg81c0\nihp7\r\n=ZLcY\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"4c409a18f3ef0a7ee6f9b223a514471c0515b639","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"13.0.0-canary.72464476c.0","@material/rtl":"13.0.0-canary.72464476c.0","@material/base":"13.0.0-canary.72464476c.0","@material/theme":"13.0.0-canary.72464476c.0","@material/ripple":"13.0.0-canary.72464476c.0","@material/animation":"13.0.0-canary.72464476c.0","@material/elevation":"13.0.0-canary.72464476c.0","@material/typography":"13.0.0-canary.72464476c.0","@material/feature-targeting":"13.0.0-canary.72464476c.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_13.0.0-canary.72464476c.0_1631028861813_0.8283989779850578","host":"s3://npm-registry-packages"}},"13.0.0-canary.37d4db866.0":{"name":"@material/slider","version":"13.0.0-canary.37d4db866.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@13.0.0-canary.37d4db866.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"c606fd686d25430a2442c4ef14361a837658c14c","tarball":"https://registry.npmjs.org/@material/slider/-/slider-13.0.0-canary.37d4db866.0.tgz","fileCount":37,"integrity":"sha512-NSpynPiao2dfQcawEBLw7AD5VcX33XZkChOsL509stvC3mHOxYOqUnZQMWShcxIBMoJPgpJcotLwJqy6eJBqpw==","signatures":[{"sig":"MEQCIF8bvQU8V8s8c2HNYhesqbSXjAOjzkLdES3E4idi483+AiASbECDioOF3El1S59P7SDZxlFLEKjGykwK2hAUUwBPjw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":855964,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhOhtACRA9TVsSAnZWagAAiv0P/1OOin5BVIK3y6yup+Vp\ndQ2iX2nG1GC25pCNVTVgc0ncjzmS23nUNcgld3UQw1x3AIFJiYeSX45JrCBZ\nzyK/DXBLDyLTxyianw4Ere/lIxFBdXvv3DhARFKATzCVzarevg40mJU23gIr\n27zA154Gmd01ZpenQ6+Esjv+NDsaB9lNSQRvYqBuwFGGDzEW0IcuSXTHWIAC\nrP16GnjhopfZhRzlN8hgVJYxfn+cbD3BV345eKsZ+6Dc7fgq/iyGt349YKH5\nBgUzG3csMoOAgD4DvsGHTAwiW409JVGDN/qFbDet5Wq3FdXQNnfipbyWdZcW\n2Dg5gDHPccpZoKGJokgGhim+6A/64+9O16QmHwzLDv0WkgP1lornjU2gZS9p\ngkuHnxfzZUh89l6a4Ld7RCmw+qf/8aBaQEAXsWPCJkysBWNrCUSvxzZfzFh7\nCw0kHdGmIb+/o8/x5GjDOR6JYeVpA4W0lFgYdlaRKGBq7cyWilEzbivN331d\n4nrdBXm6rR0OP0yWN7Flqqkiz9JFAcKMXTObWXBbQcaylc5t/eqrgZ+EL4xd\n9LUNMfScm4sV4csVsddgZZVLR0/ZltuEOy2tapFRRxdI6igLdqoHCzL6qGSw\nK92sK1YokmI2coNGzvQ7gOWRD3XBnl9zQu/JsXjfMaANXjE/Koa6++8wQZ2K\ncrQw\r\n=CkDU\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"25270b452713f831fa1adf302fa3f2c357ba759a","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"13.0.0-canary.37d4db866.0","@material/rtl":"13.0.0-canary.37d4db866.0","@material/base":"13.0.0-canary.37d4db866.0","@material/theme":"13.0.0-canary.37d4db866.0","@material/ripple":"13.0.0-canary.37d4db866.0","@material/animation":"13.0.0-canary.37d4db866.0","@material/elevation":"13.0.0-canary.37d4db866.0","@material/typography":"13.0.0-canary.37d4db866.0","@material/feature-targeting":"13.0.0-canary.37d4db866.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_13.0.0-canary.37d4db866.0_1631198016455_0.7645072130699879","host":"s3://npm-registry-packages"}},"13.0.0-canary.6df682e74.0":{"name":"@material/slider","version":"13.0.0-canary.6df682e74.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@13.0.0-canary.6df682e74.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"173f682ead3709b26fcbdcd1c79d5dd94e422c83","tarball":"https://registry.npmjs.org/@material/slider/-/slider-13.0.0-canary.6df682e74.0.tgz","fileCount":37,"integrity":"sha512-wXVhCS6SGe3GOcPNwxpo34FToUdSxrKe85FonwxkE/Wdtw5Ga6YmkZtIPOP2tDPI4ZJUm9+2z8IZCHhNOMNzdg==","signatures":[{"sig":"MEQCIFi5pIu/159ifsLmmmWFTSbmhSKnjkzHMEnF372XSsvjAiBqivhuzhtqAO27pB0xO8M5OHIuMncyTm9zcIvIkJbl1A==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":855964,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhOiuYCRA9TVsSAnZWagAAIPcP/14B2cNzAyiCggad68p4\nODhqnQ1klH4IWwQNr+7du9IR78HKn9LKeGAKnNPM6nFaL3mr53j8+7bCYpSR\ntOUO9QVRrs9dX4nwfa/hv0fla1kNPXyS8vJbR95NNb5p2/EkbG05NDsDrylG\n4V0p8+kybhY52IlU4ptXkXW7RTER7z2vmtoj5JzrLB4i7lvSo/DvZMqp+8yK\nlKlDbRmt516UHOHUZHAQ2MffdY4PlNwOwfyiVfc8qTrn/SCS7+3o9VZmhjXp\nyx2IZ3TnDTazLRVsftsizr6WXZiOFz37yw8Zip26SoUONbXop97Y7HGFKaLE\nFibGI0doyMIKU465i6oz2QBvuvcxBFdsw2PXcYfzsrj6GqewjAHHgwTbt8Ck\nUyme4V0/om+FyXBq36bY2G7a3EsND8L/Hpqq/cbbnJKH3MHqSASvKyyEpvlZ\nIpCcnpuW1kfk07HRSYyzGMNNjMSt1uxxWZTPRCsoeJYbDU0E8uZ4F1LlurR2\nO/DYA9w4sqGTzSrKvKx5NRIeTjIKnttwCbpz0faIOmbxt6c0mnOUsSmv+ADa\n1ZYmHqVw78268YgoyT4H8NSIpIC6VHNSUDarV1UTAEm8XkQhXSyphVnJ9NrF\nWaya8Ss7jOJpTy0CvfA/6oxiM0t5ZYuF+1pqUWJB4UB7rrpKfLg5H+TNa1DN\naPRm\r\n=hqSu\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"f8640926b088e6e6fd8688e2bf177fbb60e83f2f","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"13.0.0-canary.6df682e74.0","@material/rtl":"13.0.0-canary.6df682e74.0","@material/base":"13.0.0-canary.6df682e74.0","@material/theme":"13.0.0-canary.6df682e74.0","@material/ripple":"13.0.0-canary.6df682e74.0","@material/animation":"13.0.0-canary.6df682e74.0","@material/elevation":"13.0.0-canary.6df682e74.0","@material/typography":"13.0.0-canary.6df682e74.0","@material/feature-targeting":"13.0.0-canary.6df682e74.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_13.0.0-canary.6df682e74.0_1631202200429_0.46673666150271953","host":"s3://npm-registry-packages"}},"13.0.0-canary.b49359c35.0":{"name":"@material/slider","version":"13.0.0-canary.b49359c35.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@13.0.0-canary.b49359c35.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"6c736135d876bdd0ef7d9b86da74b3b8429f151f","tarball":"https://registry.npmjs.org/@material/slider/-/slider-13.0.0-canary.b49359c35.0.tgz","fileCount":37,"integrity":"sha512-vUgA3/psqByejXy6p8i/asW38hVFfYYBnuzGA4mcNNXtFAmpb4FTGtCfOaHX4rSTxTE0QQUBz9FKTyXIOQkpWQ==","signatures":[{"sig":"MEUCIF7ioMDVNnyMapHZCQ+EWwWZfKHjwZ5zGzM8dUKWP4BfAiEArtUSde4zIozcKkBMUm1Fgqj6swJxHfCK/awQoNTA820=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":855964,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhOkXqCRA9TVsSAnZWagAA38UQAI36CASJeLVE8BoQU5Y0\nmaSML8C8+6hrBF99+8bx2f07huVvf1f51uJvcYEoCahmKdXfc6J6UIHh2FA8\nywy+Y5ghY+tXyhNh1nj1+tmoYSJw8U/lWywjH68FhLHxv5c9UMnIyj/n6uJ2\nE9pCI/WbVj/nTkrv0Jj4eRF+L2V6Ve5gdFGleuB0yxMUahkprEpWDbAXg1Nc\nZQ3PLx0n+RqcO+/AQoFkmbvLuETQdf5E46ONHBEocquoYdXghKtbFyKhk29t\nsnSWptuxHiw55OX4yn83qXTSY2RwOXmq+tEB0uF3jXoJVwKNaB7z4WYv/8O8\nA/ZwrSX9dzJzalEopunOnU2oo9v/IOXmsXry5SFoxrBNQr9dPQJ9e72MxdRT\nJxcHutL8vDHIMz9LT8dhiQHqq1OWkLzYkeOPClkxP9rObiYqIPXmVoIC0dQy\nrYZqB4PWR3fjMv6NrycFCmbnTs8+8lN5tPvGguJ4i1XEIRmUEwDC63YeJqAc\nLcfdVlPseNWOWomQlfIbxJNnjL+cOtw/SGpkfCPkMUBL13YWVxJbZZcdF1aD\nB18wj9dZ5PY+oBrzsAgYp5FTEAKrvW3gSqk35ztt6rCcepo1pJHuziyrWOv6\n0+mNIOIOUCYnjt2+pry0smdCy1cthcEp/yNb3/jigVxDudZ9LWBaweg9+XsI\naNuR\r\n=XjSq\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"817b18da85c93007b9b038927a1ae036f98f686e","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"13.0.0-canary.b49359c35.0","@material/rtl":"13.0.0-canary.b49359c35.0","@material/base":"13.0.0-canary.b49359c35.0","@material/theme":"13.0.0-canary.b49359c35.0","@material/ripple":"13.0.0-canary.b49359c35.0","@material/animation":"13.0.0-canary.b49359c35.0","@material/elevation":"13.0.0-canary.b49359c35.0","@material/typography":"13.0.0-canary.b49359c35.0","@material/feature-targeting":"13.0.0-canary.b49359c35.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_13.0.0-canary.b49359c35.0_1631208938199_0.36440206125759267","host":"s3://npm-registry-packages"}},"13.0.0-canary.470bd34e8.0":{"name":"@material/slider","version":"13.0.0-canary.470bd34e8.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@13.0.0-canary.470bd34e8.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"2afe2c64fb1bc7b63057e59b521f7fc810c1e63d","tarball":"https://registry.npmjs.org/@material/slider/-/slider-13.0.0-canary.470bd34e8.0.tgz","fileCount":37,"integrity":"sha512-EgPYVtYClCLhsBB0fVN+fATySJsW+vuM8TU/bRKJIfK3NL22t7frs9bhsbN4S6xD9iqccvqCzumTLp3Sn6kFCA==","signatures":[{"sig":"MEQCICH7Qz5mNO/xAyRhE8KXDPltWdrnY2Abhkgux/JhpCLZAiAGe3OrkMNvOnjRhhrYUggc8exD6muuoV7n9YOyQuZDmg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":855964,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhOkwDCRA9TVsSAnZWagAAtz4P/0yNMrw3B6/LWHjc0WxB\nidxV+0HbNyOaUOEfN3ACTqtWp9RLIamS52BZIrM2Dl4fKuxdwl9UBs9kfhGa\nIVVtBFDc3f5HrwVuc+3oN9cOyqVi35/qk3ct30tSJufCzY9Ugk1jkrUtuo+p\nqUQt+VSh+OrynPqSY64P0OW3MZILp1btKXMbIZusFAevQgsFIoCmTdpkQRt5\nknJycYVz5BV0COK6ntM2UEr15/hIuq3VcUUoDoC0qMx32MRxFINSrQ96XF1t\nuGYJBeOxq/q5x6u0x2rpambVxaFAjeFZLzv80uOkDaOffcb95l/QDo/Lrk1A\nEdO+us+7gvyxtnR/QblpKMHi/dOLlqeoi82zZRxZYE4CKfhH+t8ZxTaYISmt\n/Y+Vue+DEKrXwP/f+6X5HNZC0KS9246z65aejmyQdqk6TkIMU/maKhS5OoQ8\nrEfY9Z51HtQ0wr9CmzEdTuLEJV7JCsRjsS2OfJgZD9yv2vk+jE2rqG/Bhhlp\n18xUkIRSMHxkN/Fo2yRbSwqCrwduOXISECrNsDMW4rKXK0m5G0K+q3+N64qc\nTq2sNNmqNAMDtpsTyVOS/mmEQ0mD0hZMLm011GPKJ4rBvlxCA9/ZTjlQe22k\nO9Hr+h2JFoeRyGULP2TR0hSvd69qEh2e43Rxx2BKzCDVhEM1SCaA5rnb35eK\nbmqY\r\n=lbQq\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"f249b00e3cc067fbfdf722d71dd85392d031ca0c","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"13.0.0-canary.470bd34e8.0","@material/rtl":"13.0.0-canary.470bd34e8.0","@material/base":"13.0.0-canary.470bd34e8.0","@material/theme":"13.0.0-canary.470bd34e8.0","@material/ripple":"13.0.0-canary.470bd34e8.0","@material/animation":"13.0.0-canary.470bd34e8.0","@material/elevation":"13.0.0-canary.470bd34e8.0","@material/typography":"13.0.0-canary.470bd34e8.0","@material/feature-targeting":"13.0.0-canary.470bd34e8.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_13.0.0-canary.470bd34e8.0_1631210499259_0.9462721805936396","host":"s3://npm-registry-packages"}},"13.0.0-canary.d48a01771.0":{"name":"@material/slider","version":"13.0.0-canary.d48a01771.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@13.0.0-canary.d48a01771.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"c5c98d4680455d78df49de27968766ed7bb83e5f","tarball":"https://registry.npmjs.org/@material/slider/-/slider-13.0.0-canary.d48a01771.0.tgz","fileCount":37,"integrity":"sha512-OHsXJf7yWpj5GVctr7SdzCN01RcDVA1q4KO5n8zYkaG+h+NAIftqfoNxkk6D4DZ8OyU2ku1IBEKistQEWAg2yA==","signatures":[{"sig":"MEUCIQCAAMrtmyk8RdunKEi5yy9v55ANih1XArtZTk5fJwkV8wIgHGpQiIDl4v8DxjmO4b9JSqMuHhGsBL7AOz7QTCRlwJY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":855964,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhOk4WCRA9TVsSAnZWagAAkdUP/0uxwF59qwIIUDq0gaSR\neZ7idBVbNcyWYs7ArIASBpCGMzhk0FwRjvZswOfOT137REF0HFgwRT5htQso\nk2LEZJtyRbc/i8OW79Um1RHGM+NF5eGXFrs4ROYRjPa9xnySvqpwMWtf909x\nsOQZDYbiTzULpTKDRMlDX6cI90ztvSo7znPyUZUGk7RRVQOFBMdrI1AN+fM9\ntIoaqs0dXjpEt2PzcJOII6H8jJwv41Henb7kAeuyqUArIzN4WDPMGqmaoA1Y\nffcqcoP82WwHCMU5te75habiE9kzWAFglQRWFlFbhCxClJaBsU5fLbcQsUlG\nQOwjFTdT7la2wNHOz0B1beC2sRzeJM9tdJeGqN8Oc9QtV9OcH2pGzVsQf1PF\nA6s1apGMsksz3LOnQJOd675nKrZe9H1bVIr8NCL8mCaVWGiJilYeImlidiE+\n3DXSxPZxppGZBMEGre2DfUaODNflEGgboz8ExBFU4rs8+NZiAZ06/2xqFZ0t\n2aDvEWsJBCITuLWBHZ2pB8CvRrNs+qqyyMf8sw1p/7VJoBI719X+ROoKOa9+\nsxGWZwCha5+nB3dZRWjAhJ5HaxJ5cfWn6kque6wgnxwDqcrwa5c7DXvxpOvZ\nmcmUs4Asb/CxzClJ3RaF6RBCB2Z/bBvh6GjeKvq0udMutO5OgQRHXF6fugdV\nYHzg\r\n=z93N\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"6796441e86b583e99919b207640bd02efef6fdeb","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"13.0.0-canary.d48a01771.0","@material/rtl":"13.0.0-canary.d48a01771.0","@material/base":"13.0.0-canary.d48a01771.0","@material/theme":"13.0.0-canary.d48a01771.0","@material/ripple":"13.0.0-canary.d48a01771.0","@material/animation":"13.0.0-canary.d48a01771.0","@material/elevation":"13.0.0-canary.d48a01771.0","@material/typography":"13.0.0-canary.d48a01771.0","@material/feature-targeting":"13.0.0-canary.d48a01771.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_13.0.0-canary.d48a01771.0_1631211030194_0.512653495242001","host":"s3://npm-registry-packages"}},"13.0.0-canary.13db34b34.0":{"name":"@material/slider","version":"13.0.0-canary.13db34b34.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@13.0.0-canary.13db34b34.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"d7a9a596afad569fbf5ef203931d150590d97752","tarball":"https://registry.npmjs.org/@material/slider/-/slider-13.0.0-canary.13db34b34.0.tgz","fileCount":37,"integrity":"sha512-IbJ/apDdUMw+EJSwDUx4zvK9T7Q8Frw+PayoKazoIKrHZCYjgaLjx/Zpdbxy/8BCMqDEaFOh5GPy97SCzo8KSg==","signatures":[{"sig":"MEQCIGYxz61oHf1eOD/VwFSLMouH0qkw1s+auUuEw250xQEFAiAcGrE5h3w56UlLIrfBaFozWbFZSjzygPfXiX9YV8TQug==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":855964,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhOlGbCRA9TVsSAnZWagAAjGEP+gIl+3IZSdo0SgE+tLXc\n7LENc3z/EyN3TyopDue6fePXJyu3gg4H2Y2dNzYIdtRzhMx/zUDUfHabEoNv\n2fX27pfeK9VwIQobIspyhEIheY85sGXGm3E86ty6cxp3UNQp461qPPHysyl5\njkVI0WDuBH1dL6PzhgKh14K4Lx1eVfcsEZOjyNXybMFIld9gPNfBOrvc8tpi\nYG/3drg2bgX/yMrrjlYV90t/98LOSo8KAy//TqWytuXmmyZnGXAdBtx34cki\npzZm4y6ZiFrHdcoQuqTlHtm8yv2DR5s5PBcqRA+5AEEnZvBFr9YNXchvlo5C\noCyk8Obz9SJR5DHWJ3i5k1eIEQdkKiF9eJ3w+PBv6BGG4g97a2A2yC5csmJr\nnMFNznLTmV0yuQQ5Tslp3/UB9k8ZMpV+zhQWvu5WL5lNpXPPDGxhbZBgO6E1\nFCq8ktZDmynBGegla65ApvZpax9IFtDzMrvbSaid3afJu1+5AeJ1gJhJ/hRe\nUr638l6EG0BLcGYJyYtjjA3Mnr2kmKq94MrfLaKnoo4rVXYNxQIjiMG0KGo1\nx6ZPY1vW4r1NzKLKj3heGfAKSD7Ap2tUp11ekkhKLMhHxq+IelPtlk1LS9Dw\n7aMV1jalD73r3yYQMEniIZ4MQl0hb5KuG75xF1rZpKx3zx4C378xdqI7F+g/\n7Y9v\r\n=KWu9\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"7883b32c9c6a3280e801925b874df667e1055809","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"13.0.0-canary.13db34b34.0","@material/rtl":"13.0.0-canary.13db34b34.0","@material/base":"13.0.0-canary.13db34b34.0","@material/theme":"13.0.0-canary.13db34b34.0","@material/ripple":"13.0.0-canary.13db34b34.0","@material/animation":"13.0.0-canary.13db34b34.0","@material/elevation":"13.0.0-canary.13db34b34.0","@material/typography":"13.0.0-canary.13db34b34.0","@material/feature-targeting":"13.0.0-canary.13db34b34.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_13.0.0-canary.13db34b34.0_1631211931604_0.08181469783344175","host":"s3://npm-registry-packages"}},"13.0.0-canary.864798678.0":{"name":"@material/slider","version":"13.0.0-canary.864798678.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@13.0.0-canary.864798678.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"e2611ad83b0f9f7c8bb5b585041274a23061384a","tarball":"https://registry.npmjs.org/@material/slider/-/slider-13.0.0-canary.864798678.0.tgz","fileCount":37,"integrity":"sha512-QbzURDWDnfIkQQU4lelE7DZ5nXz2BBWYpvBOpq8Ux6OtS7vOoQ/Em1Pt5r3L8zgUeDdAasWB7wHvIFD1XOw0eg==","signatures":[{"sig":"MEUCIDoi3RwIKgUO6IMUV8BVVTm0ZSv1j+FEvZC6l2r/CQf7AiEA/34V3VxiP/dj6Y3t9F+TUOTaxxBQmFRaDpJDTaH0ViQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":855964,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhOlRHCRA9TVsSAnZWagAAV4IP/2z4tDXKHx1qosSDypQ6\nypcrIbd9gNXR38pbK6JyFmfr5RfMmjB+++5HmIgV6YdOTchndcgarxrpKBMi\no08FrYReIEi8NNfG1uhP92rClU7zwZNnVzfq+Xwh4kbzb0nzUwJs5O/w8trP\n0bI4/Bxr0108saikxo2I2AAVpTiFno5Dh3Ob3cAIKYhKZNmUd0Ty8N5C1vI1\nP6WHvwjWy9SKGcP3dSLCUmtuuEGNyKFcWmkhC1bPkE3grv341IfShKwn+uLt\ngVbdsR908uvW3BuIy1O3s++0HL/8swZhZ1Zqfd7k6fdIR/B9WOEYYfRWew74\nWjDbgQq9rMU8YCZAvOY/dmPvxQH5XvtJYq5Rkv1kwxwqjF7nMeTg73NKQ9kQ\n4H923IeZV8DpDqBAuN6L2/atAYfrVH2WCo6OxR/LwsnUmRhBA2XeQkZOJAdy\nYq10HrEIgTR5KQSRuoVvgqBtRdZlEsQXC/GnsjJiEObY2JpVenV87xe9+mP7\n8aPTScpr+61jLXZfRaKHxXi4+VzpDMmsycgFR4s7pC/HXOKyutZK3zJH0Hnf\n+jKB2NAxDRJoR/0Q0JhbVl+tOnD5jr2YL03g2dOuFTtSs7t7x/O4V9TpJpgt\nhrQNwcP8OPFR4m/Kni0e8CcBXC9jKMnr9y+Rq4B67Th7lDYXh7RZJ3CJyFda\n3iNM\r\n=ZnfL\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"08d2ae683a56b5e86f7a54eaf5a2090fd4288df1","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"13.0.0-canary.864798678.0","@material/rtl":"13.0.0-canary.864798678.0","@material/base":"13.0.0-canary.864798678.0","@material/theme":"13.0.0-canary.864798678.0","@material/ripple":"13.0.0-canary.864798678.0","@material/animation":"13.0.0-canary.864798678.0","@material/elevation":"13.0.0-canary.864798678.0","@material/typography":"13.0.0-canary.864798678.0","@material/feature-targeting":"13.0.0-canary.864798678.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_13.0.0-canary.864798678.0_1631212614874_0.4820699668225963","host":"s3://npm-registry-packages"}},"13.0.0-canary.d04bda3fb.0":{"name":"@material/slider","version":"13.0.0-canary.d04bda3fb.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@13.0.0-canary.d04bda3fb.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"f03719c7b4a9160ff92e0e04ef5fed524b583746","tarball":"https://registry.npmjs.org/@material/slider/-/slider-13.0.0-canary.d04bda3fb.0.tgz","fileCount":37,"integrity":"sha512-s+W7gtxu2cFHVHzqiGziSJkJh9hgA209AhresscxTl2/+MHrJky5ekQqmQuRLBSL2D6VxqI9yOA9U2OGMB5qIg==","signatures":[{"sig":"MEUCIGOthm5i1tx9ArS5qaJkDnmwkB5CFjl9WQoY6b72t07XAiEA06Vwgfmc4M5s/aBmiKSPCXuIG58c8hojkiYACP/EiIE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":855964,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhO3gHCRA9TVsSAnZWagAA6TgP/2Gz/25iUmfN6AIUcxV7\n6rpncryTAs2wxgv+rHYuKJgjEM95PTCLpbLPUncSZu6zOo3JIbOuANV4rTFc\nO0Mv5llphNIcr43v6M52W4rztOSdiwWIc9pQ35YrneBPQAr2zn7IdMG/+pRD\nw/rZqv72Ubzs+Nx3rMecY4uhFpTD17C1CICF1XgV0hmut7bmZhadKKtslist\nvKiQRvR7eL+bdKUbGLLiSlFU+7aYl43xi5p3/6MO6/P4wN2K1kxQ0NXlmep5\npPUNL5/tZIxl5EsDfY/+I2R5zvXng7T6kIje44M6/Y7Yv1kMiRc1wbsHls1W\nGTDfSMbOsEqs4wfrcxhctQJrK3GTE//8uVKAfJxXWv8zUMUXSQA3GaHmMJ+6\nnxoNk7Hhq+Zb6sgltb/WFC5uTZx9QH5njbrf1+LvEu1MPvJJ3GgFPUMYpWU3\nuQhX+7jCIRHFOIHkxo32Cg/0Im42B+emsfOWHtb2hBj/X9M75b6wxetuISAf\nAjJUg2gi/sYSlnbHkFfCCtBzUYGGwhpzv1Ar3MgGPyWtkcGOYnF2vVxSq7k0\nksGQyhkrgwXUno64qFfwSfICErU242/SvGPp5AJHLnqufa9dptCDeCECNMXI\npDEI67LbMt6yhF9BUHj5z1rmliwmSVd3KHtUr728uf93f9/B6aKfQaKyqRFL\nAiWn\r\n=gWNk\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"7dcba6a47b77f0011a1f0e22b3540e2a70b285cd","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"13.0.0-canary.d04bda3fb.0","@material/rtl":"13.0.0-canary.d04bda3fb.0","@material/base":"13.0.0-canary.d04bda3fb.0","@material/theme":"13.0.0-canary.d04bda3fb.0","@material/ripple":"13.0.0-canary.d04bda3fb.0","@material/animation":"13.0.0-canary.d04bda3fb.0","@material/elevation":"13.0.0-canary.d04bda3fb.0","@material/typography":"13.0.0-canary.d04bda3fb.0","@material/feature-targeting":"13.0.0-canary.d04bda3fb.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_13.0.0-canary.d04bda3fb.0_1631287302771_0.20371844218456148","host":"s3://npm-registry-packages"}},"13.0.0-canary.5533f73d3.0":{"name":"@material/slider","version":"13.0.0-canary.5533f73d3.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@13.0.0-canary.5533f73d3.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"294a477dcd760caf079cb240487b410fcecf6b7f","tarball":"https://registry.npmjs.org/@material/slider/-/slider-13.0.0-canary.5533f73d3.0.tgz","fileCount":37,"integrity":"sha512-hR+kP0iqX62ujgKBOq5ZNwYnpS/n2WlKPKL4sPWsmkPSB7GnTP0K/jIR2GM/rC2Ab8zsodWKB9W6G+ojwrK9lw==","signatures":[{"sig":"MEQCIFYVn0UlOa4voWptLBNe92gcc/ws8ppFpBssasxzeasFAiAwMZtUlaP6Xc9ArpIskdYq57aXyLQ22TT2UoIrAwWNKw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":856693,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhP9jTCRA9TVsSAnZWagAA21oP/1LhN4CfT4EL8S4U+azJ\nI3++pXErZsHzsZnxj9+4qpYm8koTbAXj/HZzhRWT/m4cxR7eB5sUdbWDQzSY\n1HUO9SvPJ9r28cq54VNt3X3Y7yOYhsp55GWEi7tpk4WxbTytvRSIuWGttFEP\nxtaUpNQK2i92D4ZHnDxtpopiKaFmazSye7MoffvIbMaULks0edbY43hPYLrc\nG4nfnudGRlqQYXlI8LJjgmIEkZYxcTEY2wzaVd7POa4gNkM3ef9rZEOPBGav\nDIR/tsAPlVckDMjEa47wQDEpijLR0etg55eEVBbrN7kWXcX/weyLLnmCpWbF\n085j34aQsS8WXbWmp0DtP0verzc4wvq0NQCV+or+S/VMFCKiJTgXGg18rxnq\nHulK4BHeylJyRQcPiXVi0fe+Nl2dBKB5+xiBcWzf4TEOj6eq4bKbDRfZcpjz\nqoBjhFUSfHizo4077NmoUm1CnJonXqIobjsql4ZQJ5HyPesFQxSjB8CD2FZU\nXD/zAONKY+UoLB7UkEupZAvpMG98qVoJtCJEtTJ+Xvzv0ZB3aLgDXyK556rr\nCMi1yhKJOAy7G1g2BKZkl5NU6MybQwZGGeNeAt5Qx4uCw1O8vS+LZ6vPA38y\nhNA1W7vm2N9PFkizr6VFLFjeKzQvSTiEsiY3VGf+UhVdb071FVP6f+BOyJgn\n/zFn\r\n=3d23\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"20bf1d151f241eb77dfa3233eb61f4e35d5b2838","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"13.0.0-canary.5533f73d3.0","@material/rtl":"13.0.0-canary.5533f73d3.0","@material/base":"13.0.0-canary.5533f73d3.0","@material/theme":"13.0.0-canary.5533f73d3.0","@material/ripple":"13.0.0-canary.5533f73d3.0","@material/animation":"13.0.0-canary.5533f73d3.0","@material/elevation":"13.0.0-canary.5533f73d3.0","@material/typography":"13.0.0-canary.5533f73d3.0","@material/feature-targeting":"13.0.0-canary.5533f73d3.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_13.0.0-canary.5533f73d3.0_1631574227652_0.394658529940459","host":"s3://npm-registry-packages"}},"13.0.0-canary.08398f880.0":{"name":"@material/slider","version":"13.0.0-canary.08398f880.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@13.0.0-canary.08398f880.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"c601472fc5af51804e52fdf22f1235eb07021bf8","tarball":"https://registry.npmjs.org/@material/slider/-/slider-13.0.0-canary.08398f880.0.tgz","fileCount":37,"integrity":"sha512-jtdizX0Pdwu3znIWGDGGjLUikPzUaA2mg+CEIAp6CoTTwVefJIqO12iZZ22txc28lsiz36YcLkee+BrB11YkJQ==","signatures":[{"sig":"MEQCIAffZqx+vGMMlc4QBkNvundsqaae22jMyLHUZopE3ZhmAiA9Oy2gG694D1FS4DfHf7dj0clvsECqpML1KhNdOFWVnQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":856693,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhP+AECRA9TVsSAnZWagAAl/kP/1gDuky/rK5KdXHdw4VO\nyuwq4yDclxkrcsltTIbAG5cFBr8hodmcM/Rt5aPUf6dABUiOjjcoLSgkhp+0\nFXxPzw6xqOEtiFTXgy4wgeUzHsyLxPKxKcnXjT3NWmn9hQ0VihFuxY9UWnxN\nZxZ6wXL1AXzPUy6DRiZTcHZy78KnpqfC0/gvk2XHHIDpjzuzwqAonh6Ltvxg\ntVirVmgy/rrgv449JqTdigiz5xzQsCUAeS6uI9jy1drKadnCUqxT/KYTX6UA\nNNZi5zD0YRGXXmYkvl4gCT896oyuQxNvafJlTUqvVvJXWbd4TKxiE/61+3C6\n6BF4UU/ShiRHEY8mfu60A2hwO7wKYe0XuVlxTu89Z8SW8R1Jk2vvN+ge6Hs3\nHszk+klHlBoX1elpgZKgdZiGqgr7cGPMfjkQLR7Cgg3ObwMQFNadEb01EvBM\nEqBQJ05BiP7Beh9wCCK2o8vAin2gCB6+2eFDaax14sHm1fvCHJojyzLMkiD8\n7oLDz9CpQ6/Gqyk97wnACO1gXuV82zK6RzZrvc2ylt8fv0YsY43+xBEmwYz4\ne/NFHhZ1O4j3bPTeGW+tjFlNUXEksq5Cjf03fl2FLbWwMc4KuZy3ctq3T10Q\nlkxMvB97GKZ0uT+5fge08jB1OtLn+7FzNRtzpYhu5R3cT8dUUMKerlXPHE6q\nAXuV\r\n=vnmk\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"1a993a7d6bd4a018cc4ae230bf1cc3fecfc16d1b","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"13.0.0-canary.08398f880.0","@material/rtl":"13.0.0-canary.08398f880.0","@material/base":"13.0.0-canary.08398f880.0","@material/theme":"13.0.0-canary.08398f880.0","@material/ripple":"13.0.0-canary.08398f880.0","@material/animation":"13.0.0-canary.08398f880.0","@material/elevation":"13.0.0-canary.08398f880.0","@material/typography":"13.0.0-canary.08398f880.0","@material/feature-targeting":"13.0.0-canary.08398f880.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_13.0.0-canary.08398f880.0_1631576067728_0.35754783455092465","host":"s3://npm-registry-packages"}},"13.0.0-canary.818f4ee93.0":{"name":"@material/slider","version":"13.0.0-canary.818f4ee93.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@13.0.0-canary.818f4ee93.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"9188d1c82f435367e0b60d09afa494feb1b551cb","tarball":"https://registry.npmjs.org/@material/slider/-/slider-13.0.0-canary.818f4ee93.0.tgz","fileCount":37,"integrity":"sha512-RKwNa6KgkjbkqaLoWXGoGAcWz0afvwY8z+1k2+Mxjcmf0/+Dcqs4eViKa6iVMOgoD1bFB0q5po/j6i0Pn48LMw==","signatures":[{"sig":"MEUCIQDFh0KMdf/RRznXoysFj7oKsJKBGfwmNRFcBGe5xY2axwIgathMIYITjRwp92AhaLbh3kRDnVP0ifIQG5HinLSdT1g=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":856693,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhQjJfCRA9TVsSAnZWagAAx5QP/2FiTZcCu0tgt7ZLdwoN\nft5/0ChCGXtNU3wTNQdzRRCj4MY/dhBe8iH1dY05U1Wssln9v9hrit5c+oRl\nGVx19SDPS5LYDkKbhAbvA8/r2IVOgln559WeOwFVgRwMM3UDVaUVbH+Ua7nV\nDtB/GJ8obUrukwTPY2eYHR23YSaFfiZWzjJ3VyoPjorrH3ksy5z6lEnm4kJk\nTqKJbiPS/gX0Ao0FiL4RCWzpW9hfuJkKtsjkl7imdbtxdtWrvkHHxthvnvt8\nCaJXZLyddnR/T6IQQIBPrsRV/yLeONEAyYX1qKrlg4mtMo193jJ5wKFcZa0h\n2McqKmDSn9alykNLThfTsXddDYakLA7Qxvc1Hdwt75KildMDRh8hdvcn4r9Y\nDgxu9rTx67s6qQ15CCC6TM4L15B9K7c6VnBBlG3WiNOp7LSYHbonDxtqFH4h\nWokwbGpq6OVg5ZuDaFHw88qWCscL1kEp22sxA/xybvjNw35697GqRH64JdP4\nIj8Mz+HgYIvcGVf4biM7+ijPunRTe6IS43TuMmyOtJRfISx80x2jzWw4FLo5\noaHgNoIRP6Pv6MSLj9//R8TRPg4siBoRaSsUH3/rflReUfUmEYoFKANDUGDh\nybj+4eLEMNQg76/ul/sWz3nC2FM02Gl2t/SJY55OSJd6HVeLZUDxst+sGwAx\nYIpR\r\n=QC7h\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"1d88a726d331a878c9a8721e3237e8cf6df49f1a","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"13.0.0-canary.818f4ee93.0","@material/rtl":"13.0.0-canary.818f4ee93.0","@material/base":"13.0.0-canary.818f4ee93.0","@material/theme":"13.0.0-canary.818f4ee93.0","@material/ripple":"13.0.0-canary.818f4ee93.0","@material/animation":"13.0.0-canary.818f4ee93.0","@material/elevation":"13.0.0-canary.818f4ee93.0","@material/typography":"13.0.0-canary.818f4ee93.0","@material/feature-targeting":"13.0.0-canary.818f4ee93.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_13.0.0-canary.818f4ee93.0_1631728223451_0.8648718948023919","host":"s3://npm-registry-packages"}},"13.0.0-canary.8355e14dc.0":{"name":"@material/slider","version":"13.0.0-canary.8355e14dc.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@13.0.0-canary.8355e14dc.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"1513c7c0a0e61c7f167c5a4f59ab47e26fbd2a91","tarball":"https://registry.npmjs.org/@material/slider/-/slider-13.0.0-canary.8355e14dc.0.tgz","fileCount":37,"integrity":"sha512-bRwfA1JGy0B5hVjl87SnnvGrtRnOh1UVoFb8ZaQzudI4Y3rL2uyZ07H9pK7HhtlH9jlL0cfZZMevrAUnafBYdA==","signatures":[{"sig":"MEYCIQCku26fuKiTPNFTGv/CjqfYYkXZOvCKyqCP7Qytk0q1lgIhAL2Vb0Sv10UN7riUqwM+B06m8yDulsk8Wnab8efoeWRQ","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":856693,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhQkWZCRA9TVsSAnZWagAA2nMP/A528PPVLsQQ6R27jNmE\n/YKTPakLoqsNNuEgiSTx2e8ADreamcR2iRrD74yrHMT+eTTyy671HfWLJ4XY\nGF65QlRtHC/3cI9spBogdDTpVO/ottsuy9MmTiWIOsbs8EDIR/IdDH12qwKs\nlgNXrH9OCGRoJ1OpMFp/aLdePAoJ5mz9INRRMBLAFQTVbaqbs11895QZYC0J\n5J+hy9Zhhpj+8cUpYR0Liqgg3pTKkHTjWOoIvKhfCsAklZ9aT0KymZjTpPSs\nXG0lWKbW3CiN7PHRCGaw7LwRxIpnaQhe6P5TQjrzPEqkUtWZmVtcYc4VnHCO\nLtSq1f+Cgdsikdy3Ji6idjEI5IjhgE2chuTjCs/eNXcOvVAx8PkPoQ5jNDcT\nxm/9vynLxasflvyVFHbmtkWo3h/C8OkZJUeg7qbe50P6BDINVOi54gWp6tXL\noUoMZAkukYABiDs1ecAFbwLZN85+3SQZbJRI1HNM0UEa02g9gu3A4GQ+aCfB\n1m1dBBy/jCh7oJm8nbcbnbQriBWZaQsUpOmvNauRKmXHEXNsWUVY3UjPiKU5\niib6W7rPy2grdlMShnbn87XTNsIpfBkw2MUivVQrS3terZ6toJHWdX9NJvLw\nbjiQrQFPzqwxh+KmFHtypRsV2rbfr0BkjGGdBwzRyOoyWuzejjxecZod48lb\nfghV\r\n=xleF\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"065f64e5cbd54d86f092d8d1406bbd0852b2a6a7","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"13.0.0-canary.8355e14dc.0","@material/rtl":"13.0.0-canary.8355e14dc.0","@material/base":"13.0.0-canary.8355e14dc.0","@material/theme":"13.0.0-canary.8355e14dc.0","@material/ripple":"13.0.0-canary.8355e14dc.0","@material/animation":"13.0.0-canary.8355e14dc.0","@material/elevation":"13.0.0-canary.8355e14dc.0","@material/typography":"13.0.0-canary.8355e14dc.0","@material/feature-targeting":"13.0.0-canary.8355e14dc.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_13.0.0-canary.8355e14dc.0_1631733145228_0.7191455240085942","host":"s3://npm-registry-packages"}},"13.0.0-canary.d4e16a6c4.0":{"name":"@material/slider","version":"13.0.0-canary.d4e16a6c4.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@13.0.0-canary.d4e16a6c4.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"f5abd4d134c534cc3b05bcaab27297b3f1da0d73","tarball":"https://registry.npmjs.org/@material/slider/-/slider-13.0.0-canary.d4e16a6c4.0.tgz","fileCount":37,"integrity":"sha512-7D8pun1uW9S2UhJMp77tpFdBnX7Rwki9qZ62KpuLDmqey1D/6MeDMpsL2ehu5EbGK8gAN+hpmv84GkC/1cB/Jw==","signatures":[{"sig":"MEUCIQCWmTQJ1Z80j+0UE3GGAOySh6vEAm/YYpB2rIbFKsIdNgIgMIP8Z9BLdh6lW4MBpupbkqXZJEGCJng4sfbN9EBqeZ8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":858883,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhQmytCRA9TVsSAnZWagAA//UP+wc+P6b3HMRGvda8WkcD\nRldmvQIQzk8vXbyPs5mPPaR7G+/dg/qVlDI+E/GPtuKzhZC6pmBgMs+YUnG6\nuhNK/fJ7F3ciACvprOGSTZaUG72WHCpko929o8GxEQAPYXaVXMS1VUPVBICT\npfI5OioYWd9l5/j43BZpVUdrEATuZ/vHKRsFrbuZdwH1JYyDG3a4dc2tlJSc\nsGDdXK5f5eBAyqQkl2v5ZdMuWcQZb327Gdq9Tfuq7vlV2Dlo9u4xryRf/vzD\nNi1pCshK5dblqPb/hzM90AuYR8UgdSaVqU6cBlK4lLN3MpfaRWLMaPEZVW6U\nlih5uFUabvG4efBG/W6av/vNfIVDXUTahbrOiU1F675kYXhZcdfBpqGEu623\n1kqaeHCp8WGFcXLX8LEflKF0c6XgDgHj+4teOCwRMBb1dmIswfSG97sSR2cx\nWAdvI0oj/vX4W6z+C5lb1oXtRHDCaALcOvdpVMtdxqO1FGoLgZRipmiuLqoP\nuGx5OmZxRHsa07zfuH7H8yWEvtqBOwWP2marOzh9gEFXebU0+1zY497trY0x\nCUAwa4HoG3MxqTr29jQQ/Z0Pd/flLKd1OUSN3fLr74duqEhQYkINwmnwqSHU\nzMhc5rUDrq2b7Q65ZqptGQ8PoH1gg55+uFJc8Irm5zk9DHi0w5ysW392fMo0\nn2w3\r\n=YN65\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"2c2d0c3f7c18e3a2b581679df71df5e7a0e2fcb3","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"13.0.0-canary.d4e16a6c4.0","@material/rtl":"13.0.0-canary.d4e16a6c4.0","@material/base":"13.0.0-canary.d4e16a6c4.0","@material/theme":"13.0.0-canary.d4e16a6c4.0","@material/ripple":"13.0.0-canary.d4e16a6c4.0","@material/animation":"13.0.0-canary.d4e16a6c4.0","@material/elevation":"13.0.0-canary.d4e16a6c4.0","@material/typography":"13.0.0-canary.d4e16a6c4.0","@material/feature-targeting":"13.0.0-canary.d4e16a6c4.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_13.0.0-canary.d4e16a6c4.0_1631743149424_0.040737640297923816","host":"s3://npm-registry-packages"}},"13.0.0-canary.65125b3a6.0":{"name":"@material/slider","version":"13.0.0-canary.65125b3a6.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@13.0.0-canary.65125b3a6.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"5b86122cf23857edee7e7954f47390baad10f980","tarball":"https://registry.npmjs.org/@material/slider/-/slider-13.0.0-canary.65125b3a6.0.tgz","fileCount":37,"integrity":"sha512-YDpzaEPylVrGPQuzhkV/y4f8Sqa+V4d0NWihl0wiQG+Plv6lhiEyaeWaRbZKFndAnhg6c5DZivYBFA0V9tnu8Q==","signatures":[{"sig":"MEYCIQDHh1Rh1w/3s1aB8rbN9LbaKfvVRm1HVvqcg26Y0CiPoAIhAM5keRU0n+djxArmaRyeEVJdAu0C8mtcUWYQTnkvga1t","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":858883,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhQ7RnCRA9TVsSAnZWagAA4uEQAImsNcfJ+aDRqflBXZwm\nn4Fy8YINIWHnh0YtqtiJGTfnxv8kpgLndMLJCdmGK13nzo/5V090FvtQ3Wlo\n2713VWHe2bJp99uV4y6rbrgA+Bx6SpqebxtKNg+zRXABO5DvKNiD//uiNEDZ\nt1g63OEj275oIPT8ERSqeWAq2cddkwe6cGuQQq1rdAjN9vpKVvqqHlEhT4NJ\n21GyIO4e1IEeipABWfFWVOH8WShqxqV43Es7pRrBegyBtIZYOU9STJNO2VcF\n3jEwUMAZ5vD/vcEcGbY0AXzoOa+Pbzf5/Gk+s8W5n43HU/+y0L+jqFoUz8NO\ncuEYZPmI3uwZ1mDr6eai3fQzhCUdHF/4AXfmILe8d9wl0KNl6n44jr8GaWqH\nj0s9LYOZU21V4Xcw8jZriix9elUWoT5Sivv5nmbytk90IY22lfyWFEnfRdJT\nOHhbQmfTjjq+orv/RoOmGQbgvPpajZ+SJox1+DF86xOigk/JUtR3Mewkba3p\nCDrziQaU/lCa/wBOLnwZxI+A4KUfPoHvSR3CF1WeASadlMqGpO+GQPUQT1uL\nO7DBWdK/LYqgyMRBmTjaJBsuHDIXP02rJ319B3WnRo4F7cPCVVlmF76HbUN1\nVu/6oDv0nnk4F3SwdVqz5Kt2UFG/RSPnVYEvPNoJu8AFoDlQpKzl3iL37kf9\nUj8q\r\n=+DtO\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"7f141fcd82e6061ac62fb457dad40c0ad70e52d5","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"13.0.0-canary.65125b3a6.0","@material/rtl":"13.0.0-canary.65125b3a6.0","@material/base":"13.0.0-canary.65125b3a6.0","@material/theme":"13.0.0-canary.65125b3a6.0","@material/ripple":"13.0.0-canary.65125b3a6.0","@material/animation":"13.0.0-canary.65125b3a6.0","@material/elevation":"13.0.0-canary.65125b3a6.0","@material/typography":"13.0.0-canary.65125b3a6.0","@material/feature-targeting":"13.0.0-canary.65125b3a6.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_13.0.0-canary.65125b3a6.0_1631827047658_0.4957939878357429","host":"s3://npm-registry-packages"}},"13.0.0-canary.80a583365.0":{"name":"@material/slider","version":"13.0.0-canary.80a583365.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@13.0.0-canary.80a583365.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"02dca1023930e799b5889283683dd20907c68f45","tarball":"https://registry.npmjs.org/@material/slider/-/slider-13.0.0-canary.80a583365.0.tgz","fileCount":37,"integrity":"sha512-lCVJF5k9LT7v9G4ISBCn5/2yX79j8wTITOy7oOjqY5RSPupj5leNfot/qrzUBv9V7sC3Pve1cy8Q2D8HwJrK4A==","signatures":[{"sig":"MEQCICVBUmGlEb4unxFTDrcKRRxagIm3j5AJrp36F6JhkIvlAiBNHKbyrlwCQvRR8LVYEkUOau79E7DpgeeNT9D3ZO1bIw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":858883},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"c174baf193216601da7fe07831dd2152585c6beb","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.17.6+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.17.6","dependencies":{"tslib":"^2.1.0","@material/dom":"13.0.0-canary.80a583365.0","@material/rtl":"13.0.0-canary.80a583365.0","@material/base":"13.0.0-canary.80a583365.0","@material/theme":"13.0.0-canary.80a583365.0","@material/ripple":"13.0.0-canary.80a583365.0","@material/animation":"13.0.0-canary.80a583365.0","@material/elevation":"13.0.0-canary.80a583365.0","@material/typography":"13.0.0-canary.80a583365.0","@material/feature-targeting":"13.0.0-canary.80a583365.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_13.0.0-canary.80a583365.0_1631910942846_0.6727991545387833","host":"s3://npm-registry-packages"}},"13.0.0-canary.83900936a.0":{"name":"@material/slider","version":"13.0.0-canary.83900936a.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@13.0.0-canary.83900936a.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"f60dcbbeb69dff4029103096db1792671eedc91d","tarball":"https://registry.npmjs.org/@material/slider/-/slider-13.0.0-canary.83900936a.0.tgz","fileCount":37,"integrity":"sha512-cf66+fJGCbcWUE6EkJNJANSdUeWGUc9joAIBE6SLcrZA0h630yi2J06LgoHWat5LCX2RJtgoVT4DkDwsEHBSCA==","signatures":[{"sig":"MEQCICfG9xt+BwVXG22BlI79BOQHCK/Kql8h7PRok/SQAySnAiBGIvpv/H9uWNMQpjm5wtQ/Z31oQn4NvsHWOZdHSgcVYg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":858883},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"ca6026fb6b378ac9a4f14997612369fe29f31093","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.17.6+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.17.6","dependencies":{"tslib":"^2.1.0","@material/dom":"13.0.0-canary.83900936a.0","@material/rtl":"13.0.0-canary.83900936a.0","@material/base":"13.0.0-canary.83900936a.0","@material/theme":"13.0.0-canary.83900936a.0","@material/ripple":"13.0.0-canary.83900936a.0","@material/animation":"13.0.0-canary.83900936a.0","@material/elevation":"13.0.0-canary.83900936a.0","@material/typography":"13.0.0-canary.83900936a.0","@material/feature-targeting":"13.0.0-canary.83900936a.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_13.0.0-canary.83900936a.0_1631921055774_0.7753136039202353","host":"s3://npm-registry-packages"}},"13.0.0-canary.860ad06a1.0":{"name":"@material/slider","version":"13.0.0-canary.860ad06a1.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@13.0.0-canary.860ad06a1.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"492372e5a5cc1cc4a1cb671fb77f92bd2b239e4d","tarball":"https://registry.npmjs.org/@material/slider/-/slider-13.0.0-canary.860ad06a1.0.tgz","fileCount":37,"integrity":"sha512-HRFsNgaxPo75QjaF+VY6/TxXmo+hh5Gq/1AnTNwFWkSqgRg2akzD7zm3x942Mv4e/o5l2pSN4ZGxHdBOOyFJnA==","signatures":[{"sig":"MEUCIQDCp9XrAYT2hrfTRUtgZB9zW0DrMBk2YL5uo3hP+diDJAIgB02u2y632XTx+qKXsHYlBz7lIZ3M8cxyabJxsSX8sow=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":858883},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"8f156ac018a526d53d5f5077762518483bfa7dc7","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.17.6+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.17.6","dependencies":{"tslib":"^2.1.0","@material/dom":"13.0.0-canary.860ad06a1.0","@material/rtl":"13.0.0-canary.860ad06a1.0","@material/base":"13.0.0-canary.860ad06a1.0","@material/theme":"13.0.0-canary.860ad06a1.0","@material/ripple":"13.0.0-canary.860ad06a1.0","@material/animation":"13.0.0-canary.860ad06a1.0","@material/elevation":"13.0.0-canary.860ad06a1.0","@material/typography":"13.0.0-canary.860ad06a1.0","@material/feature-targeting":"13.0.0-canary.860ad06a1.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_13.0.0-canary.860ad06a1.0_1631921768763_0.4542585492499531","host":"s3://npm-registry-packages"}},"13.0.0-canary.3b8d4429e.0":{"name":"@material/slider","version":"13.0.0-canary.3b8d4429e.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@13.0.0-canary.3b8d4429e.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"453f08eae56baeb44534f9c192f20fc785559f71","tarball":"https://registry.npmjs.org/@material/slider/-/slider-13.0.0-canary.3b8d4429e.0.tgz","fileCount":37,"integrity":"sha512-lW7oZcQ+uLy4t3mb12O1et/PPb7YPtq6Ilmj7+N3lgtbsHdMqB++fhv2nDfarfWrkzMaL+sc6AbFzwmjf0f+Ow==","signatures":[{"sig":"MEUCIDmZmLl3sfsNrny3VZ1pqBZs4C4T1d/u41XworibdKvLAiEAnZGr7m0Z9bdtMgS4jH5SDYLO6C6t/2QxdnZwHvwmlAM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":858883},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"c548d2fdb2731631683bc92955d6701cd0c2bd14","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.17.6+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.17.6","dependencies":{"tslib":"^2.1.0","@material/dom":"13.0.0-canary.3b8d4429e.0","@material/rtl":"13.0.0-canary.3b8d4429e.0","@material/base":"13.0.0-canary.3b8d4429e.0","@material/theme":"13.0.0-canary.3b8d4429e.0","@material/ripple":"13.0.0-canary.3b8d4429e.0","@material/animation":"13.0.0-canary.3b8d4429e.0","@material/elevation":"13.0.0-canary.3b8d4429e.0","@material/typography":"13.0.0-canary.3b8d4429e.0","@material/feature-targeting":"13.0.0-canary.3b8d4429e.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_13.0.0-canary.3b8d4429e.0_1632160051325_0.7382230639236516","host":"s3://npm-registry-packages"}},"13.0.0-canary.2da3606b9.0":{"name":"@material/slider","version":"13.0.0-canary.2da3606b9.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@13.0.0-canary.2da3606b9.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"c3a9b4bb97e0f28f6b69f4c8b9cf5505cfe16ae1","tarball":"https://registry.npmjs.org/@material/slider/-/slider-13.0.0-canary.2da3606b9.0.tgz","fileCount":37,"integrity":"sha512-psRhyfJ4eXArY9rXE1GzN1t6CeEJB5n8tMqZ3re8XFB8f1BeiQ7/I3xroTSphwVexRcr3UXixjQQX6bKGtDywg==","signatures":[{"sig":"MEUCIA9TmHIn3lGBakGN5cX1g9wOEr4RRWWzAJ2plKvLttxJAiEA7RtLBZhpxpp/S3ZQOW4UP92oUOjSfWgYEbFOFMdGl/E=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":858973},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"c452408cf52d900869313ad573c1b84c9d6a3105","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.17.6+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.17.6","dependencies":{"tslib":"^2.1.0","@material/dom":"13.0.0-canary.2da3606b9.0","@material/rtl":"13.0.0-canary.2da3606b9.0","@material/base":"13.0.0-canary.2da3606b9.0","@material/theme":"13.0.0-canary.2da3606b9.0","@material/ripple":"13.0.0-canary.2da3606b9.0","@material/animation":"13.0.0-canary.2da3606b9.0","@material/elevation":"13.0.0-canary.2da3606b9.0","@material/typography":"13.0.0-canary.2da3606b9.0","@material/feature-targeting":"13.0.0-canary.2da3606b9.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_13.0.0-canary.2da3606b9.0_1632166658321_0.1464996520717048","host":"s3://npm-registry-packages"}},"13.0.0-canary.e8c598d1e.0":{"name":"@material/slider","version":"13.0.0-canary.e8c598d1e.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@13.0.0-canary.e8c598d1e.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"d67065fe1e7aa96ddf847001568da8ee77bf6f68","tarball":"https://registry.npmjs.org/@material/slider/-/slider-13.0.0-canary.e8c598d1e.0.tgz","fileCount":37,"integrity":"sha512-KkqYWMgDT68c3gYw2nBh7XzYBez/EOpJuolNnFiGJTCHQPCmJv6LWXRpsG2QWzRJzl75VAknvX1ETka4ekZ77w==","signatures":[{"sig":"MEQCIAHwkeufRC5S2UOZTMaWMPHNlhuE8DtO+HxJeV/o9HtXAiARCji3bkSmb0/2pthFzGpAXuNSsBD8vXaXNkGIPw7sCg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":858973},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"11ab5557b275cc7f950ff2123684083e6245eafe","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.17.6+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.17.6","dependencies":{"tslib":"^2.1.0","@material/dom":"13.0.0-canary.e8c598d1e.0","@material/rtl":"13.0.0-canary.e8c598d1e.0","@material/base":"13.0.0-canary.e8c598d1e.0","@material/theme":"13.0.0-canary.e8c598d1e.0","@material/ripple":"13.0.0-canary.e8c598d1e.0","@material/animation":"13.0.0-canary.e8c598d1e.0","@material/elevation":"13.0.0-canary.e8c598d1e.0","@material/typography":"13.0.0-canary.e8c598d1e.0","@material/feature-targeting":"13.0.0-canary.e8c598d1e.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_13.0.0-canary.e8c598d1e.0_1632172309674_0.32633709011292766","host":"s3://npm-registry-packages"}},"13.0.0-canary.1340ee9f7.0":{"name":"@material/slider","version":"13.0.0-canary.1340ee9f7.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@13.0.0-canary.1340ee9f7.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"84383b9092a500da2e7b40ad624056f72ede353d","tarball":"https://registry.npmjs.org/@material/slider/-/slider-13.0.0-canary.1340ee9f7.0.tgz","fileCount":37,"integrity":"sha512-lj9rk27AXFiGNVqUNj0druzcYXtKq5tbU/63UhlkCclETuZ+BUVnlNcfsy7fYdhoJAYwVSVGDAslg2F+sb3yBg==","signatures":[{"sig":"MEUCIBAXWxYc1PnGQuFTFWS/n2XuUFojDVxT+3azfWmuxixPAiEAy3+cdqxsvqZw+jG56xS0L2bvvzotu2fQXpNyB0fq/zg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":859005},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"c9cbdc93fd9954f12cb74ebaf2cfa5806d078879","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.17.6+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.17.6","dependencies":{"tslib":"^2.1.0","@material/dom":"13.0.0-canary.1340ee9f7.0","@material/rtl":"13.0.0-canary.1340ee9f7.0","@material/base":"13.0.0-canary.1340ee9f7.0","@material/theme":"13.0.0-canary.1340ee9f7.0","@material/ripple":"13.0.0-canary.1340ee9f7.0","@material/animation":"13.0.0-canary.1340ee9f7.0","@material/elevation":"13.0.0-canary.1340ee9f7.0","@material/typography":"13.0.0-canary.1340ee9f7.0","@material/feature-targeting":"13.0.0-canary.1340ee9f7.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_13.0.0-canary.1340ee9f7.0_1632333484568_0.4878966880096822","host":"s3://npm-registry-packages"}},"13.0.0-canary.65084baff.0":{"name":"@material/slider","version":"13.0.0-canary.65084baff.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@13.0.0-canary.65084baff.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"6219f1379915284d86ac858ad19f2eede5627e09","tarball":"https://registry.npmjs.org/@material/slider/-/slider-13.0.0-canary.65084baff.0.tgz","fileCount":37,"integrity":"sha512-vESXr7ODTKE6TEMdX2GiqdOt0Dw1aXUB4oMnSLSudnJbP6Z0QqrvVs2ybWb+y2zpmU6EZCM1gfdo4/Nabr6Sxg==","signatures":[{"sig":"MEUCIE4upZHXsf1g51yvtDNIQdgHOWSHL6zplvAB0G8TczuAAiEA9cJuL+PyUAIHvp+e06ERzoWVVublMarTd4g0x9F15l8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":859005},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"afe4cce0d8c7e5038058ea8198ffd72e99e1c941","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.17.6+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.17.6","dependencies":{"tslib":"^2.1.0","@material/dom":"13.0.0-canary.65084baff.0","@material/rtl":"13.0.0-canary.65084baff.0","@material/base":"13.0.0-canary.65084baff.0","@material/theme":"13.0.0-canary.65084baff.0","@material/ripple":"13.0.0-canary.65084baff.0","@material/animation":"13.0.0-canary.65084baff.0","@material/elevation":"13.0.0-canary.65084baff.0","@material/typography":"13.0.0-canary.65084baff.0","@material/feature-targeting":"13.0.0-canary.65084baff.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_13.0.0-canary.65084baff.0_1632432338530_0.10892972257172095","host":"s3://npm-registry-packages"}},"13.0.0-canary.c79aa0cdd.0":{"name":"@material/slider","version":"13.0.0-canary.c79aa0cdd.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@13.0.0-canary.c79aa0cdd.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"2991d89abe223c36a000bdf3653a751c424a9601","tarball":"https://registry.npmjs.org/@material/slider/-/slider-13.0.0-canary.c79aa0cdd.0.tgz","fileCount":37,"integrity":"sha512-OvWaxGYaXnLBoDzffM/bMdR4jkzsLtWP2xo6qYd1spaWJuLVt9l3nwHeEIQKSCY/hR0wmOISOW4GT60hUaC3Xg==","signatures":[{"sig":"MEUCIQCw6ZYlDuHiUdHU8NInpabCk8SbViOjBVa4GuKufkpQSQIgSSIws3P43Pc4Td9kWXoaJmUtSoeMrKcC4qmuQ9V4ims=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":859005},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"2caa02d38f883966fd5f78948743dabdced9b689","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.17.6+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.17.6","dependencies":{"tslib":"^2.1.0","@material/dom":"13.0.0-canary.c79aa0cdd.0","@material/rtl":"13.0.0-canary.c79aa0cdd.0","@material/base":"13.0.0-canary.c79aa0cdd.0","@material/theme":"13.0.0-canary.c79aa0cdd.0","@material/ripple":"13.0.0-canary.c79aa0cdd.0","@material/animation":"13.0.0-canary.c79aa0cdd.0","@material/elevation":"13.0.0-canary.c79aa0cdd.0","@material/typography":"13.0.0-canary.c79aa0cdd.0","@material/feature-targeting":"13.0.0-canary.c79aa0cdd.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_13.0.0-canary.c79aa0cdd.0_1632490924495_0.6065545338563401","host":"s3://npm-registry-packages"}},"13.0.0":{"name":"@material/slider","version":"13.0.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@13.0.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"21575e99bc9700b56d44bb5ee1b63b4a0545e412","tarball":"https://registry.npmjs.org/@material/slider/-/slider-13.0.0.tgz","fileCount":36,"integrity":"sha512-PW+3X9MiOoWmXhirYo/Mk2UYW00Tnsihrx5YJQ4+IxwbrUI75/8yUsO8kVr7YC+Eqhldz8oXzhIXglQFtbpolQ==","signatures":[{"sig":"MEQCIHoEEP7dDZJgYKTJNy64qJ10sQRaoC13A667NTKqARyUAiAfubhAKlWOuc/0bFT2Ot1TlCKs34QkMcof0fUVDtDfCQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":857910},"main":"dist/mdc.slider.js","module":"index.js","gitHead":"198431fcd8ff3028934d2cf3a5b292f8482a4570","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.17.6+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.17.6","dependencies":{"tslib":"^2.1.0","@material/dom":"^13.0.0","@material/rtl":"^13.0.0","@material/base":"^13.0.0","@material/theme":"^13.0.0","@material/ripple":"^13.0.0","@material/animation":"^13.0.0","@material/elevation":"^13.0.0","@material/typography":"^13.0.0","@material/feature-targeting":"^13.0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/slider_13.0.0_1632512746360_0.4807281836551487","host":"s3://npm-registry-packages"}},"14.0.0-canary.198431fcd.0":{"name":"@material/slider","version":"14.0.0-canary.198431fcd.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@14.0.0-canary.198431fcd.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"927f4e5cca5b3127c98413561f83386511045a3f","tarball":"https://registry.npmjs.org/@material/slider/-/slider-14.0.0-canary.198431fcd.0.tgz","fileCount":37,"integrity":"sha512-vnG2EXbeJ3lPoAOi6QC14EhPb07P5KKxtUyHfq+ivFE64x+FYZreN006u+p59WjRkg5HZ/5/tq1lzUqdobMn+g==","signatures":[{"sig":"MEUCIQDeZ2NLVSCHe5GurmtYOOD7nU0CI5MHRlsB3K1HJ1cwOgIgX63xpdim0kxwFhTewpbSjc/XaMZCamlCYcUnHQ22Rxw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":859005},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"34242e3354729334618dc12d6bc959e0a8f14dd4","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.17.6+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.17.6","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.198431fcd.0","@material/rtl":"14.0.0-canary.198431fcd.0","@material/base":"14.0.0-canary.198431fcd.0","@material/theme":"14.0.0-canary.198431fcd.0","@material/ripple":"14.0.0-canary.198431fcd.0","@material/animation":"14.0.0-canary.198431fcd.0","@material/elevation":"14.0.0-canary.198431fcd.0","@material/typography":"14.0.0-canary.198431fcd.0","@material/feature-targeting":"14.0.0-canary.198431fcd.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_14.0.0-canary.198431fcd.0_1632512791019_0.10238570510510825","host":"s3://npm-registry-packages"}},"14.0.0-canary.9a02b6ef8.0":{"name":"@material/slider","version":"14.0.0-canary.9a02b6ef8.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@14.0.0-canary.9a02b6ef8.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"c15a8c2241baff4612308c3fc7efe963b245fe07","tarball":"https://registry.npmjs.org/@material/slider/-/slider-14.0.0-canary.9a02b6ef8.0.tgz","fileCount":37,"integrity":"sha512-31RHv3EpwAnO44+4qewMCNvOW9nc3q3TuLcqPFbbwls5JI7gv7NqunY8U5CoX4O4pFsSA3XsrcrCoCupcsLZQw==","signatures":[{"sig":"MEYCIQCZy6ZDpfP+L/Lj/WOl7zoR/reRMmX7ii6AeSssh3uNDQIhANIHzZYL0hTEgwQj4NqweaUvDctsWavt182XJb3kXZCj","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":858946},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"13e91b1150d6339b15d71c44c8743eb9e2026eaf","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.17.6+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.17.6","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.9a02b6ef8.0","@material/rtl":"14.0.0-canary.9a02b6ef8.0","@material/base":"14.0.0-canary.9a02b6ef8.0","@material/theme":"14.0.0-canary.9a02b6ef8.0","@material/ripple":"14.0.0-canary.9a02b6ef8.0","@material/animation":"14.0.0-canary.9a02b6ef8.0","@material/elevation":"14.0.0-canary.9a02b6ef8.0","@material/typography":"14.0.0-canary.9a02b6ef8.0","@material/feature-targeting":"14.0.0-canary.9a02b6ef8.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_14.0.0-canary.9a02b6ef8.0_1632575470413_0.12942573946324454","host":"s3://npm-registry-packages"}},"14.0.0-canary.758ce31d9.0":{"name":"@material/slider","version":"14.0.0-canary.758ce31d9.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@14.0.0-canary.758ce31d9.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"60ffa8e71a3ee9d0a61c3c8c9cd4d16882b929ee","tarball":"https://registry.npmjs.org/@material/slider/-/slider-14.0.0-canary.758ce31d9.0.tgz","fileCount":37,"integrity":"sha512-ER/GlSevnMnKMafysH9Lc5vmKOsxLCNxWgBfXSRaU9dYYqCqe4XpWG+oGU4S4xffIPbxqKic34dO77wA5Q2Rfg==","signatures":[{"sig":"MEYCIQC/GMgNjwiEcC0lGbKgWjGZAYAGxx9SuN0KKwbX4jc7PwIhAOUI9XiRUUsKSk6b21n/tKfBWjpikQnlsQ7EUwBYmWID","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":858946},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"09083795b738aece76a37f8a1dcc8daf958204b1","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.17.6+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.17.6","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.758ce31d9.0","@material/rtl":"14.0.0-canary.758ce31d9.0","@material/base":"14.0.0-canary.758ce31d9.0","@material/theme":"14.0.0-canary.758ce31d9.0","@material/ripple":"14.0.0-canary.758ce31d9.0","@material/animation":"14.0.0-canary.758ce31d9.0","@material/elevation":"14.0.0-canary.758ce31d9.0","@material/typography":"14.0.0-canary.758ce31d9.0","@material/feature-targeting":"14.0.0-canary.758ce31d9.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_14.0.0-canary.758ce31d9.0_1632763764177_0.2245280507146148","host":"s3://npm-registry-packages"}},"14.0.0-canary.86b50ef74.0":{"name":"@material/slider","version":"14.0.0-canary.86b50ef74.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@14.0.0-canary.86b50ef74.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"9619d48a282d254d6e6f20230f3691a79c84a630","tarball":"https://registry.npmjs.org/@material/slider/-/slider-14.0.0-canary.86b50ef74.0.tgz","fileCount":37,"integrity":"sha512-iGuDouD7CB3zQSMlXa+qupPxJV/yCIKO+2M4lTRqOOBF+KnXGy8lBMThYIRMFreBOjK0wKJYgJpUKZNMLh4flw==","signatures":[{"sig":"MEUCIBoPRc6RwP2vw+x5kNc4yTXhUIi49OnYiwk3548w9WMZAiEAmCNmOQbhoFfbuhFLupnhkFYWvGNhdSTDsRhLFMx0SXQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":858946},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"5941ece7c1e494e720865be940d098a5556de149","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.17.6+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.17.6","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.86b50ef74.0","@material/rtl":"14.0.0-canary.86b50ef74.0","@material/base":"14.0.0-canary.86b50ef74.0","@material/theme":"14.0.0-canary.86b50ef74.0","@material/ripple":"14.0.0-canary.86b50ef74.0","@material/animation":"14.0.0-canary.86b50ef74.0","@material/elevation":"14.0.0-canary.86b50ef74.0","@material/typography":"14.0.0-canary.86b50ef74.0","@material/feature-targeting":"14.0.0-canary.86b50ef74.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_14.0.0-canary.86b50ef74.0_1632850992249_0.14097158107316177","host":"s3://npm-registry-packages"}},"14.0.0-canary.b2fe3528b.0":{"name":"@material/slider","version":"14.0.0-canary.b2fe3528b.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@14.0.0-canary.b2fe3528b.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"4cd10abc4d98311e565d1656af8fbcaed2077d30","tarball":"https://registry.npmjs.org/@material/slider/-/slider-14.0.0-canary.b2fe3528b.0.tgz","fileCount":37,"integrity":"sha512-G4fVvTD/jwbzEysZ/D/zuOVsQaaLzGYMQKO19Mv2r37SPvXLPdHj7cJgN+3bJeVLIePqj7P/Wi2LMDsyLaoWdw==","signatures":[{"sig":"MEYCIQCypWmZ/Hx6UCCfKlTKiSwbyS97JNfC94HeT9OFGzn0uAIhAOqFUw+FRm5iXKrQY9C/Xg6KNPQmb9CaZhYfsJbL49dy","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":858946},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"cce11b1c181ea84c0bfdbef26112377518afa98b","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.17.6+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.17.6","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.b2fe3528b.0","@material/rtl":"14.0.0-canary.b2fe3528b.0","@material/base":"14.0.0-canary.b2fe3528b.0","@material/theme":"14.0.0-canary.b2fe3528b.0","@material/ripple":"14.0.0-canary.b2fe3528b.0","@material/animation":"14.0.0-canary.b2fe3528b.0","@material/elevation":"14.0.0-canary.b2fe3528b.0","@material/typography":"14.0.0-canary.b2fe3528b.0","@material/feature-targeting":"14.0.0-canary.b2fe3528b.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_14.0.0-canary.b2fe3528b.0_1632956209885_0.6016563397399719","host":"s3://npm-registry-packages"}},"14.0.0-canary.586e740dd.0":{"name":"@material/slider","version":"14.0.0-canary.586e740dd.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@14.0.0-canary.586e740dd.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"27942e3e30bf4cb0e805005dca9ccdd29b26c92a","tarball":"https://registry.npmjs.org/@material/slider/-/slider-14.0.0-canary.586e740dd.0.tgz","fileCount":37,"integrity":"sha512-ZYRuqoCgMURSFcSGvD059iuD8PzIV/P2MJxRlXeEWDGU6O/Lfjr8yMQjk8eGt2e7OkUgB+8zTRftJM1G6X7MSg==","signatures":[{"sig":"MEUCIQDAQNA23RVRe3HifSx/CLGg931R9yz8lUwko+l57Yoj+wIgDqwjwXqGsO+ObQeYaGk3Mf24RejqPGpXG9PDK6FRRFU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":858946},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"6c765889db11456de00c45d7bb289b6c7cf3ec27","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.18.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.18.0","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.586e740dd.0","@material/rtl":"14.0.0-canary.586e740dd.0","@material/base":"14.0.0-canary.586e740dd.0","@material/theme":"14.0.0-canary.586e740dd.0","@material/ripple":"14.0.0-canary.586e740dd.0","@material/animation":"14.0.0-canary.586e740dd.0","@material/elevation":"14.0.0-canary.586e740dd.0","@material/typography":"14.0.0-canary.586e740dd.0","@material/feature-targeting":"14.0.0-canary.586e740dd.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_14.0.0-canary.586e740dd.0_1633019474002_0.32459175745117874","host":"s3://npm-registry-packages"}},"14.0.0-canary.2ac92d766.0":{"name":"@material/slider","version":"14.0.0-canary.2ac92d766.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@14.0.0-canary.2ac92d766.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"5e46d888b2bf55024de4008c5c86dc77830f6f3e","tarball":"https://registry.npmjs.org/@material/slider/-/slider-14.0.0-canary.2ac92d766.0.tgz","fileCount":37,"integrity":"sha512-aXg3yzcwEjA7wqfoXe7LUaK57R7VfMhiZajsmibfZ0pFBYjfHRpnyLyRTgClQ7Pbfae+Vk3c2OeL0AhUI2ivpA==","signatures":[{"sig":"MEUCIQD8LpSCvxw6ZY+q+g4o6FV/azPjg+7vd+xFIZsf+vq53gIgdG/uLbGMHX2pUtR1GFY4FBubx3Rzrq2lS+GZti9V52M=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":858946},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"3a797e3a01110aeaf8270a13c2cc32d0871a8bd2","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.18.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.18.0","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.2ac92d766.0","@material/rtl":"14.0.0-canary.2ac92d766.0","@material/base":"14.0.0-canary.2ac92d766.0","@material/theme":"14.0.0-canary.2ac92d766.0","@material/ripple":"14.0.0-canary.2ac92d766.0","@material/animation":"14.0.0-canary.2ac92d766.0","@material/elevation":"14.0.0-canary.2ac92d766.0","@material/typography":"14.0.0-canary.2ac92d766.0","@material/feature-targeting":"14.0.0-canary.2ac92d766.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_14.0.0-canary.2ac92d766.0_1633462121855_0.7188332184929802","host":"s3://npm-registry-packages"}},"14.0.0-canary.353ca7e9f.0":{"name":"@material/slider","version":"14.0.0-canary.353ca7e9f.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@14.0.0-canary.353ca7e9f.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"0ec0c4dfbab8bbeedf17419717a42c9b013228b1","tarball":"https://registry.npmjs.org/@material/slider/-/slider-14.0.0-canary.353ca7e9f.0.tgz","fileCount":37,"integrity":"sha512-wYVmPpTpqfFeGPAxSVkT67tazHaF4LO99D0Z2uwiJqhdsPRAni/2S6qt1tS59bMF9ca2s+4soNa2zoFtgFtPJQ==","signatures":[{"sig":"MEYCIQDlwww1dHjMSBLdzZnHwp6z6okjmtGw0s8e0ikzxVAX1wIhAPjPKhGN1ZWP1qewYht3lcEMpDvDQN/TCt/vNBJ4Me4N","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":858946},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"4f091efbfcb52d523712f9b99808d737b06a60af","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.18.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.18.0","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.353ca7e9f.0","@material/rtl":"14.0.0-canary.353ca7e9f.0","@material/base":"14.0.0-canary.353ca7e9f.0","@material/theme":"14.0.0-canary.353ca7e9f.0","@material/ripple":"14.0.0-canary.353ca7e9f.0","@material/animation":"14.0.0-canary.353ca7e9f.0","@material/elevation":"14.0.0-canary.353ca7e9f.0","@material/typography":"14.0.0-canary.353ca7e9f.0","@material/feature-targeting":"14.0.0-canary.353ca7e9f.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_14.0.0-canary.353ca7e9f.0_1633718811566_0.8310533462570575","host":"s3://npm-registry-packages"}},"14.0.0-canary.c78ff0429.0":{"name":"@material/slider","version":"14.0.0-canary.c78ff0429.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@14.0.0-canary.c78ff0429.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"31d8d4d04abb46284742ec0a1ce3a006d0cfe0d2","tarball":"https://registry.npmjs.org/@material/slider/-/slider-14.0.0-canary.c78ff0429.0.tgz","fileCount":37,"integrity":"sha512-sajgvrPfa0AoVqi5Oz8h0H7+iaIMoNH4I4K2FL1z7abZ0V9n8VrN8M3RDTjdGaDAci7dDNLYsnlGlgTUHEaqpg==","signatures":[{"sig":"MEUCIDVNRwSPG71G+74eMW1s6Ed2TYW5qzNqemDp0RU9fwM+AiEA7bQoRxd2uGAGalpIyD+MbYZOGOPawEIyJ3itnN8/+30=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":858952},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"55d918ee5ce9842b93075fa0d0ffd2b64b5f3ed3","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.18.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.18.0","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.c78ff0429.0","@material/rtl":"14.0.0-canary.c78ff0429.0","@material/base":"14.0.0-canary.c78ff0429.0","@material/theme":"14.0.0-canary.c78ff0429.0","@material/ripple":"14.0.0-canary.c78ff0429.0","@material/animation":"14.0.0-canary.c78ff0429.0","@material/elevation":"14.0.0-canary.c78ff0429.0","@material/typography":"14.0.0-canary.c78ff0429.0","@material/feature-targeting":"14.0.0-canary.c78ff0429.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_14.0.0-canary.c78ff0429.0_1633972934932_0.7171034791620052","host":"s3://npm-registry-packages"}},"14.0.0-canary.261f2db59.0":{"name":"@material/slider","version":"14.0.0-canary.261f2db59.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@14.0.0-canary.261f2db59.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"fa80b9887006b4d86255ef320e45c630963c7623","tarball":"https://registry.npmjs.org/@material/slider/-/slider-14.0.0-canary.261f2db59.0.tgz","fileCount":37,"integrity":"sha512-JoTlKGDf5+Ao0JNNlpiNM1h3TezhOELpM8dmCs1IwCzw7pWepihSa4oXemdDadHKAYM0HOIo2OQVcark96/WSQ==","signatures":[{"sig":"MEQCIE4LAXAYpD8kkYpAHHHuADFByMtgljm1FWapb4HltnbrAiBtbi3cSZxJI8SIfhhse7BGd46P1Wr20cUCYaCzCPFpCQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":858952},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"22c1cb4091a589b9a53b844da4e8d98309c75acd","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.18.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.18.0","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.261f2db59.0","@material/rtl":"14.0.0-canary.261f2db59.0","@material/base":"14.0.0-canary.261f2db59.0","@material/theme":"14.0.0-canary.261f2db59.0","@material/ripple":"14.0.0-canary.261f2db59.0","@material/animation":"14.0.0-canary.261f2db59.0","@material/elevation":"14.0.0-canary.261f2db59.0","@material/typography":"14.0.0-canary.261f2db59.0","@material/feature-targeting":"14.0.0-canary.261f2db59.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_14.0.0-canary.261f2db59.0_1634749190245_0.18132287278507486","host":"s3://npm-registry-packages"}},"14.0.0-canary.9803d2dc1.0":{"name":"@material/slider","version":"14.0.0-canary.9803d2dc1.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@14.0.0-canary.9803d2dc1.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"9120474edd8e39a0dc474dd96be95fa2ba2bbf5c","tarball":"https://registry.npmjs.org/@material/slider/-/slider-14.0.0-canary.9803d2dc1.0.tgz","fileCount":37,"integrity":"sha512-iVLFWSN1WatUaUD1kMdWCvP2qqY7xuhfI5o+5grH3TQKHCKJtOHBJxAgG4VLv3NsmNwNfO8gtckd4gbTo3Qavw==","signatures":[{"sig":"MEUCIC+elEq89ms7Nv1uhKo6rdVrqAWDIzZMWv5klQGG2nKiAiEA3fkHyWlAlpGELfpNYlbVhVJ0qFqUA0GxrChlIKaGbOc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":858952},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"4ef0574fd4b362b2609f5dc9bc002ef96f07fcc9","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.18.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.18.0","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.9803d2dc1.0","@material/rtl":"14.0.0-canary.9803d2dc1.0","@material/base":"14.0.0-canary.9803d2dc1.0","@material/theme":"14.0.0-canary.9803d2dc1.0","@material/ripple":"14.0.0-canary.9803d2dc1.0","@material/animation":"14.0.0-canary.9803d2dc1.0","@material/elevation":"14.0.0-canary.9803d2dc1.0","@material/typography":"14.0.0-canary.9803d2dc1.0","@material/feature-targeting":"14.0.0-canary.9803d2dc1.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_14.0.0-canary.9803d2dc1.0_1634757706685_0.31736267105418636","host":"s3://npm-registry-packages"}},"14.0.0-canary.348665978.0":{"name":"@material/slider","version":"14.0.0-canary.348665978.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@14.0.0-canary.348665978.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"af9c53d5c3291ceebabc5902e02855c9ba0148a3","tarball":"https://registry.npmjs.org/@material/slider/-/slider-14.0.0-canary.348665978.0.tgz","fileCount":37,"integrity":"sha512-mwNhzFnrAsVufD4JW/SY48MGBvLpeKxOTTnkQbIO1uuArJ7v9RumcvLK4MOTuh8e4s6ZHV195OogJmFHAMFhpw==","signatures":[{"sig":"MEQCIDpLWoST8JMIbEMoi+BDhKnovKwKWcnEqKPjzK+fWThcAiAgcrReqaxwEO+HPheCQrfRTYWvMNYVErSmcOHEKoP1mQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":858952},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"bf16d95c07dcfc371fc864fe30028299a2d5d0d2","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.18.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.348665978.0","@material/rtl":"14.0.0-canary.348665978.0","@material/base":"14.0.0-canary.348665978.0","@material/theme":"14.0.0-canary.348665978.0","@material/ripple":"14.0.0-canary.348665978.0","@material/animation":"14.0.0-canary.348665978.0","@material/elevation":"14.0.0-canary.348665978.0","@material/typography":"14.0.0-canary.348665978.0","@material/feature-targeting":"14.0.0-canary.348665978.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_14.0.0-canary.348665978.0_1634827836319_0.39650810247763446","host":"s3://npm-registry-packages"}},"14.0.0-canary.b2b979a8a.0":{"name":"@material/slider","version":"14.0.0-canary.b2b979a8a.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@14.0.0-canary.b2b979a8a.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"acd4337627af929079d320dc5c3144f90f17fb78","tarball":"https://registry.npmjs.org/@material/slider/-/slider-14.0.0-canary.b2b979a8a.0.tgz","fileCount":37,"integrity":"sha512-FQPPWw+mmpHSNB8ciCPjoxCWMAHSFkOLhGZzTalhteIHBBxR1Zo/ukcd6dYS4Wzd9fOgwNSx01W1Vw3ItQofjw==","signatures":[{"sig":"MEQCIA1cGfUk8X505wUlaCm2vhLWg0629IlaCLxPfhy5V+06AiA9a5EqYXEg9kRl0KD+qt5BFnv/W3fjRXHxQpww72M2Rg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":858952},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"08377359fe2dfa41ac960f776df2ba00e50e9819","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.18.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.b2b979a8a.0","@material/rtl":"14.0.0-canary.b2b979a8a.0","@material/base":"14.0.0-canary.b2b979a8a.0","@material/theme":"14.0.0-canary.b2b979a8a.0","@material/ripple":"14.0.0-canary.b2b979a8a.0","@material/animation":"14.0.0-canary.b2b979a8a.0","@material/elevation":"14.0.0-canary.b2b979a8a.0","@material/typography":"14.0.0-canary.b2b979a8a.0","@material/feature-targeting":"14.0.0-canary.b2b979a8a.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_14.0.0-canary.b2b979a8a.0_1635433931826_0.8350180181263303","host":"s3://npm-registry-packages"}},"14.0.0-canary.1af7c1c4a.0":{"name":"@material/slider","version":"14.0.0-canary.1af7c1c4a.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@14.0.0-canary.1af7c1c4a.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"8d98b9747ecb5d9303e8126787faa41de028a376","tarball":"https://registry.npmjs.org/@material/slider/-/slider-14.0.0-canary.1af7c1c4a.0.tgz","fileCount":37,"integrity":"sha512-dIyJr8wGAg+H8jebMzArJ5Mot7scAOsoStso3TrCPYodQwUxOJ6Sl2uroJAE1tTIGaI+ehgl9rkZMGNWT+4YhA==","signatures":[{"sig":"MEUCIBXLhtmUbmAk//Zhiqps9QRNRwmi+RjMzGbD6ejhWsLeAiEAloECHHkCN9iQXpC+FC2Itrvhef4MSsa3l+CMpwMVnJQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":858952},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"3673ef3144cd47c5faba873a239454e11e3d72eb","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.18.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.1af7c1c4a.0","@material/rtl":"14.0.0-canary.1af7c1c4a.0","@material/base":"14.0.0-canary.1af7c1c4a.0","@material/theme":"14.0.0-canary.1af7c1c4a.0","@material/ripple":"14.0.0-canary.1af7c1c4a.0","@material/animation":"14.0.0-canary.1af7c1c4a.0","@material/elevation":"14.0.0-canary.1af7c1c4a.0","@material/typography":"14.0.0-canary.1af7c1c4a.0","@material/feature-targeting":"14.0.0-canary.1af7c1c4a.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_14.0.0-canary.1af7c1c4a.0_1635443580120_0.04553605816836748","host":"s3://npm-registry-packages"}},"14.0.0-canary.4afd353cd.0":{"name":"@material/slider","version":"14.0.0-canary.4afd353cd.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@14.0.0-canary.4afd353cd.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"5e4d24cfa4490a6a8313f1b4a7889df16a688c44","tarball":"https://registry.npmjs.org/@material/slider/-/slider-14.0.0-canary.4afd353cd.0.tgz","fileCount":37,"integrity":"sha512-eHG+9XttO/l/PWdRT/4QzLTRKpORNbl8bCpxpLDCqdR1bise6oo4pVigbU9C+c7DJlMcWzq74fHKihdWWhIUeQ==","signatures":[{"sig":"MEYCIQDsOKhTB/quV+tahuQaPeZwnDmlPRCH5QbCf67b1bVCugIhAN7bcNsWH8tKMjunHSK6w8AaJMooBybeP4vfc5P72eeM","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":858952},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"491d940b4e97c65f274b1b4d42b3842e9bd3a4f9","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.18.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.4afd353cd.0","@material/rtl":"14.0.0-canary.4afd353cd.0","@material/base":"14.0.0-canary.4afd353cd.0","@material/theme":"14.0.0-canary.4afd353cd.0","@material/ripple":"14.0.0-canary.4afd353cd.0","@material/animation":"14.0.0-canary.4afd353cd.0","@material/elevation":"14.0.0-canary.4afd353cd.0","@material/typography":"14.0.0-canary.4afd353cd.0","@material/feature-targeting":"14.0.0-canary.4afd353cd.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_14.0.0-canary.4afd353cd.0_1635519703725_0.09958782631270657","host":"s3://npm-registry-packages"}},"14.0.0-canary.a986df922.0":{"name":"@material/slider","version":"14.0.0-canary.a986df922.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@14.0.0-canary.a986df922.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"10e5ea0cbd8663cc0779ac0fe5c55d72561fa7f6","tarball":"https://registry.npmjs.org/@material/slider/-/slider-14.0.0-canary.a986df922.0.tgz","fileCount":37,"integrity":"sha512-yvXCj1I9iEKTdSOLg87XkH5Iqj4/NKiRcb8geJAw0RcumV3sRu7e5uZ2/cCpHJJvuxFXuavMRAgQn2yfwK7mdw==","signatures":[{"sig":"MEUCIQCX+u+UKARBIsxplZ2qeW71SJnXpzkgv5KtrbUe2xx5kwIgCFucXhuUnfmhrp0QdXSi/JDq/FFdEWnNcU5oKdGaOsE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":858952},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"6fd5c666012fea37f8a5a820b4979cc66e59fe9f","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.18.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.a986df922.0","@material/rtl":"14.0.0-canary.a986df922.0","@material/base":"14.0.0-canary.a986df922.0","@material/theme":"14.0.0-canary.a986df922.0","@material/ripple":"14.0.0-canary.a986df922.0","@material/animation":"14.0.0-canary.a986df922.0","@material/elevation":"14.0.0-canary.a986df922.0","@material/typography":"14.0.0-canary.a986df922.0","@material/feature-targeting":"14.0.0-canary.a986df922.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_14.0.0-canary.a986df922.0_1635543312212_0.9693697973929729","host":"s3://npm-registry-packages"}},"14.0.0-canary.c3cdff07b.0":{"name":"@material/slider","version":"14.0.0-canary.c3cdff07b.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@14.0.0-canary.c3cdff07b.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"7f45ca4de9487dc6509d1dc809b77a5f97f7268f","tarball":"https://registry.npmjs.org/@material/slider/-/slider-14.0.0-canary.c3cdff07b.0.tgz","fileCount":37,"integrity":"sha512-tyODq12UCB8lohKxT3LSjbSP5Dw7ufS3la15wPaYtCLat2tWwfhQtuXfPZboPRNyVECNE6JJZyUFngqI5M6ceQ==","signatures":[{"sig":"MEUCID3OTTXJUhN/oSu/b3Uik0hrNnO3dlN1Cj9grfLBr1Z5AiEA+VvBHd0CsZEez7NtG03K1RjPsMow7u34yjPQVjjJoqU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":858952},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"078c19c333e3161ad6b51a3fdc993d883bdc19c8","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.18.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.c3cdff07b.0","@material/rtl":"14.0.0-canary.c3cdff07b.0","@material/base":"14.0.0-canary.c3cdff07b.0","@material/theme":"14.0.0-canary.c3cdff07b.0","@material/ripple":"14.0.0-canary.c3cdff07b.0","@material/animation":"14.0.0-canary.c3cdff07b.0","@material/elevation":"14.0.0-canary.c3cdff07b.0","@material/typography":"14.0.0-canary.c3cdff07b.0","@material/feature-targeting":"14.0.0-canary.c3cdff07b.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_14.0.0-canary.c3cdff07b.0_1636484764721_0.38388919445541303","host":"s3://npm-registry-packages"}},"14.0.0-canary.468392606.0":{"name":"@material/slider","version":"14.0.0-canary.468392606.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@14.0.0-canary.468392606.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"ef96cb18cb888cbde29417320a7196945f52450c","tarball":"https://registry.npmjs.org/@material/slider/-/slider-14.0.0-canary.468392606.0.tgz","fileCount":37,"integrity":"sha512-8qTbjNlFy9cVgLctA8bH4NYgTLi45ErzT6/o5nc9TP4ywo6NVdl41SXZFQrqqY5mGS66x/4OQz75GCy2XMk+ng==","signatures":[{"sig":"MEUCIQCs6jqIlabxMYdFczyZYQxb53dgoe4SifhWWFR77Iyh6gIgepPo8iE+wq6iPQ94KYjqyI8YIJjOnO50MpgX8n/AO6A=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":858952},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"ac451ce035a924184caaae0df5252896a7392e33","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.18.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.468392606.0","@material/rtl":"14.0.0-canary.468392606.0","@material/base":"14.0.0-canary.468392606.0","@material/theme":"14.0.0-canary.468392606.0","@material/ripple":"14.0.0-canary.468392606.0","@material/animation":"14.0.0-canary.468392606.0","@material/elevation":"14.0.0-canary.468392606.0","@material/typography":"14.0.0-canary.468392606.0","@material/feature-targeting":"14.0.0-canary.468392606.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_14.0.0-canary.468392606.0_1636659604362_0.2610110853586849","host":"s3://npm-registry-packages"}},"14.0.0-canary.828f9803b.0":{"name":"@material/slider","version":"14.0.0-canary.828f9803b.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@14.0.0-canary.828f9803b.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"4099ffe0a8ffbdfd78a87995077964d2b52ea333","tarball":"https://registry.npmjs.org/@material/slider/-/slider-14.0.0-canary.828f9803b.0.tgz","fileCount":37,"integrity":"sha512-rmo98S0YzoLtB/OCzpkIVmbEFdoTuRlKzhKh4N5cDuBUpDg91SkDm+KEdmdSpdwfoS2bWUCOTQZiDD3kiF4aOg==","signatures":[{"sig":"MEUCIGpuHFEblwAoW4siFSs8OezJR7ac+64pcGLWO0MLjypUAiEA1t3alKuLJxL9/ktAnAPLHawFz6Hj8HV545RQ4DK5DHU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":858952},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"c64e9f941d45dc823621c068481be90a0eaa0f39","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.18.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.828f9803b.0","@material/rtl":"14.0.0-canary.828f9803b.0","@material/base":"14.0.0-canary.828f9803b.0","@material/theme":"14.0.0-canary.828f9803b.0","@material/ripple":"14.0.0-canary.828f9803b.0","@material/animation":"14.0.0-canary.828f9803b.0","@material/elevation":"14.0.0-canary.828f9803b.0","@material/typography":"14.0.0-canary.828f9803b.0","@material/feature-targeting":"14.0.0-canary.828f9803b.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_14.0.0-canary.828f9803b.0_1636660246480_0.8770512980745839","host":"s3://npm-registry-packages"}},"14.0.0-canary.8795cba87.0":{"name":"@material/slider","version":"14.0.0-canary.8795cba87.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@14.0.0-canary.8795cba87.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"3e08f5774bb8114c96bbd6bdd59b81fa469333fd","tarball":"https://registry.npmjs.org/@material/slider/-/slider-14.0.0-canary.8795cba87.0.tgz","fileCount":37,"integrity":"sha512-oMuUPe8MtbzovgG31xRt0XL84iW7q5XpNJooBBNuB2sxMSuWfNzddUviTtrZq8bMiLsj5oaqCiGM/q76qhuTNg==","signatures":[{"sig":"MEUCIFpFHG8aiHYQkr08XNwC4YS1j7skNIcm1WUI3LPgIP6vAiEA/9ogxqCHTGrE7c3IahdDnc843uPWfxlmbZfiSF7Xo0g=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":858952},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"12c2e8ee797434819828bade998610af66a528ac","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.18.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.8795cba87.0","@material/rtl":"14.0.0-canary.8795cba87.0","@material/base":"14.0.0-canary.8795cba87.0","@material/theme":"14.0.0-canary.8795cba87.0","@material/ripple":"14.0.0-canary.8795cba87.0","@material/animation":"14.0.0-canary.8795cba87.0","@material/elevation":"14.0.0-canary.8795cba87.0","@material/typography":"14.0.0-canary.8795cba87.0","@material/feature-targeting":"14.0.0-canary.8795cba87.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_14.0.0-canary.8795cba87.0_1636660603213_0.798379902570791","host":"s3://npm-registry-packages"}},"14.0.0-canary.cd7f8cace.0":{"name":"@material/slider","version":"14.0.0-canary.cd7f8cace.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@14.0.0-canary.cd7f8cace.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"d91b73e40aa8061faa797d87f378abafd26e6cb1","tarball":"https://registry.npmjs.org/@material/slider/-/slider-14.0.0-canary.cd7f8cace.0.tgz","fileCount":37,"integrity":"sha512-1aSv4cZ8dsLKoPJFobjZ7ZBlZwLS6Tl0J1D/cRJcU6alXH6L5zDy36Ve5fuHJ5StBmlwFuWy4y6cg2tOxqWKlA==","signatures":[{"sig":"MEUCIB8tqg0vmrciMeXh0zpzMKV6d0xS97jX8I1BJU1+1watAiEArm8B3wTMgL6bR3nZe8NFdrwuhxYYR9wqokWg73mpHXw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":858952},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"6f1e9f39fe9a43e01e67b849cc2a96a5a31be67c","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.18.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.cd7f8cace.0","@material/rtl":"14.0.0-canary.cd7f8cace.0","@material/base":"14.0.0-canary.cd7f8cace.0","@material/theme":"14.0.0-canary.cd7f8cace.0","@material/ripple":"14.0.0-canary.cd7f8cace.0","@material/animation":"14.0.0-canary.cd7f8cace.0","@material/elevation":"14.0.0-canary.cd7f8cace.0","@material/typography":"14.0.0-canary.cd7f8cace.0","@material/feature-targeting":"14.0.0-canary.cd7f8cace.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_14.0.0-canary.cd7f8cace.0_1636660704509_0.20603660498789966","host":"s3://npm-registry-packages"}},"14.0.0-canary.207230eb8.0":{"name":"@material/slider","version":"14.0.0-canary.207230eb8.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@14.0.0-canary.207230eb8.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"0a80ca9d009864b9cf1d26f40f52dd4649b8875a","tarball":"https://registry.npmjs.org/@material/slider/-/slider-14.0.0-canary.207230eb8.0.tgz","fileCount":37,"integrity":"sha512-9KjPx998aKM6F+BdV3rFm0yYSpXnzGfa84k3AewKXelumONcKu5ZSXsMyR03MEe7uQ9O+b9+P8wC0e7xPevDSg==","signatures":[{"sig":"MEYCIQCPAFOYxpWSKnnrPcITcnpPIhPjk/rvVvd2o7eATK3AuwIhAJPq2rx1yHDy0aicjy67shN1+8QuOs9SvP2eaH7oV9m4","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":858952},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"de1b12d24234ecfbfbf5a665f46c26b71016be2e","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.18.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.207230eb8.0","@material/rtl":"14.0.0-canary.207230eb8.0","@material/base":"14.0.0-canary.207230eb8.0","@material/theme":"14.0.0-canary.207230eb8.0","@material/ripple":"14.0.0-canary.207230eb8.0","@material/animation":"14.0.0-canary.207230eb8.0","@material/elevation":"14.0.0-canary.207230eb8.0","@material/typography":"14.0.0-canary.207230eb8.0","@material/feature-targeting":"14.0.0-canary.207230eb8.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_14.0.0-canary.207230eb8.0_1636669481316_0.7796233678176254","host":"s3://npm-registry-packages"}},"14.0.0-canary.991fb99f7.0":{"name":"@material/slider","version":"14.0.0-canary.991fb99f7.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@14.0.0-canary.991fb99f7.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"94940d4a210f0c9ce7e4c56a73a1bf89e8690589","tarball":"https://registry.npmjs.org/@material/slider/-/slider-14.0.0-canary.991fb99f7.0.tgz","fileCount":37,"integrity":"sha512-H1eQPWZkZbZmpAMzBOkplN3dBi5v1qWLZNn7RJPV9MR96oGKqpe+Hc7MSKkA40ewzi3EeiRynkpIHOSJNMUUow==","signatures":[{"sig":"MEUCIDG8b1V2IZ66TplON/Dq0MjRnalWKeanG2FmFhylzsefAiEAmRVKKqErff0coYQXKIbTQNHBbJon9luBPHwXuHZq91A=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":858952},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"d13dee60c11cfef5bdcac33da4fff6f13626c05b","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.18.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.991fb99f7.0","@material/rtl":"14.0.0-canary.991fb99f7.0","@material/base":"14.0.0-canary.991fb99f7.0","@material/theme":"14.0.0-canary.991fb99f7.0","@material/ripple":"14.0.0-canary.991fb99f7.0","@material/animation":"14.0.0-canary.991fb99f7.0","@material/elevation":"14.0.0-canary.991fb99f7.0","@material/typography":"14.0.0-canary.991fb99f7.0","@material/feature-targeting":"14.0.0-canary.991fb99f7.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_14.0.0-canary.991fb99f7.0_1636670183017_0.5468902491191956","host":"s3://npm-registry-packages"}},"14.0.0-canary.15db4f164.0":{"name":"@material/slider","version":"14.0.0-canary.15db4f164.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@14.0.0-canary.15db4f164.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"bdbfff86428351dfa2c1f502d33b170e309fb379","tarball":"https://registry.npmjs.org/@material/slider/-/slider-14.0.0-canary.15db4f164.0.tgz","fileCount":37,"integrity":"sha512-Ye9OvPzsJgVWM/Z2xz4UVK0SQwE+8lHi/Jp0veYBPwyuUZROZAT1q6RGONSV3rx3mbTkyMh9rEtTlt7UmDaOjQ==","signatures":[{"sig":"MEYCIQDQIeahhB63+7ffJWaWYwgoYSaikk4awulupU3Fq6899AIhAPcn/SoCUKHkMRXTesVkrWNgLYbZfipLzIts6FTibZWe","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":859337},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"562e11bb445a0e51783e848adc61b690a7a1ba3a","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.18.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.15db4f164.0","@material/rtl":"14.0.0-canary.15db4f164.0","@material/base":"14.0.0-canary.15db4f164.0","@material/theme":"14.0.0-canary.15db4f164.0","@material/ripple":"14.0.0-canary.15db4f164.0","@material/animation":"14.0.0-canary.15db4f164.0","@material/elevation":"14.0.0-canary.15db4f164.0","@material/typography":"14.0.0-canary.15db4f164.0","@material/feature-targeting":"14.0.0-canary.15db4f164.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_14.0.0-canary.15db4f164.0_1636738184404_0.955998514498585","host":"s3://npm-registry-packages"}},"14.0.0-canary.8fcad5a3c.0":{"name":"@material/slider","version":"14.0.0-canary.8fcad5a3c.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@14.0.0-canary.8fcad5a3c.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"8103c2662b7cd71a59214b8dcca64dcb1768daad","tarball":"https://registry.npmjs.org/@material/slider/-/slider-14.0.0-canary.8fcad5a3c.0.tgz","fileCount":37,"integrity":"sha512-vhUoggAzxuL3ptwrGBWrmLrEVyNHzZVJxERHaLM1DY9jfcTNelR5FXpjbuWSqPpLGbD8flI1ZyNGRxx2ZZdfWg==","signatures":[{"sig":"MEQCIAhbcICFfcqfOfIMDDlohMxSmRUH+0X1AWNhtkBLlOYXAiAsN06JdO4FG5XuCcYhDWeAcNqr5WETVBCfhViIPW9ukg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":859383},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"14b654013dacdda833d34b73c1a94811202298d0","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.18.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.8fcad5a3c.0","@material/rtl":"14.0.0-canary.8fcad5a3c.0","@material/base":"14.0.0-canary.8fcad5a3c.0","@material/theme":"14.0.0-canary.8fcad5a3c.0","@material/ripple":"14.0.0-canary.8fcad5a3c.0","@material/animation":"14.0.0-canary.8fcad5a3c.0","@material/elevation":"14.0.0-canary.8fcad5a3c.0","@material/typography":"14.0.0-canary.8fcad5a3c.0","@material/feature-targeting":"14.0.0-canary.8fcad5a3c.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_14.0.0-canary.8fcad5a3c.0_1636744440311_0.2203965076978327","host":"s3://npm-registry-packages"}},"14.0.0-canary.f81fb1d23.0":{"name":"@material/slider","version":"14.0.0-canary.f81fb1d23.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@14.0.0-canary.f81fb1d23.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"ecfaa9b9845f39c42f476acc65be0e7cc1cfacdc","tarball":"https://registry.npmjs.org/@material/slider/-/slider-14.0.0-canary.f81fb1d23.0.tgz","fileCount":37,"integrity":"sha512-FBS0OCyEaF39em7SvQwZGPW535moojqY1Vgv/elLKkznxL/SFtI9jCWraPznVf+gbcEJPj+Vb8qOT3yH75OkQg==","signatures":[{"sig":"MEYCIQCzK8lhJbAqi+naQ5ycgS4qfcjyHW+FV/3pK00auNxAvQIhAIl+qQo5ts/wTGHKpdR9oWEFkNQEH/hz2MEoY8b40uXR","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":859383},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"60600a1b8cf651dddedd6881a54b20db7b75cdc6","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.18.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.f81fb1d23.0","@material/rtl":"14.0.0-canary.f81fb1d23.0","@material/base":"14.0.0-canary.f81fb1d23.0","@material/theme":"14.0.0-canary.f81fb1d23.0","@material/ripple":"14.0.0-canary.f81fb1d23.0","@material/animation":"14.0.0-canary.f81fb1d23.0","@material/elevation":"14.0.0-canary.f81fb1d23.0","@material/typography":"14.0.0-canary.f81fb1d23.0","@material/feature-targeting":"14.0.0-canary.f81fb1d23.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_14.0.0-canary.f81fb1d23.0_1636756812791_0.9295236468604029","host":"s3://npm-registry-packages"}},"14.0.0-canary.783f6fd5a.0":{"name":"@material/slider","version":"14.0.0-canary.783f6fd5a.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@14.0.0-canary.783f6fd5a.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"d58a4f6334cd074ac783a68cb01d23565a9bd922","tarball":"https://registry.npmjs.org/@material/slider/-/slider-14.0.0-canary.783f6fd5a.0.tgz","fileCount":37,"integrity":"sha512-60nClkLHM2dvZFS+v2rgRrzPwW1q0aKYUam9XxbxcYAxRTGP7UthaJe57XJNBGnBUg2IQOpE+4QN7jq+bdTX8w==","signatures":[{"sig":"MEQCIE9tm5TbRw5hLCRy4AwNcF7A/MU7OIG6S4gmzY9aHy/fAiB+lJZycw5g/9Sr9YaGWJzbBue3bGeGnenGdSogYUqXKw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":859383,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhk0aICRA9TVsSAnZWagAANkUP/R0e6xYNnUM3QorRgJjO\nLKneKQ5hQ7xOtdyqOwbFYUuERhUtfTbo/59GVSbesWLAWwtprOMb1Zw6Q64F\nA8BD78khxtpBNYAFUnNPEGBrAkvozuoWZHql3F+T+T82+ke/PfTF0ghRxXZn\nu8/oaObigFMCJeYtpCPKCwUEMSB6iA0KHbdWrl08F2hs5Y/cid1PgHpNs4Bz\nc4+KdpFlqW1B2BPjnStmtjo00W1pqvPkw/W1/qfLjYYI3qYrOQVt9dUFc2tI\naIjdQ2EZfjWDM3ajbVWo5NtHOwrHAVDZzUeEfNCWVvqCXKM07+CMWChhzj7Y\nYODVH3w96QsbX4Gjt+2U97C8PQeBePL9lKqTDaJvXBIShSuaqD58Wpjux9N1\nwz2PMtvMa4zBtVOCTZf3TFFzqPQ2EGFY+O6xTHrUH0OkArlKtriil6bQKwxH\nniwG343n1dOStZo7bed+Gw9J7L+E3j3X5wOK6oPvDYKjv9fZurImgmLqorv+\n68HMrw4q1WxAdg2NNLklwDWlRTOmapvLVqOr2tLsKGi/trpNtAiMKc4/ch5m\nw030+N+CVQt6T7rq/vCCE6dq8VjZ9gWlseKPdEt4+j+35ma6n62yMPdMBpf1\n7mF6vDM3rb/HpXBjN8vdLU2xAFlr1ZjRBfjizJ5Y4obFn1uQWVjmIlH4b8R/\ndlzG\r\n=LFCY\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"29ba9297d5424f35d235c8ff87e393874c1b0a25","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.18.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.783f6fd5a.0","@material/rtl":"14.0.0-canary.783f6fd5a.0","@material/base":"14.0.0-canary.783f6fd5a.0","@material/theme":"14.0.0-canary.783f6fd5a.0","@material/ripple":"14.0.0-canary.783f6fd5a.0","@material/animation":"14.0.0-canary.783f6fd5a.0","@material/elevation":"14.0.0-canary.783f6fd5a.0","@material/typography":"14.0.0-canary.783f6fd5a.0","@material/feature-targeting":"14.0.0-canary.783f6fd5a.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_14.0.0-canary.783f6fd5a.0_1637041800310_0.08390591896856892","host":"s3://npm-registry-packages"}},"14.0.0-canary.d57ec74c7.0":{"name":"@material/slider","version":"14.0.0-canary.d57ec74c7.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@14.0.0-canary.d57ec74c7.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"f46b3f4a645e7a16bd4c78c2e1d2c19f4dd2b958","tarball":"https://registry.npmjs.org/@material/slider/-/slider-14.0.0-canary.d57ec74c7.0.tgz","fileCount":37,"integrity":"sha512-UDM17BH8u+0yFlq/4qfHxJHFgGcKfLr511Mr2i/dHOmSteBYUOzNesBIeK/zY3FuIdtpHPf61Xswf0RafbLHIw==","signatures":[{"sig":"MEUCID1dYfBvGqPhWZNPvk8XDtmWvaF/dlS71vIHVLEXlkSaAiEA9fmD+9DmyvucfoeoAg/o18iFnrrdyxMgahke/m9UDD8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":859383,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhk9laCRA9TVsSAnZWagAA0r8P/11xCmQpjAi7cNccwbg6\ns0Mz9hztDnLKgDJSeWpDXKmwJeJ+5LZ9lfSATAlJMeIhv1JWK0FHMEfbXmwA\nPyEmDXKxJ42O4BnYW2r7DF7uz2IPlzZerxFssAPAtze4TS34Yie5Bi6hUunT\nqwLQiRQfEWzfQgs7JJx1J8pnrGWAKHOOBcdDmI8PeCrkYm+nirbkfhxt+1G/\nTVBZh0rCRO3giNUW8tOV9mgdtp4U2KPXkVv5HYuuboocqpigQ8ag/+2YJfkz\nIGWNmH98UOFXk3fwRAOlFA4u6u487x9EIL5f8mQl5hBBt5Njd9g0T4QBWrbZ\nFiFCxn/xp/wv7UQ6M/tHD7aW0fJRGPzYLv8t75NlybFwPsqnNigwEaAfoFf7\ndwYgOaEtmLlZRu4Ahc7fpLTaewkA70YR3IZrVfhsM7TEhAD4yudX+mgK3/np\nEsVemKXAN44q2qttPuGWxn4GdFLY16W+tQv6VJ2uZjC3GngZAd6MkGXNB+EL\nA23Za4iBwb5Cpo2aJFUS7d7D1T51pHkLeP0sfNuJ2XQWYQFiyY45kHKAWfIQ\nRKbce0CDhyY0EURUnhiZ16+Dz9s3X3S7Wz1w0W/MTtt2zg83cbiMbeTVIAwx\nm//owMn+qYEXJEvAZtw9nyaeB94RjYdYucMCa8IsZ5px5kdmI/9GEVMIcZ0R\nQdIS\r\n=XkLk\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"dbbd8db21de66e88b3e713faa99419e6b2f53c68","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.18.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.d57ec74c7.0","@material/rtl":"14.0.0-canary.d57ec74c7.0","@material/base":"14.0.0-canary.d57ec74c7.0","@material/theme":"14.0.0-canary.d57ec74c7.0","@material/ripple":"14.0.0-canary.d57ec74c7.0","@material/animation":"14.0.0-canary.d57ec74c7.0","@material/elevation":"14.0.0-canary.d57ec74c7.0","@material/typography":"14.0.0-canary.d57ec74c7.0","@material/feature-targeting":"14.0.0-canary.d57ec74c7.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_14.0.0-canary.d57ec74c7.0_1637079386625_0.6312679183582617","host":"s3://npm-registry-packages"}},"14.0.0-canary.554c71829.0":{"name":"@material/slider","version":"14.0.0-canary.554c71829.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@14.0.0-canary.554c71829.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"55a9a825d084a75d55a1e623e7b80cecf2cee760","tarball":"https://registry.npmjs.org/@material/slider/-/slider-14.0.0-canary.554c71829.0.tgz","fileCount":37,"integrity":"sha512-xtMSlw5sN65pLZGxIlnjREEmhARgF+BfdNHDdGtBZ726awcrRQpLluMo1J2tA+W25rTkm1XsmqLle/HSA8QsQA==","signatures":[{"sig":"MEYCIQCpIQmjBFHajNt4U7+QOKuA/HtYaIyGfux0eA0Smwzc2AIhAK98BW+2oJLjPCesDZusLE7Tkg3ox76RQE/KcVa75SCj","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":859383,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhk9oHCRA9TVsSAnZWagAARI0P/16OkOrT9DGx299F3/s+\n3bqxJcSNhR4b6eyPbZ7xSNglRW/LvNYBPn8qcs/PGD/aDOLT4zTYq7BGRVMF\nEcJkCpFxyCu+5JkD93BygW75M4jAmLBRa8N7H+btVeSYciDobl8b35Rf3Frg\nMELhtnuWEc4tc96V8Uq0KMOwTKyy/+MWgln68+ceo4Vi/EzF4k4oaBWNBQcP\niAX3cu6F+wO1s7gNTAIqQlPXHUg4Yj3cDdd2nQaLt4tEpBflDTVVslOfGpCA\nT2KcFr+hdUpoKi+4nOxF3RStJfOIDy1Uz8V4yShUGDerfgKP11FSIeq8FZP3\npvPxoTLtfhzn2OUbTfnZvT3AI3ebA01irm+NJNPN6pQO6KWVg2AbM+jej79f\neJP8o+7kXp5bcwQqQzbzCExF3Q0lEY+Gcl8RLKpygXok0Q1z9VQA633/C40q\n2lsPfnUxHZsiKClihFvhT9cIRWiT1omsUgdETWh0AuTj9h10YgOom7ceQXTO\nZ1nQRIBt+hEeqWMVvqarWxQfM8oH2SLFzGFQZEQc2e+9EHWH+MutcryRvkYt\nRcJDVJ8CU6c46IvM8yrbapsmmfuwiC6esxMwFqfKUfOLtDq4uxl6F8eiiP4h\nY7F9VFNXMS7qSfo6HfLe2oV1VX8PUl3ikmDCHRLc6zhiCygOHd5CpZHAhZbB\nxh7j\r\n=wg4m\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"be0799ddf10fc34b46ab20d754f7ef73d9efbefa","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.18.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.554c71829.0","@material/rtl":"14.0.0-canary.554c71829.0","@material/base":"14.0.0-canary.554c71829.0","@material/theme":"14.0.0-canary.554c71829.0","@material/ripple":"14.0.0-canary.554c71829.0","@material/animation":"14.0.0-canary.554c71829.0","@material/elevation":"14.0.0-canary.554c71829.0","@material/typography":"14.0.0-canary.554c71829.0","@material/feature-targeting":"14.0.0-canary.554c71829.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_14.0.0-canary.554c71829.0_1637079559536_0.6132199723339924","host":"s3://npm-registry-packages"}},"14.0.0-canary.3ef470efe.0":{"name":"@material/slider","version":"14.0.0-canary.3ef470efe.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@14.0.0-canary.3ef470efe.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"22386dbfa773c225a4cc15414b912fbd3fa76a28","tarball":"https://registry.npmjs.org/@material/slider/-/slider-14.0.0-canary.3ef470efe.0.tgz","fileCount":37,"integrity":"sha512-Az3x6qbbzlh7ETdkTAOw75mD1aoIQ1Qw3Mg7bRSK9aiO0YJygR06PBggzBAzZZudOAmfeqKDbhxvHvszbxYYiQ==","signatures":[{"sig":"MEUCIFZ//Kh+Z48wZYnAiaaYiLAoxHjzkuBN66xsiSTvRZt5AiEA1yks2RrnXpEQKQjKdd+lJEHy3/EtMPelyDfJ6hq2zd8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":859383,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhk9spCRA9TVsSAnZWagAAJ5IP/16Wg/bCUSR/w+qpr0Iw\ncnoiW3jPkQK8rr65SbWTmIRC62AdrgN+yZG53rNC1OJ0waz6mYmrMHCwKmiW\nO1awrYIHkQuedORvZONqthYCOpvVsnsXJivnNLnzDpfGyX0dPbrLtoEWBngV\nA/fL7pKjVIl9TQJrfevnPOtfvSYl6Bou0WqGYy2hsVcMyY5dbX9FJvZr+CCz\neFrE8ccsrstJV6k1696r+CmEH2ztniCpoOeCMYfY6sgrNVitkNOQYriZwELf\nAVEFXBwRBqsTQMkTx8xcywpijRHaYg0fTUAiFuuFZAFqUy32xgFLXeWtm7eC\nEewt3gxS74ic8kvrZyYqVvHS/1pMy8GxELuC37F/f4X/BduSZkqdgAzaRMVo\njytJCmlRQ8sAySnRUdAmAbccvDQtpeEFozwOf7D7KGAl9RjnyXanHmVXia80\nQC6JdXb9OkSuH5ypXEIqE76nFQ6pe9ipyorti4/NUyhn4DiDTbzKtEUoTznl\nxSEvckg55NXaqagjLa0sT5JC+eZ8AQqJRW6n5zF1wQxTX6wRWj2WS++fbtDN\niQ9SdQIkGvcohZdgJ5yzqNabEz//DLpsPC8B9hZreCfypKH9ar8b64S1O0CW\nMER9xwIJ53BybFQrpStnMpKg3Kku1vE/fP4nVjp7cjWy2g2VrDjsMIZ3moUw\n0Rok\r\n=OzmW\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"49429a109e0c13bb4f9d8fce0142cc5f142a6afd","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.18.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.3ef470efe.0","@material/rtl":"14.0.0-canary.3ef470efe.0","@material/base":"14.0.0-canary.3ef470efe.0","@material/theme":"14.0.0-canary.3ef470efe.0","@material/ripple":"14.0.0-canary.3ef470efe.0","@material/animation":"14.0.0-canary.3ef470efe.0","@material/elevation":"14.0.0-canary.3ef470efe.0","@material/typography":"14.0.0-canary.3ef470efe.0","@material/feature-targeting":"14.0.0-canary.3ef470efe.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_14.0.0-canary.3ef470efe.0_1637079849431_0.2730141327055995","host":"s3://npm-registry-packages"}},"14.0.0-canary.61a28b2b5.0":{"name":"@material/slider","version":"14.0.0-canary.61a28b2b5.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@14.0.0-canary.61a28b2b5.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"3da0332f7994e7354cc4e28c60f46bdc81d26c56","tarball":"https://registry.npmjs.org/@material/slider/-/slider-14.0.0-canary.61a28b2b5.0.tgz","fileCount":37,"integrity":"sha512-/ocr9Z3jh45Erj1Gl33kdJ1gDFmAv8tMEq31Mk5bdTeemCoUgbNlGjavv35Ymkvqw1TpWt2IZ05f5bqk4lpxZQ==","signatures":[{"sig":"MEUCIQCgttFPw+Lno1IGsZW+EcyjTsy69QFdq5FvjEBK41BBHQIgM+uJy21lepAauwXjXwUSP9PvNcexcGgYPqmZ9zw4NNE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":860773,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhlVEDCRA9TVsSAnZWagAAsYgP/AkipJ5NOdtg9hdmlf4J\nbsa2mi1QwP8DKSTrWQH55v6S0vYz9Crpkn39CSoagQImlIkuXupOjqg68P0Z\nDw2Z+Iig/n5URmR2zZhMj7GnhE1EGi8QtvuGIv8+IkQ0s6fDpmZHJp5AIfgN\nu9i7rP4PTwgjzLKZMuZRASUVykCWbQ3nTaAkJeOvzqZSw/0/38HOZI+VYiNr\nnF3oCXxfQwT5d3hMgighI41smoYiMeYA2YecCUmAT6rZQP05hx0BggIZCpv3\nlwg9cmx+iPnu2QmxsT1GnPEGB9/FP1vz3siPlOIj012WspvssD/S8eVcWqu0\ntMAqqZqgnau3Eu/aSo/aXG1xRpZqpGzBh8fP2kzZjdoB0p8nTPqThSIOINZ2\npOt6dMQFCKn+32feRLAtavob1Q/C1dmwGWd9Du37taQ56DQlWh4BN6YIrdqD\n5jB4mJ2U5kaBtZYVqypHJ5qNNiwJLqIWlCnDxutHNat4B/sK+5cPDImhVyzh\nTmVpV7MS+cm2CeD60bJZAG4rMvi5OX64tUjyOKypY61VOQxBad4Dt4LAp5kl\nLrBKQYxapBphyS4WkoJ9Tt4tqk+3qlO8o/DjeK9tL3ggEI8PlJBfInLIegy9\n5FHw+erfU4j5nELYTvpVPO8GQ54I9FaWSgI9SvzI+qRFQ78yvTkle7U7I2Wc\nhd1m\r\n=BlS6\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"314b98aa8ec5a35ba8a45706765f4cd7496dd803","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.18.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.61a28b2b5.0","@material/rtl":"14.0.0-canary.61a28b2b5.0","@material/base":"14.0.0-canary.61a28b2b5.0","@material/theme":"14.0.0-canary.61a28b2b5.0","@material/ripple":"14.0.0-canary.61a28b2b5.0","@material/animation":"14.0.0-canary.61a28b2b5.0","@material/elevation":"14.0.0-canary.61a28b2b5.0","@material/typography":"14.0.0-canary.61a28b2b5.0","@material/feature-targeting":"14.0.0-canary.61a28b2b5.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_14.0.0-canary.61a28b2b5.0_1637175555153_0.7831389456859101","host":"s3://npm-registry-packages"}},"14.0.0-canary.fae6c652d.0":{"name":"@material/slider","version":"14.0.0-canary.fae6c652d.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@14.0.0-canary.fae6c652d.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"ebd4c8b35895d9273d8d15b3c5becc9607641c2f","tarball":"https://registry.npmjs.org/@material/slider/-/slider-14.0.0-canary.fae6c652d.0.tgz","fileCount":37,"integrity":"sha512-B+eaBFKXnzzUYsU1YzPaKUfYf6nfmpxXz//3nue9I0v/NA8LFiPongv0aRhILaO7jkTu9lNYDgTaMS5k+XkdyQ==","signatures":[{"sig":"MEUCIQCRPzTnVKTNg2oO4lO2TxVY4V2n1MqQ9GumPlphNZ3SWgIgLE4fWEe5G/Q2tBJ3FogOA1ivtdpQWAmQWvTXA1kTFeo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":860773,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhln5cCRA9TVsSAnZWagAA1aMP/0jUtt+Ns7zD30xhTWuz\nP5q2UsEmhKejWn8RKVBSBNniDJTMBLM/eltooHEJ3VQb2WkYQGOxJNh4tlG4\nRE+vc5FHdeHpGrjT3ABdhqjqkf/uAy9dM2pE2hqGeAhgRJlOe5h0y7MlJpc9\nNPChYmH5hN+RS+EgIW37Oh1nHBzxqgvXsvqouk2LsDMlm8o+tw3x+9XHYH3z\n8CiiRnPPZOGSj8mpKf3Lp3s0Op5R1UBNZV0x1y2HaW7VQlUPw0jOM8DF3yQ3\noyK9bwcf/9Gs5X/gXOzkiP3Jaus5/qMmGQips2GBLfFVS0upOUCynAOm8gxL\nMU1oYrP7Ly74Lnc4lNzep+bAycc7Dpl/Xwxxryw2g1SbeOIWuUWljjhsLDtV\n3wgqB49kcB5gfrTL9tkbiasJ+fngSnBc0cmeiO18bLjXAHKMzwIlhW9BucbD\n/jXLJ/LU1bOhJjK0TJl4jY9KwdcVmox/pZLoqg3J9/mDEn8oWAAovv2BgSDN\naIB+aykzXPr0QlnbpQsi74i8fO5X1uArLpwV2+hvzAuYz6D51VQ0PKASCcCz\nxN1Ajsec/8/+IyMAdWAG7wOhaNiCNGQeQxIQlujK1sNaa2OTjMnxqF0cBC8Z\nNPSFiJ/mO+Idb0X0SMAheS1NDUt71BtVY+Sm1uQGYPVPwa7zMsqr68vJT/DW\nkfXq\r\n=7s0g\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"d27c4bc9db002b9009b70cb7437b393ce59b9992","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.18.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.fae6c652d.0","@material/rtl":"14.0.0-canary.fae6c652d.0","@material/base":"14.0.0-canary.fae6c652d.0","@material/theme":"14.0.0-canary.fae6c652d.0","@material/ripple":"14.0.0-canary.fae6c652d.0","@material/animation":"14.0.0-canary.fae6c652d.0","@material/elevation":"14.0.0-canary.fae6c652d.0","@material/typography":"14.0.0-canary.fae6c652d.0","@material/feature-targeting":"14.0.0-canary.fae6c652d.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_14.0.0-canary.fae6c652d.0_1637252700202_0.9381821118514717","host":"s3://npm-registry-packages"}},"14.0.0-canary.978a3b5bb.0":{"name":"@material/slider","version":"14.0.0-canary.978a3b5bb.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@14.0.0-canary.978a3b5bb.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"00076051998f370cec4d9c857cbe4aed35a413a7","tarball":"https://registry.npmjs.org/@material/slider/-/slider-14.0.0-canary.978a3b5bb.0.tgz","fileCount":37,"integrity":"sha512-711q7IqF18B5iNnXl5PNN4ZGir88B2qvBHeUmdcq54aOsKeomaLi0FL2RIrqwOCr81ZTtGKRtcl39bjT/kpbfA==","signatures":[{"sig":"MEYCIQClaF2E+hkDBkalbAQ2AadcsRWSoX0KrRALAhV0BsU1fwIhALHF/fP7NbiTSZaIx0FrL/4xSdJA6/qZTtmvpPnbPQMb","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":860773,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhl/1kCRA9TVsSAnZWagAA/IoP/R4vGuZ3IYj8N774AvHe\ng35ibEzZqS0Df+CiRmB4qFoeG3glXyFHSIluoHzUNgp96S3eIyWVAkgAUCeY\nEMOJ2NtKZVLXgxmBqa5blxrFodGqzGspUIrkF55ggmOl3g+UIW9voCDscNf7\nkANBoCNJllbwA5yzO+si9nlA+gpEQnJ1upHrQVEirYsZ40qVzmnUaeC3FQfq\npLpyNVjRVvP2f/QqlW4vK7xM0qd7a8e7RXsYNPokxJonOEe4R7RRkf0jjd0O\niw7CMz6NoUdh7CXc8PW+QHnXqekcwk7XVrjTWGn8ZXLhenCU6dCTaDovbjJM\nLF6H2Rkyqwunis3+X0gqfzsOSsv9SgORsR2H59NMuFf8PdgmYGKf2Fw40xg1\naYhJx4qQN8zYdinnAVYhHNROHLStCclpOTD/X4bT4I9w6O8GG98egP6rX31c\nmDftSovQ5tMMyT5o6MYK2mjn6pXICmTIYesRno+iasrYSGL7gryMcUNSkmxi\nDtd/jRQu47cBl1ntFdQn8zHpU/hL0ysOFXcVafwNqZOAULbkRDcN3BG0MdxM\nAZICo8GLKjJaMnvUJ9SDInTSEmYSNXCudYZOROJbM2mwzW+uEqyHKK0KZqaI\nClcizKBWydo63bU4TXpb8F2LYpfa3WPN2DgNsx7QIIjvtQ6qaMV5ysawbih/\nY4Jz\r\n=WOLv\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"0d21a3472967f5ff791662e03961fb034a9227d5","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.18.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.978a3b5bb.0","@material/rtl":"14.0.0-canary.978a3b5bb.0","@material/base":"14.0.0-canary.978a3b5bb.0","@material/theme":"14.0.0-canary.978a3b5bb.0","@material/ripple":"14.0.0-canary.978a3b5bb.0","@material/animation":"14.0.0-canary.978a3b5bb.0","@material/elevation":"14.0.0-canary.978a3b5bb.0","@material/typography":"14.0.0-canary.978a3b5bb.0","@material/feature-targeting":"14.0.0-canary.978a3b5bb.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_14.0.0-canary.978a3b5bb.0_1637350756727_0.8872374637243505","host":"s3://npm-registry-packages"}},"14.0.0-canary.e6f43cf44.0":{"name":"@material/slider","version":"14.0.0-canary.e6f43cf44.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@14.0.0-canary.e6f43cf44.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"45b6fec4dc0a6134d5536be7e411094ddb384ed0","tarball":"https://registry.npmjs.org/@material/slider/-/slider-14.0.0-canary.e6f43cf44.0.tgz","fileCount":37,"integrity":"sha512-TKC42MfZr2jUIxJgFvXHjFxhUhiD30n2AYq2RmODEY0VFT8ulxbNVQr4hdSYyFImDv4vV4WAshUEQ77epK11Tg==","signatures":[{"sig":"MEYCIQCWhPypAI39VLarLTQt5IVmmcReXa6HErlsT16vYD/DoAIhAI3O00NICek7Xxc2mVHiKNZvw7Vl0mL69tvopZFMo2Su","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":860773,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhm9TMCRA9TVsSAnZWagAA9hgQAJQ0SdZu6F2u/tXdHCz/\n0yIqeMA+sj35aiUD7ocDjyU8zTLqXhGhndYwKDhte0Sq3+PSmIth3fH1yTqH\n+rrfqHDpKDND9hckSK5zVnUxU6p0Zh+JUOmJ+5G1ihoaXU+AeXuTdHbHvTQE\n9A46tSpA4zpPyEymF1oC1L1nGnVizzHz+Lm7ma9IAqRP99KL6jGJwE+CT1jV\naqYmLFpfIXeP0XDenwZXiP5gy0hjvgrfi6gMtJQCX5clEDy4UUU5FRBhq4Ye\n2YlrK2s8g/1OIpdJ39aa/+pf7/GdY4+gdEaurwCpSaGhaNA8VZPKbWZzUjw9\nyMtTDyVQN9t+MsX+izZYx1g9UZ43DRTxpr3z5tryx7ni60Uy62Al1vjr7pG/\nSjU7aoAfk5z13lBou4WCp2GJ8zSJoWp+RuyzYpmD0dhII4/j2gqW3wMgmSpF\nQTBfG5crHiM17usDUs50Tf5WRmc5NZaR9tKF9i+ym5DN4knV2wTNOicgSGr/\n5j0J9bcgJa51uzO5VzWV7PDGosGMQl9UMO6Pwyxb4Hw2HE0mkUsDX7DY+R5U\n3UR2MmYsKA5MYwnuiabnZ3Bikr0q4D5gFLtuTda2L7G/4csaHTdxEN3qU4Cg\n4zs1H9q/hK+Ja97QPRGZ4y2zQOAnrxNzwVv0AghkY8oX4Sds8HXNKu3NMCRv\nGdMx\r\n=aV5l\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"36200e7acad50905888cd5fbe17075663a96ef91","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.18.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.e6f43cf44.0","@material/rtl":"14.0.0-canary.e6f43cf44.0","@material/base":"14.0.0-canary.e6f43cf44.0","@material/theme":"14.0.0-canary.e6f43cf44.0","@material/ripple":"14.0.0-canary.e6f43cf44.0","@material/animation":"14.0.0-canary.e6f43cf44.0","@material/elevation":"14.0.0-canary.e6f43cf44.0","@material/typography":"14.0.0-canary.e6f43cf44.0","@material/feature-targeting":"14.0.0-canary.e6f43cf44.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_14.0.0-canary.e6f43cf44.0_1637602508568_0.4792330953670627","host":"s3://npm-registry-packages"}},"14.0.0-canary.39cf14bc3.0":{"name":"@material/slider","version":"14.0.0-canary.39cf14bc3.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@14.0.0-canary.39cf14bc3.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"37416c95580958df4ea06ffc21c1b6999efa3464","tarball":"https://registry.npmjs.org/@material/slider/-/slider-14.0.0-canary.39cf14bc3.0.tgz","fileCount":37,"integrity":"sha512-QxHbW82Hyqa3KoNeioSjNAmqB7dWg2dJbg6pNK/HIfEbPVmNkJbmVS3GpiRyTOtXUY57lIyIzlPLlhNsQm16zA==","signatures":[{"sig":"MEQCIAQge9xRYtAbzpNHX+lSbJMjiy4GGCyVoAmWv8I8iPi4AiB9aAL8orgu9w/2mf1mP2w9ilHyhlprh23V1Gs3NhfY5Q==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":860773,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhnCH/CRA9TVsSAnZWagAAiMAP/3PPbzl/czHdJD+gWBEA\nin5ALbrrjnGXZzpiYJ9X1g5Ak8WjlWW20h1vygNZql/TEhmSN2LFncEFgqM+\nEryUTt/MM9cWdtZfFm5C8u+3sXSrE4mQy8oiZQrie3009dN5L9LYnH+S6Jwi\ngHzJ8bzbsghTgJJ82dl+/JyenQNKUyHFrgIuvU97SLop9XYeDg33otLnpQG1\nCmCqLhAP2DczMSwoQVcckIRyF5ClXFzeuLjxTkSdoRdqHdycg5636ssHNVQJ\nBdEXiM/DcQpntrlxbDdn4593UgRPfA5lC8tLe7bj7cE5qkvqAhlU9ubMEB4r\n0TKeEo+3dLq+8D/qxa+LylSVsfZVn79GdPPH/UQFef7cgoMlnY6B84gBhYfH\nBAk2BtQr0m04huwfgjNwTDbVbw7OgnLGXI9N8TCG0cpW0HYUIWb1A1H1oEv4\nz77g8JlRJeiZZHoE0qiSOJlU6U4C99HK1eSl6fmCmzmar/lo4Z7SHxygVjMf\nYadUXqHin8Y4AcVszPvfcasLs6CV7zbE9WBsOzD5zqAjMW1GPniqQ708M8Qo\nf7ngtkXnPXgpiTkytF+mPnXGFd93pQy3XafB3dZ5d/Reln1RhOPKMr/LEEVZ\nTvJtKpdygK8ViF1+ksMOcwJk156WQwp69N356jiajQFvIKphIAyySFGnaq4X\nG8+1\r\n=fGtn\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"7a4dadfef1095fc344517a394b0286ecb59751dc","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.18.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.39cf14bc3.0","@material/rtl":"14.0.0-canary.39cf14bc3.0","@material/base":"14.0.0-canary.39cf14bc3.0","@material/theme":"14.0.0-canary.39cf14bc3.0","@material/ripple":"14.0.0-canary.39cf14bc3.0","@material/animation":"14.0.0-canary.39cf14bc3.0","@material/elevation":"14.0.0-canary.39cf14bc3.0","@material/typography":"14.0.0-canary.39cf14bc3.0","@material/feature-targeting":"14.0.0-canary.39cf14bc3.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_14.0.0-canary.39cf14bc3.0_1637622271536_0.2625785442223971","host":"s3://npm-registry-packages"}},"14.0.0-canary.93134d453.0":{"name":"@material/slider","version":"14.0.0-canary.93134d453.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@14.0.0-canary.93134d453.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"00113d3e58ab221925719905feba7d3eee4b8897","tarball":"https://registry.npmjs.org/@material/slider/-/slider-14.0.0-canary.93134d453.0.tgz","fileCount":37,"integrity":"sha512-+hv+2xLcuiqk4oqMO13qjCP/HPhLZ3ML+DLnSjT9GYzbbWGN761DTaAtnceFiMiQ4T5CAi9MryO/fKYuUmwm0g==","signatures":[{"sig":"MEQCIBwA9VNE6IHh5WenN4MU0NJgxjXpdhOoKdFkKXj5QMGcAiBbSyh0HXTe0CiOm9k9FwSmxzHRsfx3fLwXlLuJQR+MPg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":861324,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhnQsYCRA9TVsSAnZWagAAt8sP/0cH8dIZrLHPk2OOLk/k\n+8ZMQSMZ/2QuK2wrWRLrOMnF3W3ukZxcVFnDeg3k321lO+vehGvYuu1krWei\nncliuqJNWusqioc6anLdG52wAig3eJ3vTpSpix17B0UDRbL5h3DZ0LBdPwtB\nfCOsS5b2cYao0njFsVsUyvMCUM2YLl4DibT9xDPUoAK7gJUo5OIA2dbLz/Mf\nwU+8bchPvjVUBQsNHzv2AVyJKq55k/vcgT6ZXk38oY+bk7MvYwdEML4V0eSL\n6WJt6hUXOPgYSXLrLULfEyhawqfG1OyrxY7TZFYYUn0MajG4wgny1JyZ9NbE\n2vtrtJI5MhJ4J7xsU+KmKzQ4Cd2a9dOm9njMuYBy1O0WKxXZLbMnE7L5IcZ8\nqvAYTI32jRLiz8cPSXSVv2NZlZRe35hpIS+4FY/VdhfL3s3eXk7g83/spvr4\ng7gFI3j2kU43F7D3kt6k2oI0oZAOg5oYR8BNejpeRcDtczTFLr7DqFaiRq/H\nv3fKkErwii2yQpFXvAO4ea/mmqc95akvynnvODXHC8VpuIKM98zXLkkczByI\nNcpNHGDorcGMG4HSKJIkO86aku/UccI0uSHDQsaWoKnn/cQTZ8ha9wAVPRgj\nR/Qg6ykAAjmv7UAj4Rf2Lg47Q1dnU0FHc+HR4CwfsRvzEWSEDlFyG9K1BKYD\nTGxo\r\n=1L1d\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"f37d4e46e027a3258621f6950e12796013661afc","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.18.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.93134d453.0","@material/rtl":"14.0.0-canary.93134d453.0","@material/base":"14.0.0-canary.93134d453.0","@material/theme":"14.0.0-canary.93134d453.0","@material/ripple":"14.0.0-canary.93134d453.0","@material/animation":"14.0.0-canary.93134d453.0","@material/elevation":"14.0.0-canary.93134d453.0","@material/typography":"14.0.0-canary.93134d453.0","@material/feature-targeting":"14.0.0-canary.93134d453.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_14.0.0-canary.93134d453.0_1637681944729_0.37038409227828994","host":"s3://npm-registry-packages"}},"14.0.0-canary.bbd11268f.0":{"name":"@material/slider","version":"14.0.0-canary.bbd11268f.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@14.0.0-canary.bbd11268f.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"015d7a3801a85057e156c22f27110bfb8de21eff","tarball":"https://registry.npmjs.org/@material/slider/-/slider-14.0.0-canary.bbd11268f.0.tgz","fileCount":37,"integrity":"sha512-f8l8FEpWP4zX3fgYgvu2qjIabGb0mQ1vyij2maSw9CTiBu3GSSmMqO4CyTo4xrHr7x08/etwOUdUtXHWVHguyA==","signatures":[{"sig":"MEQCIBifqSwGdxOgTp6xUBEuYlK1bLqPFYVj5T1gb60a9w8YAiBOg7HMQyRTKbkThp9nWame5HFH6Zw3heocDQWBuQKfeA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":861324,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhnWvwCRA9TVsSAnZWagAA1o4P/1kCdQotDkImQx84KqnK\n8v2hMxRJqZ9BozOYjNlVusMlFfq8xlKkD3ppV4LIllX4YMh3R47AXwDeuNnW\n0i4jwqaLkkskXpVmitchreoDDX/+MiETCXrIuQCYtxYOW46ugiDwrikgLv2X\nYKYN3xRi58BZZsa7+7MGS8uTsoJFFnbgGP9cn07CPDsXsEZEVOSweN7RcZ1t\njrtKSCYQMLtKR68z4j+9o+gk7atnPgERT7SOsiCXMNnUqdnYPR/vJhBYo7sH\nB0Y3xnPf8HMcnCcRJHefZF0EAM9QWa1OQz+zElYt05Hhdk03XSoaLEcZZFhX\nZaeQJJdFP9XwS3dONZ8bMe5SdzdaiZY3ynwJAo2RXzS8O6UTcj822z75fRck\nmVNZ6x/OmeLcKQhE7zgl1y6Nyswl4Q/2M26Z8uA1Y63fr6trwvSa2byV1ZMz\n3maXrrB9cFbTSBcDQYn4cKKwjf0TmVdKgQOXZQQUW3znbBjCI9U3i/rphdPu\nUPzBz/hIJyvIBfJ8XAg2QuYXRSQBkOk3Re5nGS6g6M8jcanZ5o8z1S0eRgq0\ndHZ/HjSUrVr6KnJF/+DBJNKnNKOUGHgCqTSg2Ee8u/aY7YSvmCbdlLeP1PDE\n+x5XSdLVVa3PWOPMPSuz6ZwF3gvb2S6WKNP2F0Heba1uJhx5J29WQMMDPNLD\nAwdc\r\n=Fam0\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"46484a77ecd0c6d7b548301f4e92325ffc4f8010","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.18.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.bbd11268f.0","@material/rtl":"14.0.0-canary.bbd11268f.0","@material/base":"14.0.0-canary.bbd11268f.0","@material/theme":"14.0.0-canary.bbd11268f.0","@material/ripple":"14.0.0-canary.bbd11268f.0","@material/animation":"14.0.0-canary.bbd11268f.0","@material/elevation":"14.0.0-canary.bbd11268f.0","@material/typography":"14.0.0-canary.bbd11268f.0","@material/feature-targeting":"14.0.0-canary.bbd11268f.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_14.0.0-canary.bbd11268f.0_1637706736251_0.33724928981693925","host":"s3://npm-registry-packages"}},"14.0.0-canary.3db9c4d3d.0":{"name":"@material/slider","version":"14.0.0-canary.3db9c4d3d.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@14.0.0-canary.3db9c4d3d.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"22f27676d77e8ed1549b162b9bba2bf60773c1a9","tarball":"https://registry.npmjs.org/@material/slider/-/slider-14.0.0-canary.3db9c4d3d.0.tgz","fileCount":37,"integrity":"sha512-QaX7kb8SADyT1P91dBdY+nnwz3a5iaQ0W6W3O+LAkwOA+nMjE0yKICNJDulEIqygXv2Ir4escaZDo092yOat2g==","signatures":[{"sig":"MEUCIQDqRYYvSRCeIFbPAG3l/COblpHitIK+DToUDAbXJa6W/QIgLcuc02rOyL7wS/tzn7TYlV+T0/QWEY3SfBv4vrcM+Q4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":861324,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhnlw1CRA9TVsSAnZWagAAhn0P/2M/S0M/GCH1D7s+ny5S\nORz9fGZCok0JXa6AlDG8DN2JwWM6JC2BLVoAxOcqprL8d78pOfU1Fs1ea8IE\nm3D/jPyyqCxrC+9XLRk9qbo2aT/Wr9/ym2UphFJRFgBSe9iRfbWThN639q/6\nreRXYcHYcxWM3TDSOLrrijb41HITsOOkzp6voch+inayxrio1Ay9ZYo7rhz/\nZQtWVODw252PKeHZjmOEhCSLv/C4rrpXYHvlHfS3xGuaY+6HJg9QNCc5PSl8\nmsN0CRX8qMHh/qN2gFY5trTP1tzhXFQICQCFle7JBLLuWdFnoQEBQrnLSeBN\n6iF1YhJrJVHBE+b1aceTDbnN/aNJzr4A23nihawYnEXrZ/uue1h/yLdNPDjk\nhfrswVkKhTmZRB1/dogMmYfohEZNDsBHi57RA6wVM87EIlIWlttkk2W83S5p\nUgfZos19u1/m2YpvRZmtZBzow687lSVFpBoTo0lPDbQaLMxr8Xh1Hj/WT46H\nthpQ7jiQ3kVMyZcgBy/sX9FPxGQureqM6AfePt+fJGENwbBT7dJ8lO+5+9GT\n2lztwWf6LLhH18UGH14EL235bd9/3auuoDsOdKCyNrbuV91AvNiU+uSn0x3x\nnIzU2Xc6PzXCI5IfgO7SE6pSqJS2OigJDf9noLM8uApswVpBfdavXB1nJDtz\nJ1mr\r\n=TvYn\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"61e9de8c9bd6ef83a5f0949cf53ce4a8b689f158","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.18.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.3db9c4d3d.0","@material/rtl":"14.0.0-canary.3db9c4d3d.0","@material/base":"14.0.0-canary.3db9c4d3d.0","@material/theme":"14.0.0-canary.3db9c4d3d.0","@material/ripple":"14.0.0-canary.3db9c4d3d.0","@material/animation":"14.0.0-canary.3db9c4d3d.0","@material/elevation":"14.0.0-canary.3db9c4d3d.0","@material/typography":"14.0.0-canary.3db9c4d3d.0","@material/feature-targeting":"14.0.0-canary.3db9c4d3d.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_14.0.0-canary.3db9c4d3d.0_1637768245231_0.7677954690750697","host":"s3://npm-registry-packages"}},"14.0.0-canary.78305b6d5.0":{"name":"@material/slider","version":"14.0.0-canary.78305b6d5.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@14.0.0-canary.78305b6d5.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"ab85b0df78dc2c12f53d63c650bbce52e5804835","tarball":"https://registry.npmjs.org/@material/slider/-/slider-14.0.0-canary.78305b6d5.0.tgz","fileCount":37,"integrity":"sha512-dqTL85HyES/BIiLf4yoFgeJv4rINWCMjpN4ML2oBSZ384YN4D3I5D+vBIn95Ms+Dhi3oZKH7FPzCfnHgbq6GxA==","signatures":[{"sig":"MEYCIQC9tDfLxvt/BBgvZU+nkKhFaK1rRzYFToWghG36Adh2QwIhAIV4EKiSTeLPKXH2R9YaquynymSSf7Xaaer+1/AgGCWb","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":861324,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhnpePCRA9TVsSAnZWagAA+EoP/i1+SZ4Wkw3mG5QZ6L9U\nFUQ80PLoL8G8pxcegajDWzCidDtqiuLAtJZN3+a7W3B4cMZXbXfD3GCdr+Jz\n+O30TZggGqqPxuE3gudxCRb7l+wLyOjno8CB2bPekwTY8I9HcvDnbmIYE6Te\nFzoKWdt8S0ANqkGteU5GS/6Sovb0bv0jtlCaJSE460e7M+pL9JAa3Y8ilVYV\n7J+UtoCxoG+FV/le5kStiQtkK5q+wuHRVQY5NCfj2y8rXes5IDJUbb1YOgnz\nkjC4VVw/61aMiveXY50eSUBMEJjKpYacwNuGQWia3DfoFZqwEtUpJkYKxFRr\nxiJaqAJEYKIjVwtQ18eR0BWdDKfi00qv2ztyJtZw9te1aq9dcH9u52SWpVjc\n66XIfDVcZPu4/BLDjynsIjVxPMOlqkS0QSzhmo4QRXxh68vDC4UFHjiLHoAv\nL4gwj0Jye/bY6X2q4jr6KVwA1fH5JzrH4RRbQr74PrgtSMOUSZiwZsu1Nc2m\n4nWDqGUZcuRI4NIEHOBgtGqq1lU/d53Mn9xbCSGjrsu5nVaFjMK2CleBvsfM\njJi5aIL9KA4YdZ4yC4T3dYdizTaViXejcEzukC9s/L8+C/d4+HadvR6BRX7l\nFO5flKcLbkGSoTJZXpiQsfiAM84l/HQOJflJ23f+v3VBRt+KLDdGp9eI6J65\nmAA/\r\n=Dn5a\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"2885de69eab36903fec52b85e7001eb561624eff","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.18.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.78305b6d5.0","@material/rtl":"14.0.0-canary.78305b6d5.0","@material/base":"14.0.0-canary.78305b6d5.0","@material/theme":"14.0.0-canary.78305b6d5.0","@material/ripple":"14.0.0-canary.78305b6d5.0","@material/animation":"14.0.0-canary.78305b6d5.0","@material/elevation":"14.0.0-canary.78305b6d5.0","@material/typography":"14.0.0-canary.78305b6d5.0","@material/feature-targeting":"14.0.0-canary.78305b6d5.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_14.0.0-canary.78305b6d5.0_1637783439376_0.7221664445311307","host":"s3://npm-registry-packages"}},"14.0.0-canary.43d08ba77.0":{"name":"@material/slider","version":"14.0.0-canary.43d08ba77.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@14.0.0-canary.43d08ba77.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"bf498714be1e9adb0d206074dc8af426075145f6","tarball":"https://registry.npmjs.org/@material/slider/-/slider-14.0.0-canary.43d08ba77.0.tgz","fileCount":37,"integrity":"sha512-1aq5gwY6OFcohH+aAfJq2CtO5MOviBaQzCZMsgIL+bZkArsZYejs0x135fKDAXYwUlZdhVlU4jW2pCoIRwAWuQ==","signatures":[{"sig":"MEUCIQDnEFIPGn4Uf0psOfAUMJSdSgRcCCbId9fx9C5YVziR0gIgM/S+Etx/q/XWX8R4/E4Xhtt/iPPDjDg8tI3woncS8zo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":861324,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhpqwECRA9TVsSAnZWagAA6MsQAJkEHJHtqhi+taMdNI87\nYd9kaONBUkYc69rvrc06AVCb/2NCb/X1VZ/yerzlIpRRFCtmgOCdA9oEy5P9\nIB/Bt6pWb62FGDSP6Rs+7Hmf13KjFhkuCQy+MBVt+qxV6FUl9Zyji+VBza2J\nG9kAFYm/Z4bI+XZymoDCXEBWdDsSDC2Uk0b7/RpOARZPl4U7S/skr1oBzwjI\ndF8+v/ssDgICThx3RNYCx/qnhpxewDx82MNR7OEBgcMTRQSsa5pFaDbgEvEo\nzhbX3I4Z8QN+6DIrjGB3x6gjeyvxIoBdvIETB5LArZ9vLvH14ki043jmjFVm\nt9vfK8VsnsR+DzXtiem+XSpAE0KLoXxto6CrdLl45ymgYVYivGbu9sB70CKF\nObG+82A+W2NWl/NszPXVXbXMLtUbirtB5HWrVBZ5drWpblr5g4snpcxeDLuB\n+VTHyqhfSTxVMv+W+HaW2wGLPOyxF9m1+VBnFTwM6VfAKDRZ5KUlssP3mqcl\nJXnfWnens/zUtYGJG9SFJ8YBzp0URMEt25SfA+3VKwTmN6v2aTAG5R0k8qWG\nItYaldHxEufxN9kPbrflWXIG3OXEbht+3GUxOgFo0+uYdx8xUEabobU5W+I1\n3Rl1vq0lu1bYpzHHJFk18UMuLAFG5F8v5ZEwJUGg2baZAsv4vkYNVTIMWQiY\n1nmF\r\n=m9IB\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"d1929fe60ad2c7ba249562f1c1702898df8f04d2","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.18.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.43d08ba77.0","@material/rtl":"14.0.0-canary.43d08ba77.0","@material/base":"14.0.0-canary.43d08ba77.0","@material/theme":"14.0.0-canary.43d08ba77.0","@material/ripple":"14.0.0-canary.43d08ba77.0","@material/animation":"14.0.0-canary.43d08ba77.0","@material/elevation":"14.0.0-canary.43d08ba77.0","@material/typography":"14.0.0-canary.43d08ba77.0","@material/feature-targeting":"14.0.0-canary.43d08ba77.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_14.0.0-canary.43d08ba77.0_1638312963886_0.9014490788691902","host":"s3://npm-registry-packages"}},"14.0.0-canary.17a072535.0":{"name":"@material/slider","version":"14.0.0-canary.17a072535.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@14.0.0-canary.17a072535.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"5c94173691ddedfe6a04c148cc3a4599b324f793","tarball":"https://registry.npmjs.org/@material/slider/-/slider-14.0.0-canary.17a072535.0.tgz","fileCount":37,"integrity":"sha512-2fLtMtIVcvZO2xLsFY2zIvjYMxtrzTSXfhrySGkqVG9/MIWtFqWnkuFrnCQ4E6/6vOTpj3uwE1DyGHz+HgbwcQ==","signatures":[{"sig":"MEYCIQDFSkNNKJexbfxSK8XZ8sxsIJIb11Jw87kfD7qUeD4LsgIhAOyKNDMoR/SWosK+uZl/jPEXdatb22yswe4Eo1Kgv0u4","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":861240,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhqQrdCRA9TVsSAnZWagAAQbMP/2f7mEnyLXAMNZ4NKgwv\nMaxmD/qcMWC1SPrxQCSlCFCo6zYxVKXFN7zAR1Codl2yHIFB7MFkBZg8BHAY\nAsmbZ6HlaSXTS1PzAG4tU859dIbI2WHVVlIoVE8CZlg7Yc4TLd6imbVRhAfo\njEFwsUzePgMgt0weSAjx3L+lg+bqqjZeQ2XePJ+F14UX7Rs+anpYnMSsNn8a\n9KrrArSNDFSFQc/WXMuV7CbcWTTDt7cVbgVtykOJRAypvBZcDZa3C/mk200L\nUzbZfIwvzrS/EXutA0ZIKrODdUesMQlqrGE5Fox+dx6hfK9TtOekThXjLDfY\nlzBRZ5/AUVXkCjJJV750s5C8hXkHYbNZxNEcy4Ec9Zl8lTcig6/J/DT3OVLb\nxAVRtw4AreEMy3ErY53e3dvO9hAVTtL7PhchFknz97iaT62/HGA7s0v6qs8r\n4z5T76fEWOChffdwyDoQGmGA8KZH1SBImoqR5itKtuyneNVGwO0o/D3+OnNO\nwc52f6om0INI0viVZ6A7R7DUIElGguKf3ZFOP6lujw6+wd9y+2kStWSaOrCA\nOvrl2emn/9m3Jnh8FA0l2syHwQu5OPI8ZjfUpYVGrf0DFepVzMZYtACkmakt\nmoWuqPxuqNY6IgkPXW8lHj5TRjrb3hrBvO49CJu59HVuS7u+BR/gK/gzsSve\nI/l7\r\n=9THg\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"317cda93b55159038a12575fec5c35e9ff5460a6","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.18.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.17a072535.0","@material/rtl":"14.0.0-canary.17a072535.0","@material/base":"14.0.0-canary.17a072535.0","@material/theme":"14.0.0-canary.17a072535.0","@material/ripple":"14.0.0-canary.17a072535.0","@material/animation":"14.0.0-canary.17a072535.0","@material/elevation":"14.0.0-canary.17a072535.0","@material/typography":"14.0.0-canary.17a072535.0","@material/feature-targeting":"14.0.0-canary.17a072535.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_14.0.0-canary.17a072535.0_1638468317045_0.24030325989989332","host":"s3://npm-registry-packages"}},"14.0.0-canary.5d809696c.0":{"name":"@material/slider","version":"14.0.0-canary.5d809696c.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@14.0.0-canary.5d809696c.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"718f83e24c6bfaad1e76a0d08815225a2debb9a6","tarball":"https://registry.npmjs.org/@material/slider/-/slider-14.0.0-canary.5d809696c.0.tgz","fileCount":37,"integrity":"sha512-KApAs7uF160m1pYG0vip929r3rCVDkx/OvtORS3vjXscyC7t5kLelvt2WCOTO2Cx+lPC7ouEX3Lxug4BM0foow==","signatures":[{"sig":"MEUCIQDvyRrqmKA01lVkwKp8TJRI3Fmb4NVk1rf/QDlRKNRoLwIgexqIVQZMizuO/aStPPzNAMGrOTDGTwi/HaBG/RmfCYE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":861240,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhsO77CRA9TVsSAnZWagAAOJEP/jVJpYwakbRo8Bz6RWxj\nkwPvMyr9rsE6bkw+1IKm8/h/xb5WikVutKGz4PTL9ggLAZmVQKXCh3VDMD7j\n0yjTDEdnRQ3+HARoszthniHofOZ8JiQ/l9/d1ADUSOLJKDr4+zZy5uZHvMyK\nj8qDWEaGctDZ4ow2Gx3jYZpCfO7Te4my2o2iQRoWaiSzVUQgkRAtsn+mhSWk\njMANdruLXdvfyRPMQMvFu36joG2Q98bHQc27FKs89/gO95iE0FSWtOidKCLj\n4KjoarSOGAgPdhTSg7oy2pCxFm5qWsrCdM3ptF9r01Tt9nptKjMjWBcYEueW\nA2GZYW74faMR+4wck/kYnse9SY+fizvfxwHn2PPuP8kffKfFw/93RqjVN1y3\n9DEecWT2w3vGu6hy/W3h+6PnTBjNP8arYOHu7LRRk7UddnZUePnWANsymjOo\nAu81ZmdtHeh2Y4B0PEJm+lbs0zdSyOcWBDciAEutgfD6G1C5vmEPnA8FgvTy\nA86FVl0jg5NGDMqDCpqKjZOV66cpAE4n35Bq1NoCg2E91Q2y1kBvUAJ5u4hy\n8HcHLWJb1rhl6A8ojhiS5y88srHEZndBRqVHXyAHm6HZowR6loBN0gKLdjGp\nRmgiiKxjPK2OxUje1VnFWoBdpJqnewtU00fHkdDLeyv1iBxE2ylW6+/P4+ry\nH4Wa\r\n=cswU\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"955aa3e4252f722f096ceef387b285a197760b82","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.18.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.5d809696c.0","@material/rtl":"14.0.0-canary.5d809696c.0","@material/base":"14.0.0-canary.5d809696c.0","@material/theme":"14.0.0-canary.5d809696c.0","@material/ripple":"14.0.0-canary.5d809696c.0","@material/animation":"14.0.0-canary.5d809696c.0","@material/elevation":"14.0.0-canary.5d809696c.0","@material/typography":"14.0.0-canary.5d809696c.0","@material/feature-targeting":"14.0.0-canary.5d809696c.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_14.0.0-canary.5d809696c.0_1638985467034_0.5102434304192431","host":"s3://npm-registry-packages"}},"14.0.0-canary.b6510c8c1.0":{"name":"@material/slider","version":"14.0.0-canary.b6510c8c1.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@14.0.0-canary.b6510c8c1.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"fc07b893c8481189b57324e48193345e98148ba1","tarball":"https://registry.npmjs.org/@material/slider/-/slider-14.0.0-canary.b6510c8c1.0.tgz","fileCount":37,"integrity":"sha512-InP2IbeiQlS9xzjWxIPxpRMH1YS4Wriy3UYcGgGXfGT7J9j92j5I7bHLO/+c0s7vpvyIERxPvVzxZwQdLZGsGw==","signatures":[{"sig":"MEYCIQC5n8gsvHUkhDYhFOVBdNkZjfwR362nKRzpY5A+6eGwqgIhALaBOx/emGmRcc2XXthibJujJa0+/5iC8/fD0EZ2OE+B","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":861572,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhsPQjCRA9TVsSAnZWagAAFWcP/0GP0PUa0WZhlgUuQvRS\nY4pBco4jiI7E43afprhtfRd6hPYnzw7GLDK4OsyqNMfAWrWVq1AnR7A0Wlu3\nm/EPR0FQJHedeqBRHXXJ9LWUUjxGkV+vv+e2VYdpj6VhKOP9bx0tVnIVtmlS\nUOI7fmBeJkj5DiqgoyBEBPM236ZCLnWd2xpdxjn+cyH67sIpXQCafoWi8g7a\nklgb0bUCQuICfB0uSNCMG2UIZvcDVCBRNhYz4oGxureBcP/+lcrQQQKVZH4P\n3654HwvkjyZNvEcdafZFmeA8NNY3OvWpSHGTWDRS/dloRbSRkhhvYhz17A0G\nHwI3Ud2l031mUvCcwlQeIuzqacInocYBXJQqrbmf5j82cTAg6jcqWjg2+Xzg\nsA1JB7lGMgBZNa/ilAxiQjNi6viG1dMaT/hDyQRmakfe4B7NnNuogKDTUJtC\neS3ObNgFYC2Y2Vb+MeuuNIRYnsZsxYIzfoEs5k81IlR33HnGxzJX5HQauab0\nrYuwF8K7iWd09cSVgaYouiVLllaSynhGSnUHKWAzNFunCcPNXbClMM9KWvf/\nnV5UVk40P03AtrPRvMJsDwtalh6qvsir4ycqyx8/Gu1lQ4jBSGoYiEmrglYY\ncyCpl8b41WOxVK+0Fp+9n4HYEJwGN/iOeU/xwogIlVslpAizdcMy9kGavIcB\n+DOn\r\n=LOOM\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"7b9b6695d55be857206c67de94ea9741aa48bb38","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.18.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.b6510c8c1.0","@material/rtl":"14.0.0-canary.b6510c8c1.0","@material/base":"14.0.0-canary.b6510c8c1.0","@material/theme":"14.0.0-canary.b6510c8c1.0","@material/ripple":"14.0.0-canary.b6510c8c1.0","@material/animation":"14.0.0-canary.b6510c8c1.0","@material/elevation":"14.0.0-canary.b6510c8c1.0","@material/typography":"14.0.0-canary.b6510c8c1.0","@material/feature-targeting":"14.0.0-canary.b6510c8c1.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_14.0.0-canary.b6510c8c1.0_1638986787589_0.9892748151726221","host":"s3://npm-registry-packages"}},"14.0.0-canary.f460e23da.0":{"name":"@material/slider","version":"14.0.0-canary.f460e23da.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@14.0.0-canary.f460e23da.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"f2fe7a4e12351f518bcc33c6fd8858ad98fa50f0","tarball":"https://registry.npmjs.org/@material/slider/-/slider-14.0.0-canary.f460e23da.0.tgz","fileCount":37,"integrity":"sha512-/y9WEAkYbXxkQfwcHsRAZ2J9ctWgZ8gj133OHLyXnoR+LBrcsLx6vg3MY2SBHm09JI65QsvBUQBmQrNj6h3ToA==","signatures":[{"sig":"MEQCIBbxD+l1uhU4IQDxnugoamrb5WY4WccSFtS0gopMjeBkAiBlJ3XUeiE42HX7bWi2pwFi7z2I0LAaXILmalvYhK2KBA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":861747,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhs3FiCRA9TVsSAnZWagAAiNYP+QEZE39Zfmjus6EVIMYl\n+Gur+tHVdf67ABovsJ1TZI3eafYAQ9uTABQKsKmze0wINS7mgNnKHhf/tKAg\noqlpnVJ7dB2gM9ROMU7ld6Nxv1RQb+F8bqTk2krPwAEn6G/cMlM+8kmKuMBc\nMl340ejWj8zg948WNwpKc9Bjjcsc/PbvjAEzLm3YhPa70R2LPaeRES5vcNgO\noZeYmp3gkCgWe0lCX0bdAT+DwwQbY321ngl8z7sIb7SmbQPwD7WZnOKP2LN5\nI61H+4rYWWU4CUebtHO4+cKkySRRq8LjcPUxlAE3/ztBevh9hWSufTJmY2fk\ncqgLfKRHT5VZs32ztxf0vZ0Hg5hkIhR9xF4lswz5Z/suMrOA/w3bnNFZSKIn\nQa0UYyATpDtmfLF9LOAfoTTRhWErNqT0/OjFQeFEHkoyGNlKdx46lnccHSIx\nwjaTmqMFeLtqe80jvCDkNSzwRW85gLCKRTQ2VTQhWZ62u4JEhv0Vy3rjnnL6\nRpxsF1M5spb9Y/Pv7OjOJJ2/m27DBc6nM419SUDqM/DCqbFyNDOxDX8fgEtR\nAd0n+6P8wrmVrzuakvhND1tloQbmCyH+BNFrL1z5wwj+XhYIkhRoW/1pK/u2\nSf9RqbNL7vblZNqRPrq7OBO1ibEv1YNFLo33N2Q4BkvEISHXpRWBlytdGw2P\nhxA1\r\n=KobY\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"6d994090cf732fc4f1fb93f91d64e265cada1b1c","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.18.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.f460e23da.0","@material/rtl":"14.0.0-canary.f460e23da.0","@material/base":"14.0.0-canary.f460e23da.0","@material/theme":"14.0.0-canary.f460e23da.0","@material/ripple":"14.0.0-canary.f460e23da.0","@material/animation":"14.0.0-canary.f460e23da.0","@material/elevation":"14.0.0-canary.f460e23da.0","@material/typography":"14.0.0-canary.f460e23da.0","@material/feature-targeting":"14.0.0-canary.f460e23da.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_14.0.0-canary.f460e23da.0_1639149922393_0.8916763165397328","host":"s3://npm-registry-packages"}},"14.0.0-canary.7d8ea4624.0":{"name":"@material/slider","version":"14.0.0-canary.7d8ea4624.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@14.0.0-canary.7d8ea4624.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"ce9383dbb407ef48b061d0e43004e6eb7d1c4cc2","tarball":"https://registry.npmjs.org/@material/slider/-/slider-14.0.0-canary.7d8ea4624.0.tgz","fileCount":37,"integrity":"sha512-wrPnQm62/N8EOAtRqprObutnhoCJOSBfZU92r4va5C8AceN9PHFb+28pIylXXlf7OD2SxNj/OYlCCmmgA7Todg==","signatures":[{"sig":"MEYCIQDHrY1nTeVsVJNuEvuQJfLOok8U2m0NdX/9vUSjG7PKZAIhANC8XxEzWjLvpeDozB2a8UuIHdArVAA7JlxC8QdvEW6i","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":861747,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhs6qfCRA9TVsSAnZWagAAnTkP/1xZ6ex7e9g4cYCJez0v\nEwmTkpXmvXC+jNtT9E+3dH860j9T3WG1B7zax3h2olMZeTW8BAnYLZhARAMr\njJruQnGvDDnHH2yPNtbFANt14GkJldR3EPITbdYaKaOwFwYO2qZAxEVLl0iu\nLHwjo8sE1hHu/P5qidEEO5tJXzYFZ77iCbfvUixGg6YY1v9yGn5sDe7SYXVj\n4Jro3u4sqwcLPbXaWqhP+i+t1ead7xYxahs6TXzwOPj3BJ+WWtj0vuVziM3G\nlyIjGZiB6sdATE8tzx/wLNSTqgEqulVaOGJFsmo2Vv5m18RwzqzrR0akzf2C\nhf7ixaOaHPeOgSdZGkAPRZ5xkP8NGMeZXBqlf+npRrZXWz/dGq9Tq59Pk2eu\nbeF6lGneBfCbgYnf697IXcEzEn8buRviClFXZn+INv+OVdvTgKubKhLut6qA\nORnaqr3iclgBUDkHPc+UYUDBZnK3dVcA8niF0Lw+jAglRQuEQwJYYI0sWUk8\nN79mZ7y9EyeLT1FEYrjWLrYkJdydzyfHYhnttn+rjzCyKIWTPUCgeFHrdQJ1\nd5k2KfnOuPHlgfrS+o5zVasrRg8AKHw//RzDzn/syOQlFhAnYqUoV3m69KlO\nhotXoFArQ/6VByOGndB+e9T4w+7lhw9/PvLXJLS11qEfJ0r2Gb7Q9sy1GdPv\nmM4A\r\n=qbrC\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"70\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"30\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"c5733baaefa11aaca3bd6f32fb2ac29c20894738","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.18.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.7d8ea4624.0","@material/rtl":"14.0.0-canary.7d8ea4624.0","@material/base":"14.0.0-canary.7d8ea4624.0","@material/theme":"14.0.0-canary.7d8ea4624.0","@material/ripple":"14.0.0-canary.7d8ea4624.0","@material/animation":"14.0.0-canary.7d8ea4624.0","@material/elevation":"14.0.0-canary.7d8ea4624.0","@material/typography":"14.0.0-canary.7d8ea4624.0","@material/feature-targeting":"14.0.0-canary.7d8ea4624.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_14.0.0-canary.7d8ea4624.0_1639164575132_0.9626043165765557","host":"s3://npm-registry-packages"}},"14.0.0-canary.8fffcb5dd.0":{"name":"@material/slider","version":"14.0.0-canary.8fffcb5dd.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@14.0.0-canary.8fffcb5dd.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"42dccd3e1c49de6af78e1e9f115153c20068ed4b","tarball":"https://registry.npmjs.org/@material/slider/-/slider-14.0.0-canary.8fffcb5dd.0.tgz","fileCount":37,"integrity":"sha512-c2lqs/1mxHnzI/ITkKGZPzSaScic7BDyfXdAyoc1dyK9tG12Ed/ToddxoPc/dIWElQueokbGJ6CuWDWY/RTv0w==","signatures":[{"sig":"MEMCH39r5A8OkLz/Fl6lIPwSTD8WD0FM8mbpjgphtyxxJbgCIGAXnXdqdtex/ohi7jRUzFg8Ez8r/CBANXBs7qxNsWX0","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":872213,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhuFvpCRA9TVsSAnZWagAA9VMP/1I9IBVm6Ul9P3whmAd4\n6tryoDpNosS23dBSh/C1fEgdJ3gFhLPgYAarM/cBznoNqAR0j9ueUsS/t+Aj\nd5xNarackDVnmUaC2Z92t/5MpkZDawuOQDcHgIUzh1iOY/ndo7yojk6ks3C7\nDY5f+9zrOXfNrrSJggsOV56UDV6xnLVkxOAziVhIZ+J1xr373tBWxTVLlyfT\n6JKv24Twedlyj4tUabSZCCIcDcCV5bu9Ick37nAls02sjHQh6fghchvqjQkL\np+4CRjfhOujPx4qdEkc1Re1hjIjnZoXtd4/VaNmgqWGWCdwnhyW1i+M7yx6b\nmmxSsfYr207zNt7VKg4FNWgHjVqu15efAAo7CezbIQ/qRKw3cyVYYpJgRAJe\nkuDgGp1zVJZgPBbjJ2pdqeKtaFcxsIlHRoeOQKi2zyDbDSeir0brAeK3Yfm2\nEeS/Cd05jgfw5rhLfFqHC4C3ZR7NUmtrfkBJrm/wm5GW+7AFxi3Zh7+Tr4Pu\n01ZopfTkDxOh7Omk/ct08Nnsyt1mQTYZTGgZI6VqCO4K1zPH5GQu7yKXaoWb\n/hbyNjTTszrPbELrk9VJBP9D9j3qJ6gvEHktWur6xRkin4abTHdSsVqeAe5B\n8P30M6iJ5iqS7UgLo7SwPqzpy6ybPmLMdpGp9ceInRtO1sK7us5I/YRFy0jZ\nj8BY\r\n=66Nw\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"ed22e4daefd7bb5e95668ab484a3a4a65793437f","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.18.2+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.18.2","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.8fffcb5dd.0","@material/rtl":"14.0.0-canary.8fffcb5dd.0","@material/base":"14.0.0-canary.8fffcb5dd.0","@material/theme":"14.0.0-canary.8fffcb5dd.0","@material/ripple":"14.0.0-canary.8fffcb5dd.0","@material/animation":"14.0.0-canary.8fffcb5dd.0","@material/elevation":"14.0.0-canary.8fffcb5dd.0","@material/typography":"14.0.0-canary.8fffcb5dd.0","@material/feature-targeting":"14.0.0-canary.8fffcb5dd.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_14.0.0-canary.8fffcb5dd.0_1639472105436_0.5430821265068151","host":"s3://npm-registry-packages"}},"14.0.0-canary.21e1cb9be.0":{"name":"@material/slider","version":"14.0.0-canary.21e1cb9be.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@14.0.0-canary.21e1cb9be.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"73c3371b50b9441974267b0d545645c6f05caafe","tarball":"https://registry.npmjs.org/@material/slider/-/slider-14.0.0-canary.21e1cb9be.0.tgz","fileCount":37,"integrity":"sha512-6UXNgs+AkM91cyLmRWZHNuvgjlc81voNQmHf4sQCqGIjaya9eYuwC9DRqbPbeGeO2PW8yCfaD4iZiLpHLForEQ==","signatures":[{"sig":"MEYCIQC3Y0XN1Tq6bPGA1ayHxU5M16PSSP9OB5rECzPTRSMsLQIhAJfFZ/PCRnU8pjnpAggetSXxvUo4Rhy99wkcYwPb7TDA","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":872213,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhuPMHCRA9TVsSAnZWagAAE+cP/3EvxgHlNA0iazFi0+Tc\nyexeXAaLUgoXJoVLi/uCVxemEdUYW9CAxWYJIthLLKO3aaBYMzvTJPwFIuVW\n+Op51WbPEcfFCJwpvMN2soZ8+Yi8+4Gl7epeaj+wbdHWUQeBl1Lq7ZsspyoJ\ngX6cfyikuSjhE+rA0JJlob1XSbsNXHGkGmF/FuGQZmoDQmNBThLxrsYh6Pnw\nBZ4OKTvCXWt4o6VZe1AxOtaSXAClkV4yiRmFtpIcgLji7oef+wwfb0qn/qz7\nC861ZYH7/fpYA+7xzKiYxH2fzzjw1hre5WJCWDOpb2YABYsIBXkQz/svn/LF\n6UsDeTs1Fhqw2RzMlcRlBN6UdEBoCRM0Umd646c8Fu+EJgjQUcLpe6VgSHWJ\n2IzQhoTejnVTGjNl8R5MHRutxcdFy5DN6UnJ613NuRljnREMZVZ9Yk1YgjfY\nywiZ3EtJkV2AxdgXwaQXlr/jiROTJeHsLaSPXeo0u51jVknyXB0wyKB7Is+L\nk/hS5Nzsle2PIR0MVrJGjEDRB4FpEUMfqE3cK50JElN8rd+yhopwisBN+2T0\nz5ZfXHf5ZAotD60tOX1q7bYySkP55E0guoNBLr0F5o/tOOsgWiLFYsVza31u\nyFe9JHwxSKihVWe/ex+0wV98QMLylSGplqhXJQijWVJCtQ+utcOSPb9FdAw5\nyjpM\r\n=JV3p\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"091bafb203d13305d394af0cb6817b1bf05c64af","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.18.2+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.18.2","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.21e1cb9be.0","@material/rtl":"14.0.0-canary.21e1cb9be.0","@material/base":"14.0.0-canary.21e1cb9be.0","@material/theme":"14.0.0-canary.21e1cb9be.0","@material/ripple":"14.0.0-canary.21e1cb9be.0","@material/animation":"14.0.0-canary.21e1cb9be.0","@material/elevation":"14.0.0-canary.21e1cb9be.0","@material/typography":"14.0.0-canary.21e1cb9be.0","@material/feature-targeting":"14.0.0-canary.21e1cb9be.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_14.0.0-canary.21e1cb9be.0_1639510791098_0.04195071518041216","host":"s3://npm-registry-packages"}},"14.0.0-canary.ba78e8724.0":{"name":"@material/slider","version":"14.0.0-canary.ba78e8724.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@14.0.0-canary.ba78e8724.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"e8faa22891441f6e437879cf006625f29673ad91","tarball":"https://registry.npmjs.org/@material/slider/-/slider-14.0.0-canary.ba78e8724.0.tgz","fileCount":37,"integrity":"sha512-rx+iYnVBplKOzK007yt/TIaK/60J6jhHUD8sW6BwEw2LtftGiiVKzKHhOygeVrLnEUp03vWiAhdLE6K1gzzReQ==","signatures":[{"sig":"MEUCIFRoW5lmXabu+BhRkxtg4u0pIbjiNJNIucdCSE+ZQkBlAiEAtfQQySCjZwiyK1HjMiMhYQhQOJukI6zcYaUaTaIWGDo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":872213,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhumhrCRA9TVsSAnZWagAAt7AP/jIQElPAAfYSt35jUU10\nRQ1rMltnuMeHzK4sZMgC57vbQa9dj522e4NHz21WAMzOTLOSxT3ef4yErgyn\nbXgu96g3c/Xy3X6aQ7gy1qYknvLt/99dhKa3TtNvxWM0aawrM5v8jHDhXyLi\nRHBZgk1T58TBca+LNlti/cuD5QgRiHZLXI2x1MPNyYQANyEpmmVz37y8wwfj\nCrYio/aY9Hx4NgQUi26FLB4iPIVTIz4TWlvabrBzdtlizrcIDMhs+weTGb6c\n8bGGS0Vp1KUbBCJApw00QYmMyb8tiUm5D1QQ0N02rJndBlA9ZIosVH5nnY+B\nw4nsp1wMbKUC4tlApXUvn7PSvXij8iMg91cI6UfcezM5uD0P8CXkQsvoGvbP\nJdYZlOiyhv5sOdwJTQIwxb9ueLIZL5Q5bizEqpSnzKeRcLhKiZsNdigDjrIU\n/xdGfUng+3yxqLcdYN0SMgfx2PcmHmQ3E0hZAyHHtylKTK8AKldRAujUQsE6\nVtDspbZYzL4HQAWhsxktONLqF/hLDdeWMZakbd2Jtc5Pf+OB13icR2+1Wvhd\n89VcvsKpgO+RdVAR9hqqn7JWQ5+9Px1kkHW/d6LXN2BWl7ZIj8swS7+iokn3\nFwW7rQRE+Gy8n/PgNc/5tG+UOCXDYlvJrcUI6ny0clJAl1i3I9L03H3uIhG+\nNgMG\r\n=ZXo/\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"396b66ccff73478ac662f95bc36087e71ae8d980","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.18.2+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.18.2","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.ba78e8724.0","@material/rtl":"14.0.0-canary.ba78e8724.0","@material/base":"14.0.0-canary.ba78e8724.0","@material/theme":"14.0.0-canary.ba78e8724.0","@material/ripple":"14.0.0-canary.ba78e8724.0","@material/animation":"14.0.0-canary.ba78e8724.0","@material/elevation":"14.0.0-canary.ba78e8724.0","@material/typography":"14.0.0-canary.ba78e8724.0","@material/feature-targeting":"14.0.0-canary.ba78e8724.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_14.0.0-canary.ba78e8724.0_1639606379357_0.9687217164177759","host":"s3://npm-registry-packages"}},"14.0.0-canary.e3e073c00.0":{"name":"@material/slider","version":"14.0.0-canary.e3e073c00.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@14.0.0-canary.e3e073c00.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"d02b830f42558f97f53835f2f216c47ee31337de","tarball":"https://registry.npmjs.org/@material/slider/-/slider-14.0.0-canary.e3e073c00.0.tgz","fileCount":37,"integrity":"sha512-V0LASSiTkbgFqL+YJJ7BCjP6Oq3xUolnDY1QaNnEdeN7iTJjN96Ajk/tFgjiBiRNqmNbtKxUkg1fyG3FbBZ5FA==","signatures":[{"sig":"MEUCIEE6nUoB5ZiTfcoeIxqg6YJJuLc1/VkPYcoPOxLbyYaGAiEApCxQxBMcbkaNYAf4uLUoxJW3uPBFLFaBaqbvqPt9JF8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":872213,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhwPEZCRA9TVsSAnZWagAAYAQP/2jWcPQLwKQKXKbfwJTs\nJG7DddUNhbXdpF0/0vRTW1Ko0ACQ8Nw3Y4D/CKDOOMCtppa4J5l+FuDOgfHU\n914ounJn02EYuBkkvwulYwISguBeGYzGvA/+EI7GNXl3Rj4p0s9fV2RKmE15\nCYoCnvTdqAOfuOymFgbS9FSa/5tSFi3KiMSGrMS47PqTCQWLHEdBPfpwQE5s\nAEeQkP2gjC6w17e80gIrxfkfUr7jUhG0Z45Hgv+DPVkDZNHtV4qmc/be1bUT\nQT4NvPPPye0+n0DHdPGa79DUqBG//7Yqu72GO3cmdzftFSiizZNxXohGpmiJ\nRl53gtopRb61j5I0V40TltVdKaXMKLyjthP7dSTEx0gPjmNZUPNnWmVySD/6\nUI3QbNObhRpmjqvTD0ve/v7TPvkzdbGT6AdKVDaKcja0UzhU7cX/jDKo0u8Q\nsFG0iS29dmjaaInqcyxwF+hKBae0Lc23MQkfSwFtmUgFd8Kt4woqyUrmrHL7\nF6YUy3QWETrCTVaK71Rwcvzid8mBfhrCX99j3CtVpbSlbqWpfQgssTSn/Bp8\naHfxGOlROYvlo16BRm/o9XV17EAtsoGJtnD2FUntJpURbxcSqTxd4TM5fzg0\nnmr82t1yixepg6pZ0DG/Wb66aJD70kZnJbSoRk6LSmJnZkwQ/5HFXA4HjVZ3\nFJxH\r\n=mC+h\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"6ed0d4833cc10e9b5406989bcd66b072aaa259d3","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.18.2+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.18.2","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.e3e073c00.0","@material/rtl":"14.0.0-canary.e3e073c00.0","@material/base":"14.0.0-canary.e3e073c00.0","@material/theme":"14.0.0-canary.e3e073c00.0","@material/ripple":"14.0.0-canary.e3e073c00.0","@material/animation":"14.0.0-canary.e3e073c00.0","@material/elevation":"14.0.0-canary.e3e073c00.0","@material/typography":"14.0.0-canary.e3e073c00.0","@material/feature-targeting":"14.0.0-canary.e3e073c00.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_14.0.0-canary.e3e073c00.0_1640034585026_0.5910983488418591","host":"s3://npm-registry-packages"}},"14.0.0-canary.3366a71d7.0":{"name":"@material/slider","version":"14.0.0-canary.3366a71d7.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@14.0.0-canary.3366a71d7.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"06f2218a1c5c66a03d1d75f42c3c99bc9c65266f","tarball":"https://registry.npmjs.org/@material/slider/-/slider-14.0.0-canary.3366a71d7.0.tgz","fileCount":37,"integrity":"sha512-GCcRsavsGcf9IEYS7MHfjbq5+iKEfk3aThdScaKrMivBrhVhUqgR9xEr60vc3IjIDjhuPLayzxSt33sqyFwPMw==","signatures":[{"sig":"MEYCIQDt9KYbCjOibL/MstES5Aa6tkc4PvCtIetqs5owSyfcAwIhAPZTaYk12Mt4aSN7jtJ0DifHGG6j11zkLs4A8qpSXvNB","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":872213,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhwxrwCRA9TVsSAnZWagAAQdEQAI8GKqaqz0xwupti7O50\ntGUy8oOEyupOw36jf0/+0J5jltuxhySzyoFc+kYpPL14AnUHmA165L3onUJ6\nFPFmcQYG/zpGI8K3W35hhJEGFh3Z82G4Kg6uWTY3ah6Mv4T/Rzcthuvqzq5A\n4+sAtyCqxoU8P9iECFyMdFmzqaROBHn1tUmllgYcKR1c1r2Dbz5Vj55yalRd\nqsrelbRcmG7MSXIsffKFzoBlC4Y/NxEMzgbBBJa420LtRUrJPS34wmr9ixxo\n38+O9OI8ctRpWBlHSpUZdG1ULFAks0mvUFBlu9LCfEblN+4cLW+PIqWNxMRD\nrLB+ku+i2KGTYjkhLenbsGzVk0qlSmWiGZVgwYGQSzKpQBL7oLa2IiaUW/6o\n1JpljWBKRgRGOiI6F1l8MMU44nziw89j80FeegzkYd+O9GWpfjDBYJ9jMc3x\nuKjHZdIUYLp5F4oDnuVSsqnP5fInxY2sbYvFHyNulchUwvwVzrrtjAT7h+t9\nHNzeb2bJetUikcn6SuF/outJAMk3teWz8Vqq8JrPjlhwzdB5zPFOj542Dwfu\ng/aYV1HOsu877GS4za3pYCsQcUhNpkl40wtbADoxnlaeS0TN5GomKjTH8yqn\n0+oL6fMBAidZqjot+oUktLrFMoH3taKnjZT0j6kKszn6kIh0kFtowT1Jetjz\nCVrX\r\n=Ylo1\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"36f8040c2829cecee06f5c8f52e08e9cabc9004c","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.18.2+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.18.2","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.3366a71d7.0","@material/rtl":"14.0.0-canary.3366a71d7.0","@material/base":"14.0.0-canary.3366a71d7.0","@material/theme":"14.0.0-canary.3366a71d7.0","@material/ripple":"14.0.0-canary.3366a71d7.0","@material/animation":"14.0.0-canary.3366a71d7.0","@material/elevation":"14.0.0-canary.3366a71d7.0","@material/typography":"14.0.0-canary.3366a71d7.0","@material/feature-targeting":"14.0.0-canary.3366a71d7.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_14.0.0-canary.3366a71d7.0_1640176367862_0.4557303008642437","host":"s3://npm-registry-packages"}},"14.0.0-canary.c047f7c19.0":{"name":"@material/slider","version":"14.0.0-canary.c047f7c19.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@14.0.0-canary.c047f7c19.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"2554103a2fb20c07470246beaa9fe83bc466e0e9","tarball":"https://registry.npmjs.org/@material/slider/-/slider-14.0.0-canary.c047f7c19.0.tgz","fileCount":37,"integrity":"sha512-dNtIrbgMsT+GsE72og0cUv7lHjnPMatrTZtiOy64zP3EvPqJaCFTv7c+KI85NX6sHsPg3qSkhVITIxYVRjYiBQ==","signatures":[{"sig":"MEQCIDSl7UzI6dODM5mQFvpN7JLeRkaXUOEn8U0cZzrIfdeeAiBBL/2qpRp4AS7fmtlz0IbQ3t23zvwzoIjcJ8qOAigAeg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":896937,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh1ctBCRA9TVsSAnZWagAATa8P/2nYNUbrQB1/zqrv/g7o\nUCA5DU/R4WdN6mlwqZDdRLaVdv0ni4KaNEnzCcgFnqwtPvzfqNwJJ3RNzJ9+\nV0suodVlQ51YJJaCTOUdY7lva/NCV38NCKp2LOL0ZO650wgrIXYEWzYe7BZg\nnFxml24ZlWSUrjTs5fnuLNQcKv0AzqAzN563s85BjRjZmRjaPeVx9doOfoqI\nQkWF8m3/18kOfzMAN4NsyG7JnUHj84Jzpg8fpAGoucRe2RzqOrVH5xT5Xw1w\nZPerlmTlmM7Zn6K2HEv5mUBJVmsfx+xy0ZUYOYPqjKlnlRXiH2TZum6PTlVI\nxb1ACJrpV/RimMdUC1PiAWpgiMx9ztElQvnrNidhJHGyN4fP6iUHHUjAhUvY\ndy29cvtH6IInZoYOy0ktJYQgHRwAIVVRldKySNIQCnly0Y66ptF5aAM7hlfe\nZWTcUbaOzNnPBV9KjkQ6FzR1pKgAxQAvjGbcAwFJ/DBZRYjhooM9BESx6SoR\n+y3VLKbEtgUBeA0oBBXgH9NsjMpb1ZcaTHdNpqxgPRce5wW0n55oUkyT1KBR\ng9L4Moj9c0j/i3HfC2nrbdajHHeO5Si/WOzEDAQ7TrE6wKWeILeGJ3Ft3U8d\n+rvwd8afnhnly2MO9U/PyLFkLpn89vu2LT/03StWgK7M4JOsKPfpf4eJimN8\n0WFx\r\n=dRcv\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"f89c0e152ba1bb64d7b262b279d38cf5d93dd788","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.18.2+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.18.2","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.c047f7c19.0","@material/rtl":"14.0.0-canary.c047f7c19.0","@material/base":"14.0.0-canary.c047f7c19.0","@material/theme":"14.0.0-canary.c047f7c19.0","@material/ripple":"14.0.0-canary.c047f7c19.0","@material/animation":"14.0.0-canary.c047f7c19.0","@material/elevation":"14.0.0-canary.c047f7c19.0","@material/typography":"14.0.0-canary.c047f7c19.0","@material/feature-targeting":"14.0.0-canary.c047f7c19.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_14.0.0-canary.c047f7c19.0_1641401152822_0.5200987605442","host":"s3://npm-registry-packages"}},"14.0.0-canary.05db65ec0.0":{"name":"@material/slider","version":"14.0.0-canary.05db65ec0.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@14.0.0-canary.05db65ec0.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"f4d649ea2e8d44160bab5d1c2aeeceaadaffc142","tarball":"https://registry.npmjs.org/@material/slider/-/slider-14.0.0-canary.05db65ec0.0.tgz","fileCount":37,"integrity":"sha512-2wlRxyJS1eUy0RYZqwM9jI/CMyz9yGswtY3DFYtQsPYjkV/9tQcmni3MwwMHLoh7FV1IqqHRnfETftwvoraSwA==","signatures":[{"sig":"MEYCIQD80AJGmHFaYLZpKtSvNz3gI+qrG5OvVSMqPIyZ1X9OmwIhALMGQqO4nt+VuWgpxXhjZgFDI1EP9nmBUseizYR74Ps4","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":896937,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh1yNnCRA9TVsSAnZWagAAmyIP/2t+unKUe2QtaysEYGHt\nZdJY7PHAZ8xaOoCtMRbDJPJfS35lMu8dDw9VJzY8QeRYMrZoCOze3stG4afG\nvNVwsgeguuHkSzkZUtkVqK7GkLAN870jUr3WKXDMeC/abmN7drM+Em51TG9J\nJ4Xqn1wdpaZgQEq9IdyYuULqgz3+Phe88KX3US3Nr6JPXPjX9xmAwrA6NYRZ\n64S/IoVhDphb2r7KVZAA1Ci3oEMA/2rF3gz09fL5FMbE9W8d1CbLd3Plneap\n0y/XTtnxd1/eBDjoBEyRgCgAxTPD9/5oWto8GHe36LpA+R1nAJxZZTgpNeer\nrIph/ZcoNG+Idp2RksVnhvK0oEreq22oA66jnK7cnL6N7pjdWNvOsD0WcSxb\ntR7hK1uTnKF6Vkzf+sMGj2ZOz3wiOL809EKrdTLqJvicRMuUHbG4Ie9IzNKm\n/YPOYljFhMFH6uE4Cw61s/ojqBIiC7a1msOWDhWJ1Havb8AOkFez1NgFIQX4\nCCySubxtzgVQp3ZsbpW1ru1o5+5hGus1nFMw4cmyMbqDcrPKprLWNpHOkygi\nucqQuDpauzuwiytYczTmGOltimqjFCPSTJGVzXhVLkhnJMFSYBBS21zHZy92\nkm4o/2Sjpehas3A9n9A9MRiKb93ghuiXBG2p2kYK6lKRSxU5lzZs8m135Pxv\nTF50\r\n=a3O6\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"4ee3c4fadb795ccabc127e2a968744c5bed23d38","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.18.2+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.18.2","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.05db65ec0.0","@material/rtl":"14.0.0-canary.05db65ec0.0","@material/base":"14.0.0-canary.05db65ec0.0","@material/theme":"14.0.0-canary.05db65ec0.0","@material/ripple":"14.0.0-canary.05db65ec0.0","@material/animation":"14.0.0-canary.05db65ec0.0","@material/elevation":"14.0.0-canary.05db65ec0.0","@material/typography":"14.0.0-canary.05db65ec0.0","@material/feature-targeting":"14.0.0-canary.05db65ec0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_14.0.0-canary.05db65ec0.0_1641489255707_0.1913675205308074","host":"s3://npm-registry-packages"}},"14.0.0-canary.6ca8b8f85.0":{"name":"@material/slider","version":"14.0.0-canary.6ca8b8f85.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@14.0.0-canary.6ca8b8f85.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"1be9d2eacb4c13cf0e3870319b2efba2afb6f34c","tarball":"https://registry.npmjs.org/@material/slider/-/slider-14.0.0-canary.6ca8b8f85.0.tgz","fileCount":37,"integrity":"sha512-oKPoe14/CYIqtt18n6SLkteqDtBoIZIpJC09QTdiyqVRgmzkQ6XG9UW6ynFuwFCiog0A4qncsZbPsUspqmRR/w==","signatures":[{"sig":"MEUCIGfKs1eLjT7P2yInaA0jFGhfMC24JHanFjEvfTL2R49CAiEAjmlgIX/qwFFhqLo3tpvpp4rujmfxHpgj0KeCG/4OBG0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":896937,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh2GPgCRA9TVsSAnZWagAAplEP/0hYGCqIpTFk4lNI2UmN\n+TR9uv7xQuH1Zs+gvIqejlx6EpP2dxr5ZM1fw4FtzqFYZ0BZ3Cjg4VH+uAmT\nzog6N1dsQIz9qMJqr59KNg19nVwGFFyu5+oI8j1e5JqI92LrQDIUrqy2gD74\n6GP9BUyX/2x6dQzWcNp7KktFp7SkpaFzgtJt57/GtU7Q9fP/K06AKNn5Qjid\nRx+MXzudPiWT8H0lDpnrIQK9L1YSVkzG1GDIunRtAFzLj0w63CP5B88nsrMv\nKkWpI1Vvtl6siVkZM2R9ScCt2fi0lo7vaRoFOy4RPMAhL16P1uFe6mE0RoBE\n1R6P8B0pYwqBj0gLjHzyyMK3iblwC0aEXfs6bmwLMt7uaclG2t5SOBeOAzfD\nbUN4JDTWehg4U0efftjmGCNyOd+w8KJq51mYHA1Gc3VhRjAh6gybB/g3StjR\nWb4uScyrkd7Mn8sWkMVA10mMzJIOEfCLEO2Y79W4m5RZS0mkDjYPumX7kecc\nd0StNbPMpRN7oqTS3U3Os+i6V8vF5kNV7oVhG/PQ6bIKmJb4MyZxxgmCdo0q\nHOpoO34dh+kc2/ZitF6j8nQKz+yeZbfeAr0dlgA+e12d86cbq+9mzF5NYEpd\nM2wvdfo0tddtES3lCTSdaNloO4uxIIUMDgtEFvL6Q/Vgccmj6tbJytfufgYE\nv00v\r\n=SjMb\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"b3237bcea052016fff824f201904a358e2cbeeaa","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.18.2+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.18.2","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.6ca8b8f85.0","@material/rtl":"14.0.0-canary.6ca8b8f85.0","@material/base":"14.0.0-canary.6ca8b8f85.0","@material/theme":"14.0.0-canary.6ca8b8f85.0","@material/ripple":"14.0.0-canary.6ca8b8f85.0","@material/animation":"14.0.0-canary.6ca8b8f85.0","@material/elevation":"14.0.0-canary.6ca8b8f85.0","@material/typography":"14.0.0-canary.6ca8b8f85.0","@material/feature-targeting":"14.0.0-canary.6ca8b8f85.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_14.0.0-canary.6ca8b8f85.0_1641571295886_0.6789017500656571","host":"s3://npm-registry-packages"}},"14.0.0-canary.173ee7a7a.0":{"name":"@material/slider","version":"14.0.0-canary.173ee7a7a.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@14.0.0-canary.173ee7a7a.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"feab03dbe2807858da226675bda889e95f212ef4","tarball":"https://registry.npmjs.org/@material/slider/-/slider-14.0.0-canary.173ee7a7a.0.tgz","fileCount":37,"integrity":"sha512-94cZlqdrYILV5fSAbAYKSI75rGnlchFBOIy2ZoB6OwtPWvufORUQKctZ6R2d8JsNeXemAV/LAzyLYJb0R36BAw==","signatures":[{"sig":"MEQCID5hjfN0Wkqdwm52H/WASobL0pdmQ5tYrzq6dKsu48+NAiANboqIJbUrRq+Wmi6EtKXJRtKKewuplk9cCRQte6mEfw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":896937,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh3GS4CRA9TVsSAnZWagAAE7QP/iZH50tJz59g4Fzy44On\nrpyD0wkiGVpK4PhOOiltLqUqU6K4IPQfB/02OQ4UABg1qtHS+AFlIp8V/d6u\nifc9+hkfZy1wrvvYtog4MVfQM9atHl7Ka7o3eSOnih2hgMd7ultnLves5BUn\n9fnVAwXrUdfDTtX8HPmrC5iqSzFjofzxc0s1TaYYQDv7TzVhn3ZaXH1V9QdG\naQh91YODpbHCRlebg80rdQ2S7C69Ji5eTxYdD3xMEFDxuptmY6V9aOKlqaSe\n6uzQ02x9LJ3tcjP2k9dJwGFQIW1bDh9Atxd4pPquwdenC8fRWSvN1uIThQHq\nw5HXp4U9IouI/OMdJo45gbdWGi2lzyxpcLaEOQP59zh1dj9NCyAhSfkL+RZj\nvLa/ZNr8ZGYnEy1bVejjju0FsnxDw4utK5vCcow1knFAG4UaAcQNnWwRKPl3\n7sU6DDTysSEMzx04jzgRcLDV6hqCFXtjDMKhlMQEqYGptnhL0zrpFnDPTMvt\nB8PQBfXzmIm9QSJ+JPj/xG1pCYPfO0V/79Oq63G/wa17lQRxow4tD+mWTmJ8\nAvoRu2lwFi1Wdm+9kEd8vEvh+ibBrBGKY9QV861QU9ci/FvV3VevlwU1MDQd\nK7cO7fhbLv1zcs0jEFVHo78gRsQzECm4l7i8lAod0Rkee7dtAN3q1jHW3mq6\n4vgR\r\n=JrHx\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"f034f9d63d29784b9608c7c25ea586070efbd27a","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.18.2+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.18.2","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.173ee7a7a.0","@material/rtl":"14.0.0-canary.173ee7a7a.0","@material/base":"14.0.0-canary.173ee7a7a.0","@material/theme":"14.0.0-canary.173ee7a7a.0","@material/ripple":"14.0.0-canary.173ee7a7a.0","@material/animation":"14.0.0-canary.173ee7a7a.0","@material/elevation":"14.0.0-canary.173ee7a7a.0","@material/typography":"14.0.0-canary.173ee7a7a.0","@material/feature-targeting":"14.0.0-canary.173ee7a7a.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_14.0.0-canary.173ee7a7a.0_1641833656239_0.17298678668005296","host":"s3://npm-registry-packages"}},"14.0.0-canary.b704e4dfc.0":{"name":"@material/slider","version":"14.0.0-canary.b704e4dfc.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@14.0.0-canary.b704e4dfc.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"b10804b79b300e4080ff3cdd6da43b38106a1c80","tarball":"https://registry.npmjs.org/@material/slider/-/slider-14.0.0-canary.b704e4dfc.0.tgz","fileCount":37,"integrity":"sha512-tV6cELN2b0uEh4WP54jluOyvB7+44JxSPEqivQuEIaE8Z4nK5QvF4+rQ5er6LJ2ApPFrE8YeP0uunck5REWf+g==","signatures":[{"sig":"MEUCIDW+XnLLX+Q5F4UK8fk08ehQmE4vtDUFyfgD4xwWr8ViAiEAwMc3ZTgin24lmfV/xuGRdkAT+W0/xB7hf/grIsFCgeQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":896937,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh3HvgCRA9TVsSAnZWagAA37kQAJPHCaePLMPVlm+CoWpz\n3mL3YPDPqeu7xsx0n1A9pvxKVxo9w5EQiDq37dBBe3sw7kfnCuhEKAVzBoL3\n7n6FLeIm1bruI909xep39SarRIpcRpd9bdfJOpnRyuvnckIBhC+e/Iil/nWz\n6O1SP05aj2LagDieumQHADh5jEvY6PIKBD+v1xera3MVsXiqZJ0pBUw2kVDp\n8k8KirDTgvOH2nVgU9o432QreIXZSTdR2tDhwJu2QiZLS7G4eZM9ghnTYdvI\nJ8rn5kjbBK6upN2b+HvT9KJoCt1YDI1+TGeBT6edwT4hj1YMlgHtmbLveqLW\nZ/G2d3xH7YG6svfKKP0TDjB1bS4HICQMpAWU+JuO8KR10Q5Cc/0Ocxh0qKoG\n4+n5uv5u12um3K48KhwXY4Y+Zpy6+utlkwKv5NwZL1ihB/oDFVa3tR4kQb3h\nrL15suWaB1iXxIEKyiTy/B+2T+vUyE+GrsY8vr4pXsdjDKHqOdhZfyJ46XBO\nrMPlIOmByIUZ1hXLmsZcMJiqlQUOi/40wnJlDli964qBoeXZ+JVwHjrmlQEm\nzHjsES1WTVAqTKEBhhrfUEjbUCATzBts3mo161b4Eg+qecCIeMHFC3F5PUT7\nvpQ6R5uBDgF3MHBLHysQsljroBOY2TSxFjl9yWv1l2lqezd+N59kg6GbzvMT\nuoyu\r\n=NIaz\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"7aa8626c10b7e0fe9826c55e7f08c4ab0aa493bd","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.18.2+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.18.2","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.b704e4dfc.0","@material/rtl":"14.0.0-canary.b704e4dfc.0","@material/base":"14.0.0-canary.b704e4dfc.0","@material/theme":"14.0.0-canary.b704e4dfc.0","@material/ripple":"14.0.0-canary.b704e4dfc.0","@material/animation":"14.0.0-canary.b704e4dfc.0","@material/elevation":"14.0.0-canary.b704e4dfc.0","@material/typography":"14.0.0-canary.b704e4dfc.0","@material/feature-targeting":"14.0.0-canary.b704e4dfc.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_14.0.0-canary.b704e4dfc.0_1641839583756_0.1830981441479067","host":"s3://npm-registry-packages"}},"14.0.0-canary.c14e977ee.0":{"name":"@material/slider","version":"14.0.0-canary.c14e977ee.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@14.0.0-canary.c14e977ee.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"1624119e59f946025bf85583ac6141e9e4e03a40","tarball":"https://registry.npmjs.org/@material/slider/-/slider-14.0.0-canary.c14e977ee.0.tgz","fileCount":37,"integrity":"sha512-IjdEvED5X1Z40UyGREL1E5UvCCIS6lTTs6xKvkrM2KAp9T0ph6eO7Leb2afqE1pJ/RXw1UIYka1s15o0a+hTkg==","signatures":[{"sig":"MEUCIDUk2s6NGho0m8CJ3p1QMywjEVDwJYVb00eCuTjOKRCJAiEAxWWs/qcyIbEO3bYBMAtr/5u4pmoe0tmTTMsItPcVVKk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":896367,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh3acSCRA9TVsSAnZWagAAHZAP/i+mP8zzu1svzqOv+bVe\nCoEjldfZLDJhYpssLYNq7k/06Sblq6lfl+OVyp49CLqhx77KElgsbAfPoLa7\noFCj2qQg9207jr6eWLCEJqtZPuwWiLxp1mcNMUav6Qj5PEPAaJQs1WV3EvqD\noRrpun3jrMuggK5u582o9fpVjMU1/BjYPy15C/35M1AGNobUl1u7WggvQKrD\nw6NKN95sEiqIueYCXMbayB5bVBmBaoVHbsPU5UaO94hx1drQuodU53n7JYhz\ne7f/cjJ0MTYMQiJMUPnxUEZk97uUUExbP4PAp0XA7eXOPIejKM6WWCv9/J/S\nS0Wd4ksxgcC8y3+g9kJWj9sFmanjM+ejhH4fA8x0sdf3IpxWzFY4XB1f12Tu\nTwat9ZsVzianNhcONFqg2aYedvhjJZOGWTs+gkd2P5L4caheLDNoOIYmAMCr\nCybtdHcNKbjSFfFx3LdO19SNmsT1I+BKEJGVFBTSc+TPB5ywft+opqm4dunn\naD8tMJphX4dX4pikWS3sK8usIJQiRLPue94u7QwzRwxUGRqJLjRUtH5tzpKK\nNMoS5sCWVgalOypVPIYYydP1IyK3UIsZM/jgu6x8PuuWsTwDoD1Su7MeDRpY\ncyMI3ltJNmmupNjI/DXmTZuDE5NeHNBUcUt4n5TyokRWj18s2SXai77kfOFI\nZvdp\r\n=R9ZG\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"9f7e1b7371c604a5d4692bdbe25aecc578fb16f5","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.18.2+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.18.2","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.c14e977ee.0","@material/rtl":"14.0.0-canary.c14e977ee.0","@material/base":"14.0.0-canary.c14e977ee.0","@material/theme":"14.0.0-canary.c14e977ee.0","@material/ripple":"14.0.0-canary.c14e977ee.0","@material/animation":"14.0.0-canary.c14e977ee.0","@material/elevation":"14.0.0-canary.c14e977ee.0","@material/typography":"14.0.0-canary.c14e977ee.0","@material/feature-targeting":"14.0.0-canary.c14e977ee.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_14.0.0-canary.c14e977ee.0_1641916178013_0.3661109940701377","host":"s3://npm-registry-packages"}},"14.0.0-canary.b094eaa4e.0":{"name":"@material/slider","version":"14.0.0-canary.b094eaa4e.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@14.0.0-canary.b094eaa4e.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"7c7e3bd99f2d67728eb3d18af250c2990986b49a","tarball":"https://registry.npmjs.org/@material/slider/-/slider-14.0.0-canary.b094eaa4e.0.tgz","fileCount":37,"integrity":"sha512-ZOcTld3+AwfTX9Wkhdttff1kT+mjYIk+P0rPReQ6id7SadhBlXXhAt2V1GkWbzODfr9RebJvbhe1EDrCyuetcQ==","signatures":[{"sig":"MEUCIG/z+N7lGYr5yNl3ryCqdBPAMplkDebaJrx8WuhohCQ3AiEA74DO8PkmsfEeRntep34gp+YXyJZrcfJjjRAT2idXMDA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":896367,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh4cQPCRA9TVsSAnZWagAArJQP/3uAd3yS+IjjNmW+oOy6\nyx//wafBbzQ0OtCOuR/ftQcr40OatkwLdqwUGEfXfSXZL+z4+5tpYvVnxHFy\nk+AOApo55FIg22NWLTGnxW2HXinouy+cKssdwmCDAxpLxdGikS90tEcEt4Os\nyv2Q+0eYjAV0GwQN9viEuogCKGGJphd7WtS/pOJPCir1yPcwayWKJmG6loDi\nbGJOz/wIVvOMEvWWoxYgk+SyDYSvxhFDvA665NmhdgvOrrUz4tsdQQTuvEWz\nDopAVWZAV+4acLdHvYjQLRIWt73DhDPJxfGvNRFbeRwdioNvWlGGIfwaEBMJ\nc7J7pqTvMKW5/Otd2V8o2ToOMS0u1rEIIn37ZZz8uMrXFgxEQGKihPGcWh+c\nOLr781yQe6sAuDQV0swBlpz6BwvQUKyg32J9GhX8Mo2XI8eFlXqdP25bzzag\n8eEWInTnr38PqIWmlHJhZxWUKvY4GA5x+tq4gji14chASD6Rd2+8SoH3r0AG\nt44O2mn7l3HLUb0SPamoTD+WKNuwIszOSp8pgHduwu81aKsTfGs0whK+9rUs\naUCE8/c248m96e3bl0w6IhqiOcTGwH9isw91KrIQwM1iZ6PbKNdsQR1qXLvx\nLMcPWyVH8iHmtrAWBqEffYa3WNhtvZH+0BL7fxP+zqVFg1m/Iv4EECN8LQd1\nhPF9\r\n=EZjo\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"6b11b48b933746de14be90d79974d10e1fd48289","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.18.3+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.18.3","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.b094eaa4e.0","@material/rtl":"14.0.0-canary.b094eaa4e.0","@material/base":"14.0.0-canary.b094eaa4e.0","@material/theme":"14.0.0-canary.b094eaa4e.0","@material/ripple":"14.0.0-canary.b094eaa4e.0","@material/animation":"14.0.0-canary.b094eaa4e.0","@material/elevation":"14.0.0-canary.b094eaa4e.0","@material/typography":"14.0.0-canary.b094eaa4e.0","@material/feature-targeting":"14.0.0-canary.b094eaa4e.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_14.0.0-canary.b094eaa4e.0_1642185743344_0.6397794041141385","host":"s3://npm-registry-packages"}},"14.0.0-canary.390220e42.0":{"name":"@material/slider","version":"14.0.0-canary.390220e42.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@14.0.0-canary.390220e42.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"6d9761d2a6e1f88871d3d183fe83b1cbd0a60429","tarball":"https://registry.npmjs.org/@material/slider/-/slider-14.0.0-canary.390220e42.0.tgz","fileCount":37,"integrity":"sha512-qxy5STWWHdmtdZ7f3UuuqfA1q9hchGwcshz02IyHlckxiXzreyOpwRcZ7mUowXU1LZX3w8xhBLMhLSyXMjU/+g==","signatures":[{"sig":"MEUCIQDE0MFLc6KsmLHvSiIs4H0b0jCiqpSExg+/9XX5inEdsQIgNSqXSvB0tgLnPrlCt44Xbx9oKCROoXaQgUuVL/il/zc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":896367,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh5Z1UCRA9TVsSAnZWagAAJ+EP/2dNgQQ4Wb6SMBl/o1C8\nstB8Q/n37B3dyvmq6UtQQXB9sWfLSf6fFqrfJywjs94r4ZXmuCfi/dPa4GBF\nU+ces9Fjf0D3rnKuSzPWzAKWh9B/TakWub9c3xUB8Jz+eauat5p5PdMITDQL\nFu0bc21ESiYXJ0E25UkvPd8O2N6wCbJBqapt7NLvYWmN62taynpMArL2E8o8\njW7CQ6hO/irpQTWsmH7Q13uniWxwKLMBnGpleRCGCTWulvggceLIwsFs66qW\nMio7ZZN5RSGgE1r5t+IJHUvLiR+DQKR7prp5VmVNz/1d3vT3ytwwP/7ZEEkm\nKO0sAbqHjILBO7sCtb/ejSYfi1TsfQLmk/8xtDoQLRzgcGQp3gpU/htIE8pI\nPdYZ9tjFlXTGdCX00fVkjnhFE0zx5JgLt9c+x71W5T3AuUXVZTUtEzziNjfo\nnTBmwfgFiywJvdMhBjfgAULnrReS2tBdMpBY8G7DMyoyqCyzGs5VI+o8jfMx\n2oMzKe0UHD5t/mZXrX2MG+5v9vW59UHjBmwkrxBETvnYW4qGodaoT0VZm6V0\nCglrj1VK1ahnRo8dOUwcKbnhXZveoBkOxc/SPKnztgfLjspJusGCCAtzdvjm\nWeQPmlEmBtqEF6ImPWbIQgyVmm7TEWaQtO/ujMpVsZAoYFFS0Pi3oJ5HQa2Q\naTCw\r\n=MFHI\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"dd9f4e499bf257838f40df3957ee3c321500fe37","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.18.3+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.18.3","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.390220e42.0","@material/rtl":"14.0.0-canary.390220e42.0","@material/base":"14.0.0-canary.390220e42.0","@material/theme":"14.0.0-canary.390220e42.0","@material/ripple":"14.0.0-canary.390220e42.0","@material/animation":"14.0.0-canary.390220e42.0","@material/elevation":"14.0.0-canary.390220e42.0","@material/typography":"14.0.0-canary.390220e42.0","@material/feature-targeting":"14.0.0-canary.390220e42.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_14.0.0-canary.390220e42.0_1642437972080_0.6805696171301818","host":"s3://npm-registry-packages"}},"14.0.0-canary.4b5391f8b.0":{"name":"@material/slider","version":"14.0.0-canary.4b5391f8b.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@14.0.0-canary.4b5391f8b.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"d62caae6b299c0247fa4ed0116d5b13bb44eee34","tarball":"https://registry.npmjs.org/@material/slider/-/slider-14.0.0-canary.4b5391f8b.0.tgz","fileCount":37,"integrity":"sha512-LQ3jj5VoUlRMkjEwYWrxDGz9fUTVXShHAtWen2tBIJgXvOVPvmJHVxtiWNpdptgAQ0smoKugR4u0qwglTiPkMQ==","signatures":[{"sig":"MEQCIEQUPdO5jpRjVgkJd/Hc3VasfnUQUZrQl0WnXaKJaDXPAiAzKxYzr2uu3MaotaSszJEBrnlflQezwTnpeIeY+x5cPA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":896367,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh6KRPCRA9TVsSAnZWagAAA3gP/RQpNEuq8gKtmFtT2EAj\nJQcCZNkhVQpkowqopjV5G1Xql23HsihjF9fzwTxCAZScepzh1/cmWSK5zI5q\nbcEu51EIfdL4rlSdo5kbg9kAS6o+RPpFxFdU0JUr8k0EaVBQzY9CmytHWXK1\nZvbTTPMKpxDgLp1NGdapSMcHqfr21fXi2BpwfG+zf1dZIzreEqtGp+Itv2Q7\nnGrGo8MPWl6V4c6NwfqLFEhL5xe4imBYfvGXqC7ue6/tAhWRBROro5rj6vg4\nw6y5bH2OrJMEWQgtXllkqTB6wezBnlcO9NyDffzIwO8T3W2yCYfUonxpurrG\n7ze/DgGP2/RDbBDMySTEDr+SK5TDfy2lcPDW5UvQaQIJeNNkms7oLb3bkrRM\nNBnhLdeTdEb8nhmgjBzj7DdlVXdCyWg+ow9z1jWPA/v2wXPbr00xEmI2qQop\n0zghlkF3iTUY/Iw0nXw6K6Ry4cH+9GFokkknTYItAgKBUQaZdsRqwyU53hto\nIsGGFBlvCaUCzuX2FtS9eP5t/YDdkWdq6OQLJ3ZsyTvLJ/0ajXuB1MKbgaAx\nxKyowCXRmDTnymax5elE8QdjVg1EJCEt0EEXU9xzFqpCkhnwERdtcfx50bvH\nRymXEHCYfdtFpCFrQ0eTc2maXim8DjbZl4a9rM5SQ7bZxuHiUbVyF8LsWcYo\nTPVC\r\n=Xi7M\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"09410b4524a4005be30dd18c47d4214d6eeffca0","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.18.3+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.18.3","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.4b5391f8b.0","@material/rtl":"14.0.0-canary.4b5391f8b.0","@material/base":"14.0.0-canary.4b5391f8b.0","@material/theme":"14.0.0-canary.4b5391f8b.0","@material/ripple":"14.0.0-canary.4b5391f8b.0","@material/animation":"14.0.0-canary.4b5391f8b.0","@material/elevation":"14.0.0-canary.4b5391f8b.0","@material/typography":"14.0.0-canary.4b5391f8b.0","@material/feature-targeting":"14.0.0-canary.4b5391f8b.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_14.0.0-canary.4b5391f8b.0_1642636367278_0.5622957832364741","host":"s3://npm-registry-packages"}},"14.0.0-canary.cef6bc623.0":{"name":"@material/slider","version":"14.0.0-canary.cef6bc623.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@14.0.0-canary.cef6bc623.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"d069377cff32de6502d7d3f6f7d4e6a791ea49d1","tarball":"https://registry.npmjs.org/@material/slider/-/slider-14.0.0-canary.cef6bc623.0.tgz","fileCount":37,"integrity":"sha512-emONG0/q4621HncgQwOUeWDggoZqehotOrVQaCYusos0b/jQaZ4aIB+RDgW/MFkL0J4Eh5kPMi1P9uoDXeaVUw==","signatures":[{"sig":"MEUCIQDDtxMT5yUTFethN/1JNMAr3BH572LZgjZ37s4MsRzS4QIgCtAOH9UuqnmgX0Wq2XZq8FGeDTFt0Bx36oJCtUP2phs=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":896367,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh6KobCRA9TVsSAnZWagAAy/UP/2Q7nzOl7nYO+2NbmHbR\nbzLCO9E8fS6iznHUz2D8R0KS9ieDhzhTKiUq9gYTIOzz2+oWpHSFk3PvBJlz\nZVJM1EPxqsuuJ3lPSVdUza0hwCChjmMvU9a8YJ/MNBtxWwerrxy/hnp/cQIK\n6ib3HhGTKfMPWaAy68V9pYrxxE5jo1ApuzDBorkYRcGi8UOctqKcZ4qhalNI\nwNOjUrzIc4PTzPp56q/Gr96jHU5vh8JclwXOMCrSB/P8UorXKIVTasHkR4aH\nt/t6NuQ744Z23Kk8Vv/JyrsdWcc+PZAn5HehMleAUiRe+1+og4EORHH6bN0v\nd9Q7b+v7TSEPlO3TwnQpKNPrfBTssMpUV4zmwG0VwQN86NO4HrZaPCAFbsZc\nP+zkXSkru8XA0/1VFJhK3WgRYuLnHkaYCUiUM/5VdVETOqHIrQvR7JW6/QNF\nX6TErpRigZhjr0Z/mctdDCU/TNa3HDqQPyGh5gITqrQdxvWuhp/IimyQ0sCB\ngljv03iX/KN1jxrau1cfeDMgt7fa1J5QGyIXaKhXC+TcUq99TzmKE2aQ5f5p\nRvnv9WYeCLNz269TQv9jvDJM5GZiBtmYfB4Eob8rVAr2447zCMHnai4RTJBZ\nzTJzgq2DZFDTvmPJE8Q7iD8p1ZYWIDPEl+Oy9yO40hBFJu6ulcopulRiVkcp\nGlRV\r\n=WA9x\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"6bfb214d1f6768cd968026313c7de32009b2da1c","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.18.3+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.18.3","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.cef6bc623.0","@material/rtl":"14.0.0-canary.cef6bc623.0","@material/base":"14.0.0-canary.cef6bc623.0","@material/theme":"14.0.0-canary.cef6bc623.0","@material/ripple":"14.0.0-canary.cef6bc623.0","@material/animation":"14.0.0-canary.cef6bc623.0","@material/elevation":"14.0.0-canary.cef6bc623.0","@material/typography":"14.0.0-canary.cef6bc623.0","@material/feature-targeting":"14.0.0-canary.cef6bc623.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_14.0.0-canary.cef6bc623.0_1642637851664_0.9017744760488238","host":"s3://npm-registry-packages"}},"14.0.0-canary.0379179c4.0":{"name":"@material/slider","version":"14.0.0-canary.0379179c4.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@14.0.0-canary.0379179c4.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"91970f0ad1b861cc384eb6b45587bcd7105fecdb","tarball":"https://registry.npmjs.org/@material/slider/-/slider-14.0.0-canary.0379179c4.0.tgz","fileCount":37,"integrity":"sha512-SqLCYeE+6Wqa5vJ3MJ0+m40QEVj36sWMgq79N1LTcEg9H3x23pGCNs2pyzHG4Y8TMKcDfdVw9A5m11E3PZxRVQ==","signatures":[{"sig":"MEUCIF9u7kGkLRu6meMV5NuPoD6vZEavT3xeVRWMATdMt7CEAiEA2P+Mw6430WGq0ybHvpOlZ+jnlFEVkjhOhCj+cV5Y0Dw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":896349,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh6a/gCRA9TVsSAnZWagAAp+MP/2fXSHURh5a8WJxI3VR7\nhm7q2qyReT+PGLz+U8STRJ+Xku584ER2RYkfiLtfDxwZcTDkAEizmQoZxBUP\nwGW8/Gfq29TfC6IIc4T7KRqFmWj3mhOBr8rsdRlaTI98x6NfClsQ9p+q64BL\npcG0Iv2DWLCkXSl0Hj/VfECTwrJaVgGknr/0EKMHD/BQUH/eriN0uA9i5LsH\nRiGM0oWHvQSHifVMAJi4qFrWV1e8KtUsPh3qZa3uL+wfm7LgERTzkEe0XT5J\naLo0tgIXDOn0pH7C7ipndTdiY7CxL7HNIZZi9tBSBBf42HSx74GZnGnHABBY\nB3+Jg/9Y/UeNQ0B2zUixcnRpLw2diIxJsNhV8PeVq065Z2ijgCpgJ5I20fVI\n/rvoObQlOsB2itRoNctG7qdVRWZ/zRk7qL+1yEyxG2N71EzGLmai6K4mUcCq\nDZnmLVFtoqaVsXwfU9TB1cfRfA4qA6W4Z2qQKgdmfBgW0pd8t/uEJHc11WfX\nKASM56XlCjvCbCbpYToY1f533f0YqSZBMD7GlP04mQzEMKmkMrUCFeChXO37\nCuemCakDCCKoiQOdPdvR13gJHv6kNKZbypuXwA7b6FzeI03YwYnpb5uiiu+i\n9rWXm8Vb142yeYcXn1wum1prXY8tLN/gqFHR9niZVtrg01df3rZcrkILCtFs\n7ARC\r\n=VO/g\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"fd62b4e352900f807c8308b282906b51227baeac","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.18.3+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.18.3","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.0379179c4.0","@material/rtl":"14.0.0-canary.0379179c4.0","@material/base":"14.0.0-canary.0379179c4.0","@material/theme":"14.0.0-canary.0379179c4.0","@material/ripple":"14.0.0-canary.0379179c4.0","@material/animation":"14.0.0-canary.0379179c4.0","@material/elevation":"14.0.0-canary.0379179c4.0","@material/typography":"14.0.0-canary.0379179c4.0","@material/feature-targeting":"14.0.0-canary.0379179c4.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_14.0.0-canary.0379179c4.0_1642704864626_0.3930161403147925","host":"s3://npm-registry-packages"}},"14.0.0-canary.e62f3dabf.0":{"name":"@material/slider","version":"14.0.0-canary.e62f3dabf.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@14.0.0-canary.e62f3dabf.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"771b8ac1e33d8682d7d5dc4da5e9e0e5e751e305","tarball":"https://registry.npmjs.org/@material/slider/-/slider-14.0.0-canary.e62f3dabf.0.tgz","fileCount":37,"integrity":"sha512-kPkjWK6kJvsB/7y6VAMWjOVMNwpPXYd0ookXQpwwmM4LwTBLOkq1D6AMPdvUuVr2ZQi38u7f+CHeKjs9II1DLg==","signatures":[{"sig":"MEYCIQDVD9eDygiV80/Eun88iF3PmkEDt2SIkChID7math36uAIhAK/JeOOxfysUSyPGnfeRBXaHTrMtclrY1+aMUlWGlzmI","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":896349,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh6zu8CRA9TVsSAnZWagAAFAIP/RxoLuvgCqQHpJJzjy/Y\nNjPVkPlWIxC7AHnWZIF/3uyjBx2YnothvBxNW9o8gq5SNx3LXRDqAXGib01U\nJPkytDAhAvTBUcPCEyOfBfRsZ8X/OR3j2k09S4D97+6TiinOBm3vRjTRPOyq\nBu+661JfssXqd9kQzqqq+9CZPsNayI86agbp5ortMFkVfrCpMI6IpG8xmnwj\nMMn8u5DgRMsBu1YtwGyJaYisWco6VVk1HRXveIJGUtI72K1zl+99Eae57p15\nm8YekbstZi5NBSKMT+lNVw7sUBuLV1GU3k3QZTGwoXOcbyFsNV8Nbj0ttMcy\nKdxLEf0oTZHDnGp7ei03UZts8u1yNPWG4m8S13gDG3lBCC9fLndK/5OMyriX\ni6VUXYZdfgttpeUTAy9/y5GJ70dNtatorRC0XF6h39OBwOFYUFBL6tYmkN2H\nvJ8XWlZ1t+nmh4CeMNphGWk8/GQaCvq5PeDvsCkKNmJaa2e7yZqUcRPtnTMV\nwTO4NQhxc316XRNJXYIQiwnrQGIR7C3FbKuTPMc7ey6zPDjrWn3XG6A/3mdr\nzJXZjCXp4LE9hFEXyRiR+MQ2JMpxMQiZiazQrc8ZkUXXLaYoYOo+Y+L/s463\nZPHFnxt4TaJg1H3eNXrxEY0Z7WfS7PVVWuiVlYMdV0r7es8Ce3b+msYH6O70\nSMiq\r\n=W24G\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"7f7d12458af5eaac6bd913db605b5afc3753906d","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.18.3+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.18.3","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.e62f3dabf.0","@material/rtl":"14.0.0-canary.e62f3dabf.0","@material/base":"14.0.0-canary.e62f3dabf.0","@material/theme":"14.0.0-canary.e62f3dabf.0","@material/ripple":"14.0.0-canary.e62f3dabf.0","@material/animation":"14.0.0-canary.e62f3dabf.0","@material/elevation":"14.0.0-canary.e62f3dabf.0","@material/typography":"14.0.0-canary.e62f3dabf.0","@material/feature-targeting":"14.0.0-canary.e62f3dabf.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_14.0.0-canary.e62f3dabf.0_1642806204086_0.9454881991249953","host":"s3://npm-registry-packages"}},"14.0.0-canary.3e20c1de8.0":{"name":"@material/slider","version":"14.0.0-canary.3e20c1de8.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@14.0.0-canary.3e20c1de8.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"70b72730a779181152fd2e2d1a638fced26def1b","tarball":"https://registry.npmjs.org/@material/slider/-/slider-14.0.0-canary.3e20c1de8.0.tgz","fileCount":37,"integrity":"sha512-JgIVEaHnSNMMAS8cJWrhemzxe8zteUJVb5RJMTnSXVzEU6kGOTK/HznFfNrOTXCATE/QuUCMNdBIT12snnlLcw==","signatures":[{"sig":"MEQCIFySSA3ZZuYsmm2DIUcTMz8/hgwVvtKzJcH8NvRiPm6eAiAa5j9J2Ha9E//WLrELmtsIGGwZD3HBKL1wajHEWJ+woA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":896349,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh8BfsCRA9TVsSAnZWagAATpkP/3F3A04rr61O4jprDxMG\nabQjpYDX9TYir2yZ5cK+P0aDxQAEyEHcpE6ZnTbwE7fs02T59Ma8+G3T9nE4\nxcdz5F4new1I7tI4NLmBxseTqAvmFC+rCvaWzPP3TtTVDBz5mjuansudm5/M\nIlFlxzYr5zI+4+DYzO5cwZ5AOl+PRCmr3TR8ckKhjehJH5YTjVNeH47Qr0Dt\nt0MPZqoZ5hq+lbcL3I78laYNcO4MSL2yZg61coE6vnSbquCYznhDYHtD+40a\nr3wauD0E/GmM87L9H3EjJG8He8q9RxSUoR/HDu9wuca9PbNB4poiiwBuXfB6\nxv6hHeZmNDf35wIKWN5WK66iUAKUbSeO8SiIq5vdwWt8tYJC6DM92MbskQid\nmE486WdM/bKyRnNmIUqC8AWBQQPESD7jywpL84ygRKEc5fcJ5JyqhMoNOoNp\n+hJ4d2XgRp2dkzMGnlRRuNAejs3CivO7PPywMKp913ArJ6mT0NZmhhOO9HdL\nOHrUeBElt980B7FQyjmvlM4m/ewe9nf7Mdc3vSWHcLgzfxPkBYfXpbGKd135\nXVis6tiLecYFvUm3xLfOIaTS5LtA7b55xgKMqeP9Gu6LIQ368kFNxsWn7uGR\ncCK51cnX2TQEL1kGkDOi52xPeVyh/C4Ct0HFkw84y6yOZnPQQkm+cdQC1BZw\ng9yu\r\n=5WH6\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"29fe61f3aef5a85c7a462638b6c2b809a3be57c3","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.18.3+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.18.3","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.3e20c1de8.0","@material/rtl":"14.0.0-canary.3e20c1de8.0","@material/base":"14.0.0-canary.3e20c1de8.0","@material/theme":"14.0.0-canary.3e20c1de8.0","@material/ripple":"14.0.0-canary.3e20c1de8.0","@material/animation":"14.0.0-canary.3e20c1de8.0","@material/elevation":"14.0.0-canary.3e20c1de8.0","@material/typography":"14.0.0-canary.3e20c1de8.0","@material/feature-targeting":"14.0.0-canary.3e20c1de8.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_14.0.0-canary.3e20c1de8.0_1643124716185_0.7180470688715863","host":"s3://npm-registry-packages"}},"14.0.0-canary.9f9d928b2.0":{"name":"@material/slider","version":"14.0.0-canary.9f9d928b2.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@14.0.0-canary.9f9d928b2.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"7f5d0f049e296145f732d5292f67d434a9c2eddd","tarball":"https://registry.npmjs.org/@material/slider/-/slider-14.0.0-canary.9f9d928b2.0.tgz","fileCount":37,"integrity":"sha512-l/2PluEjHMnPyA9ADE3BEQWUl+3h6I8Pk2WC5ae+RVM1Ghoueh8LcWVXxUdrXWHYGAoPA7G7QQHLDRkf7Vgwkw==","signatures":[{"sig":"MEUCIQCVLV9BnNvppTHI/C9ekJ9V8iD3wbhL0Hpd2U8biWc9pQIgf5jdbLVI6C+wTipy6jrecsa2GIVUxmPhevRg+OPT9zY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":896349,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh8uC6CRA9TVsSAnZWagAAepUQAJBo/4+Focv+TKSTpTyk\n0O5Z0hdzJX82F51qBDlx2SLokf7vf8z1Y7XQeanz07mLV7Mo2nluoCugvdUe\np8U6xgSF7SZTyVCURMbGAkDMRU71DIGvMzNom+t98GxlvKTcSZKPjC4BLn5L\n3g3JJ4+4sWqiwGysz4hd5K63w0GZ0/lXmLW7eR90wMOOhA3VwLGbV57raXgG\n2rCfGCA7yh1GonTDHWijwwO8uuFC/DIw1SZBEXUUunHTl250IlEPRyErCuF4\n2Im7gbTc4MaxtcAKaMKpcPjY2/BQQK5+uSiO5tzEh47ydnIJouEC5q9xwEZe\nefMA5sldKsqvQICNWxV8pJ04Fs3GbCGo4pVOyFRpbC4RXX3j7RFoR1f1Jejo\nCbvPTiwnZlU2BnYEfgt76GqMmVPKSkYDLf+gh02ddCgxK9CjD/NfnIJJnYDz\nstzpEfIi/o2TD8bmQ00imrAhGM3dg32Y1RB5BWVjrckAvIIgwYppC08RECdy\njDNazPWhINX8eas+KoRfM78x7yfOvYQ5zVnigckxSB+nQMvmJjq0ARvijQHS\naPIz6E4uk55xKqqzA0WifWL+uz7gyrSQuczR7BeMb3QsQ78dNgMrNNxNmLMZ\nvsIl4ZQWhW5tXT569QqeofCswcd6r62Tnzr3Sbt0/Jve74pevwbokoPk+J8z\nxCz4\r\n=8qUW\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"2983c7f2f01e1912809d6004e47ff0c7c27de38b","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.18.3+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.18.3","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.9f9d928b2.0","@material/rtl":"14.0.0-canary.9f9d928b2.0","@material/base":"14.0.0-canary.9f9d928b2.0","@material/theme":"14.0.0-canary.9f9d928b2.0","@material/ripple":"14.0.0-canary.9f9d928b2.0","@material/animation":"14.0.0-canary.9f9d928b2.0","@material/elevation":"14.0.0-canary.9f9d928b2.0","@material/typography":"14.0.0-canary.9f9d928b2.0","@material/feature-targeting":"14.0.0-canary.9f9d928b2.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_14.0.0-canary.9f9d928b2.0_1643307194175_0.20773247360145186","host":"s3://npm-registry-packages"}},"14.0.0-canary.a2bcb065c.0":{"name":"@material/slider","version":"14.0.0-canary.a2bcb065c.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@14.0.0-canary.a2bcb065c.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"167ddf5f0d840bfeaefb7dba7d4ffd723cc6e512","tarball":"https://registry.npmjs.org/@material/slider/-/slider-14.0.0-canary.a2bcb065c.0.tgz","fileCount":37,"integrity":"sha512-240TA5XG0tmAs+bH7s082cWcTKZabfczgx61oiSnG3msJi+712oPEaniSbN1cFYcxLP5syf1Um5rl179r3Rvbw==","signatures":[{"sig":"MEQCIHFdWVpkviz633yW4LRFcuj38jZSKFKrNTvoBtFWGFd6AiBkkSnUa73xksbbrYbRS/hB4AqwH3+payrK2g+YoF/Ljg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":896349,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh9EXiCRA9TVsSAnZWagAA244QAKOsIay+nrV0ND6MtXOr\nw2TV2CZc9jOIkDEVXk/2Bp5pNSwzsrQzT+/H+auKYHODq9mOcICnsM/WWQFg\nkg270zGC909ah1nxvlciHXdWcTuQ8wmKHYLz0QCOUPVMIQ05BGNyEjK6afwZ\n7ZXD/k7+Vl7GqWTpfwV9wenJV/4Rj/SPUSucvUAGnxhejscRRQQP1wlU/ART\njupYYD3D/GwvtpyhvybIxH78dvWAfUnGIuCgHU0FRvcRi1pw3551Wlq9idzo\n7mgDt2ORCdtcYGxDl1Kfozv18lfXT8Xl2LP17vgy8zealAxJep/7n51yNpf3\nT5KbLlp2Y6oK5RKzrqhwWFmnbopkhbbN8B4xfFHuFSd/LOEFqLVvfWdWqSqy\n7bJzMEpoHDmXJsCGclamlEr4Y+qFB6JsFufRYsclZ/YgRG4NLf7MZt/+pNvz\n8CHSxtINWHVlHgJFdCQS16M0x87wM5F9JX3nXtE6WYmMFfcaTP8xut0Qspkv\nPZy6Zfuoxk5qbnmwFA1fBx+qHeZu4QP882ZEnXUjo0K4gxRhb1Dvf7AtEjwT\nH3JUjugjBIX3lmMhh9S+HCKBEacnb/CwasqUTD8EGt0VbxJmrF5ISlE0zMyx\nX/ioMmwQms39xIe85brTk3Qh45THKdI0gAMoyaT1ix6CTZCoS0KH/FfR4qlh\n009M\r\n=6n8d\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"7f175ca37545bf0bacc2b94f7a18a2a3fbd5eec5","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.18.3+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.18.3","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.a2bcb065c.0","@material/rtl":"14.0.0-canary.a2bcb065c.0","@material/base":"14.0.0-canary.a2bcb065c.0","@material/theme":"14.0.0-canary.a2bcb065c.0","@material/ripple":"14.0.0-canary.a2bcb065c.0","@material/animation":"14.0.0-canary.a2bcb065c.0","@material/elevation":"14.0.0-canary.a2bcb065c.0","@material/typography":"14.0.0-canary.a2bcb065c.0","@material/feature-targeting":"14.0.0-canary.a2bcb065c.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_14.0.0-canary.a2bcb065c.0_1643398625987_0.6918985556942476","host":"s3://npm-registry-packages"}},"14.0.0-canary.4e66fb2e1.0":{"name":"@material/slider","version":"14.0.0-canary.4e66fb2e1.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@14.0.0-canary.4e66fb2e1.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"aa020837b3db4d12650d20c0b782b58b8769c98a","tarball":"https://registry.npmjs.org/@material/slider/-/slider-14.0.0-canary.4e66fb2e1.0.tgz","fileCount":37,"integrity":"sha512-CpIkNd0xXVE2JRHSZxr5c+Fhsm4BG1VN7zAb5xfiHvP9zkRk2U5PwReh51BSYXGyp/NAHUR8hN2qewc7Ew4RNw==","signatures":[{"sig":"MEYCIQCOklm1DmNRtBSOp8z2UIigJ6ef2VchZGqzSK9v0rggiwIhALDhaIrYWAYqMABUTROJOZOVK4vX4Tteo2kRmGp/G/Ww","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":896349,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh9EboCRA9TVsSAnZWagAAwCYP/1AGQRPAzx6W347G/28O\nuCytbAsJmFvL/18TBNqSmOiAqhPW9jZ7cGSSu/63SFgrmBgi2Zlal84j6eub\n2ajvCges19d244qNIsaatXnt13/RKYDUpqTBjP6JhztyZm9mVsx8S+U8+ONr\nmcRvusKmpr1Wsw3CWqJOsrQR8Ci0ngu+mI8tIvAZviwDNWVTeSbDkfGMfxFC\n3k74pv7aftFhxxD/D/uTZvV6S6ptUX4arKQGCy88hdBhN9bp6BQ4O380tBwI\nra4h8c/sv2R5wrVmh6+WdDBAAkSYecvJIQE6MxbdhzoU1GZMjXmPDgaPpW0s\n3lpUYf3Uiv+vYNvvAqz5+Jb3ldz12Qmk1MyNecI5WcQlVNRAHtiNoMydt1Ip\n36EFzvJCKSBU5r+KorhYg5iq7rUZYAj01yOQNS8UiTWWk7SO4Lxh/fESUiS9\nipzfHXdAKsNfeMbrVNF2xxdtgyiUL2aQ7lteieDqRXukYIfBHEaeS2xExQNr\nHKwZOVOSaJp9NoQ0hZBoAvoBr1XfLthDzF0BPxqYuqZ1C04v/QIG9zZRqXRT\nN18xPd1aPVuJFaclkfKojkS5FZkGyji5Slq4e/xuN0jYGOn0WgO/duZiOJnG\njNEoSO/uh+7QYc8NSrlsZj5NrO6gWygdxArt10sOka3FTTkQLv+ueGCtOg4X\nTbsV\r\n=ltgR\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"edee6a64c210815507bd8460fea3df2591cf0d65","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.18.3+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.18.3","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.4e66fb2e1.0","@material/rtl":"14.0.0-canary.4e66fb2e1.0","@material/base":"14.0.0-canary.4e66fb2e1.0","@material/theme":"14.0.0-canary.4e66fb2e1.0","@material/ripple":"14.0.0-canary.4e66fb2e1.0","@material/animation":"14.0.0-canary.4e66fb2e1.0","@material/elevation":"14.0.0-canary.4e66fb2e1.0","@material/typography":"14.0.0-canary.4e66fb2e1.0","@material/feature-targeting":"14.0.0-canary.4e66fb2e1.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_14.0.0-canary.4e66fb2e1.0_1643398888323_0.5885891170232249","host":"s3://npm-registry-packages"}},"14.0.0-canary.9736ddce9.0":{"name":"@material/slider","version":"14.0.0-canary.9736ddce9.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@14.0.0-canary.9736ddce9.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"035ed6d2961dbb138a814a88699b57cf26c9ab21","tarball":"https://registry.npmjs.org/@material/slider/-/slider-14.0.0-canary.9736ddce9.0.tgz","fileCount":37,"integrity":"sha512-ysv9zpmamcgjNpuAOqjNvS1wm+ZrlOKiskR5KR6UQ7W5l0YOh4AARu2/fa5apEi6PDdBAz1yq0ot/JN6MoizHQ==","signatures":[{"sig":"MEYCIQCu3DfEH8rjlBPVW8PoxRyODC2rKbPvwEBtXndCrl55MAIhALLn33K4dSnL6sa4jd6PE6D0hy8riV/vSd+yaC7NT4vk","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":896349,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh9Q3DCRA9TVsSAnZWagAAQzEP/jpDjJTaTlQcsCXueLHY\nKGv5IsJMTdl2950X3gdDxssTSMwW856WDBN2/uOhzCdKRklUfxDKdhpKhH3p\n2dnRAAExmr50cLodJMkHwN1av/hXRIzmjau0KcTd32ScJ4BvCM/yoMCeFugt\nomnDhmfmmosfuShZwyNy29bIvF/05ZrSN/gzTQAdTEqpaO6nOE2CkL17d3Tq\nayyTZG8DugJ1rfU/+46Sok20dBS9GLz+k+gQZtnVigNN8itLHSjN0c5G/Bvd\nzZQEEGRcbEgjIh9rCUwsivuYtgcSncQmSOPG+5zEtCd0TakQV8RZc9C88RKA\n3TkIcyZaEWPLJiqvqVryVsDwqCeUmdJxVfyiQSXUgqetgGKf5rK7T0kPpDhZ\nnfFTkFlIvBWWnKUpKyMYfW8LoBbITqMcJ0IjdDECRJg4RJmfHYG2T1uNEq0A\nXIptkqSxL6b6f8QwrPr5lcTE7U8YFdtKGkPh2rjPU2BoTKJuJeIilbCJzcTA\n7lJbZcoJ4wibGq7zZfyEusAfoahXbVGperGRsJ7+GQFWICqLJ6fZcXkgJBtG\npQHXV0OA8U6TdIuqj2kdQKCFxLL9sjvHfMAoJmPq78nsXXcnlRWqFYntQa2A\niRfO0QKo1vANQ45Xjt0x39hGEwqeWvzO995r5xx00KO0nyGrqvr/b3r0GJBy\nSBoN\r\n=P/wU\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"d76de36ce796a981bf5e48388104bdb581d17529","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.18.3+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.18.3","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.9736ddce9.0","@material/rtl":"14.0.0-canary.9736ddce9.0","@material/base":"14.0.0-canary.9736ddce9.0","@material/theme":"14.0.0-canary.9736ddce9.0","@material/ripple":"14.0.0-canary.9736ddce9.0","@material/animation":"14.0.0-canary.9736ddce9.0","@material/elevation":"14.0.0-canary.9736ddce9.0","@material/typography":"14.0.0-canary.9736ddce9.0","@material/feature-targeting":"14.0.0-canary.9736ddce9.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_14.0.0-canary.9736ddce9.0_1643449795424_0.17757248455156227","host":"s3://npm-registry-packages"}},"14.0.0-canary.cc4ed13cc.0":{"name":"@material/slider","version":"14.0.0-canary.cc4ed13cc.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@14.0.0-canary.cc4ed13cc.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"9d9b2407fce301fb261980158b91b6fd5c08844a","tarball":"https://registry.npmjs.org/@material/slider/-/slider-14.0.0-canary.cc4ed13cc.0.tgz","fileCount":37,"integrity":"sha512-jncLreHOZJrf0wFf5wLrJLNvnhsRYqaMOZpnCV/kA6irBnZMzOEGGINE0JcdtQCko3N9G1ny4oQS84sANd6mAw==","signatures":[{"sig":"MEUCIBwI0Eh8vVzpqsiuIBA1JyPrdcPJ6IYJ0BL1PFyLBaV9AiEA1hHx2LSZRw3ObwLQi42T0ML+TLZPl1tjRUtVOdoiCPo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":897492,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh/W71CRA9TVsSAnZWagAAgA4P/jl7T2yieo6QNtyGyP+o\nt10H84ZtRIpHC2FyeFft7saBgIIh91LKjaEktTaBGZSbbEGoLuvcPei9Lr/E\n9Cybmq2mk83TWKQGjG/2wcPQCS8krCcIbAm6Q9QrdFpNyDU14HeMcXXTlDC4\nkWCboazznOUNllMg2NWWScbhkbAXXg/Un+E8I94RBYvdQAYJ6al6Jd2NbDGC\nlMPz6rW8KIEY5640hq+dg5ki7e9J+gDdYTVcCAor6p0eEUncLHJUNdFnpfIT\n9veziH6HTxNmRrbU3EsyGqoZMM/GLZUaSjHko1WWqs1KwV72Ljqfft7uXBpH\n6fBT+TsKE537ESmqeHZnwoKplHuUDrXCg9OyddH0YIPlHgurvZle3ubZaNFH\nGqVOZgvfygt1zQRxHnGDE6TIUHw6cC54444/WkRv40sHru7d8a/YNTb/jYsa\n1cPzPo1W182+WefBYFYSlnlcBxJRTIw5MuoXZ5cKGv/MUCBwAbTptfSY4+hc\nEOQWjICbO+r3AW8wz6dOWSFvsJIuz/YywDh0XBHqvKSPd94E67QywNkTHVxy\nHfUohdMRu4ldkLV0taO8Dz98AzwVrzX6WMwFUM0hQGTy6D6yvjYUy+dBP0DK\nJkne7Gyjxt7bcs7hxIUbXB+MiQ0wcZ/Lov35gJBBOB02JSb2zR+bwSZ8OVJL\n5zaX\r\n=lcRS\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"15c769412cb0230363c372a7d45bc6bc10eff8e7","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.18.3+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.18.3","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.cc4ed13cc.0","@material/rtl":"14.0.0-canary.cc4ed13cc.0","@material/base":"14.0.0-canary.cc4ed13cc.0","@material/theme":"14.0.0-canary.cc4ed13cc.0","@material/ripple":"14.0.0-canary.cc4ed13cc.0","@material/animation":"14.0.0-canary.cc4ed13cc.0","@material/elevation":"14.0.0-canary.cc4ed13cc.0","@material/typography":"14.0.0-canary.cc4ed13cc.0","@material/feature-targeting":"14.0.0-canary.cc4ed13cc.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_14.0.0-canary.cc4ed13cc.0_1643998965452_0.6611960762019822","host":"s3://npm-registry-packages"}},"14.0.0-canary.dcba26fe1.0":{"name":"@material/slider","version":"14.0.0-canary.dcba26fe1.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@14.0.0-canary.dcba26fe1.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"0cc213aae1e89c31528bdacf153d31580d87efce","tarball":"https://registry.npmjs.org/@material/slider/-/slider-14.0.0-canary.dcba26fe1.0.tgz","fileCount":37,"integrity":"sha512-nKE9IH4T5mIukMk2VVtwJYxK/Vgl+LVbBCu7w/xn5ke/2wU7DbWaidVxqAhI9a74IU2tgW+JzfpJmcV3TYXEyg==","signatures":[{"sig":"MEYCIQD5xgIWodhOz4zMCDnfXWT2VzDt9wxT8dpbySPW9hGIXAIhAN7oYFDCSO9OP5Q3cJ2xMeC6aDdWCzd+8rlyx9BMVzo6","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":897492,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh/aE5CRA9TVsSAnZWagAA3EIP/3R41mOkMyseIQbJ5c5F\nwa2CYmFrXP3mNz/3Hat4F91TSipJiPVWO8RWO9hn7diRW++dFTJ80LMAvnxL\nn7oDokOaEuIgk6Elc+3EYcnUkqK1GR8/wvM73NkRRz7R07UrlOFTN57P66Bn\nKamRogmmoq2x+DlR9zrck8Axy9Hbsz+JyRTDcQKPCXyrSmrAoC0nz9Lyj4qU\nmiqMHKmt9t1TtzSeC8DkQLXWdQgf9wWVHPb1KkAV5XSFbXKTE61jQpedCS0m\nMUjMHkMkk66Hslbm4usuZBI7T+eOgxIPku+GSkkPTVq1hRgDjbJXkqAloqNj\nA5brSVnFQmOb/GiDZ1UeXCWRnZtAyhtfegPnJ2vO6rqKfPY1UeVUJfi9Ke+4\nfKwas0ABgf4Fl2CE15EjkMZvIBesd8M3SQ01XBCRFb/ShFELY68Fzv6WMVqQ\nmfMpMaUbhfu/KPRCi3TNeFyctW7lDiALngbSWS9MgcVrb4DRa5Hxv7yFQYCP\npfeKNOk4WgNPaZczdoJi0wgA1649IrkOSULaYhOWW3QZJO9nXopwk9EblXRH\nDsjZJ8D2CNmjKVbgNODWmwgmiyyDEK8DnqSN//hJDaDWkfrNGGzbj6On7pEy\nWuOZa1nC5jbaQTLIJpTBhUmvVw7K3FvoHbzaeXDlBsv8BlAMfqOJXwajVt+M\nSRBv\r\n=TlbA\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"ced7dd56d5d3b017288f0575d6e773c03f01d0ef","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.18.3+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.18.3","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.dcba26fe1.0","@material/rtl":"14.0.0-canary.dcba26fe1.0","@material/base":"14.0.0-canary.dcba26fe1.0","@material/theme":"14.0.0-canary.dcba26fe1.0","@material/ripple":"14.0.0-canary.dcba26fe1.0","@material/animation":"14.0.0-canary.dcba26fe1.0","@material/elevation":"14.0.0-canary.dcba26fe1.0","@material/typography":"14.0.0-canary.dcba26fe1.0","@material/feature-targeting":"14.0.0-canary.dcba26fe1.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_14.0.0-canary.dcba26fe1.0_1644011833456_0.629607704124886","host":"s3://npm-registry-packages"}},"14.0.0-canary.ec54d9046.0":{"name":"@material/slider","version":"14.0.0-canary.ec54d9046.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@14.0.0-canary.ec54d9046.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"b6782b56ba4fd379e875996a09065c70c7571659","tarball":"https://registry.npmjs.org/@material/slider/-/slider-14.0.0-canary.ec54d9046.0.tgz","fileCount":37,"integrity":"sha512-RIl6ymfp9rHLMpMMAM+36OE5+e7uXYNTn/KymWHOEK6AWIPEtTmdlNxr7yJbmGUZLlgKAbXiZR/fcj5sr35L4Q==","signatures":[{"sig":"MEUCIQDdP21sbaRdq/yo409/XV080R8teo9LJXd1ki3kahux1gIgQ1nQANJBGG36adHbybg41ateh+zuuayQyioF2zfSN30=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":902901,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJiAT7fCRA9TVsSAnZWagAA8IcP/37fl6wAlUMJv7MJbeSz\n6dZH1gxaoYW4u2+dZ06w4D93N0f1w+NFM4ORpxEHNuQR3v6nf1v7jrdA/x6Y\nRNcb1OskwFFhfdjSYjgslysez3zUtbkfg+ZVP505KbdIZKmji/e8RXyOjNKf\nS2kC8U6LHwdfjfHoG6z07tGoeClHvCY6cz1dhXikL036LdShb3zXryKw2bEt\nodRitF6T+IE4GaItAJl5jrCsBKpWr86hGeN+v5e+LYQHi4mecm/xfYGW+tUg\nB+koCLnTcvyAlfLuH0mBUtFSxl3ai4bu/hOnF8FJUWLW6DnXx9/97wJW3IbA\nM+CEYsDzRt2vRHE0OEKxj06mEoXT6pbsIr9y1DSn9kt0RBpXo35n7PZ4nlvM\nyE2yUZx6gClzbwLJj52U7sgnpT5XBZfeogfTBIV/pXkHKuORyy4WpmdNXjRU\nmtK10qXsMD5tafkKy9PXsKBQuBwHPiAdduvta6V9hNR87HyLczk4W44jNtUp\nxyFJZL76GU/b/qrWoF+8iT7S3MhfGEmG/WdXcFs88aDKKbCytNPboZ93f/8w\np/EnF2q4sBnLoWpWNjUK7bdh5HTb+6bsFfjqRY8dNcmL20UdCyySK6RW/Zop\n4GISA2o+fgj46dwV53CL1NuQWR3FJ9UeGANCIJ2o7MZyNFUel2fXtyeYdBz6\n0dCG\r\n=XDuZ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"68f6bb151595e8790d7092842d6c137ef93ed770","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.18.3+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.18.3","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.ec54d9046.0","@material/rtl":"14.0.0-canary.ec54d9046.0","@material/base":"14.0.0-canary.ec54d9046.0","@material/theme":"14.0.0-canary.ec54d9046.0","@material/ripple":"14.0.0-canary.ec54d9046.0","@material/animation":"14.0.0-canary.ec54d9046.0","@material/elevation":"14.0.0-canary.ec54d9046.0","@material/typography":"14.0.0-canary.ec54d9046.0","@material/feature-targeting":"14.0.0-canary.ec54d9046.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_14.0.0-canary.ec54d9046.0_1644248798746_0.6912424597707061","host":"s3://npm-registry-packages"}},"14.0.0-canary.ea9b5b463.0":{"name":"@material/slider","version":"14.0.0-canary.ea9b5b463.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@14.0.0-canary.ea9b5b463.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"f3ef94519fdb93d4911ad22c36b26f3dae9689a1","tarball":"https://registry.npmjs.org/@material/slider/-/slider-14.0.0-canary.ea9b5b463.0.tgz","fileCount":37,"integrity":"sha512-C/SuO8gMfYHJY9BE2y6Dey3KUOij9UxKXLbxfrxITdU83fTOxcpzfDODnHWey7Ln1F+jlAKsBw2bE/NuJYdMaw==","signatures":[{"sig":"MEUCIQCgwsnI9dzjYaASa3etY1/JfyPPjc1aGc7tOCIdKDXJ6gIgK3WWOlAqWJCCtGDn3aLhzs2J9pi3ES4lZbMDXj85bAM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":902901,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJiA/+nCRA9TVsSAnZWagAAqtkP+wRVrXaBXU10YjT2viJN\nmMb612SbYFys89LTvpu2HqIEd27G+zwN1E2QC9vOWVLBe6Q4IRmIHJaY2PSR\nxkEGSrJfwHNke1seld5UoTXqcbKcppht2nAQj9e7KNu7fSq0WFv/YPnzFqif\n+8kz1j/3aIJX4wZo4sNas2f/P7Hhbau/PSlXPeveJb7SD3IVI5Y7u9jLKv+S\nBxuOLGxblLqONNjiFlFxHRnZ1D+ChKA+X49DKohxDGJQ3NOmLv8IarQBOgYU\nMRhhwvBF3wjLRqHQ3xvbIeQl6X7xEMQP00zLWT+mVIlIKryIjjseXFmzSPiO\nhtWGVsiZrNKGNk/NV1Vzn8EuTO+PK5oEKHt86RWszYO+PpmWaakAseC540tk\nxillNTj8bDZ0LnOMKF1OT7mKluWwJF6ZHuHcj6NG9X+NabKQIwabJZRqbnxx\n7B29Z/UgB5DAf1FoXstYJPcyfBtL+EcXe4wB2gh8CGjO6KCpBcSxEuzl/o2c\nlFye+bbR/fgmf+ux/XC7p2rOuUF94xx+8K7+VTCakeRlLjDGiLgPGpmX0tQ5\nzsdKxh0xj1tUrnsSH3svKnJZwoB1Nmddu7Zoyh+pmXt02sYLI/ss8ZuJr5Re\npcULv1mAQR/BFx7Umw+alTdn4PBNiftmGTOEG+KZa6CGKrd/DurNzkrKT/j8\nUiR/\r\n=3pRv\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"ee827dceb9fd1c47516461b8ddc28b66702f2c04","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.18.3+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.18.3","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.ea9b5b463.0","@material/rtl":"14.0.0-canary.ea9b5b463.0","@material/base":"14.0.0-canary.ea9b5b463.0","@material/theme":"14.0.0-canary.ea9b5b463.0","@material/ripple":"14.0.0-canary.ea9b5b463.0","@material/animation":"14.0.0-canary.ea9b5b463.0","@material/elevation":"14.0.0-canary.ea9b5b463.0","@material/typography":"14.0.0-canary.ea9b5b463.0","@material/feature-targeting":"14.0.0-canary.ea9b5b463.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_14.0.0-canary.ea9b5b463.0_1644429223071_0.05849850048261329","host":"s3://npm-registry-packages"}},"14.0.0-canary.96ea061c1.0":{"name":"@material/slider","version":"14.0.0-canary.96ea061c1.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@14.0.0-canary.96ea061c1.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"84c0e2d1af0b1a3402ed37aeb9a3026033066cda","tarball":"https://registry.npmjs.org/@material/slider/-/slider-14.0.0-canary.96ea061c1.0.tgz","fileCount":37,"integrity":"sha512-nWlA2cj8dhVpe++WRALGyQ7k/AuWpucPLXqmpufEbPtoHieXguMggnctJxDMT8g6bKHYjB5l0hz8pRYbdo/qtg==","signatures":[{"sig":"MEUCIAh92vSH5QTkGn6gzLSCmx8Mj2Hpb5AIEjcnT/LZ7tNnAiEA0pETWwsuobam5S57djqd0eow0VlnyzZmzWVflEPQ9r4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":902901,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJiBA8WCRA9TVsSAnZWagAADWsP/0g9zrKTa4ElfKwIoteM\nP4J9bDaUw1+wdLSJeW76Lel2tVsPvUMwSPn5+rvuM70+KxetqSbz/szD1UBE\nsu4pNIOUnDWmaAJw2hv22eM0IfD9BfSpSzrg+vcV3ZRBF0oXEKdCKdiAJHgb\nMk9TPMlBLETTgrHqGSoP0LtHMi9rXYE+mprFAIXeT7gKDf6kEMUG6xGJU6xZ\n8yIsW2V3V60mj/fHtRs57FnQfUcED00N809l/+HsBtcgNdkWLpmIKQa6hqRk\nNEH4039w/A/QBK/skQELGxOMh7+uuYF24IhhBowvALaXcrt/FNl66hW5HHVu\nmXOF7e8zYJuGC065+uUPSpprJ0BZnrzQTstF4sPBFgmMQtdS31nkcvZ3Ko89\n5z8ncy7MV2PL/NGuPULeD/G6XUVTdu4Y/Y1H1wTKWJN+LxwuaWICB88oHMrg\nk7zccB3Ey/bq7n+mvIF5t2gDig/sMVRxAOz9AcVts2CaIyHOcFneBwe5ZnrA\nTUjErynXmEOvbPhjn9SvrFKvoQG33xkzmSlScAsUqgs2yB/+ha1j60nty9fq\nYABqdrNQY+M7uhI6Yx9WL1aNiXSM9wMDVBWwQFfZl+1HLPIGOzDgzuiO1R5a\nR/xCM+QnBdV06K4YzmgnUi9YkFKmfmvIbiEdCknjLhBq1ROtzN0NyWNi/IQ1\nZJ9I\r\n=XNCa\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"b1a410c21f8ac6405b364e437b5af7eec06a2020","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.18.3+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.18.3","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.96ea061c1.0","@material/rtl":"14.0.0-canary.96ea061c1.0","@material/base":"14.0.0-canary.96ea061c1.0","@material/theme":"14.0.0-canary.96ea061c1.0","@material/ripple":"14.0.0-canary.96ea061c1.0","@material/animation":"14.0.0-canary.96ea061c1.0","@material/elevation":"14.0.0-canary.96ea061c1.0","@material/typography":"14.0.0-canary.96ea061c1.0","@material/feature-targeting":"14.0.0-canary.96ea061c1.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_14.0.0-canary.96ea061c1.0_1644433174001_0.8045809510570647","host":"s3://npm-registry-packages"}},"14.0.0-canary.e00181e59.0":{"name":"@material/slider","version":"14.0.0-canary.e00181e59.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@14.0.0-canary.e00181e59.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"724cd0dc9dd7078e2e48c2833e01d5fa26cfc38d","tarball":"https://registry.npmjs.org/@material/slider/-/slider-14.0.0-canary.e00181e59.0.tgz","fileCount":37,"integrity":"sha512-dliI/97YE6M/J26RrcIwpdk1UNXxyk/qd32F6DG/NBlle/QrL3U3He7MMGVO8zX5ACfBrShivQR+sts8IYQMPQ==","signatures":[{"sig":"MEYCIQD2piZtdt7p5h56WgzL3HwY4ymo6bcdqw3jYyQiyv+4ngIhALMabR78NOFNsyMrqKmVBS9y+vv/1pdAq8QrweVDQ9bZ","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":902901,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJiBXBKCRA9TVsSAnZWagAANVIP/1sA7RGD8pwsO/6BCUaq\n4MIkxdfWIRXM1M8XHnxqqYf6nw8edzn55yhShIp/nmo+Wwj82958z5pco/gv\nbaKzir/re0mYKUfJ//5eJGGmIUwapHsojrXUKEPnXCpJO4zwZcB765noYHDA\n2UvwfiTNo3OpwXeaYfyc7ElTxGul+qRIsq1QvA9/sfKCT47/XrConL4A6+Ug\nYmozubBRJipUMVQJmfVH+1UkqgnsNd1VTkKHjTcSJAam1ry62RyD5b7EAVNR\nosumGIyaB9F27tP36f1H/i4tQds1rTisaFb48jyKW4mlL9lQekjwsEG4KV/C\nS9H3teTBUCJshXq13M3D3fN5GoYhIrji7/vly/ACX2FJH4BzNUP8aYndicKo\ndGg1viEhH06ppSSfS3a4BU3lnCZaRzICR28iSbHbb7wNWPGef5zfSFskL30W\n6j+mirSmFSHq8zvvTyqNQ9YVD5xujp84bYYtqCrDriHXntU1iXK0dZhyzH6C\nfScGvtP9C8Jy4LhqyDgJqVdRTtCKiEbPCv8Ca7FYhPDtLVVVo2GOXwqCkPJH\nKeWD1JNTQ3Nk6KOaIFRdeiDDN4UUOgHl3tbeZpds4p8+AMVehHPWrCl1tIwQ\nxyMeuwyDUopmOmIHKiEAaJMQBLc5qizDsZ+pXQuLFgTE2M5g/aJIcCxWpsjW\nGRGo\r\n=oZNv\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"7e9ce072e9ec1ce5820d347b59d99209542a2bfa","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.19.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.19.0","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.e00181e59.0","@material/rtl":"14.0.0-canary.e00181e59.0","@material/base":"14.0.0-canary.e00181e59.0","@material/theme":"14.0.0-canary.e00181e59.0","@material/ripple":"14.0.0-canary.e00181e59.0","@material/animation":"14.0.0-canary.e00181e59.0","@material/elevation":"14.0.0-canary.e00181e59.0","@material/typography":"14.0.0-canary.e00181e59.0","@material/feature-targeting":"14.0.0-canary.e00181e59.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_14.0.0-canary.e00181e59.0_1644523594126_0.002685684246829023","host":"s3://npm-registry-packages"}},"14.0.0-canary.037285f9b.0":{"name":"@material/slider","version":"14.0.0-canary.037285f9b.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@14.0.0-canary.037285f9b.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"a28c6459cf28ec05317bfe2409ef493f66f222e2","tarball":"https://registry.npmjs.org/@material/slider/-/slider-14.0.0-canary.037285f9b.0.tgz","fileCount":37,"integrity":"sha512-KyaJbQBY3JKI3ASWO4tl2L+Ydfk1UIsscSOkZuDoPEV/JAgcQeYmbYriOLG+YCOHbS5HTgUHTqAC1HYwUnYzMQ==","signatures":[{"sig":"MEUCIQC1trbu5c9qyTixCr40Amn5K4242KgHL1fFRmm4CmU5oQIgJ3+6pLEmooC08Ge9Kj5sgbJ1i8fn6bUpUwtc6R+6ThA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":902901,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJiBqsLCRA9TVsSAnZWagAAEvEP/imFzxfv+d6JptUZH3wA\nBqCaiILrrOQXoLibj8+In7k4jbIEkDhlp8OHrQnw0r/TYY0bOSxdoZ8239nr\nJswdVZpNXzO27YnYZOMUgN2iMogsa/88dZDS7vE0QXRvg6JtJKx5FBPMkxTZ\nUO48Ba8frZEbw+rBkJ5UgV/Lwbp/I2u0eL6/l8nQqY0nzSetotRfm+0/aFKk\n0y4ZzyIXsqOg92NLVTzMWrxrkU2Bg1w7tvhn3FLsbX7v4StQav7FVy8nAtrm\n6xC49/q1Iqdv7DjitMCVRyM1gGYKXkEzr0awqAcIs6yrsTvm5do1EqJpC6Jr\nHOUyl+htb0UqGh8KUy271xokxmKjR/ee3YfzzDv1qQ+7CqtsVUZFN2ymWLaY\npDxApRw0Y1GESkv6XrV7n8ea8JSz4veB5dWJ7X8ptrZzXFz0f7N89iQrn72W\n0yvSnj4+FlXrySj7kaBpSb+C12qQvWXGqtP8mQnHGfDu2sXSDtHyzYU4089R\nc2XN9w2ceZFJpytiSMDmZ60ez19iNMuG3Nvvk4a6edOa0PraTgZbnTov6CWF\ngCUulNwaORvkeznowZoaUgmDNGdF64fivWGfF1MbRj8UoONHSx39NMJKcY8D\nulPKVbVRYJuaabo1KK0BWbRoXArOmHR/x98TYwj2qY1np+YaIsgZeiGlt3Ek\nTpBn\r\n=f2CB\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"a9bca201560da3f96e435e6e070baee148bcabe2","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.19.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.19.0","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.037285f9b.0","@material/rtl":"14.0.0-canary.037285f9b.0","@material/base":"14.0.0-canary.037285f9b.0","@material/theme":"14.0.0-canary.037285f9b.0","@material/ripple":"14.0.0-canary.037285f9b.0","@material/animation":"14.0.0-canary.037285f9b.0","@material/elevation":"14.0.0-canary.037285f9b.0","@material/typography":"14.0.0-canary.037285f9b.0","@material/feature-targeting":"14.0.0-canary.037285f9b.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_14.0.0-canary.037285f9b.0_1644604171487_0.37262798795547813","host":"s3://npm-registry-packages"}},"14.0.0-canary.1aaa68dda.0":{"name":"@material/slider","version":"14.0.0-canary.1aaa68dda.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@14.0.0-canary.1aaa68dda.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"ebe55db4be40476a61d375b65eb0f7357549c820","tarball":"https://registry.npmjs.org/@material/slider/-/slider-14.0.0-canary.1aaa68dda.0.tgz","fileCount":37,"integrity":"sha512-V15xGTESbXhxonZNvOBlVhHzcNSI2n48LIX1mpkJgq0fr/i821yJFouKj8XK2TTj6IAY/U5gjHq3jxe0dOlL1Q==","signatures":[{"sig":"MEUCIQC5nZTslsLze+SqItafYCXkvAaiu63CbybC1JIYh2VB1gIgRu2RHmZzBg7p7GwSQnlj6fqZU8Qt4CAUyGuykGOUhSA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":902901,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJiDVUsCRA9TVsSAnZWagAAR5kP/1m6XNLa9L5YEy91D+7u\n/sFijnb1pIN4CD9NTforjal8160gi0QNia0JyZ0W+HanJ1tE/cLm+RgggjUf\nD8fT9Mj1zPzY0LLXBHYgTFpQTSZ1Ylrf+Xzea7SIhLw3eb9Fz6RK0I7gmIu8\nMdH1nkMhjePW9l3sf8h3khDtPBjLEio5sw1AOm3eV1ay6UmDrHBksW7IOVHR\n5uS1NrcbIjKQrT7AHdAd482fBdc84fpUBdFnjRVwvONkUnimO64SOTJv94zj\nyPVSyE6lCEQ7pMjVIxcsDyYXBIqWuAaELE8mPQE1/2u3XdtxvWE0+t6DA1YD\nqmm0HdH+JET7nbADffsI5sPwopC4oRs7xs1vyaHYytAlTjT22L9H/12dvtGE\nlE4e1lppL9pA+hFZQUwBESXQg7xFVDF2fkrbE2vV4cr+DrbptlwobDvkwtK+\n6+sU4EttYFbLY9AS+4T9J5PuQzQvAdvQROJVKxxua5L2v/CE1w5Su6547bpZ\n36dMYrfjmpfOxwdJ93FZYgMBHtFVi36fgNM/mpYFKyvB5xDHw0CUYwrTNgE1\nEW7qF9aRAlpGoXCj4qa6TbmJ7uQkCCdTwhCswjJzP30FNA9+k0nQIVVixc0R\naDT7wKaJwvXmSpgPn5l4yKz7yvXR9arKBk0Ojy1IZUpwm5slmw0HagHT7hqX\ndP6Y\r\n=X/Yo\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"49eaedc3ce6f1f8db6a6929143c077e8f65694f4","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.19.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.19.0","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.1aaa68dda.0","@material/rtl":"14.0.0-canary.1aaa68dda.0","@material/base":"14.0.0-canary.1aaa68dda.0","@material/theme":"14.0.0-canary.1aaa68dda.0","@material/ripple":"14.0.0-canary.1aaa68dda.0","@material/animation":"14.0.0-canary.1aaa68dda.0","@material/elevation":"14.0.0-canary.1aaa68dda.0","@material/typography":"14.0.0-canary.1aaa68dda.0","@material/feature-targeting":"14.0.0-canary.1aaa68dda.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_14.0.0-canary.1aaa68dda.0_1645040940646_0.170100137931404","host":"s3://npm-registry-packages"}},"14.0.0-canary.ab4aba1af.0":{"name":"@material/slider","version":"14.0.0-canary.ab4aba1af.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@14.0.0-canary.ab4aba1af.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"dd1b07350bf3e2d74e514bf7eeb1c6d7d3cc592e","tarball":"https://registry.npmjs.org/@material/slider/-/slider-14.0.0-canary.ab4aba1af.0.tgz","fileCount":37,"integrity":"sha512-vN/YBIfRxIrwA4eyAso2NQb8mmgfn5A0nA3Dc6tru0ZmGvoHR8n6svEn7qV8WEHg19Awr+pBfGpgO3KFft0qKw==","signatures":[{"sig":"MEUCIQC2DANUTj08Hg6LkuHsGU97tDb2VJB4DNqK/2qynt7MWAIgZNtOaOmZhzV97cGVm0e3BfcxIBUuYX7MGNgW6DQJ1fo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":902901,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiDpD0ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr+SRAAi4QX8HRzQEtLaWwmur7QLeGMZCilwgUJ+JEJNfUa6XiV1cY1\r\n/MxrpWtpzPt4np0ZC4YXo/Q1S29N1fVNTVUkeFk3XZgGmUyFECcPonMbXIkd\r\n31pL1zUHpK3Ed33Zb6M+oJI9DHteXyfmOSDJ4dX/gCKDqhknGAyo16zCVsg7\r\nXZMSempVPehsOXMH9YTM4vv7ClEL7qKlNMC9VLxi3iejE7r4BAgb7ly/K3Rb\r\nFoeuQxzx6aZevW2K/A93rZbHZM0oZUoF8OCTTi5oLD5+UHwmfsI4g65KyB2q\r\nIx9hgvb4jojTTwb0+7TkJ6KOUrfGjBng89BmSTe9/XnDWKGDnP+J4zWOAVcq\r\nZ1VlDZwKyJ2ohRRqFOdSTXTHeq0HCz+Bsj5754XdwQKz8XQY0Xp/dGI/yjuM\r\n1Hs49VXF2RR7luBhqDTaV8oClOoYuGDIUVdQIcOHXyQylcxm0SIaD2J/gq3U\r\ncvdmEn8++dHBoQP5JihVaKa30gdi6K7umz1eLlp4ZAFFv+G6qU2JCLdRk9UL\r\nu6aZg6BQHAWbujiQJTBFNcdWy1R8NtC3QmKvuexzLZf9c0jGwaMoTxEJD+jH\r\nJ/zhmwdeHJEr9OfZ7oHy+vO5RczRgzW8avIngOh3j3aH/2OIUeMasMYMmCTw\r\nGjppXYh4xsfbLsQiw354yODvVUFmz6gJNAQ=\r\n=DRzr\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"89aa095a35d4a006012f1de893cf181c5725f676","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.19.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.19.0","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.ab4aba1af.0","@material/rtl":"14.0.0-canary.ab4aba1af.0","@material/base":"14.0.0-canary.ab4aba1af.0","@material/theme":"14.0.0-canary.ab4aba1af.0","@material/ripple":"14.0.0-canary.ab4aba1af.0","@material/animation":"14.0.0-canary.ab4aba1af.0","@material/elevation":"14.0.0-canary.ab4aba1af.0","@material/typography":"14.0.0-canary.ab4aba1af.0","@material/feature-targeting":"14.0.0-canary.ab4aba1af.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_14.0.0-canary.ab4aba1af.0_1645121780639_0.049399398910220604","host":"s3://npm-registry-packages"}},"14.0.0-canary.e58552c6e.0":{"name":"@material/slider","version":"14.0.0-canary.e58552c6e.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@14.0.0-canary.e58552c6e.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"c7aebb91ed5d1872d99ed996856e18ec5fd60851","tarball":"https://registry.npmjs.org/@material/slider/-/slider-14.0.0-canary.e58552c6e.0.tgz","fileCount":37,"integrity":"sha512-eblX/uKVNwSXT2InAgQCyqI5qkqL5/1B7GoeRg1hJ7/hKQFLpJy8pdFN1W6lOkLpa9e05BSgtLxAeTdbFD7v/Q==","signatures":[{"sig":"MEUCIBlqmYwgRe1E1XTbQa7wReD8TOgGOMJEbgJgbDJ15J/aAiEAqo0WJz/65dR2xqqcEgumGt6u2OIXhKGGD/aprktEc3k=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":902901,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiD9+XACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmrq/A//RnQ7nD9osgXNxWmwhP9SJPH7wLguDyRlqbVNF8Lupjm7XYoX\r\nGoUgZZLThX3dcGHQ6HgH2dSeWV/knVBAPM395PUcsGsESr5SDxNv30I7sHRV\r\n3R8dQO/2Ut8X11tKtLC2+myN4CFFGP792XVI0S63mYIPPtUsMmhmmN2NH5vE\r\ntiXOe/PlRVOI/4ob/L71/srhv9HK7UjDRB/WtqtZte1joG1/h3h3d74/I6P6\r\nfljQSMRGVeNFBISifZLgAtsD0I/k+3K11UaclW8QaY65yoDSYLL0kpUS+Dx1\r\nZLkMbGbAf6hbteiftV3s2G8D75Xa0ETp7SJWc2IMa82HrV2ZUd0kn+MAFUUi\r\nMnEg1wgItR8k/PRt0xNGHtVWWHQKHEhM3EEgEr5th9kAFyQgN9ArH2IHXtwP\r\nEdhYBZXBVvzCrU+eKv2v7dRVXIDL1Z39cliiIyD03Ve9rJ7g5kPZLj3rwVEN\r\nz4cboZGT+DAK9ePAzSnORBjTXbMFCygj1HksywJeffsa/b9+TKCZ5TyQPXoA\r\nMFC4XxqYZ2A18hKa1pFjx6jTp9IEUmXBq6nko+webnT0yeGyg0+SPrcNjJrl\r\nx+od8trxt5ZZuiuEpeh9Mqu0IM1gwU4YC9ufYGGWJlPXkbaI/xlNLDWzAbf1\r\njdNLTVXMAQGgUkYxbrZcf6vXFzqXyFqcP3k=\r\n=ITcr\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"6d5c1a026de93c3896f05529594e5b025f79a060","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.19.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.19.0","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.e58552c6e.0","@material/rtl":"14.0.0-canary.e58552c6e.0","@material/base":"14.0.0-canary.e58552c6e.0","@material/theme":"14.0.0-canary.e58552c6e.0","@material/ripple":"14.0.0-canary.e58552c6e.0","@material/animation":"14.0.0-canary.e58552c6e.0","@material/elevation":"14.0.0-canary.e58552c6e.0","@material/typography":"14.0.0-canary.e58552c6e.0","@material/feature-targeting":"14.0.0-canary.e58552c6e.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_14.0.0-canary.e58552c6e.0_1645207447176_0.6309030982272235","host":"s3://npm-registry-packages"}},"14.0.0-canary.868793776.0":{"name":"@material/slider","version":"14.0.0-canary.868793776.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@14.0.0-canary.868793776.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"4cf92db321f213f4f070dbe25230935a73c27cb9","tarball":"https://registry.npmjs.org/@material/slider/-/slider-14.0.0-canary.868793776.0.tgz","fileCount":37,"integrity":"sha512-ROO0/fE+ffdg4gTK4EWQYlzG/3+LW621Ebj+LcugqPIwCgyxSfOQKZe9mzceMTGmFOLhu02138xuknCQWEFdjA==","signatures":[{"sig":"MEUCIFPCKgvxFiBUhFmwvG8sTCvdoPADDz9Q0rzPZDZd5FfcAiEAo4UH67U2o0PKTPorcSFLzelA44WLMRsJOtKV2sSGabs=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":903870,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiFTsDACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrqHQ//fGMCHXL2XW+FlBxFBgjA1H0yK53w/+nqrxZcP6sg58U8Zwtt\r\nsIMECvD9PrWi7+GVQiID1UEwUPvAsy0uUv2tq/kz6Z60pk494klRmRHexDWy\r\nCie4P6dkLCrnpTNBN+m8761NuvJwXqZO3ZEDdMl8W5FvNk8AJ7j4+ygbUsfQ\r\nsWlr8GQcW3osUSNBFETa7rx4XOUD57sIQAxkdRawup2KA/tpawR9H6XSq3TB\r\nxp4WQjxfJ7656stpNAMffgtyuhxrYnLNP25M7k5Cp2CdE143achEwoA1wHVQ\r\nt1svYMDy2bed4H349TgCeCEWNGt8Qe7HH8ZM2OIZ8i0QuLTvZD8+1G73IJoq\r\nvVKXpvxkdd/8FHOlW7hm9om2BN/9So3L6N/KD9UqigqiqEY5L7k/Ltpsw9CT\r\ns+2JlZ5joiCtAyDnC4Ua0Uy2BFxUBswz+HndfHuSKwHDK2QpqLTs8xCfzOrg\r\nt8BAX3aH/57OVD/gITI0lPWM8L4xqzjk93XqlzewpBXjDzNHoCmmVPEOdvY2\r\nn5euc9eqJqcaYkG8gGyV063S+xL5nboLxZyAfcSXAmEPmbTWPEAXuEq7DtjP\r\nsz8MzBKCzfDsqcai+x3S6ncA2oWiRdl7bWpRIRuX6bDOSSBaVAdVmAOos7FY\r\nLPK4kA/LGdb1ba1YIDavnAuXCD/JIqW85Ag=\r\n=mS1L\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"78272b55e375cfc80b8f288ad4bcd4bba3d8493c","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.19.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.19.0","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.868793776.0","@material/rtl":"14.0.0-canary.868793776.0","@material/base":"14.0.0-canary.868793776.0","@material/theme":"14.0.0-canary.868793776.0","@material/ripple":"14.0.0-canary.868793776.0","@material/animation":"14.0.0-canary.868793776.0","@material/elevation":"14.0.0-canary.868793776.0","@material/typography":"14.0.0-canary.868793776.0","@material/feature-targeting":"14.0.0-canary.868793776.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_14.0.0-canary.868793776.0_1645558531589_0.8271820650192392","host":"s3://npm-registry-packages"}},"14.0.0-canary.fdc37a445.0":{"name":"@material/slider","version":"14.0.0-canary.fdc37a445.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@14.0.0-canary.fdc37a445.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"c7d608312fb6102a26f56434f7934b5b707b1a14","tarball":"https://registry.npmjs.org/@material/slider/-/slider-14.0.0-canary.fdc37a445.0.tgz","fileCount":37,"integrity":"sha512-R62EjnlY1c4WbkQFzwcBv7N5P1r4iWzr/dG+2XsQvyBu3zPaM9ZQn+yTkHamMZSok79r5vEWSFAbJPy+CzSN2Q==","signatures":[{"sig":"MEUCIQDydGoEoePgBwnyvdpgXpdduTSs7R9uTg4OuzwEAzgZaQIgDS5lHKqJJxaaJGd+YDeZ94gwLlBWxzXbJOufH5R+vEk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":903870,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiHRhyACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoDtg//UbEjCjiM8mDuVYEEObRqJiKTaZ2fXH6Gey+sztmdT855cfb1\r\nxr4YPzPRljh5HCIeg31ZhZ5mbntL3Y0GfxJCpTL3H6OqrsK1IrlWRxUfczIh\r\nO48/RZIMnD9DM3sA5mTmmimDrcWsuMwU+Pa9e3EHvTNe6L19aiyMvaAYPJeJ\r\neHA3kYsr3qVs9sKaLqb1E1laK5tOhJVW2K1i2G2FdOY9fQqXi0FTGy8WGcNY\r\nseCFu/0IfzXDHyJu4Y/hrbqK9QkgHnAZ+ubiYJbvrCDqMXkqjIm1nxCbK4zh\r\nYoGfFH5Jzmg4Ys1PPdzl+p8MMeRI+3ZlZduhApUm/Kh15/tyFITBLhyBDAj9\r\n/hkJ0B7S0QXUPZdl/YghUUTmsrJ2JwY0rSHeFfrAycc229DvV92ZsecQ5wkI\r\nhxpHdECkjXf94Pwto5pIzQgy1ZRAVHlTaOfXwNxRaS75ZKByYDYT9WY8igMJ\r\nVOzykNqiry4A0hU71fOkzQ4kJbIMyxaliFQGTX6aXPe+5GPoe2PoPS32MXmT\r\nemTULZ0fZtErrkL8ESBSCBikt7MendVYEzY4RHV1yczeUhN4ck/o0DGj5u30\r\nl6jwf0OtKSU+w8CbyJLnWeNV/XArqurXimnIqy7Q94aEt7Vj47vthLhbFt/H\r\nHYoFkZT/GmyPqIhyAq4aLAEu+zxGwPGb9Es=\r\n=bBaL\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"5a8fd2fd927d036e44b0b22f48d858fb848e504d","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.19.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.19.0","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.fdc37a445.0","@material/rtl":"14.0.0-canary.fdc37a445.0","@material/base":"14.0.0-canary.fdc37a445.0","@material/theme":"14.0.0-canary.fdc37a445.0","@material/ripple":"14.0.0-canary.fdc37a445.0","@material/animation":"14.0.0-canary.fdc37a445.0","@material/elevation":"14.0.0-canary.fdc37a445.0","@material/typography":"14.0.0-canary.fdc37a445.0","@material/feature-targeting":"14.0.0-canary.fdc37a445.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_14.0.0-canary.fdc37a445.0_1646073969999_0.90044365352466","host":"s3://npm-registry-packages"}},"14.0.0-canary.43c7d87dc.0":{"name":"@material/slider","version":"14.0.0-canary.43c7d87dc.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@14.0.0-canary.43c7d87dc.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"9dacbe47b5d1eaf88b33e077162c65c285dae523","tarball":"https://registry.npmjs.org/@material/slider/-/slider-14.0.0-canary.43c7d87dc.0.tgz","fileCount":37,"integrity":"sha512-iTkzogdfjszQhUrdVmSNKuxaOFlbtNebKlYGSJzANmUMhRRTPc1AuulXieYMqb8UPnOLJP6Ot86qjRcBtkkS1w==","signatures":[{"sig":"MEUCIQDDjAXILBm/2E5rY9Q22MGTEL1M3J7amDQk011YhhCNgwIgQlFnCpmKxiaXlILCJxytcZHwUT5MKVm/yje2I8JafMw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":903870,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiHjy3ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpKhA//XXXMTYRnb3EPtDYEjcvCX3HkRcHIgU/piMGKMHRsHm2PCeIF\r\nnB+ijglaXFVqI44EvW9zvV2rtzhfEfE13bDjsz/bFAMZaParciZLBdSATR+u\r\nfEBMKNTzgNG6N3/4WGCjRYFXbtcR2cye3SuIvtjbhXv8iKVwHmDwhfUihFFv\r\nCXnRP3AWVYC0IPtHo4VHgihFDoSxCMR83rrCFbTwQGs3EpJjCb5b+bMeDr2u\r\nTS7UsHvP0i8iyQ9UxF0b56Gkglq9af3SZx+UP2Tn1eSpkPeKXgeu2ijrKdsM\r\nYhNJXiuTI8lkvSR3xk9Zo7CfYvvbsdScUkWI0eZoiF4t2xfBHZLe4/djDEwC\r\nx+9R4fOArQfHT9YJ2qAkvJosMqbp7OAxMIzofCD0UxR+PNBOr6VjqcSuY7WN\r\nJDjoTZjbH1iaELh0FPv9HwSnyb4v4AXuVrj1X7eP+hCHqLAg9a1K1XqtoNHT\r\nuoGDodHE9A6MQFMrLvUk3wIduii3wF0uyF/QBu98nMICw8kFc+Dbt/uEG6Qa\r\nVavg/mBkwUZV3xqAy2pH72pDdIULk+oSQa6YUBp8Jf9LTpy+7vhqVWREyP0C\r\n1J8+IjfH5aVAD6S2XQKHiB7p6SIXjKNPOGl3voUKXFM5pYorr0OigP9MBbJB\r\ntD6ya+yH7ErT1AD3skM/iB1ajY9i3N3EX8M=\r\n=rQMY\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"c03dfa84e200bc6d570c73762d7ce507d0659e76","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.19.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.19.0","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.43c7d87dc.0","@material/rtl":"14.0.0-canary.43c7d87dc.0","@material/base":"14.0.0-canary.43c7d87dc.0","@material/theme":"14.0.0-canary.43c7d87dc.0","@material/ripple":"14.0.0-canary.43c7d87dc.0","@material/animation":"14.0.0-canary.43c7d87dc.0","@material/elevation":"14.0.0-canary.43c7d87dc.0","@material/typography":"14.0.0-canary.43c7d87dc.0","@material/feature-targeting":"14.0.0-canary.43c7d87dc.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_14.0.0-canary.43c7d87dc.0_1646148791272_0.44075360661661667","host":"s3://npm-registry-packages"}},"14.0.0-canary.23043acd0.0":{"name":"@material/slider","version":"14.0.0-canary.23043acd0.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@14.0.0-canary.23043acd0.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"059fa654006fe79d29522b7e97efbc7c58a6f2e4","tarball":"https://registry.npmjs.org/@material/slider/-/slider-14.0.0-canary.23043acd0.0.tgz","fileCount":37,"integrity":"sha512-n2lvjL9yXHXbBEFwwcQtrk5Xgp6RQiSciI85gfsT259nSIkAFKrSBXnjKbfIMxI/kRRf9c7BaZLMW2QYVrNAsA==","signatures":[{"sig":"MEQCIBmBuzPKS7axWNHk5cqaAEdU7dNd0ynYsro8weBAFNM8AiBPLPRBJWL9q84VzgPx3RNACg+ys+oDSGCb3ZX72DLEeQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":903870,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiH9MtACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrdsQ//d/yvwaVSk6VXgJblCOENVdvZg805VFzfIw073MtigeFTNWFU\r\nHr858eRTiwfmtTKOg6BWmlwa2UOcjfP267ml1kU8+jsYwclc5qAfPRaZ7Hre\r\n5gR/qKNb79R1sv95PEiP2neZ7/0pXvKpEzlZu55aPTyYnl1oHh2+Ucf/h2Cw\r\nIqaX1tcGkQEubLZTIWde9WqkjbxDGFuVVp5/bVgRsrDdbTmqLAopTdBzU6Fx\r\nCsJ5FkcHn2YqyGZIMM2YdpRzjJSy+muoHyIGLfLMZiv45kxqq2H9HQkll6si\r\n+YKo27fX3K7/l0sQaxEuDTJIkmXq5+vkU6+/Kclacr8UmhQOGlHYzdHqEzxk\r\nWYw1emoUJrGqchaUUNbc0TkFqr8RIEegC53vZ9sx86AzJUzPRg0poiJZW8kQ\r\nPUwmHBj4qGtms0NO2pb/ueQiQb05PWQQ7Iav8B+IO0mD7AVIHmMJWPoYbHRB\r\nrzdTiZNyB5ybFFpPWnI6TI7csCzLhsf+49NHiizSbudvvmjlW0VCSFLfl637\r\n/wQyY8INwkwAW75LrFLchQ36wLQo/NEoX11fAb95M+iqAUWSozegDg1UkgCW\r\naK35VqxO1IpTUPaq3xZ/6yLfqM2O6NX4EGAohbR0i6hdj5mfgxJmw7CUuZ30\r\nrTOSGodikQhF279IVL/TwPqSPIiZMkgPjIM=\r\n=LoGJ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"b1cfc3908c111a04a69dbaa90966642093f79e86","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.19.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.19.0","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.23043acd0.0","@material/rtl":"14.0.0-canary.23043acd0.0","@material/base":"14.0.0-canary.23043acd0.0","@material/theme":"14.0.0-canary.23043acd0.0","@material/ripple":"14.0.0-canary.23043acd0.0","@material/animation":"14.0.0-canary.23043acd0.0","@material/elevation":"14.0.0-canary.23043acd0.0","@material/typography":"14.0.0-canary.23043acd0.0","@material/feature-targeting":"14.0.0-canary.23043acd0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_14.0.0-canary.23043acd0.0_1646252845577_0.17818590235005694","host":"s3://npm-registry-packages"}},"14.0.0-canary.6505e61c5.0":{"name":"@material/slider","version":"14.0.0-canary.6505e61c5.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@14.0.0-canary.6505e61c5.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"5735f66150497224ad40a3bcfc0bee23a14db35d","tarball":"https://registry.npmjs.org/@material/slider/-/slider-14.0.0-canary.6505e61c5.0.tgz","fileCount":37,"integrity":"sha512-FTHl36tOhCUYuebbNFkFf7i79eVnGiH/28sqUt5WaWpg69YnVwSp7r6WlYDv6tHf1pC5SwBnfEeCbMLhotsAKA==","signatures":[{"sig":"MEYCIQDTQFQPGaButLWa++hso8TeWNtyXucRH3VcWpRCLXJtAwIhAPdLiLmkzi00B55poKrgx+uVCLF1fQCSBx34OAJaHQxG","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":903870,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiIR5dACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpBqA//UU10Dh50nSHSmSgsH62DoobuNqVzZQWZfKj5iZhT0ubHPNR6\r\nU1GStx9WXTw5sbr2M1SZdvewMbbVVxKtsVb3ui/va3hevoM/YcsgG8b4HADL\r\nALeUWVcDx1Taj8+RTItAZgqRrr/soWAxNUE3pxU/pt2tkwd1yM4I4w2o3qbP\r\ntEGswAiA8g52CXiyAZEb9hb55XSrdn5mL4b2NxbP1QY2wUFqDu76JGRxPIAy\r\nGn2GLbaCMuIPeBnGODUyXwOfVWH39R64aMR198Czpj+TLH9vqAvYA+vVn7LD\r\nf4K7ERPtRrH2AU/n3F6ptnlEPnq27GQy7lq0/fKNq5KV9s1URjoYs5+wZjyp\r\njIuazYls94Ftsh/mAvku+Y1rjApld+UlgOgl56lGNGkZEhACMlUC3kedR0R4\r\nfhAUj/3L43RGbALLTH6DMV4ooROZsQPe5JvLnHLEx9zseB2Mnih1//U43ZJ5\r\nOySnA7CXLz3MaYVNM4xhK8WB/oWv/ak9rbnRFGqGLrwuG8KuD13Ogj0JUUAG\r\nnmVYYtD7Kbvt/UFhAy8sYKgRpmLHZ9on7ETOq4JUU/5cs0uonMvBmymw1Hjk\r\nOQM9q+ZI/+jmAFHNvvyzPNDfUA/vYzUEnTf6wS6wdPFf6YjzL4Fb/ac/YFL9\r\n5i5QbN0CqNENktO4oK2eKNtvLYcIpg5++oA=\r\n=rXJP\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"c9070f0099aa35dc2460994d2d83a8330b996c5c","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.19.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.19.0","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.6505e61c5.0","@material/rtl":"14.0.0-canary.6505e61c5.0","@material/base":"14.0.0-canary.6505e61c5.0","@material/theme":"14.0.0-canary.6505e61c5.0","@material/ripple":"14.0.0-canary.6505e61c5.0","@material/animation":"14.0.0-canary.6505e61c5.0","@material/elevation":"14.0.0-canary.6505e61c5.0","@material/typography":"14.0.0-canary.6505e61c5.0","@material/feature-targeting":"14.0.0-canary.6505e61c5.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_14.0.0-canary.6505e61c5.0_1646337629470_0.6075004276472256","host":"s3://npm-registry-packages"}},"14.0.0-canary.16c166154.0":{"name":"@material/slider","version":"14.0.0-canary.16c166154.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@14.0.0-canary.16c166154.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"0252fbda27f1c5277a7e867079a7b38e91fa76c2","tarball":"https://registry.npmjs.org/@material/slider/-/slider-14.0.0-canary.16c166154.0.tgz","fileCount":37,"integrity":"sha512-BnC6AEx/oTNtTNk25d6PhUoNJiOwSnE4LZAp7fWS3FrV1KS+bznGnkodtqYoDGt05W31AApzaAeiaroT7ZoSPA==","signatures":[{"sig":"MEYCIQCS6aX1XfY2gG+PT21xF/jMUiYy3pCt6sFDapo5cveTEgIhAPsYiSe1xjmynh9ftvjyDG6NDvjjSSTIkbWLOOdsNqKK","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":903484,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiJ+UuACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmo8sA//fdbiJtGPIJuKmlkYRUKI9nBK6BFmm/t1a4Pd75vkqiBk0J4Z\r\nxaprxUeTrhbHHGM6MjEnHdUtIrfvLIypHXapip4dogGQomypOh4bExKjo/sR\r\n85gyp6ny9iz/D7imZ/j+w1aqnsrZzHTDNDBl1y5BcLBOhxKF6RZiwo/OrmEe\r\n4CH8Qg2y7u6gf7rAiis+A8uSKwEX2ivG0NrAfSrGrZLHfKe72iInGFaTjO/8\r\nRlFKD1aZ37cPnY3Tsm87CO8j5j66WwDSGboPauGo2eCDr8Rw+tVrupGIv2wp\r\nua3CeZZMW4lvLk+RBtIH9HQ0G801GM+SVKMQwAkW+AmUoqGnJD9CaWjET2dp\r\n6c467aCA7p8Eg4iZitJ7TY+0kan+T2vX3vqcDuv7tHO7vH2HvFVom3FFoPH0\r\ngoiwkgH+9YJsH5uWTIoCh/Iwh4kPTub7SauXD5pColUJ4wmlV4Ngshst/+4g\r\n8V2VJqqkDynxQ9WFphbBs0GifThawpnNAmGyQmIlKT8ZVCJG7FWCb5EAdkzX\r\nyYXOFUuN5vAaXIaetHvY1XTLZl5TDGhHk5r93JH0rb8HFxkzTzKnOavFo9LJ\r\n7df8Yr0+dMM54aV0oBXv0SYWzTAGO1Q76mBID6i/2XE/UbYTcZ9i++r8fiDa\r\nEW8kEGxoEcimz85iBLVIlBOm0Igx586wlD4=\r\n=phKP\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"dd1bb8b4a67220dc0120ba2dbdac900e51002949","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.19.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.19.0","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.16c166154.0","@material/rtl":"14.0.0-canary.16c166154.0","@material/base":"14.0.0-canary.16c166154.0","@material/theme":"14.0.0-canary.16c166154.0","@material/ripple":"14.0.0-canary.16c166154.0","@material/animation":"14.0.0-canary.16c166154.0","@material/elevation":"14.0.0-canary.16c166154.0","@material/typography":"14.0.0-canary.16c166154.0","@material/feature-targeting":"14.0.0-canary.16c166154.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_14.0.0-canary.16c166154.0_1646781742119_0.44301408393778563","host":"s3://npm-registry-packages"}},"14.0.0-canary.bdf1d3771.0":{"name":"@material/slider","version":"14.0.0-canary.bdf1d3771.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@14.0.0-canary.bdf1d3771.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"a5fabaea8481a29ec4631bbfd1ffe32dcfdbe2f8","tarball":"https://registry.npmjs.org/@material/slider/-/slider-14.0.0-canary.bdf1d3771.0.tgz","fileCount":37,"integrity":"sha512-QX8VGpAfPkQ2LEYECuF1S9+Sdj8YVOIOokdySfa/GWIdB0ZscMYKLASPawQHCQ+qh2jn1ZUqgv4tlmhKA0tAlA==","signatures":[{"sig":"MEYCIQDZFCvFFtiD7qWAbzbRQPECBz84fzH0x/ZFhisJevh5NgIhAKvmod9DkDp/jna/BliVghWLf9krwa/0KYKysrGh7yua","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":903484,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiL1ERACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmo0PQ/+O6nZF2JHqLpNvQ5SZ2SZWtvg/KBm5BjU6W+GIgXzrI5LRq1U\r\n1X5I8thuPsmPk07/jN1EwMajr/lSNzJnHxK9dvR+F0mCqwARwMOIqNP8D4jB\r\nf0SQb3rynb6Ja8FT3InomfPxAwHxxerwCHMvm6HYkHblvUTIQGRqbHgGZfGO\r\nDF+5y8HKMhBS0wYL4+nllOFOO0PQJ4t71T8eFq72M5Ns23kaYHUiiAI0nA0B\r\nQlWd/iKZrBHYKs6ioGV7chzUm3MOWRkooETlLv203k7dgSB4LbTzOWpxM57a\r\nc1YqulBBkq9HJIZaYCfOeMWus5vfDjYK+R6HDatvEXnQ7YO6ZocVFE5K/q0U\r\n5I6mRkdwJzRhhqQtiOdV/8SI9by5lu2eaWwjbP8kZMaGVaMa094JzsrwzgGP\r\nA8JwxOljpbTp7mQuOAZwr8C+i0lIOg/NCPeMBlVvZXm4V58d8XbBg45f+bvS\r\nfq+8N2NowJhHuJsvVS80vkyKQTTP52ufw0peBEyefAmrNBl1T6c4N+o68G4D\r\nYD6Os5dy9EvHuzDEeKFqwq6WcUSsBhc1KE2lN4CgAUSm8pxMT4yhA2knxUsH\r\n4+sQ6aMpjr8NBW8k4WPLCg5ynn2u7VPZ9Ab77PPwWi07xDSP6fKH36INlmzY\r\njaIUStlrY9Nqq5ABL+2/pz8MufJyIgRWlU4=\r\n=sQZz\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"bf598649c7389f49207c410e58144f75a67cc4f5","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.19.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.19.0","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.bdf1d3771.0","@material/rtl":"14.0.0-canary.bdf1d3771.0","@material/base":"14.0.0-canary.bdf1d3771.0","@material/theme":"14.0.0-canary.bdf1d3771.0","@material/ripple":"14.0.0-canary.bdf1d3771.0","@material/animation":"14.0.0-canary.bdf1d3771.0","@material/elevation":"14.0.0-canary.bdf1d3771.0","@material/typography":"14.0.0-canary.bdf1d3771.0","@material/feature-targeting":"14.0.0-canary.bdf1d3771.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_14.0.0-canary.bdf1d3771.0_1647268113501_0.3264068213618363","host":"s3://npm-registry-packages"}},"14.0.0-canary.cf4292778.0":{"name":"@material/slider","version":"14.0.0-canary.cf4292778.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@14.0.0-canary.cf4292778.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"98cfecda70d913d41587eeed3ad81198867222d6","tarball":"https://registry.npmjs.org/@material/slider/-/slider-14.0.0-canary.cf4292778.0.tgz","fileCount":37,"integrity":"sha512-3JdRPtjAjJa5ZY853zDdEnRwkXUPh2m/SJlg2kvHB79idrX/uORMjJ0U2LwTI0vcKXfSMejMt+N+csJ4Hw3qGg==","signatures":[{"sig":"MEYCIQDIJQKwhjxFX4l1bBwRgqRJesxAXAs0xsnQJRRpEwv/ogIhANsNktuHTFXtJc8RPK+svOFbxcGODwPLLBTWEbkkBCS2","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":903484,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiL93wACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpMYhAApHLuuBA6SLKYiR7PpUhlhkjiYBmJf5eX843mwHTHjsJruh5z\r\nj0K/jKPXki+jCftGubEObryGzj5EcDV+ehemcLg39tN7IEkQnqEtcHUbL3eV\r\nqq3/J2TOHFGbavSpdbnBkUrmyJla3Aq1N9QyLLHdlDf2DVQ9xT/haojY92nF\r\nfZlfETxN+fbM1685URednWzrXnxdWS2nEdfgrSZokCIIeG2jATXgT0LsajeY\r\nG6V297Hgq28LWkH+CmAw0DlF4Gsp3yg2GF1G6yIxQPO5Gp6sF/cscPwJ9dMH\r\npM+6DDwtzVgaWyk0g2AkjFUAPAIIX8sRGvd8YQaxS4spy9Amz3c5UdQsidDx\r\n9VUE0kILTbLW6f9SZ5a1TtJuLN3g4LmzkoF0WAeEknCbym904/IFeovRatje\r\nMND2LO8BEOOUet82GC3u+kg2h4H3BNTksBV295GaKr+zF+qT+shG7M/0TFr2\r\nRyY/VKfkwistCGAf8brK2Ae6AGSlB9mnJ7TJ7Eo09X3Qni5trUy5kUEbNfol\r\n1scUdzQoa+rofpCvcuAV9Pg47oLr6bzXCGvss9QgxTd2MGwENpiZj3ZMOrXj\r\niA/XczGmAdSEP8H5peGrC6vMenQJopu1VfOSNKNJhjLwK9AqRTWefeVCZX6x\r\nSW+JkFvEDvtpIYwLio66GfbE+iYUTM4SWeI=\r\n=UbNb\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"85b1d5db9650586ff51d999fc12531d07489d13b","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.19.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.19.0","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.cf4292778.0","@material/rtl":"14.0.0-canary.cf4292778.0","@material/base":"14.0.0-canary.cf4292778.0","@material/theme":"14.0.0-canary.cf4292778.0","@material/ripple":"14.0.0-canary.cf4292778.0","@material/animation":"14.0.0-canary.cf4292778.0","@material/elevation":"14.0.0-canary.cf4292778.0","@material/typography":"14.0.0-canary.cf4292778.0","@material/feature-targeting":"14.0.0-canary.cf4292778.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_14.0.0-canary.cf4292778.0_1647304175819_0.5408912917580633","host":"s3://npm-registry-packages"}},"14.0.0-canary.bbd43e0e0.0":{"name":"@material/slider","version":"14.0.0-canary.bbd43e0e0.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@14.0.0-canary.bbd43e0e0.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"382993a80f2a44afeb8bb9b594c59cbb4be94c2c","tarball":"https://registry.npmjs.org/@material/slider/-/slider-14.0.0-canary.bbd43e0e0.0.tgz","fileCount":37,"integrity":"sha512-laERqCXRaQ6vouyFUXpO+hY4WPgYzpIQF3PMR9/w1Prz6Y5c08PZOJS85piDKqDLcIT0DoWRxpR3x6OTIaOUkQ==","signatures":[{"sig":"MEQCIBi2BnAtyLL2N3fbCBSGaUntPWOSy/GFAQCb36AQ1h0RAiAffeexVo3oeNNKNUU2486inNLJbdekYRun0+hGvl/pRA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":903484,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiMk18ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpYCw/+OzsN8kw1ypHZ6YhI9pvXpaqC0bNSwQXohVY0oE81ycvE+hd8\r\nF0ZiPoVr32QrLlqCMZM9jawT25pvInjts6UWh8Tlmam9G9+TL+mOwkVi64rv\r\nbwXHaw2NAU1XSsSXi+xiz7n2W4v6XKltzNHJusCdmtiZayDAMKibOOLw+LPh\r\nth6WNbj902TmxzYcrXqqoaO/LhFzMIbvqvI3kvpx9CHDlJD+at5nwC7AaVBD\r\n7+FOCsukWnRHq8R6rwjK6x+KQV/uNFhOheaMhoJaN/EfinIenv615/1mZ+AH\r\ndzLuYDXgnFdOEfB4Jyfgv9rVVT3mt0Hky9Jd5TP5j34RpGLUf1xw/m+sopNi\r\n/zmaB9dk/PHJ0MqCOaDvUpXqOxzPZiRsQ7YqDl4XbrUD7nEpQrSa7TEKsi1x\r\no4oA0hC0ZJgH7xcaCVVqww8aheUDSR2/O0OELxyUHvC/AykJAftfX656uSX3\r\naX1n6tWgjc/y5OTNknE6y2h4D5MIMtW4Fgn7TpQyYayqX31hk4bgD5tQWGcs\r\n0cj5x4uG6cKW7kOuTPLHelq5lkP/YQD4hVt0JWHTQBPxJ6YKZnupadtp6e9w\r\neD7bEAFV5DaskcqLK+t7s53wTSniYabN+dJRh07tuIefVxYGfLDVoRBplJx5\r\n1RncdZ8p3QycaUbVWRLm9nyJ0Q6DIA3KgX0=\r\n=Mrj/\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"bd60ebc6c6267688058726d6f98421b0e815336d","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.19.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.19.0","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.bbd43e0e0.0","@material/rtl":"14.0.0-canary.bbd43e0e0.0","@material/base":"14.0.0-canary.bbd43e0e0.0","@material/theme":"14.0.0-canary.bbd43e0e0.0","@material/ripple":"14.0.0-canary.bbd43e0e0.0","@material/animation":"14.0.0-canary.bbd43e0e0.0","@material/elevation":"14.0.0-canary.bbd43e0e0.0","@material/typography":"14.0.0-canary.bbd43e0e0.0","@material/feature-targeting":"14.0.0-canary.bbd43e0e0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_14.0.0-canary.bbd43e0e0.0_1647463804249_0.7636996122714459","host":"s3://npm-registry-packages"}},"14.0.0-canary.1b6afad86.0":{"name":"@material/slider","version":"14.0.0-canary.1b6afad86.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@14.0.0-canary.1b6afad86.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"ea0e033f5ac6c13bcd967261c1faeca7e2a9bdd7","tarball":"https://registry.npmjs.org/@material/slider/-/slider-14.0.0-canary.1b6afad86.0.tgz","fileCount":37,"integrity":"sha512-wAaAI/tsi++0Lz9uwPH4Yo2AU+NeKP6laZz5M1QaxHXljdr8/OaJuU/6Zz1LD3s9OLAhNiefhi+23obuXmj+zw==","signatures":[{"sig":"MEYCIQCCS9gMbzeEk36FJUCOiy5HQHbqP2uxfujKenAENv6LdwIhAL6OXYAYZfZ3arlT85joLnnrFThs3R0CG+cz1aTIxnLE","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":903484,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiMlCnACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrbMA//T3j6/MjUvVml2w0P7uyW6M6L8tPEM5nqpLOp+qJLgrVgfmS6\r\nP2588TmriU6Jc3AK2rTzaxGGbQeEiD9FgEeixrTfBe/2Nn6k0i+O7dQQH9oc\r\n5IoTUmUjy0rFj3LI1NBEB/9sm+FZDhBsAMIdAhITcAHAo1n8dwNLR8GYi747\r\ncAe7D6oiD3dM7R+KFEHk6ygNrR2xr+4NbhurL93RXfwzpv9spkWKdrdkn3xq\r\np5rd24UBFmTSb+d0BMbw14Q3sUfxpRf2ZHw2Twa9PGecTYRTuit1UUVlynFF\r\nBh29pMY2ykV2hN2PYaRitW/NNx4DYrbqxcFkzvtPxCBcBOPepnmk681irw2U\r\nG6qPdfJ3m1CMLoP+y7xFeSBNMgHGX1frLROdCzjnR7M6C71ggf2AaY7ys4Ej\r\neKrcDylfaMy8kCakaGKUvTHNh6IAEFqpzNSfO9U/7iUSzlskM7lLsvsZmQ2/\r\nFiHHAOlw62NKlyVIC1hIe0g5ht0Th/WOXNKF4DIPPdUold/GSZijGoF1E7IJ\r\nl4UJpl0j+0DBefG0VPJafjSRbQqenfyHP4cd+kUZ7gJW5RilIudnuwBM2u5M\r\ngn3em9U5H44te2XVNEgAOz/IEEeRWIJcyL+2RdAyYNj+jQEgfLEBo57nyG43\r\ne3G8h/VriuRwGGE9hFjadN2lUZL5oupXBU0=\r\n=fDv7\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"5e32cc72145fa47fd2155c83c81cfa7ba5e27db8","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.19.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.19.0","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.1b6afad86.0","@material/rtl":"14.0.0-canary.1b6afad86.0","@material/base":"14.0.0-canary.1b6afad86.0","@material/theme":"14.0.0-canary.1b6afad86.0","@material/ripple":"14.0.0-canary.1b6afad86.0","@material/animation":"14.0.0-canary.1b6afad86.0","@material/elevation":"14.0.0-canary.1b6afad86.0","@material/typography":"14.0.0-canary.1b6afad86.0","@material/feature-targeting":"14.0.0-canary.1b6afad86.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_14.0.0-canary.1b6afad86.0_1647464615241_0.17569142180900288","host":"s3://npm-registry-packages"}},"14.0.0-canary.bdf9d4af9.0":{"name":"@material/slider","version":"14.0.0-canary.bdf9d4af9.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@14.0.0-canary.bdf9d4af9.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"c36a2f5f3c7c797083089725c73ca4bb98b8fe23","tarball":"https://registry.npmjs.org/@material/slider/-/slider-14.0.0-canary.bdf9d4af9.0.tgz","fileCount":37,"integrity":"sha512-yoaudiUWAB171u2A2X2crbKN+poQsh5wkVWXeVJbHkBUvc4Qs8AI/5r3a3c66A3Ovj2EzmYm9wOV9N5BjQ4GUw==","signatures":[{"sig":"MEQCIE6p5SJUjYp4eOmmBazNTFTPu2k4S8oIFPXBRqU1Bme+AiAg6HadwKq3+VfJXm5bALyVATirymBofYCv1h3d5by8sA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":903484,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiMlP/ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpfdA//dlE6hAf897ieaAvt+BkShT8GtReAgt3mvye7zeWHfbqYwHy+\r\nqDPrQvc6uEiPhncqFgRTYla7Y0VlfbTKsiwGpGuRKrytFu9xcfrYXtXCSGWJ\r\n7/kmhCgZYmhXGBpuqyPvRn3GXywEpYGu7BRkXgLi0ceOdaQH17J3Uomr8BfQ\r\nmkxryesPam7Y/F1nOXBRJtmjtLPeljU4oyUw3jzTimbPJwhh8Qr5H/Q4+BOM\r\nz/bHl4IgTQGnHnDRRobKxheLAyr5xe8QHsRZOPs2m1VPTysB+c7STiEtYj5v\r\nr+nsmgdAmeAY7EG/irXabwhpyIunsLdvsaN4jdGTF1+HTJEgTBoSg8WmX4tb\r\noDkVnH52RhBOfE/mSUvPaPmWPNCz8KcS16BS3ZRU3EJ9f4u1/DD8b7UXZtzW\r\nGUSCnEuDLFPokmHEBJWaurJ45J+/KhFfw84xZhR/9y6hTvrA0FoU25PTp5iN\r\nKoAsTR8N3duUMFPNALRr+/HOWcfx8BBd5LUmUw7MfTaYcH1p5NleNyH8oqvu\r\nQ0d7NKtdTugQeJ5RgLQdjHtczksOZC1YvRrGyIVkzhi+pOr0bgm4HjRmFRc5\r\n3rA1jraGWjDgcJpk4mfbLiaSFbQ2cRdEyCamYvXhbMkuchcLb1tjJ1s8bImM\r\nsdn5jsrk4flssl9cbsamlUEHcN86OKt6wbs=\r\n=TTKF\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"413f4cd271111f1b118401821eb4bb38e7fcbad9","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.19.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.19.0","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.bdf9d4af9.0","@material/rtl":"14.0.0-canary.bdf9d4af9.0","@material/base":"14.0.0-canary.bdf9d4af9.0","@material/theme":"14.0.0-canary.bdf9d4af9.0","@material/ripple":"14.0.0-canary.bdf9d4af9.0","@material/animation":"14.0.0-canary.bdf9d4af9.0","@material/elevation":"14.0.0-canary.bdf9d4af9.0","@material/typography":"14.0.0-canary.bdf9d4af9.0","@material/feature-targeting":"14.0.0-canary.bdf9d4af9.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_14.0.0-canary.bdf9d4af9.0_1647465471332_0.8303154580492795","host":"s3://npm-registry-packages"}},"14.0.0-canary.32b391398.0":{"name":"@material/slider","version":"14.0.0-canary.32b391398.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@14.0.0-canary.32b391398.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"ca32998f42097ff01d173e1ac02de0cf11e6994f","tarball":"https://registry.npmjs.org/@material/slider/-/slider-14.0.0-canary.32b391398.0.tgz","fileCount":37,"integrity":"sha512-ZDkcoTdmiS/2qLwyYb6VtJeClreJG5dCOnEF8QBVPr5dcukrnWM01ORYs5Ix//pMrxMZZmUd0QN8witTaRUJNg==","signatures":[{"sig":"MEQCIBPSebJsikQZnF9HH3zV8ZcWMdIGUsYUu3ofwyj2mTseAiBeFjUX8Pj4XDZHnJjgwsnkWKdNnjhB5h9/4PGQniteCw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":903484,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiM3bwACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmp20w/+P7gEt3VEE8rhO/xsrlpWkFHpyq1yYek9/xxQUqd8Vsp8i3FM\r\n6oPMBuBDpJjXb3qH98XdyoKCzqeiQDtUnblRXJsfV4TFTZPGwDwvT2e8VSTI\r\nNpu+NI16h1pBROXYyetxhhPWfH9imPk4nAzqXtHWlf9auO+lta5+k3hKMdf6\r\nP1SfF2kPqpx8J0CrCR+sF2kMX+Drw2ndMLi+dCjl4qb+purOJ2y2psCi3/5J\r\nWj0uXXAZhCZ9ZaymTXxAnZuJLjs91pDS5GZomUxSCO3vyoRfrNJtMI13WeMc\r\noemV2coTs9e/x7Hnzry+KzUUS51FVLkdHNMFD5uHKtSFwBYMylUs3EvBYyeI\r\noL/6rAFqiTmsSlRrsBM9EPsv1j4ED21ud7DlcQK4zVrWETb9EMwiFG1FgiRH\r\nHTg8RpwDZl23kjNF75v0nT0TNKs6eS//fJ0oKpOGMthWYPFhUKN07mmbSh7f\r\n2d96+lFfmqSnCYaz9YENd2ajcTb20wVv/xfs6abvevaTc2b2o4q+Ap8Frq+6\r\nRcVjPGKsab+DgOx+wBhSQSwAamhxkLJVhmg7/j2JD+AieLMyoCzb36ZUaec0\r\nlByI1fgug5xqA2iP5r7GD5qj387S3+3XGwOvdnNFQqQMiMzPCZnTD0rMsPfH\r\nTqdGfQ3pBVvl5x/d13HJtb1AcXJ5ON+9Xi8=\r\n=cV+V\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"8a457bda7a5cedbfaee9da752ba2dbc093b45ac6","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.19.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.19.0","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.32b391398.0","@material/rtl":"14.0.0-canary.32b391398.0","@material/base":"14.0.0-canary.32b391398.0","@material/theme":"14.0.0-canary.32b391398.0","@material/ripple":"14.0.0-canary.32b391398.0","@material/animation":"14.0.0-canary.32b391398.0","@material/elevation":"14.0.0-canary.32b391398.0","@material/typography":"14.0.0-canary.32b391398.0","@material/feature-targeting":"14.0.0-canary.32b391398.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_14.0.0-canary.32b391398.0_1647539951809_0.6851324512860708","host":"s3://npm-registry-packages"}},"14.0.0-canary.ae8a6a3a3.0":{"name":"@material/slider","version":"14.0.0-canary.ae8a6a3a3.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@14.0.0-canary.ae8a6a3a3.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"10a13843a73b41b5d5f25a55a33ecb5d810751f1","tarball":"https://registry.npmjs.org/@material/slider/-/slider-14.0.0-canary.ae8a6a3a3.0.tgz","fileCount":37,"integrity":"sha512-uhkr7pi91nf40zx1P5NHUIdTd4YSPkauGlFcABZg+BPhrugx+AdfKri7WYQ8zzWmH+kTeZ38dmgzO2BWZ6K5tQ==","signatures":[{"sig":"MEUCIQCHC8uMiZNWvAJfI/65Ksao47703KKne4Hv8O1LyUHSHAIgcEUHYjdz0YlCZwmUnkpcTDbciBcz3ffYb2m7INdM25M=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":903484,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiNLWxACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq7XxAAhzZQ/q0NQBUfyQyh4mFwBg4uEndc40CfQxKB9yQlwm3uYLqO\r\n+bN4oJXv00d3/9F8gl9pc9hDZEGEk0s2w+behjPZYKbkYserQRzNDOmTj/KF\r\nmO+HYWVj2lUJKg/U/hjjWxnocDWlqCl45cNuoGtT8xOgeNJL6E1u4qkHGHXs\r\nk/MjEgHvx6b56Ut+v3ARcuQWHrFmj54s5d7PnxBXqm3yDbSliEW+asMh/HNB\r\nMizVz8zka0/SnHwZBfYCpOzbAfopyiPrDf/qYdzj82LQ/zevCz2gdav5hJu8\r\nXYf6pPxI5x8+HYxKNi6seOuYK7obCjJlVV5aT1l1MevtajAz6wQsisr9vfqI\r\ny/SNBdBJSFM3q1luiSJ0VrOMGsV35u1eEQMICCZQCqLh98dLrYLbZft4V9QM\r\nlDTHrXsNIoEJVQCmz0OyLZy53LtQ10XH+ycRqnMB06ONVDDhuoRIVAna/Y1M\r\nJ0gua1QqCBvSFk/NaWSHG3b5lgNvJbgufMrJSsKZ2hrgyw/J20TcAg0eW7pF\r\ndhZ3lNLtEJHYuKuDlu+tIOc8g0We/ebRjVnAC6/BqDVimejlHZBlzROEYmuR\r\nqILaL0k8Ymm26uorYRuQhyJr5Cu5X+9vMpQFwGYT6PNgwhQO3E67o1cUAENf\r\nl+6iw/gbNPikEPooRm+iX+aBC5AbMJewX6s=\r\n=AnAB\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"783283a1304f941e05b3ef25b9a589158368c595","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.19.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.19.0","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.ae8a6a3a3.0","@material/rtl":"14.0.0-canary.ae8a6a3a3.0","@material/base":"14.0.0-canary.ae8a6a3a3.0","@material/theme":"14.0.0-canary.ae8a6a3a3.0","@material/ripple":"14.0.0-canary.ae8a6a3a3.0","@material/animation":"14.0.0-canary.ae8a6a3a3.0","@material/elevation":"14.0.0-canary.ae8a6a3a3.0","@material/typography":"14.0.0-canary.ae8a6a3a3.0","@material/feature-targeting":"14.0.0-canary.ae8a6a3a3.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_14.0.0-canary.ae8a6a3a3.0_1647621553259_0.050194211570228076","host":"s3://npm-registry-packages"}},"14.0.0-canary.cbd9358a6.0":{"name":"@material/slider","version":"14.0.0-canary.cbd9358a6.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@14.0.0-canary.cbd9358a6.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"6be59553caaae148c440111d261c9502969aa439","tarball":"https://registry.npmjs.org/@material/slider/-/slider-14.0.0-canary.cbd9358a6.0.tgz","fileCount":37,"integrity":"sha512-fnfr/CpaaGN5ucpCC1Tag1jgzhqeidX6mG6B6J7mVgc8mPW1PZGQfTGTYf87+GL1B9I7QuF98fC1Eh4OnSeOPg==","signatures":[{"sig":"MEUCIQDxuZiXyDTBWTSv119aNqfDe4QhNZ7S31JZLbhe5SLITgIgK5CNvkgyrIft65h4fff3TsB6s/tZRiJy9QyHUb3tCVE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":903484,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiNQ0QACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqISQ//X5456gXfqTvJG7m7wSDXBLPFUNb3OkSuo2sZl+Agto6SRw54\r\nDGF8YzOvz+ynSr2uzpPZCrbyumV5Oanr2dowq4yDsmAWIL2l/qLOxYlboYC9\r\nUAZ+guhmKzVJgHmcNljFrcISNt9A/2p43/eu2ojT6UH1dTEFKDjTZ0+0C44Q\r\ntyyKDVu05iV8b442mslWW5auzpr1VCNWfa5gCF8SkZ11EdlA86+zgHXI6HQx\r\nRZ4dq7ikjT9h5QMQVgrhcw9FplsmT2JaCV33XInkESfqJd5y3Y/j3lqEKpYy\r\npYg4Ilo5A3Gj5bxZrKzoYW34gBR4SNc93FZnuuxa8mh3kF67LtlrBrf9VCoX\r\nrlxREpQaJTNl9oLcKCdney4ithNwhVWRdiTC6aJRSYMCklljPPVE5qYLmngB\r\nsSKZk5b7GPXoCdIc8lgQaVyuucAbqNrs7/lHCKvf0xLu07pGm4bq/GjU8xh7\r\niC6Qqew6gNxYidUXSdUif1k55nT1KqSU/YIFqr2w73U2oh1zoH75EkVYBZCv\r\nMKaRQrBe/NyQsbOU2UsN6oJ7c/jAsNHNO4MGscco1ONtSm9wW93NZJuRgmS0\r\nJ7IWgJfhA3fD+5utkNWz90C3hJBdjelnClGdcAvvj4pkR0qVwWhbz328LDXA\r\n6+hF93i19MLyFlwfYxwFYIJ0SKG+iGXmso0=\r\n=NIeF\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"a4296a048e6aa0c1ab8e8d2cc6cb8321c24dab9f","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.19.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.19.0","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.cbd9358a6.0","@material/rtl":"14.0.0-canary.cbd9358a6.0","@material/base":"14.0.0-canary.cbd9358a6.0","@material/theme":"14.0.0-canary.cbd9358a6.0","@material/ripple":"14.0.0-canary.cbd9358a6.0","@material/animation":"14.0.0-canary.cbd9358a6.0","@material/elevation":"14.0.0-canary.cbd9358a6.0","@material/typography":"14.0.0-canary.cbd9358a6.0","@material/feature-targeting":"14.0.0-canary.cbd9358a6.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_14.0.0-canary.cbd9358a6.0_1647643919986_0.11317319741167187","host":"s3://npm-registry-packages"}},"14.0.0-canary.dcfe49c98.0":{"name":"@material/slider","version":"14.0.0-canary.dcfe49c98.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@14.0.0-canary.dcfe49c98.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"7b895d35b333af7b121d6311de81c6c5fcb722b0","tarball":"https://registry.npmjs.org/@material/slider/-/slider-14.0.0-canary.dcfe49c98.0.tgz","fileCount":37,"integrity":"sha512-a2im6U580ecZBhXmvwX9peFim27nQOKAhiyq8JRIRPjRQc6Q7lmEZpWrP087jnsyiBPDS0P2l9HFGJjTYGFaoA==","signatures":[{"sig":"MEYCIQCfma2Fg9QBculq9s4NWeWZblxqhpAacDIU2F8CVFcqzgIhANzUbABw8gqH5Du6R1qrupgjUTskD3ZUFQq01u+EPx9v","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":903484,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiOMd0ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpjAhAAhc5Es+C4LpuEXKHIoA+NwiQ3gQ2bZcBLy/qEeyaqqV2S6G4R\r\nA4Jvyi0bLhtzUKIx2eKu92oJJG29svjA12rVddI/Jy4gV4aYcpxvFzE1ExM3\r\nCEbl2drERHB8cf2H0R5X+V4TX/xbZzZR6TGLQT64IDIOPL1nWZ6dBzOz5It9\r\nPUnX2KsP19zj6ZwZzoAXD5IiQoXGWAJfYRQbRr+ifV9KdMyt2E/JIsDvsApG\r\nGfi5ZjQ7OoNQ8UfYr3uilGq7CIaKReGrtq315OmtURRRBfQKwpmHU3M9p9no\r\nCATLTew1bEUTWAkatsXo085n/Kkg6MMkqPCck839VLGih4VY2wY3WfAAYODH\r\n0s1EmjRkNStTn1s4Ow40N/UYtLhMQuDHIAVYBAnAidiiCM2Pgr9XXp8cFeEd\r\nu3vyiojADiF/k5s7AIESyo7SihCOIXbid3t1LSaafECNT7ThruyBXzdDySKO\r\n2JgqQx+sLkVvNlEfYhPLKt8IwNoNPitYhBtt7McM+bbXLemVFGdlC4KVjxVk\r\nh2G1ixXY4DIrEgM5JNSlpmuf8IXFXNcsqfN33MgKvezwsQ0yKfOPhkj2crPx\r\n0yerslltNoxqbevFjLx33HNQ+Cp4Q6c8uTsV0EljBRwP7mkgblnUFM0f4KtB\r\nzucLQZZwNyL4WGU7QfVWgabUeqKunDI59dQ=\r\n=u0Fl\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"5b68455eaf6aaf2f571eb64a1d8a5edaba58d37e","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.19.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.19.0","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.dcfe49c98.0","@material/rtl":"14.0.0-canary.dcfe49c98.0","@material/base":"14.0.0-canary.dcfe49c98.0","@material/theme":"14.0.0-canary.dcfe49c98.0","@material/ripple":"14.0.0-canary.dcfe49c98.0","@material/animation":"14.0.0-canary.dcfe49c98.0","@material/elevation":"14.0.0-canary.dcfe49c98.0","@material/typography":"14.0.0-canary.dcfe49c98.0","@material/feature-targeting":"14.0.0-canary.dcfe49c98.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_14.0.0-canary.dcfe49c98.0_1647888243639_0.0983502260013398","host":"s3://npm-registry-packages"}},"14.0.0-canary.f31a833fa.0":{"name":"@material/slider","version":"14.0.0-canary.f31a833fa.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@14.0.0-canary.f31a833fa.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"23105166888a39c3f6df8182a867707cbeb297f0","tarball":"https://registry.npmjs.org/@material/slider/-/slider-14.0.0-canary.f31a833fa.0.tgz","fileCount":37,"integrity":"sha512-WPSxVLa/PtvRZ0vcdMChAKVKNOCJf0sdJkdA2+CxEgLGz8+lsBFzAdU8JdFDfNG4j1EzRaoUwCxXMzk/lGLe+g==","signatures":[{"sig":"MEUCIQDqTBlGrgokPG3ARr463CqsF7/NO4dH1YxQXyDWcWLQxQIgJgsjmiJ2S+BElUtCbMmYKrgSB2dBJfO8WNV7UO8sa7s=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":903484,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiOm7lACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmrqaw//ftRfH5FlbkmeOPTyzPq4EUmw0ARbJulKZRYsCygKRDCDib8J\r\npigXSzwBpDVR4IQidjeafWCoIeqS8CnC01zGppaz3olJS26hZCbq7MGCYClu\r\ny9ozin5aoIoSo+PdWPy2qrUGg6iNvNLzpUyfuOfO4A5MBZkIU1/bOo7gkyE9\r\nqmQ2SDkx5rB8Y3fT1MVCereCKOOEfOVTqH6IDpXMFHEWXgLRq6FHjLzX+hPH\r\n6F1FcJFVrxIGAUx1dn5l8VAm9n7D0xG5a0I4Q9ki7obhx4t9HiEfehCL7Hzh\r\niKXS4QooxVlOgTiVJkoKyyt+4PjSs2PedLBjXDexc1KMKzWcxPcNABnM74hZ\r\nKP2yvvt940eZlf8OE06sf8PFY3FTyYP8n7198Sap+A4TOSZNcL72sTnN991c\r\n07lfH0lOvxXegMhGVc4zOwa7MW3WjOC2e0yrA/FcOr4/oUl/UeEep3d+1SdH\r\nbYY/T4tBFkZO9mFagnYpfMp9WW8lTcIGbgXB257CbQcOuhQtfEUbY4nlWFsu\r\nl0KnS2BG1VbhmoeIYKjPYC4+YHrNuGYehLvZOLh3pi945W1TZ8t1jZ/G2Nw7\r\nbrU/4BvJ70JdIfNVikvMHiPSatfJ1/EcFR3OG8KyVmcwcPg5g8YBp/XG8FGG\r\nD+NvU1nEmZKvI3/rYg7Zw2lNBFXqycWMlUU=\r\n=sNxF\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"28572f217366c634964a133bbf0ee0b8e88b8126","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.19.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.19.0","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.f31a833fa.0","@material/rtl":"14.0.0-canary.f31a833fa.0","@material/base":"14.0.0-canary.f31a833fa.0","@material/theme":"14.0.0-canary.f31a833fa.0","@material/ripple":"14.0.0-canary.f31a833fa.0","@material/animation":"14.0.0-canary.f31a833fa.0","@material/elevation":"14.0.0-canary.f31a833fa.0","@material/typography":"14.0.0-canary.f31a833fa.0","@material/feature-targeting":"14.0.0-canary.f31a833fa.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_14.0.0-canary.f31a833fa.0_1647996644828_0.01568049257531845","host":"s3://npm-registry-packages"}},"14.0.0-canary.4b92e210a.0":{"name":"@material/slider","version":"14.0.0-canary.4b92e210a.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@14.0.0-canary.4b92e210a.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"597fb05fbba6d5dfe0bbff1e41f7a7992a69e8d6","tarball":"https://registry.npmjs.org/@material/slider/-/slider-14.0.0-canary.4b92e210a.0.tgz","fileCount":37,"integrity":"sha512-cGD8XEaZ0vkXKOt4WT86OE/fjyvPrQZGDZWQ8ydZDI4Q9wxEclm1RCkHEBWjklNLNGjGqpb6BDTUPdgd/Gm39A==","signatures":[{"sig":"MEUCIQCHjw8ma34czmE2DB8hi8Mfh4fcqUQJQreRfsGY+XV7GwIgQ94Uo0gp7jrzO3m7J8mVt0IlU+d542nw4jYMqxhIZfs=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":903477,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiPNIZACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmpbrg/+MwTj3/WVBSosvfjR2E02kkSeb9SFIAL1XpCxfWDW1koP5B5f\r\nZY8aKsd4ykJPJojOp8hNvd9XdiepRWIygXOuclkHAOU3aKCa3P6UCkCJrL4M\r\nDndzOWkJXkHqHSlE4lZxa4X1gmErJ1YsG846XgaKnDo9Xleegp7qhYRAU+Qy\r\nNSTv8NjuKHsne0qLWoErmXiYVQPH1CWAkfNEMT8F7Y1+LSpPqv8FTVO7MEiM\r\n/i9EC1wJTm2w9sm2XXAtseGGFmVyAIZOn2Vpicum2tTJmDXWUdV9+McwKD+/\r\n7ZCVILez9tKxXIBKmZyiLcVPLnRBdrGoYrhCldBRz5EnJhYV2vTiaeViDO8v\r\nlhANDI50Kdv/alMbRztk4ZUZySrNWc9h9wMEaZ155/zxlHIjl7Lrm8xXeeAs\r\n4vqf9UIqOtAWWoXepbqZAxk+Y4IYqcSgEZl/tZ1gc3+Z7yAvoy7USQMJ1GCk\r\n+ixEhOZEY1YIpRdygnM0injalYEXZrIY+ASlxAeuRBA8AXP0o3AzQ9OfFcWk\r\nTw6UB3aeTeRxUS0GjZLE4V9dSfIlGMB3RS2slf57BvbIxCsbMHCKHduqVnhG\r\noZVGtMw5vnuhzNhV4cwAn90TbQzvgXO9v3+fl2hB1zkSJa8ELkR5QNapDJTM\r\no3scJtCBWon8Xuo3mUvGHqIAbFJTUOYCGlo=\r\n=6y61\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"e9fc48f242a1815183c2b4c74ea1f8bb9967004b","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.19.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.19.0","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.4b92e210a.0","@material/rtl":"14.0.0-canary.4b92e210a.0","@material/base":"14.0.0-canary.4b92e210a.0","@material/theme":"14.0.0-canary.4b92e210a.0","@material/ripple":"14.0.0-canary.4b92e210a.0","@material/animation":"14.0.0-canary.4b92e210a.0","@material/elevation":"14.0.0-canary.4b92e210a.0","@material/typography":"14.0.0-canary.4b92e210a.0","@material/feature-targeting":"14.0.0-canary.4b92e210a.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_14.0.0-canary.4b92e210a.0_1648153113272_0.8741321709084175","host":"s3://npm-registry-packages"}},"14.0.0-canary.a657abb61.0":{"name":"@material/slider","version":"14.0.0-canary.a657abb61.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@14.0.0-canary.a657abb61.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"23ba6a9b56770c90300cb9960c57dddfa0853110","tarball":"https://registry.npmjs.org/@material/slider/-/slider-14.0.0-canary.a657abb61.0.tgz","fileCount":37,"integrity":"sha512-0ye7ygKZKNx8R9ynP35z/ayYPbf6AZa7gX+i06DgprKQznYJsCBxhwfMHyQuQTIiUSBS4DCic4oa669EhVCjwg==","signatures":[{"sig":"MEUCIDCt8IXttJgjXAc6uo5h/1pCm4CHaC1oOmzmC+3qiGd0AiEA1F9l7AAHl8AgEpnR0tesBxcVl/Sj+U7XMFRDpFnXOEg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":903477,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiPNcbACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrDnw//adewz96KLhNzKzTEX8gAj+2WCr6IYxB832sBJ8Nnd0J5BRFC\r\n53oxqJ8zmquT8X5GQlofbmC82jSUGrtvBfyUzbG0cCwnVt4i0aoBzrEbJuUU\r\nsC/qy2a7Xd6eXNba74aNggbOdzLjoNkEKLNV/nJDfrJs39wyn/ldRp+sk8Eq\r\nTHXic6Rl5yH3h5Lo2Z7p2EA7GYh3eekS3JmkfeeETYfNx/l/BNgzyHzOpcAh\r\njtAwlt4Tle2DAnnJ/NhOwkradnR7azEf0LBfZnP2i4lUSffRKWLZ6dhngU99\r\n18VUkBf3GM36Uu8EXMDiXh4kijk4sw9YYp2DGJzJBWOLKsMaI9hVcvrYNa85\r\nHrmTyfUdFtRAw3VNHVSleIW0VyurhNiA/DkN2vqJ7tNOvEYjQG2Ht+yKozaq\r\nUIaLzT69rdWFb6RFbYOHFP23hiPnEhfenduNqU5hLVU3oCiw2Sum4Cfu5Gnr\r\nve+GV/3lg3hoFbNwkW6sYRgO9Mj27ET2oCfBUSevrC0/c4SFZxWw0O/JLo2n\r\nCquFyijixXIbzLSzNN8fOskYrxmH5FS0t84sXFP7PGAo8EJKl1Rw3CWkrK6q\r\ndBd25SKt1ILvEJC8WyJqx82gbhDE9Ok/OM4t1/0vC/09mM1jD1J6eoD1MNAD\r\nxqFtFJEqKZImp4FVfUcm9cbRs+uuUbejqbM=\r\n=frMW\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"b17ff714094456afc14ac1ac896e38f85e300743","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.19.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.19.0","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.a657abb61.0","@material/rtl":"14.0.0-canary.a657abb61.0","@material/base":"14.0.0-canary.a657abb61.0","@material/theme":"14.0.0-canary.a657abb61.0","@material/ripple":"14.0.0-canary.a657abb61.0","@material/animation":"14.0.0-canary.a657abb61.0","@material/elevation":"14.0.0-canary.a657abb61.0","@material/typography":"14.0.0-canary.a657abb61.0","@material/feature-targeting":"14.0.0-canary.a657abb61.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_14.0.0-canary.a657abb61.0_1648154395356_0.4398659650008454","host":"s3://npm-registry-packages"}},"14.0.0-canary.443f63f50.0":{"name":"@material/slider","version":"14.0.0-canary.443f63f50.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@14.0.0-canary.443f63f50.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"0495e596c7a2b141426ee4fd79bcb99208101c0b","tarball":"https://registry.npmjs.org/@material/slider/-/slider-14.0.0-canary.443f63f50.0.tgz","fileCount":37,"integrity":"sha512-zofdmaB3j2i0WCD2mQhLefMMbEpdS/mU0E4/7Ol8VFFQLBRJz36So40S6a+kk8auNbV8cyXEQFJdlSY2YvzLzw==","signatures":[{"sig":"MEQCIAnIN2bdo6Cf4og/Qxn5cDj76gEvbCXdzMT9thRpJAluAiA82jabD4A1T0RDsWnZxZFUdKQgcHdV6aIK/0AXs3nRKQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":903477,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiPkqDACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoBpxAAlHWaBjcjS1GgDSzGqie6L1Zfb3l3iNdk6RdhR7MMvGnnug1x\r\nsa5Fd8R8QoniZArKweXZhu+6e4AFSsX3YXSCg8WC7GT8je0v5TxLTJswq6Tm\r\nNN5DKYgFSS5EWc2iDtuXmp2NJF2o3YZbEPstbg7higXlpp7cvTx32uoT0OQK\r\nvq8uy3NjEur9nzoEmBpIbVo0cocWoAhbhOVofBVhQHo5DKnd2/sOsdMNE1D2\r\nIHVS7B+ueNZmzthSdvK9wblf1LrwNB7j0VZMqLKJ7+C5+Sdw7PAi93ZYpGUe\r\n4TRQcJQZcHayuR6jiBSGpf1nHTOy39gFVNzwSuRPnkXPqQjs0wMR9bLW+eZL\r\nZXy8oEYKbH6GhyfaQrufSMLpHVu/zRu1wSIndbvpkISVzCWyN00wueq3i6ON\r\nh3p1RfdOV7QcsGBrUnSguWw8JuRz3ZkyKW723CnXwirfOUWGb6UkB2CkS04S\r\n49ffq5oanZI+R71Xv/dHsgbh8Vryri9TPVnjcJ+zrU8NMppuo5M1grshyPiE\r\n1zn8mpPEArWVauU0bUdfFgXEdKscAdk3syH9Sd7kVGS3PuUBjgqAWCYart+i\r\ngu6No3iAh6NB8Qxpdrv2rpze6WNA+WkEm+pcZV3OGlKHeHb1FyOiibRbLma2\r\nW/5OFLP31di2mzF+eC61hqwjdf6+oKZaby0=\r\n=kh/Q\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"0a9e4a4d027bc972dd036582cbc94abd30d3cd60","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.19.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.19.0","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.443f63f50.0","@material/rtl":"14.0.0-canary.443f63f50.0","@material/base":"14.0.0-canary.443f63f50.0","@material/theme":"14.0.0-canary.443f63f50.0","@material/ripple":"14.0.0-canary.443f63f50.0","@material/animation":"14.0.0-canary.443f63f50.0","@material/elevation":"14.0.0-canary.443f63f50.0","@material/typography":"14.0.0-canary.443f63f50.0","@material/feature-targeting":"14.0.0-canary.443f63f50.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_14.0.0-canary.443f63f50.0_1648249475013_0.9351270684391126","host":"s3://npm-registry-packages"}},"14.0.0-canary.eb382f318.0":{"name":"@material/slider","version":"14.0.0-canary.eb382f318.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@14.0.0-canary.eb382f318.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"8643a68594d397bd3d1f9ecccc6c24eef1d25b2c","tarball":"https://registry.npmjs.org/@material/slider/-/slider-14.0.0-canary.eb382f318.0.tgz","fileCount":37,"integrity":"sha512-Bt49Dy6My7yEleuPKWuMVn40pBhj7/bq2U6jU1AUoliqwqsqvgaI+EDoyM7GAHro4KBWTWl7u0M3A0DR2BAJmA==","signatures":[{"sig":"MEYCIQCgsHCgm562hEz8k+fUOmHGeDGNCHCXokUvVE9Rta2WUgIhAO0rSdP94o9XH38kdlY3CcH4pk+BYg8b7r1g3jgHulvq","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":903477,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiQ0M/ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoZ9w/+NNH7d1CooKI1xbqE2T6kJr4P26Od9bzWSpAtoqhqdnkcdah/\r\nebMZNrqBLt8iYTUlseZ298I1WDRhnrQrHFVfVBP45Wfu70SmmYIy1Nzh2p50\r\ngbdWXQfxsxnEG64znJRN9cJt+2j2JOYkR47GyyjropYGS6YCMhX6HMIp1ZcT\r\n+Gdb0FDo2rXcO5IMcGghHeixLl8KcC0Q3PzWD+jCjC9MMblD1L0ZiklzEn/m\r\nWCaLXrJsdf8+TbU60UxK9dC3xWNdKGvT8wovz7T/ZVNXXWFAq0p+ibtjnmSb\r\nfXj7zaUkGb+qwNUw3r9+ailnyawPSrOyx6hWYKmv5jfu1hWfbLcnGBupfULH\r\nCNfpnxvHDB37NctLeY84jLQSIGts2yDTf4Xs9EQ92U/D+VeNdDBbB8ry9kuN\r\nPMJafR8kFGLG6M/iw92xwvE0d/GIqVXrtm1lTeLDOxd8Ba6CCwurxtKivIPu\r\nD5yH8R0BEDdf9l39Eyin6zhknK+wSvqzROxuOPKH8JPvP4EJqoqlsbzAE7nN\r\nwH5idaxMQgfOQ+/39AyGh67fi/RRzjbrPouyEjvEkl7yb6xOApyg7sm9BXDd\r\nMex7D3qbnuiR8F0agtQv8tSbBf2WM1voC86CmkKIezy43VvISXy+NQb5Y2lX\r\nx+YCOb7SQolynke9P2mGZUqF0VdwrGirsm8=\r\n=5dg4\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"9aaa59e82abd1f56fdb3d963213242fe4f989c89","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.19.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.19.0","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.eb382f318.0","@material/rtl":"14.0.0-canary.eb382f318.0","@material/base":"14.0.0-canary.eb382f318.0","@material/theme":"14.0.0-canary.eb382f318.0","@material/ripple":"14.0.0-canary.eb382f318.0","@material/animation":"14.0.0-canary.eb382f318.0","@material/elevation":"14.0.0-canary.eb382f318.0","@material/typography":"14.0.0-canary.eb382f318.0","@material/feature-targeting":"14.0.0-canary.eb382f318.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_14.0.0-canary.eb382f318.0_1648575294861_0.22774009603694578","host":"s3://npm-registry-packages"}},"14.0.0-canary.344d52823.0":{"name":"@material/slider","version":"14.0.0-canary.344d52823.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@14.0.0-canary.344d52823.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"473129a8df4836e81d04a21e05781a3d553ced53","tarball":"https://registry.npmjs.org/@material/slider/-/slider-14.0.0-canary.344d52823.0.tgz","fileCount":37,"integrity":"sha512-BWYO9hx6MGcJLz9+GuDzH1/MaiYCCqK+8JQEouiWPBOgdF88hpQ7FbRRyCG6c2MA09E8i1sFK3OmPP1e0FweQw==","signatures":[{"sig":"MEYCIQDCaQ7I7d3EEhjVEMTyyhZh2P7Uv62g8eiHNpQQKxTOpAIhAJKh653pk5b8foI25QybJx2VPmFq6FXbQJHNS/afbZZN","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":903477,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiQ1NDACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqMYw//S3Dn6jztWFfI/w50Vj+m8188dPLl1P2eKiaAhrZ2dNPZNKhp\r\nY2RxkVuCwtH5+BYYYTAYWAFr3z3u731hB9uvI0E2hxxwM1/IcQvOzOsslGvM\r\naijOV4bDUup4rnvAE+9wxi+eio+UgcCJhNybLq8kAB+hL+DZHzg0pRFEJrOE\r\no5KcTxsf4wk0IOXMnSI8PC6ZbUtYmaq5WYh+V3pUOJ2K1l95kUtWXbNMUIu9\r\n4QGu0w5tYvegI4hLRtzGwcdwOSdbN5oKR6ZuQHI88lmaS+eM746i2BS3A9dD\r\nCTANwpF3+mxIKdSkgUTXRWVRni6Liokts/A6lCJPbS1ZuygdiW8fhHMr7oeX\r\nsZNMdv8ERL8UG8QEzSrhj/dZ7UL0Ry65YWf0C361l3RfY0FwbF4XVG95ZLAD\r\n73VJYTXmcYOXWhXOlcvJ9m77hhPg0AQpiYIPqwiVFEKNmQUVF7ySgvfa/Qfe\r\n43SAteHiegHqm037dHX4w9I9G4QtLfNpGOVCwbvNuZjQRVGjrcoOa2Z6KnBM\r\nuCWLEg8oukoq4tOmjbze3ziDo7rGDSLK0IQ/8Tkzb9yMTsjB6XcY9eBUI9Ef\r\nkY/4gGUd6zZ1p9kUzKUQM918ZxWr6605cEXM8Tje5uKiVP7SaKBmgwyl+Uiq\r\n2oIA8jLITutyKyxC4R/OBDocP7L312ndL0g=\r\n=RuIA\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"1d0b3e3b77ca281daab88499a03131363e8ce97f","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.19.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.19.0","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.344d52823.0","@material/rtl":"14.0.0-canary.344d52823.0","@material/base":"14.0.0-canary.344d52823.0","@material/theme":"14.0.0-canary.344d52823.0","@material/ripple":"14.0.0-canary.344d52823.0","@material/animation":"14.0.0-canary.344d52823.0","@material/elevation":"14.0.0-canary.344d52823.0","@material/typography":"14.0.0-canary.344d52823.0","@material/feature-targeting":"14.0.0-canary.344d52823.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_14.0.0-canary.344d52823.0_1648579395476_0.17307814954914247","host":"s3://npm-registry-packages"}},"14.0.0-canary.4e372fb49.0":{"name":"@material/slider","version":"14.0.0-canary.4e372fb49.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@14.0.0-canary.4e372fb49.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"57db3da1ea86f7c27d053247d224c03219b3f593","tarball":"https://registry.npmjs.org/@material/slider/-/slider-14.0.0-canary.4e372fb49.0.tgz","fileCount":37,"integrity":"sha512-7cPM7FUmuVL8C5M3/kdICg2K93YsRmaQW7vccYgWpTp6na4f5TpKeQwqa94aNIFaaKS7BXfxDZmEfn7KWbsWBw==","signatures":[{"sig":"MEUCIQDEXgG8yX8TYN7FoHffkDPnnMeV4G5eUUeYVZfpaGfddAIgdebFFzD0iFDsvXDHXLQBjvO/aahFnHa9/xSnVcx8O1E=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":903477,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiT0p3ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqM6A/8DmCkviO78h6pjvd82fqEpLAhj326V9M1qPBKS3Nh+DKlr+jz\r\n2CmSbuT5gGXAxijr49715jo8P/8TOW+zuiThdr1+aY74NzI/sm3ctalrOjUQ\r\nPJuWCZdihOZwnFKCvehakzvxHtB0d2hrqDI+/NlOMyh8mY6kOMTm0RvmOnnE\r\n0Wt2yunYl8xE0JjkbxpJcLHreN2cpu2uCLxVGRrRNIt8dzNYZszY+l+VdJ5e\r\n/gqwUu1jbynTN3s66Dm0OYyunAcWiWPThoa/KgkEm+RW9gyZuIIq3JZ3p8Rx\r\nUBG8fK0/VhN8bFv69UvN7yst+ZJdDJeRj5p9rw9CEImUSHBwUdmqN2BkNvM/\r\nFLhTX0qr6v1FgU9mAaloYHdZ7a2BM0a2fcPSEKqSkdCSEPNW3MavToG9TQab\r\n7eW6mEf10+EwXLINMM48Xv0FI0cKT4GwBnpo4f4WE8q+vr3sKKFErTk+chIi\r\nvxkN7Wvi1O/4AXIp5/IXRPECxahUM/R5AAZnIIDr4lbguRnayZVGYp3ssqQC\r\nIx8dthVs7WNODAbOMMlmXKSPBSdgP32ie+dHNcDAEcy9HSXvdXu62APfijVg\r\nQ+113fvgDESPODAKvtfjfvk1klCG8Sc+bbhrisSnqlnFwIdCPdAScIgNq9DB\r\nNnJk/+GHwCy2gfdAd85+2uD1/BuyWNA6m9w=\r\n=Zh7R\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"013d3cd7cc6d83c59581f40ea832529343f43047","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.19.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.19.1","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.4e372fb49.0","@material/rtl":"14.0.0-canary.4e372fb49.0","@material/base":"14.0.0-canary.4e372fb49.0","@material/theme":"14.0.0-canary.4e372fb49.0","@material/ripple":"14.0.0-canary.4e372fb49.0","@material/animation":"14.0.0-canary.4e372fb49.0","@material/elevation":"14.0.0-canary.4e372fb49.0","@material/typography":"14.0.0-canary.4e372fb49.0","@material/feature-targeting":"14.0.0-canary.4e372fb49.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_14.0.0-canary.4e372fb49.0_1649363575144_0.4419347041118211","host":"s3://npm-registry-packages"}},"14.0.0-canary.3e30054fb.0":{"name":"@material/slider","version":"14.0.0-canary.3e30054fb.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@14.0.0-canary.3e30054fb.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"04d8b4f4feb0ea12ca4bfad6fcb7329357b98879","tarball":"https://registry.npmjs.org/@material/slider/-/slider-14.0.0-canary.3e30054fb.0.tgz","fileCount":37,"integrity":"sha512-Zywog09ZScoJl0MBusXvt/kLTnmz+QE5m2ijLPLQ0nHl6cRN6rynTU6ZCtLL4ICT93YuuAmDvWUXhXiBY9kM8Q==","signatures":[{"sig":"MEYCIQD5jbrpfUfVSALWcgqcko4/OaHwRZQ1k2k/BmCgiZ6MrQIhAKEy0+rkO7lBzMLyb51pSxMtvke2IiUCXbLg75z+q97s","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":903477,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiV0s2ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpeBhAAovYewY3A7g0n5Y/N5iPWEH8J8zxoqNdnyRQ9SE0oBBbW0pwh\r\nS6FDTUM4A7nLYxrjcozye/YTHKed9IOWQYJfsk/+zdXdfy6NiiQyT63gUEfW\r\nmEngR7gyiOKUrILmZ9AIT4JxvApmMlGkkvFxiIY7oJEdBZX1bg8U8p++YBZa\r\nGK+29u8Ftxf9U1uKMbLCv0N0pwfvgxPt4m9+hqd+x+s/CR4kqAHlE1QxEePd\r\nxIHE4BnCGfLGByzLD+ZKId932eER+nvK3ODoaQHV5Ux6loA5UTF4ZM4ECfm+\r\ngr/mANI/GhGTTQAwBXHJ7+F1lTXaFEWg6VJJaRthSEgjR0ydyKNAMWcl8kI7\r\n4x+wZ1shq6cE0YkOOH8o2wGJwNgvmuyA5Ty8Oi4NjLEEEHCOoP5ogynB4m4e\r\nYwDO4YENHiqbFgTFKg+k1yOj/wz+1TvVPHXZA5ep941zZYseGvj7xVreyUZd\r\n8NP8jtTj5hC21KO+V9pd3GlTUvdf9kHoHAidLPqEm62VqT8Gz2pg5ArcZJ3c\r\nHhJJF2BAIe/5tzIoBq42fw92a3xOPhxLN/3QvZTtOrOgb1E5iBbgH/KKGe3W\r\nZce35Oz5IA/oVEbg/LHmEsxJNHKuG7xQfRCDx2j7TAUqrarsdKlsM8nWDuaH\r\nK9Yorq7pDmZI1BtXQLl2OfRFbkiMTkqOiWg=\r\n=ricP\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"04d79139861b90bf3488ab3f74e4bc33e6af1c8d","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.19.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.19.1","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.3e30054fb.0","@material/rtl":"14.0.0-canary.3e30054fb.0","@material/base":"14.0.0-canary.3e30054fb.0","@material/theme":"14.0.0-canary.3e30054fb.0","@material/ripple":"14.0.0-canary.3e30054fb.0","@material/animation":"14.0.0-canary.3e30054fb.0","@material/elevation":"14.0.0-canary.3e30054fb.0","@material/typography":"14.0.0-canary.3e30054fb.0","@material/feature-targeting":"14.0.0-canary.3e30054fb.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_14.0.0-canary.3e30054fb.0_1649888054671_0.8576630067935886","host":"s3://npm-registry-packages"}},"14.0.0-canary.8c4da223a.0":{"name":"@material/slider","version":"14.0.0-canary.8c4da223a.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@14.0.0-canary.8c4da223a.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"7abe8e533dd8ea52df5b6ce7c680c64450a2c148","tarball":"https://registry.npmjs.org/@material/slider/-/slider-14.0.0-canary.8c4da223a.0.tgz","fileCount":37,"integrity":"sha512-qAcdfkg1lr6Cgk80cXVdxKqWh75RmUCZP7Z1zExwk0166ILxjpD96NaLRNPkiaN3z9kw+JEPPJLXSeMYgJGKgQ==","signatures":[{"sig":"MEQCIGR0Hnpr344cmFr2QFgprUljP4fT/yDalnH7ZpUjsaMBAiBU3CQuGrghvCTiyyRSe18z50tqXO3uHpV2rRhcgNcKoQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":903477,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiXtQbACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmogzA//Z6p72vzz/uI+jS3Ku0UNACrt9lJ70KYfsQzytsRYGw1p63ks\r\noXGRl2nGbta0wHUT3wicnIvCUYi+L+HXRwtmy9QJDQL6HpLxmgowfrYTh28e\r\n8bn0SXNMDELJVOca7/PC/IqdPZdztLZc+RYgBezhmnmWyvRheGKDbteSXeRv\r\ngeG2Nm5H6Q1QjaFDvECWR7K5nMyS+LNBqsFMrPM5BYKMsth5fVrUpHbtRc4g\r\ngYEvHPG+Kp1To1BkSaNJuxYIGKDnK4SmMXwO60yvEjY/CF2g8c96HVBUa7tu\r\ntN67Y6KXCN4e2mLvQDbTL965YytXvjg3K8yPOJmhakIjTal/dA3eCG+aL0jP\r\nzRwLQgI2a+RmRfdCcPEotGamr4PMLEWUl/riNZHrhKrB+E4aJnccbYdjSjjU\r\nxTU4EOIcWvnEGYc/tN0K3poRlKaDmYOPvzFgBhk5ZMkcby1M9/038M7WQTde\r\ni4Qk4J+IktWNt157KZkWqf/EArZuDFAtOy8SxVHariRlnZ0VHuhf1HMmxiir\r\nLS2hd296z0O9retQA+5TM0exfdRt6dgZNF84zRtgvzIcjKs7jNt4gZVs/BR4\r\nPr9Jz/tSHY2DkrT8oy8JHJhpmtaIJvf+4dV2Mb9ASUob10gN+b480gMTD4Yo\r\nEOVoYnKFIdRy2Wp8XyZuCyLbJOGUYdYIyyk=\r\n=u6/K\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"a5f798a752de150dd0a004bdfc90979ab4185d1d","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.19.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.19.1","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.8c4da223a.0","@material/rtl":"14.0.0-canary.8c4da223a.0","@material/base":"14.0.0-canary.8c4da223a.0","@material/theme":"14.0.0-canary.8c4da223a.0","@material/ripple":"14.0.0-canary.8c4da223a.0","@material/animation":"14.0.0-canary.8c4da223a.0","@material/elevation":"14.0.0-canary.8c4da223a.0","@material/typography":"14.0.0-canary.8c4da223a.0","@material/feature-targeting":"14.0.0-canary.8c4da223a.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_14.0.0-canary.8c4da223a.0_1650381851242_0.8590716063270807","host":"s3://npm-registry-packages"}},"14.0.0-canary.7de8965cc.0":{"name":"@material/slider","version":"14.0.0-canary.7de8965cc.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@14.0.0-canary.7de8965cc.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"2a470e39501d78a2452f2033b53c41debcac82e6","tarball":"https://registry.npmjs.org/@material/slider/-/slider-14.0.0-canary.7de8965cc.0.tgz","fileCount":37,"integrity":"sha512-mx/DIfk4yWa6RAQK0mBy+RICSqCWjEPWYgvwPmw1r15Y/Dx3Zo97pTUT04uEf8m0Jyq77ci4qOsLSrrHiDcaMg==","signatures":[{"sig":"MEUCIEQH/iZ5S4IOeQ6amre0tCd4Z5cRl5f1lC2aP+wB7qCwAiEAwOe4s9kue/PAxGWLzdATvTIlQvKnOIgMe7JDK90GTzA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":903477,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiXxo7ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrI4w/+P6Sx4N6JAO6UTYKqTaGCUTvm06qbohiFXBBMgicmUz551YuO\r\nmoTWkqswzqqGP5iByEaxe5/rkhmc4fAFQ4dPDSMT7rHmiI+Xbppi0tDA2DtJ\r\nGck4NGkqvXBsDjrmLH2QEhVT5Ci/y6ZLpTFla3PQGJk2b+FfV2OKld61ftev\r\nugH7rf4ffQoxGStj2JhcLVRu6Eb0A751LUVjXm2Rsu6c7zjQZIPT462Pu7Jr\r\nfOhmfo1M7cHRqnzxJnZW0fIAZOYRBHKzasRP9blNvvOme+cWG4dIox+z+qcG\r\nuLMtK7SL7Wx9ZUIvEniTQGZXb8swl3LPVdf2zrfe3Aa4Kyty3W4e+ydmlcTN\r\nYA1V/GfPMysaeuI/lpXb6NMJTbGDGT3pFDUBIPxyELXtvIrk/aJtf02N1tn7\r\nfARKrjfoM3ftfmU/F2uEXyAmISq9PB52SjOGE7t3pqDKMnjRwNlF4YhvMnLs\r\ntlSvwGbbxaVZswsMoyVokIGcmPLdhVqL5YeyqP5Jz35tD3yL+8ePJIJ87Sv+\r\npI1u6Z53nx6Y0JrpDxMMFeOzRqn1YA8uYsjrLKaGrtsB3nilY1psxHXtlHat\r\n0Rm9OfgptbB0vs+o/5U6O8v3wBdbp5P2DcZPXZFnAbHn7uLQT9RoG6AfvGQr\r\noYFQ6io9JA3SQgT4hhrPfCw8p6BnoeF7ppc=\r\n=eOD9\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"538ae755c197f0d9a1fd3a2cab5000c498987584","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.19.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.19.1","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.7de8965cc.0","@material/rtl":"14.0.0-canary.7de8965cc.0","@material/base":"14.0.0-canary.7de8965cc.0","@material/theme":"14.0.0-canary.7de8965cc.0","@material/ripple":"14.0.0-canary.7de8965cc.0","@material/animation":"14.0.0-canary.7de8965cc.0","@material/elevation":"14.0.0-canary.7de8965cc.0","@material/typography":"14.0.0-canary.7de8965cc.0","@material/feature-targeting":"14.0.0-canary.7de8965cc.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_14.0.0-canary.7de8965cc.0_1650399802882_0.10121143951498612","host":"s3://npm-registry-packages"}},"14.0.0-canary.641ed0851.0":{"name":"@material/slider","version":"14.0.0-canary.641ed0851.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@14.0.0-canary.641ed0851.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"67b03dd17266bf5a3068a3f84df7eb8f4f94fb51","tarball":"https://registry.npmjs.org/@material/slider/-/slider-14.0.0-canary.641ed0851.0.tgz","fileCount":37,"integrity":"sha512-PULwsAXXzRT4GYoIRIN9UqUs7EX282EZPE2i7RYamVeQtJ4JXi9i4VT5EvQzDI3VBD+x1MhqwMuEU/anWn7I4Q==","signatures":[{"sig":"MEYCIQCDzXuCNtASJCiOguYvtc6kXvh6ZF8XAUr5aKLYJAdv/AIhAPb6diHRvRCW+FacjGOw4mw92DUNq1agTiAST+TRMYgV","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":903477,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiYC9WACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoThw/+PHp4/il85dqZb51VBxrxuDO7S/95cToRsBbpaRZrLKOET2qr\r\nX0uduCDSl0PTX39OZNVFgZI8bzBtfdcZGOA2vpFoXjoDZthjlxeerWxbFkGD\r\nu26qSZ2x7Oz+GL5W4hbLqKk2VqGYN/1xc7wbyONfhPG/h/GKjV0tHJSAcTOP\r\n8RogRLSAXHF7n3CeQzZOD1KyI3hCNnr2epVUkWV9+vFoTjkHeIAJHURPb1jb\r\nnEH86C32nUAMBnDNkioxdoy+65kmHsUAKksanWtNCr6Q9DdM8Oxm12Td00Io\r\nuTBca1NVAFl313GGXfGMdfLS1iVNUJiN9pWE4P64MtpVNh8Sv0U4MUfXB7Io\r\nyxRxZI4CSasUzJqVPMm2NXseaPKEHzcCBdxxVwjG4yUDzPr2befGJPXD0NQu\r\njX3Rp0L9MKk1rNeAhPS/Wo1FtivLR6RrzeAq7gfsG0Nc2Vejs8MLMXmsKYte\r\nvLXTG097kj92PvDkWEITDBWd7Z5BcWbC/KWtjhoZ9Fcu4yj3B1dEvEG9xLHN\r\n2ycX6hShKQfhjaZS1Sk14KgKDuCaYn1D/oBEnze53H/FH63ahxZzE8t3HHAB\r\nKsg4ZqZ6HaqJ4y2olHHqlgVcg2GQWzeQMFmA8JN62oETqD32t6kkGooqD5FC\r\nPwsxB3VnqQJz1yu8o/3fAdevXrJKpS2vRLY=\r\n=2NIs\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"b45ef0f6764b2048f5027d4990cd48d6bdce11ec","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.19.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.19.1","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.641ed0851.0","@material/rtl":"14.0.0-canary.641ed0851.0","@material/base":"14.0.0-canary.641ed0851.0","@material/theme":"14.0.0-canary.641ed0851.0","@material/ripple":"14.0.0-canary.641ed0851.0","@material/animation":"14.0.0-canary.641ed0851.0","@material/elevation":"14.0.0-canary.641ed0851.0","@material/typography":"14.0.0-canary.641ed0851.0","@material/feature-targeting":"14.0.0-canary.641ed0851.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_14.0.0-canary.641ed0851.0_1650470741778_0.7371100666168653","host":"s3://npm-registry-packages"}},"14.0.0-canary.e88f83024.0":{"name":"@material/slider","version":"14.0.0-canary.e88f83024.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@14.0.0-canary.e88f83024.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"93ad81a2360f7afcd120da1f549d4112227deaae","tarball":"https://registry.npmjs.org/@material/slider/-/slider-14.0.0-canary.e88f83024.0.tgz","fileCount":37,"integrity":"sha512-kpgi2lhcalh5rhB0yUrnqT0sOUW023BYRKaJQnK4Q9rPXqB6JaKy673PFmOcFI3EokaiQ/KdT97gX2+j4/Li5A==","signatures":[{"sig":"MEUCIBgx3QukfKCsekj2Bepp7mlLEYF7ZYsVwKNj0b4mVGJVAiEA6BEwPwUaDZH9MEWaFYaoXL8rjbX70AL9W9mz3JOoIvE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":903477,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiYEc9ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpBTw/+PJ30wK/qpsV3GKQw005zAbDn2wZ34icHO34VJGltxnFML/nq\r\nazzyKDf0ioegXIVFpIYyzuHbzpD6QO86JrlG4uk88+LTvYHAaPWh2pEyRFky\r\n0ihF4zwURPb0XEW7xx+gYU5FOpZZXQfWEB704ZT5PdNqZRKO3w8RImfYLp9+\r\n7juDGCAQzZ2czhn+lakbls3zbpr/aqALJG6VrqY0Rb+xR4WlNWcw9PWy/0RY\r\nNkZvf77tkys47z3PRbwP/DaLr+GPPJLvr+pWgIy1mdw2mCyYjngx/SHBxAyr\r\nu0d5jP/JYqjl+FHLY7CqQDt17kFkiTd7I4Sxxh8JI9bsgxjVA48gl7aEdBFt\r\nIEsGAU/JLE3TeEulTEOxfhElwmc4Wk6MlKHBJOcUPdqcE6EormaZ09pMYnqR\r\nB9AMe2sfMXFBR6TJ61u5Tk1BSiKbotQvVSxnfQ6cotoJhAU5PTVVO7HnW+CP\r\nz5KtCDvW705dcdzbf0t6MSPPqbI6ofPdy+NWjJ84uwMBqlA8cX3olNRLMPGd\r\n26DskJxLjwb8EPc9pS3C2z8Tu9WroVZG5WgsMZcNMk2j8pvxR3S30MnGOvNo\r\niQJb7IUVG3CdVnmBXTrY3WUPAn6MC2lB8ERT5nftQVnpq7y8/5z8Ko+WCcre\r\nEwkApIAsReAD8RJNltroOoHZiKRCWQ4Bj9w=\r\n=cBrG\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"e9fdf51ad2ddd3dba754b98348bc356126b5640e","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.19.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.19.1","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.e88f83024.0","@material/rtl":"14.0.0-canary.e88f83024.0","@material/base":"14.0.0-canary.e88f83024.0","@material/theme":"14.0.0-canary.e88f83024.0","@material/ripple":"14.0.0-canary.e88f83024.0","@material/animation":"14.0.0-canary.e88f83024.0","@material/elevation":"14.0.0-canary.e88f83024.0","@material/typography":"14.0.0-canary.e88f83024.0","@material/feature-targeting":"14.0.0-canary.e88f83024.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_14.0.0-canary.e88f83024.0_1650476860722_0.6423158498744324","host":"s3://npm-registry-packages"}},"14.0.0-canary.7321d6254.0":{"name":"@material/slider","version":"14.0.0-canary.7321d6254.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@14.0.0-canary.7321d6254.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"fbc6dfd65aa673bf45f3601837ff04961bde8523","tarball":"https://registry.npmjs.org/@material/slider/-/slider-14.0.0-canary.7321d6254.0.tgz","fileCount":37,"integrity":"sha512-OC80aoLzYIMqRMTckGFI/GiuDX/RAMrhZ9LVUs1Du3V1IrkPfYeJ28hGHAcEnlDHTNJiTbem6hsLWjrZv+tN3Q==","signatures":[{"sig":"MEQCIA23ggwcAG4cxFxBcZLI+eu3iQnMZ3bPRza+PT29KL/7AiBdq3ETv6L1o+EpPCkTEJlM4Yu1kzXOJ0s8ae4ATIlQkQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":903477,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiYGjhACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoK2w/9H3Cz/+HiUh7/aQ7yfVDfXJVOz3QHYyJCUYpELwLAzW/N+1P+\r\n7Wk/7gxyA0+xhjoNjL63dD6Tr2ppKiQqfNkGrOFL225vCDq8lS/sfRMPNbA/\r\nh2SC6dLGzHXUHVUGnwJVvaTY9EvO6c6c7Anbo/11dHoBR/AvIPuzkZJ8g+CM\r\nFEb+ikg54GiaQ7ms2uJYLcs9tHAMVIbDgj0rz6klZaVUFcTkDZeOu42XtMJh\r\n2ShRml54ZVJB+GlkjhT7f/bCrczZQ/SWB9JI9++QSPTboHmLCP66J32aFI9M\r\nt1JawrV2jtHQQ4cyErTOr8QE/C8FVUZCBGHOsleVKtI2tYzON5vWoxqjGZNu\r\nCQA6rYuzZCi7GddNna3+BVUvydpNgdYsmeSTmS0r7HMsx5mpP9FxmtEGwzND\r\no9muLfOFXpGm55XkjdUWsP9KHQLiW49pvYKkVizt6hFk5aDMGPwV4dgYSW4s\r\n/Gw13ckVIyB4b/d7ZF+4b1oHCYDzVKZDdy0ERa/EZfTpedT1MI7gc6a9LFgI\r\noGdKI7sgDUMPM96X5n1E4hiHnYqDqYeuXy0UEenq8Y68YW2jy6AOwZC/uQUE\r\nyIGn0xyJQIMH8ycox4eYAx69jaLf2ionlGT/63YEkSkpwHPkDL/pCd+IbxoU\r\nfDOlHQCwEUjdRzMdVV9HB8vGGSPGTnwSp1A=\r\n=XWRa\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"981be270463043c4b45845cdc3efce353eb53b30","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.19.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.19.1","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.7321d6254.0","@material/rtl":"14.0.0-canary.7321d6254.0","@material/base":"14.0.0-canary.7321d6254.0","@material/theme":"14.0.0-canary.7321d6254.0","@material/ripple":"14.0.0-canary.7321d6254.0","@material/animation":"14.0.0-canary.7321d6254.0","@material/elevation":"14.0.0-canary.7321d6254.0","@material/typography":"14.0.0-canary.7321d6254.0","@material/feature-targeting":"14.0.0-canary.7321d6254.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_14.0.0-canary.7321d6254.0_1650485473063_0.35623110593982954","host":"s3://npm-registry-packages"}},"14.0.0-canary.3ab956515.0":{"name":"@material/slider","version":"14.0.0-canary.3ab956515.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@14.0.0-canary.3ab956515.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"d00b490043475f6960cacedcef05b71e8380d10f","tarball":"https://registry.npmjs.org/@material/slider/-/slider-14.0.0-canary.3ab956515.0.tgz","fileCount":37,"integrity":"sha512-ZRlLfpr5H22g1N0iMbtaEnDAf3QkI0AzvaHo1vOTTjRKizEKesulAYSYhQifnAMjKYRtrxB4M5QjH1jlgnLcTQ==","signatures":[{"sig":"MEQCIFYeFralk2e5CJ4My9lf1okJzQHtw6AYRjgPkWI0a7ciAiAiStJn2EbqeGMQk/FWcsfIt+p94xC1SR8RjdozG8d47w==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":904088,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiZrfgACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmp86xAAgl5iqO1O+pxLQsK2nJl9u2sz8pa8Pva47lRJuuTBPkopHE/J\r\nlEa1gxzw06as49Hx/66Xy8RgH8FZ+/jqprwJ3sLHaQVmvXuk1Pt54h4c0+CZ\r\nRYcS6bgzlef29u+8ZL7A7f+8CESwzWKmnk8jbig9cRXn8U+sidEXsgvxD50U\r\n7+sO5G7oB7CoM5nWXsVbyqEIux55RoulKohP2D6MyiTw9GHgyc07+U1y6AzA\r\nT8bxQnzcnLYE41h/gg0TtM/MI+st40m8d6ddfd7NX6tlsXgP2EayoCqJCHtw\r\nqfTLyrXN5SaCbGs7JYvoZNDdwxAeTVvVaf5Pf1QFeVAIT0auoXnFepdw2vl9\r\no83tLvE2rmBWkW8+s4qW6d9Xs7xrNLANkGHNBEhjP7PBgZhymlXvfAY4jX6F\r\n104KjYZTdkNGaj0WkkIRVXi4KzqGpTsIfH+LSgcynYt4a7Wb5m1EFHyqSxPE\r\nlgn/jdnnu0NCbqh3/jq89yB9G5sSSDF9IrObUPhvQjHCBp9v13nW7xl+Y4LV\r\n+qrYC4pSFErpMBNIJ5lk0O+JjBf0MiBjCxxVoQ6Y+3TNUeq7wwVSWIpRHvll\r\ndVB/6HIJkkfhzj/J55nNXXfY0LgeArneirtkzE+LDUHnmvoiMUrUpUmUKzra\r\nbUXAaWDsDIQD8HLXXYClYj0OeJSAn6sGC3Y=\r\n=2Ey1\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"a09484c5e8d50e8b042d5367972a9111e0432c38","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.19.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.19.1","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.3ab956515.0","@material/rtl":"14.0.0-canary.3ab956515.0","@material/base":"14.0.0-canary.3ab956515.0","@material/theme":"14.0.0-canary.3ab956515.0","@material/ripple":"14.0.0-canary.3ab956515.0","@material/animation":"14.0.0-canary.3ab956515.0","@material/elevation":"14.0.0-canary.3ab956515.0","@material/typography":"14.0.0-canary.3ab956515.0","@material/feature-targeting":"14.0.0-canary.3ab956515.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_14.0.0-canary.3ab956515.0_1650898911985_0.5472468072595598","host":"s3://npm-registry-packages"}},"14.0.0-canary.53b3cad2f.0":{"name":"@material/slider","version":"14.0.0-canary.53b3cad2f.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@14.0.0-canary.53b3cad2f.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"94c795117e5f616f8147c3a8ea443d022d377978","tarball":"https://registry.npmjs.org/@material/slider/-/slider-14.0.0-canary.53b3cad2f.0.tgz","fileCount":37,"integrity":"sha512-vsKgzDrIZh098zy3+zuxZaBvlbfVCbr/4H5a9cPhnUN947+RgqGWnPYgTozVQbFvFfN2pDi1aHOssUaayOUKvw==","signatures":[{"sig":"MEQCIBb/ieXzlyRsT8//EIDY2ShzzMIaGX1ukZkJQ9M2MMtIAiB1EAXxOqlMSSIjbD++Qse1G4KRfm8NUDjjxVrzVblMTQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":904088,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiaTrhACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqxVBAAo+v6CoOA661lk6e7deqXdCSc3K8Tnfv2gTgcHHRWJ/TMY7a8\r\nQqJ4JNIfbVTCaadrMRt+NOJUbt95oiyFsfrRG8m8N/LshVS2m4nPtBclhIvy\r\nAp9l0ZNsVslrCgo8QCBxxWnxznKl7b8ZsBs94FlGsNhZXjDGFTnrHQhGj5N/\r\n4ZbqmnUFh35NNUQxCxuxBw1xcJMxujtsctNTDQ8tIwuZiQNnoPZaYZGmYRlc\r\nWAed6hQMLtNpJSgFzqtjBArGOC2RheXg5pcN5I5gcYJOqLd0ubQnV9LbaRRz\r\nF8OC4BBm8Pke+hXngHR4/Qx0DhirPWuYZOdJ5mXV4f29xv2wa6FZ5uefCbWy\r\nhs1wgfL+2P01u5Ty77ubxIQvO/fRPpi8lEImYIAOJcVetnFHln8QTmXv8My2\r\n9+kqTj4oUIrNyKOJB2woF+xhVquDz8s4s9npXuVqmraEvUprqotEdgMVS3d6\r\nkokNwEQulrvZkMlsyw7EIu4O0Zscp7yJCmLsL/oM23ymD5+8oS6Rbnz5lD2X\r\nnB6lXs6M3vh3H0HGDZ79FYEhq00KV56tUgyGCknrzuDyZqqnqSb3zQcnKMQi\r\nNp1zFX3jvr65J4UZ/7HA3xPZlyzqR/nVTWzr1DYtg3Dyr0mB3jNowqd/Qxp0\r\nQEUUGSlyNnazEQJZKs/9ESpDYyCcmYZX+Y4=\r\n=L/qp\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"ebeda2e23436103241b0e82afd57b60f74599133","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.19.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.19.1","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.53b3cad2f.0","@material/rtl":"14.0.0-canary.53b3cad2f.0","@material/base":"14.0.0-canary.53b3cad2f.0","@material/theme":"14.0.0-canary.53b3cad2f.0","@material/ripple":"14.0.0-canary.53b3cad2f.0","@material/animation":"14.0.0-canary.53b3cad2f.0","@material/elevation":"14.0.0-canary.53b3cad2f.0","@material/typography":"14.0.0-canary.53b3cad2f.0","@material/feature-targeting":"14.0.0-canary.53b3cad2f.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_14.0.0-canary.53b3cad2f.0_1651063521509_0.5683219856093955","host":"s3://npm-registry-packages"}},"14.0.0":{"name":"@material/slider","version":"14.0.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@14.0.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"8a1e4ac14b2831e53c5e97237219005060a67eea","tarball":"https://registry.npmjs.org/@material/slider/-/slider-14.0.0.tgz","fileCount":36,"integrity":"sha512-m5RqySIps1vhAQnGp2eg4Sh2Ss6bzrZm10TWBw2cNFHmbiI72rK2EeFnMsBXAarplY0cot/FaMuj91VP36gKFQ==","signatures":[{"sig":"MEYCIQCGZlVlXSHMhSJvFxHJiq+JbxCdIqm6SmYicszfMCNheAIhALmCfMDUtwbnLtnZTSON/PWIdKLgv2vmeN5IkCAl99Gi","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":901432,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiascZACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpZZw//UcRs1/gF/uirD8m7AIQHP/BmHJfu3FOCsBv2fqBIvmBm5gBx\r\nbsicrgrVp7dC69VUHDFERJ55/SOg0396MYWFBxv79GGyN+gmvEpJioSlOmVQ\r\nAHBqCY9xyFMND7Z0zYYsSBgkm/4qs4ChMQpaH0i4NXZSRiJPsZ4Wc7YIPtWT\r\n6dENeVUuodJXZZpKbffKBAw1KF6CsugAb4/atnJ9KJ1mILT87R62XV4u+g0D\r\nOoQ4cwK7wR0Ok359t8S5tCOBANE6pN2Kv6QoZncCOb/NmWvucvm3Vivbv4Nk\r\nIIqVpXjRB5VlEjaGGjGMfxjWUAIcLUkVk5ehZx7WFLE78WaIYOrh9A4weUVV\r\nX/MRX5GsLwEFmoSF09CmIF+JlnL1kUoJdh6d/8r/FKb0rcyMozFeZSsDLVdD\r\n3Pr8ZC05+VwqHaMYttYu3qTSG/OtIOEy8C9nPJRNy0k/aIvLM56mhByHO0X+\r\niwlJrqO045GdB/zqZPP2DxKhkQmAC2Sa5cyPxmVRWPz+uLtrtkb8z4Jmp3dw\r\n2VpvSsUIufbSQC5W2gxro6sE2l3veRh5GW1iau1t5cY5Mpa1/S5x7HnnaLU+\r\nhvxDTXxtkLWS4Lw+TlQgvDHwdJ3B6wNPDINYHBRIPNWLX33I17fsxqcUmTwR\r\nF66QJHlmkHYZws/khak0CxIZszPEbBfB1+o=\r\n=S7IF\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","gitHead":"432c815e58d61a257742836f816cf95e271e6ea1","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.19.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.19.1","dependencies":{"tslib":"^2.1.0","@material/dom":"^14.0.0","@material/rtl":"^14.0.0","@material/base":"^14.0.0","@material/theme":"^14.0.0","@material/ripple":"^14.0.0","@material/animation":"^14.0.0","@material/elevation":"^14.0.0","@material/typography":"^14.0.0","@material/feature-targeting":"^14.0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/slider_14.0.0_1651164952925_0.6622291015212909","host":"s3://npm-registry-packages"}},"15.0.0-canary.432c815e5.0":{"name":"@material/slider","version":"15.0.0-canary.432c815e5.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.432c815e5.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"613083c8d8fe30eff22036e9aeed221e336f8974","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.432c815e5.0.tgz","fileCount":37,"integrity":"sha512-HmsJYswYfHGapVBv3w+Zk2+KO/O+gRYkO4u84RlSdm0eXxG5bk4D8S9g3t64aRIYRK3gxPK4LhTQGoq02KnYZg==","signatures":[{"sig":"MEYCIQCUegMlAIBumuacjSLsJdrlrRjWLn9pdwzcqXnKeVVzGQIhAKaDRfKVqhiIiM9khUFnQHiLPARLq+D0wZ+vRng5yLtu","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":904088,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiasdcACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrR6A//TfdlG/XdgQVKYrA3EGsS5t0uRKKz3HApC8G8rCvdumVJaubR\r\nYYfQGrJBoOKBh3BoXCP+TUnkNBrNmVDNIuWyl/4gQcbFnLw3w2fcD7IvbFnj\r\nhQvUz1IhX4UiYLeGKKN58uOVkl+4Ghnb1H7n2DlOn7YfjkYw/goELgblERBA\r\nbNyCu3yaNNWZQ8TJ0fqtbjKF3COsLZuU+r7J/m+iNT+Z4x12VXHVOyuFa7nY\r\nodyU857iMULUKbxy4MyqPcDk+/eewUWKNiJxrhYUKwNc1JuCpMlLKm9st48y\r\nGkHm2O7PitwqH/leyeanAvOyeZUiIjbHs88TgudlqX8jEHH3XZJvFj27Y77R\r\nV3IZhEJSgo2EG9eTmhmaa6IVWJ+gn1a3t4IJ7Er5duNKOceGxRFz+MYokH+d\r\nKnVLUEn01C7qSKX5Z9hPER1vnecbDGmavCJpL/P2ZMrbwzW3CDw9/of0+Jk6\r\nvkFK+ezwMBh2g0zfD6nKs17pT3J8BOwRsqFBGf68JsR9Kmk3w7cBRgbTa/Dv\r\nhamgv3JKGPKvkhpfhm5bOK3W1ScOV/ryPW+iaqV4B1B9B8GaVlkYIpicBRmp\r\nkpcSOpbcNsoavB/kw0JjQXAzrhHBDqKJrRlPwAb9B7rD5mccgL/QFtnneGte\r\nVSHQEgNGZ+aJm7eOMd12PnZnI6VXs7/76Fs=\r\n=gM7s\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"df8af7a4f190284cd9f3bb1756b2f443509424df","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.19.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.19.1","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.432c815e5.0","@material/rtl":"15.0.0-canary.432c815e5.0","@material/base":"15.0.0-canary.432c815e5.0","@material/theme":"15.0.0-canary.432c815e5.0","@material/ripple":"15.0.0-canary.432c815e5.0","@material/animation":"15.0.0-canary.432c815e5.0","@material/elevation":"15.0.0-canary.432c815e5.0","@material/typography":"15.0.0-canary.432c815e5.0","@material/feature-targeting":"15.0.0-canary.432c815e5.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.432c815e5.0_1651165020125_0.64230717213894","host":"s3://npm-registry-packages"}},"15.0.0-canary.a0f01f669.0":{"name":"@material/slider","version":"15.0.0-canary.a0f01f669.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.a0f01f669.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"94910cf32c5863a00ee5fbd0fb6ccc4da2cbb22a","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.a0f01f669.0.tgz","fileCount":37,"integrity":"sha512-CpplVcfgW8zEHs8RhT9SdBhTjxi8MUZECwa45AkTtJm9BtkVzvO0SIxS7y7h0aS0i2QNsDvP6NlHkTgOZqnZMA==","signatures":[{"sig":"MEUCIQCoAOO/rLzmKiBPQJBvnYtTAG1zsIjHoDchag5LEFIVywIgM+6AF2QlOaS/T2FP3D5szyJlf7kRpuXDVNZCHgegfNM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":901990,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJidYGvACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoaAg/5ASQiJyel7aW7KCNiSOSHca5Xx61g2H3jT1LiMDtjQFJ57iFm\r\nuqyVAkLw15hu0CQxHuUglVHz831venVyU3gD/bYTE1HEzeFjSWuasDVfhJ0b\r\nJJjUo+jbL0iMJASEY92dgw7ScPQzMeG/Gpssq41hbj1w3PXLTsFnOVXzcY7h\r\nM+d7d0kKjKR6Lm+9RTKXKXl/BabFoFYb7GxBCGtjXgnsNonTrjKy8Kuy8+of\r\nGhcbe1Fc4PQRtx5QOQGd+wqfIeVkn6/X4f4WcRNf4xp6DjQUmdhR7rZCiaga\r\nKR06kkuis/kOkeduuEDnDuYgP/cIuRQqoXYDvsQAaFvuRvzqbG9G0bxbsHQj\r\nkNPJ5pg6q7FMnYDQWsD3aEmWyVdiElB8JJPdC0wn1zp1MtBMDBCCeATU1ImJ\r\n1trShn8aj3YaXBwF8hW29SnZZCcy5R8Tztnm7dr/IiJbwQGnV5Pp4Cobe6/u\r\nMU6SCILo6G4T/AZ+o4WVtHBL/qA4t2JVt38oxdXT4eQ8CvydbvMD2tHpT/Xb\r\nFmtco1K8CQYutaYx813rOuu/lY4tqhS+6l5l2dQOTWrNE30GJGqJglR6Fh6u\r\nWILMrtPBHm2vr93he9SIc/VqKeQjkmUoRNX1HR7+am0xiJAud8rRPqavc7J6\r\nzoJrglyDWuIJJs3BIZk78713gog1yeKe2ns=\r\n=/8CO\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"51daa70df3212a8d73c545c86ed1c57273d41688","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.19.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.19.1","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.a0f01f669.0","@material/rtl":"15.0.0-canary.a0f01f669.0","@material/base":"15.0.0-canary.a0f01f669.0","@material/theme":"15.0.0-canary.a0f01f669.0","@material/ripple":"15.0.0-canary.a0f01f669.0","@material/animation":"15.0.0-canary.a0f01f669.0","@material/elevation":"15.0.0-canary.a0f01f669.0","@material/typography":"15.0.0-canary.a0f01f669.0","@material/feature-targeting":"15.0.0-canary.a0f01f669.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.a0f01f669.0_1651868078937_0.14928292443526647","host":"s3://npm-registry-packages"}},"15.0.0-canary.276cb39a4.0":{"name":"@material/slider","version":"15.0.0-canary.276cb39a4.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.276cb39a4.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"7ff87481a3b24980db37c508560b7196dde418df","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.276cb39a4.0.tgz","fileCount":37,"integrity":"sha512-QIipbzr6vz7maT/oqQ4yINO6bjXPb+UkHXM/dYXVzfUb7Gb2WuX+yCB+cS01IBDzsjvuvCS8cLsbCnVmDWJGew==","signatures":[{"sig":"MEUCIDfgSo9FtnLJ5hsermDvaCBA4UH7vqjYbDDhd/leWq21AiEAx+Vj43q+5SGNzO3B30WFQPLVml+JNjc1NV6Gd2IWRKI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":901990,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJidZOxACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmo5bxAAhxTpTpG1Suxanoltq899gIhiroUwKuLU62x/8QIHqJ8QaTHU\r\nAdo6K0g/M5ATGom8S/+BXY+TWek1yu4jUX1x8SUUHJC5Y+qPrQWCNG/r3vHE\r\nfw6D9Yq8bATbc2bmdQlA+buuIK9IwE45GTPg03JXC6R8og9p1tJooFklxT9a\r\naB7lvOqZ5kl4szvaWSwiP+LcyguK0ujvCNBJxLBenBfiZSYsxZdnNahE4/Pi\r\nfFrzuR+QznwOkg3xzhHbgjGaBvp3KNfNZh/WWxgiCGXqBEztuAEitiiEmYHC\r\nCpC4E+W0bgs1WpPqf44EogdAeEmhRDAZMwIttzMPDihrdO+LejvJyg5j2Chd\r\nI4YbMRIYP7Bx5ACTSzqiuSCmscrZmw8xTigwTVTgUX59VUFN0Yj1OGnIbEIQ\r\n8+kxLEHCasvh7x0p5/6pFXO9X7gGHUwWu6zahyoYD63luEkUcbyq1fst4PJX\r\nAVP2CZeKWVH2hsSFHF56rNUIWSUzUC3CqzdSq1KteUyj/PSs967ry1VBu7zw\r\nIAfloGNYFi9W04eQnnWU70RbXIR4p2g5/b0nKIPQOtLkG9Uho/YDd/zuoOnK\r\ngojzNG8fDbiCm1Vgu+qWyMuscpaQ4LNnd0BCJfb0ZsTNuBXVr6+todb8FmNJ\r\nm5v0n8k0DhbZcy6Ht1WVEtx7XZiv/FUmVb8=\r\n=bmsi\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"c57cd64760098925aff1fbf0bc2a73d32dd2bed4","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.19.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.19.1","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.276cb39a4.0","@material/rtl":"15.0.0-canary.276cb39a4.0","@material/base":"15.0.0-canary.276cb39a4.0","@material/theme":"15.0.0-canary.276cb39a4.0","@material/ripple":"15.0.0-canary.276cb39a4.0","@material/animation":"15.0.0-canary.276cb39a4.0","@material/elevation":"15.0.0-canary.276cb39a4.0","@material/typography":"15.0.0-canary.276cb39a4.0","@material/feature-targeting":"15.0.0-canary.276cb39a4.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.276cb39a4.0_1651872689244_0.5294881094230517","host":"s3://npm-registry-packages"}},"15.0.0-canary.4fe98ed70.0":{"name":"@material/slider","version":"15.0.0-canary.4fe98ed70.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.4fe98ed70.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"b4a2c3575788b5c5a8f97c3041b2b28791399e4a","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.4fe98ed70.0.tgz","fileCount":37,"integrity":"sha512-luu6EUZGN++NCv06VDghJPeOZyI+aUp4LYdhR0+MDk1zp9cwsiBwmIht49ppSfR/zXuUwOlRtrGBDTG//shaFA==","signatures":[{"sig":"MEQCIHsrq7mKIwi0/sBqE9SrIa4ebVweG/RyFc5PEs79NBdEAiAWrjCMMXAcwXGlp/jT6kp5H1A85B6I7LvZVfZLDIkH1g==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":901990,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJidZlyACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoCgRAAl5XrrGHGlKtuzA6ABqP7mlIIGS5XBPHENiw73ukdepAo7NkS\r\n/PDYCBcr/zEJGMs1W8tyQUt8mCWLo6Vj9AsUOqo5Bd/6v1HnTzmnRfcinknK\r\nZlxmpCMkg5rRiqvIYjMHhjpECxorK+a7hXeVF/J0NrLjceoqH9yMVfKnlw3x\r\ndhVTY7tJuAjzQOgrmKpXYr7vZrpFPruWrV79mDKO3d3XXU55A9bKg29Dm/Mj\r\ntQqOyhSwxFR1RJdrMAH3zmhCTK845fePoyaOKUo6JKNp3nYnwIj+xSPjMHzn\r\nvfCYUrxMGP4zxyRYADWYgRuPl7dNKMuxsi7QY28kfF8+5nW9ULRK8ITn7263\r\n4KD9OiHhp5UXvuHwkXzcsub1VUmfa33bCaFr6O76GwAyM5/ma0rcHL9Hvnn4\r\nDenkwLacyyrG98VyM9HQzjIeL7SMiGhIYPzczlWGHUcG4+8Goe6N0V2Q6aC6\r\nABGu/D8KkP/uSBF7MtZjy8kZe24zTPeimnSXoo5SQ86tHQnUR5TlkchBaJir\r\nv4hrU3/9zMBJax5VBdfRDI5mmgBF7NyPV2kXVatH6OST2DoKmTdMy5e5qcba\r\nt1DoCpznY+OPAMRNU1O5whSgcjsxilkD3Nk2N9iI/pC2z7uw9gYr/kUdhs0n\r\nuKc1EoWVSdkNWkT7t8TT2cW3V2adXFMrLVA=\r\n=kWgm\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"353fde061dd090ede4416fc2477bc050587d6367","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.19.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.19.1","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.4fe98ed70.0","@material/rtl":"15.0.0-canary.4fe98ed70.0","@material/base":"15.0.0-canary.4fe98ed70.0","@material/theme":"15.0.0-canary.4fe98ed70.0","@material/ripple":"15.0.0-canary.4fe98ed70.0","@material/animation":"15.0.0-canary.4fe98ed70.0","@material/elevation":"15.0.0-canary.4fe98ed70.0","@material/typography":"15.0.0-canary.4fe98ed70.0","@material/feature-targeting":"15.0.0-canary.4fe98ed70.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.4fe98ed70.0_1651874161724_0.8150576069795159","host":"s3://npm-registry-packages"}},"15.0.0-canary.58b130a3d.0":{"name":"@material/slider","version":"15.0.0-canary.58b130a3d.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.58b130a3d.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"6af14ed312928127db59fa1a7f03d60d3db7d211","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.58b130a3d.0.tgz","fileCount":37,"integrity":"sha512-Nc2qaY+UND4R8BVSBI2UQBs8dI5hH4uJXnhEnEI++gtHtESrwRlSSfByNlYBpLJmgVSRX/IczVMv6g4yan5QNA==","signatures":[{"sig":"MEUCICWT1D/pM2d52T6oJ9nltEK9ZlinoM711eYa9+UY9U8BAiEAgC8TZe0Vdnf7e60A+4rCbmFt51YYBxBP7qrjPnxKe8w=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":901990,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJidZn9ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq85Q/+OzwUNFkplkKm+lw+b3o7Cl8IsRQIZU8eanv1Wql6yGwCQxcb\r\nQunjrvGhjfnsoBysmdEhHUMBW4OmiR26U4xkaybZhyIvQgObQjhDsKZ7ffew\r\n+8feFEtNPlDLKwsTde32RAoQWIbSuq1G1G0B35l/CDDm0ehEVBEAmceio4KO\r\nutM205USmZ6/Q999kYzhJYJGaVH2tWQlmj9lUB4uIzDF7Y3/7oaIIYPRIF3T\r\nmA3ERSQ5mlIK1jS1KGa8Ws8L4ZgTrFKmSr31BakKjdceRFL1txRAXOQ7I3UR\r\nm08t1zrcWR63yEjNfZTYbhDu33MXwPv3tVGlY3kbITR2tiNeiG6MYEJ6+CrJ\r\nVOdM4K8lofW/jdntcchvxDwVpNXUa5UwODPUdXeSfLEEFqFHGg+7B594uv7A\r\nfQ5qEVocz8HBDtZHMmYgVFuDPgzYX2rn8Qom+LKyKNYUMMG8VN/p8Yc7uva/\r\nwQQ8EOBh5OL23L/rGJQM773I6DhmqGjayq1fzdF/j3kIEAZQRZBO8BA5PmXK\r\nvuzZjoQz025DHssVLiu15Qsw+wGiALWsN9FjjsBZHZdPxPJyhXTrMHtL7Xq1\r\nEBctlIyt9BzyHjo6vBxzanOvIRj9cak2hnGS/GiSEQeoYBhRSdSkJvW4PeNd\r\nGzrQwt2l33olWNLn3J0cjOqd9TCfPtEsIdI=\r\n=ELMY\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"58c8ada7946689a0a59acd63cbd49b6c987c9853","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.19.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.19.1","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.58b130a3d.0","@material/rtl":"15.0.0-canary.58b130a3d.0","@material/base":"15.0.0-canary.58b130a3d.0","@material/theme":"15.0.0-canary.58b130a3d.0","@material/ripple":"15.0.0-canary.58b130a3d.0","@material/animation":"15.0.0-canary.58b130a3d.0","@material/elevation":"15.0.0-canary.58b130a3d.0","@material/typography":"15.0.0-canary.58b130a3d.0","@material/feature-targeting":"15.0.0-canary.58b130a3d.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.58b130a3d.0_1651874301531_0.0849177038524842","host":"s3://npm-registry-packages"}},"15.0.0-canary.ae278a2fe.0":{"name":"@material/slider","version":"15.0.0-canary.ae278a2fe.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.ae278a2fe.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"7a0eafa5aeec40f4d86b617d0f30bae86270dfb0","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.ae278a2fe.0.tgz","fileCount":37,"integrity":"sha512-2QHy8A7WeM9YyTnUhqxCjiNOEXQcHcmrdUuSSZTHc2r0Lc1mQgVVlO8yk1SL4R5y3SUI/Cf0k1URsHZj3cWr8A==","signatures":[{"sig":"MEQCIDJXQWr3YYpcH1TzEzV/9K0iT07iO8Hxo6xqlUQhAvC/AiBVZH1LI4NPrkqjvlgv50CPNYV+pnsuQ61yrMDfmZTKcA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":901990,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJieTJTACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrHMw/+IiS8759/3erJJnPQUfrDQ5CnKHSHnk6C5I5YKt4MoGUl+I0x\r\nQinr66qCXML1HwObCTiq+fQibW8wS3Bl2kVVDaVkfPOw4l0x3hW8dsaS3Ktt\r\nQkaXCD2qbGRQBK/iwXhDETOd+0dzKEIgyt7y6nVBFGOhrGYKb2aEn62HO16A\r\nwiriDVis4NxxYHnj705ABCboMlr+DaX3BI++1vmpKi2kaIzPwcCbKFbKphoP\r\newi5/XJNTqKC3AFrgJmAT2VqE8Y3tx1RvLvkk9uNUB6rsU3jqHTSiUm5y0bO\r\nNbtscZEbn6KS085HR1DPDxrcA6NIs8P5lTctMf980yhaEG/9WRSHYIKXabPc\r\nK1kgaSAwMxPgygUGD3snv4AEDSpVIx1dkO/9B6K+6Mk5Xm4LWPDDKPsxM5vT\r\nqZXeyHzeYTZDwsSiVQ4RyTSAEgopYZaTjIXAlDy9lI+rfGqW5jLRxT869A2D\r\nStQGeZy7JsFtoykrKGfSPMrnuwFxTYQxJdp9B8BuOdKERL1GvLbHQwNZkssW\r\nQifMUKouPnkETasuq0p5g5ui+CY3BTjuP2Qwscr8ssblBhq+PhwqG6PoLk0q\r\nqv8dMaIdpBZBFSg06BwbVu/wp2pYGzzZflYuka8nfWb+TW1530WHku7JbcEr\r\nGiJ6+fvVLkHMfgINkhQejyu9EavdW+wWRls=\r\n=po+h\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"bfd08e232a3a514dd5a38dcd77d17df365502ece","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.19.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.19.1","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.ae278a2fe.0","@material/rtl":"15.0.0-canary.ae278a2fe.0","@material/base":"15.0.0-canary.ae278a2fe.0","@material/theme":"15.0.0-canary.ae278a2fe.0","@material/ripple":"15.0.0-canary.ae278a2fe.0","@material/animation":"15.0.0-canary.ae278a2fe.0","@material/elevation":"15.0.0-canary.ae278a2fe.0","@material/typography":"15.0.0-canary.ae278a2fe.0","@material/feature-targeting":"15.0.0-canary.ae278a2fe.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.ae278a2fe.0_1652109907278_0.8037000854454779","host":"s3://npm-registry-packages"}},"15.0.0-canary.bebf5bfdf.0":{"name":"@material/slider","version":"15.0.0-canary.bebf5bfdf.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.bebf5bfdf.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"e3719fdabad99374dc85f4aa2e062976574b888c","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.bebf5bfdf.0.tgz","fileCount":37,"integrity":"sha512-S7fKBt9amAoSJkfqtOeAdMVEuK6QgGBG+/TeBNnbFBOD/od/jwvRljg0uvGL734k3hTI2wvMgCIX29Fq+5ehqw==","signatures":[{"sig":"MEUCIQDZs3YI77iTFLn3gmIaOl6rLlNSMW8TlBMJENhVulBeCgIgWaJRm37TUYvjntDxOMXdYT7YcfxyuLf+DvJEFbRXjuI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":901990,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJieyITACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpA9g//WC8dyct7aFmqcqJw8a4jZdKeZQ9x8sbbvbHsrma+iogzWzDb\r\n/JDrCoQfo37k2THhhOJZAyOa/8Slk3dQAWhfyMfcZhzsgxK606uVr7f/QcXD\r\nZFaDHfjeRJkj+gWTymUFQ1zGXTTVszbIQ66ndUYKkt1cP7brPKyXMLgbVLtl\r\nx+mUcgN03L5SBww2mLGceN0J3McErFXs0MyskZNsnNIJqw3lbjAATrqvhhrl\r\nBqPJruUk4ZGoB8m3bZxASskT9h2i6NeWVGBvRL/9RPaqz2fDwBgbEe2FhF48\r\n8cSCB7n+BYbQcs5aFCgdMSvLWNFHK6czJHkz0PH2xRiDkEy424l4Yh/s8b7H\r\nUElsfeUtNhgwqzpTXN0BwYH8FYwSzXU9F8bL8OTbQXvSCuNR4TLR0nJwH7Y5\r\n/+4E/W9ZeKj9fvxFO9y5VTR9pVbbUNCDwzj99mGIq8HCUiXSu0MTkgbSqjqI\r\nwvWV3GMMO8m0drbCtG/oJO2oyTOjHysokfB4iiZTvffKE6BWQ2ybVvBPY9cf\r\ndTFmIL3OGrOMuh6pREzw+Qhk4xM7n2yhu9bZ5UfFZC3Ae45BKkQ15zkqIPKc\r\n/OuLFJgQ+dWMM3lMu/V31TFPiz4OyZUOCCTDAo/EIITw5cdYu827XHUqDYFw\r\nOzIAl36TY1bS9UX2yT4kDn5wK4JhTsoxMjk=\r\n=E+Nv\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"61d3971a411616375c31cb3fb763fafc120c9570","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.19.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.19.1","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.bebf5bfdf.0","@material/rtl":"15.0.0-canary.bebf5bfdf.0","@material/base":"15.0.0-canary.bebf5bfdf.0","@material/theme":"15.0.0-canary.bebf5bfdf.0","@material/ripple":"15.0.0-canary.bebf5bfdf.0","@material/animation":"15.0.0-canary.bebf5bfdf.0","@material/elevation":"15.0.0-canary.bebf5bfdf.0","@material/typography":"15.0.0-canary.bebf5bfdf.0","@material/feature-targeting":"15.0.0-canary.bebf5bfdf.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.bebf5bfdf.0_1652236819412_0.16830573215949896","host":"s3://npm-registry-packages"}},"15.0.0-canary.e6072cd6a.0":{"name":"@material/slider","version":"15.0.0-canary.e6072cd6a.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.e6072cd6a.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"855813b4dc9e1b70bbaa29f88b35824bf2966c1c","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.e6072cd6a.0.tgz","fileCount":37,"integrity":"sha512-LtXB5XCPmrM3rlZbBbe9bgnxS6ycqMjmw4i5yY/l8MdyGlgvtVsPdMTLNPjJAeEle8IUov8ZJPJqEonVO5U48Q==","signatures":[{"sig":"MEUCIACpy7KBIBQqz9yWDp2eDx3vwzZetSYW2YT/QHICxG55AiEAraVL7qPvvFSV/KTWJOm4ffWeFNaZ/SbPkCKrTAlgkFQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":901990,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJifBoSACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrY8g//WPzl5N8ZaW5GMA7IoGIlisNtc9IjyThthrucek0nvh5SZ5JC\r\nFGAGBIep4lV5Pr0HEsLqMsbYSynDI4DNCE6EgJ5M7v85+7wJQ/1cw7BKYipg\r\nG4UJkz46Cb3OfYdwiO133wzJrQL2578720VxG5XJCxzEOZNZ1YkdndNbK1Sf\r\nhqj4cecQsLwxM6zHf1Mu0isqHajjBe/AbPhpMR+NlPsINGLYogomwnHMgL1I\r\nXSf1cA0pyc6zNCLJWBvcdeayyhfzzzsxr3qpqjoAOSnszDxF7nYN0Ndpq8++\r\nxy7Kf94p5NGWNQW2FrMPKcxvoGIQnzJ3tZe+VIG4WlhvmhMSbAX7glpA+Lmj\r\nXcynPLKbudu8FH12Nq7gfKjOk5RmftMyXauLeuJeOW57lX0mVh79IjQITl15\r\n6ls2NxqQ4smnpKglHLTtEaTRntFe3ZnldUZtZhLLfws0S2SDs6xQtTPov1Dl\r\noytHOWrOSv112uVOG/V0ko8TDewnUZgr/E3X8pB4iBFKio28oTgf6hyRy362\r\n8n1EsqX4Uj+4Qdmv5HUU3YAB/eE09nCgacIaKw+sn58BZRFCyOor8jhUaHIS\r\nhIemdc4mDjU6A73HODBWFjrBIBRU5CfnBmgrLfjZ/OYB7d1VeL9yFUstKnQv\r\n5tqnQqTT5qT9OnyKO9hvqH6AyRGXcNyXqzs=\r\n=BEm9\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"ef2da678e66576709be19aed16a880b00e73a039","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.19.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.19.1","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.e6072cd6a.0","@material/rtl":"15.0.0-canary.e6072cd6a.0","@material/base":"15.0.0-canary.e6072cd6a.0","@material/theme":"15.0.0-canary.e6072cd6a.0","@material/ripple":"15.0.0-canary.e6072cd6a.0","@material/animation":"15.0.0-canary.e6072cd6a.0","@material/elevation":"15.0.0-canary.e6072cd6a.0","@material/typography":"15.0.0-canary.e6072cd6a.0","@material/feature-targeting":"15.0.0-canary.e6072cd6a.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.e6072cd6a.0_1652300306512_0.24947914174113506","host":"s3://npm-registry-packages"}},"15.0.0-canary.5b40eb988.0":{"name":"@material/slider","version":"15.0.0-canary.5b40eb988.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.5b40eb988.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"d36ca39103bafa75e1612885c622fa72fddccc36","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.5b40eb988.0.tgz","fileCount":37,"integrity":"sha512-OS+HZ18g2cfVY7RBWPvi276UeBAvL6T1WPZZyA1m6Co60pltattDDerbriqUNN65UxvN0QWQXTOhqzuW6Z5Lwg==","signatures":[{"sig":"MEUCIA+HhwxAzpNQWL3lyfoxJxg+5dWna/wYySLVoECWgXamAiEA90TZxhFDi5JGRZwOMxsvV5+Bn6cvPo/IYSV4/m37rnY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":901990,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJifHR9ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrDuQ//TlJ2+iyYtqbFMyofh7mJ49klNtKtBvikLF1HsTI2zeQpvLoc\r\nt2N8n/j7+VSs7FN7M5HwJ0mYLbJddi4EIBARFh4yPdxgd8cp1gbs0kVp+19a\r\ntHGcegV9plKmvLTc5tjGD2VHgWfkG6laYdFUWIVA9InRCAIaEcdVdDu4764u\r\nQrqI+qmxB2jfOC1AL5nPtAw0/rRCtM9vefNpmelMJgVpd2msye6vV8jSb0BO\r\nTFQuaOo+Y4R59xcVhJHcePo6dpRmse+njhIlpB7uvuzWRzFLcYdrtxBlY2fs\r\nsLF+i7rk+RePnVBO93/Yg91KDc5a3zcC8BYJhWgrL2o6dzkEygrIl5YNj/yY\r\nx1REDOA8By4YDSYW500hL2lJlzM6ZcMhgmrbbPH76Z2rzmbiuUGDnwZyapaE\r\nnPBnVIEyVQUZjDjK6y5plmwKRL7qnOLD2nOY3ajrTLOzvvZl1VXwoCCRjWTC\r\nuKABqT8Z+gmSayozpQO0v3O0C2txes+BvkcnPTzaeggtxj8wV1kFu4C/BSRX\r\nxEJsg6WSenw6MnIz7f4boXMUuiWEqgPlBCVJ3XtyAmjBYt5BcYI9C5U9q3lo\r\nDhq0TQc9C9zDzDKNnQHpZIEosVEurx9H0Xhs6YmzKQT4M+lYc6WZZ0USZ726\r\ntsk5jdAiA0lCK0nW/4tvAADYh0AAGTk2Xsk=\r\n=KKSk\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"c30f2a613c97ecb48fd3f9ad7b0677e51a156449","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.19.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.19.1","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.5b40eb988.0","@material/rtl":"15.0.0-canary.5b40eb988.0","@material/base":"15.0.0-canary.5b40eb988.0","@material/theme":"15.0.0-canary.5b40eb988.0","@material/ripple":"15.0.0-canary.5b40eb988.0","@material/animation":"15.0.0-canary.5b40eb988.0","@material/elevation":"15.0.0-canary.5b40eb988.0","@material/typography":"15.0.0-canary.5b40eb988.0","@material/feature-targeting":"15.0.0-canary.5b40eb988.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.5b40eb988.0_1652323453539_0.18403656937046464","host":"s3://npm-registry-packages"}},"15.0.0-canary.6a61d62f6.0":{"name":"@material/slider","version":"15.0.0-canary.6a61d62f6.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.6a61d62f6.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"82742834591916e14e2364fd6fbac31a26b8b1aa","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.6a61d62f6.0.tgz","fileCount":37,"integrity":"sha512-NtwNimVB0O3QmK4qly9Qs7ML960cKpmEKi1MIAfZSka5Es4WEZWoQhIf0U/p+rmtS+kqzFpzCywqkuAMw8NUpg==","signatures":[{"sig":"MEQCIEW8QUwVrI37g0/Xh7ix4Fw+uH1ujhWAC2YYyti9KBZxAiB438h3X4WKfDyMzRz+qOcq4FQ2Rhm9GtaTrVAU/7Tq0A==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":901990,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJifW2LACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpP9g/+Klh6O1Ylg9wu5zD4QPKvnsDGk8G4FqwkBcc3Zthpv39nWa19\r\n2Zj8rCxuvl2AROxFXWK3A6YzLKHZ694/6gT7GlTmumEYdVe+XZ80D2K2cBGp\r\n9HvzjBQ0KDT8gzuK4IpFPy2ZBeiAdMvEUlaaugxShwXEtcmu++L8dg3+NVTX\r\n48ZpDy8sCHDieoY/rhp3ULgR61qBC607vBhtw36lfkIlSvsbLVXSzt+SY4dH\r\nX0mjpa6O1v09bmOZ/yIhSZb34EASlqat4tzPycHb4pz8H7bySdV/cGZzT2tZ\r\nNqbiLXtMubAYHDTRO6qJVT+PZcJqI5dXsdD+4vNBYasxRUoMX5qHsZng1mE3\r\n1xhNSRwxZlUdB4oolB1Rhixx719maOKeAhGVHbMwOLaVqaxs3xazoKmbaHr6\r\nQPG1fk0mDyGZwQMGGmXOxki9DkH0xR/IPl3sMquw1SicmvzaoaH4LJrKpBn0\r\npyVw3u4lTPy5h2P3KEvxP7bWq2dbC4UjXeHo/NHztJ1euEKd64RaWV8/iOko\r\nuPkvE5CQsE3ODnu2tw5bKxaBPw+IcC+QzwDWrwbpYRpvMQwEYLvjaDTykf0N\r\nS6Bwh988CEG3WD1QLsukGNW8IF+8tLJHpBZVK7dxQG6cQSnzue1fRVyWHuIP\r\najCd7XXGHfKJC+us3JCwHj2vKBmZXKZP4i0=\r\n=y2IN\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"1d46f0951ee9f725b870919613271f00fcb1b521","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.19.2+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.19.2","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.6a61d62f6.0","@material/rtl":"15.0.0-canary.6a61d62f6.0","@material/base":"15.0.0-canary.6a61d62f6.0","@material/theme":"15.0.0-canary.6a61d62f6.0","@material/ripple":"15.0.0-canary.6a61d62f6.0","@material/animation":"15.0.0-canary.6a61d62f6.0","@material/elevation":"15.0.0-canary.6a61d62f6.0","@material/typography":"15.0.0-canary.6a61d62f6.0","@material/feature-targeting":"15.0.0-canary.6a61d62f6.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.6a61d62f6.0_1652387210907_0.6736131159987722","host":"s3://npm-registry-packages"}},"15.0.0-canary.05930a453.0":{"name":"@material/slider","version":"15.0.0-canary.05930a453.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.05930a453.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"66386092fd57adf994809d71f46ccab74527265e","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.05930a453.0.tgz","fileCount":37,"integrity":"sha512-7C586ybMSGh00ZuNP7bEDPPpxPJSgw3wkcF5VEE5j9T1iZwNVZomxdNDzJ++Tm7uiuy13qaNZqRHMXyZx3f7vw==","signatures":[{"sig":"MEUCIAhyEtMLbMm6rGO+4Vkhjf5BYXVoqNNNVynR6Vz7mUOeAiEA12nVFnkYJoW4lc+Sh6GwzTXidNFbcSNtEDVD0sx3ic0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":901990,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJifqfAACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrVXxAAkmUwuugNwTs/st6Ued46pFY5UdSG3TgvkrqMeICiuAAL3yNj\r\nmaopgDZvAwJa523nxYuMCcUOw28ofwBTmZ2fZp/8LRw5CLREbK3i4L9mLwGX\r\nFyPbvTjGqVVsOyB0JxivVyNstAnVogpkdyQtlmcFiOl0AfCgFHE2tQ4eMYFc\r\nDSU5DWQ6lQEb0p973ctcJzgJMLZrRQmYB7S6WsOCUB+F0PWmCq07eaprWE0O\r\nxH7k1OiIu6krUkCRxbsbQV0yzAGC+j09jQRMqr4UwSKkvHdw3/lixOBDanVD\r\n9o0wkqrxSQsB5DmPhjzS2w9rr4yJ8XCvPjJ/O5xWDJ4J73MdbpuZjIVOW7na\r\nNANSBTMx50fwZjYOznXcRERjHJvxw4uVzW8wGBxAX2dV+PBrtFVKnu5z7INM\r\n1oYzlbcFGALi+KolvgWT2jrtG01t3A8NU9/KGo0PNUsxgRH6aprq1HJXU9Dc\r\nlQRQXiy5RAvl6SPNXMq9uc+O3c/A3q+1mZXjqy4G9BDkV1eSlQndWq6RJhiw\r\nJEkewe1RdIMp/NRApzNh706k1JlWzO23STHZVKm13FeCMwY9hllVaiaQ86Du\r\nltvIzluwtc4j9aFFauZ5Z4wz8Wu1hr3Fzf8PQXlobhcKFrO5qaW2zc7ElA6J\r\nE+y/NbmdNrGsSTeDyUmq/ZVqBTC2Bcb08CI=\r\n=tAlG\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"e6dfc2d0553321fbe47e71fb414cfc1152b0ef8d","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.19.2+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.19.2","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.05930a453.0","@material/rtl":"15.0.0-canary.05930a453.0","@material/base":"15.0.0-canary.05930a453.0","@material/theme":"15.0.0-canary.05930a453.0","@material/ripple":"15.0.0-canary.05930a453.0","@material/animation":"15.0.0-canary.05930a453.0","@material/elevation":"15.0.0-canary.05930a453.0","@material/typography":"15.0.0-canary.05930a453.0","@material/feature-targeting":"15.0.0-canary.05930a453.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.05930a453.0_1652467648526_0.6321766553805424","host":"s3://npm-registry-packages"}},"15.0.0-canary.c0a11ef0d.0":{"name":"@material/slider","version":"15.0.0-canary.c0a11ef0d.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.c0a11ef0d.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"395cc8a137d47fb573da79c867b55dc90114afe6","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.c0a11ef0d.0.tgz","fileCount":37,"integrity":"sha512-yyrd4tmsyWKtg0SG1shXK4D9XHW/AJOJMxC7+ayXW42jNQqQZM5kyt/qcWqPYzftcZfzDfvmfTK66zTI2lPu5w==","signatures":[{"sig":"MEQCIE36vrCZ4FasDLx/mN7xEQ+jtUKLWw2WMdqOhSwEMM+pAiAwRC/6XZkUpJZD9awZRw5PO348PHn+MyOINC55kxOurQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":901990,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJihWydACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpeBA/+Id7JgvgB4m/Ni3JnyBWFOBBCYqMpr4WaGv4qInFtjkIcPw78\r\n2rKaY78wHoyC8226qcZF65Pp1ulfPTYmum6hQB8f9Z1Fm91ioXSF3WgJpTPq\r\nMoqTxAXs44Ql9EQjobzyBZhmoktUf8R0IGK3cz6zQU3mk3c22x9riu5DZdDC\r\n4ghFaXAeTG8Yf95JJ9cgMppQGaTgpixJVFLbU4heChztuXgLSOiV1lxNqhK1\r\nm7AOZWF/HOJbB8IuVgR+jBfkKWok6pRkxFmgVBerG5W6akKIlFQRpsHdquJf\r\n0axV3C3KG6oK2SnOz3wjp0jt8rzBlyGlhX5sa81lzBnlwK77UF6j4GJdHkvV\r\nkwdyAavKMV6yHoXJ78Kfabk/S4F+YfYXncl9hx/6mKLHgOPOZC7AoqObCguN\r\nGZ5YCR0/8Fwp5AejsFQsjAUp6e4+5RAVZSThTRECU1/tVJJWpA+631oKa5Vx\r\nnPf6n4aowdtuq+Dl/f1pyfaQcWO5rqfzw+CHsBMfHFCganRYWO39MepjbCvh\r\nBB5xizCFVeat+jfA4HG/zctlsMgfaQMLChJWvGaeeT9579Tk+O6X/pvM9haP\r\nDJo5FW39/REgVLHiwQf4CkHGL/Pp6XqLpEd1Irf1iACT1iZ9L+t2LPqkgLQS\r\nRkuU9J/tpztdK5brya/FEgFk0PovaG7S4Ws=\r\n=WKbl\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"a97df68c1dadba0530f5fcda79fb8bc3082d963a","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.19.2+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.19.2","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.c0a11ef0d.0","@material/rtl":"15.0.0-canary.c0a11ef0d.0","@material/base":"15.0.0-canary.c0a11ef0d.0","@material/theme":"15.0.0-canary.c0a11ef0d.0","@material/ripple":"15.0.0-canary.c0a11ef0d.0","@material/animation":"15.0.0-canary.c0a11ef0d.0","@material/elevation":"15.0.0-canary.c0a11ef0d.0","@material/typography":"15.0.0-canary.c0a11ef0d.0","@material/feature-targeting":"15.0.0-canary.c0a11ef0d.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.c0a11ef0d.0_1652911261525_0.697052472011555","host":"s3://npm-registry-packages"}},"15.0.0-canary.2f9b268c0.0":{"name":"@material/slider","version":"15.0.0-canary.2f9b268c0.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.2f9b268c0.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"a77198fc38fbc329a181dd15f4f47eba4fe2c3d3","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.2f9b268c0.0.tgz","fileCount":37,"integrity":"sha512-3ltVxebRn1B6oDY1Jfn+k36RRH65Ijt9ZIRCe0Wie/uB/0VeDB1GSjPRxCXLUGLqsk8Iz5/8dpeXrrLLt1iWBQ==","signatures":[{"sig":"MEUCIFrkP5+q6H8BKFp1GnbXCnu7Ijba+xt3jkfcLxU6PJC3AiEA/rF8vk8SvO0olveX8lTQNkq1K1geVHT2WladqVgRYFY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":901990,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJih+zXACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrQ+g/+NU3OHdPPjGyQPdylpkotJBpuW2pKIderKaGGZL/4zWunzRow\r\nl/BKXePIPoQkC/OhQ294sCTaPO70VZTRCEXoYAvzCgIXmmYLUy2Ue1Fj1DlG\r\neUWvCKSEtFihpzRlNqdLenUQqyU9BBWzlud90rnukP7fK2t7nMKIWMqU7JKQ\r\nQIJD4PXoHkqu1FTtsWthZEkJ7imgLaFxs5QdK/dbgKJ9QF7M3S7QUZ/gJ1IH\r\njEePpBcIKakhZ6k6JH6H/y0dr7Zvmy+lLEfu8Yj+cvmrNztmkOn+EoolLc3K\r\n+MAvqxh87jCi56BJE62mBAZRsmSS6TxZjpyfhmZHLZrvXKvrT42MKAU9KlkF\r\noA2gFdmcbQIgNaz8Jdq+J5gR4jWIQvJ7QA+6E4hwsrwwo+Arbn2yZbV4+l3V\r\n1QxVGoTuyDLQ/3eY5nI1IEkBNbCtRzHzRqAzImHvo/t+TUTkF81+9g/nc+S6\r\nxs5Vl4nKSl5Hn2ThSfd2ZpZzDmB2RA5wBQXACCyI/MeMw2Q1dhqZidCSTgvO\r\ngrFQxpp9CBGp17ZNUASicyMNcSIqxct37kCOnUXFzy3/Qo1hMTZXgVUd7U3X\r\n3rzAfQmNOu2FLJRslFnB2UfoQwYe+Ns7bN3VMsKvd7lF5As/pbdL8qWNTmyq\r\nZhdmvn3AcZtSq/tu665KutwGCpjPmMubzQw=\r\n=VDc2\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"29832a4f010df39515e01d98656d2e77ac1e47e0","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.19.2+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.19.2","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.2f9b268c0.0","@material/rtl":"15.0.0-canary.2f9b268c0.0","@material/base":"15.0.0-canary.2f9b268c0.0","@material/theme":"15.0.0-canary.2f9b268c0.0","@material/ripple":"15.0.0-canary.2f9b268c0.0","@material/animation":"15.0.0-canary.2f9b268c0.0","@material/elevation":"15.0.0-canary.2f9b268c0.0","@material/typography":"15.0.0-canary.2f9b268c0.0","@material/feature-targeting":"15.0.0-canary.2f9b268c0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.2f9b268c0.0_1653075159527_0.2518772518309249","host":"s3://npm-registry-packages"}},"15.0.0-canary.7741345b8.0":{"name":"@material/slider","version":"15.0.0-canary.7741345b8.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.7741345b8.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"66e2de195af0b85de02cddc094af31423f2b534b","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.7741345b8.0.tgz","fileCount":37,"integrity":"sha512-j3fbSOSyIqIK8T6Cqun/8bJ8VVvKfb3bxOIHKvMsV4pjxAle+MuBcbPgj35vpxviRbN1kRAcYAgi5bVhadQ9tA==","signatures":[{"sig":"MEUCIGvAdn3/iD/eWEWa9PTMgUvdhPUTT5iB/eOv0Zwghep7AiEA72Tk5bZcX7PjzFFdDEJRFO/fMwER2t98EZtn5GXSj0w=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":901990,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJih/PmACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr2dw/+KblmTllgpgHd0gz9mMSR5nj2XgaLBO1fBF6kDke0rZzYUm0j\r\nec6Y5lFtZI43OTdQGPx7OXe7WobTiDY1Ow8ipQkYiJlua6xZ7IpardTgQt6F\r\n3WfsZdSe5cH19738qFAKmuwfUmIbepci7c2gwxbUyZhpVWtMJKqbNB5S/vX7\r\nw5MnOawYkYFFpRBuGzs44IfsguovErmU5tsljYaQBegUed4iZFY+u434GC6U\r\neuq5omuglgiOwqbV+67kMx/TFfaaobB4eW6bilV5tOZY3E5fxGEl4vyDcdhE\r\nfQ3BlG8JPz6FW+KEdjKUIoC8cfobDteunB21bj2BGpjKkBVlkcQpgG/NEIPW\r\nmninwoBhWy5Dc/6xx6ed1h8sR6zN+OX/pYonjfG1waT/Fwc3qDjaOAu6AsYE\r\nSzJT2iCqyJXypxG/XBxu8ielJIO7xQk0BupIX6C2Vw9lg1noCHJIGXk8+YBk\r\naoQkOr8nmPBXrbYrwxVM7fusmydk6KzbgzUBm1kV1W2Cfhz/8pt98DHBFQHM\r\nC10DOpc5/qeCJNYTulddrZNi6sPqdKV64IIKG4oKvII8MiVkyBaBSpUu3d2h\r\nBfd5DSMJWz7XXolXityPgE4QKxEgeee/U3PbZ3tAhAL16OXUNvczwob3JTxc\r\nkDvg/duxYAqSvF5NyP1ksGnv4UtYbS4JaNo=\r\n=bGBh\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"2e61e5e8196d28c1bd4d1c7a12c242276c1d8ec1","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.19.2+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.19.2","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.7741345b8.0","@material/rtl":"15.0.0-canary.7741345b8.0","@material/base":"15.0.0-canary.7741345b8.0","@material/theme":"15.0.0-canary.7741345b8.0","@material/ripple":"15.0.0-canary.7741345b8.0","@material/animation":"15.0.0-canary.7741345b8.0","@material/elevation":"15.0.0-canary.7741345b8.0","@material/typography":"15.0.0-canary.7741345b8.0","@material/feature-targeting":"15.0.0-canary.7741345b8.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.7741345b8.0_1653076966304_0.5932302454456655","host":"s3://npm-registry-packages"}},"15.0.0-canary.f807e793f.0":{"name":"@material/slider","version":"15.0.0-canary.f807e793f.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.f807e793f.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"0f5b337f114548aa2f88ea4567da926735dbc624","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.f807e793f.0.tgz","fileCount":37,"integrity":"sha512-cetITNt5+yun9XUT8iqDl8k+a809nqhp8LZtApvPwqLOjeRCxioh/NGPr6/WeoqFVuIEjz3U+wo6fYQI7j82FQ==","signatures":[{"sig":"MEQCIEwi0OcA0OjzNhWEjlP+cfPPyIdjvbT26rcyg0dmNk2QAiBwl7KMc/eEwCh1kiRfCYXAEFE3Rj6X0Q6u7bSPOcktAA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":901990,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiiBSOACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoBQw//UsEnVG0dAq0GM5f/Z2CO0eOiAfBzCHgXUhk8TsFDZjYebalm\r\nYzFNTr0JCY/EFaUYa0OoJRjcG1z9IXzwtorGJ5ZsozfVe4FGN4/zTubvx1xF\r\nlRGXemAkweyYXCNpnI5DJ7TXokJbl8Elqv/CFHz0UITgme7zfGFdYQdfZGbM\r\nJdCxjz2BJ470O22DAj4sEWbUsL9MkspzVDWCbNee77W5BC5CLJdxhupd3fdg\r\nDOE1W0efQZfT27hpiwTufPRq2cz0kSFJ32wP8tnGHljveKe4ds/VUzfhSu6a\r\nLYFHNrXiA657SOOiWXEaN1RkZc5FHvQgWNuDU/q0jMSRFnNPvpTMaJ4ydlEq\r\ngVhooLpK1G1oMgUsSxvhasajts5BqWwOD1R8XxVWFTgz56zJQdpSDr1p3Dey\r\nZjCJSgFASqUbHcIWdFbFibK2Uh+faMTQlCqldZR9DNQ2lzI8v4PHNybGTNKN\r\nVqDYL2iRgWfNtxut0rv4P8rZ1EV0O+asTL2x8qrJd68dTTtPctSd0cXL3rMK\r\nVi4axHFerlDHQE168zRmtmvX8Fy0K1T148eQUGxdDNZBMBwHiKNH/iPN2IlD\r\nrpJ+HeFL7DB+C0KfWR8uRqPCMuQ+Cf9T0Rqecfe72suJSD0M+WAU2gI5Ku3T\r\n4Ji3mAJPEqwYbgLsoeADLJdsqBCpE3sTqPo=\r\n=2cnk\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"b4ac5ff59e90b4770de9f689d9b09381fe2cacd1","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.19.2+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.19.2","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.f807e793f.0","@material/rtl":"15.0.0-canary.f807e793f.0","@material/base":"15.0.0-canary.f807e793f.0","@material/theme":"15.0.0-canary.f807e793f.0","@material/ripple":"15.0.0-canary.f807e793f.0","@material/animation":"15.0.0-canary.f807e793f.0","@material/elevation":"15.0.0-canary.f807e793f.0","@material/typography":"15.0.0-canary.f807e793f.0","@material/feature-targeting":"15.0.0-canary.f807e793f.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.f807e793f.0_1653085326250_0.8768061124627022","host":"s3://npm-registry-packages"}},"15.0.0-canary.9f53d4a8a.0":{"name":"@material/slider","version":"15.0.0-canary.9f53d4a8a.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.9f53d4a8a.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"4ebf3627475b0b78f7f7696d9a5abbd7560592a5","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.9f53d4a8a.0.tgz","fileCount":37,"integrity":"sha512-NVh2qJfY1mKZNIXYts5xw8QvgI0UiH61/DRKZwXiKHdYyGf125IB4g77Q8J4P4ci4l4v/Ikz+WThgLdJqN/68w==","signatures":[{"sig":"MEUCIBjulacOLAB7UvIp0p77IrvraJEa4PxIzUboRbGwsqevAiEArBBcKytBHi8dKlJw6Om4Iquf5l2BIUIn6gX6mke4rS0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":901990,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJii6DmACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpEpw//d/OJew1VB68KPyNTXXZczin1W0/hrOBGKeaBKFCGI0tkisRi\r\nT5KWt4CRo0UwKwTZpzCNLoQkeKIXPIlNcjz7KgeR5bdOqCAWRl+N3+tVVB+B\r\novJMYV9OQxTORjOV1t0dzV+3bswOxnNO4H3zeU5U2msPv2ao6J2d59jznl5s\r\nwwkx9wR9MjZy0otlm/sRK6EFeO+T+4GBPuJurLgcoBszgAEmNKVOX83j3UZy\r\nuMlF8SL22A++VqsgnYb0b7c8epua6ZYGH0nrUZF704QBsl4JQktg2rX2zeUD\r\nFFqL6eAozKRPAlxag2frYEd06gt8STxI+FQ8Krc7E63yuQ/M2X0NKpX4oA6H\r\nzc+rKXX4BDwLhssKbVr7Fh1tcaA7U0yerE1hfETgKep4eeARb3oIqghzdmAJ\r\n+gj3TpCPIuYiMuEXgMot6QmJ0sJlQdgRj/ikqVwm9n4aT8mVZx8maQUr5xe5\r\nUxh9fGJTgGWl3uVNZ8NZeNWD8HifS9XCJP5FORs8b7NLLpfxTgaPwAiUlDbM\r\n/RIKG+Y+k42AIMWsNgHQKEvDunTbM8VIfjtF5vk9j3DUvCi2AZjh557v7ecD\r\ntcgEqe/VKZCd8mYjVPEyKjnd8dSADCz9mebiMip6pfOJ4fn7IRoyP0esJkh9\r\neLgnjut1wtA6QxbUpAFr3sfddDUXqZxXVdI=\r\n=WAIJ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"5db1bd7747bde68bc956d054f2e939e62c78df6e","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.19.2+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.19.2","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.9f53d4a8a.0","@material/rtl":"15.0.0-canary.9f53d4a8a.0","@material/base":"15.0.0-canary.9f53d4a8a.0","@material/theme":"15.0.0-canary.9f53d4a8a.0","@material/ripple":"15.0.0-canary.9f53d4a8a.0","@material/animation":"15.0.0-canary.9f53d4a8a.0","@material/elevation":"15.0.0-canary.9f53d4a8a.0","@material/typography":"15.0.0-canary.9f53d4a8a.0","@material/feature-targeting":"15.0.0-canary.9f53d4a8a.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.9f53d4a8a.0_1653317862532_0.9798107199587531","host":"s3://npm-registry-packages"}},"15.0.0-canary.77cf00e37.0":{"name":"@material/slider","version":"15.0.0-canary.77cf00e37.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.77cf00e37.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"b4395912b611f88bc7f0a0582248e753db62d962","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.77cf00e37.0.tgz","fileCount":37,"integrity":"sha512-RDXDzmUWFD6o4FvY/9/etZyFfnm04oDzBUJyIOBQtz0IQDoXvYYqGI+r0Mn+IdyBYhFfSkcMNg0b3eOyCwehLQ==","signatures":[{"sig":"MEYCIQCIePUEwU4JvLuOtdWI31XdVNDcpdsNoEDnAGg1sCGsIAIhAPOcf4/6wkoLQXrHPIxJjLfx6DVPiRHavD+tDCALVQ+m","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":901990,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJillLqACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmqt6w//XoZBkurEFOPg49AxI+Fk9teD8S3wKPnuizhvO0PDcaFeNnZ6\r\nGShWyW17YGHhW6+GAnbr9a9cjNS0DytYkhPHh11XolLrHgAMu6+R6D9/yFL4\r\n6N8Gjl8WeWYKNKvStspVGnUKz+2VvOxiAufJ2/YvAyW5axNdhjEDtUmFkQuT\r\nJh3iIvivvw0XPwdSwIPQxZJaWHiet4a2p3JaGP2/SVQJFayuyjcpNipWnxeU\r\n73lOGC7ON8WbgeMpC/gUvITZNMkTpbToV28X4yifEdn0tZpaks/MxLj5Vv/Q\r\nx3n0UHPH4nGCVaBVDI9KKjpLCOIHWc/7HQeHZh1zP0RyN0TYF/SuCqW0tVEx\r\n8R0vDlByhpNIKylOICcgcaa/jOguUTYZct/Rs+PodNFO7YLrlDhZrXufzpAR\r\nAkTxq9UpxCBVs7lGYjwzsOwmYeqtcBbeY3bgkU61MJteoRqVAOX1YHgCyGHF\r\nRQpjsgmagIgJ+YFQTSAPkhSepa8l7dGmXbuNYf3xE4FABRAFVyPfLXAzkMNi\r\nm+OtFNtstuU/peo7RuWkFtVPXyhV3NauRTFRU+NUN/zQV5Iu9blRWUzJOjCQ\r\nxcj8+SzhVLHmJ4c0ljv4kX3NU+3bkQXQW+wrvXYYUXT2zq9K9QiG4A+EmntP\r\nWA8bLeZEHFfJ7dtGCe/H9qW47Taz7fpg+Ik=\r\n=Wjqc\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"1a68e64a5e78b8bdc529142c18c028aaf1b15b9d","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.19.2+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.19.2","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.77cf00e37.0","@material/rtl":"15.0.0-canary.77cf00e37.0","@material/base":"15.0.0-canary.77cf00e37.0","@material/theme":"15.0.0-canary.77cf00e37.0","@material/ripple":"15.0.0-canary.77cf00e37.0","@material/animation":"15.0.0-canary.77cf00e37.0","@material/elevation":"15.0.0-canary.77cf00e37.0","@material/typography":"15.0.0-canary.77cf00e37.0","@material/feature-targeting":"15.0.0-canary.77cf00e37.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.77cf00e37.0_1654018794500_0.33132815459500087","host":"s3://npm-registry-packages"}},"15.0.0-canary.3c7b844c2.0":{"name":"@material/slider","version":"15.0.0-canary.3c7b844c2.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.3c7b844c2.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"a0797853f9708c9754ba20eb3e559ac97e4a0dbc","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.3c7b844c2.0.tgz","fileCount":37,"integrity":"sha512-87rKH86B1LUnWp2Dr2uBRSr4QJzCgRmGSqRlSmCa++9sqoOmy9gtqB851bqy+7P4kw7OCZ/0zvHplMABzvfakw==","signatures":[{"sig":"MEQCIH+1B0nfoIQTPm1RYKxqCggyUZxSaVuSj9vBAdbDRlZKAiBtBzkdChaRLISzR2k4436FoSINL7RCuaZuvY2cNm/GKg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":901990,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJin89HACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmociQ/8C+rX/TrMmxc9RREerI8jewvE6U5V1YGs/R7igSiq5/G4Mo+u\r\nqGxJt/n17M5NliT/3sMIcm5QqxZa93oSBQ3j9mqgWF5KjcIMMOupCqWBbvcy\r\nEe5JksWDLwAp09wSGKSv5BKgLB8iCb17ap/JBMwqaIAb/5z0485kONGEMGXs\r\nYVLP4/7Wz3EV2btuG6VCnUIfkkSILh0/dPb1sGNtJ73oAUi7JIvb/Y67+yzk\r\nPIMNUIRPN0DM9aKdIr0g2c7uwIXSsJ29cIhJf59JUjJ936TGWmhfcjqkOTGn\r\nLDS44aEmcQ3w0SGWXZ49e52rxIQdut6FtWmnZevBZ/N0Zdiq/r4kMl+rYnZA\r\nwLLaHjeLc3MSJKm7dFLYXc2QKjI/Wb7mDC5xFp3nBPG/KNo6jayEypTrIQu9\r\n+tKTZo9Z5LVjHp3EmHuF0Z4tjJ+5GEjWigYYLn2zp8mtG1XXJmIY0E4jVDOc\r\n5jL2XL5e+Kgptt66tIvh86eX0R8vRW1ssu5366G5TG69l/siPwsrBqt6dX4s\r\nnW5HvKEKDD8cOM7z7QSe//i6HQ6aqJ8RLq3HxWbtU9c7EEGTQIIcvQeR9K5u\r\nL6CleM0gayf6ZfjmkDFxqGo4FWs1HILO63nj6mONHrpUvoywXoYtLFrTsSqP\r\nRoU5UoKpL3W3bWZfJFalMDtt/zFivt0M230=\r\n=5lnS\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"e9422b2e6573001fae4c8aeb7cc75741000e0034","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.19.3+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.19.3","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.3c7b844c2.0","@material/rtl":"15.0.0-canary.3c7b844c2.0","@material/base":"15.0.0-canary.3c7b844c2.0","@material/theme":"15.0.0-canary.3c7b844c2.0","@material/ripple":"15.0.0-canary.3c7b844c2.0","@material/animation":"15.0.0-canary.3c7b844c2.0","@material/elevation":"15.0.0-canary.3c7b844c2.0","@material/typography":"15.0.0-canary.3c7b844c2.0","@material/feature-targeting":"15.0.0-canary.3c7b844c2.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.3c7b844c2.0_1654640455714_0.983443165745362","host":"s3://npm-registry-packages"}},"15.0.0-canary.df47894db.0":{"name":"@material/slider","version":"15.0.0-canary.df47894db.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.df47894db.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"dc9eed0a80627e1b14ecbc6db2ca51fed2d4ee7e","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.df47894db.0.tgz","fileCount":37,"integrity":"sha512-HrvF+NKIIOIBP26ZnjA1Bbu6LMqGXkyLFrtcTZPuRSlQP+d1mvjwb0G0ysfrzSHH6XPvp5Aa1TX8O2IkHV8qIw==","signatures":[{"sig":"MEUCIHXKiAIitipuJvtgCzrARMQMxeUUT45LDA6r+CkCaTHyAiEArqdNc6QMhJDETpzbHmtI3R94e8V4ThMQFZfB3tqxAS8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":901990,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJip28WACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrH+hAAihgG3bYUjTHh9vbVt7oB7i+ZxFlzxqk4wFqBiyyCri8B3oqf\r\nS0OL0SX5ikMYwEYn88m64/GsWJWFWpaZMmDWE6zSETh41khlH2al0J/LeKqN\r\nsR35VCbPwiNgQqpO9PGRx79Hc6yYBNXhkgYlFwiP/N9O0yKZHbA+VH9vTRuo\r\nhefU3ftn4OPblDvhqUtGGJoCnKa28b+y2XLgcpAHhCDChi/sCiyfJvMJS9+F\r\ngX9CrneCPe6sNtyzb94e5yHDpK4nHfUvCTHP1Id2OpxTMU728ucuosrnUjfl\r\nwmJL0jSTMhmrixuVvhWNklg0WzAj1DoOBid0xKRc16sWHTQd1O2UabtOFVcF\r\nnS3CPucs3ND5RB8xVGnL+Jl/7Lbw53iYc/FgcjFWyAqaHvmeCCXfYcmWCX7I\r\neRjGYf0Mm04e0MbPD3zzaBTUO6JL8yGtTYbrC9/D1UhzvcgwEWpOwyc6y1M9\r\nsICzbnF3wUPWFpJVSCq0mWE9DNKlMcrt5k+RuLl+TDFXDbbzllEfq2MuGp48\r\nIE9uShej9YL9PAhsY1/MX2msKIc3Ult7Zy97OMlOd84aQXQSYuri8jtdgBQY\r\nfI/4p5isPVgFRk5hAwgxe8kU9sxD0fiz1jkqLZbDXCO9Ftr3YnyIf7SlRD1/\r\nO9lZ27EWbRXdHiMGymvkF6KkiT/9H9GibmE=\r\n=ckAv\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"42be62e51a7c150444c5b32b2d2acee03d09e6f3","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.19.3+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.19.3","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.df47894db.0","@material/rtl":"15.0.0-canary.df47894db.0","@material/base":"15.0.0-canary.df47894db.0","@material/theme":"15.0.0-canary.df47894db.0","@material/ripple":"15.0.0-canary.df47894db.0","@material/animation":"15.0.0-canary.df47894db.0","@material/elevation":"15.0.0-canary.df47894db.0","@material/typography":"15.0.0-canary.df47894db.0","@material/feature-targeting":"15.0.0-canary.df47894db.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.df47894db.0_1655140118248_0.6432047767487385","host":"s3://npm-registry-packages"}},"15.0.0-canary.b18a873dc.0":{"name":"@material/slider","version":"15.0.0-canary.b18a873dc.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.b18a873dc.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"a4a748032dc32a674e9b226440bc88078ace7623","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.b18a873dc.0.tgz","fileCount":37,"integrity":"sha512-ADQGmhV3m3yjoLpM8tVUV2vBVb7YFWu34CihkJ7dPvpAO+Wa5/Cu8X1aOnqViEPJARD/iky0YhzMCgztAdhh5w==","signatures":[{"sig":"MEUCIQD4k4oCBzxUWqzFiN1fT7yYfuklcqqbXwO6pvFzIvYm2AIgZURcYgwNWHi5rqnlAk+Co6HuMCE7EhZ6TdnVWAqIfZs=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":901990,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiqCrfACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrcdQ//Q9TGBIiUfWVhJ0+p332T4SIwEWo9vCvFiU7yJwEIRutXkd3t\r\nBUQKC+7+cRcD5EAEfrGU9+ldUTp7O3a+cm7Eoir1+flYIaSMGci8oXD2lU0j\r\njC6BCtMtJJ0FFO6LT0KPGk/I5wX5YAJ6D8HAx20YfUNqYinrqxNKx9bkkucF\r\nMvW6PPfU7c2QjCEG8NXLhB9oxaIaOXOb2yRbqAlqu5B+0qAUsfIbR9ilv7dp\r\ncJew8grtRssKVR2senCIPCOJbaOhRpSkdpTukiKnL6AvsPfNqvdjJcFjgtBh\r\nGGocvvrMPWVUTEDdLTYsspfhh/ADB5FJOEoZBwak7LDm08HaMOlASycfxc+b\r\nMfyL2CPx6aIRpuGAcyyXELGqCRiGnEt8XjkQEG6r8mBbMCis+8EO3POcte2w\r\n6yJGpJMLIexZcO6SPUKjIz44f7MNSMupwo08mNskBqfYC6Fwev1h36HsZ5B9\r\ncksWdkT5FiLziGeELm7pNCr4suZ9by0QSJzLyT2YOo90dNew+14p3FHT7MAr\r\nSqKl39iT4GGxH7C0qhdEc9Qda82yWvjK+M+5Lq3p2KhXESvxIFTkVZhEc66d\r\nH/RzrfbIqbPwoCFGow6Gr7dTeYUc3Zusu49dmJrL0YwYkM0VfWLn8QSr6Bf3\r\nvBwilaogj2uSjFV3BFm/vvEE9O06mstXb9U=\r\n=G2Ui\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"b35dadfc99a3788643d8762f8afda3f2d6e76d5d","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.19.3+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.19.3","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.b18a873dc.0","@material/rtl":"15.0.0-canary.b18a873dc.0","@material/base":"15.0.0-canary.b18a873dc.0","@material/theme":"15.0.0-canary.b18a873dc.0","@material/ripple":"15.0.0-canary.b18a873dc.0","@material/animation":"15.0.0-canary.b18a873dc.0","@material/elevation":"15.0.0-canary.b18a873dc.0","@material/typography":"15.0.0-canary.b18a873dc.0","@material/feature-targeting":"15.0.0-canary.b18a873dc.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.b18a873dc.0_1655188191762_0.770376760708031","host":"s3://npm-registry-packages"}},"15.0.0-canary.ba9c29637.0":{"name":"@material/slider","version":"15.0.0-canary.ba9c29637.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.ba9c29637.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"b90209ec0b7939456bb2ab8717ab8741ed9a64bb","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.ba9c29637.0.tgz","fileCount":37,"integrity":"sha512-98BTX0yd4Ia1CXrDo0n3LlGcFaeemJnSV4J0OlXAjy44lr+gji5xkNepcviC2qURm0L4PbqsW8z9cJBSnYhlqA==","signatures":[{"sig":"MEUCIQDOQ5bY9gwQhSz8GfBtsBOdCA/e5q2KCDUP6boeX+EmrAIgIkqoT60ggooiSU3tufhOWeeFmMYPQ2quYd1+/n+6vRI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":901990,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiqNoaACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq0AQ//QeuejCs6d3Zbe4RlZv+7mrvNgDJxNDdBNoUr2AZYgbVT2Dld\r\nwL8c5hbtd9Fpc/eOuhoz47WjfcxFYNFf/uOWyPr6U1YadHrG0cFDrQXJ1Lw3\r\n1QeXrTo5UYynTNMllK4NiyFZ38aOMVCypDftJ0QpjON4HFNgNOQu7b2QQ/Dd\r\n61PMwr3nPzToQXLLbmwFfP8ZB3WVde7YKYopJA1sK9pjQK57QJvqddcdh3X5\r\nNIc9xOPZhdB4BT5l4yRn6jjHdN+hp1hkcU+AkzVxXGxch9LtLkwRhZjLFf+r\r\nMYyI4iVrXBcYbrQpLvxwYx8XCh456QcT79DjBTCE9Z7UZTPApRykNuj1f6JA\r\nTybDyQuhnX6JYMSaeb7zHBbh5Ym6y9yOu9u1Km25JTwgN+Mqd/kwyT/CeZTp\r\n6Y97wvpfVyZfke0WtGZMBh7NDkMCOr3YQuwjMdH8qC02uQi4fMAgaSGsGTth\r\n5t1Gt6IHFSGlVUmSDOgqNC9bzKrTj4tJoGZiOf2iL6SSgk8R203f9OG85lIy\r\nB0K+g25bozrSKhVG+I99H3n8rahHWMTGID/D4B0WiLn1WZJGSEhKCl/bDGIe\r\nE9aH9a5Hrlmh50K9LzjMHbLFuLZ6BKd+1XbOVIGgUTy0ev/sJ0IXQD9dveFy\r\nEBODJa+MMI73kfAwTHesYTTk0ePusAeFET0=\r\n=V7jv\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"2bf89a291dc4aecd82cf7a6432d198374cfea69f","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.19.3+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.19.3","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.ba9c29637.0","@material/rtl":"15.0.0-canary.ba9c29637.0","@material/base":"15.0.0-canary.ba9c29637.0","@material/theme":"15.0.0-canary.ba9c29637.0","@material/ripple":"15.0.0-canary.ba9c29637.0","@material/animation":"15.0.0-canary.ba9c29637.0","@material/elevation":"15.0.0-canary.ba9c29637.0","@material/typography":"15.0.0-canary.ba9c29637.0","@material/feature-targeting":"15.0.0-canary.ba9c29637.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.ba9c29637.0_1655233050156_0.762930177419614","host":"s3://npm-registry-packages"}},"15.0.0-canary.9bfd12f01.0":{"name":"@material/slider","version":"15.0.0-canary.9bfd12f01.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.9bfd12f01.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"7f4761a742ab60be98c9751b2e9a6e5f34d88fa0","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.9bfd12f01.0.tgz","fileCount":37,"integrity":"sha512-Y0W1pn7vyTWtOsAGp6o/PlSRunmMwaRYCaMYX2CPVVAUomJ7uyS+EYlb363EpH/Y599Xrv/A6D9xgIFbuBnoPg==","signatures":[{"sig":"MEQCIG0KlHRI73/l3euEVUXUK4CmCZbFDlmmmux+QRP6J98BAiASCtrpWsldOifdWNpXOX8l/jZCUj+hBs395jNZYLQhvQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":901990,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJis2v+ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpWsg/+N9Ia3e2/eopqgZsUln5RuxVsfUisBEtHKfJdt96t07jIraRS\r\nl+ASH+NKHSL4TOZsSWZlcustawvnY7s2+OAxKtHjkU3q5Ow/mmfP7NEOVzY6\r\nWVu/8OtpVSXLuvBlJJBuJ5QRILB1BGOkWxHiF4o63xRTAkfHZwAqldEy2ZEq\r\n66/apKK0XoUVXBhjgCLuxsw2z0hTuxtdu4IyDIVZmei7FYCqHcWhnWj62jSD\r\nS4aAeZeqxQA2QPfFCwy2OtQIQLWuA8Xj4wOrPVGOoEJomgbJpRcSfkrfFHiS\r\nrEFYWycc0vHnm8v7aZep5C7J4mmZVhOnNItp4caEvbIr2yrHQpWXIEYVN+ns\r\nI0X4npWfmc0/FVSrxjBm8XssxB0R1xzKUhNIorqOdrcoH2kqlYBLKXVmzB51\r\nC8bfm70YBnZswbbhhku5ds6DpaVmXOx0LNgTHUaxhuPVgaA5PL4eWAM/bFy1\r\nYvh6Gzr3cYS637ptQSsKdBXvQ4GMDyi4AVCqt8oO283orAXC0u7bDgaZXqJ1\r\nlSmngoO0s6rFrn6L6MQpj7YnQovNSJIlrtXGYVLzcX0pS2+bVK31pIzTFGlD\r\nHOjO6YQhF/YqyeyHRUbYKKAne3e7AMUxTwAS/iFCfvi+Ea+SamBG8ggHn7B/\r\n5phEMBjDj2BJyBoPx2EbaiVCXkJENkHEceA=\r\n=lIYh\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"ba7b0d01530df70f39142820ab69babfc9cf5b8e","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.19.3+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.19.3","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.9bfd12f01.0","@material/rtl":"15.0.0-canary.9bfd12f01.0","@material/base":"15.0.0-canary.9bfd12f01.0","@material/theme":"15.0.0-canary.9bfd12f01.0","@material/ripple":"15.0.0-canary.9bfd12f01.0","@material/animation":"15.0.0-canary.9bfd12f01.0","@material/elevation":"15.0.0-canary.9bfd12f01.0","@material/typography":"15.0.0-canary.9bfd12f01.0","@material/feature-targeting":"15.0.0-canary.9bfd12f01.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.9bfd12f01.0_1655925758599_0.2568265840265598","host":"s3://npm-registry-packages"}},"15.0.0-canary.764de225d.0":{"name":"@material/slider","version":"15.0.0-canary.764de225d.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.764de225d.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"daf78ef0833c2fe86087ca59bb1c45cefaf50596","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.764de225d.0.tgz","fileCount":37,"integrity":"sha512-sxQFUXQS4DPszKJ0gPShFrbk5RFLYxurujPsVvUbu3IrrxbcTZYtmgqAyaIjdYxcxzrPyVDo55t0Njgn7yoj2g==","signatures":[{"sig":"MEUCIQCCsvRcjCCR5F4x3A1nAgWtID/N704ZXP5AlKbgoO+sLAIgZXjK7phq4dXwzISlCTgyFIWsLlrFk2Lhv/hZ6OZbChw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":901990,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJivH1dACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrpjhAAnvk1yKeEEcvrpWYqwd0w6eA4TbVvuYqrV1hgzMMdqN+pB6tw\r\nefaqgqyH2+KRmVXGTRC9Tmz+DPJwUW+Q55cwKS4shw5x78/9RxGaxvnwafcn\r\nViGjxA/9rmqYCWja88UGNKZ6ettleYX3uw/BSVGAgaCsQ7rmnyjCN+jdrMXP\r\nSh6ZjMM4AJYQYKiKU7EAYpBYSr028Qy2ppLANQmIwySNQ2/gGJD1ulDBgMCm\r\nmGtpgDPphR5v909f1jHxJgjVsqtJaWXcXeu6/hIqvUg9CWCImXTRWLzDO3AK\r\nDWRvN/nFXUMxW5gWFPSII/hnYaI99TtgjvCCDE1GuD4O8Y4OIZxOGHATW2ib\r\nMYCIF/v90ti2QKWtXKtzzIlTej2BAT61+ngxBF52IsZQ9hjFQ8LdbB9SgpId\r\nVMaywryF3PgP/XMrAyC2YYf7T/9VNbGjgjJH8Jl6Fo09RMbZEMobKRukJD1T\r\ngHnh9J9tUQbdMhPzNIswMAE2bwlaNMkZK7oJ3ct7ZjIoufenznUnM3IF46we\r\nF1SBjEn5JZv5T/GwQFUQnv292MF0wa3nkTGkjzVIAJEeEnLHu6knD2SAHeeo\r\n4PJQTsANSOriDIRhs6IyGcHicIxqxpue8qHRblEiaNm7pe840b2cxS+Uq10D\r\ne4q6H9983lX7QHY7rQFiFD9OJbkmp3dbRLQ=\r\n=EtLl\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"25c0f0a7c9d8dcedfb35f64d0851fc4fb86b8534","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.19.3+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.19.3","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.764de225d.0","@material/rtl":"15.0.0-canary.764de225d.0","@material/base":"15.0.0-canary.764de225d.0","@material/theme":"15.0.0-canary.764de225d.0","@material/ripple":"15.0.0-canary.764de225d.0","@material/animation":"15.0.0-canary.764de225d.0","@material/elevation":"15.0.0-canary.764de225d.0","@material/typography":"15.0.0-canary.764de225d.0","@material/feature-targeting":"15.0.0-canary.764de225d.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.764de225d.0_1656520029277_0.529302906997523","host":"s3://npm-registry-packages"}},"15.0.0-canary.31e517cea.0":{"name":"@material/slider","version":"15.0.0-canary.31e517cea.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.31e517cea.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"8a846787f7096755f832bbaa12f3cc7332beede2","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.31e517cea.0.tgz","fileCount":37,"integrity":"sha512-xEj3QF7cLZPvNWl/YqSKZMfcW8yZMWRwoKdwEaJ9poa63oQDmSb9tZT64nYzO/ZNF1JTa9kd3/aasQSKzfMgIg==","signatures":[{"sig":"MEUCIQDcaFKO+WJ2thMnQFksv7ybJA2LMMpWt6BeXyPQdiAleQIgO4b32QbhluzPMZrCH7MHidlALIzLc+jqVwuXuu5QahM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":901990,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJivzzNACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqcPQ/9FGmTsj78p83pLBRvaWS/ma7Xrc7EW9gOWI+SEI1AH9NUAqc5\r\nOMBiFQp2JcxgGSlevcmLHS+6goAmcNbUe+b6CG8poGoZmSL9hwp0JWzMxmNo\r\n2eomO7g8FbnkNEjcYJM+jMuL52lCQCGop8B2mIWiBCi234Bka5M8wdevtku4\r\nJU2W62AmmSGS7ovapal65xDiqVpZqgD6dXUChrTdo5NyB1bGwvkoNZFEtunQ\r\n0lW4u7BcwBS/Rfx20IB06KZE2WTgLUAewmuawb0ZsdQW//KaxxVYDs3R64rr\r\nl3m/v1sr4ofGAp1/ksE1mldXe9BmrGWrifFWQ8gf1U1TYRDnNr+2DhYh/LhM\r\nnKsf5fsIgXJcoXZDOsYpcr0vOa3Vk+EKuiM7XQnf6lFMzCLK0RWeQj/UEPw2\r\nExml+craWVSyY+5hmvfDlaC6MmeOT9jcQgK/qzCWrSc4rYslGvNfAAGwD6sK\r\nCHwmc/AYIWYaKrQwiTUMR/8iWc1jba6QtgwH2Kz8Btzcx9FsQ7Imjro8R28l\r\n5SxUSwCvBwcZknYin5fjutgDXp19kY8gjxkZ0hpbCBPp3cgj/ht0Dxl8McIX\r\nHIdKyNws1xA5NnWvnCPChWBLgJ5GDLH2P72rMy8r1lBiYBJuPIe2L9/Lf1Q+\r\n6ol8grZ5YjSCUZZOVjTEgh3UpwKUJos3wuQ=\r\n=t72G\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"8af6d916fdf79ba9e33a883ad56f539f3decd5a4","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.19.3+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.19.3","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.31e517cea.0","@material/rtl":"15.0.0-canary.31e517cea.0","@material/base":"15.0.0-canary.31e517cea.0","@material/theme":"15.0.0-canary.31e517cea.0","@material/ripple":"15.0.0-canary.31e517cea.0","@material/animation":"15.0.0-canary.31e517cea.0","@material/elevation":"15.0.0-canary.31e517cea.0","@material/typography":"15.0.0-canary.31e517cea.0","@material/feature-targeting":"15.0.0-canary.31e517cea.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.31e517cea.0_1656700109672_0.27233202211776053","host":"s3://npm-registry-packages"}},"15.0.0-canary.9ea4e8e9c.0":{"name":"@material/slider","version":"15.0.0-canary.9ea4e8e9c.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.9ea4e8e9c.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"ef901230de84aa73c468e8805a23baa84b15ccc5","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.9ea4e8e9c.0.tgz","fileCount":37,"integrity":"sha512-Vn88gF8Ex9wYuvf4yXfaNdJ+m6u+pAyhP3uuEAbd+5x557rcJcAEMMECyCYETsgJgv2a1eBUvgz5MZlgEPkFuQ==","signatures":[{"sig":"MEYCIQCGegcaVR6Vt4BpFJLzPJlzY7tor07g+iGQIeOSmMpCFwIhALGeVz3+QLqsrFOwRAyPHv2owV/+d6N3hAngoHQElgaI","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":901990,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiv3tJACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoaIRAAnOO3CKlCH0KELu0RetqPHy8zQ0nq59r2cf+XhPEJWHtAlMlB\r\nZ4rwzAhdfVx0PHDqtNl6juq+dKNEctsvMrTOcUDO3XdEr5GRijrR7QSGXOuj\r\nml57MK1qvB54Q1K5zdkXD2CenUggr7s6/4tN6lJxgqecuT81/Wz2oOHFaWq1\r\n1VQH93J5ZlN7WHEUenpyTiiar1VEyayQ+OxPnmwirud4NmgNKAlBwQgkWCpW\r\nVZjaDiVb8ycMsMdRSx+/v29patnC3K3L0CAGV9UxQ98i7sVbMFHQndzKUTF8\r\nouYT9OHpDlVbg5KUovLHDEUQgfIDsq9Vkx16EHvJjFll9kPd4/lq4MuNWcPK\r\nycv+/jQgy98vIHv7uwNZDdEh1l41NIYk850p9bwdCX5ITmwvIz64p46JU0Qe\r\n9nSFjyS2iUaB1gjAbwJ57PuJj42BlZXHDkRsnklp4qjTnFJ+2Vk68GFYYHni\r\nJc+EVfI859X75ZdkRyo6CmAilXZv0wi+ZY8YZeWCT9xZtA+dAM6onoSufDsi\r\nVkxc56iNYOMpMDd3/fTZoP9RFXwp4HQytt2nNq/NK+SwomQquvImzFg3pGm3\r\n3lV9+ry/gwyJ+bfBU12bPa2tblcr5xgtCX8crtTteWfv+GKAYX+clC1MI9GM\r\nYK/IPWIOdj7aI0CIvacS0oPbQKGek3VS70g=\r\n=+vvO\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"7a2b791f6f1e376a53ceef81767514ec18174558","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.19.3+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.19.3","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.9ea4e8e9c.0","@material/rtl":"15.0.0-canary.9ea4e8e9c.0","@material/base":"15.0.0-canary.9ea4e8e9c.0","@material/theme":"15.0.0-canary.9ea4e8e9c.0","@material/ripple":"15.0.0-canary.9ea4e8e9c.0","@material/animation":"15.0.0-canary.9ea4e8e9c.0","@material/elevation":"15.0.0-canary.9ea4e8e9c.0","@material/typography":"15.0.0-canary.9ea4e8e9c.0","@material/feature-targeting":"15.0.0-canary.9ea4e8e9c.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.9ea4e8e9c.0_1656716105149_0.9055945831450123","host":"s3://npm-registry-packages"}},"15.0.0-canary.cd5bafabb.0":{"name":"@material/slider","version":"15.0.0-canary.cd5bafabb.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.cd5bafabb.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"6e3b0cf9fba5174009189acb67416272384d6b49","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.cd5bafabb.0.tgz","fileCount":37,"integrity":"sha512-8/dONCXGgRTHy3pg4FiQa8MMoYFBpKS0G46j2oChDjGx9AmRdYFc2pl4iTVNL0xl72/1frSNKgNV9J9ny/egzQ==","signatures":[{"sig":"MEUCIQDpovCSMpwelIJvKBMWF1+Y8pItDJgsLxgOBpyy9YKPCAIgDNhfXhs0XR5qrbvttOwH7R2WGtbNs6ePIRQPnjY8t18=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":901990,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJixcxVACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmrwtw//UOT0n+4iXuUuC1VSMq7WnpoHyfxSrr2weVw95PvfRu8p/Ldy\r\njfx8IDQ4OfcetAiWo0hI8H9t0eUOKlxgQ9dgCB0Lom/eZp+nOfxL2EMzBcWG\r\n8DTxwvattKZ8Gtrr0QGnwy2egrnEibc9zkFATGmvD4jkwBQMG/kmv/HbxVyr\r\nLRWtI+HKCDXhDH5HXoO7/ozpXP1/F66qnuBDcUEtUCEihjjalpDV4XctJ92Y\r\n4AmLMBGaS7NSeQRJvyOOjQa8YRWeKWtt5AuE8V+bU/KaqdhT/QhKIjt6BmCO\r\n30uIc2bIjQgoAMRYzfhyzsbhBsx5SnHHB+8YgE6A8KLbCzAkpCfuU3ZP4k3Y\r\n2Wk7qkN23ODV1gksoHP5cegUuqP9J84dVhVVPMwzsGxoyS7EAM7xRvWmOQyh\r\nvv/JF+lvqeSQWNiLH+LXg8IdUmQesLHTRdUIYX1OWar8svnxas9PBV9/Nasu\r\n/By72jcTB7szqFoRa++iq05GBbgWUH6QPf0ZMQYP12zGBQ1TMZiREIxOj7DS\r\nDOlEzDjpt1o7QCrNa5CWBq8IL5MfOwsBL1TFtE3xDbQ/QcZdjjpjOpG57+Mh\r\npVDIEMqD9MFG7m6rmmMvjDGrMZiWIwvDFE+Xqtn6Us5RoKwexuGkg9OQdH2T\r\nKaTCuygNbbMaMMQBfuRMejo+ar0rWakyxtY=\r\n=3PH6\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"fceb62aaa361c04ae0a30158d529c7e6896b6f9a","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.19.3+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.19.3","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.cd5bafabb.0","@material/rtl":"15.0.0-canary.cd5bafabb.0","@material/base":"15.0.0-canary.cd5bafabb.0","@material/theme":"15.0.0-canary.cd5bafabb.0","@material/ripple":"15.0.0-canary.cd5bafabb.0","@material/animation":"15.0.0-canary.cd5bafabb.0","@material/elevation":"15.0.0-canary.cd5bafabb.0","@material/typography":"15.0.0-canary.cd5bafabb.0","@material/feature-targeting":"15.0.0-canary.cd5bafabb.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.cd5bafabb.0_1657130069593_0.9804682194328334","host":"s3://npm-registry-packages"}},"15.0.0-canary.a02fe49d3.0":{"name":"@material/slider","version":"15.0.0-canary.a02fe49d3.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.a02fe49d3.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"ce333690f5af0c9593bf629c2f5cff6d6cbb1d05","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.a02fe49d3.0.tgz","fileCount":37,"integrity":"sha512-y9PZCWzV67CoMpScuv6Ca91OlmZoPGfQnzQynGM0e0WLs0Zbd6ka981eRzmtppzzFvc1T4RsQ5Zu6hb/fyit9w==","signatures":[{"sig":"MEQCIE8V1B2JkGfZ/pAtMwsc7EQA5pcj8MUfYVFjRPb69Uc6AiAnZVTHMS/7o/EcqaSPajcfZ3FZjprZM7gVhVP0YR8R6g==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":901990,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJixdmeACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpgSBAAo/FnkILR/Eo+0V1SnS1EhRT9i9t4lLvQite0VDOxmqKbqQyh\r\nHjs500xsAdHIVMyuuyh+AmClDDhW0EqXRPzOWK9dlbyrpuhZJ5jqfSVL7QN4\r\nBXsx1vaX7aIKRNnUJ4b9HCiLno/pDOr1e5amhldk/hsCbiFklZvpb9yhUrnP\r\nC++cwpL5rBH1Ikn4ExUJPtRfpmvsx28UuYRmJudVrJ4ZiT7KM2cYbzJW7K9t\r\nL/awcuHakku+uFOO3v+P1XVVkQPB7VmoK8X9cAT9RPF5ufh4JmfUo4dBEEtD\r\nTsRBkDZnZOgsYEBRmqMXIVdU1qQ4UIy/TIhGLxC39A9Tzt9RbPLoiLDrGpoj\r\nt4Q9KB+ZOf0C6vjESZMu/i1xqTwOVCYYMnqOzdYWc1FvGKNHvJiWsHOd2F7d\r\nKEkRHdXlfmk5mOWV0bwEFINLvkNmYym9sR3I93z+6YVK3gQpIiHZ0yKKy3Ke\r\nL5YBtbDPN/xJKw8egJ/4lK43uXADJPxoOwNvfnW045c+TCZTCnAQKeT9uFxX\r\ndvWTokSGeeQFN4ONbnakYyzvCdD04D1AmJVGNdnrHfcC+iDT4SMTBVzrwI40\r\nlM+4Q8Nsn3CyEAeUOFk6OntVX+ouvcnuG/+xpT4uuCL6rLO518TpPYnhNFOZ\r\nitJGZenlhVM+w5uBXjS10uMLxtwNXyu5gmk=\r\n=7Ybw\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"8304e794f430681d03b9d2d3193e635a072f2d8a","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.19.3+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.19.3","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.a02fe49d3.0","@material/rtl":"15.0.0-canary.a02fe49d3.0","@material/base":"15.0.0-canary.a02fe49d3.0","@material/theme":"15.0.0-canary.a02fe49d3.0","@material/ripple":"15.0.0-canary.a02fe49d3.0","@material/animation":"15.0.0-canary.a02fe49d3.0","@material/elevation":"15.0.0-canary.a02fe49d3.0","@material/typography":"15.0.0-canary.a02fe49d3.0","@material/feature-targeting":"15.0.0-canary.a02fe49d3.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.a02fe49d3.0_1657133470351_0.37188842503450026","host":"s3://npm-registry-packages"}},"15.0.0-canary.826a3d8be.0":{"name":"@material/slider","version":"15.0.0-canary.826a3d8be.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.826a3d8be.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"6ce5ccb67ea81bdcc4fd2a834717736dbd29f123","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.826a3d8be.0.tgz","fileCount":37,"integrity":"sha512-kUNPqPXDl2FMgVPViWRe4Rq53A/FstMSpBoWOIle/8Yf9fztioekQeLdPpEt3zoXzSET1rA8bbuNAmohcb1L3A==","signatures":[{"sig":"MEUCIQD5SMSau0MWcwdXAcyOmGhA0H6FhyUDzFnlPOc0LV6VzwIgFaSpnoQPJIxQQYtBsrK9pmES4aYzNta8MnQp4YMFWsQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":901990,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJixeL9ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqgEA//Sct2/6ApYwHpAjvLQmiMNAVOEgG2MKHi7U8Q7d+sq1iYIXFC\r\nPpLWpz39bj+ROSQsNrMiv5TGLnY5t3PkdVfVnjw583N7pTOze8gx6fPDm6M3\r\nEeKgVG2LhK8McDgdfgC2Y11HaqZ/9lnQscIL1AiGSRX++cDrDRayKtB2NpKD\r\nxmiHnH+2Lt4Qb4UhVMJw9dCj/5OmsxZLYhdgmArs4OLW+AV1BpVRAUDGIOrL\r\nWmsvVYEiNFcvSNYHZb9GHS7ecmSsXtKGk04xmjfighWYKduBCvTGf3Z4aJ+U\r\nG/NTzy26LKzQ7w/C85kMycgf8aD1N3toyBjrKYYYeozrtBOU0zvevUu9emmR\r\n3zLG7fi6Mp1WkxeD1kOjakfv/G1OAG59fGhoAoT14fJQ5kzsZZ65uALlhwQ3\r\nVpjgedtpgErtp4u3iY5meyM2aBBnmhgp7eoaSSW/rwdIqB8Zo9kEpq3h1xdf\r\nv4oSKnDByc1Rb/qN9CpIHTF9Dq+ZsgqB7XFTDGfIPrmV0BGXvG38jBuNiYW1\r\nF9ItaAJhLaczdkpPdiXfNk6e5ZhOtaLar+rWkuNzGi+d2q47DYqOX8oW+HMi\r\nvS7mXxlGXaMZ96JguB5IPrG4Z8IwSFviff96pRiqE1QHQNAtDTUror0zsNOw\r\neihjxD+HK8a7ZRCI6A9iebgUZUx1M2+xw9U=\r\n=t28o\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"f54c723431e97d10fc1886f271ed251cb10209ce","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.19.3+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.19.3","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.826a3d8be.0","@material/rtl":"15.0.0-canary.826a3d8be.0","@material/base":"15.0.0-canary.826a3d8be.0","@material/theme":"15.0.0-canary.826a3d8be.0","@material/ripple":"15.0.0-canary.826a3d8be.0","@material/animation":"15.0.0-canary.826a3d8be.0","@material/elevation":"15.0.0-canary.826a3d8be.0","@material/typography":"15.0.0-canary.826a3d8be.0","@material/feature-targeting":"15.0.0-canary.826a3d8be.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.826a3d8be.0_1657135868907_0.2266957460221084","host":"s3://npm-registry-packages"}},"15.0.0-canary.ef276aa93.0":{"name":"@material/slider","version":"15.0.0-canary.ef276aa93.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.ef276aa93.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"a659b83648ee085b0642990ec2dfabc71b23f147","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.ef276aa93.0.tgz","fileCount":37,"integrity":"sha512-9V0hys16+NHqJpAW2EQRSp6htFP2/G36OTVmesMyAIAQIDXUbAhGCpSOFXH8AIdTYBXA3CvFJCctu1G0K11v/w==","signatures":[{"sig":"MEYCIQCkA3Zcmb5R35Dw3DxWYOc68yXjWcj8JmQsIb3SnxSItgIhAIy++gf5o9Mr4uHotco5ls92HdNmYIaBco5LCgmeZnB2","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":901990,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJixxG1ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmo/RQ/+NjRRoHg8oQsyWOpIN+Tw+eM4NwRWJby49R2Q7tC3Aa0qxK85\r\nZho0aGvXqi61XsqrF+bUXl9DBSRlbqgdqtBSb1CqYbknw4VXEWFZktNMdJQ1\r\nu781ZUwZ5dHmusJ6ctKsz/RpIbOEssyM37Dg70E3eXkXLKsL6JFnUC9Pe/Rp\r\n1fh62M7H+bU9AtzWI5lL8UCXvbOju6lvWZyRgN1tGkCbQI3GYnFWzgnzbV/f\r\nLtgMlLHtUMEPZAgNZzZ3bqStcoBrtK0c74o8nBMKWOVjtq4+IzG2ssUW6m3T\r\n885SZ6kCl/wmPht5o3dR1DIuADbSyr7Aumc1soYZBm3z2FaEWhTPb+2OWMj9\r\nk5nAjCYnuNp2IRxDXMUNh/WLf+MFSZiutE5jc9Ok/ec5vkF4bYe2a7MNs4Gj\r\nomNi7qO02SSnR49IXl9qU8IVpwsXScF6pKc27ZHi+IJVN8EC1/X/mSXRsLwn\r\n1Kk9ZAZKdzma+M3xIOxmQA1szDsPPEnZQRy9n44DzHachaRbQH0jbKaAVQn5\r\nDnRoV71xryvCO5vz3WiPkqrZFXV33AkKm8BvhEcuC8yTFKnlRqG1s24HNR/I\r\nBK6SKfxGXs2hIzlcvYkx1aTiU35DWNyWfG2VLvOPX+6ImF9RsGDLaaAzWjjx\r\n0tQW5LSoLHmNA6NnKJsux2X7xL+7KeSB2Uk=\r\n=geNo\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"502fb9536e29ea5887a9fac4aaf0c9dc2c732e61","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.19.3+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.19.3","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.ef276aa93.0","@material/rtl":"15.0.0-canary.ef276aa93.0","@material/base":"15.0.0-canary.ef276aa93.0","@material/theme":"15.0.0-canary.ef276aa93.0","@material/ripple":"15.0.0-canary.ef276aa93.0","@material/animation":"15.0.0-canary.ef276aa93.0","@material/elevation":"15.0.0-canary.ef276aa93.0","@material/typography":"15.0.0-canary.ef276aa93.0","@material/feature-targeting":"15.0.0-canary.ef276aa93.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.ef276aa93.0_1657213365080_0.5944640888552808","host":"s3://npm-registry-packages"}},"15.0.0-canary.59cf61d6b.0":{"name":"@material/slider","version":"15.0.0-canary.59cf61d6b.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.59cf61d6b.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"2637806caccf8433cef478559fa425c80e5c11dc","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.59cf61d6b.0.tgz","fileCount":37,"integrity":"sha512-ZnXf9PoQMi7hdOCII4mRoG53wnEV9qyte189l2wbgCtBEnCcJsVQOMYqNGz2joa8kEPBlVCW5eY4brPuRoZfhQ==","signatures":[{"sig":"MEQCIF0fJ7QpfRS2UW73KiAeIF+/ohUPHaY5tkvWGKAPi1o7AiA/4X4BEt33ketq9GR7X5D1CqsIIxPVluuhjs7bxMjUig==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":901990,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJixxhyACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmow7g//eSU9BFPIujGLmFQFwFmIFZMf6UWAXONfs6l+5Vr2oJxW8re7\r\nKCShj8ytN+vSuLdU++mBG+iMnGXoUWRxhFWpyVPyZq9ZzXx5VD269v6UIjy3\r\nmTcIl3Fkv5HvQZ84Ia48AiQk035M0uAXeSqYP0DiV8+ZfqT++BzoYdGTiIay\r\ntylNIPl+02vhErm9FhDtNtrwhKwseyciZwnFTgiiFvzSCOW+KEzveoZgdzlh\r\nNwC/DLmWw65bq7bWNXMphQa6mkBKQAmJWAC1ooVZKJzTfiQCg0cd4mdEE2co\r\nhQyrWkL8uH5bZHm1kb0V8mMn7brpG4ZXg+MDL9kg2fitxUOANtOURbTNyFnK\r\nJk2CrJUWBmE3fK4jXSPr9XEcKCSdHVgXgn9yuGr7OMx8ljgpj9P9OyeImhgn\r\nfr6yoOTM7cGK3+OxAYg2/yhOGV9UFoHw3aAom8ciHgA8EFSnBa/E4qGBMiBn\r\nWKkpnyTbb9QGnq5CWp+bRxGxwajcGL0qx3GOMYuTNHQyYx7IKrc0Mk9SyYmX\r\n/DuydnZ5DO+BugZ/9kskYdIVky6dX1yP/YPKgRbBFx0YsTYnBzHrxnaQdWr2\r\nMPc9WqByu+AeJCt0UtVfdmMsTBxNBxjX2wW3dxRWC51cxKjQJUCItPWKBtl7\r\nJc/YT+g3jeqaBC3CLItiyJdTBkS19vOy93o=\r\n=iNec\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"2f27bf33b194929683b4faa9f388325b07b408b4","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.19.3+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.19.3","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.59cf61d6b.0","@material/rtl":"15.0.0-canary.59cf61d6b.0","@material/base":"15.0.0-canary.59cf61d6b.0","@material/theme":"15.0.0-canary.59cf61d6b.0","@material/ripple":"15.0.0-canary.59cf61d6b.0","@material/animation":"15.0.0-canary.59cf61d6b.0","@material/elevation":"15.0.0-canary.59cf61d6b.0","@material/typography":"15.0.0-canary.59cf61d6b.0","@material/feature-targeting":"15.0.0-canary.59cf61d6b.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.59cf61d6b.0_1657215090608_0.2881470078445738","host":"s3://npm-registry-packages"}},"15.0.0-canary.8647092f7.0":{"name":"@material/slider","version":"15.0.0-canary.8647092f7.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.8647092f7.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"e5187b919ea5877f98a9cda7e980727be8f33caf","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.8647092f7.0.tgz","fileCount":37,"integrity":"sha512-1fcYot04BoJvdPhnvMrwesUrV8VrvNqHNpHz/oEh6dV0rzqGh6JrzwsLrRyLeVLK6GSmFyteJtDptJKXQwRIng==","signatures":[{"sig":"MEUCIQDEnHz7kh1/46hUCMw+SrooxeGSLhKUH4bJf5sL9ceJWwIgaeCV8G+wqCr0y6rFRoqUCgvULlJ3cfrQIpQhyqNPAds=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":901990,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJix0RWACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmp71w/+JpebjSe2+XEQQ3eO9Z9r7hAdC7CxAY5bTLNbWjEgAqFQh6Em\r\nyLkii9xBK76j12byzu103vuV9kpaB4I1rcPRxDkFQwkJuILQxtXAyqrFXY3s\r\n2LRorRo4khlZzvoHAQFXi9gAb3rZYKHNJOtip3hL/1CdpLPOTqbPrt64c9ou\r\nOZRjFnzwqJWSWjyR0UY8c1AREuO+yJTxU1bu93/HW/86M0rVI+P9o8j2v0HK\r\n9WbstGAyF8CGt98j6QBAkjZhYujaSbq6HYXwCv5f301hMiaoT78vl00tHlz/\r\n2Vlcb7sWRfhvjX8OsPHAh512zCSzF8gjk+KC9E8OdURIcxRsx4SPQC0Zh/Wu\r\nyRuz9r/IG1DcXLdQe52UyeylJkJKszTxai2g8NTxFvEgZlW4fZs8s+HZJzpu\r\nt4wXXB/JzL4mpdj9Gt/2aT28S5vJ1UW2STS1zAYbZMYzEnLkgqI5sWXog4vK\r\nYJV+/Rr0QtiBMsM9g+1Jhu80/+I/vsf8LIoF4BTgtP4srkyYrjUIjucmU3NA\r\n3ubzJdSRwywX5UGdmTrFY9QIq9JV3SScnFgu7pJlnf+3RGjqW2PwhBsb7En7\r\nZwtP4H/Y1Kd0a5chzVgYqBP+sdBxawZQFyhhdAxkCy198nmj3YT5/xAaXWPW\r\n6tBsKSMQzGg+A3ZIQk94Kh1CYSXfDQvoN1U=\r\n=EMew\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"1edf72197ddaf5b6318f71205888f8ae695e9b29","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.19.3+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.19.3","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.8647092f7.0","@material/rtl":"15.0.0-canary.8647092f7.0","@material/base":"15.0.0-canary.8647092f7.0","@material/theme":"15.0.0-canary.8647092f7.0","@material/ripple":"15.0.0-canary.8647092f7.0","@material/animation":"15.0.0-canary.8647092f7.0","@material/elevation":"15.0.0-canary.8647092f7.0","@material/typography":"15.0.0-canary.8647092f7.0","@material/feature-targeting":"15.0.0-canary.8647092f7.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.8647092f7.0_1657226326442_0.9631195131175523","host":"s3://npm-registry-packages"}},"15.0.0-canary.02ecd4d85.0":{"name":"@material/slider","version":"15.0.0-canary.02ecd4d85.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.02ecd4d85.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"ac609013ba870c53e17d0bc66a3c1d3432a86d5d","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.02ecd4d85.0.tgz","fileCount":37,"integrity":"sha512-1ljN9jaTYmla92uXKtCNqfLOVrlDmp0/5x9NTCJthaYEK+pIrobMSL2t13UkVs+Ci5TpV+HvTKSvUHYJj39VWg==","signatures":[{"sig":"MEYCIQD9IZAd8uBb5Ohy2vKWtOcRtKhGFRfcxmKDu+BLZcO5NgIhAJl3Rz4/qtinim8vcR4WnffqQMwYWrqAp1Wv/5ietgvL","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":901990,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJizFI6ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmp7zQ/7Br7fUii10yH/wIvwfQtH7N4AseXlkEYUnCc7xkQkf1mUAROU\r\n6zFIqRNowoBa80YWYDKEhgOqxBnMS1u6Q80M3QoFDYfZysh9K8miX99G6UMT\r\nPPrw3YX4DK8ACRwu52crZCK2GVZbL4ExKP2SkvlxaM4ZinReZ+/Jw+mmkrZh\r\njCOKTsjJRdDeFlsfYJ+qXSmnCfs5Z9fcX4nJtnMKW+WLa10/qSx9T0EYkmLf\r\nSKhGjI517svK28tqRmuO7cxBVmczRbnJh7z271ev9uhliHnIFPYM3MIUuE8w\r\nZMY/65ie9nFfDg2ZSLVxH9YIfnJtEvo955sVix5IvfDEFb9/Enkhmld0Qw60\r\nP7uDt0/CKBQLpx1KPMYmrVsrwI2MKmg6ijS/iGpQ6Mn+FRVxxcaBPUTJgfvP\r\n6J/8KKZgCCk/Q8egP7/O7uVt62HmDLN7mXjfIbyqQIEWbcDrOewF6N75fsXF\r\nMK0I05PkS44brOzfpt1OfE50IwCUjXIovu9UgQ/1BHhVrdn8SIm1eKPWicfh\r\nXgwtZhF41hC/A5DU+kqaKGciPwZXdI4/bcGFRcAqYvEFWmSB6xdTekFdCmB6\r\n3rfaqk7ZTWK7G6H0mh6rhiWTxLL4b66KdHGk5PJCQxO3sJM3baFpeYe7jQFE\r\n/BrTiP/5shMdASdjBOOiwkxKpe8wXwbrslU=\r\n=RNir\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"e9bd9b1837b6df66731c0fc9da61877874518d2c","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.19.3+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.19.3","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.02ecd4d85.0","@material/rtl":"15.0.0-canary.02ecd4d85.0","@material/base":"15.0.0-canary.02ecd4d85.0","@material/theme":"15.0.0-canary.02ecd4d85.0","@material/ripple":"15.0.0-canary.02ecd4d85.0","@material/animation":"15.0.0-canary.02ecd4d85.0","@material/elevation":"15.0.0-canary.02ecd4d85.0","@material/typography":"15.0.0-canary.02ecd4d85.0","@material/feature-targeting":"15.0.0-canary.02ecd4d85.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.02ecd4d85.0_1657557562724_0.9125713220478815","host":"s3://npm-registry-packages"}},"15.0.0-canary.63d3a146e.0":{"name":"@material/slider","version":"15.0.0-canary.63d3a146e.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.63d3a146e.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"1b7902e7703c7443f4624b3dc32fd317b1abadf5","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.63d3a146e.0.tgz","fileCount":37,"integrity":"sha512-sU2wOX1TqII0QFqpFu+LEstwXFCyjxCUN430WpNFYSQLA2ZWHJ1r76ZDwQljMTESI1iaiqYD47DOpmdynaP14A==","signatures":[{"sig":"MEUCIARnb3QfB0pMicEJGHUiEShdLAaX0edmNMxfIhmCoPDSAiEA5uhcQoaGPZCQG8HmIqROqN1imVbwsoQnZXR7g7Yhe08=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":901990,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJizVz0ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmofJA/5AEvG2SQHsWu55WSnDnmYYm65h7wJMu6iG/DtE8a0uKfBBI3W\r\nxopUc1SlJdcm2D7ggWcYJx5OFzwHUXuXkWEn/Zk/w/V06Wjclbai1krM9hLX\r\nT7gZtcFdQpOpMrb2ByHmgFtZA533zxvcxLBFjFS8z3zuiV59WBO9JcODd9vt\r\nlEsPX6uaCg20HakP2Jy1wFyh/vsDyVLiwjn2uLqrlqJjBozZKPyb2mWLImLX\r\nM5hFGdPzI2y8Kq8DnaVdmrYMdJlCJWbU0qSSCpvBRjQuYTwzu7Tcj1MiQO0w\r\nw1A7GHC46ysFg73qk9YSGWG00juyiBgcyiugWgpShljj69MaP6n9bI9T4wp7\r\nmxasDd45ayAaRBYIxHIFBgg+XnbZBZw86AgxAnx7Ok2uz80P0ddZHo/a7UCl\r\nGwS3TIttC7z8ETIUHSt4jPkriqRyozBMIyzW4s8EBnNsEGJQf/Iu6wTKyIFN\r\nWL+2KLSWhySrT9cXvY7FcZe0CXqGxQa62N/c2gnscvX+u86IJBiO5UUR9cKW\r\nRBW35ED91mQyrY9qKxuLm8cKbhptBA+QrTrafnCteCkvd57WRX77fIPvHP35\r\nxQAeFwSze7OMAVwZvoobUAAE06L3idMGj7WPZp5CQptV2hfrSnuhpt3DeHSi\r\nF0P3ZvO9nzS1Rrf1ZBSFO284lt+3jFxDP1c=\r\n=cY4W\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"593f32d351d8703bd0422f65b3651e55f97fd31d","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.20.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.20.0","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.63d3a146e.0","@material/rtl":"15.0.0-canary.63d3a146e.0","@material/base":"15.0.0-canary.63d3a146e.0","@material/theme":"15.0.0-canary.63d3a146e.0","@material/ripple":"15.0.0-canary.63d3a146e.0","@material/animation":"15.0.0-canary.63d3a146e.0","@material/elevation":"15.0.0-canary.63d3a146e.0","@material/typography":"15.0.0-canary.63d3a146e.0","@material/feature-targeting":"15.0.0-canary.63d3a146e.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.63d3a146e.0_1657625844242_0.8060086473004608","host":"s3://npm-registry-packages"}},"15.0.0-canary.88db01990.0":{"name":"@material/slider","version":"15.0.0-canary.88db01990.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.88db01990.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"9531cd73b34e957eaadde1892155ab5c6de3064a","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.88db01990.0.tgz","fileCount":37,"integrity":"sha512-XYQf3DQ9ilEsfWI0bsfEdVj784CGONwKo9MI/ERL/iElVCaUvbOSy83kTNNpUmjARrY7yIQGI7tu0pPKEA1y4g==","signatures":[{"sig":"MEUCIQDFxPZNZfHgyFrIpztx9YMfSTu/hWGhzQP19+MHmxfllgIgYfE5QiOBLEVrykYhn9iqXbL5tI3Drfice1oFDI8LcFU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":901990,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJizV2ZACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpJYA/7Bcqb0gVTep3YDS/xNfiF9V9q3JK81JvJKN4ae6dfiNuFdftq\r\n2kePH+aAe5ZJE/IrnsTm5i2DdPKNtrwMu2KgfGl7oSHHVulbvwFfoXlRB8L/\r\nAWVMSsqkC3vYWCr3dAcVhGcNtk++BH7tKs7MUxEwC7q58oqbwsglY88qBcws\r\nypAr5oNi/047YqMEzoXLAf8zrPhJ0Lbl7+ITOteqiV6Trd4rHuQSDK4o6stn\r\nLGW/UTWrI+ZDpemZTCvHYtFxU1Bi2DPjN3dCxahfBsXIavHePmEYYbjsYmml\r\nLND7qy9siiXXLO3HndYBf/OfbtFd8kBX+QkmShIr1kj+CuxmcmlTxXflxj7v\r\nmtXF0rdLw2NbhICvRSf0Obzie1A8gYS70IzV+splhyJa4wwMirrZbwssz4mL\r\nukJ/7p+rW+BE3f6nfI07S1DdM3KsGMiKt50CzcPiScG/xj3hjFZ6teRp71RR\r\nNt+3jbeXBqUqinEmZRDd3Rtzlkjyufh1tjNrFxFZ7NLiIxH41osjEwf3X5BS\r\nFKYOX5hkdj5CqbojDgkEqhxOjXOoFulkHWJQySc8cE4ifC9A+hLLnvuMLAk4\r\nLDZsBii8Bn5ByAy2IFtoF5NvYizbMuz0zhwh2Y/hILpzawh88TbEFf6ZGsLR\r\nROxAxL+QMqGntlF+lkpQ9O4UDWhWK+o6J7E=\r\n=6iXP\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"a2570f15e2572775da6e1894e5310c107a703ea4","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.20.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.20.0","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.88db01990.0","@material/rtl":"15.0.0-canary.88db01990.0","@material/base":"15.0.0-canary.88db01990.0","@material/theme":"15.0.0-canary.88db01990.0","@material/ripple":"15.0.0-canary.88db01990.0","@material/animation":"15.0.0-canary.88db01990.0","@material/elevation":"15.0.0-canary.88db01990.0","@material/typography":"15.0.0-canary.88db01990.0","@material/feature-targeting":"15.0.0-canary.88db01990.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.88db01990.0_1657626008742_0.5366230101997083","host":"s3://npm-registry-packages"}},"15.0.0-canary.6432d8fd7.0":{"name":"@material/slider","version":"15.0.0-canary.6432d8fd7.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.6432d8fd7.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"98971e8bbf49ab73c15c64a3d06c1ff2c6480b85","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.6432d8fd7.0.tgz","fileCount":37,"integrity":"sha512-Fe25NGeY1k1wfkW794WrQETRBa0jztqJmUb8a2ZipUyV3aXzef0xEmkx///GOyLrgPWbFWks7DWLYhnygSzRPw==","signatures":[{"sig":"MEUCIFpg+qF8FoaL3C2jycyTrLK/rp/D5nA51/8ygt27+qg4AiEAgxcWh3OmMOWHG8pr4K5hdf3fRUYe+6gme3zbwnwPvJQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":901990,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiz8W+ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqO5hAAjeWZCzB7QnMJWyS1eO+JacaJzwvpWoGo6Vhl4zB9+lApM1km\r\nLo9Fgp0w0ywytlPqbDS28hj4OPjdiPQLPspJEgCltPshF9UdQLXDxkvkZR/6\r\nJvisnfAL4kPAcVswYpcuqv1H6SgI5rrFaWQ2ldSF6iRzBzxPOknUpmlrUXdB\r\nEGAtJZ+ZaOUcx7/PQDB23kRCHqYTw1jAgq2DCSt0B4aOAN0aeeYtrxmdaMHo\r\n/wYbQbWx+4gmyFqgFLrf8MzpKZ+DRwiqKKYES2kIBAMMlc2IQOUIoCMPK5/m\r\n8sB+sqQpg6taIijna+A/alZ1LRzkIaUtNGbD2aeWuA3lU7f4fWD9z3PMxEMB\r\n7vldiZy8xt45Jifl3Jn8lBcbP7Rb29nPayXWpJMfSdyMFF0vcy1VSf/b6QiR\r\n1JuR2A1cQCiEdlKGrKfnKmkgjzS4GU/1hVkSeWwacAUHhHLhTzIOmdCmprAt\r\nkoX0WEZNmyR9fpPcg2X/yP+GW1KZ3C9loncKkkVgWiwTObbADZSqqw4gBp6n\r\nhYj4WCcSW6HJdFBreS2UnrBG+TH0iaXJFNeXAk3WYdpozIJ/oVRVTeKTeIl9\r\nT41yEJNfr0VyuHAMFQVT3l3mnDKUrvKQYmJnkxH8yhR5EKAn5jYjJCOz5HhB\r\nAJRFIVbBGGEDhHpPRjaEJVJEigkQy2L1mfg=\r\n=W2GJ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"307aa53d6ea873bb978456b538f97f9922496798","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.20.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.20.0","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.6432d8fd7.0","@material/rtl":"15.0.0-canary.6432d8fd7.0","@material/base":"15.0.0-canary.6432d8fd7.0","@material/theme":"15.0.0-canary.6432d8fd7.0","@material/ripple":"15.0.0-canary.6432d8fd7.0","@material/animation":"15.0.0-canary.6432d8fd7.0","@material/elevation":"15.0.0-canary.6432d8fd7.0","@material/typography":"15.0.0-canary.6432d8fd7.0","@material/feature-targeting":"15.0.0-canary.6432d8fd7.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.6432d8fd7.0_1657783742378_0.8373372698310484","host":"s3://npm-registry-packages"}},"15.0.0-canary.085f9b25c.0":{"name":"@material/slider","version":"15.0.0-canary.085f9b25c.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.085f9b25c.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"5470278de7390171aa40a10124b7cd9d24efeabf","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.085f9b25c.0.tgz","fileCount":37,"integrity":"sha512-BKsnd5UaZ9+qT5QnC7wubdRA8iK38JihIcLCf3IhZrESQufonMQWis6PZrMSEcpYjJFUZIgK0OPeFDgfRX7I3A==","signatures":[{"sig":"MEQCIFf6W8zgcSMzZVZwq9Tyuq+edaSlQLGv0zxk/k9M8O3EAiBnt5ttTJHG7viDCiylrg+mMqxVG8ZRD0dZJ/3YBb52IQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":901990,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi0EW5ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq20A/+MQjXnmMoAeUdXfZ0GbeRTiDTO6MKhtJ3363s66aLVv2jVIWH\r\nEPiVJKisvc3j2bBPus30KKo7AVCy+21DhY8qiRL+kiIUXVSpYrY4MU1fk3MD\r\nwaH8UwczJgyt46CeybyVkNtcBCxf7BTdLiZeBCtyhI10cAiewyl3wPZnGfMX\r\nMwrI4Kfi6PQXwfFO43nJYq+JFB6T6eUztrzpT4caoM0WLzC6GglG9qM3E7SS\r\nuIqBkV1CN2TC54vp8pS2Z6hG8OIPfPEhNAesp6SEDr1jCsLZkBqF3GLyxAnG\r\nNNyBpktrNFv1AESsum2M+qOmgAVIYhLk2dqvMxNza4mpZceMM187bspI6NF1\r\nVx+4vFL4gqlQVcwqZ5Xwa3V2lBzdPm7ENNYyXx6nPysxuKji+EYB4uDJlJTN\r\n8EEwUF3taqrYBSsEj+ms0mcHxdEI/T7rRi7ND/vpPL+Y84JIYnbEuZGjepT4\r\nMf7+Nt3ZR5Zz7u5cTXIPEks8Ad71ByDDtJL2bdqnPk8zu+vbSaFao522z+AH\r\nwlqHCW+ry7Z2epVXp4HDQe/KZBvc/JclbX1Q9Q2XQ73QYO9fxTalPg7aY+Wc\r\nKg2p7U30V8XGF9zEt+qMPes8HvTHw/FR/u7fSNXjSEeC6DFNvxzhjIEB9nMZ\r\ncGPlKOcd7DvARtQRtnVvrB/wgpPVvAnhSI4=\r\n=6JhM\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"766a8d5f5fc7e4e022835f16c6ecdab8d2ccf071","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.20.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.20.0","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.085f9b25c.0","@material/rtl":"15.0.0-canary.085f9b25c.0","@material/base":"15.0.0-canary.085f9b25c.0","@material/theme":"15.0.0-canary.085f9b25c.0","@material/ripple":"15.0.0-canary.085f9b25c.0","@material/animation":"15.0.0-canary.085f9b25c.0","@material/elevation":"15.0.0-canary.085f9b25c.0","@material/typography":"15.0.0-canary.085f9b25c.0","@material/feature-targeting":"15.0.0-canary.085f9b25c.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.085f9b25c.0_1657816504785_0.4944471110671447","host":"s3://npm-registry-packages"}},"15.0.0-canary.39f9424b3.0":{"name":"@material/slider","version":"15.0.0-canary.39f9424b3.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.39f9424b3.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"9bf97429d6507ebdde17c07743c0f3a1a1c846ce","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.39f9424b3.0.tgz","fileCount":37,"integrity":"sha512-gYcC4ePmQDbcEHYKVo1LfgsYDwH9eL05GohTWjT5AQSMBxyyRRLZHo57oXjcbtLQDMrNv7GF15jehV07eAExSA==","signatures":[{"sig":"MEYCIQDJszl1t/B+ATi3YZR+afd5YB0cy+NM3nXKOWsgv3+JrgIhALCoczey61xA0CgVAF8Muv42J6AUchoYlypTwIksq59p","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":901990,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi0EzSACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrGDg//QJNh29IDhCa7S5LZwyCrXVQcP3guGWiD6TSUHCnq3EWaAUqa\r\nz/oTAp+eIq8cbUcfHMTnozQs9E6kbr4AqY8GIG8GgxDZDcHAYiNIsw0PVQmw\r\nQr6bS3JTFXRjNGr87TxXXe6eVWoM8X5TLQLypdjbJEFffrbnAyJ50nMb8qIG\r\nO4k7TViWwyWwji7IcXdZnnHSIxCJLs9hmmFFT9aozQ2ZnGsNnireOhfxXKdj\r\n9CAafs3vC8PpPM7BbPZje3ggjITrdiP+bGXDeoN19W7cnIYq9e7zcwfmh4hI\r\n01E6ipqYfp5HkTgXVSG9BpPJgAbXlSpy/Ofb15LloZ/jX9fcYOxwrD/8zSn3\r\nWJmGRDL1PiurikYlDpGErX5/wRWmPytzSRnMZh0hiRCBnQFvnSQ8Kb4iS9vv\r\n1HsjZt+VOsReB1+Zi+sMm/T0/pknAy57cgxxBFMdXKeflJjN9w0weohMhl4L\r\nq0JIgwzonMfI1BA5sU1sYkNVro4g+mTP3EfcTgrKMOTqABN8LXeEg65cEqms\r\nU70PHM+GcP1MRoPmfVmy8DAUyJ73z6y4Y8CcxciQRdJrwFqF+RgFDQCMATyI\r\nUpia6PJRpOKeqDen6cal2IzFFsQjmF3Ml7OSEeahyzlWjIm9hSg5S16Wztyv\r\nCu5y0CA3rdfk9Q1apEtxkoqKfWDG62CW3tU=\r\n=6myV\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"62e726843fd90c6139d8ade27db8da6ded6e1d77","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.20.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.20.0","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.39f9424b3.0","@material/rtl":"15.0.0-canary.39f9424b3.0","@material/base":"15.0.0-canary.39f9424b3.0","@material/theme":"15.0.0-canary.39f9424b3.0","@material/ripple":"15.0.0-canary.39f9424b3.0","@material/animation":"15.0.0-canary.39f9424b3.0","@material/elevation":"15.0.0-canary.39f9424b3.0","@material/typography":"15.0.0-canary.39f9424b3.0","@material/feature-targeting":"15.0.0-canary.39f9424b3.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.39f9424b3.0_1657818322116_0.2499505477194348","host":"s3://npm-registry-packages"}},"15.0.0-canary.ae9fce587.0":{"name":"@material/slider","version":"15.0.0-canary.ae9fce587.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.ae9fce587.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"bd7fbc92b707c0391df88ad7bf5e5bcb056c8c9d","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.ae9fce587.0.tgz","fileCount":37,"integrity":"sha512-YVuSNJgOqE3STHJC/EiF8PL35x1kKXt1AjFsfdewoU/SkIrXGf5MFIw4urPN9iYx99dVd6UXcKwnYFyr2dTpUA==","signatures":[{"sig":"MEUCIFHYRt+ViqXI/jMRZyrrk33bmrTNmyKk3IKdX7l+tXxUAiEAuCqaVNleirr2Lmi0YRkQuQwfRoUBohDFBi06tdSuZcM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":901990,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi0FuTACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmp7Fg/8DkWLcng7KIvgdLC+11oFGovDEU5LA3ltlu7rBacWNNpT0TWd\r\nVLNhcmgZ5jJ6BspwWwCA5BebAju2slQzy8puHpEtFFW9bKarhqQ6T4dYGtMI\r\nAcMhBzbaM1t1H5gMcL4qulzbgOmh7r04UxdwLa2l+2T02rdIXMAXLbnP2siV\r\niyD1QtMYfOcc/ePvRPjpDRoBZZHSHBAatg8wXgB+z05JgauNySTWJJrHsXuQ\r\n4tRmLZPMZyT1In+OLT0SyLAol/hU0EclyiBHmMCvBAPfkVixkg8Jf5ZKsK3J\r\n3Z0fGiTyAYKaeU6YRj3jjf2MMt+0CsB0E0JXHJ2nLMZuId6P5AXeJCVzs5H4\r\npdHeqHem82E3khKQELon2h6lCqKiT3anVIVrxLu8iP9Ykg9qc2YB1vdRDebn\r\ns5Jy+yn4QcJSLJr2XmQmft+n/hQI9cLal170IOfhUCPyjDwWMAF8C6jPsI3E\r\nzcxOBkbXAkA6LirzL+uQSebt/rG5XzAJVg0j6tSXEgz2gEQX+RKj+qICPfPh\r\n6CHG0Vhr0nk6f9raPbAN6tGhMbR+lqTUax3l6LOmZtVmaGoCUnDpFhStvoCO\r\nMOSU/6aEu6Q8hLgQ8uAxo1fbiBcpe3G/nXJ/dgHbC/bnBjWbU/S1OFxdzr63\r\nRC1r7xvLa9Tp33L6D63xolNDB2+32JXa7dw=\r\n=oJJq\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"2d55d2ded8f3ebf66d72baffd67452a8de349b3b","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.20.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.20.0","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.ae9fce587.0","@material/rtl":"15.0.0-canary.ae9fce587.0","@material/base":"15.0.0-canary.ae9fce587.0","@material/theme":"15.0.0-canary.ae9fce587.0","@material/ripple":"15.0.0-canary.ae9fce587.0","@material/animation":"15.0.0-canary.ae9fce587.0","@material/elevation":"15.0.0-canary.ae9fce587.0","@material/typography":"15.0.0-canary.ae9fce587.0","@material/feature-targeting":"15.0.0-canary.ae9fce587.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.ae9fce587.0_1657822099112_0.3394646245419859","host":"s3://npm-registry-packages"}},"15.0.0-canary.1ebddc343.0":{"name":"@material/slider","version":"15.0.0-canary.1ebddc343.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.1ebddc343.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"a7b4c6ee4fa62b7ceab9a5c2c97eec8a16c2081c","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.1ebddc343.0.tgz","fileCount":37,"integrity":"sha512-qB6XRU6NU74OWs1IzPBp4JodeNwhiGpyphkVpP1tR6gqqRndhPRYxrk6hltvHf8jybkfM+wn9WA349fMk53Q7w==","signatures":[{"sig":"MEQCIAUKFYeXY5MkYjxDtcnvWz53E2+txvicxu8vO1pEKPgPAiBwRcppD7/GtPbmiRiAlRAW2LacuHAHeMTzBAAGB9/cLA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":901990,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi0SoZACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpegRAAiu37ZgPwAV9jnwROPsDUZZnM7bloj6XQ4L+jdQFZUj+7nktO\r\ncyv3/ySaQ1QZ9GDlKwuwLWww02dyvtbvrx3/KPjVbsA0if63PZ389kwZWsUk\r\nOI7dEuINzBmdWwldimYFx09jcAmaVRk1j8i3HlaJhAupA96MAMo5n+B646G/\r\nUHStC1aCtx3PjJrQ4BCF61TGsVbPwl7RwZz7eL5sNhU8+kpd8RFP+AUOwQH1\r\n7vqSofdcRk05IyoT8Xqg+4bD3JY5b4ryPkS3Da0lW+dJ6FLAR7iAz98szEff\r\nQUhzmzb9AwAwukuKbrYRWqF/5RHsHPJBI0Cc+EwpVADckkV6VGQk6/eV3elN\r\nejhFhAIKKa4JMQfVaIrPhomc+8C/IV5LllTCWHbGYg+gN2wqFp1FXb6fBGDL\r\npKj9QtBApwPYfQ3/rS6Y+N5GDWJ5sYoo7XKK8ulUxaZ8p72Is1xldx8nzTbt\r\nN10UM+tnqdhd5Dxd47aV9WCP9EpqUkqBN9bCL1oNeBT0EjbG6nN6Bg48Z/gJ\r\nREvIPMA/WCyATNdvsUa9DHIAqWVX3+9iEIhEa+xLP2rApYiWGaiNIHvOTBww\r\nXoZp29mgBRZkG+pZozUWQWODP3Q9DHs3J4QmT2A1285RiukChX4LKZf5NQ1I\r\n8ZJZpYJJlDP8O03rMoas3BYChu2WQnlMIIg=\r\n=njB2\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"2ec31cdb5e8e1a849368a3f352b213919bec43df","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.20.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.20.0","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.1ebddc343.0","@material/rtl":"15.0.0-canary.1ebddc343.0","@material/base":"15.0.0-canary.1ebddc343.0","@material/theme":"15.0.0-canary.1ebddc343.0","@material/ripple":"15.0.0-canary.1ebddc343.0","@material/animation":"15.0.0-canary.1ebddc343.0","@material/elevation":"15.0.0-canary.1ebddc343.0","@material/typography":"15.0.0-canary.1ebddc343.0","@material/feature-targeting":"15.0.0-canary.1ebddc343.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.1ebddc343.0_1657874969571_0.8601344767767278","host":"s3://npm-registry-packages"}},"15.0.0-canary.c5018840c.0":{"name":"@material/slider","version":"15.0.0-canary.c5018840c.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.c5018840c.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"b39eb88f13345051699a002350a0bea1ea768e42","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.c5018840c.0.tgz","fileCount":37,"integrity":"sha512-nLSz1kAOjqo6yUd1kFTksr2WAxM6p84fA4j4xr4JoyFlhBIYVmc9NHlpLJvDMmBWhhZ8gkgKSHhvjBYGhHWyBw==","signatures":[{"sig":"MEUCIDvVhDiewHOOaZTf5oMXM3cum1IPotbDjUS+ALx4frawAiEA0BWipCeyyznGf/vquqcRjD62SWQWIW0TQZ8y3nZmquA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":901990,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi1Ss3ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmqr3A/+Jyn8afqHa1fouZklUcRUVl0LznBdhQHwPmG4fRbmSmMcATqB\r\n9Tx+P075w2kZpykYTgK3qnE8uE5rdsZ2E1mDERnBC6ZGlUbabTUeWzFK1oYL\r\ndeZkil5P07DrfSU4aBAxmIC/Jqj0liqmdKUSN4jzxbIakAUisZngefjmm+Fp\r\nxHmmLWdIwRJmDRhvvT0Mf5G7zoOWqdieQLNgI46mhGlAh+Xp6yCU1P7nnjbx\r\n/Tiwh/w/6tXUOhpR9Ejo27Ci7Nri0O7wPP/98kICaop+NN3X1/hr2uTaFXET\r\nAqmL1rRwzlc7ckumGRLkAw2GY+27XCPdiJ0sVcrVobscDPmQCTQFdOpwoZwE\r\nxpi+F5iKNtkYU5quJkYVAKqPG0etd9J7epWNt2R9wEW/+pmsGSrJCLIFlszX\r\nqgCw2PUX/57q08+sciFf1HTwGuWUCCXolqGE//rPdGpYfKUTGss3uqTcdHBq\r\n6Ryq9IDsbCC4NSZAAO+9phjLdrDpGrBIsafNNiS6nRT56L/RK/+sBBxEEKuy\r\nWvdVZSak3BbvrToIsRsC6jd4+nMvbPxC/+fN0vbONQ13PqSWIdoszr86rQue\r\n3UHDr/9kE6QWWZ7F+nlGaO5vbJv7DkDssC9JYya4e3rEcuZULF6ZIyJhvbh/\r\nTAZ19yIi4qDfhLImcA9t4IWDYFQZqwydaGQ=\r\n=to49\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"c86de383c50b7d72b8c5cf908c5fdf3e6efa94c4","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.20.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.20.0","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.c5018840c.0","@material/rtl":"15.0.0-canary.c5018840c.0","@material/base":"15.0.0-canary.c5018840c.0","@material/theme":"15.0.0-canary.c5018840c.0","@material/ripple":"15.0.0-canary.c5018840c.0","@material/animation":"15.0.0-canary.c5018840c.0","@material/elevation":"15.0.0-canary.c5018840c.0","@material/typography":"15.0.0-canary.c5018840c.0","@material/feature-targeting":"15.0.0-canary.c5018840c.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.c5018840c.0_1658137398776_0.9091329388541181","host":"s3://npm-registry-packages"}},"15.0.0-canary.551b40d18.0":{"name":"@material/slider","version":"15.0.0-canary.551b40d18.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.551b40d18.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"144b6be7c41e8667fb06ed3f56472299afa2c31b","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.551b40d18.0.tgz","fileCount":37,"integrity":"sha512-0U7b7zwUSjQEbF6flA8SVXFKL1RCzMzNtBJyKW8RO20y9qw5A2LMyo8yj26i4jJxUgQZIpSwgPapnSowAffEAA==","signatures":[{"sig":"MEQCIAZ2rySXJHT561NHcTdYyiLAf8wkjDtJPgLjBsCoqxqRAiBHEQWlD3YJG5nQy12b9//gXQo2UjE8D0KzSf/EJUQUiQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":901990,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi1S9oACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrcVg//WVJ0JPEfnr4nb/ZwceZSl6CiNnqt0n8IU3Qy3Mvl4D5RgmKv\r\nj+gWMRLaUnzUoR4rv4TQ8hb4TnkSaVd11fhbV/tDFPvVgtT3tZihW249lFFv\r\nQDBg+ft1UL/i7YduFgcKEMXNAtQnmmFpeUvAIaUZexb6n/wfgN1ewqhu+Bak\r\n6IHnYDC8+zJhEaokTF1urf/VB6PeU7rSYK8GpWukdsZKB/JndMhgvnCwRvI1\r\nQxFhY1pVlAAtrlAywm/S2d+BP6l09UAibG2ANalXg6l7PawyvQJ6OI7Qbvgb\r\nIQbuzoyzSw24EkpE5EaOuiVXk2BSUPVYUWHym5feDw9fVVHsuXHOvHFT4ySL\r\nVCkKoTcNs63SMIwW6wQIYz2SCvxBKgxQeQBbt7aNwWn+21VYmI49p7IxiS5g\r\nmTWzNYdP2HbMkpUuqPSRbrZ/6nFnl6ZAf5CHUSg/a0DoFI8vk6ScCFR03m/q\r\nemTKJ/WCgOf62d7VnUdHq3jF1LYcG7WGZCZlj2RfJykf/EnXJyCqre8/YRYN\r\nBdNuv8oeRHlURrJUobC8zthmCbfSANoU/g8VamNklOdJZLD20bWjBS8EZKaq\r\noPPZHIX8TQW+NHOHJ2lVIaKLYY5TaNKeLv4DxWX/52G9xS5xt/E49OPnd9m3\r\nRtDTGzMyY5suzWb9tgfW5Z5PeQuZ97JdtRk=\r\n=T7df\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"3e9aa3499438031c9229cf2a18a1a3672620853c","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.20.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.20.0","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.551b40d18.0","@material/rtl":"15.0.0-canary.551b40d18.0","@material/base":"15.0.0-canary.551b40d18.0","@material/theme":"15.0.0-canary.551b40d18.0","@material/ripple":"15.0.0-canary.551b40d18.0","@material/animation":"15.0.0-canary.551b40d18.0","@material/elevation":"15.0.0-canary.551b40d18.0","@material/typography":"15.0.0-canary.551b40d18.0","@material/feature-targeting":"15.0.0-canary.551b40d18.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.551b40d18.0_1658138471914_0.9978560348591357","host":"s3://npm-registry-packages"}},"15.0.0-canary.cf9f12371.0":{"name":"@material/slider","version":"15.0.0-canary.cf9f12371.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.cf9f12371.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"bb56134ec2d37054b1758ce7c9e8c22b4a215718","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.cf9f12371.0.tgz","fileCount":37,"integrity":"sha512-Rt3MNCmqU9MBcrr/xjO2Z5XRQN+vNBfttCpQ6yMC7NF9BhKHmpcvUDrfZ7wokE+FmSj7t+hqxkGmDUL30rGLXA==","signatures":[{"sig":"MEQCIGbiSfKKk9h+VGjE1hGJDUtnXjIes/VJGo68NygezTa5AiANg8Cdkzt3oNIVUBZF+DIEsL0Iqi/tL4X+36fipWQJ2A==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":901990,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi1TBZACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq2eBAAgVJ/OK7cDnG6ks5RII52kwilLTgGUFyHRtSBYTIOK8+F4Lfy\r\ncu+wDAm9c0g/5vSQJiBgtECfhqqfaXBYoTIELtwDTOu2GE9Yq1P4UF2/D+RT\r\n8a++KB4sKuUR6Y5aBVuwFAlMR2tfMove0uRTS6HttonoCR2QICy4wh4FfzCC\r\nFh3rVMJOnpQc9Ifc5AZywExx2nansOy6sXj39r1ATo/RiO51mqscGZJkrJib\r\nE42ZjOEJ6P3WGBEvHHVMVxfYyP9GGpkXEWN180zFOwwV4wcBqOi+ckT2gDJ5\r\nQGFA8OxZrWtJl69XETJWol66rsNIh0/+2ZtJXfL2gflVwlM6OSi1PvU/uhOT\r\nGrJr41h0MqaCQSesjxT4tuSGSfVX3CIc9Ay3JeDY8Xj8dCDeXsDIqhg1mLjp\r\nG+3m+E+5jhVuAVaZ7Texm5/4O9HUq0NIpeLYVCvZJeMI9HCIQlZIvI9PSszj\r\n6Czy232PYV/xcDIPBoFgzxbs/ESz/iHbtAQaQNQ9c6KPRZUchEjPjpGgo4XV\r\nCPNy5SX2QJgj3vrzPd7zABFvoNVFTuI2kzjHygO9Q6WYva3ERHEZZ8bBPdkr\r\nLUMWjki1UzNTIN3ueF2pc8s3mq8DOWl2MAbYz/Hxq2r1h31xCC66zJk55hTl\r\n4N9khY513vf98Lpmo4DtNVGRvbgQQKqD9P8=\r\n=kBkj\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"1817e344a80081e042f37248beeeb96228402878","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.20.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.20.0","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.cf9f12371.0","@material/rtl":"15.0.0-canary.cf9f12371.0","@material/base":"15.0.0-canary.cf9f12371.0","@material/theme":"15.0.0-canary.cf9f12371.0","@material/ripple":"15.0.0-canary.cf9f12371.0","@material/animation":"15.0.0-canary.cf9f12371.0","@material/elevation":"15.0.0-canary.cf9f12371.0","@material/typography":"15.0.0-canary.cf9f12371.0","@material/feature-targeting":"15.0.0-canary.cf9f12371.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.cf9f12371.0_1658138713627_0.533286386959722","host":"s3://npm-registry-packages"}},"15.0.0-canary.2797ff8b6.0":{"name":"@material/slider","version":"15.0.0-canary.2797ff8b6.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.2797ff8b6.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"c169340ce8a826420d751c8c5beda7d65f5f03ac","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.2797ff8b6.0.tgz","fileCount":37,"integrity":"sha512-n1BRAnC3viiKmTgJfSTWVsvKWWVAfJBsjh2BZYnoLAfyRtwn0Mf1bqcqHovJhgRtyO0zF1kizOaKys0NM8n0Tw==","signatures":[{"sig":"MEUCIGYJt0jWv1u0k0G2q5SPd/3lwIKv3TP6CnkNkaHWqG+iAiEAigJGRWqAYzpbF/72x43+OVCHEBEMwaqZUE+Xhav28ZQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":901990,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi1fmyACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmoa8g//bVAA8eTrqLnzd92EIPpS7UyIorQj16jkyjuyJ2B/9Uy42s9m\r\ny5cTH+hrVienG4B/KCG9h3JvVY86MMdjEH21lJi3rafPKE4508u631j0kmVg\r\nSbhUpu3t/WRujM6avVGMmeUHplqTM3HBdF6iIh8p6CyWuArgfstLfDY1alIG\r\nbUCevP4LP0nd7CKa7Cdp6cwoCLwZouh70C+yGKyr9ASpfgEXVbLyGLwpUib0\r\n+23jDFQvRo5Eee80iaob5/sIq2ukbAUaNEyYnxmVkNOajfr9nvIj09dib7WK\r\nA5VIvNkOFSJSAnpXD0ImXKihU8XH0lDgSW55GS2skrClGxNaDoSmyzfKHmY2\r\nOEVHiCo6gXa0q/9d9ONYbnRo/nU12ij0bbAMMbbcosGMBMCb+ENganAavL2w\r\naeUwtK9ethOIUnZ4f6mSPhjIC5UwGnczNmzpj9YOPmDK6s5/O3m9tM60bo0W\r\ncpsSAw/JcbX3m3aFTh0O+u8/BNla4tvXmm5AY8UR1+C5+UTRw9IM/Ze5miq8\r\nPYELi0t07ZoXl429/ebdL1c4KvLo4OXklHtW3TdU0ETmShK+P8xgaOOrL3/u\r\nvFU8T+lPA2axyhq2w8zc8j/1rt+vi5kbkHdIL1l9mFGz/KnjbTeF6oUAJvku\r\ngXFPkZN6jNFNo+y8OEYjTFe1sKK4t90Crxc=\r\n=USxn\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"2c89951e5e0cfca0b1dc61a4f30259b33cee139b","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.20.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.20.0","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.2797ff8b6.0","@material/rtl":"15.0.0-canary.2797ff8b6.0","@material/base":"15.0.0-canary.2797ff8b6.0","@material/theme":"15.0.0-canary.2797ff8b6.0","@material/ripple":"15.0.0-canary.2797ff8b6.0","@material/animation":"15.0.0-canary.2797ff8b6.0","@material/elevation":"15.0.0-canary.2797ff8b6.0","@material/typography":"15.0.0-canary.2797ff8b6.0","@material/feature-targeting":"15.0.0-canary.2797ff8b6.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.2797ff8b6.0_1658190258443_0.23054337147764214","host":"s3://npm-registry-packages"}},"15.0.0-canary.110fafa17.0":{"name":"@material/slider","version":"15.0.0-canary.110fafa17.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.110fafa17.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"7698b77e572367f7dc5e567086d55b46630abf21","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.110fafa17.0.tgz","fileCount":37,"integrity":"sha512-0H1hStJkz8iBu1d6loGEbOnzuX51qphGsJCBg7PJKX+j71tytQVuAr4L69rRSKss8WS+RgjFHQkFMfJ3we+H4Q==","signatures":[{"sig":"MEYCIQCPdiVtxTNsic42sufuuCuF4qZKLJGMr6gBU1Exp21OEQIhALLx0WEG/CVciQH9ZIs8q6W6DZh87bHWzwXe+mb/oFE/","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":901990,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi17LqACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqScxAAgPyq3e8aYlXTfJlw5oabJlAy36JXHKX5tvPPlVoxsaZ1L0+U\r\nRMPMACGp8liT8hccrDy80p3W+e8hfbLhpg3LwWe2oN6V2FVmaHYUAumtBtDN\r\nAJg5SJD88ISADClVAKuYRL4dcWcg3sPioMMpAv7EWyUhPVHKaqHNvdSajJmc\r\nqi3/ZpRw2PHQNFUfanJ3Z/7baGoS8OM6PwpnYV3z2Z1HmYKkMP4wMM3JNZzZ\r\neMJ5+dzRrF4TrKbULLUPamLdU1xVZr0c2g9bjZuGFZdceHeVxlHHg9bvoYS4\r\nuxFjYDtsqffPo5SU8r2e0sqg7pn9mL0gpOhO+R6aXTt7Nh1NwIwvbfzcvbSV\r\nnEDQ42PPtWA/HmAadgRHfrUbMezCusQyFLUoxncnMCNs5bKacvhhSoDtv8KT\r\nEpMFi+Qgr+iuI72SM8T23ntH5BjssWI2VNTOY0DY6PuQw52EgBBXOPwkhwS+\r\nalsCvS5zBGJZe8zYNH29dbcGgKZyX+KNRLbfmje9aJWVdUvt0OYv6qktLjsW\r\n7rHU5blWcHHTG0+JkR+twHCIW4eqNiES8yhSVdd5XBGKFn94uYdUxU5ZlM2P\r\nFat57EHJvS4/NB5FnYA5SJ7d7iNrvaFDNunSwlzNzMx42V76VDmIWlYXXydf\r\ntWUAAUxw12ETTp/yIrVXZC6+UQjFrSwemIA=\r\n=496Q\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"ccf0ed3e8eaadf1526fd10979e8c00e79b228f5f","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.20.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.20.0","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.110fafa17.0","@material/rtl":"15.0.0-canary.110fafa17.0","@material/base":"15.0.0-canary.110fafa17.0","@material/theme":"15.0.0-canary.110fafa17.0","@material/ripple":"15.0.0-canary.110fafa17.0","@material/animation":"15.0.0-canary.110fafa17.0","@material/elevation":"15.0.0-canary.110fafa17.0","@material/typography":"15.0.0-canary.110fafa17.0","@material/feature-targeting":"15.0.0-canary.110fafa17.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.110fafa17.0_1658303210133_0.2789812887535066","host":"s3://npm-registry-packages"}},"15.0.0-canary.386ef1d2f.0":{"name":"@material/slider","version":"15.0.0-canary.386ef1d2f.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.386ef1d2f.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"07c0677f66804df36a116dfe5db5bb44589e88ea","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.386ef1d2f.0.tgz","fileCount":37,"integrity":"sha512-JTVrDxOxnvMqup5DQskrEtjLs5uOtk9Y/lYyhOs1y+0woOxtYHUvbeI+vBx5LxTlVdpr/NRMCyI6lnzXBXqsRQ==","signatures":[{"sig":"MEQCIF7kknzDnmvYMaIfaP3SR/XI+oEbMoQjZ11SEF9ePlo8AiA9pFCPolZUBbbwKcayoOBUhuFO0SNXidlKR/gqT6NY+Q==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":901990,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi2EdMACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr6JQ/9F8tzxnZR4CV2ev5STp9ymJbD54WPrg1qe42eTPc4v2bX7M+P\r\n99kjiswqKgrCYZEjdHXZfVn+OnofrrHIUwrArB9Qq1cWVIn5cV2j39GRIk54\r\n+OjKXMN0uIbdFuxf3KtnDQ5wPSI832y68Tji76xvJAVmMHgy8+h6EdWI4Y9L\r\nUrwErSgU0spNQL+x8M+nQIPDnOEmCzviIxjmFJeRf7WlD2SDaFmWK1jtnMWQ\r\nl5MssgXa4B/4Q41eR2vvgKGkn/UoA2yri8xft4ksfw/0Kn6SVTEktY01delh\r\n667jHoKmJw9SzNUJNmcA3mOF0I9mv/2x9QTOAsxWnKoTXeuFFR/FPrENl4TY\r\nuzPCjBCACWCNwynwK6AIbwZtPj8Y16BjxY2vCi5JoWWVtvs2HYdfDxUdbX2n\r\n7M3U3CpQnBKaxyhcdPhK1lmxsLMPZnZyjQs+ig2rsOEDxL0CrrvTKhgvsxEc\r\nRmQxUGBpuHwWHEHICJxoQUHBWAr2JMAe2FxqR+/NYcgpCIsM5POQM6WhALct\r\nhSW01bZ0GVKy5HoN++8nPEKe7i0nVGz+NLpDefW+ENeXHoEGoWIlFcS6mYs+\r\naHGWP8e5/0XJCUW10d4WMGArDTjWvr53gfX/rZzFKOKz5PaLNPbDEKifLUHM\r\nnIr2smjWgM3dyn5IRBsCSvjNQ6yl7IUYsIs=\r\n=c1c+\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"f81dc27b99348c90268023c46429639f145ca534","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.20.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.20.0","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.386ef1d2f.0","@material/rtl":"15.0.0-canary.386ef1d2f.0","@material/base":"15.0.0-canary.386ef1d2f.0","@material/theme":"15.0.0-canary.386ef1d2f.0","@material/ripple":"15.0.0-canary.386ef1d2f.0","@material/animation":"15.0.0-canary.386ef1d2f.0","@material/elevation":"15.0.0-canary.386ef1d2f.0","@material/typography":"15.0.0-canary.386ef1d2f.0","@material/feature-targeting":"15.0.0-canary.386ef1d2f.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.386ef1d2f.0_1658341195772_0.07969505609067884","host":"s3://npm-registry-packages"}},"15.0.0-canary.c3924efef.0":{"name":"@material/slider","version":"15.0.0-canary.c3924efef.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.c3924efef.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"cc10eedeffc34ec0fae0fdb3fa3c4773745cfa0a","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.c3924efef.0.tgz","fileCount":37,"integrity":"sha512-L4RXby8vV0ihtCm9qm9ppLK44Spj1L9a+KhEYHHc7odgbM/OqJb7xbwSvAi6kt2kUO+Z5Osn1df27Edii++wbA==","signatures":[{"sig":"MEQCIBFnOWBLYjTpX6ee/HZMtEbfpwjGDO5IeBg9GJbNeOA+AiBe9MQFJ+3yQmFOyNbJnae1iP2nBnb5+HgUkKECaGnOQg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":901990,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi2EmWACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrGCg//fBloXIZtR7kQOtbnleDkWhcVLR87embfrALqP+n0T/CBXA4J\r\npTWSUJ+EuzvS9GlCpRZP5nEaxSOoPlZXByoHaCyzx7rY5s5ub04biVNaYo/F\r\nyZ3JqxN6ASq/TkgG72gAUPOqh2epm7fXqglEdA4C+JhmFoXzfa9PLwwUGwNK\r\nUvAQuCH4wtDOM8lhXIyJnwRPjSTZfnIdkAlgQA4bEEbRcJNc+8HBxAZiRezF\r\nO62a2f9uyvyqVsJFnm6qlyFNsivfGLnSQgpu2kzUI7WcHa8D7/4bpSoldoCZ\r\nP2u5DGtSTzAVxTCeu7wx26drNFT1fMIEipu06ZsdpOyOtYngGnKOawfPUPDZ\r\ntW+O5/1AdUw6Ua00ovViYu6fBRsdL4tHG8CGwNoclPCtPkEQ+kDeOscPnvcv\r\nq7px5kaRSe15b6IZl4T20UK5QHPB8uzeeaXnsYzbefsbJzmWZjWcWVOvKS8w\r\nVx1vsD5KJS0STDuTPY1cZuWhKa+dJn6le2coveNSUfswP+6+JSuF+6BXHbCX\r\nbzslPzxABWcOA3yrScgOh6YuP5fCl2lPfwfw0A0sSMY1NCXVZRaDYCDqZhD6\r\nr/3dJBNm7QQ92h/sXHnzCvgvi5O9/fog2hDA9QhS5SjgAV9FgnNfD2Dg38OP\r\nByhxYT6eukpm/1dWxAjS4gjUwCKxVJ6CbYU=\r\n=mTz5\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"f665d9454e06d217296aa1a2064c9c67d3fe2759","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.20.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.20.0","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.c3924efef.0","@material/rtl":"15.0.0-canary.c3924efef.0","@material/base":"15.0.0-canary.c3924efef.0","@material/theme":"15.0.0-canary.c3924efef.0","@material/ripple":"15.0.0-canary.c3924efef.0","@material/animation":"15.0.0-canary.c3924efef.0","@material/elevation":"15.0.0-canary.c3924efef.0","@material/typography":"15.0.0-canary.c3924efef.0","@material/feature-targeting":"15.0.0-canary.c3924efef.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.c3924efef.0_1658341782575_0.31617739675490486","host":"s3://npm-registry-packages"}},"15.0.0-canary.cf5c5907c.0":{"name":"@material/slider","version":"15.0.0-canary.cf5c5907c.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.cf5c5907c.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"e9ebbc283e214ed8e72197a1c58c34eeb0b3d439","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.cf5c5907c.0.tgz","fileCount":37,"integrity":"sha512-TVooPzalbAqVE5qogKJ119FSVfQ8NoXMVrBksQqV6wL/xSvtJ5gPUx6/cbE/nrvxL+BovxmxCOyO7/qe6A946g==","signatures":[{"sig":"MEUCIQCDONM82Z1IZTA1UP4h772nEtnRAOGf/b0pX1Pnlqg0CAIgEi/TAA9o3mlg+6yXDycXuYJJIagKlcLiT7D4DFDN6PY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":901990,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi2HH4ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpUyg//TrzQCB58gLFxAfgmg3QnLPKcg6Ty+TS65NvHZoC/WLGqoA92\r\nfPNvgd2M8VS8YMx5qwnHCnO9pQiWtINl44M35qDc97xpttfF01X8VtFCLz1o\r\nBDK7dZnyHThuNXTPKRXx67ikv0mfvM1+iv5rEktlTIrcuyU0vE4rWHqxe9RE\r\nO25vrHYUcb1m4mQ/vgm/8VpaiLcROXJOhWiOa6/uZm/WUCKY5tx4otbk07lO\r\nRYMXZzIQuV/1/N05XwsLhjR97dM/LsZ7pOcKChEjOISp3XhifZbP0pjeNURB\r\nuqRdqDernptM68FXvs91i0v2LGZb41mROJ81LM3Wb66lzwXjspljpGpm7otp\r\nc65AkScDdXFAG5aokRSZ/bGN1XLmFXoWGST6pQHFYpLrLmbqSFAaUjfCnA5B\r\n+BF7QIZEMT4Tr1kPBdxMGxciSUrCPYsr2yYNrQRPQk+8+xTGnXLA7GKN98WA\r\nmIMmMQJJHsVih88vCtWRMjAewmFNCTjf2AA9CB07rDiuXobw6UuI0hGdkdMF\r\nCWcjGdsW3wHqE/z5y7l/Qu6lpu0B1DiTAuV24AwwGDsmshAi8V7pS+1KbqLj\r\nnXk8uA4BLMPV8kqXjI5/rIQp/JAssn8UrMCTHNKJwLO4H9f3uGVQtQKNy4UK\r\npHj8qIuWUS3beasXv3CfCOlcOiqOW2+ojcs=\r\n=xRk5\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"ff18947542e40ce8532c2ad78551ff4e74f9d647","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.20.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.20.0","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.cf5c5907c.0","@material/rtl":"15.0.0-canary.cf5c5907c.0","@material/base":"15.0.0-canary.cf5c5907c.0","@material/theme":"15.0.0-canary.cf5c5907c.0","@material/ripple":"15.0.0-canary.cf5c5907c.0","@material/animation":"15.0.0-canary.cf5c5907c.0","@material/elevation":"15.0.0-canary.cf5c5907c.0","@material/typography":"15.0.0-canary.cf5c5907c.0","@material/feature-targeting":"15.0.0-canary.cf5c5907c.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.cf5c5907c.0_1658352120676_0.44884536694239174","host":"s3://npm-registry-packages"}},"15.0.0-canary.0617e2319.0":{"name":"@material/slider","version":"15.0.0-canary.0617e2319.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.0617e2319.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"b66b63365c77b61c5666d2e556b8b8723739528b","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.0617e2319.0.tgz","fileCount":37,"integrity":"sha512-ATGTrjfhCL6Kl0N7/3zZyXHJMmCkuleaVLHYnRDuLU2pHdcQ+a08YkxTGhdLFxouX88f7ihUsfNHgPWopn+z9Q==","signatures":[{"sig":"MEUCIQD8fgdWcLyaGvXUiwPuKoeKwlkJGCsOGNpZKlOg6Y/i8gIgS2SaHy0mjom0JXJ3WZgn3N6Avh05gnufRmK7q6/KI3w=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":901990,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi2HZAACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqhCg//Uh67FCcvMwXU8A+4OIJFDxQRIFnztRBJq1uBixPehTsm+a68\r\npneDyq5I0pLA0Pm59LMhAo3vw6LOaqUZPkCVG9cdeMVsm9ReFMkMeETUEP4p\r\n5LCJGPZN+srzPkDu5EYsfQafouMboSiz+WjW9utVSF8v5c+AXSUbml6/9jSR\r\n5BhW9nygrKhWDYUOMZlK46Pb4TZQXnhLF3gm/BH/QAB0/NpUq8C4kNgpMALm\r\nU9AbhsyYjEiRDcOXpK4dc0s72883G8YqTJTpUPNPXWWcbu9qt1zRVHUfYtnm\r\nH5U1nvvGdArsGfkkTt5NWKaUo02UP/DBdIFg4T5YXd5yQYzI+EqRpKofesNp\r\nAfxSM/j/Uj4J+QFfhzO4Ai/keLa8iMJxj3wX3+vVmHugOqId6iPJVUjjbEAO\r\nngMWPOoUxzcRLvwYccvtWwyrwwV+TP7nJk66bBcMJw5x4aDfcKSowPSCyAIy\r\n+gU+2lx9GIKdks3svskrLL7Vvw2jlGOruD8YvfPRSWWY3iexUHg2Icf6+txa\r\nhPRabV0GFZaPpuKzbS2sZkj8+QHNn9HGeRPtO9G0JQcpFM777lHDnAPAsY+Q\r\nuMug7vfERcUgZiaUCAChKYzslTjSgv8YbM1W9OHSYAa9+6C7dPcRWXzL+KPM\r\nV5qwzIL3Ya6HO+YL4HE2InRgVcA05IY5Ryo=\r\n=46Xq\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"a4d6efed0d00cc69adede24744dc368da0b2c897","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.20.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.20.0","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.0617e2319.0","@material/rtl":"15.0.0-canary.0617e2319.0","@material/base":"15.0.0-canary.0617e2319.0","@material/theme":"15.0.0-canary.0617e2319.0","@material/ripple":"15.0.0-canary.0617e2319.0","@material/animation":"15.0.0-canary.0617e2319.0","@material/elevation":"15.0.0-canary.0617e2319.0","@material/typography":"15.0.0-canary.0617e2319.0","@material/feature-targeting":"15.0.0-canary.0617e2319.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.0617e2319.0_1658353216360_0.4428347456985293","host":"s3://npm-registry-packages"}},"15.0.0-canary.a743b7967.0":{"name":"@material/slider","version":"15.0.0-canary.a743b7967.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.a743b7967.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"fe3cfc4f67b996521628ce85a17b1aba3cfcef59","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.a743b7967.0.tgz","fileCount":37,"integrity":"sha512-2VZrH2LNuNZ/2vsNgj4flL6Y6nB9JT/yJqHsHM2CRY+MboMgHc3iNLPxseK742FvkfGxmgfk1pzZHCswdqG2OA==","signatures":[{"sig":"MEUCIDk6rScB3cq9xJdNKPvmc+9ep765YJQm9J1TH8hAWKQ4AiEAmncevuspH2vGplUO/uQf4FL+P5FEVrwiIb1PUBJ9kDc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":901990,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi2Ho+ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqFXhAAjo+MbkQKxEcMj/ayko+EtyZX4uz24cPMX2YnaKh6CSEwaVgk\r\nkjuvaHzfoNXi9/sUKHsCWM8woxTsqGQx35KvaE4vTAWrq6x880A319N0llrC\r\nXZKBBHAYVB2ncqk0fSsLQ33ReRpkCFuZXMo3Fgr3a1FzgPgWBXcgdggkdDib\r\n/UabKi/CuWET7NzHsNgHd9WtNk/B20v4P4pLK8CCxSN7vhUiAJFTgKzoKHUn\r\nnU0fLXGyobjGOaf3oHRhRpS/y1ww+6vO8iF59kORXQ+0J1jhQfmaq1YIk+QW\r\nICOw31RaVbHBxjhGvoSUREFKdhUrftBX/N04ZqXhYtKA75T7dsxucc9UYejV\r\nmASWnb+ru/glAPCtbul4mf8+coBHqEorER1cc4+gm3Cvntwk3WQjxSN3WMlK\r\n3/hvJO1Knzernj83XsEb/gfd/glk5NER0HazXiTuZbdRB7SyyzeEz7lM6br7\r\nETUHNqcJS7tqeeTJBhuEvIc/at26SOLa+PWOMOlDadjPqJFqiY331DQBxFh6\r\nwQGl6bRhnx2D7PFWCt9UVgOl1KGMmsRU3npAoiN4z0UprR8yExNPnboWJB0G\r\n6nTsPPdDG/5joJ0UFoRMdurXNccGdU/OjRSYM0UjXPNdf60yIIisCVkEJSWF\r\nszd9Rtk0g+GQrkI//EduDlENiKIqliuUb90=\r\n=/4+1\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"6fe7cdad71b01dac35a3d815662020bebbe50e23","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.20.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.20.0","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.a743b7967.0","@material/rtl":"15.0.0-canary.a743b7967.0","@material/base":"15.0.0-canary.a743b7967.0","@material/theme":"15.0.0-canary.a743b7967.0","@material/ripple":"15.0.0-canary.a743b7967.0","@material/animation":"15.0.0-canary.a743b7967.0","@material/elevation":"15.0.0-canary.a743b7967.0","@material/typography":"15.0.0-canary.a743b7967.0","@material/feature-targeting":"15.0.0-canary.a743b7967.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.a743b7967.0_1658354238456_0.651248781728675","host":"s3://npm-registry-packages"}},"15.0.0-canary.69fd619d0.0":{"name":"@material/slider","version":"15.0.0-canary.69fd619d0.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.69fd619d0.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"58fa0f805b4c3b2811df087fa0d35644fcb15f11","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.69fd619d0.0.tgz","fileCount":37,"integrity":"sha512-8HE1ZUD5Y7AnfFfLhwSxIzKpA/M4w/QCVD0+fgPE6UsDvMVUD+06DPKKYxsIGV5gzI0Dw2PcFSH1ELC5MAvdng==","signatures":[{"sig":"MEQCIDFPEEoSlAKxOT+V8Amq07RhHwraLB+N/V8CzsGl0T9bAiA38ce/Zm3z8nYiyh3cTLWRGGkd9JGLd5jAFUEaPySdrw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":901990,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi2H0VACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmofaQ//bgLR1Pkc0cuBKM3NOV2N8ypwLypOvJmNV0t7Da+OkMY+Ug9f\r\nhQUnN4tgQz48q3t2fDBPsOLm//k7HeAt6Paw9ifmcmSFOWTKCvaIIOOrOeXz\r\nGNwgnJGHQ6D0KMQHpg2UOXUiVBzJpCXfILBxt4YH6BUVPnKdp7YyM5J78jmN\r\n0H6PNrihcSZTm44fPzMUvfiPIhAcbZdfe4iKPwBWGLV68Wg8M5P2WmDu6cAv\r\n/z/RMC/Yz7UmoCEWMvMQ2r1byhIprTRV5H8j7ssW3eh2L49JDB8L3Z7c5/9r\r\nurZh7kMgUvTrHQkWr0h51QDzGXtOYmJyqHyc5Fqv5OmlBryHgU8n1SOBFINW\r\nUci/H5TWaVcmzoIXrv2FwuljxH/mcYpurzxcgYICpZy9/C6rVKcnxgvFvgPT\r\n0YHQDQ69Kq9UpPQC0KRUswp120bc8YOf3uyERACIjTbKnNyjkX3gaM61prWl\r\nYaGsOUgn7e2YZR00r1UPCzqA+9DSwIn7KssNqq5U8/7PlYxPw1d3sFockMnA\r\n/QBtxYETqMi1pgOB8J5e8ToSkoG5d6Woh8cQCY96T+2H4+Jz/ERyqyLPorUk\r\nup1m2K4PhvT6vpdSrLz05bSyM4Mp5Cw+Xc1jkrhVfmB9Tv8MuGbgW0MDxbvF\r\nGo/tT6KvvivG5aZMsF8AtxJaLp7pn28igOY=\r\n=JjyI\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"8982644a21769a71fcdbd9d8a35d87f00bf73b3c","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.20.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.20.0","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.69fd619d0.0","@material/rtl":"15.0.0-canary.69fd619d0.0","@material/base":"15.0.0-canary.69fd619d0.0","@material/theme":"15.0.0-canary.69fd619d0.0","@material/ripple":"15.0.0-canary.69fd619d0.0","@material/animation":"15.0.0-canary.69fd619d0.0","@material/elevation":"15.0.0-canary.69fd619d0.0","@material/typography":"15.0.0-canary.69fd619d0.0","@material/feature-targeting":"15.0.0-canary.69fd619d0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.69fd619d0.0_1658354965450_0.7055796206964122","host":"s3://npm-registry-packages"}},"15.0.0-canary.2a6ddc1cf.0":{"name":"@material/slider","version":"15.0.0-canary.2a6ddc1cf.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.2a6ddc1cf.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"f67bb34daad1bcd5a2979e471bcb9f84107439a9","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.2a6ddc1cf.0.tgz","fileCount":37,"integrity":"sha512-KKkRb3dK/cUpdVzSLrQn3soRpsAf62SnFJDT+g7sYc+AXm7iYOjek7Cs/AVk4nkcpMJJEQm35A5MPobgpMQW6Q==","signatures":[{"sig":"MEUCIQDG+jKNpdUiCSUgeyJU4dhQZJ7+WCi5K18isiXC+66E4QIgfaFZB0DtehYy0I+MetjxU3ezg32xTF91oTS2mbV2uuQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":901990,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi5AUkACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoILQ/+JpEjLh++eTZbYPAZgLtgcfmz+63wUo+q1X+TqVbqYxkrIS34\r\nFYyGvPwhhg7/qbDRJB/vjoVy2umIM6cLofxBfhRCt4KmXotUTpaxlqYmuH0x\r\nxVAynY8tolR+Ghj3eo2tD1+G436c/C6thDRC40kUlK/RfRtEPiK54VKtOCeF\r\n/RVGmSVqaVal6JW/VpRTuLRkZQtJVrUyLpvGw1BGM4uSvCYVyeq5evnC8YPQ\r\nLFnPCuJyG6TOzXkgsKfvu3+umE4wzSxFBsP1A43/xBFEqBFujCLkv1INONnw\r\nYNQyDdnWR6mDXzA6keCJ8JoK5Osl2Etmf0aFqjxN+WeNOQy+7NRpmnYRMTRT\r\nYWfZ4Z5Ooig/Wl43QUCd27bOCru50ySnSz26Rt5kkdcUnZTgf9qHB2m7/Rrc\r\nCmXTUoEzGgnMttW3gqrGHi7ecGtOMWjUgW6+VsT/D/mFeVBcyoWU/e4RtwuI\r\nO5p5DH0s2KxPqN7Z4AtggeaZNsTBvMtKzhah+xM4ic5wsnv+p5ceP5GunRIs\r\nVavx4TexxTrgshW80q+aUwf1KJaFUUmAPkvhPID11a+FQtva8B9GTmkPhIar\r\nbkcoMVxEE/8K9Iz0EYisI813o13qpsYAA+YEp3+5NgOKWfa1KJ7s+jU1AJOZ\r\n8pyBkWSejHd2AmiWop3XBm/vk9ONgNu4MX8=\r\n=VWUC\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"0e951ea9d38f3d449f24bd1d8ecb0fa70c0da462","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.20.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.20.0","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.2a6ddc1cf.0","@material/rtl":"15.0.0-canary.2a6ddc1cf.0","@material/base":"15.0.0-canary.2a6ddc1cf.0","@material/theme":"15.0.0-canary.2a6ddc1cf.0","@material/ripple":"15.0.0-canary.2a6ddc1cf.0","@material/animation":"15.0.0-canary.2a6ddc1cf.0","@material/elevation":"15.0.0-canary.2a6ddc1cf.0","@material/typography":"15.0.0-canary.2a6ddc1cf.0","@material/feature-targeting":"15.0.0-canary.2a6ddc1cf.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.2a6ddc1cf.0_1659110692238_0.7151361051457195","host":"s3://npm-registry-packages"}},"15.0.0-canary.86efd56f6.0":{"name":"@material/slider","version":"15.0.0-canary.86efd56f6.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.86efd56f6.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"8a541a2ac29aba9500539b16079c9dedb77b6bad","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.86efd56f6.0.tgz","fileCount":37,"integrity":"sha512-2i8Dh00veY1qWyon9aif1qZ69ZswW+9eCm00RLJjQN5jZVNHLOhVY9dGyUrVxC4fU16LpXpkz5rY2kraPdk0bA==","signatures":[{"sig":"MEUCIFt93F7ZZZUhe4v1XSopOYrjCyYyLITugiR79DIKkmbKAiEAl0B9o23tQTDYwo0CaqF0BMcIY1aK44FcP7LN76L7rec=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":901990,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi6TiZACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqOWQ/8D4xemrvkTBf6dVq1tvSOTuZfnh4M8XFBiaLn5YyEP0XyYSOM\r\nPxwocyY4OSBXlf6+uXxLipOaFuqsOXUWRLtgC6x4qL+UXLGwkVJx3ZXkv5kk\r\nt81aCoJH5qH6tniB9kRHavv5WFGcN36Vwx0ORe+1YP+ufhLaPTLAl9r8LvbM\r\nwaGPoB6HoOYtt6dS5Y441OF5TRrTpbe2FMuOQeYlXGwLD4dlkjzcaL9yxXX5\r\niYsgyExiyFIVtmDcgM4KeNdZnvsnK/9Gxrt1dsdFQcB/8eIbWnkaN2tkfIEs\r\nJvoW5vXTTM8pPHjGLB+GXC8cHOS7rnhZlpXcPgzJb2rqVokbRLCtjBuklmMw\r\nO4gfoEeQeuEWDaBrYka9gmw9dY9YHXbu7fDUzvg/CTgQyTT95XqlJx6QKAQb\r\n/zR8Eb9pG1tMNTTPwdqOLS0HGUwfaN+Jq5UtwOXUJ9sfaLZEAZlrZRuT2Owx\r\nwx0ZPWC8rDbuZtadci07vMR8IapQMBjwU9Vbd+5qrcYZMQ5rsLwPzTrIc6xT\r\ne/cZgeiDM2jgMPiXhO8BkAEwFrwr9qFPvGqwiol7mFDhEXWmLn0jdpkQdPHc\r\nK2/wJ1EwVTL2QPcqoCk2FTV8PZWXi9dJdiHwg2GrXBYA7ZHwB2N0ivZfFlZV\r\npk8zL2qcxIhR/HgvQphi8JW+rJ7HV5YcPDs=\r\n=1SRj\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"a4781ca009f9a9b59c7dfff5df2d23bb14b9de2f","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.20.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.20.0","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.86efd56f6.0","@material/rtl":"15.0.0-canary.86efd56f6.0","@material/base":"15.0.0-canary.86efd56f6.0","@material/theme":"15.0.0-canary.86efd56f6.0","@material/ripple":"15.0.0-canary.86efd56f6.0","@material/animation":"15.0.0-canary.86efd56f6.0","@material/elevation":"15.0.0-canary.86efd56f6.0","@material/typography":"15.0.0-canary.86efd56f6.0","@material/feature-targeting":"15.0.0-canary.86efd56f6.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.86efd56f6.0_1659451545640_0.3847815481067631","host":"s3://npm-registry-packages"}},"15.0.0-canary.ccfc24d19.0":{"name":"@material/slider","version":"15.0.0-canary.ccfc24d19.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.ccfc24d19.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"d46af6808215ffa4ddf7e4bd6cc1680d07ff1eae","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.ccfc24d19.0.tgz","fileCount":37,"integrity":"sha512-oEdwW29bzQPEcV//h0UoC/iVQvPosZGESFozKDNV//uQGwKEZZyumZYPipuLEuZmdran2jziWCmRtse3tfLmVg==","signatures":[{"sig":"MEYCIQCem4LNZclqY10chbMYd6QgJ0EQy0FIS563uTnyrI+AMQIhAJ4nvno7noQ1uCgIxQS4Oxl+NQuPRxi693m0XqSqt4Xd","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":901990,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi6rrXACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoNmg//XpkS3K2GE67bdqFbmOwpuAPp1O7iuXEaG91dPoXbM6Liflr+\r\ncZds6hC2wh/GJPBBTKtHwSX2DmHF6DHA8f/OEp0g9WOcK/I0j9tTX3Ee501A\r\nLSLAzmQS/Ron8y4hwHo7CIwrqWMj8NO9AR8XvLaMs0uN1xkES/1LAOGXL+7D\r\n0+DzjGRVQndUd14irSuB8IqGUDCubnNKZW17mmchn/YVybyRIUaSOR6qh7rb\r\nLQSH7Js7Rf9Hl3NOsurko60PwHWiw9YbWOudNjk2PLTthUnqrE8iCdUrWJf7\r\nc/f73KA6bk5DcBcLH6z9lDG6qmGGXJRwq2cm5jLfFgtN2GqBQgamnPB3ovfg\r\n24/o0EjSxYoMim8jb++6mhP2oUEeKSFJXoHeoKb2Y3JsCOi7wlW7wa2j1HdT\r\npzLb1ZWk44F3cVBFDxRzVDFig94UBp8V6ALM7PzL9QIj59JJ3zUYDqxatXes\r\nwojCVK6cY8+GfL2ngdWSUlrX4bLb/0XJoJZNbjo5FVceSnjapaYq6KV8mEiY\r\nRI40sBG3ZJ2tPHy9Qvzl3J5VDbs0LC8nX+IENxxyl2DvhAMgzGLDD0knnKVU\r\nx28mFx9JOvPFPK8JKTmPUDJQeEQGTLHIRHIlrNm5dfnNfb95Mj8VFwMbuXdi\r\nEJz11awF3VVPTYDoLWylYtMzh0gkCUMrVBI=\r\n=42M8\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"f790058ff0b4b30289ee965102aae1ca19654ddb","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.20.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.20.0","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.ccfc24d19.0","@material/rtl":"15.0.0-canary.ccfc24d19.0","@material/base":"15.0.0-canary.ccfc24d19.0","@material/theme":"15.0.0-canary.ccfc24d19.0","@material/ripple":"15.0.0-canary.ccfc24d19.0","@material/animation":"15.0.0-canary.ccfc24d19.0","@material/elevation":"15.0.0-canary.ccfc24d19.0","@material/typography":"15.0.0-canary.ccfc24d19.0","@material/feature-targeting":"15.0.0-canary.ccfc24d19.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.ccfc24d19.0_1659550422882_0.10950548408662097","host":"s3://npm-registry-packages"}},"15.0.0-canary.e4570146f.0":{"name":"@material/slider","version":"15.0.0-canary.e4570146f.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.e4570146f.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"a40716b62b3c626eaa65e86c1494e8b66e720543","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.e4570146f.0.tgz","fileCount":37,"integrity":"sha512-5rjFC06l5flMhQOTxrR38nTsaqiKfRWkKapFS1F91otuOwOmz5ucyRmohw8HAaSAD2ygU8uau0It5bEOB1dovQ==","signatures":[{"sig":"MEUCIQCUb478Y0TjODGP6MhEVaIclgrDjeJCcwgXH5Nmu0MGAQIgdGLwv1ceE9sl/HbX8k1jDRbUrfsqZ+C2jsfpKEweFR0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":901990,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi6sEyACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpUew/+NoQu1GmIzHjZf2b2o6kj9hRHiIPc4oHupndspPdu+18HELgB\r\nwUU/1duWHuZJeCHZPBXAQV4gfpp6v98kgHshkv/1FigFZGcbYZSoaariNUHH\r\n449Z7w1jitjDhn8Mif3BCEirZE7JuyY7+jKQQZNbfjEcGBku7I4kGmdYMTOL\r\nwlO1D9P0+76XSD3RVwsBDtTMBGrY4diRmeGd/Qs32oEsp1DEmadveUnX5voc\r\ndXwxAjcsZTpE80WTYK2bbxBrbpObsFCIYkktz7i7CeMGr1/+ZOXsJZSJxa7t\r\ngdgOHKVeAnxnfmWxNcC+YX8V0aeCMGOtouahIAl1KecrqaCM2SJBiU1r9JkR\r\nZTeJCHIA3+1UFuXYaZGpi3N7PpwrRzM/5p0Ktwl2NqyXyQEkppNrI0KU62Qf\r\nzSSOtpzlHSEqJ8FPX1jG1vBXJen3EEfNFi+p0SWD+vl9gnT9bIaG8vhuizSM\r\n6jsjYm2Hkd6eur2RCvW3wdk3yGrUYGf37vLGWCAV17s0SYCH+/3/oIA9q4Hn\r\ngKgW3E1n73fs42CdRg7p7SIfQ8aS6A7BDVtICHmrSdDZiMMM2jM9ELbWHx+g\r\n4ahuTtsUH8h4TMxt47auTvJlv7j2qgGEnXzoUE6IKjK17hvKC5mGhtGbG/ex\r\nj+0I/G6D4wol/YFs1mMI/GVsIAJAAnwebWc=\r\n=s8r2\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"e80d690ce0a868398025065053615e866dc51ada","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.20.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.20.0","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.e4570146f.0","@material/rtl":"15.0.0-canary.e4570146f.0","@material/base":"15.0.0-canary.e4570146f.0","@material/theme":"15.0.0-canary.e4570146f.0","@material/ripple":"15.0.0-canary.e4570146f.0","@material/animation":"15.0.0-canary.e4570146f.0","@material/elevation":"15.0.0-canary.e4570146f.0","@material/typography":"15.0.0-canary.e4570146f.0","@material/feature-targeting":"15.0.0-canary.e4570146f.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.e4570146f.0_1659552049940_0.7196447989653547","host":"s3://npm-registry-packages"}},"15.0.0-canary.6683a36cb.0":{"name":"@material/slider","version":"15.0.0-canary.6683a36cb.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.6683a36cb.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"30243ab21ffb725b1de2af92001b1598a4d86e4f","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.6683a36cb.0.tgz","fileCount":37,"integrity":"sha512-lNliNpU1AuTLQUirGleGiJMm587ndr5lMKD7eP4m8aScgxddjL6A7JopUAAzYAl+bH73z9dabwhdG1zYpbtEGA==","signatures":[{"sig":"MEQCIAiQYZv2lY1UtJOW+NpHKypT+rmrHx2m0Hdhpl5fYkz+AiANJJWd9tWkhRHEv4Ma/oCnjVgEnwNkq90Pa+FcZYjl1A==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":901990,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi6sqTACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqbhQ//RMAUdXw7FLjLGkqBROtUSODlzjKZfa2AYt11xANmPZSGrVlx\r\npz/qLIFS5/7J/lWFHMXjZIIfJ7srx+ovLudNHJDhLfauJQvs0bIP1zBqJRXq\r\n13TNro1JR7WcOSQ6hAchP5+WPvcavSZa2PzR/ulhq+qnwbhpwvDUMKD3XGvs\r\nW4VCyc2gv3a4g1TgmkshHRC5HAr1ETggTn8PU6xj22M3/U6htLlqre2Te+Ts\r\nJGT/9GGtcCaCE36st+HYMJZxkNVHVjMbPhGjwX4JlUuetejZJfCxGb9FLbFr\r\nWSJGopw7ta8ED0NyH1G04pE88BIeWLtyUc3NKnbJxPaZbzBrw59eGZJtzkJx\r\n4JzmRcLHx0v1yAJ+cb/oI9V9WiYva3xOYU7Vng8PQhsd6ZPjEIgJnj8DVEb7\r\n5GlpACeGsXAa3fS+BsqX8iJIAPU1vkiKNFUlvALVR0mUCyCrZ0/aMiPNrnTv\r\nc1H9pSdOfFSrWMp2UO37NYOsHgXTtQc440FVldSmS2D8smvPv3I/OkpzWNoN\r\nJ9SYrGDBeHuFd1L1uQ3qLNwLZ7E045U9hfw4VxrdBPlL0Wm9mAGAXvJOdnE8\r\nMlkOos9vr6SNHunM2p5mCWelAn+HhAgLLwsIbj3Eb5+3RGzl2qqqV1fZ5Dp6\r\n+AdrUWM7fZN9kobq660kIHPEc53ldk1zPsI=\r\n=e2w4\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"8feb0b9a8c5151a18a06d282cce87d861ea12e5d","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.20.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.20.0","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.6683a36cb.0","@material/rtl":"15.0.0-canary.6683a36cb.0","@material/base":"15.0.0-canary.6683a36cb.0","@material/theme":"15.0.0-canary.6683a36cb.0","@material/ripple":"15.0.0-canary.6683a36cb.0","@material/animation":"15.0.0-canary.6683a36cb.0","@material/elevation":"15.0.0-canary.6683a36cb.0","@material/typography":"15.0.0-canary.6683a36cb.0","@material/feature-targeting":"15.0.0-canary.6683a36cb.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.6683a36cb.0_1659554451375_0.4360708196429399","host":"s3://npm-registry-packages"}},"15.0.0-canary.10196647d.0":{"name":"@material/slider","version":"15.0.0-canary.10196647d.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.10196647d.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"7e8e1229bbf338ff1051e93a86d697bd1b873dff","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.10196647d.0.tgz","fileCount":37,"integrity":"sha512-o/thWHd15/dJHjND6zqZihpJ5Qkn27HzP5klUURff/YQRPf015ItPulVZv9GNvJ0MVMfRxtoHFXCmYXo+qjAdQ==","signatures":[{"sig":"MEQCICshN2bvDpEL6944Jtdla1R9OMz/tACup5U0zEFSZlRQAiA3OVp8oit9sbxFUEawLNQeyvP9qvWR4ZZIMq2oUxuSGA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":903549,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi6u54ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmqv7A/+JhuEoxqtjIaSsFb95cd4KbLiIxLoOrCuButvxXjCJbimf+5i\r\n00qpG5OQwk3GrllBnXNAM0lQ3FrR2MNfdoe//Haw5Pl1lrVQ8XIJiKXJAX6g\r\nn1ahuoHqSQVy/P4vXsrO5putcP9K6t0HjwyJaRr58CQIbb0NSPULMl86x7/s\r\ncl/PEjhl6X/2156jQmbD7bDDK80gosMJYUNVKR6DKuv4j5Y/DoE6PFHazxC9\r\nxQP3Suqeh6S+COLIGDs2mFyMph7JOnsbF5a7swroaL2uJ8THQcV7fOrgnVyr\r\nbbfSOXqDXzv4Jk7GcMtCwIiU1Wmr5Ie2AIpHMEZB0aRcfJsBlJnhOhOqDSBY\r\nYusDulmKZQ5Us/b/S3oXT021TGT+4cApsSskydjtPnIMp3TlYjd4uqGq//ye\r\nH688Lr2E+Co/IU893NDb1RHAldoZjR4tE4iZvA62t2OV/mmToUFFcSP1U22e\r\nHlAT6FPaBdUSHh/p+f1JBMXIXMpt169cXjmC2mgQ3qSqSzXiKnupCs41PyZz\r\nyGCLhT64K1gijp0I3m18i4ZJEuvjU1s0d7PG//Jao0/qH6kTOgG7RYtpqLtC\r\ns03EW7li/1U4K+MAhXx1b2Hr/oDhuncZW/JdzNBPSQUwJ0oBWQAu/Q4YvJm/\r\nWVIOhaOsIemRCZtKTu7fJBP9CXhS/BjU9og=\r\n=fiaY\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"7a708dfc09b3443c565ce80a676b159abcec1339","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.20.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.20.0","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.10196647d.0","@material/rtl":"15.0.0-canary.10196647d.0","@material/base":"15.0.0-canary.10196647d.0","@material/theme":"15.0.0-canary.10196647d.0","@material/ripple":"15.0.0-canary.10196647d.0","@material/animation":"15.0.0-canary.10196647d.0","@material/elevation":"15.0.0-canary.10196647d.0","@material/typography":"15.0.0-canary.10196647d.0","@material/feature-targeting":"15.0.0-canary.10196647d.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.10196647d.0_1659563640407_0.038861139515190324","host":"s3://npm-registry-packages"}},"15.0.0-canary.b20d3d73c.0":{"name":"@material/slider","version":"15.0.0-canary.b20d3d73c.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.b20d3d73c.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"1fa83253bbaaeaccc4c139ebcda4d06b3f6829d7","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.b20d3d73c.0.tgz","fileCount":37,"integrity":"sha512-4CMt52ZOswXWrgG9L28Y4SsQ01/5qG8uOP9uUvUgpcJ169XebaXiI+JWC5ljHcN4x5nSVbhlaXWUdzbWzVuifA==","signatures":[{"sig":"MEUCIF6QzCu+V8k8w7IsPiCr0uNCFOanKXa7qOM7TQXk3yj4AiEAw6oQXvnsjBBD5Q9p6crBABhg2yTRr4FrxPjxY+M2EAw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":905742,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi7Et5ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrLng//er7VS96ecO9rmRxmU4DU6f5P36Nz8CjHdo3zS/mcnwTiN4cX\r\nzSr/WIHv+Hxnbc4Okwi/kfp6FPkFgGZL7kSW76DMyHXw21lnJgsbC1wFofEp\r\neeXbDS1f3iNdlSBG73tTzoEk9fpBCAGe3AIaTtLtqv1y+2JQ3Y8pSjqXEgn2\r\noYBZtOMGux+T9CMQb3kJmhn8hJCzcab0UsNwgN2Wf3ncLTvIz16TCIURX+SV\r\nhpN6hXTdyYRGZj79hwv+JV3SHeHZ4IsodHRVrJBr37gRNU3fx5dtUGcVh0vW\r\nmpOBAQJV/rCl820+51BvQs2kw/pyu+8t1eyFIPN1up/aIHsYjbq8CjBVmoFh\r\nI/47zgyVOuzHVQmbJZ6S7z/IhlNTt6bb6xubKM3AYubZwNDwGyKUpEIAAvrd\r\nCu+rF/Xk8ju8kTZJgoLhDTXeXy283uS0NwKjsl/AlGFoR40A5JvB5fGOLUYe\r\nVbmOqWlXVw+vApVtQlOs7V1BzzwQN++1R6y/DoiRU9AcQS2H3EDQfd6zbQ3F\r\nt+T86FFDXygl6aic7Jrk0y6iT1nK+zTwNxky3jzC+ZE7S9jRyTBnsb7/ywp5\r\n81jK+LaRPtqNOsb7SbN5/9uJZWDXNskGc+8mxUcEtwozVN02JxUJKcJ9Z8jo\r\nTcGhdi1vPI188YMcO9c+nNFBNTUWP0pxmhA=\r\n=YxWb\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"c869b5a3ceaada6bf2ec164c65f1e4fd88a0e7ba","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.20.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.20.0","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.b20d3d73c.0","@material/rtl":"15.0.0-canary.b20d3d73c.0","@material/base":"15.0.0-canary.b20d3d73c.0","@material/theme":"15.0.0-canary.b20d3d73c.0","@material/ripple":"15.0.0-canary.b20d3d73c.0","@material/animation":"15.0.0-canary.b20d3d73c.0","@material/elevation":"15.0.0-canary.b20d3d73c.0","@material/typography":"15.0.0-canary.b20d3d73c.0","@material/feature-targeting":"15.0.0-canary.b20d3d73c.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.b20d3d73c.0_1659652984804_0.5506467373599533","host":"s3://npm-registry-packages"}},"15.0.0-canary.47c0c6b1e.0":{"name":"@material/slider","version":"15.0.0-canary.47c0c6b1e.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.47c0c6b1e.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"8bb23cfa5b07f95e21124e7011cb486bf03e5c1f","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.47c0c6b1e.0.tgz","fileCount":37,"integrity":"sha512-OLjuvS/cNTh7ixgECys66ZAzhMSq6NjFdzfEiicSffSL7iZ4F+DZE3dyA/OO1yhYRDie6u6NP2Djfsd5Y2f/Mw==","signatures":[{"sig":"MEUCIEmZO8lUlfJYcekcQsa2uhPNqPHyS7rsJZ807hyIzpq2AiEAr+k/q5P1eK0831+yfr1TxlFYBpL2BA7vQgC/u+RdENo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":913000,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi8ntGACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmp3Gg/+PtQ2tCOd4AY1HCuDtEY0upl3oVJvi5/WLJFbm87/3D/bYbmG\r\nkZsNqBiGFdmHfuwpV49QoXzOUTeFpCSSAFffSIEpfkwrJyTJgrts7SXc7UpO\r\n1KymqUDrivzCkX/cl8D6R3KwGQAL16fJtOQX/ZfEzT6pKGuBfom0WU3/wjZJ\r\nYn/z8gZp//bA/6JzWKT8t3p/uWxcbGZtgVDrvLFBcbZiaDwKzHLkfnIBv4EI\r\n+Au4Lnr9D8INUciuEfYGcjgGiyI5AVnoEuknaodnWPtPRhSvRX58D0nTnjLH\r\nTYg3efalHDhEiYQaGcgoIvsRdULeV+Y5YMsxEu8WLydNwF8mgVcO7CTrjwUk\r\nvbiJLWQ5bSu0+lQ+uR+glycttKxdcnSyho00Sy4OS97bctcdGZf4iphHcI4O\r\nmBQrmha8l+5mM5AGEnCG7mTal9UEB5GiRR3oedhgPal2kbQebMm+nBk36Z8H\r\nBRYkYAadGsieZf87za1fp7IT5VLsGfiUorm+9RswP99aGPJCSkDTKb27VKV2\r\n1EPGf3LJfAbYfgZHt0NkauYmFuZIzpkGwD6IIxsMlnpQZqXqT1msl3/Drsvg\r\nUX0WMJ4QJodU13lxsZpsWCeh+uo7dNF+PpF1qltSlkHArr+3drSG6TLNcqSp\r\nys3Lsgcg4Qbce7LISarrXtGFuiyGME1ql20=\r\n=ApOy\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"692955bb2bb9c99ddd9321606e40fe4a56de120e","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.20.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.20.0","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.47c0c6b1e.0","@material/rtl":"15.0.0-canary.47c0c6b1e.0","@material/base":"15.0.0-canary.47c0c6b1e.0","@material/theme":"15.0.0-canary.47c0c6b1e.0","@material/ripple":"15.0.0-canary.47c0c6b1e.0","@material/animation":"15.0.0-canary.47c0c6b1e.0","@material/elevation":"15.0.0-canary.47c0c6b1e.0","@material/typography":"15.0.0-canary.47c0c6b1e.0","@material/feature-targeting":"15.0.0-canary.47c0c6b1e.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.47c0c6b1e.0_1660058437963_0.2175587972619446","host":"s3://npm-registry-packages"}},"15.0.0-canary.0e3dc8e38.0":{"name":"@material/slider","version":"15.0.0-canary.0e3dc8e38.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.0e3dc8e38.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"74fc54d0584e7dfb5121f95a80d068240bb4b900","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.0e3dc8e38.0.tgz","fileCount":37,"integrity":"sha512-Y3afh7VOxtrebjr8nBQaOvns9xwx2FDcLriqmuFq35Rac9XxdD/yxXYKZUtfskmZMFCODrgnurVHNaGsjzcgUg==","signatures":[{"sig":"MEQCIAyogID6nX0gNPpCP+hpceH29/JhWj9PsPDjJL32U7XSAiBmcFY7R9Jh8tfbyUMUkm+gbWVBgS7a9gnyh3O4+AQNnQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":913000,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi9U5tACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrR5g//TR58g4x2UJKtrG4W/ZwEm7Y2d/HrypdC/pP+J9SfmIddO5HY\r\nyp/jruA8OVJETo8NmpARPYV6fCbQpZ9Lqe+1FQN3jstSv87GTnxKhu9gQzyX\r\n7oT/KjWhw2/Xa6GWUEeStM1aHVb52KKS39XZsTSK++ptManiiylymCafVUYJ\r\ndfkJylPVmons03B1cakfTOg1xAwED2frAZ8OoQ0qCd2lWL6l0nbFnL3DqpuR\r\nSTG7D6L8JF/5hd3ZiobgebPZGuhSHzzvPtt/g9h57923DZ7cAWMVqrcugh8p\r\nZqEstorkhORH3FDuyEeVBWsoUZL/4Odx1kKDyQsWa0jiKJ1Kup5CeKpogo38\r\nS5KF+D06Lb13ZGVf5bXlfwlGSWG5nebsr/SUdB42EC2IwEwvjSEtymOy9DSU\r\nVVUowODvMN+EMDdMUBLBDTYga6JOZFN7FdlQq/MRhIZ1g2Q/KFNqF2KzJ3yq\r\nafIDpus8KHUjzAdyhdoqIc6xaYjBLgB282uEM76zlh7hCEFClVCzjiIbVYIJ\r\n1hPtuWd9S8FWOijmwp9pXwbwgEDngNBOLwt4qVjSHlNf6hIdd/B6TgCXqzZB\r\n+zoT6p58Ee3AhusINgPvtlSQFh0iOf3yJqr2nahuNMLqkoJTp94/M5lUcBqF\r\nirqOSqvMzsZTrGPKApZWaSrvN4+j8ZynkZg=\r\n=bh5T\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"51983e03d07e3c1f50454770dc24ff8d6d6f97a1","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.20.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.20.0","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.0e3dc8e38.0","@material/rtl":"15.0.0-canary.0e3dc8e38.0","@material/base":"15.0.0-canary.0e3dc8e38.0","@material/theme":"15.0.0-canary.0e3dc8e38.0","@material/ripple":"15.0.0-canary.0e3dc8e38.0","@material/animation":"15.0.0-canary.0e3dc8e38.0","@material/elevation":"15.0.0-canary.0e3dc8e38.0","@material/typography":"15.0.0-canary.0e3dc8e38.0","@material/feature-targeting":"15.0.0-canary.0e3dc8e38.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.0e3dc8e38.0_1660243565395_0.07547501762480024","host":"s3://npm-registry-packages"}},"15.0.0-canary.d5a11f1c8.0":{"name":"@material/slider","version":"15.0.0-canary.d5a11f1c8.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.d5a11f1c8.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"91828b18d196d3e4afbcf90d95358d49f2815802","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.d5a11f1c8.0.tgz","fileCount":37,"integrity":"sha512-FgfYon4x3YA6B/Mt20uainnwK0oQAgzBpnoyY3M4UJqyYdUVU9q7B5qoIqNrQDbxtPR5oIkeJ+7Jx/z3cs3XsQ==","signatures":[{"sig":"MEYCIQCOI9m+9QyRCh8/rZeIYBkAAelfUj/XE6ECrWKHpTyi5AIhALjP+GFwvP1DkiJYxQCRUdMDAP559fAOPWp3LA/iFQxo","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":878529,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjDpbGACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoPqg/+MJ+csaoM2RMpEUmyEM6icXQuiJDpaVvcSIK9U3RxPQfEQY6x\r\nLyoocEh1aA47+mz4KRIcWqXnyKpr8j2lBcMDHLLzaUOWEeI+V/zV9U/37GtY\r\nDdFomyJ1mbwFz9hfCI6lXWHFeKT8sxWof6hhHg4YuYvXR4T5j2gHnTmpqoWV\r\nRxLXdeRkXiytgxxbmku6gZGd1fuu1128xaAh6wuBOYP1f9DDIIR6HKA7Wdch\r\nW1O9OOhXuswV0kgCK4dP6lTqclHoi5UJEN3kJULVRUFQw3YoAvfRFEPKSlYY\r\nYYiRevFqPLG9XxmQsGbzkmloR0Ywibi6jfPNNYRqJcZYqCuKa1eOBVX2CB4K\r\nRDdG/PIokp8MnJnSj8a1gZjvq7ASJMwRMIN8VfX0jYi16rMkKjlJBjXbiJgP\r\nHzEk2dTMCSn3fdqZFi3UeiDVu6Pn5zDBpWZAtDV4pF4Qp283BTpdqlKucWiV\r\nFL9oEsEEyTk4tQyXU5JTBbjVkge5JDWXMdpPzIULQDhV4SrFaazUniGq5pQA\r\nmF4yDpektTbayO8Ru9u7TehG7A/LoY7u+42MyKT5Xlg05qITwz2xtQC90umI\r\nJVLt9DCJYPZRyQaqZcVyOAEdtYXNkB/rsPrrXMbdRPDVancC+RWAaZTEhY4p\r\nzJGfcIslylyRpbv9ZfVKHcJKsZKLS3+0K58=\r\n=BF6+\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"7ac71b54192751de3a5469d20cb2e1c30e544d30","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.20.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.20.0","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.d5a11f1c8.0","@material/rtl":"15.0.0-canary.d5a11f1c8.0","@material/base":"15.0.0-canary.d5a11f1c8.0","@material/theme":"15.0.0-canary.d5a11f1c8.0","@material/ripple":"15.0.0-canary.d5a11f1c8.0","@material/animation":"15.0.0-canary.d5a11f1c8.0","@material/elevation":"15.0.0-canary.d5a11f1c8.0","@material/typography":"15.0.0-canary.d5a11f1c8.0","@material/feature-targeting":"15.0.0-canary.d5a11f1c8.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.d5a11f1c8.0_1661900485712_0.427070294754037","host":"s3://npm-registry-packages"}},"15.0.0-canary.bac992a95.0":{"name":"@material/slider","version":"15.0.0-canary.bac992a95.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.bac992a95.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"609d1438cbce43702b44ef71b20d3009c4bbf4b5","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.bac992a95.0.tgz","fileCount":37,"integrity":"sha512-q56ceb+L51B5+/RTUrUA5pSmQHhwSQ2FmXHU9jMFPbrnnSSZ17Q59fZJOA9MwJ8MpPfr4Ni0iIsdVrL2A/OuzQ==","signatures":[{"sig":"MEUCIGNrxzVh0WUPqKQNf1+JIpGKYkdUH+Tr5fPSb4X0XfD4AiEAuHepCIL0q8i+kNsOkUThIAsl5gHDyNvh6Mw414PeC/c=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":878529,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjEFnLACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoO3g//TSKYRvVFFa+rpzVD3cfRIOXJj5Hf0lICpGOWIfkv8BvgbWv7\r\nz8096beRORi/pukSc43vxI5VvBh0lGTJr55QyKVK3DS05Y4GlIz/DwcnEh1I\r\nb7f9XkrCZjubvxwPtFjBhg8skhtDE1SirPunSRv0KHAqYi9gwJdJTuBoV38C\r\n61ULTaU1WPVHbBN8v6UWr2s81tf1WckK8N6edfQ5jYLR/OXEqiyEYZ19j3pf\r\nxxX3Xf9NDWduAbpxnaROFc1rnc7Qle7/C5PpJLH3fUUwa1RDL9D32XIeAH0W\r\nD7jchPbZ39UahB1DVHeEd7NqoMY3CFebahsj8pD5OoxNMSfL2kstGjrgWePX\r\ntp7I2vGLJAbweTtesQrjg6M8FKWyMs8AWrk0xtIDSx/WJ5/xg5ds8nYbEUSx\r\n8XzuD91fTpbdzy7c0PXnEKTO35mVlPN8iDUZNfhIbnZYBrjGThB7OrrPiDq8\r\nsV8z4UytIVQP5xjmQc49k7iQDTYFewM9TcHblYUb+HNQCI2K9AJekeFirjN5\r\n6FeRY54Ai6m7306ID52ZkUkXjkHsRL/eztvNl/hagXLbpf/90z/3I0sZdeps\r\nVlyCPWCN9Fx+Y5ZOEE4Nutoq+AhYHugG51SHod9KKuDbVdEO2y8QBYJ00mUV\r\n1cowcCd6ncVPLWabWgoIAMsuPqGTctK9w1g=\r\n=iZZi\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"b8dc8f019b6b9a7241d55c21925faac495f9230b","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.20.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.20.0","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.bac992a95.0","@material/rtl":"15.0.0-canary.bac992a95.0","@material/base":"15.0.0-canary.bac992a95.0","@material/theme":"15.0.0-canary.bac992a95.0","@material/ripple":"15.0.0-canary.bac992a95.0","@material/animation":"15.0.0-canary.bac992a95.0","@material/elevation":"15.0.0-canary.bac992a95.0","@material/typography":"15.0.0-canary.bac992a95.0","@material/feature-targeting":"15.0.0-canary.bac992a95.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.bac992a95.0_1662015947084_0.7266931955822351","host":"s3://npm-registry-packages"}},"15.0.0-canary.d25f3404c.0":{"name":"@material/slider","version":"15.0.0-canary.d25f3404c.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.d25f3404c.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"b8707133c745035f0df95d92cd019c8178065857","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.d25f3404c.0.tgz","fileCount":37,"integrity":"sha512-Vyu5VOWTnEBKxmms03gp34TBQlJ/IYSQw51HBprOYWOu08NezCvirIXE2MD4x5gmxLnYSL+YrC5CXH9tnuhMbA==","signatures":[{"sig":"MEQCIELUoCNpjwVhPIV947//xxEn24VHGdkxI8pLpnpHSGD1AiBBCTFWlc9WHqJVjEpqH0tLwCpST11QVray8RrLwVTN7w==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":878529,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjEH8VACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrC2A/+OmMJr4LTphMPH1ItfLlDqfDSRSatqVI5/sssMRij5Ki5PZoh\r\ncj5klg/zGLfzNPg0+DjXlZ0uhSAtpMzHZNnd238jpmE2JeidHvc0PlcO1C7w\r\nYooSbsO5kkOaSruiJgRa1Z3U2QLhYAITiuRPYkNdjc/cLlp5oTVo/LYvUGLm\r\nJ3UMw4hoxhd5YCMKwWianX2DrPmdGMmeKgQSvHyNndfFrq26CpeL783NuyYT\r\n24tievkq3VQ8mCVX/N/5nM7mYY/DWAQAJnUbbAs0sPIdn2JklZGSKUke6m0o\r\nWapUXqtwZYT/uTyySDMh+DCiOvjl/fdYVUdBvGaNO3XK+bqXHSUU3UJNNG2v\r\nUr471QzswEy2USMmwrxjPuDGeuxQu0cPszxra7zgjCZOIlIbHAUj138BmzNV\r\nwrhmRSoU4G5GZg6OAjl2YHYNOMkFuYO9GKlSz42KxPt14GDervLawtaSFFDx\r\nWU4ljfFsTvxKCfVg5y73It5kDTZ/iAalCyihFIUW8pn3OECveyiGzpDPmZSl\r\nSm9PDEXICYMi7jfaR/7DvzFK0NYy6mCxtngPbYySnaApy/pRrp0jkhigYeP8\r\nl3yA7aNPZ3Xq02fy5bewp8YkRtSH9wbI1lMN+3caE437FDKrtp6J1Rbf2Gvt\r\n7eACWMWztzDRDz1logQ7sxHOnr7N8WQ7FIU=\r\n=euEV\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"cea256990068cc2248c9bed32c4a47fe622a3286","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.20.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.20.0","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.d25f3404c.0","@material/rtl":"15.0.0-canary.d25f3404c.0","@material/base":"15.0.0-canary.d25f3404c.0","@material/theme":"15.0.0-canary.d25f3404c.0","@material/ripple":"15.0.0-canary.d25f3404c.0","@material/animation":"15.0.0-canary.d25f3404c.0","@material/elevation":"15.0.0-canary.d25f3404c.0","@material/typography":"15.0.0-canary.d25f3404c.0","@material/feature-targeting":"15.0.0-canary.d25f3404c.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.d25f3404c.0_1662025493372_0.9247854318677904","host":"s3://npm-registry-packages"}},"15.0.0-canary.920d8a79e.0":{"name":"@material/slider","version":"15.0.0-canary.920d8a79e.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.920d8a79e.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"7f3f23b0e8b27b4c552fc569b0997c03f83813ed","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.920d8a79e.0.tgz","fileCount":37,"integrity":"sha512-NACVGLOGojpKYjCXPBsOiklmD7xAtJl+PT7AXRM3YrVKQmo+rk1uGF4aWnSsfE+iYNSxYk3dhGGAcMG4hGlB6A==","signatures":[{"sig":"MEYCIQDXSxldI9oSSOKlvq0ckJm+CEkgKBT0WneWl02vTWLP5QIhAK1jEGkadYRISJcpDo/QOVZfm0zvQydNu9w2eyGQXC2m","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":878647,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjERQzACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrNJBAAjyJ6EVYO+2iLarlFroCzePSZvUR/zOilVLmCG93aW77825Yp\r\npMjq22jUaO+vRRLL3MNuEn0iANMjTfoJ8kuGdduanzDGGnFq1lvjgTKXSQuu\r\nwrN/pbf5Xn20d2hOP74/6J8EftByuaHnDorKmzHjxMAGpoMDQo3LPe8uJdmi\r\nE3HpIIkR0p3bBDlVVWDffOYXFYqgcLG7m0Jym17hX6iDECAwzH/HxDB9lc3G\r\nYfZgB2FKxHYnZ2DbfPzP22lhMUtorAuatAxiI9acdBnJPc7u9Y0ojQ4FQwsn\r\nLraroTyP9/n49EuyssuDSyXRlucrUwtRiExowwGcmDf7NoPWEeJoeuPOLkRI\r\nUGD2CHqVT0wIjiR77wIFuWkIM9jqVg7cuTjBZaKlpqzKFRWGZi4hJCbDhSSv\r\nDMdDFxP/+0j98/h5Hr2/SM6zjI3JDRxlT9RIIIs4WUAaL3gt2RD6JpFE+pwC\r\nu9U+JcJyt+abviFtXqZb+r8yhlzXc1p3YFN7gSu32ACj4OdSTuxsqsPZaWJ+\r\nemAr3yvuZpg/+LlqLiuEvlGin3R6DOMs/zeH2wquJZD3IchTZnx5TeQOf+tP\r\nZJQYhuNPhRWNx9y7sgdsiQmln86ut8Qlsci+eNtpiCB802zoWdRIaMnD2UKC\r\nLCre3FN8W/0v4agaGyS7KLQtGJ9rkKLiZJ8=\r\n=9rEz\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"781a4c78770587fd97c25633bf9f137081c35bc1","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.20.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.20.0","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.920d8a79e.0","@material/rtl":"15.0.0-canary.920d8a79e.0","@material/base":"15.0.0-canary.920d8a79e.0","@material/theme":"15.0.0-canary.920d8a79e.0","@material/ripple":"15.0.0-canary.920d8a79e.0","@material/animation":"15.0.0-canary.920d8a79e.0","@material/elevation":"15.0.0-canary.920d8a79e.0","@material/typography":"15.0.0-canary.920d8a79e.0","@material/feature-targeting":"15.0.0-canary.920d8a79e.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.920d8a79e.0_1662063666675_0.9025343325616735","host":"s3://npm-registry-packages"}},"15.0.0-canary.c363f267b.0":{"name":"@material/slider","version":"15.0.0-canary.c363f267b.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.c363f267b.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"b06a7fb1367180c81b79c5b4c84c3d071e998ee1","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.c363f267b.0.tgz","fileCount":37,"integrity":"sha512-ShT2PIsuUqpuDgEvkbBH9v75dK0M5H2c6Tc/v4s4iQRiEhXxesKOi9VZEoYDnqWAEBUWn4+4m6oLkzVuf59ORA==","signatures":[{"sig":"MEQCIC7TrailM4Yi0LR0dVEMq6xUBFzMdQOY6EfXW8WKUUDBAiAiVolQiaxSknt+vD/iCXfkoVJ+pZOZBUYooSbwDeUG1A==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":878647,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjESGgACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmriRQ//XTJxXyVpjuoBIZCphCs9t5xLiBLplM4U0RiTGB8ZintJGzFO\r\nwrEN1OEO9sGRMv123TL/L9gJrFEsZRDnrqk9uXnV2yocaY/1ADMpgMsIqBmY\r\nqBwIeueqAXYRFfsQUo3abUiZ3lxpNaJz3e8pjeEVJhjiOvO+Muxl4uFt13T9\r\neHh+ZOMYtrAdrpwBUVfu24NU7Q91C6YAxa2iuiMHeQg+J3BTSi7S6nu41/ev\r\nf1pqlzAYbS3h6rrAfPSA0olqjovO7srskFLzoc4emyNRZRdwW+wJRXurhjY2\r\nh0t+d+wCirlGNHluVGhc+mNBbpzDPXlPvL+xk4vovs2nxb2C4vYDLiOiBuVx\r\n3aAZO2KJKlXTuxV1c/+gQ5YLRnZLsFkH/Yk9lv7CGmjjtQzler8tzgXblOA3\r\ngFOq7hOVasFAEZio09d8HU82ZxhUnFckPYz60iFOv0TdNY9cOLwmhDpC+oHI\r\nTMS1OsKbV8kCkvc2eRGVD5gaLmfWfJlkQuQSLkmkmO2VkRuLHIMbji+sCKJ/\r\nUgavrWdyjWIUeHpuFSwHpxc58iGVwQbQqWdEmnt+nIt3kC+5Mnbb7PwczULO\r\nS6hbpiQQ3rI6IhxyXzkdg6+5Jl8qVA94VSxamePSgS8qKOHwXsygVONwBd+T\r\nXePQ1gfo1lvVa9+9IUWZ0XYVnLdgcDkCAU0=\r\n=1/SH\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"6e2ef624f85a84b5510b55933f017db57797f611","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.20.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.20.0","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.c363f267b.0","@material/rtl":"15.0.0-canary.c363f267b.0","@material/base":"15.0.0-canary.c363f267b.0","@material/theme":"15.0.0-canary.c363f267b.0","@material/ripple":"15.0.0-canary.c363f267b.0","@material/animation":"15.0.0-canary.c363f267b.0","@material/elevation":"15.0.0-canary.c363f267b.0","@material/typography":"15.0.0-canary.c363f267b.0","@material/feature-targeting":"15.0.0-canary.c363f267b.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.c363f267b.0_1662067104535_0.12770198166219315","host":"s3://npm-registry-packages"}},"15.0.0-canary.a4eb4937a.0":{"name":"@material/slider","version":"15.0.0-canary.a4eb4937a.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.a4eb4937a.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"ef62bfdcbc79003115332675e7d3ffe8f4c1a63c","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.a4eb4937a.0.tgz","fileCount":37,"integrity":"sha512-x69ISRJkKV/YnB5F2iGdxOMjoTCC3I6w/6m+Itqlk6CHolmRejMgXDw2suQsaEUGzry4xA+Snf7gCKs62njM3w==","signatures":[{"sig":"MEQCIB8bZaPAe/q0xjS5jhpyHMojZnCbnXqYOGCZq4hF6WlVAiAyB9SWT8t7Et1nwu6o3kyysZX5dx4YvxumUHCoeeyQ9g==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":878647,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjF49LACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq/cg//TQQ8Wza/2KdZa1nmXdKZTxDg0Jt/cB7QTqKaRq39RK/cgimK\r\nib+LBnwHGJM0UDh4avGk3F3FHPLECaW0YA+1aZvlZ9ePalBaLGmRHiblrtQw\r\ndpDO7qPL0IZxsyBq4E+vX6q3sOQ4Ps/Q5HpMwu+XLrHbcpGjnduCkbPOWBKt\r\ngBPxTaljo2Um69onJu/026NGcp9hTrd/LlcX568mGWOSjRbEw83YBGtgkMqU\r\nNYN5R60o+ELXI1K3eYbIMmF3eM5Qf/bwQAiOdDbQR4zk58GF7CA5IXjBw/QU\r\nf63LUPE4/5aw6+90uzobse/hiiWSF79sKFTRmD7XZK5/xnoC/ZsL+na/gJ6a\r\nngQix1OsN9e5Zm6n+oq1TOcDlpFgyRFGv3CFnqZC5zxFOKGtAncX5gqgQ2Nz\r\n6o8EG+UejwYLyS51VgtTGu9y0Pzjvpjw/zxPCZfhotb35jtRwdemC7NY3WRa\r\nTvVBHFKVZjYoafv2PLJvEvVKHliGYPoCElhgALcJzbi+HMK+sZTdUAXju51N\r\nWfud8qNGK6h8BYor4WC8goWQ6UjXcTBd6g6+aJiXnaPfOWpyomc8g0RxfT70\r\noshEMNqhZO7h+vrJk20ByjKTC/jfCZFh717WbYIrM9DQ5QiJ6Zs+Jm+vqpSw\r\nzfsD0QvMs5VuXERcOGqJ9VqWIzmqos7nSoQ=\r\n=BSbl\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"cc03915314119934676831cd7a244f70e12dd2c6","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.20.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.20.0","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.a4eb4937a.0","@material/rtl":"15.0.0-canary.a4eb4937a.0","@material/base":"15.0.0-canary.a4eb4937a.0","@material/theme":"15.0.0-canary.a4eb4937a.0","@material/ripple":"15.0.0-canary.a4eb4937a.0","@material/animation":"15.0.0-canary.a4eb4937a.0","@material/elevation":"15.0.0-canary.a4eb4937a.0","@material/typography":"15.0.0-canary.a4eb4937a.0","@material/feature-targeting":"15.0.0-canary.a4eb4937a.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.a4eb4937a.0_1662488395224_0.08482922709746643","host":"s3://npm-registry-packages"}},"15.0.0-canary.4299717da.0":{"name":"@material/slider","version":"15.0.0-canary.4299717da.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.4299717da.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"a131cc14e592d648588621ab1c80759ad0672413","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.4299717da.0.tgz","fileCount":37,"integrity":"sha512-I7+eSbFTzcUiQPTLb0rOIqFMiEJQNU30YPysWY2gqkMU/JUXnVlS7HZKjGZBLfuGkxJFmU3vd+86kpcx7L+Low==","signatures":[{"sig":"MEQCIFN4VmxVEUj2Z+rbTocmaZ3AdFFgNxKwRqQ8tgLYe7YZAiAXCBRKraLGdONHmLtsFHzBT7PO7bKfowe+w9q+a+6KlQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":878751,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjGMO8ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoH9g/+Ii3963ISQxeosoIKT2zHlTgO/hONoMh+B00LZqANAg2y/kUl\r\nda5mSKnhLuIbJD0/LQNlSO03SbDD87dVAAaptdJT3zkphu3UQr3DVDclZs9O\r\nMJb9GVLrIUk8Go3IHDKiz2uVUltWt6ufMynaCRNSvjR71b/WBUaQZoee2Qjw\r\nas3zeVLHB24SNYpDtuY1Ld6nf+60Ie2ymdyIt6Ov9u8/rCPvIDpk99t1wfnp\r\n+OTfGNoQNF6VhfH1NRbuVx8MhofcLo3K8Wcy0iN2Ihr2kud4X/Zmre4RrWpr\r\nXB4OGqNRKnRvHgA+HTlZ1ZGZLTn2LAfLz/aLl0ExjeoiqsFNrG90lg6WEEFy\r\nkvU9jdLsWMcNyuCHYiLTNFhQLsdifPNMh0Ug853f1qf/WbXfY4QoupBO0nrC\r\n/x0kntvR8hl8YXM20c29yuoeJDvQn+wiDWLSlf6Z/uqlemgnB4/YSwGEGZny\r\nQ7ThWdCtV+s7pB1GDZKq8y4aXADtA5JV64L7wfmg04CYMKDqx/62TYeSyXsG\r\nF4NSqMfA9JBem4RPN/ilJDRNogV6OK2C1qvYyXoYwJalygSlvfyjGKpSBTzC\r\nm/vpjLgb9IeVpvzm93MQ2FtxrL+ll3RCgpa6qIU7Rz/getUnGSudJRPKAtx7\r\n7nqggS0bsOirR4SmxkyFbfUr5Y8M8lSdQ3s=\r\n=vwCI\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"22082634ffad1ea812192e5ac62786a8ef47aa81","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.20.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.20.0","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.4299717da.0","@material/rtl":"15.0.0-canary.4299717da.0","@material/base":"15.0.0-canary.4299717da.0","@material/theme":"15.0.0-canary.4299717da.0","@material/ripple":"15.0.0-canary.4299717da.0","@material/animation":"15.0.0-canary.4299717da.0","@material/elevation":"15.0.0-canary.4299717da.0","@material/typography":"15.0.0-canary.4299717da.0","@material/feature-targeting":"15.0.0-canary.4299717da.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.4299717da.0_1662567356464_0.8017934545833165","host":"s3://npm-registry-packages"}},"15.0.0-canary.fa7d8d44b.0":{"name":"@material/slider","version":"15.0.0-canary.fa7d8d44b.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.fa7d8d44b.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"2a5504056358c3e19804633577b2c6651b208099","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.fa7d8d44b.0.tgz","fileCount":37,"integrity":"sha512-HxDiKF0GXAcSpIQkcv4sf+qGo6awE296JBYQSyySNa4sxVTyNPp2uguAbeAUzKe65RuIpUfHOPV4EG1JFssNjQ==","signatures":[{"sig":"MEYCIQCNCzSCj5tCO54JA4W20YO4784RvjJ7GzGaGpWd4LmhsQIhAMfoJwyDZg7VLCClkEzbacTFd1mCh1YL4gxenn+WDldt","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":895345,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjGO6tACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqRWBAAhoQwI5xad2gACIQuTg7WvmIkJ240iZ332eA3kxgO1Yw102gc\r\nbfsKUBGWfIIBj2A19WeiJq5IJXej+vrSb4Y/KgSn7nbj+2wkJGAJG6c6GKY5\r\nqAZExMKkGOZB7KfnEmzXqnsgOmHyuMP3HYpq3UntN/sibXK/tuMfYLDr8ZHU\r\niALPQAF856mH9BGR2KvHdp/SclvlKShOGy/KTFN3XYTWUDFA83e1kr2zD5nK\r\nCfJh3NKBaBZGuPU61ep6e8VqAZrDZmh6w4Qyat7mbYz+WAXf+Q6wwvfJyK6Q\r\n+oWcEkZQGMU998fSfEA2jbNpJIKy4Y0IcGTNS2mYTqrFEL4NzPdc1dcog4e8\r\nTu6yZn0HKaquhDH1xdjoe/qfX7AEsmOxQChalD0DdBkqGvp1Id90Kx9dNCzp\r\n0H1NfG4F7NDLdoorSCVOzYdT4pjx/8IrdXGEFAQ/70l619QNlbpwgCvegwSR\r\nYZlXeTLVQE1hyhNqDgKcQf3PAw617171QH+l1jzh99LIy8buFYMr4qEo+EhS\r\ny8F3b6/j0m7Yt+Pypr+Dll+qtlzvRsoiOAyCoBdehysBmzCjqEMFrCka6msW\r\ndqcfraK2ULF8aDKEG8PAuUkjYjWpg0bklB1Ad09ZpWutYDLCyB7jhtvPura8\r\nkxbp8AhACPCvdK+yLpHVKVAVC2P5sDkbl2g=\r\n=d89h\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"6fc828292e73ec2f8aa4332891628e90f4586658","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.20.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.20.0","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.fa7d8d44b.0","@material/rtl":"15.0.0-canary.fa7d8d44b.0","@material/base":"15.0.0-canary.fa7d8d44b.0","@material/theme":"15.0.0-canary.fa7d8d44b.0","@material/ripple":"15.0.0-canary.fa7d8d44b.0","@material/animation":"15.0.0-canary.fa7d8d44b.0","@material/elevation":"15.0.0-canary.fa7d8d44b.0","@material/typography":"15.0.0-canary.fa7d8d44b.0","@material/feature-targeting":"15.0.0-canary.fa7d8d44b.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.fa7d8d44b.0_1662578348709_0.355722014154801","host":"s3://npm-registry-packages"}},"15.0.0-canary.a40e3c768.0":{"name":"@material/slider","version":"15.0.0-canary.a40e3c768.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.a40e3c768.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"aa1aae219fcd49b637e5de9012564d82df9dc9de","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.a40e3c768.0.tgz","fileCount":37,"integrity":"sha512-0LsaDFTaWgpVuZZnmWrc+qWgPrw1VzGOTuD3877vBTcJ53OdP1K6RENxtIp0Wz+K/gJHmMA4DjF4Bk9dqwK7YQ==","signatures":[{"sig":"MEQCIDvHFvlRZxqHGAmHwBoy0nWBVxWZxmGDX3u7Obq39ZkaAiAjo6JOujRuNXQWAHbuVENBzW+thh4FqEGUW3gX7kSB2A==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":895345,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjG5w0ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrkUQ//dMakYwdIrcc5f4tH133tIwI7z6ziXJbwhg7CrvFtmllrpjWe\r\n1IKM/15zmhN7LwY4Pz7po0RjqfLSf33eiCFsrDgRGBqxLsWxTj1oXnuk+FhB\r\nzqdrYGu22BW2hkMT2knqzQ59E0myP5H9bDrjZbq0gn4wF5XYENtvsJBc34J4\r\nuOvf32bSuyF8oJHHhirW58XESCBKXPb9k+sRNck3sqFbZyYsK877inx0nMVp\r\nlVVohstdEYALAedjwmKGdlSqSk0YqRFRDl2VkIASbsmLXkyDAMmX1e2K2ibC\r\noUZHGU5PvvCcBJ280ATfxGiw53Zwd+htdfzSJrGX+8w/cE1B9kxtIyMfSPAt\r\n0ZgodL68p6pUbIIjnmHxbYBGsw/rWsT0wjMgc29ec28y+C/PwMPWMowo+TbE\r\nP48+Pyxtf0eafwv5acS/qHD4Erp1CsMRzzeaqmKKXwpOPm++u/LR3s+dZdjd\r\nJf9A6a2dd/QrRXSv02kA4atuT+PobZjLVkgZ6DBH4AxE5Ss41TQTgu9NQ3+N\r\npzqxSHRMC0n4qKLycBHLHQcCBx6xK9/ZBbeEfJBkOC6e+kMvTX0AtFxVOlE1\r\n/dyuKPMAUBVEFvFhRmTepbDtQnFKovDZdnnv8FPM2WCfyEBk5c9onGuBpeCE\r\nk5KUmD7NeIpYaLxCEZSspKPLkWHemGzvk8k=\r\n=tDVe\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"33ff1e71e12298ba7158884edffecc83f0055913","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.20.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.20.0","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.a40e3c768.0","@material/rtl":"15.0.0-canary.a40e3c768.0","@material/base":"15.0.0-canary.a40e3c768.0","@material/theme":"15.0.0-canary.a40e3c768.0","@material/ripple":"15.0.0-canary.a40e3c768.0","@material/animation":"15.0.0-canary.a40e3c768.0","@material/elevation":"15.0.0-canary.a40e3c768.0","@material/typography":"15.0.0-canary.a40e3c768.0","@material/feature-targeting":"15.0.0-canary.a40e3c768.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.a40e3c768.0_1662753844497_0.28994873831715573","host":"s3://npm-registry-packages"}},"15.0.0-canary.18cdc9a00.0":{"name":"@material/slider","version":"15.0.0-canary.18cdc9a00.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.18cdc9a00.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"e3ea060541b1e76c130952ebc2a6b179e58fb28d","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.18cdc9a00.0.tgz","fileCount":37,"integrity":"sha512-OmrBidsOx20QCnGqypgJhjVT8Ujt/qIJYay0Vdw73ygkce9UCgEQNUlZ5mlA5b5n+r8Xxl2tzHClIRqZIntgNQ==","signatures":[{"sig":"MEUCIQDvVkAbhHmVKuKWQ7dKpgn8FY8qrxhS8PrBpDXphiQXwwIgP6NXb1WrmgXL/2uSmHulE3z5XT4HzcPH80wxCJUS0B8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":895228,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjH56JACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoK1A/+KMc9RWn8lYuNzQ/Xmqcg4+Q1yZdmJh5I+X0PNWmsE4ZraLxZ\r\n7zt4+sYymIk+vWh6yIuz+kJft+1AktYxoMoysdz+MxTRU0E51MtKJ/VO/fTl\r\nNExuZc28Roh9msirot+xLRy6x5vhMfaFWoaQx4PderLQK5af/Wdjf2YLm4UX\r\nF6q3auv1rQUbwXr3Y93h5AWLFoh1xBneO475pydpgK86FWFKrFH1pL2dNcR4\r\njlBt8a7eWecuUgTgStPs4npxc1hswCDc1GKU9yNpgxUUB2RJ8903DwtRDtg7\r\nbZNxdR7TbHlnVFdenn10TpPnuwk/RSsYD9wyIhLe+vi5bw11bKCChK497Wyi\r\nj2sDJWIJiA30pD/t3V7OUf5f+EqkO1hyXnUTAGbhKlE0Z38aLZgX6+9zrxk/\r\nHIYk6eOdrBteqjby91RgJG+pFyEJ9vyvsfh5TmH1dm2ncetawMXa7OL3CbNQ\r\nP9PT1Nu+YtD1FPeUeps0Y8zt0OyA4+5EWqk6KSJO58SiuP3n5ZFo6R4v12Mu\r\nhUYXbtquTrMtDldujADSk1I/3hfhoC6519rNJHj3VXbZyCoqEfb6Yg9BiNB9\r\niiLa4fX3bYTbDvsEdyaJMKi7YV8axA4d2yv6uQsO5KdwD31knIhcuIINQmxE\r\nx98UJc3Sldslk2QqLBft7GgO6AdBussGWf4=\r\n=jxcU\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"85b7dc2034fbd68e480826d635d6d061ba62d3ac","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.20.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.20.0","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.18cdc9a00.0","@material/rtl":"15.0.0-canary.18cdc9a00.0","@material/base":"15.0.0-canary.18cdc9a00.0","@material/theme":"15.0.0-canary.18cdc9a00.0","@material/ripple":"15.0.0-canary.18cdc9a00.0","@material/animation":"15.0.0-canary.18cdc9a00.0","@material/elevation":"15.0.0-canary.18cdc9a00.0","@material/typography":"15.0.0-canary.18cdc9a00.0","@material/feature-targeting":"15.0.0-canary.18cdc9a00.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.18cdc9a00.0_1663016585027_0.14071814727338738","host":"s3://npm-registry-packages"}},"15.0.0-canary.7ab3cd3c8.0":{"name":"@material/slider","version":"15.0.0-canary.7ab3cd3c8.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.7ab3cd3c8.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"8a012e803b68454f8f4f4e202afb2ed35c82f06d","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.7ab3cd3c8.0.tgz","fileCount":37,"integrity":"sha512-9xwlDB1P6e29CUxohXY6EbTyuAnMwZHJ7DRMAvIj2bAGnBMneX0GfE0fVp8J2ovPxb7kw91AXSs8QCzVsOjpaw==","signatures":[{"sig":"MEQCIGh54ktS/oSRQwZKGyYqjXJMVlYPmioO9Dj3041Jbns7AiB0P/JkyUU/dkBNKsKerusstEF3uLKDKMEOtDbaSQRRMg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":895228,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjIQaYACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqXKBAAkvRSc6oQYyn4xAtu95k0+E6VQPBfSEuY7pxvZqEeRrGr+eJF\r\ngXNeFRMDcP+kV+oXod/4NdJdjG1rw3jlsUTclpqKk7CB/VhHoEZYrmril9jz\r\n3TPBImdfFFtox6o/SMxutVpPjxGN0O5Q8ngcpBlkKQw/tyF/VPGDPeDJg+Qw\r\nJrjdd6xHdRt8LaSNcQgUJoGQo+jRVI1DyAtutj+Ke/szjsfDJrybCCkGAtrt\r\nkmyT3ZdWJmU+e9bbuA/2R6O3bqMF7yxfODPuaANf9tnmHMeCTRgV5O/EncpX\r\nsjwp+oyHDpFxqWrluYQjOsExOw51AeUnZ18RhE4GXPuAKwJNPGrhpRW69qzS\r\nozkoj1TmME1RenUsfxP8jjcWvye5Rw6u/Aa+y/CoGVZpULhmdOXQDQCTfqWf\r\nhYISvtHdv3R55g3mNKOVb6ED1V/pjcgApyuvK7n5wW6IR7mmJ85zd2aJPIKi\r\njFIIR9naXTZ0Ku1BwBai2Rnk40ptFSN6m6bMPeh+YDIbv+cDDpWrs9Q9VB8T\r\nT0e1X6dMokGVoPZUFydFyIEBu8WPjwSrzMkGHm4+z2r0XZs02b64/hrmkDhr\r\nKMieudpB+STrOTw49wK+pItRdQELbbmA9c79j/0773178XhjHQ8Qxeyti1+c\r\n3WvrJthWlmRSAbUUjkJl/92JvhXIOc8qsd4=\r\n=+OKj\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"5e840f2c9b221706de7ff81194e71da2b68b82f5","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.20.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.20.0","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.7ab3cd3c8.0","@material/rtl":"15.0.0-canary.7ab3cd3c8.0","@material/base":"15.0.0-canary.7ab3cd3c8.0","@material/theme":"15.0.0-canary.7ab3cd3c8.0","@material/ripple":"15.0.0-canary.7ab3cd3c8.0","@material/animation":"15.0.0-canary.7ab3cd3c8.0","@material/elevation":"15.0.0-canary.7ab3cd3c8.0","@material/typography":"15.0.0-canary.7ab3cd3c8.0","@material/feature-targeting":"15.0.0-canary.7ab3cd3c8.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.7ab3cd3c8.0_1663108760126_0.3524188368883985","host":"s3://npm-registry-packages"}},"15.0.0-canary.2860d244d.0":{"name":"@material/slider","version":"15.0.0-canary.2860d244d.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.2860d244d.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"8e945286bb0d2a2ea79f9478188f1d0d976811ad","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.2860d244d.0.tgz","fileCount":37,"integrity":"sha512-OV0PbQzIiNFB3vBGVtMOccyXg727deQyA5c9QSxFRnjV9sJPWwTHoP15Ei8Xhxf1NKsznOiOcYIPbBiJLvAl6g==","signatures":[{"sig":"MEUCICy4A3GHeSFgojysThkTJlCxzQKPUU1YTds336YfCixxAiEAx9bPnVZUeCBac01mpCKSP1jgrKmdfduF8PMQgtNsu5A=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":895228,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjJP7CACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpB9A/9H0Xdmiy+4G8q8+f2y6tCATqTrIrIqdKgIv784EJfzo5noA3r\r\nsrok3pe+pZ7B3jCD/yNRYYExJaqG1vGg0a4oOZpZMpTPRrl71nb8FbwJkH2b\r\ng9IV9XKyGNrGVbbOWBHeqAMKH9oFwr5zk6/5dq/p11zASgATm/ljBR5iFCmf\r\nTsrHp+td5NKos6h6d1vPoJAvb8UES3Wgawirov79ZyZ0aIVqQvmTPNKpVyvj\r\nnvhVidjha26u35ekONQP8DdOTwcS05O78xm7+gnKWqBUCLtFhsy27YqWit7i\r\nF5Zzo9eise1zn1gnk9csdB8+3Q9RNZzXmRs9lvRjl9IX9iuDuKBeVn35TGoD\r\ngmTF9EHYGK+6gAbmzOeREkwz5NEwE7DvTlJizgYwpuQESRjWAVNgDJ0RzvDM\r\nDMWcrjimqW4xalJ5xi3bdIPH/cZ9x3cGhiygtw5vBK6fpj3xlp0l51MxtQMl\r\nL3aGPIaeEHuwdHHkiiBAZUm1l8j0ns8ueZqrTZPSmrtAE2WZiXe5SPs2rnni\r\ncYZwd4EP606t7Hc/JucgaVEfWEq5K93eDTdbLDHkIvuSHnBaMfTo6JoIBRfg\r\nr7wolme3wPU6hrln890fBy6dxkA0S9lou+V+n/IyzGU3/kkfP9p3Os/Ji5a0\r\nHFcoAGpFi4qNJgsMtacJQsYALHYA0FOwRRY=\r\n=gBLi\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"992b4ddc7340e4e4231d1001d68229e8911eeba5","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.20.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.20.0","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.2860d244d.0","@material/rtl":"15.0.0-canary.2860d244d.0","@material/base":"15.0.0-canary.2860d244d.0","@material/theme":"15.0.0-canary.2860d244d.0","@material/ripple":"15.0.0-canary.2860d244d.0","@material/animation":"15.0.0-canary.2860d244d.0","@material/elevation":"15.0.0-canary.2860d244d.0","@material/typography":"15.0.0-canary.2860d244d.0","@material/feature-targeting":"15.0.0-canary.2860d244d.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.2860d244d.0_1663368898352_0.42044113645114023","host":"s3://npm-registry-packages"}},"15.0.0-canary.e8726533c.0":{"name":"@material/slider","version":"15.0.0-canary.e8726533c.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.e8726533c.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"92717470d61194df7dbe2ea514c596b1ee319b81","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.e8726533c.0.tgz","fileCount":37,"integrity":"sha512-BF+9nSpKwOKgM8E9LIZdS5Vt5TaccdP4Hzxa0bFrYjujQVZwWnHLgIArgT/YA5FVoT1zlbFZD0zqTiHPaBNt3Q==","signatures":[{"sig":"MEYCIQDSKxRzDlIB3G5x0XEnQc4BXNFyvAIoK9efJ0LDKbjh6gIhAOx16bBwzUx2we8gAakbRoXbqk3ZADiBVKnqsZaD6+fa","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":895667,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjKh/uACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr4DQ/8DZQZMIL1ozxJ2P1HYrZgVPtAZJrh9+c3n01pQFSq4Xy6pO3C\r\nVg1XLaM6Zy0AJP2bpnB2ac4jtmv9iaAENLt+oSeOTxU/PTOTfdr5uTLm4V08\r\nVC386J1faqo5sTMmYx00q863/3hOLHPeVxZDUlRYvL5uhEJx13/LIHQft1VN\r\nhdql4OYyt8trJJG89/6zjcF0hG+iFJk93USIQuXmEIkycvFqdft9929ZdAr1\r\nM47Z5yOrPtDVbyTw20+3Vi8lmXyf0gR9vbpALf9IK2FT1Cr2qKxc/s7n0Jex\r\nx8yt80RxS+4BCIgw8a+pLd3xpuYB6zCKghYF00ykxLtTzI901BYDOEUNzjwi\r\nsdP+i1wqrOiPUh9slHuEIhVth0mGoBB73JiLEHI6RUiwZkHiWsh27s+CQzEf\r\npUFHLOPpnc4/iGxqj/6oxqyQUrnNG7epcl8QV0Fv7ZFW1hgNRDInilkIsQBQ\r\ny13IvwlVrY8z4wbvn+IFdVE1RxqRREQXOcw7nId02hB5q+w5WkwWZkzmSN10\r\nyV55JbgnyJq4ZcgLVy69ShLyxxLFnSMN9ZNbBDX+6/XNLpnEwiqnPbyXsmDn\r\nqfoYJDRMNGNnzxx7ea3Kupd0mZTKx8W3KwPVKPAEJSPmJKeA9Q+4w35nXkpJ\r\n+EOn0VpSdglF47IpZBht+UZA26XUktmAP7E=\r\n=0vhw\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"b85a9f4d1ad6e30de8175562c0093248848c2598","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.20.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.20.0","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.e8726533c.0","@material/rtl":"15.0.0-canary.e8726533c.0","@material/base":"15.0.0-canary.e8726533c.0","@material/theme":"15.0.0-canary.e8726533c.0","@material/ripple":"15.0.0-canary.e8726533c.0","@material/animation":"15.0.0-canary.e8726533c.0","@material/elevation":"15.0.0-canary.e8726533c.0","@material/typography":"15.0.0-canary.e8726533c.0","@material/feature-targeting":"15.0.0-canary.e8726533c.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.e8726533c.0_1663705070416_0.4636336945140118","host":"s3://npm-registry-packages"}},"15.0.0-canary.00d8de0aa.0":{"name":"@material/slider","version":"15.0.0-canary.00d8de0aa.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.00d8de0aa.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"a9f165f39fa56827275059394503f5597e774911","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.00d8de0aa.0.tgz","fileCount":37,"integrity":"sha512-N3/jx+s6Zk1tzjOi7z4pnyBvH3YDxEo8dBQ+VsIy/gXr1vUbVRoCunsQOA7FDNahvGVJLSL0AMXPIRlcnkco9Q==","signatures":[{"sig":"MEYCIQD0CXBWLL4tk/DAoCP4J+313oXDhl3Zlya38QIlYZRA6gIhAPpUGO5YWyoZOLwmQ/D6jQWYd+Vp+M9U34YOi1Jq6SLW","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":895667,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjKyu6ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrMfQ//QOWKuVI6KYqzXKgJT2i3oSKVcc5sILdTCfAWiSL9+2+wHJKB\r\nFcCssr96ihp0f07hOt2KP6RmnUAAhYFOzdITyrT9u7cvRENEGs5vNmZWemxT\r\nATN9P3tcnC8oP/zdoSEKKYyh5zjFJ3w4Vfz372a98NEw+D2VRjE7BcZ7p5fK\r\n4uwMSaYoG00+kTRdBlRcvrBrseCK5d5w+qyu9NmY/wPLEykfLsuKpP6e8JZ8\r\nkdq1QYFihtk2rh6duG7/OTGxrh6jtQG9T7G06V4unnXrP9PCLMu5wOfIqFzx\r\nHRK4Ae0FW4stCbD7icBLtuDoWSrsWOzEtIYRo1qYj3VDNLOBy47Pldd4+2er\r\nzeHr6KAqAxpFVbDS9CLP4bQkHrd4nHXdZHwPHxDHtgWwgM1eqsJCMvClZJVN\r\n/Tzw/bn1dV4t9ce6KzVgkVp/Vw4SVgSj+FvHHRAmXAzBJaNNt4fBUuOdlqfT\r\nASruuP5Ys6DtmkcqxXFQMymBCTTZMs922VvKaWaavdSXcn/dHPwppygJIuSS\r\ncMmGy7YCkrVKZh+Zk4XusSjmm2jdc3Uld58QbxqtCuVMzS7G8ouAZ9igUGZG\r\ndAOBx99FH7JD4H4CbRf2OQybFtkyhzn+o/wnAf+g3Ag/OuR7wnaqyRRhwx6r\r\nDw6KL+tePDnusmFnZPvF+AJb9gMAmyYwXu0=\r\n=dwhA\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"0be0806991396e042fbbfb14ac3ad622770647cf","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.20.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.20.0","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.00d8de0aa.0","@material/rtl":"15.0.0-canary.00d8de0aa.0","@material/base":"15.0.0-canary.00d8de0aa.0","@material/theme":"15.0.0-canary.00d8de0aa.0","@material/ripple":"15.0.0-canary.00d8de0aa.0","@material/animation":"15.0.0-canary.00d8de0aa.0","@material/elevation":"15.0.0-canary.00d8de0aa.0","@material/typography":"15.0.0-canary.00d8de0aa.0","@material/feature-targeting":"15.0.0-canary.00d8de0aa.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.00d8de0aa.0_1663773625756_0.1931355051758803","host":"s3://npm-registry-packages"}},"15.0.0-canary.271aedc30.0":{"name":"@material/slider","version":"15.0.0-canary.271aedc30.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.271aedc30.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"8b7e95df4f3cf8d569eea1302244e62e82eb2afe","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.271aedc30.0.tgz","fileCount":37,"integrity":"sha512-OqjJ/Jav06v6vP2ROzqY4zCOUMGYVzXUX0eTRnpP5FXJKEaiKLC6AUelP7zWTjKbpoOyW4PfWWayy73zwbwuYQ==","signatures":[{"sig":"MEQCIGq/ccK3i91jDgguuqRy96ByXV8FFe+nsC3V4EDu2ZmhAiBiqKkusiDajs7M+ouFiC+5k4iEqaLnVf6St8mwnbcwSQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":895667,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjKy9mACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrAHhAAhCQl1Q7D+RUkQuqSiOd9Mhg7ZeSn4Cs+F4hngA9ExfwJSkT/\r\nvENPBJHamhv17O/XHje1vhcL/Mr8il4RYRRo/vzd27Oj1moOo4AYVxcASjSx\r\nId8kNeGfjbGZH6+WL4LYY97wiSaLFuEeB1+BktPOQuJryYFgyoEGH4bMwcTw\r\nWTx+/PbFocsCPVKYFBXwHdbERZE2XTqvhdscznww4dGDrFYaiQ0AiEGhWUrY\r\ni1qxkCGv7gR78mkMP6YsFEdMcwkVDCOV5lH2ZBzk6DfvJuXto9R6pbs5igHG\r\nvwwkKMx5RNsGIAzD0AeStEy47Zp3HvY2aMaMnQX3aCQwEPKBZbGhO/bcqK1/\r\nbHeizWkYFWyStXXi6p37zp5SZKxYxheWLHWX70VnX7zGCurr9G8qfAhBZYYR\r\nJFrRQRy8ZdLDEG/4IqASUQKRB1BHMLUXNO6ABIQRuJQT/yVW6ZqvXS8KwAjD\r\nEdEXOLKqJ/ss/ZVxSGLJ+Ef1237t36LVmlmEIv064DoPrxmQUJkcxULwaO7E\r\nRg1YJCNxmUa04xoZeOsDqxO7vh+meMozxUQg3BDyJzwxXrKQLSqhwd7opJSl\r\nVK6fnSSh38qWTp5WmwhHiC9i4QjJvraa8Pw2oEhmqiy9XzqijS8rpmgYDdO5\r\n0+yhZ8zaMVzQ7QSZnB7WGPEYciXJsTxmDXc=\r\n=zem/\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"4972da221d6f097e904fd1a001de647e0e185749","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.20.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.20.0","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.271aedc30.0","@material/rtl":"15.0.0-canary.271aedc30.0","@material/base":"15.0.0-canary.271aedc30.0","@material/theme":"15.0.0-canary.271aedc30.0","@material/ripple":"15.0.0-canary.271aedc30.0","@material/animation":"15.0.0-canary.271aedc30.0","@material/elevation":"15.0.0-canary.271aedc30.0","@material/typography":"15.0.0-canary.271aedc30.0","@material/feature-targeting":"15.0.0-canary.271aedc30.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.271aedc30.0_1663774566491_0.4007116087228235","host":"s3://npm-registry-packages"}},"15.0.0-canary.9f17ff2cb.0":{"name":"@material/slider","version":"15.0.0-canary.9f17ff2cb.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.9f17ff2cb.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"25b65afe0ca5a839a20cf3bdd8d8ab986aeb60bc","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.9f17ff2cb.0.tgz","fileCount":37,"integrity":"sha512-sg2K9+B+NfsUDJlbhVlXn+g25vHd6tsf24H7IgUxP9g2paqK9LXuhjlMrZlPtAklS+7FVHjK93BCNubs47W1Zg==","signatures":[{"sig":"MEUCIQCfR1iL4ukkjdhndav+X3gZ9+QJXPMgByRtWi/YquZy1AIgVR6q29RBQ1zf2OnX/nsuANLvyXTXkVreyG0cn0WkqJU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":895667,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjK1MXACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqE7A/+M7LvqgILxINq2uCLoi9mHtJMWI8EGDzHKoF0G8Q8hCS3H6CB\r\nVKE2dY5VQziS2D7ptIxIQIOifPJO1kLRXurdwxBe1bFbqk1CPrCcWm1BDagk\r\nFr398Z1pjx3dc4CLmDYKYSQkrsUllXRT7MzG9bPpR/7mF+BeRCXsDDL9Dgk3\r\nCns1ngEmPeTt3U2laiSbA4kf+DJbwZiUOiDLDK0lkc79mucm4IaHmRcgo3Kh\r\nWGSDfYFqMZJsCfnSTwP3qKY8YVZ0kbpF5d7yjF3aTpftm9HfAmPI/5DDA/Y3\r\nokyWs3VKtcFERjujwtPJj6rultI+Qqjmm/XFsG/ZFAlTwGcVrj+bqyBsb5ok\r\nlymHQ9UDYkoqjqSCurQH0qoxui4boA3pRQHhbF94nSLvimfrHt343+i7LHaI\r\nQo+WkrcaJu3rpM2fzCy/3pMA06viA+4y9EUAje5T6OfsuMazLNd4tqTlIYSr\r\niOtjqzqN5/y9g7UtQ8Zx6eVkh6yuJpj/TUSAuUZooneS05NLoVqh9mTro0in\r\nBOuy+2wL3VwOFsECIFhoY0B+oQBpvdQAM2hDU052lB7pJnUAdfH/adDTv+Nx\r\nRXJ3bM6vPdDpE3r27BCQlQ+OjcUfrAGSyP+jSqt04Rko4IHQbMgLlPxVR9Tx\r\nPhaMNzybDcMwhk3q5WRRRe5gZ0x8B+hUyLg=\r\n=qO18\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"34e73eebdcebc0a0b475c8b2f9fa0dd4a4c3397e","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.20.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.20.0","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.9f17ff2cb.0","@material/rtl":"15.0.0-canary.9f17ff2cb.0","@material/base":"15.0.0-canary.9f17ff2cb.0","@material/theme":"15.0.0-canary.9f17ff2cb.0","@material/ripple":"15.0.0-canary.9f17ff2cb.0","@material/animation":"15.0.0-canary.9f17ff2cb.0","@material/elevation":"15.0.0-canary.9f17ff2cb.0","@material/typography":"15.0.0-canary.9f17ff2cb.0","@material/feature-targeting":"15.0.0-canary.9f17ff2cb.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.9f17ff2cb.0_1663783702983_0.23927984288160276","host":"s3://npm-registry-packages"}},"15.0.0-canary.d3344c16f.0":{"name":"@material/slider","version":"15.0.0-canary.d3344c16f.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.d3344c16f.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"9ce00662d33cb7a141bebe1d86f26624c15b55b6","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.d3344c16f.0.tgz","fileCount":37,"integrity":"sha512-NRmnE/Xb4JTVhtQnjUqwYtk4po8xz2DClh664c0CryAgdOMTSzQ5onB0q6qCMDrhunqL9G8fGXappmcVtcFnUA==","signatures":[{"sig":"MEUCIEOMaU8+my2bORq3PFR4UU0+xDWB1bqJudbdv0b4nWsXAiEAm4ky5NFVuLoB8vpSg/1bioNs5tMUF0rw/sZzJlu4bBQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":895667,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjLCnQACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqhWA//b8dH494MqXi0x8OM8evGnB17TuQSkHTfEiPy9cyE5jgv6MbI\r\nlVlybLbwwkc/akV+lTRP6AcsfWrXXxdgNzkhxQ+vwv5oenewVTawpzQYXsrB\r\n/8zcvneWru0WDrEP7xqPlkREWIxRj6beplS13UeQGDzMoO9TKTW9Z3nwlNaS\r\nKlIlbHLSx513z3acLmGiwE3L1irA3J/Bh08wZELtF7EqXMNQwsujSOo6+RHO\r\nxgr3R+D4rL2u2wNnZERnloX6sDbCOkkt+gUx+vTY0usxqTSvIDkXEQUVvW5Y\r\nwLpLyUD5V45kmCLNtp9CfIN9kJzkY36ZunwqHaMBK6xLS0cYuQK012kjr4JP\r\nE4OnMJegkkEN1+Q9bDSLCtADCZYKhyK86FrggyTAPQpCEfPrbhX5HiwuoDFd\r\nPt35hmNmf1pR/WQSrk3LH8/gh7lyc8bm6htL/FqqT0T2+iMWebt32qfpQz/G\r\nXweEkk6JNAQ4mjLctnSEbG6aftwV14EpWk6RgwHw/0Fc2KkxqEvb/70bCzWv\r\nHNcIiLUkP02PnWpViH8Jl+w0/+PhJ3yOPgIDCUIJX3HSQOIP9bsqA3/sMBDb\r\nZ2YR5TOxm5d3Xp8aZz2WFuIfNUywpGO0hDTZfBW/hcWeoJhx1sKrzgNVa4FS\r\nvcSZnI+sZIIqBtZjN8w6sWNoRWX6w69zimU=\r\n=ue0g\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"e0a8dfcab6df46c9fcc9969a6dba1f4fe48e028c","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.20.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.20.0","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.d3344c16f.0","@material/rtl":"15.0.0-canary.d3344c16f.0","@material/base":"15.0.0-canary.d3344c16f.0","@material/theme":"15.0.0-canary.d3344c16f.0","@material/ripple":"15.0.0-canary.d3344c16f.0","@material/animation":"15.0.0-canary.d3344c16f.0","@material/elevation":"15.0.0-canary.d3344c16f.0","@material/typography":"15.0.0-canary.d3344c16f.0","@material/feature-targeting":"15.0.0-canary.d3344c16f.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.d3344c16f.0_1663838672004_0.1146248885841179","host":"s3://npm-registry-packages"}},"15.0.0-canary.94f20ccb8.0":{"name":"@material/slider","version":"15.0.0-canary.94f20ccb8.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.94f20ccb8.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"179d2103839510400198925bb4b4f3b45cbf02bf","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.94f20ccb8.0.tgz","fileCount":37,"integrity":"sha512-hln9hZ4db2OndQBFObrA5JU4G5JUVJ9NtLLw+/sakk1M5fpZhNopFTjyAz17a5p/phzS7TnpY/vcY/KaHf92HA==","signatures":[{"sig":"MEUCIQDrmeAKYpvN3h/TWtDZHEHP/fO+6lFP21aAxwnloLf2OQIgGqFiTtXDsXc5qJh7G5hFZXRDmnQfnbas8+n0+8H1zEY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":895667,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjLMn3ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpGZg/9Evf9kEblcU3VDYniLqpjIZKXPkxcUxc6kP+74HbrpirhKWM5\r\nSbOdUzb/UhpHsRpf9IULO9M/3JVl1m/TC9MbA2opwmjnNverAR+H/d4NYH1+\r\nCLRqLHbCh33yAsDoTZFUscZJgf7ztiIPsbPcgBRXqV75uqioiR0FjcmCnGsA\r\nvPiR2mIEQVQ4H0XkcqF1S9W8++9jxc47aCxs0L9MLuFa5WBiM7zHjvH053WS\r\nsDbpSVy05JToqwe5tGjoSuz2XZVuLZXZJibAfsgTK7InHicofZ5MAM6qLlDs\r\nLuBXZmc5O1YUiIfrqdxs5eobMmpJnRJIV+CTrNQZpzS/f95TWo8MlG3AoiYD\r\nRxuH6v6nFnr2jJ9dFm6S5syXQmYDZUXnmYyqjp+ejYtNezJiC6E+bvBSJfAN\r\nN/ZawQFr5KdV9LOZ7yY1NlMgnhGU74+xT1E5rVRVGYaaUEZ7HGKbpES/8C5e\r\nUZMK01Oe4adtwQY9KEUeKSR5S+sUYT2hzHIgCclDxM/p6KrqgNSVpcV1H4Pq\r\nFd5C9ULNejJtubBUs4gY/HbSsTjHH0VZWfF4wpMuRGpI3hNhjPdy1Te5RjGX\r\nyrFsSmqSXVyDQy+ESsWBurkkJQtgzqtrNhj21R3XithiHgmvZCvhSD6G6gIE\r\ns0zKys/4w/YHUjgQhaXNfCNLsCPbfCRF4oA=\r\n=KNE+\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"16225f613437ecef2ed2d760a08046953ecd51ff","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.20.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.20.0","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.94f20ccb8.0","@material/rtl":"15.0.0-canary.94f20ccb8.0","@material/base":"15.0.0-canary.94f20ccb8.0","@material/theme":"15.0.0-canary.94f20ccb8.0","@material/ripple":"15.0.0-canary.94f20ccb8.0","@material/animation":"15.0.0-canary.94f20ccb8.0","@material/elevation":"15.0.0-canary.94f20ccb8.0","@material/typography":"15.0.0-canary.94f20ccb8.0","@material/feature-targeting":"15.0.0-canary.94f20ccb8.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.94f20ccb8.0_1663879670825_0.3782315036646655","host":"s3://npm-registry-packages"}},"15.0.0-canary.81e4cb7b2.0":{"name":"@material/slider","version":"15.0.0-canary.81e4cb7b2.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.81e4cb7b2.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"325980baa61ac6b593a9e4e5e6a18d95117833c0","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.81e4cb7b2.0.tgz","fileCount":37,"integrity":"sha512-GoIxQDgdv9ILOWZp/rrRTyA4zR1gQWKh/sE/KZJTxgWGBJ8VeCR8oIQFkWl52ZxjWVGFa44v+QBiemSOjeNdBg==","signatures":[{"sig":"MEUCIQCAouTSWpt3OFXp39iefXlGo1oTGc+PIhRItq0IVPGAngIgWx+oPdDN1ksG/mbH04d7/4gdRi2K7YZJBaPVsgj1Xgo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":893780,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjLcwQACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqCXQ/8DYYEw/RiE4vOLXFACTzTgSeVPY7yhmP6e8oIfTlP6TJtElBK\r\nEbHJiUqxNkHzyxCprgKZHYeavVD5f2wwvB+5qkoaLz5gQ10figu6XecBeass\r\nIl+woTjiWEKw3foBG81OFns/W+sTWGJY6Bn94TTaMxzVVoq7sQYLcamoqWTc\r\nN6kUGzoe4/kaJyIesRafA6olsYVpiRK4xFs22QC7lY8GzCOgOgh59kwUANgL\r\nywZ6/hk8FwAy+ZJ2MGUygzS4ynTkwujsco4OIVK5qebdOoDOKAxnAzvtNbg2\r\nS91DGT2FCp/WyntnRmjHa3CU//U1c0ubX4UxBWZZNDyagnqstDmgnNno46Ni\r\nDvQXeKq3ucBvsH8lqJqb1mPObcLdrdNPSbGOATlm41htG7bZJfGB7EKCpz/o\r\naLcNi4UDeFnb9EB027VYRskNfarqTWSyKNyrYyJzPnwVghpgBYqnpQwEuJQ3\r\naWfmbE11fx6LulHyB+BXjperk6zdYZmKalBCA1lRgGxd+7NephXdkVnPWh/x\r\nuXHI/xpGNYbJ/OazX6rOhMKxb94PoG/IlOobjfH02Cg3ZSqCvLyJR1y4Nkhn\r\ncFZ8itMQCVaNUp65QKwtugHY8blvrxdE5aEUtryfhvZVK+RvAdreiBosQ1pb\r\niKxu4vBG9knaB+25FB4zOXfPocWtIFH4/S8=\r\n=G9Zc\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"63fefc99b30106d8aae83dccf8e6e8073043a3fc","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.20.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.20.0","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.81e4cb7b2.0","@material/rtl":"15.0.0-canary.81e4cb7b2.0","@material/base":"15.0.0-canary.81e4cb7b2.0","@material/theme":"15.0.0-canary.81e4cb7b2.0","@material/ripple":"15.0.0-canary.81e4cb7b2.0","@material/tokens":"15.0.0-canary.81e4cb7b2.0","@material/animation":"15.0.0-canary.81e4cb7b2.0","@material/elevation":"15.0.0-canary.81e4cb7b2.0","@material/typography":"15.0.0-canary.81e4cb7b2.0","@material/feature-targeting":"15.0.0-canary.81e4cb7b2.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.81e4cb7b2.0_1663945744169_0.5392104615597131","host":"s3://npm-registry-packages"}},"15.0.0-canary.aa85f9413.0":{"name":"@material/slider","version":"15.0.0-canary.aa85f9413.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.aa85f9413.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"c2befc9b16524183438f1609e921c88f0460e3bf","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.aa85f9413.0.tgz","fileCount":37,"integrity":"sha512-zJo0h7ea83uEOpupJiSyw8y9LyD3tTNZkYYsYurzyb5zhJHHmvOD63TbodHRFYDKrzluuSK27LDil/iMhbAQ3w==","signatures":[{"sig":"MEUCIQCz6xD5Dxir+0JZNcBTfuBRnzFJX5O7zjr8LAhHSbcMcgIgFgg1swseet/47XO0h2qrPugNBqyAb3TQeMa/lty+0Yg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":893780,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjMef+ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpdMQ//c2/SKJku56A8uO66YVS4J8a36tLqeibUqdJFzKSUbR88bcSB\r\nuI0XlxshuoiSsO9t1Z+8CWbhOJwf5V4Y350RtK1sUoV3Bd4garcg67S2VbBn\r\n+DAYskqJ7n8NibG/H0mc6+vyl6O3tDu+c3lRWTVlLf6lQT4Jzda3hWUKR68N\r\nIlgZPkBzFNG+dM0sXcO7nnZDFMv9DBU2uJm1MUC9WnCzy6MuGGtm17TxvG9a\r\nKBjOnkD6CiYK9AS10JAKyomYhESScWT7Hq+I+mOrc9sO4tq5D13BXlfumdv6\r\njCp9CGwRDmM3n43766jAff01ZgojLmk4wdGt/Zre54VPER7Ffcb3DoW43+UX\r\nZ9SVoDzcJUO7OLqMTYdX2uhL6igcJ30CD7RdZFfXcK7RDvAVeR/TIEpxAYmo\r\nNOIvSpaPXTcGHaha1rUUqn70HUUZ0S5oZoWCBmlTBBQhwY+5sFK5Ex+7WSeK\r\nXEVE4rSp5Hwtt6/NSt1sNsOwR1yNBJqdKLKKnSBcIxiD6jX47Jxzzp01s9AL\r\nTDB/9OwXltPgltonXWmdUYm2BXR2D4fKKHq/mjnLBeUibTXZ3vy/9SO+r//m\r\nadnDHrUhhQ6DMHqWt5/MBT2RNKTlpN0EPvBq3iTGQsHk9QsgqRLmOu5rxATK\r\nWaJzA2vQY5rQWANAmeL+wPowHhEC8o499/g=\r\n=/pPg\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"73f7402d0fd839f22c2c3bca08292a66389f5829","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.20.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.20.0","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.aa85f9413.0","@material/rtl":"15.0.0-canary.aa85f9413.0","@material/base":"15.0.0-canary.aa85f9413.0","@material/theme":"15.0.0-canary.aa85f9413.0","@material/ripple":"15.0.0-canary.aa85f9413.0","@material/tokens":"15.0.0-canary.aa85f9413.0","@material/animation":"15.0.0-canary.aa85f9413.0","@material/elevation":"15.0.0-canary.aa85f9413.0","@material/typography":"15.0.0-canary.aa85f9413.0","@material/feature-targeting":"15.0.0-canary.aa85f9413.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.aa85f9413.0_1664215038237_0.4678120589054169","host":"s3://npm-registry-packages"}},"15.0.0-canary.7134a7752.0":{"name":"@material/slider","version":"15.0.0-canary.7134a7752.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.7134a7752.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"eacfbddf8aa25646d09b741eaa565cc2b71da04f","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.7134a7752.0.tgz","fileCount":37,"integrity":"sha512-rVyiUB+vZbJSi4uto/FPMRIjmqgxmcUjzGBRmDnB9Zc3SUv54/HIfgESqlp9I2di9aFYhlGzKpvO2+snDxEmuA==","signatures":[{"sig":"MEQCIEtJxzpoGZM327SojXG9SyUDNbRM9Flrm3arEKxx17wUAiBej/3iRPszyKOTVhiQoMi2DYquAMPYuBMqU8eiX0ib4A==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":893780,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjMiCGACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmo+fg//dEAMxgJW0CL6M+TW0WIJauqma/0NoZjFSrrHg//ibgVRvXUc\r\nHLVngb/UHSQGamOicqLkX0UWcOOLfdXDCvhc75LoJzzM1i+VCfO+tpBK/KDt\r\nSoogVpSeBzh3riuc0Ef3nkSdMk/aGKTyPzTdqNE55Nag4l6mloFgRr/m+9wa\r\nJV1x6GGw/GvKtjr0wyQGaQIEAl7NmM2C1fe3oyuuyEIWgtxf0lBgd9kSlX5r\r\n5bQnYt/iATCmorGQBTkDNVl3/hKJc+fj6ifl1OTHl8IQlBxJ/wiRSRuXTt1M\r\nYd6DOGKaIUB1xLjvMyM6bNMMmf08Ff3XjsENR83G+9JQGhczgYnd3Ar6kuVC\r\nKpje4F53KDlbHUHw/9cPqAsHyaG2CttAKylpXG3QtFjy1KWuJv4DOJoHL9V3\r\nk3QRT0qBn+Nj3DAu3a8W6nB7FGyaHpOmi3YEQPkdF2eHzWYKnbe9a8pqIFGw\r\nb843EkBQBR8AkXoNUEc/pshZDQhuBEU1/8IJ1yBWppaOgqqXHOeI4g97YBGF\r\ncBBRrvgxfYuwWeDTV77imSnhmb5eS4aBYkMGMvAwfrVBUMzy8Os69vslmpUL\r\n5mrRFiT7LPeIaFjM3+xt6x4VkhzSQj8hyxgw94dAYdnWJyG2tePKNzsVQyAr\r\nJE8xNTUGaSZB/ga283j0KIE8YNQfYgxYi48=\r\n=zVOh\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"31aaa09805eea1ad3a30e7b91a8bf8ee8911e80e","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.20.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.20.0","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.7134a7752.0","@material/rtl":"15.0.0-canary.7134a7752.0","@material/base":"15.0.0-canary.7134a7752.0","@material/theme":"15.0.0-canary.7134a7752.0","@material/ripple":"15.0.0-canary.7134a7752.0","@material/tokens":"15.0.0-canary.7134a7752.0","@material/animation":"15.0.0-canary.7134a7752.0","@material/elevation":"15.0.0-canary.7134a7752.0","@material/typography":"15.0.0-canary.7134a7752.0","@material/feature-targeting":"15.0.0-canary.7134a7752.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.7134a7752.0_1664229510074_0.015808358395257738","host":"s3://npm-registry-packages"}},"15.0.0-canary.70b8ac16e.0":{"name":"@material/slider","version":"15.0.0-canary.70b8ac16e.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.70b8ac16e.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"f307e21aed7131ef177e0c3d11c4fe591b2d7d4d","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.70b8ac16e.0.tgz","fileCount":37,"integrity":"sha512-U9hi7MfZTUZ/M11589pK2du8Xd1DqVeeR+zf1PJ3k1fNedz9tmhXF88q0TJMXBg4Yvb+o8Gv+dyOgvcOVzOrLQ==","signatures":[{"sig":"MEYCIQCgEgyGVp7Fx4JJKFrgiuODLTki8kUDXxpFQ024De30JwIhAP2sG3/fRmBnzMLSaq0wSenL92tOBjhhxOLXtu/g/4ne","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":893780,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjM30WACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmroUhAApL5TFi/zzXdAhOxq2v/LWcE9ojWKN9WlQYAi/vahyY/7zfp+\r\ncCLpPu/MfWr+AxLQLueunNwHVoX7ssXmVULAJeVVS2/7lRPOiHuKKVMZnDaI\r\niG2mkoO2UNYrnPF7oOXzzfvfq3fMVhMjAn2JI3HPM78puqxF6itO5dgJQlN5\r\nNVE3sMp43SB5yHhkePRhEShyyeqFlfK9elCTpl5EqP+j3MVaMtDEmoIGWbSN\r\nwoOT7N1CJ9ZbzLrwFS9t5EGh8kneer4CJ/EXqDZdNKwvkB9pAsZ81uSapcHi\r\nLEbVVH1l0K11BRfHCPLSOaAqvMl1YP7f9+E3YmehmkMyg99wdyx6yHKTaaru\r\n/ny2lriR37t5Uu/K6p7B+r4J6Ue8CuvB+D93io7YooG/r+XKiugZZ0yq5KpZ\r\n49yPvWzB4T+OPsn8Vq+p0LycuPMIaIRtfL3bBP6JtfKgkgVbkph5m040N2bg\r\nE+9aHtmgtap4mdlo+ucAiPrCJwgVLVUfSkR8rEFkcrpVYEpW2dZ+c+keesOy\r\nPMLwjXly8XDKdldPXjiB8IIbKnUAMfDXd3H+IhpEharp81EBJ7iEbrEh2pE1\r\n0Qgz2MR3NcP4EkzPXrkgLrrThylds4BbIiHQJSoZ/16YTT5nYNsWfKA/cPp3\r\ngTe8P8php1y4OXbVm8neVE9U02UEy3GK+ss=\r\n=6zVi\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"9f9fb4c3a4123798d2b993ab287cc4bb7e8d7014","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.20.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.20.0","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.70b8ac16e.0","@material/rtl":"15.0.0-canary.70b8ac16e.0","@material/base":"15.0.0-canary.70b8ac16e.0","@material/theme":"15.0.0-canary.70b8ac16e.0","@material/ripple":"15.0.0-canary.70b8ac16e.0","@material/tokens":"15.0.0-canary.70b8ac16e.0","@material/animation":"15.0.0-canary.70b8ac16e.0","@material/elevation":"15.0.0-canary.70b8ac16e.0","@material/typography":"15.0.0-canary.70b8ac16e.0","@material/feature-targeting":"15.0.0-canary.70b8ac16e.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.70b8ac16e.0_1664318742299_0.16244467122058137","host":"s3://npm-registry-packages"}},"15.0.0-canary.c20d74405.0":{"name":"@material/slider","version":"15.0.0-canary.c20d74405.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.c20d74405.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"0c361488f71dbf082aebac1558af3644a8f475c0","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.c20d74405.0.tgz","fileCount":37,"integrity":"sha512-GliOwhHwwY7W8Lxykuj1hsZ+kZ2Y86kD1ALRoqiN4I9QvfLVfbI3jKQ/9F3ReSWGesRsZqj5upDKZFxACbRrcQ==","signatures":[{"sig":"MEYCIQDmHcJXbwRBhsJnMv09mWYtSiqxpAoD+aGPHn0D2zVRTQIhAKjRUyByn8m87gykr00tq74bho5GDgPZt9gx06nlZjpr","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":893780,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjM4fzACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqMbw//fNwsQ6BUi558I0wmmGi5po7JNVPt4573evzHeDgRivkDo27g\r\nnzslhORmgV3cK/QBsBNoGKZKXg5y5CMK0JI6YMIYbkiYcJUbbdO2Nh18UZfg\r\ni35sJS92+URPFpghgk7Di9wNqokh5LhoQgw3ZBLwuJ/yEPEtUkYucsZxeRYc\r\nE2Iox/57s7qTvuUIL/4AArStXyj1NMc4MCI1Wmp7W0bpYKgHGsV/hQtGPh7K\r\ndpNvQZQa6ovHIqDlmoAtowJLNrW+jH9Qxk17pRy7Z+m3A+zuX5nfBU8EOD7r\r\nF8XHgZBiDv6GIsx2qxRD/TL7572F++RVLmgJJcnNJVwzSJaIa/DX77QQca2d\r\nvstWfvmqupUQcp5gaIL8SNS2VjrDHxY8wb3iQasBc048t67d8KXbzAakuGp8\r\n+1C+uEBEAXqplT8lbkbq1q+sCsWeFtfZYLD8VJDeFpB0cratrrqdqy98cDjv\r\nhdQL4DE7vZVGT4C4eTP8AWo6BaMgzN0DeB9wiGqZlMDVIMV9jYhqMXCDXjw/\r\nFOLHKLmx80oBxDp+1sc+1ajlY1v3jJEOIjVl+7xrpDGucwJG/ANjJzi166iK\r\nLJUUfYYv4mQtPbV60QsnXCfI0uOnEITdgLbPg6hFsdiibUiULRi0oXCKORq9\r\nhjogGt2Sjla+t40W6FYRxfaBjmTPEHSgxa8=\r\n=Vi+q\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"7e1c6f9d7e3c90438265d23d710997462d087d78","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.20.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.20.0","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.c20d74405.0","@material/rtl":"15.0.0-canary.c20d74405.0","@material/base":"15.0.0-canary.c20d74405.0","@material/theme":"15.0.0-canary.c20d74405.0","@material/ripple":"15.0.0-canary.c20d74405.0","@material/tokens":"15.0.0-canary.c20d74405.0","@material/animation":"15.0.0-canary.c20d74405.0","@material/elevation":"15.0.0-canary.c20d74405.0","@material/typography":"15.0.0-canary.c20d74405.0","@material/feature-targeting":"15.0.0-canary.c20d74405.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.c20d74405.0_1664321523537_0.5710440894605526","host":"s3://npm-registry-packages"}},"15.0.0-canary.f033fc8d1.0":{"name":"@material/slider","version":"15.0.0-canary.f033fc8d1.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.f033fc8d1.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"2b23a3013dcc0afe407ca5bcbccb2ed1a8672e3a","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.f033fc8d1.0.tgz","fileCount":37,"integrity":"sha512-5ZzFsecJo4dOMXScI71VA7Fhvv8booCeOpeO555xE4FIbjuATACVcMTdezcs4VLp8uzocENa7Hxftwc9torsQg==","signatures":[{"sig":"MEQCIGFMj+akWgu0xUtWG7mRZqRqQQ/NKsWriPNitH+ln7wsAiB52qU/wev/5jsOiaErPudrdngRmWUqqPlX9LRoBd83Kw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":893780,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjM44TACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrIWQ/9Fws/GHdRTa3I+4gFKabwWgV/7GFS2QqHqujSTBK3IjuxPhy4\r\nCe2RRbThaAeG9D/+zSufTwspDtg9va65TtvzZhkkvV73mcOfkutLGwouNJu+\r\noeGNQcnq32MAffV0K0zcGPVov9G+2lk3C3cD0YyEOYOYvHrreVaB2vP5CwC9\r\nHD1VIC/qCxV+30bSHF+GwdcoKwbIr3BdsKzPkh5tEiM+EngoCPURBPIMWlw0\r\nALiviFiXwLSA615RbiXpFog9cCGDTZXkDkAaMWiBObdhvdzLsMHNuS6pQSGq\r\nykp8RwtL/5deYQFO2XEk2Tri2+qVCTN3nSzMptI9+8U+xS//atDhhUyYdrls\r\nL7CdkyKdPT7Rc9vxkEn1pKjD4Fea/Yw5/POfsg3I/+3/qbFKI3pHpgyqC4UI\r\nrj/vxd7DBdrNM++N20whCu9B9Cw6b9QkacS5T/zv0sRA5LndrtwJVHcnf2ir\r\nSI/zWynG+y6IR1OLzxDQ1kEzWRRuH+Q5f0UoXpuciYprdQfMvs9Qdc/iyuxT\r\ntBiqh9/ErxPwdI4ejke06CXKxW2+d5RZN2TarLXgt2xhtUJmXdT4XtxuJd4X\r\nL1n8IwYqXY9ETs0gBinM3pLet/d9mtqxLfA6kYFf305WVydj52RHLIcr4JA3\r\nAczEMVvZsYoNAZVo/luyuoe4wOgUJEwXu2A=\r\n=kD3i\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"a658683d647364520f9de8a2d51f15913b5ffb78","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.20.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.20.0","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.f033fc8d1.0","@material/rtl":"15.0.0-canary.f033fc8d1.0","@material/base":"15.0.0-canary.f033fc8d1.0","@material/theme":"15.0.0-canary.f033fc8d1.0","@material/ripple":"15.0.0-canary.f033fc8d1.0","@material/tokens":"15.0.0-canary.f033fc8d1.0","@material/animation":"15.0.0-canary.f033fc8d1.0","@material/elevation":"15.0.0-canary.f033fc8d1.0","@material/typography":"15.0.0-canary.f033fc8d1.0","@material/feature-targeting":"15.0.0-canary.f033fc8d1.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.f033fc8d1.0_1664323091543_0.06515856924702601","host":"s3://npm-registry-packages"}},"15.0.0-canary.8d7ae912a.0":{"name":"@material/slider","version":"15.0.0-canary.8d7ae912a.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.8d7ae912a.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"8a0a6a3cf03f126fe81f183c8c5e3e468bd78d14","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.8d7ae912a.0.tgz","fileCount":37,"integrity":"sha512-wAuVFPff2PAchIiQREMpWGqlJFEqpd991uHfiuTQ1mIzCXQE+1pDHg+yWwGCaBiywSFtNHBXAH4aj1rcA4bbwQ==","signatures":[{"sig":"MEUCIEDvL5lKaovhNupyMogms/HoBkooc0ISlEsmg9Cjl1gkAiEAhAL8VoNcqyLlvj5CfLdB3wtZKxSWMIxKVA0KGCqTPGE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":893481,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjM/5GACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpqVA/9FU0A4DrHp970uLObFYjU8o5U1IZ0Va1LgTRufJ7u5/nQb7P9\r\naFw8r0UbcEM0jTE71P/mthAfoS5u2Qpj7jHKTcAiHKNt30SqWkkmZK2AIQKp\r\n5+zWjzozak0EYhHDtGDfXIqHjonHtDWx7SaRMPnYtSwm9eSntfBZ79T3wqbd\r\n0qDs6RcZneC7yX07yOeArdZenezxqeqZhwAzJ+vxXljLD851ThiRSE/kmTQP\r\nKDbyz2T+QifW3D9oAGAZfGhEFvyL7fDYAzh5L1MIhka+ltQ9f08kvXfIPz9j\r\nZpXMgDsSr+ls9+9jX/FGmpqImbTdcWNbQMZYVb13BU/8Buc9Jb4fcfHaUH1W\r\ngh01bYH3HXpDmgQveZYI3ZU/8GXSl0Pgus6cvrosyTi6lMgq6UmSttIBjF7N\r\n/NgE/pjmT43eavnCFbqeGLVfeWT8DjlCyAgA41Ja3A3oT53JtLs+bBV1B2xn\r\n9jKNlu4ugzXMuL/IdTSQOllpuE1HrlAbtmP5Jt2e9Ww8zJT+UpBOvGfh7Q2J\r\nMy8PvH7RtJwsFM6dCvo7eoIDM3mfPtxIK1ap0Ch4m+f2XNcCao0L3aFtmUzy\r\nMkkexbs6MjVL6/fzjgmQMr7sGFVM+M6Fs2m97k2pzqz1zhHU3ZOg1ycFWfMp\r\n5APpKF7lHNjvAEHqJKn6wyKt/DzONO09TiI=\r\n=kuA5\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"26b2ab57ab7cb3eeceab31102ed1b6cb133f4cc7","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.20.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.20.0","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.8d7ae912a.0","@material/rtl":"15.0.0-canary.8d7ae912a.0","@material/base":"15.0.0-canary.8d7ae912a.0","@material/theme":"15.0.0-canary.8d7ae912a.0","@material/ripple":"15.0.0-canary.8d7ae912a.0","@material/tokens":"15.0.0-canary.8d7ae912a.0","@material/animation":"15.0.0-canary.8d7ae912a.0","@material/elevation":"15.0.0-canary.8d7ae912a.0","@material/typography":"15.0.0-canary.8d7ae912a.0","@material/feature-targeting":"15.0.0-canary.8d7ae912a.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.8d7ae912a.0_1664351814093_0.6123641307222152","host":"s3://npm-registry-packages"}},"15.0.0-canary.db414b864.0":{"name":"@material/slider","version":"15.0.0-canary.db414b864.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.db414b864.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"543d98115d72059b489ce1af6d0c6183d0fd751c","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.db414b864.0.tgz","fileCount":37,"integrity":"sha512-RGL2GljQq7H0g+eNGMSV3XElqLexoFjblJwMkPVJFk9UTKQyz3r42VlO01BkFZg5DxlTg/Uu5HBDTbyQgplOTA==","signatures":[{"sig":"MEYCIQCijiI/JbqsKkdZBAxOgoxlOX7kH+W7n72QjeTu3/vctwIhAMGm0EfC5GnPDkYE/2KJoGbwbfgrkdbSgFUBJHWXtFXW","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":893672,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjNF/uACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq53Q/+M/tWh6taTvwZaqdk9hhNk9pwEAm9Yfe1QX1cwXNJxjy7ZuxG\r\nnJFo27n/721jvauXBEP0Fxaw93xqrj1OIGpjh7ZA7qujm0nVro11XCSvUk7Z\r\ncr5QQk9NR80v9uCVWkm3T2r0t8deZMTQmHrK0RY/L3l1pSrm/imEZs5ZM1+d\r\nzdXs6IL6CU0QgR4Wb1w3IAIoDGWQYDwKOKcVgrxBVLrl9raaozLcSqAdAqkW\r\nwgrt1IN9jFxjovM0dPQQGR7YsykJeE+lkXxESE8hVrDkYVFdjLsYYYrdkwKl\r\n8tEaZymiZxPTm5LjrlLaJcoGDVUgjDPuSTn/RXQvoAvwf1vuM5f8XDakoFUp\r\nssixbg/vA4gS4gHnfR+i3S73uD6/mrJDK7OXanUGvOXFj6A9f42IxNHt141z\r\nVF6wpItYoAKh6pC4FxzvYF7Lz2I2an9O6fkW2hmR+63o9ly+GdM2iSp+v3DB\r\nBF3cSNNJ3F2s0a1M14O/1p1DrhklsHnb6RKp/4tH2FO4Mw4Dksm3y+uGzsWM\r\nOe3jsZvu0vXGEfrEKYxZgIWHAdzl/EE4m2P1ELugUWNOQK3fuW36bJFvzTTk\r\n9UWV4rarfirw8U55H3QuSQXCHVu2b/xEzDBkH/UfqC2JJk35f40UnTST/Lb0\r\nBGMK2FXMqPtdBXXNetRu7xldtyCYwqWRf0Q=\r\n=g4dH\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"7601f089a2e7599728805effc4e9bdee40008aa0","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.20.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.20.0","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.db414b864.0","@material/rtl":"15.0.0-canary.db414b864.0","@material/base":"15.0.0-canary.db414b864.0","@material/theme":"15.0.0-canary.db414b864.0","@material/ripple":"15.0.0-canary.db414b864.0","@material/tokens":"15.0.0-canary.db414b864.0","@material/animation":"15.0.0-canary.db414b864.0","@material/elevation":"15.0.0-canary.db414b864.0","@material/typography":"15.0.0-canary.db414b864.0","@material/feature-targeting":"15.0.0-canary.db414b864.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.db414b864.0_1664376814140_0.48680714006933634","host":"s3://npm-registry-packages"}},"15.0.0-canary.28cc6791f.0":{"name":"@material/slider","version":"15.0.0-canary.28cc6791f.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.28cc6791f.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"43c583a0c527d93c15a48b518c15763ae604c908","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.28cc6791f.0.tgz","fileCount":37,"integrity":"sha512-7mcdXOaw6ZwyjqrAwSuBg1N9klVEzXc/LJAy3FxV0Hu8fZKpT2xjPeuoli7Tl+WJtDdDolcWzi/C8pLowSJ7cQ==","signatures":[{"sig":"MEUCIQDaLFn5NkPlZCPCuNuv9BaySP3po4bhz10COl9BG/ayQQIgZ5Ci7rygflVnXu0tHo4wGk9osExmBO1XHMmZxsIjqa8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":893672,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjNI19ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrC3w/9HjODhCmuSUT3pUA+npW9bGwwxk9MlLPJvAsxXsiMOLgczTw1\r\nHNbfVLiuVy7CJ2pGXN6YFuTob+wW1JRM71PIGHR/F5IshLrT+7VX4IEKl3PV\r\na5OOarmqHvVf1DbQzHINZj9/P5GFFLVbI3BFb8J5+j8AEAKAYwk4Eq6tjhC7\r\nJAcUNYFgSCo70tbbDChUG1kqaUte8D5E5nGXmP9a+OrPFhUcAQJ+7t0yHWng\r\nN4574DwWccdfJG4AH917YQ2EirzmN1FUCitb8L7eQxsZnopnt12u1PV9Ylp0\r\nYQ+L3fBp1bCeWamjiAdfsGdKIdazk2BSe8XMmRRLwQysq7ImbzzN71Q3wUG8\r\n3BZQslHUGuGC0dtgwaryPUUgOlwg3HKy3Hh4QZeIs/6vKyCran4P8gEhnLJ3\r\nqLC8ojmJpzxeNpTZCHoh7ddRtvuf8bTK87Vfknqd13gdKQ8457EgAqudl2a2\r\nfMgDFKqqLOHdtv0tGjuJdqYg7v0Q3fgww+Q0VrBVbVgetPf+qZlvf51UdHOx\r\nBh/06qnhExFFyWW7sexVRq0vl0G2TKN0HN8ryus9WiVQ0nIf5/+CQs4nFDEe\r\nRegFr0CbGDYuyF65naMxTMBO5lLJgY1Bw1uxGaA9uk3NnRF0p9JShLrqSXjo\r\nRMtx+kWfJfrKsuqUzmmLB1IoooLc5XSBu9g=\r\n=iibx\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"d2dfa219437727922f4cce877090f9afdd87edc3","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.20.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.20.0","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.28cc6791f.0","@material/rtl":"15.0.0-canary.28cc6791f.0","@material/base":"15.0.0-canary.28cc6791f.0","@material/theme":"15.0.0-canary.28cc6791f.0","@material/ripple":"15.0.0-canary.28cc6791f.0","@material/tokens":"15.0.0-canary.28cc6791f.0","@material/animation":"15.0.0-canary.28cc6791f.0","@material/elevation":"15.0.0-canary.28cc6791f.0","@material/typography":"15.0.0-canary.28cc6791f.0","@material/feature-targeting":"15.0.0-canary.28cc6791f.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.28cc6791f.0_1664388477301_0.9046228215484875","host":"s3://npm-registry-packages"}},"15.0.0-canary.a515a2d18.0":{"name":"@material/slider","version":"15.0.0-canary.a515a2d18.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.a515a2d18.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"47607be1c8e982ecdb02df9c94df002d0dfda2a0","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.a515a2d18.0.tgz","fileCount":37,"integrity":"sha512-GyhiE98Kw9G1ZzU3FFqEpiboqOweLeaj1w+clDsg+3/UJOw3sv4jooIygD4GMILpx1jB3VwKH9e1a+gZRbWcLA==","signatures":[{"sig":"MEUCIQCksW77twctrVpoUEfE5u88nW8MHu7QJSI5Qakoeh2nkwIgLWV5pPmToPE67HcQzxGpdbYq0uTl5QrYREx8sKs6W10=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":893672,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjNJjlACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmp8YRAAh0VYCCY+w88PHUVv6zo4B7RUHQqB3ZOO+1EvdmPq1X+HJxfo\r\nj1t2gSTiptJypfGB5WzpjwnJ0oK5WbrbzmVfCHYXJNaKN/rgLe8CHltKaAdX\r\nK2hLgFF0RjwcLQ3uf1thhrODlgpRu43kAS4MrmK50lrVI7/ovvlC+iyDmq2g\r\nCqhd3T8pLMVgFDU7d+xTp3kqhLj/hCsm9eDrMuIVWl2Idru4syZk3P/xUf0B\r\nXzE5TtrgyQyqxhgCrKSetEFrtVHQgJcseBkiwLLTU6Dr4FYrqxHAtW7rUTje\r\nSBzE7mW5O7sWGUROjUxAUNYYfMm1h/qKG4mSv7hAYrEz+OdWDukIcsVbYRqI\r\n18WJIZVdOiatELXKCFEfps7ob5C7UsmCr2m6JmIRHwfhbVr1KvIJtLXx7Ofb\r\nJRMzH/GO1K0lr5YdEeeU0Lli7mjeEIR0CNRM0SFEVgbHMtenOQzwO0tOuFb5\r\n2hWiTQF3bP5nIZH3zpa4nGMWr6x0xHuE9HqbuCmqNgMTVVc7+79equ6+oqna\r\nGCB2TGSv2cyDi/9dpS+0W+rGARs+D+rfyh8Eh5zrPuVStQ/XbuBvmvMfDZin\r\nNBDZdmyZfOoYuV3yDlgAArETpZ2vV9uRVPqRHD/tKVNspOP8CpwLo7ubCpF8\r\nRFEyekxAihg001/k0skYPgqdCB9AF7SizCY=\r\n=Hh6i\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"b634251c1f816bc66bc81c76758fd339ec40a76b","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.20.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.20.0","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.a515a2d18.0","@material/rtl":"15.0.0-canary.a515a2d18.0","@material/base":"15.0.0-canary.a515a2d18.0","@material/theme":"15.0.0-canary.a515a2d18.0","@material/ripple":"15.0.0-canary.a515a2d18.0","@material/tokens":"15.0.0-canary.a515a2d18.0","@material/animation":"15.0.0-canary.a515a2d18.0","@material/elevation":"15.0.0-canary.a515a2d18.0","@material/typography":"15.0.0-canary.a515a2d18.0","@material/feature-targeting":"15.0.0-canary.a515a2d18.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.a515a2d18.0_1664391397538_0.7186912422315579","host":"s3://npm-registry-packages"}},"15.0.0-canary.ce9523167.0":{"name":"@material/slider","version":"15.0.0-canary.ce9523167.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.ce9523167.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"cce0300b27c96912de61ca713b4da67b07a28cba","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.ce9523167.0.tgz","fileCount":37,"integrity":"sha512-jDuO19r/GWEnqH+6bSXtOfRhoArb01Inl1xChmfjOsZ70OtwpU8sfSK7dALrART9mYneovJ3f/PmjYIbDzB/tQ==","signatures":[{"sig":"MEQCICWrPzO+d1bDS37hlEvYeoW5C8Bjur6Yh+7RoreRmRqyAiAU307oAXEOzO4vo1mCMsv5fWY1IAFzp3Cr6yI5nA3t1Q==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":893672,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjNgDEACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpLeQ/+IQRk7rY2oKwTOL9jxwGhD71M44BiSq4+xir1373qNty9Vg2D\r\nMXs2k09oesWbVMSMCwdgGTonehZ1clJWImCGTY/DeQMwlDJNjq7Vb4MRIGx1\r\nDrHbeBHRooGIuG/pZsmkJuNYhXLGZvS/SnwBa9/Y3ub/irsQpW3COTcfY0xq\r\ngkKrB1aGamP6yeVd00TiRjmNJTi3eKCcfeEEPvgaIi/H/Ajfy+5zuLPCHyQh\r\nafAGJ7axqmC39mHzfoD/1licYW+7XZ0jOKdZ+ROhlYR4WOKWkMAcG0gPp5gE\r\nk3LiEWh1DbXZPIdUfJJnUojw8KC9EHCVpyl9m/+93IV5YqdJrIYWftF6Fq1x\r\n/LZo6vHDaHesPZ2pl/tBoK+q2Y+NyKoXMcvkKk/yL4tEUyVbItmCyolWdA8X\r\nL4lcxWUDITAh9+06lnomzn3RIsllm3S6aQ2Irxi6cmW694XEU9wjVmXcye8Y\r\nnAImzqYF+UC9gUaQFQivHkKFO8iMD0CWaX4oiDNJABAEzVhvISZN5XlOBYof\r\nTmN5CeOEOvtFuSdRslyFbHpK+pf6Achd9mX/FHcqSWOQea3bSxOPNM8qllsX\r\n/5adK9RJGwYePUMMSMaa3qcdRyRyouhMGK4cKAShOk2e9QE/VZHQkQMQK4IJ\r\nx470A/6CIYeVkA4zYu6Pb5rTztlOMCrIHNE=\r\n=zIHC\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"8aac5a80fa36dceacc7b3a6e2474218f9092a107","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.20.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.20.0","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.ce9523167.0","@material/rtl":"15.0.0-canary.ce9523167.0","@material/base":"15.0.0-canary.ce9523167.0","@material/theme":"15.0.0-canary.ce9523167.0","@material/ripple":"15.0.0-canary.ce9523167.0","@material/tokens":"15.0.0-canary.ce9523167.0","@material/animation":"15.0.0-canary.ce9523167.0","@material/elevation":"15.0.0-canary.ce9523167.0","@material/typography":"15.0.0-canary.ce9523167.0","@material/feature-targeting":"15.0.0-canary.ce9523167.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.ce9523167.0_1664483523898_0.7366342844934435","host":"s3://npm-registry-packages"}},"15.0.0-canary.b2310f7dc.0":{"name":"@material/slider","version":"15.0.0-canary.b2310f7dc.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.b2310f7dc.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"02d65568eeb7e641fb1bcc48fdf606d2a8e1367f","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.b2310f7dc.0.tgz","fileCount":37,"integrity":"sha512-Fkexi6CnX4ZSpNC/SG1wGP1rqhkS2HE34AlwFnvHSV5/MgK2mcwAx1BjSHvpKeAQssTFKCoD3/EPkyHlbNVqjw==","signatures":[{"sig":"MEYCIQCuiS9OCWt2aL4IX7hun4SompxMDrGfTBUCZHQBGEOTGwIhAJwrVywahUBGoHy/Dlbvd1p56SqxJdlYufhdnb/MDp1L","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":893672,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjNjTuACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq07hAApE/s4b0pz33jaNkEt18vvHYICAT4MjmwxBfc1GWpzyPej5Pe\r\n1RsQkxzo9jKgMSCh8FgNmWhn1L/Jfae3YTg9kNAmly52EA0MdEX7YfS6xBol\r\nSxhZeA1ndKanmIajGMoBtvyhLZt871MC8TlcLHFAZ+e+rqHFUhARfyDbmXVc\r\nJT03vxy/8g8gsoeO4Kp8HNibjGediMCn3d31SDeYDW9DL91rjcOQ+S1MYhIW\r\nMfDust8fy5rVg7sVZpPdfj2r7qdDJmO2vmPnIkG3EpumiiGQYe0lP5ojTVM6\r\nYwTTIGWrimpxSfWjFiDYIADM97I+h4i6S/mgI85LgfyWUC63eQIeoKJ2YwXz\r\nzTdF6COOlyPR+hSSg6MtzbXvIWaBowaVpBq9jNqLtOpCjMuChl6t6+Am6mWX\r\nV0JphWzv8hGKwzdgrKpQXR0Mb3MCPfcB+5ItmWYNBxpNZvfEtwJs4Y3PpPLh\r\nWM/aO/St9iLJV84Q2ZLc6BM7ZqoxUz5yuiYGO7XSAg12GXqWZD7BxozMMYD5\r\nL1k248JgL35Vx5FKWpidVGzU+iwd1EbtalI8EZ6YXo/kh/tQ6w0NtDaC8lfG\r\nb22QJwuKq/9l+ZHDqzNnWjg3teQgQnJ/zJvVtQRbf4PbrJ39EQfAr/sVoE/D\r\n0Lx1uGAZUyPy/8jAKH5Gd+tESjXilQJcw9I=\r\n=Tjx3\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"1b1f8d124dcef049ff4f3730b930eadfe1e2a58f","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.20.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.20.0","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.b2310f7dc.0","@material/rtl":"15.0.0-canary.b2310f7dc.0","@material/base":"15.0.0-canary.b2310f7dc.0","@material/theme":"15.0.0-canary.b2310f7dc.0","@material/ripple":"15.0.0-canary.b2310f7dc.0","@material/tokens":"15.0.0-canary.b2310f7dc.0","@material/animation":"15.0.0-canary.b2310f7dc.0","@material/elevation":"15.0.0-canary.b2310f7dc.0","@material/typography":"15.0.0-canary.b2310f7dc.0","@material/feature-targeting":"15.0.0-canary.b2310f7dc.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.b2310f7dc.0_1664496878661_0.7817697237033048","host":"s3://npm-registry-packages"}},"15.0.0-canary.a44241e54.0":{"name":"@material/slider","version":"15.0.0-canary.a44241e54.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.a44241e54.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"8cfe68f7e7b19d36ecf7511424a9a6c39de695d4","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.a44241e54.0.tgz","fileCount":37,"integrity":"sha512-sqPydJ7A4alwR1RXPhbu4w6/JtUx3fofZUpC2STRn467VPSpsVHtj+oYBGEVfpUT1TJMwnKNDE4JMtXE0J6+YQ==","signatures":[{"sig":"MEUCIFLsdgRjZDjyFxcYtvtMnN2gFmrzElfMUuIXr85xZt0HAiEA4TaDhcQZKql/AcxPaa/0YlI5QbHrKPFKNO499Gh5Pbw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":893680,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjNqcjACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmpz3RAAnyxyNzVcsTE9cmfxoG6lCa4xrdxyHI07rk+rvoeSlWZQT0UP\r\n+pCBf5JD4wnfvJwBCEFnB0eZq6t5mDW5g0fkuFPZrQVZUgU8B4vSGHeQVP9R\r\nkGOhEzfIkZ5mvOTfzxEiz018posPBEXt6lVxsiIi+tvxB+H/HCafpw2chZMH\r\n4BJsSdIdrbhzM5zkPAIxlrXzLNVkZHziruEsi1I93tsO3a86jmAqdGRoUaLC\r\nSjXTdcwMFuk5zcOlL4Gz1wSZ9+6ku0aaGyI3X9WtGeHNtTk8+d9ri9kz3BbP\r\nxu7Iv9nnZsrit3eLuNrZNEKZE+ywK2JE0LKOCTw3TC7Eed/ktq7HLlhxvC8V\r\n6csTREyakr8cVAD2hROr+hg2P3v0g4mTjr48UsyWy6BaSxksnTj1+HiIz/4V\r\nSZVXy1GqODPQz+v9Hc9AYQZdGu1do9UgwJzh7otAHcvj2qGEZivcHhYXlqMv\r\nWkgORS2GwnJdUJkzDTFDls4V4BrFNEAOkJuCbPktUdF2WiOigZ0OxHi63zph\r\nogwLqf9w+YerbS/3sAtgAhLFAdasr9I96i8SL9+nqjCSwI+V2Cu8FLOleNQG\r\nBqVmkGuozCAEm++dqy7o8REnevlXc+/h2ZjOLZDTPoBdQs6h9wZMUeNSM1qz\r\nWvF+bkOAVwZe+xNKoSy3j5W7xNoy9/W8NGU=\r\n=utG2\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"2a5fa6460bb58b3b2866631eacb27411a12f8d21","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.20.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.20.0","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.a44241e54.0","@material/rtl":"15.0.0-canary.a44241e54.0","@material/base":"15.0.0-canary.a44241e54.0","@material/theme":"15.0.0-canary.a44241e54.0","@material/ripple":"15.0.0-canary.a44241e54.0","@material/tokens":"15.0.0-canary.a44241e54.0","@material/animation":"15.0.0-canary.a44241e54.0","@material/elevation":"15.0.0-canary.a44241e54.0","@material/typography":"15.0.0-canary.a44241e54.0","@material/feature-targeting":"15.0.0-canary.a44241e54.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.a44241e54.0_1664526114900_0.9299198457419167","host":"s3://npm-registry-packages"}},"15.0.0-canary.0ce81e115.0":{"name":"@material/slider","version":"15.0.0-canary.0ce81e115.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.0ce81e115.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"a5e0e2e062713d0b321e85adc5859e8dffeccc94","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.0ce81e115.0.tgz","fileCount":37,"integrity":"sha512-XuiOxN1qkDuDYfSEpQOrL79C2o7d40woY7+939OiCWValyrvQNwZh9U9pfiqbRO50fT+jOHdGrB4C5YKSTxEdA==","signatures":[{"sig":"MEUCIQCmyOEy8S3Pd8EzUw67cfyRSerb5fcZ/oJ+cHtmhp4hNgIgLiuqrsCu0j06afFkSK/XCXJS3ZssZNP27O1wNyiGmJU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":893680,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjNzMYACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmo2NRAAmeD0MoyeED6VmaxTqCKeXNdk0RNfV7+J8bu5ucBonJ1156Nz\r\nNw27nRZta2liNFMTL51fJoM/AaBda+w2T3cefTI/9jrzqfP0hoU+h4s5fRpE\r\nOplHkC9IoEdFAwBPhG1s6vDieLBzo7RmZ34Nz1BX+bTRjaGPmPc/DvoTy4zy\r\nMkKgbkZ4wDqr+lkUT6CTu3fkSiVNwBpTHr0/F/D+vkdH04pDAU+7T8VAf03V\r\nvr7iFFVGVIAo2O7YSaQmOjLt2z4qVveBz6HEtEWQillRyMXhRlvbPbjv2dlQ\r\nLbDp59UwtDbTUodqEdwQ5Oc2k8O+EMz9VHgArT1/x96c0OwZlYHkG/qbFtP5\r\n1p1zTfUJxegxsMMhvVYUAePBjWHRdCJSAhMYE5CfGPlE0SzvMvAI8SQa1gUN\r\nVxFAq8iRtnMEcPUzkL8+duxBwZl2x4n3WfsRdhEfVgp5/6XEHFN+qpPte27M\r\n6uxuwVL+jspBhiV3fJxlp9O+1bNXFCiiwbTBjEyDS7ihHi5Z3AHn58704l9k\r\ndOQA2vkWWcW3Ofw43v8TBK0mAIeJzJeMFyp79hmzEhv2rFw2NFy2Uga1O7B4\r\nZGXydHu4niQAkIXiFoZNDY1OUkNC9w4tCIdIBv0eb2oKnvw1+raMhiQfP9im\r\nTdBTTQcmSapabQo4f7AyEeP3T69pcL/Yr7I=\r\n=9ESz\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"d690b44f4e157e829199ea749861c3b827d46dff","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.20.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.20.0","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.0ce81e115.0","@material/rtl":"15.0.0-canary.0ce81e115.0","@material/base":"15.0.0-canary.0ce81e115.0","@material/theme":"15.0.0-canary.0ce81e115.0","@material/ripple":"15.0.0-canary.0ce81e115.0","@material/tokens":"15.0.0-canary.0ce81e115.0","@material/animation":"15.0.0-canary.0ce81e115.0","@material/elevation":"15.0.0-canary.0ce81e115.0","@material/typography":"15.0.0-canary.0ce81e115.0","@material/feature-targeting":"15.0.0-canary.0ce81e115.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.0ce81e115.0_1664561944493_0.8069674634499455","host":"s3://npm-registry-packages"}},"15.0.0-canary.3cc30f6ad.0":{"name":"@material/slider","version":"15.0.0-canary.3cc30f6ad.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.3cc30f6ad.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"f6cea642bd1408ff2f23e478994b8972bcaa2dd6","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.3cc30f6ad.0.tgz","fileCount":37,"integrity":"sha512-bCQCl5vMJmd1Lv8dLoO80TzLvUN+bBT2a03lqDILMhSQ4Wn8pEG4r95jVMMlZPegBZGo37WdFqSktAe/u+T4cA==","signatures":[{"sig":"MEYCIQD4b4zHQsrQg94oKVM0pQSk1yqnTii0+xL4ghmyzqwC1QIhAJy34rvEWbms/d9d8v47O0A3zvkqQjKl/1/pKQqkIS7l","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":893680,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjPGtWACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrlzBAAixnMnh14P5bDI8SF5FUauho/h5yog27rAsBtuoIiB0FqDdOx\r\nhPn/qSWv8DMbJ0ggqpECjy7hsiSdFBpCPaStY/zEB+6tvUZbZQ8MeXYSyO0J\r\ncxyVJGGWuQzze0CF0ps8fpyjLFrAd/cfGtoqHCaxPxPbCFqvm/azOqokQrKV\r\nHotxXyV1SuB/zaBo0Wi1V0IExrLu7iVzdcRRxb5bOBUx7pUVo1gkop9eiszT\r\nuy0fv+/S1m0StrftaXL966qhUucf/zYfpL9m7Phz97+rCfAoxgEHC9qquhPV\r\neWoGC/ta9r3LqsmnD0IrnrDiYFY6QwDsUlvJieJYVX3zkX9hY+3AVDJkk86h\r\n1oISYPCPPU0FyxAYwsUo98Y228AJE4gaj3soNXPfbrSF3u+MbyiagPfVn9cd\r\nyVQOjeNa9KDxgAXTAFImQirKDoq6xX9l2eHnWSofuIqzrkz+eE3i3lgiJoLk\r\nXxvM6/JOtqkYyIpHQY5xXtaFR/eGU7imTmGg+cmy+QYVBjTm+t3LLll08JGo\r\nCgyEIzzn+3XXaDF7jg+w8u8+qx99aLdPXxx12Ju+X4HI6o0TuPsWlkUHQb8p\r\nPjTJgXexVB9kdwK25xXYLokzagltrm7ZvOfNPPHl3JS8YK/AxhTCJWu3/sTQ\r\nvg8ThBV5o8CGnEP0YaDfTV1o9YLC4f2x2+o=\r\n=+nNM\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"78d02265193749df2eae507da620e7571c09da12","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.20.0+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.20.0","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.3cc30f6ad.0","@material/rtl":"15.0.0-canary.3cc30f6ad.0","@material/base":"15.0.0-canary.3cc30f6ad.0","@material/theme":"15.0.0-canary.3cc30f6ad.0","@material/ripple":"15.0.0-canary.3cc30f6ad.0","@material/tokens":"15.0.0-canary.3cc30f6ad.0","@material/animation":"15.0.0-canary.3cc30f6ad.0","@material/elevation":"15.0.0-canary.3cc30f6ad.0","@material/typography":"15.0.0-canary.3cc30f6ad.0","@material/feature-targeting":"15.0.0-canary.3cc30f6ad.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.3cc30f6ad.0_1664904021931_0.7533507804670669","host":"s3://npm-registry-packages"}},"15.0.0-canary.d9cf98e60.0":{"name":"@material/slider","version":"15.0.0-canary.d9cf98e60.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.d9cf98e60.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"6dbc4195da167ec3b5a4e53a8fc3f940f374e006","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.d9cf98e60.0.tgz","fileCount":37,"integrity":"sha512-7OMMpKG4Ulep196fDCqD8YeQLrqEClTZFxh8kdO9Qa9d8AfwN9mFTYV1tMjSHNy+9VbILac36li5OjJwBkBe4g==","signatures":[{"sig":"MEUCIQDPCAuLpJdZe8gbPNeI8QungWxD0tGpZnKj4v/CtbkhzAIgDtDovmCWSw1aiYuyc0z4BIVPSQcrJJnHWRi1byz03ww=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":893680,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjPIPCACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoalA/+MkHuA+R93eyrg+t/xk/qiWn7JkOTfySwdp1Kjj1bZF9CaYMj\r\n44MKQzFMiAcRLEvO19tZrBcZS5Klfq29IJqnupiL73d7UbOADQqSXn7pz9Qo\r\nFaFgI9/2DoUgEiVhZoWonn391UEPUtrfuqnskcI4HffeKWQ3uvzsH3BigpDq\r\nBaH0rMNOsMGarFsqrn+kMCptQfIvisYjgUbNITqSg+bhyUqcnXX31/lVfwri\r\n+/gkecKWEgXFYvC8FIY0Lf2jJK9z4HHhmqvJZsCv16Lz9J8LA3/i/fF/koLF\r\nEYnUzaSajy8N85rPnQKikRmaPNNTZWC5qL/3Hj/HfeTl1f21wISboKQsmadH\r\nrpg0yvqRILqcjQw4LG6+VuujS66Y0IPzpbJXU8/Ziv8mW+i1eop0y7W2B2Od\r\nMfVy+N/XT6/uA/RQN1gq4jclt+PbRSHI2hfTkH4qacjmW4T0sOZRdKwXkXsX\r\nyGc3IcCm5Hcd3i+P2jhapGBjZjIvQ9rcpYqo2A2t4E6LUA7INHcb84WOfNuw\r\nz98CjmppLkfKXWbOGra8O4D+Yj0NcLcvqQA882avMEvs+QfPlwlRq53/e1gl\r\nFh2+KUwtwoR3IIdkXbEVc38yafAYc57hikdW0JyY6U+A5XqkL9bwA/enY+Y+\r\nqSJkgNh0O1fZPStxPQpv8E4iFoYIw5MCzKM=\r\n=n2KS\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"554e3182e6804b0bbc262ea0e730d556747b7382","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.20.1","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.d9cf98e60.0","@material/rtl":"15.0.0-canary.d9cf98e60.0","@material/base":"15.0.0-canary.d9cf98e60.0","@material/theme":"15.0.0-canary.d9cf98e60.0","@material/ripple":"15.0.0-canary.d9cf98e60.0","@material/tokens":"15.0.0-canary.d9cf98e60.0","@material/animation":"15.0.0-canary.d9cf98e60.0","@material/elevation":"15.0.0-canary.d9cf98e60.0","@material/typography":"15.0.0-canary.d9cf98e60.0","@material/feature-targeting":"15.0.0-canary.d9cf98e60.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.d9cf98e60.0_1664910274157_0.10320379085297482","host":"s3://npm-registry-packages"}},"15.0.0-canary.d71935c8b.0":{"name":"@material/slider","version":"15.0.0-canary.d71935c8b.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.d71935c8b.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"31e12b716fe5fa656c23e3394cf00450c57dda63","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.d71935c8b.0.tgz","fileCount":37,"integrity":"sha512-1d2aZw4r+EA28mdKekT14KzO+2W1ic2ZF5DYqktIYnWA6/45V/tgsLtIqqryvApzlqAOy3ddukYdCIh7zy9l1g==","signatures":[{"sig":"MEUCIEYYH048G2BYLE1aFWbY5TSvMS7LCz+YjBeu9BmibhQ2AiEA5SZNzY+Kor/GHoWW4zWNLj1lN4ju43M/AYAT76KiVE4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":893680,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjPo6tACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmo36hAAlxVrFDGy/+7TP0YGaSLzBjqf9hA12tn9loQ7l7+rxnEjJplm\r\nXXZDA807u46d2eU/3pbRi1z0Q+qzQt3Yt7X+XR4Afws+KXFyjTGapGaxaykJ\r\n/3g54yK59AObq8JVw5f6rSJ3lBdOayQum0yfMR5CQbwGyNFbTH1NnK1BMMZS\r\n9wpGSeSJNLbXde6MfXOTD4K6b9NVahoXAGbhyWKuJxDprG067mEO5ifmVf1e\r\nDN0FZXR/UeOXZ/kfvO0HAPU6Y7NShXjFdQ8d4Xx0RCHIgUg6r3M381dXKv09\r\nz8SluUE+9FyPg/tsRxRq92yZSx8PNWf+JbrRN2NZcXEB16azxqhAff+vaG8+\r\n/s9mvjUcOxS8tNiN90OsVw0Bg5lExPoUio+cDKY8REB7CrSz4CYkWyaDeOIT\r\nnVnKhQbO8iWZePZVZrrHYCzu+W+anTi4gv/9m+JwjGVkByjFIl+H1Ld+Pc4A\r\n/Az6e1PQx8VoUlIoQVjwS77I20+qRByccWC3xHN6InXHNhixYV5cJfOPWo75\r\nF6tZ97xqOuYM71kmZ/WkKhoKQltHSn2vz6nSSy6yBYbM0HYIqyf6ewtaBQn/\r\ng4s+oxTb1Aj5pvT/aCYIV5OwaGLkrjDi2o7/9Z+lVLF8cDIiuhySbLLlgIQZ\r\nGyM4tjUYCpiiZC+NlmOTgFDVnlhdA0XT5qA=\r\n=84Ro\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"0e9f697d8ab3c0b93969f61d22a2b06760934fa3","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.20.1","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.d71935c8b.0","@material/rtl":"15.0.0-canary.d71935c8b.0","@material/base":"15.0.0-canary.d71935c8b.0","@material/theme":"15.0.0-canary.d71935c8b.0","@material/ripple":"15.0.0-canary.d71935c8b.0","@material/tokens":"15.0.0-canary.d71935c8b.0","@material/animation":"15.0.0-canary.d71935c8b.0","@material/elevation":"15.0.0-canary.d71935c8b.0","@material/typography":"15.0.0-canary.d71935c8b.0","@material/feature-targeting":"15.0.0-canary.d71935c8b.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.d71935c8b.0_1665044141395_0.23449444326738766","host":"s3://npm-registry-packages"}},"15.0.0-canary.49c56a25d.0":{"name":"@material/slider","version":"15.0.0-canary.49c56a25d.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.49c56a25d.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"d517c5b025bd3624928cde527b88922563d3e5a1","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.49c56a25d.0.tgz","fileCount":37,"integrity":"sha512-CyCs8ETpTXfDHCHOhD7dsKfJiDA/daxvN4SLQEC3P7KHhzujtfMCA9eI13taazAKmnFhRMLR8vk3gz8stFEPRw==","signatures":[{"sig":"MEYCIQDU5coW7Y9Ejc2VgSPJgVoGqAdPWA/Tqaha/KtE1oQPcQIhAJTjbuqthpLWz2NKvf+6/EoNXB/4ma/q9TqfwtDKo1so","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":877271,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjPyPAACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmp3RQ//YTsh/1ssf0hGYiUhGpP7ei1YxlVPisLl2E/vLbfii1CZ+d5K\r\n8OCXKdqX3SqAgnTJk4yjFQ4jjwffC5x8ldSr04iKjpvqV4nz4af5bghDsN4G\r\noZK6xYyOGuDlIZfBpIvYw/FrBrUYPmud4Xx55SguARZIR2lzdC9tzV+/I7Rh\r\nTsE2bWVB84IvLR0OA7OSIgviLskaTBGLvoxwyDARUil2RlY7l2IQ7acta47A\r\nFGAotRhCwYUeyK1G1A7SGZNOj6E62OrmgX4v2EOdIg6LJ88XrhcJu3pVkjkM\r\nI8CpUTNooXVSYTbj1GcCofMvZAh2o9l26XrlzCfbJqo7KC+prBQcmKRZTTGF\r\nnHZLr20G/MRuZBed4+qwqXwwUc6KuohCiJ1yRXTB01H4KmCcDsY8d/iUPMTw\r\noVwZcr64Omwsf8mUCt1JZ1+vrsj4xRzl4UEhHdXBJrh5758wAjchzLAvu37Q\r\nHaLnmcbeFqNSNwnnuiFghny3zSiTPJ6TlSzdi1lvYrHVuS2E5/ezyNN1W72C\r\nwGwToY8Azao9vUDmdBkb7y/az9A8BF+uWZM5gXF94BHQicnGGRiWqC5IZFQ0\r\nlHeGmDF1I5ISki3poERfGmQwmLqnQYrXN2DsIFw44fAJdbbKHHhdG+HI2dfG\r\nWnVJ5DUHWbmY26arDRDN6qF+Q09Wlfe7mB4=\r\n=cGqf\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"46425b4f1ee71ec9e841d7ffacdce7cdc35e7b69","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.20.1","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.49c56a25d.0","@material/rtl":"15.0.0-canary.49c56a25d.0","@material/base":"15.0.0-canary.49c56a25d.0","@material/theme":"15.0.0-canary.49c56a25d.0","@material/ripple":"15.0.0-canary.49c56a25d.0","@material/tokens":"15.0.0-canary.49c56a25d.0","@material/animation":"15.0.0-canary.49c56a25d.0","@material/elevation":"15.0.0-canary.49c56a25d.0","@material/typography":"15.0.0-canary.49c56a25d.0","@material/feature-targeting":"15.0.0-canary.49c56a25d.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.49c56a25d.0_1665082304062_0.9420263625363972","host":"s3://npm-registry-packages"}},"15.0.0-canary.07acddef3.0":{"name":"@material/slider","version":"15.0.0-canary.07acddef3.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.07acddef3.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"e58ffa4cf5f86b3bf76e041e7917e7ce2311763c","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.07acddef3.0.tgz","fileCount":37,"integrity":"sha512-9OFhbyEXwTFtMVSZMhkKY0mYY/bIKT8IKYplFzmeX2EhtXM7WZ9rW54MKCZJOHygyYwIvESc6ct1lNYIb/Yg7Q==","signatures":[{"sig":"MEYCIQDeSZG27z00BWcOGxDL1n5+A8Z8hMBSUK/ABAhk3U+3vwIhAOK1oHUDgkMY2AUlTtPIX6l38VUF8n0nORtqMApv3dfO","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":877560,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjQJxPACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrNJg/+J/3xQEFoQDJCWhM8BumIk3lN7IBmuCRxGkhoPqoGZ+V6Xw1J\r\ni46QVl+Qs25/aCjUGrRMKrvXbBiaV+qAc3eth4/+8/FtiEt5xZ2D/rrkdAKZ\r\nPc9J8VoipL0N/O+ZWb0V8mgPKL55DQhTSn2tPpNEnl+Dnh7OgpLqGy4c53n+\r\nTJFj5yaHIZkY+I+EJbN8ZkPr7boIpd+0ck3WwpFLzMa6zXps/IBMU1L7Wxce\r\nAtg6lg5398+6H6/w3M2jmOwXMj8bFcFAwYNV3UpmXqWFzZv2nbbVVg+In0pz\r\nc8pSpJ3q2yqML3kLYvLRjfDiTBxUC9AECu0hq9qmeeMvB6Jwu7pRKR1V+Vv6\r\nmDBeKuFL8lRM8L2DUo9B7xXRWflbwP2P4bMvoEe7pxwBDZKR46ypT1Tnwijx\r\nHjI2rNnM7u0ook3nDfux/YraX0FJGVhWJva5pWr0zbFEGi3vatG6EvmhLwM6\r\nVPD71dG0GJ5GtXnHYzpWKx5/oEuVQE6Ltj82tyExbLGw+Wnc/wMGrI04Y5vD\r\naCgxkbcszVmLcrGmdNx2fMC0UDtfE/9UjN80A6VxJ5YHVZO/jwYtGcuI6O96\r\nn9RFKsaQzDYIMEsYbd4Py3b2QAQlc2KXyHaDRfQcG5ZRjLn4HMl2VZ8V4A+O\r\nyPXE6CikX1DgirLK2bfYugf9XMGvIeq761E=\r\n=U1bC\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"f61a6c26b4bd60354b690448809f9dfb7ea11564","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.20.1","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.07acddef3.0","@material/rtl":"15.0.0-canary.07acddef3.0","@material/base":"15.0.0-canary.07acddef3.0","@material/theme":"15.0.0-canary.07acddef3.0","@material/ripple":"15.0.0-canary.07acddef3.0","@material/tokens":"15.0.0-canary.07acddef3.0","@material/animation":"15.0.0-canary.07acddef3.0","@material/elevation":"15.0.0-canary.07acddef3.0","@material/typography":"15.0.0-canary.07acddef3.0","@material/feature-targeting":"15.0.0-canary.07acddef3.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.07acddef3.0_1665178703397_0.24427079787863293","host":"s3://npm-registry-packages"}},"15.0.0-canary.1c74eb2c0.0":{"name":"@material/slider","version":"15.0.0-canary.1c74eb2c0.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.1c74eb2c0.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"d0b4d539309023bebf0f1cbb4b70704512550c81","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.1c74eb2c0.0.tgz","fileCount":37,"integrity":"sha512-WbEvzTs4r55FxyG++w7Dr+F8zgD14sHIY9S/MHqvW1wUVsoDtVXZdUKZkOKruI0zkB1KIBygQ+6Y9iu/YHwuJA==","signatures":[{"sig":"MEYCIQCTvadVbHjOBOfe4FgT8O3r3JzVa40bANkqohKTtWdqxwIhAIMZ/D7RUlUEia65RQsgNsbATovxNZ8MXFnMxBrF2Gw4","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":877271,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjQKCAACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoT0Q//S4ySUvfWiF5Q39I3ZDsHGWnACbuydpCbH/aOmG3q550Jqpoj\r\nxoV4s6QU2oDE0vcwUiiy0L2+rMBHnusA7vevee4OE+nARVqMpmEuEWzeVp7q\r\nKoJKdFgSSqMvpESvp2HNgf6GcfX1c9JCYkzll79gePMVCo8f/TBqD7eE6ifP\r\njj7SK+dnXK9CGM0BBOdcYymuHThG+TpApJP8+SXEi0wN1mENJNdWd0qaiVXC\r\nlfYDbeJN0C91Li3WX/02OrDeYUm2rPuV5mCRfVnSji2bpmapablqzNilpBzL\r\nSUGPPRqWrbsoXhp30y62biWUa68o+jqHRMZ//aeSiEFNFHkWuujsHe+aCrJP\r\nNGGM0ad6Wiq+wJR+/IZLw2aNY9ggdFCOz28kYWlXfIWtUyiCm0HCl3Tvaw+a\r\n48dXIMKBvyLv3IJc45zo3sVBg3LnQsSED/apbLWDoOH+TUeQqB7rkedjHKU9\r\nJjjRFyPjx4UeSqbqqaWpmMG3RkX+HABoXYNh+v4F0RnJEraI9gmOr12+A0tn\r\na8VxDPoJdXcChtOwJdTIqw5tfKucGk+6Kd+yb+EAqApZPIP5YGNPLNQrKwP0\r\nQyFfsYcCm6C0QRoMhFsCRv0O1z+gyUOtvL1bCs4CuTTMkrPM3yVHG8TTcRts\r\nEBBlTOjmo1H3HzUISfsDp7jcVpna/z+RZus=\r\n=wP4l\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"fa2e48f4e71714ca4a637a500ddf18f562031ba2","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.20.1","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.1c74eb2c0.0","@material/rtl":"15.0.0-canary.1c74eb2c0.0","@material/base":"15.0.0-canary.1c74eb2c0.0","@material/theme":"15.0.0-canary.1c74eb2c0.0","@material/ripple":"15.0.0-canary.1c74eb2c0.0","@material/tokens":"15.0.0-canary.1c74eb2c0.0","@material/animation":"15.0.0-canary.1c74eb2c0.0","@material/elevation":"15.0.0-canary.1c74eb2c0.0","@material/typography":"15.0.0-canary.1c74eb2c0.0","@material/feature-targeting":"15.0.0-canary.1c74eb2c0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.1c74eb2c0.0_1665179775698_0.9914497579604942","host":"s3://npm-registry-packages"}},"15.0.0-canary.dadfb713e.0":{"name":"@material/slider","version":"15.0.0-canary.dadfb713e.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.dadfb713e.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"a10da3c7e605674d424f7e1c1f495a5cf54f0189","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.dadfb713e.0.tgz","fileCount":37,"integrity":"sha512-utbQ9zFfnRFGBq11sdpRzoxvw7qQ9RGkRgAAvcVD+W0hrHjn2v7Jrto3CpdJzgweO9ZAfMtUcGZ3155Pzc6IAA==","signatures":[{"sig":"MEYCIQCPdTXhD068P+FIuE5JhEayKTRRqX/Sr+xFt1r6Ozt/4gIhAM0FwL5EmSrkWzxbN87jucLrg0pJ2F9vDTyIKambQ9uz","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":877570,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjQQVbACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrGfg/+OkiXPKbH+iyGG7SIk2Ac8JJ8l6TDaVIdhrxHNl0qIk/eKjr7\r\nXsI/wD5y21uIpj8nVpCC9o40Ra/J9owK2qkdnZOfxcDhcdEpR7nENcZAHUVT\r\n1c9A+Oc2Jvss1zKiTqbwXZw9gH3O1mpZuFBd2F2vf8Kj0h0rYxKUs51Wi6EH\r\n8ikXVdCo86ygEVVCzp5dpNrPVEDduS9mMpPlee22x+weyeFDpD4xMzz9/hKm\r\nSK3pgBzeLaikGLldFep5IDEFESD6BOtKFloEwNfyX95SZ4mkoa91J5j+ff7O\r\nfkcZvhe5xomD2vjAlxtnPdkVhvhjkJha32QL1VX7Ni+2mzrMbaML14Bl/lEM\r\njF6H10yIDy1lP6iVfzvkc4yLwN5hcYyZKDSiiXYZn8OJffH4l52ykiOEm13n\r\nwRArbLBc4bAH/HQcZSoT/LurV4VMSjidIGpfbqis+3XS2R+DU1SXU/tDmFGg\r\nWY6bLRGiFYiBzGGWBUyy5IqawUladOZvNrDTJ5J3acRZvUJUKhKIyZ9AkAhv\r\nH8sF+xDsIS0nmY+8FMVzjg40gKjhTlYgF2+QnF6SFVxIZ1j+v/p5B7HM+j+t\r\nREuQFNo8hPSKdwK88ve+eFP/OVVJnrNGc2ZP+TmmfQHt+R7jQqtvgf4YNibv\r\nuf6LXEo+ii9KgDDteYj4Ogh44CQUcuc3eL4=\r\n=YEL2\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"dc577772f45028a4c4dca1d7c8ca8dfcf636e763","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.20.1","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.dadfb713e.0","@material/rtl":"15.0.0-canary.dadfb713e.0","@material/base":"15.0.0-canary.dadfb713e.0","@material/theme":"15.0.0-canary.dadfb713e.0","@material/ripple":"15.0.0-canary.dadfb713e.0","@material/tokens":"15.0.0-canary.dadfb713e.0","@material/animation":"15.0.0-canary.dadfb713e.0","@material/elevation":"15.0.0-canary.dadfb713e.0","@material/typography":"15.0.0-canary.dadfb713e.0","@material/feature-targeting":"15.0.0-canary.dadfb713e.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.dadfb713e.0_1665205595449_0.9574555607018247","host":"s3://npm-registry-packages"}},"15.0.0-canary.395f1ce61.0":{"name":"@material/slider","version":"15.0.0-canary.395f1ce61.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.395f1ce61.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"b0c68367823b67994def4420e056b22115c78931","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.395f1ce61.0.tgz","fileCount":37,"integrity":"sha512-27/mOpo0f5aj6+4bqk9aK7q6Hb+UwDUubU+8j20m36g2l16ZTe82cdFiSZO8geZ5O34uqb4T/LXZZN52bfSz4A==","signatures":[{"sig":"MEYCIQCwGwr/8XlfP6vWRwbMAkSnJcBRRoFOLE1CJEPUT3jdMwIhAJFg7rzkTsrWt5tF0rslt2TmDP+jxa1YKlJdbCO7jMZ3","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":877560,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjQQXUACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqzzxAAiP8bBP0w2Cs1C9rjjRFW9h70ibzIJODl8Khf2ZI5scQKkSWC\r\nqc000HOAe2msPbyl/moAgg5KGmw5uMgGEg4XspvvIfy9kX2rR7PMsfmeZFi0\r\nBE09V0G99nc3m9vMp5piC7h8kqdNSPxT4xGMmy+3b2XnD7PTAqMF3DOOH6Kq\r\nehkK96MMmpVNUkCERoHPSzcniPBS7X/2IPQ7YPU9j5fEEv/a6BrzZadWNIRT\r\nh44Ola03vw7pCnRKkcRnn6LndLjA7dta2XOQDi6nnzu77WF96jSC1Qo6OkrF\r\nzKsFadt4sAowOpd2lWa/tZeu3Um7lNKE0thijNhdf9lGdBhGB2afI6y/2+vW\r\nTYWlfiCN1JvBCDuX8hePiSWZYseRjXXbh/0OQC4VU0ZjoupLP1ZHnvz6rkBu\r\nM3LjKhdkIHpUiE8AYPUL7TAf5yWtFWQ317y+QRwAK6Tglga5HPSD2AzPBc9e\r\nvaoPpz7UqmFTEirpkJ4vJwJ6fSbJsCGYdh6ojEFfvaQbnb1ZkqCfsVbL7MhW\r\nopZgwZCLS/VmO3R824lsVVsPb34vlmDHiThIXX6u1ajTU4m+6BcWPtuzRBD1\r\nfqI5fMqcNMszXZZTIRfnVWr6k7Ch6/LzP9iQ8ROq/DUSoswLMfpXRiBwXbkV\r\nXQwZG0OekMwuzPDShNCDNtNJ4W9IdS0IbzQ=\r\n=sMzd\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"15a2d954f8c5260da0e9b6f65b6f49df69764a95","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.20.1","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.395f1ce61.0","@material/rtl":"15.0.0-canary.395f1ce61.0","@material/base":"15.0.0-canary.395f1ce61.0","@material/theme":"15.0.0-canary.395f1ce61.0","@material/ripple":"15.0.0-canary.395f1ce61.0","@material/tokens":"15.0.0-canary.395f1ce61.0","@material/animation":"15.0.0-canary.395f1ce61.0","@material/elevation":"15.0.0-canary.395f1ce61.0","@material/typography":"15.0.0-canary.395f1ce61.0","@material/feature-targeting":"15.0.0-canary.395f1ce61.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.395f1ce61.0_1665205715881_0.8637808582205637","host":"s3://npm-registry-packages"}},"15.0.0-canary.e741b5c82.0":{"name":"@material/slider","version":"15.0.0-canary.e741b5c82.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.e741b5c82.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"64ee28d06d0833e51d091d98c753b858e834f362","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.e741b5c82.0.tgz","fileCount":37,"integrity":"sha512-MSPDz2iZvxA3NV8qaIUPQXKEabKTeMhuRDfzDFF003imXJe+UK5qgyPhxd4laRyaolywV2z93HyJknrpOu8+TA==","signatures":[{"sig":"MEUCIBnKdjCBt43nrfhqsSuzzv+Nh3W38eq0Fb0YDEyZMsXxAiEAu2Wnuuz8R4anoo2p82e6sqJa/NBunI+Vg2yTPKGfIZI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":877936,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjRFizACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrRVg/+KfNknJGa8sQH4Si1oBj7wAxwhYmjYmGI4B/mDZrqNUblaUDP\r\nS5ZfrifhfiW1ocWloQ2/O/epaTB/qgbC1zHvP0bmFqIrV3wzXEu2Z/dMXt3T\r\naIuhZgjLF/xVJQP98u8zPABQUJo5OjVfij7MmBypQXQGIKP4PEB7dOjpIgZG\r\nIVAYOD9gNklthNjbJ2F4EoxOnzV1j4fvCWlg4bACdt6LpoM9E0YzXjBcz42/\r\nCL4DEV61tgXKaHCoTy6u9aUa6Jfqki94CvuVuCSup8p2dfCwNUdL9+v1Vrhw\r\nZSDPk5EWj9NlV48VikW5TxXcHvq//bomrfq+P1PKNDpddRlg1CwPuCIi0IdW\r\nmbhcwA1h+ryP7hjhPk7HRYBB9JO+e5y7LEHbvMv6naaDehemLjLHPbU/i7I/\r\nh7jq+KbakkStW7jFPgYULTfbocg2Cgvl0UAQQF5mYMH9O/OQBLj4QvR74JbV\r\nhPTkGv+rDzSlgbKJdi64ub3bCXHW+H9f+5GhY2i6iEwpu/hklyU7qTSYastK\r\nQNxmZGgis78lpHrUSTd785eW/lfMj5Qy02UTOtbVsQCI9GtI1J9dGdRor8jh\r\ndzRhA9pZoFaCTZKLRzoER6w29eSbFCGZOlYm6TXR1MXsMVv5u6N1xzVJagqK\r\nxfMausWnlx02IvkzsQidv3c4cPGRKofduYg=\r\n=wd8x\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"489583dc41bf06c909feb0a87f9679b40fe6c03a","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.20.1","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.e741b5c82.0","@material/rtl":"15.0.0-canary.e741b5c82.0","@material/base":"15.0.0-canary.e741b5c82.0","@material/theme":"15.0.0-canary.e741b5c82.0","@material/ripple":"15.0.0-canary.e741b5c82.0","@material/tokens":"15.0.0-canary.e741b5c82.0","@material/animation":"15.0.0-canary.e741b5c82.0","@material/elevation":"15.0.0-canary.e741b5c82.0","@material/typography":"15.0.0-canary.e741b5c82.0","@material/feature-targeting":"15.0.0-canary.e741b5c82.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.e741b5c82.0_1665423538915_0.6392889931089107","host":"s3://npm-registry-packages"}},"15.0.0-canary.582f3cc1c.0":{"name":"@material/slider","version":"15.0.0-canary.582f3cc1c.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.582f3cc1c.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"9e805544167efe92dc11c58b14bcc1ca2db83155","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.582f3cc1c.0.tgz","fileCount":37,"integrity":"sha512-8zh1v8Uz++TzM2P+RpLDm8skBAXieguqnuzYRR6i/ebpljvFHrSxpVTpttsK1kcu5zPs6AvZlZAcNq11RdtMYA==","signatures":[{"sig":"MEUCIQDlnX7CFgpA3+g6UC0NJxawF4ZjT61ILfOUTuL5RpGWEQIgM8UUqCv5+NpvWphDvuDgx+NSm4IceQEKItonrlnZgHg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":877936,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjRPXyACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrZog//SWPXBCVn5zuxZY/OQwhzCGRUEe4F+LHJ/Rze1hHld5ygVFOR\r\nnG6xZZyZb0g6VyEboYcrYuGOqjumDwzLtDY/4Cz1/Z6bCSiNqHQaUbDhcul4\r\nEpAlbvpQmjJnPMF6Ea/IqDfsiaEVFc6/U8b9+ktsAVbxHRCTHm7YNvEetQLD\r\nUJNqz0uWH7DJDcGE2JP5e2ORRh4AR8izUnkMwGz83K7UWa6LfgQdtHA6zCJL\r\nw9H+peQ8jNgwQO0fy39Tk25Kd0Xh0inaBh+kHk62WR1jja/4gQroLP2L1RrR\r\nTsy/J9e34XnEmUjgsbJygJi0rPINMjf0QvVQA8OjBO02KpOiKj1eCBXhUfyt\r\nZVlrTetrbR+xNJm7UXFwZGjyOa6OxfWg3s0V/oFWOoo39uTmdpXZXdaMA4rG\r\nvV7oZeq94Gk8+1W0WqE6O4LMWn9Y2qsN7QN891NqEYiNH9iNoJVZRAwwm4Is\r\n8G7PfO+sCRM/lUjgulL7RcDCM3xyVXRtt2eRIwZb4s9aKj7NnLSvffh2m/yM\r\nQaUJTXQ6WLXHiFID/wmEmJsS14lYjLaaFq1z25SgG9PxHoHiEnZ2FxXFEcdj\r\n4o1STOAd0lFrL0V8oGJEHb/6rKX8xWPwwNdKzDcheMX7vhfO5NC7lwZMw2vI\r\n50/xmyTviqPLzCtczg3UeUXvmPHKUPPG0dY=\r\n=5oSt\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"9910dd1f5b3fa962bd02fe552774781896efa7ee","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.20.1","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.582f3cc1c.0","@material/rtl":"15.0.0-canary.582f3cc1c.0","@material/base":"15.0.0-canary.582f3cc1c.0","@material/theme":"15.0.0-canary.582f3cc1c.0","@material/ripple":"15.0.0-canary.582f3cc1c.0","@material/tokens":"15.0.0-canary.582f3cc1c.0","@material/animation":"15.0.0-canary.582f3cc1c.0","@material/elevation":"15.0.0-canary.582f3cc1c.0","@material/typography":"15.0.0-canary.582f3cc1c.0","@material/feature-targeting":"15.0.0-canary.582f3cc1c.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.582f3cc1c.0_1665463794426_0.8546226565534496","host":"s3://npm-registry-packages"}},"15.0.0-canary.b1a6e3e88.0":{"name":"@material/slider","version":"15.0.0-canary.b1a6e3e88.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.b1a6e3e88.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"0ae57ecdfe3c36b83c04ded4e7f9a02256cb1b1b","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.b1a6e3e88.0.tgz","fileCount":37,"integrity":"sha512-SBdKpyIoKdq3HLkYDAxG5aaU7NtLbMo1Bq22Y9Z1LnB688dRtVtIV/LZ60/Cz7Npzejfu8GqwAn0A6dKqiqd7Q==","signatures":[{"sig":"MEQCIEi0R+JMDGGkfSOEQvcyYfE6eAkntDIGS74PLI3k46PlAiAZWXAUWqDvkNLw4VmyYqLEAEQ/RNf/iR7ckJl9+kb/LQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":877936,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjRqz/ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpVAA//fTuM99RD1v47jgFV7PeTckNJyFQf79Z2sWmWAO3JxOBd8J26\r\nmxbxD1n6PiPgMIYwUu/wSyb42wc8WpITZlREJg7yRti2/pcalJ96dWWD3DDP\r\nkVBdDmqepGpW0IZqOMy4SI4A2ldOJQVysGgAgzVDW6STgyXPhEfQl1tz9Rk2\r\nG3R1lpriyDgT0nsMAbsMMO8bg8sFDRuFOTSLreRPIzVkF7M3I36eHpE7a09C\r\nc5iTvmT+Q3WndW0ZcGLjqD0m8sP1GmTyA1WPJk382MhDRvMGksCvqktpZCQx\r\nZFjEjA5+mbkc3CmmPxq1r+4crTDtkdJ156SoJZjYqLqNyZowdHEMVIY1Z792\r\nTv2yc7TwiGCx4w+FSp7E+ubzVmHFWzlP5uObJBP2jmifePask+paQClwKpwm\r\nitfas12uICFc7D2AVzGBcbpoxxcgkI2NgzFXtKErl3wxij8tk0HkWcHraTgG\r\nXJxd5wiHN4sJOSgZV+Xj/ITbV5juVt6e4sAePo7CeIxVUjkx6twB6nE0x8bu\r\nLnfgth8yO3ALUq5HLQ7t/rWS7rbtmyQ4tPynXGEgKosvU0PSOIDgEsey2JQx\r\nHfeSfpc4PoV+yJNn3De2yCNnhwQpmxfJM2YiiqQ0RayKSxDjpzYZ+gJDcYGc\r\nQ+2fjc8o0PT982UXgfwnAFuA0EvaDBhO7Os=\r\n=yag/\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"fd6420b1b81c64578026927a4acf4ea73b7358e6","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.20.1","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.b1a6e3e88.0","@material/rtl":"15.0.0-canary.b1a6e3e88.0","@material/base":"15.0.0-canary.b1a6e3e88.0","@material/theme":"15.0.0-canary.b1a6e3e88.0","@material/ripple":"15.0.0-canary.b1a6e3e88.0","@material/tokens":"15.0.0-canary.b1a6e3e88.0","@material/animation":"15.0.0-canary.b1a6e3e88.0","@material/elevation":"15.0.0-canary.b1a6e3e88.0","@material/typography":"15.0.0-canary.b1a6e3e88.0","@material/feature-targeting":"15.0.0-canary.b1a6e3e88.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.b1a6e3e88.0_1665576190717_0.041834671974164905","host":"s3://npm-registry-packages"}},"15.0.0-canary.c9b1a31e4.0":{"name":"@material/slider","version":"15.0.0-canary.c9b1a31e4.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.c9b1a31e4.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"5b774af20eaa32c328e911e23ce5133b59d55118","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.c9b1a31e4.0.tgz","fileCount":37,"integrity":"sha512-X1tF1CoYw3jPtKwKHAYDPRGoGf/hRPNZRJGb2BDiZmJR2+x1CMeNzTg5paxkzyfNZeok9/oRKqUGpX27Gf8ceg==","signatures":[{"sig":"MEUCIFtk/RG0gfHCBCxKVZ9tupcnN4Io7JmQEqhHROilWnH0AiEA7jgRnP60oUTUd06Svm0pMFgy/9Oil0WDaroIGd3yoNI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":877936,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjRvJrACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmpd4BAAmgbGJRmbQqIJ48cB5xnJRjmuN3/SXjbJ52hH7Vkx/Vi7VNk2\r\nOPVbQfKc5x10U1F6BQCM/5+VOyv0yZML8hDygKxvKlQMnYFBqXiypQzp/22b\r\nBGxdzMbQ3dUqTVEU+jSu/09hsASrMEfgX2ujuU2anni/LVBQDfD6H85aa9uB\r\nFnOn5B2ZAhg7/K0b9gZal25XynmBaA+IniXlRAbG84nRHzLMAZb+dkwcxGqU\r\n5nTuiZCu7OY0Uvs6CMS+PaxuHQ3rKbOPMUjSqlNMcaC67Fu7Knma66lxswvQ\r\n+/i1CbSC87v/5N5vMnjs2F/moshtFN0c7oMJ4BFmQfYDypwmNu8t3vYoItRu\r\nUd8fCxHw1L7KSH1dRdLDQsGuTl6SZvhCNuBjuHf7DjiOhc7WH2CBk/tJS2Py\r\neRT2nUgFM3Kz3z1o1TrDr69I02/PKXdoFq4vQgNm+mK4RYmCx/mLr+QrviGL\r\n/dliYxf1xxTBVPMsHdlG7q8TWOajEu6AJ515M5Q6tQXlZoVox789znTJNqBu\r\n2ilW1NQjyTtjqkFIt3Nqm7wiSZ/0BkhVGZtKlM3zOaFD84cq37wxqjvuZepx\r\n1/phY0x1TtF6NUx53bMdw9Di5xr+JjFTkJJYmJc/BnR0W8VQqxkVsJbUcz1A\r\nwL5ikI5qbflJThjbaTJSOGS37RjCYj87yJQ=\r\n=3lXr\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"f7a6b71c85fbf0d1a9db952402e002f8421baf4b","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.20.1","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.c9b1a31e4.0","@material/rtl":"15.0.0-canary.c9b1a31e4.0","@material/base":"15.0.0-canary.c9b1a31e4.0","@material/theme":"15.0.0-canary.c9b1a31e4.0","@material/ripple":"15.0.0-canary.c9b1a31e4.0","@material/tokens":"15.0.0-canary.c9b1a31e4.0","@material/animation":"15.0.0-canary.c9b1a31e4.0","@material/elevation":"15.0.0-canary.c9b1a31e4.0","@material/typography":"15.0.0-canary.c9b1a31e4.0","@material/feature-targeting":"15.0.0-canary.c9b1a31e4.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.c9b1a31e4.0_1665593962904_0.30102658249669934","host":"s3://npm-registry-packages"}},"15.0.0-canary.13e9b0d1f.0":{"name":"@material/slider","version":"15.0.0-canary.13e9b0d1f.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.13e9b0d1f.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"f95febf1661a568936f007f10f79143012b0d169","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.13e9b0d1f.0.tgz","fileCount":37,"integrity":"sha512-gEXJ1NzGz44dYicie8Lql+ZbBF6LftlJ5J+D3YlEKqkS9eyyS1yVBTo5bL21H+1N70XWq/1tYuU+/PYm0V5CLg==","signatures":[{"sig":"MEQCIE2u5jmhFcH1bjbwAHums0oyOSOM9HiboU9J/NQX+qxlAiAC/PW1wAcW5BPtWBe+Hu+sUY8S70EXYPRMAOyS77C9XA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":877936,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjRxPZACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr4uw/9Ft8Z/4PVKwmtKy8d+g/8X1AXjg4dXtXSTe8cvtqqj6mrV/9i\r\n7roSc2t4QYeEZyuwjCsOujeoBgQRCtCJjBKHC792noFgliqDvydvWBAmL3Q1\r\nmIQL+QA2+IkdSgOU3xidkHA4hbrnYjt/3p6OMdHqOndxixccblj6WK5b7IEw\r\npI5CxGh9B6DH2m5+cRGoKgWN8+wGwDcIkOamIKfpp95AGKZoF5UY8tO7uFSV\r\n4e3jf1JxsxlQfbHqHVdKbO4rRL0rMDHoCgcWrtmiq4RRTRNtQTkoCETPWOWp\r\ngB3PZn1d/H/SFwJxGQgPk/iuMyHk9oVxc6LDE4C0IDii/VxGn+ypaGvEJ0mZ\r\nMe76ji93tvEu7y0vzQkRI1y3LEdpDFNLxckwtscUIx/yCE/j8OXCNeJjNiSw\r\nXdaX+3jdvTv2REBeIbUmrP8+QaGN4AL4yvYK+C4LfjHq/EuV/VfeUHa5LVWa\r\nE16hIuwml19XwoadJeDMel/1Lz8lSCa8p0dKsBRb2vXHuVTi2VSz/35ValHu\r\nDRGXvS6YMxsBxSpcbA9ZPkxNQDCdlCjBqMcIhCZVuSbSonfMnWiRG1caPYB4\r\nlCycmX+6jHbwESoykONzsB8rQ3nenbMA2MXNumBjI2NFuvqy6/aEQbs2kB6J\r\n28hI5478ykroUY9OxLcT6m8wHUX5/rPjJp8=\r\n=Hb6v\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"4d9f6e4f27b68587a15ebef6f003f73cdad60bff","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.20.1","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.13e9b0d1f.0","@material/rtl":"15.0.0-canary.13e9b0d1f.0","@material/base":"15.0.0-canary.13e9b0d1f.0","@material/theme":"15.0.0-canary.13e9b0d1f.0","@material/ripple":"15.0.0-canary.13e9b0d1f.0","@material/tokens":"15.0.0-canary.13e9b0d1f.0","@material/animation":"15.0.0-canary.13e9b0d1f.0","@material/elevation":"15.0.0-canary.13e9b0d1f.0","@material/typography":"15.0.0-canary.13e9b0d1f.0","@material/feature-targeting":"15.0.0-canary.13e9b0d1f.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.13e9b0d1f.0_1665602521305_0.5424082722569787","host":"s3://npm-registry-packages"}},"15.0.0-canary.1dc797e7f.0":{"name":"@material/slider","version":"15.0.0-canary.1dc797e7f.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.1dc797e7f.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"a48b412252bc572e8ab509985af8b0f50b835dcf","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.1dc797e7f.0.tgz","fileCount":37,"integrity":"sha512-/d2KJRT/yl+Go98HvuP0tkY11NCg19VqJvGKxHrvy6OSPyoNHK5xet70pBWHNQsymz9RbH/dPXTGpOOPb9FdCA==","signatures":[{"sig":"MEYCIQCpkuiXVgtDPI7iy01NzQPmT9w6/NCMHCpF7g5OdWLcFwIhAI1v99tlF/oAYhXcclZGJOCtTZ3fDKbYka7AlZnkKfF3","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":877936,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjSS7/ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrS6g/+Pc31mC1ASFb8kpsvC1Ss4KpBi41aZLAGuXu++jPzJppdinls\r\nmM6X/YolC92pZzNKHj4a9jIWsg7VXHCUcuUIwRlNBOp+VwpBFxcjT1vDHwZl\r\n0YpK4HGNQBj3X+ZDfNgZd+XngcRjpL4HNB4I2OAUUT0zKcGYImu1b5dz32+G\r\ndU930sX+BMDbZBvzbLcaK7VGL0xdxRA2xi90B8v+Wu+uE0Lv5AGM3/BQ4OLJ\r\nP8Le35iM+vmIbKN25two8U7qnpqKGHfJmi9hsThhpI1xDGJnw/wmRpKEyGq0\r\nWfUz8yQwgG4GPLB4/kzNSfLvz8FV0MhKWhol21WBTSWAQ1vjX8SENX4T6Mmj\r\nLGsGbMkKXp2trlMXQh2+Rny5OAefnWcx4L/rmnkKx1O8kBhTSM/fOrrj10h6\r\nvrFVtYJXZ3bPNqgLo5blTu3O5eYJQVqFpAYIGevSyHuW28SCR+9RCS+kXyyh\r\no2F9TSuDRXpoO6b2pGJOC21DCHRGaPyOpdimWyUfqIUMA1lldOGN7wZeNftd\r\n1vIQJ3ghA6HnqR8PIr8p5MhXR37rLAmZGJxnUpUAGKQTh0ffgVEYEfS2VIJH\r\noxnqEnHEjLmTSmTbCDe9fzKMhI+pHzp1V2C1iq2o68cAORB3oNckIgakSPHb\r\nHcGeLqoZ2i+obWjQ3z/TuaVpvkiWfRAg6+Y=\r\n=21wD\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"22eb0904d0b7a84996854bc57cc417286deb08b1","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.20.1","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.1dc797e7f.0","@material/rtl":"15.0.0-canary.1dc797e7f.0","@material/base":"15.0.0-canary.1dc797e7f.0","@material/theme":"15.0.0-canary.1dc797e7f.0","@material/ripple":"15.0.0-canary.1dc797e7f.0","@material/tokens":"15.0.0-canary.1dc797e7f.0","@material/animation":"15.0.0-canary.1dc797e7f.0","@material/elevation":"15.0.0-canary.1dc797e7f.0","@material/typography":"15.0.0-canary.1dc797e7f.0","@material/feature-targeting":"15.0.0-canary.1dc797e7f.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.1dc797e7f.0_1665740543092_0.6457708932337951","host":"s3://npm-registry-packages"}},"15.0.0-canary.ed4009397.0":{"name":"@material/slider","version":"15.0.0-canary.ed4009397.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.ed4009397.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"edca6d182d086e90be4b1c03bc7bf1c0f79a54e2","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.ed4009397.0.tgz","fileCount":37,"integrity":"sha512-pKnTkrrZ3PP3kUxLH+QEXpZvdSZyp0Lgm50J1EBxG8EqmMa45Cod6AJEjYHNmF2DKC+Q2ol+hfDPnEfXB6aMsA==","signatures":[{"sig":"MEYCIQCxws05GRvU/mOpbRSH264gLO9n8dD5YsUrOxumaLa0zgIhAKJF9s2nq1VYyrIa3n+exYflfCR4nj1Nz81sFmygc80C","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":877936,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjSZOxACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrpiQ//b88K1uUjcwmtQHtnoW4cYvUgoFcaWwT6Fx1y4NPoP2F+k5O0\r\nQgKwa0whUlFMXwc6UB6y7pRUD74oVnEIk+a1tiuJSorCEQ4w07CJUX5yDTcf\r\nXv9dNZOOup2FNx8ML31xaUJK7jT86igbCzVJL05gvcJhBXAR7NVw8EaM2grK\r\niUWCo9HkoExWbnJDW/uXJmLpFEJfTQfMJ5x+mrRVbjLq17R/Dv6++imLfO4G\r\nGaKmYtfBl5V2HsJPsx5NHXYUdKqEuywhhdJZC41HFmzIJqEsv35eUKYU7LFZ\r\nJ2d7P5zr2d7/ge0Po/1UUNzESYpE07l5kcS2RXcdZ1p/MFbO5vidczw8R7Kz\r\n54LthGg+i6ffP8AWA6EgwfhUOnlqa4VVAbVWNI2acYJU7VJjufOiTlVGE2ys\r\nVFPe77+g1qXlFKsYvG7G7uioRQ/kgK4T5dtUtxbXyELbxikCKCFwTptdjEMR\r\nTFGj6nq2lOEIdyWwngwSSlQszXtzGrmZ+2mFCFWaJ91NQcX7hWz256OuSFax\r\ntA96ybQSAGaX0/wtUzVN9cYzjve6aRJ63sLRDeosN30md/Dh50Q0QsRHZEGk\r\nBcsBm7IGpowWUgtc9ezFlvUWUWfFr61cs3GAuoBZGE3DztNGiptGhJPuphd/\r\ncNR4K6KhRqMLSMk2MEB0CEBzoD+AYlfl3uM=\r\n=WPKB\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"a749634198bd160446873ac2c5cf3d4345b1620f","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.20.1","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.ed4009397.0","@material/rtl":"15.0.0-canary.ed4009397.0","@material/base":"15.0.0-canary.ed4009397.0","@material/theme":"15.0.0-canary.ed4009397.0","@material/ripple":"15.0.0-canary.ed4009397.0","@material/tokens":"15.0.0-canary.ed4009397.0","@material/animation":"15.0.0-canary.ed4009397.0","@material/elevation":"15.0.0-canary.ed4009397.0","@material/typography":"15.0.0-canary.ed4009397.0","@material/feature-targeting":"15.0.0-canary.ed4009397.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.ed4009397.0_1665766321236_0.7342740748148626","host":"s3://npm-registry-packages"}},"15.0.0-canary.95ef196bc.0":{"name":"@material/slider","version":"15.0.0-canary.95ef196bc.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.95ef196bc.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"d69b3fc8e8cfb207f8e2b1cfea41a5bb23583b85","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.95ef196bc.0.tgz","fileCount":37,"integrity":"sha512-WULpHJ6+QXUNSMkhp4ZG+qhrkkODQaaQXhqpK9JqNQfx/nvNKaD/JI8PfE1tMCB+jB7qj2uImm6lLGpEiDszOg==","signatures":[{"sig":"MEUCIQClEOTZnwb0h3Bzu2lNcAXNy1UuoSC8YBk4cL4EkK9nvwIgLPBoUMOrM1zm81QqlWw+/o/iRRBcbKvh8oJg70OYsv0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":877936,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjSe1iACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrRlxAAl/nqu0WJuCjOtGaNlcufx4O9xQ6l2z9VJhNqeP8HcLLuuy49\r\n/WOsyjl1nrOEhvOd/FY979ksFTT7XGpo7ptoSbFDvjbHWsba0Wg55/GZQjA5\r\nkszjbiTqkX8/N4bB6GtquXZYh1D2isB9vOwiFjDny5QIPgqUUt34EHkBRho5\r\n8HlgGmbGTFBOCTvkdQBCw5dJno9XdkxFkOa43m+PnSAcbEwuIMUamhOuXy63\r\nWEj0fTChiRcAZCTWdWVSs+P3BjCWTiL4g0gCG4lwW9/WRfdAshXhsNFn/3oM\r\nsYEID0uWmHCc96lahQB3mzHEBriaG915Mt3k7mY5odEjK4O/wwf6eyZs4dZo\r\nGFtAmH1L8eK1eweW3/332Le82xjPNmZxrogD4W2nPJQZLCcxr1wxyhgGvh0D\r\nwbEoJS9rBY2d9JGHDytJme25S0wuayxAZr2S2Brt3B4ZR5gRlaSk73zqiy85\r\n4wzbhXpIm5nbEbmxoWO6kRtg8VKfhDGT1xwJRMvMopajP5wrPwYskSvYzDwn\r\n5PucEqHuWzXsvanLv8YTiFh12kKY390iVGeX3U6qNS/KGBzdi3qqIgSv1PZ0\r\n+tcnKqIbQJ5QzdIXpirjprU6S7r6QP0AwLhrsExIUQC8HOioBh8zpsx6y0xK\r\nau+4G377Tayh2ty43U5yqBtmIcK7lsIKDF4=\r\n=veSx\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"c133997c8c45e50d9ebfe12fabab75ec90d244e7","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.20.1","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.95ef196bc.0","@material/rtl":"15.0.0-canary.95ef196bc.0","@material/base":"15.0.0-canary.95ef196bc.0","@material/theme":"15.0.0-canary.95ef196bc.0","@material/ripple":"15.0.0-canary.95ef196bc.0","@material/tokens":"15.0.0-canary.95ef196bc.0","@material/animation":"15.0.0-canary.95ef196bc.0","@material/elevation":"15.0.0-canary.95ef196bc.0","@material/typography":"15.0.0-canary.95ef196bc.0","@material/feature-targeting":"15.0.0-canary.95ef196bc.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.95ef196bc.0_1665789281798_0.1051760409196334","host":"s3://npm-registry-packages"}},"15.0.0-canary.13eea1b2d.0":{"name":"@material/slider","version":"15.0.0-canary.13eea1b2d.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.13eea1b2d.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"724402973b0bc5f4bf4f89638cff8e0d50227a1a","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.13eea1b2d.0.tgz","fileCount":37,"integrity":"sha512-YQu+n65mZc0X6T28LTm0j+Mjidzzv6XicGu6jhnNVCNuCHtfOXY91VGU/l2PLW1mg0HZw4BoqwX4kQMnbML+Pg==","signatures":[{"sig":"MEYCIQDi7ho+ns0k3Vk0zQZbMi0DVGZTCH+Efli4XvfXkN0AqQIhAJNOW8t1KA9yKQ5pJbICuXykScJ3+idyv3o2p2FF1HNZ","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":877936,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjTNFzACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrjXA//UGhcCKJ5cmKpoa8IgXYJ+PXdmB2+iBizRox6JOkop3xNO9SV\r\nnYKNylFfPehkqBZ7rx9LIfbPeSh9WZrAQLljaXouaL3PS7vedmGgT4nCSHYG\r\nlhnaSkBybbHE7frcVODCyCuEJHov+6BNvpPnEfL7Rmj0RW7oWyZjDXp+P68t\r\nPqXBKlrlATfSqdlqgyfioKijLLCMzbmJ1x1EwyeizF4uqkKueAThuJYczZRm\r\nyxgpwaHXTAVTXverEdaouu1HjcQcZGLJT1yKJaykdxFFGnwvPRlqPxy9HTPl\r\nt1FjulxjFLrj3v4/Ugso3T38cVDJF1i8a97XA1OaoKszAPiMENvTJ4ckxZxI\r\n2tdklAjWV9Ek1RzMlkyNdCbdIqZDEktK9x7bisgsUrmk7el5PqxMG0qNgLLM\r\nORryQCr5z0VqdmGukoH/282mx+aTEmBzutXtTXjVIpnNCB7wEKAtxDGOOx6y\r\nvnTtzPxnWW5w8LPGf0fxLD3cHJTNxBslWGzdNjZFqyU22hZ+6e6cB1mTy1mx\r\nKo4KuS7RhDnePVOo27WfVn6ACyPDI47w1gDcctxOwo+CxOJvhNxUHGaRJIR0\r\nJEheuzjtxowjK3pvRGhNWMHbHP/O5KsiYET8KaqF+Z092RtOLPVsKEOlSH5b\r\notSwareVlZZqkiC8TGDhlU4ipQSU7a20PM4=\r\n=pmnz\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"e9a13860e495e7f113966b4c71b9c7931a32807c","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.20.1","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.13eea1b2d.0","@material/rtl":"15.0.0-canary.13eea1b2d.0","@material/base":"15.0.0-canary.13eea1b2d.0","@material/theme":"15.0.0-canary.13eea1b2d.0","@material/ripple":"15.0.0-canary.13eea1b2d.0","@material/tokens":"15.0.0-canary.13eea1b2d.0","@material/animation":"15.0.0-canary.13eea1b2d.0","@material/elevation":"15.0.0-canary.13eea1b2d.0","@material/typography":"15.0.0-canary.13eea1b2d.0","@material/feature-targeting":"15.0.0-canary.13eea1b2d.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.13eea1b2d.0_1665978739628_0.30023647950132215","host":"s3://npm-registry-packages"}},"15.0.0-canary.ef9b2babb.0":{"name":"@material/slider","version":"15.0.0-canary.ef9b2babb.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.ef9b2babb.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"30ac4bf8f265fbc0fd70350139738c57ecd79219","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.ef9b2babb.0.tgz","fileCount":37,"integrity":"sha512-DsuSIs7rSpP2dOMsJ4HXZRPwLtm4XJDerI8Yt0NuTEVS8YtuNI5mxh0MwKKrKhfIA2/mjvcpNWdx73E7PuLtZQ==","signatures":[{"sig":"MEUCIEt0vFaoMc+Hf/Lj5viW4SijglS2mQTOyhmqK9NV9IN0AiEAyxXIVMG6h51EfJJ/ruCptJXtXjmReA0tIFvcSQpQH6M=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":877936,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjTR35ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpG5A/+KN/4VQ/LYnyHJRoUCer0V0aKnBmg/k0WrfWQVKzHsBJOp/BP\r\n8rDQoPHuavt1NRSA2D4kfe084ZTAtuhhyZxTMD4JPEH1QjaTWqRkNxqLkTtS\r\nTPElHiOHkdIz845uymigHPfMeOt9T0Yd+4NosWYEbLgiut16pi6xMlPV8nBx\r\nlW69CXRRF25ssgxOYug5Wu/eWnzXDSsp9EvFHXw3TOtfaVEBuml23uCRv4th\r\nIvc5XvgS1fNkUvTh+eP4y8638DZM7MKRhk8sYlPl+gnjsJb8QqDYLOz/ajzs\r\nOrYHN2X67cmj2VqJarCQyrglCzLfbUIbIEvrnqz7Z4F9Plqh2qWh4NpCRpfW\r\nZT3Lu4aAxEAC8Fuvq50aX/14x+myfTiCocemSjb7+c+1HJJobSAVCUPrprnD\r\nzF/r0A9MK3mt2aCMRE/39z5p6Rh9J476forRnOV4EEYaSmvQYssslwYATvZ9\r\nrltLiI+rdyJoxuo5NnCBD5Qp7Q4e+1TcJfneMQ6UgxQxjzpPLsL6PYnj5E93\r\nHHI0w/UYi2Uu2ityjWgx+3qjiOSzEzw3zK0CpwlNWhbeO1jjlVcHDBD8s+Zb\r\nD8m8nS7ht7p2JFeqwX2F1Vg9CsA5PO4Hp3WKqTW1sZX11sgcBaZbo5NdXt1s\r\n3+FsT63dBnF10qaPMuJxoI2f5CCSTSZK0U8=\r\n=F2PZ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"2e04dcc89ca80bfb50d7ee1e4172ff9713c149ba","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.20.1","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.ef9b2babb.0","@material/rtl":"15.0.0-canary.ef9b2babb.0","@material/base":"15.0.0-canary.ef9b2babb.0","@material/theme":"15.0.0-canary.ef9b2babb.0","@material/ripple":"15.0.0-canary.ef9b2babb.0","@material/tokens":"15.0.0-canary.ef9b2babb.0","@material/animation":"15.0.0-canary.ef9b2babb.0","@material/elevation":"15.0.0-canary.ef9b2babb.0","@material/typography":"15.0.0-canary.ef9b2babb.0","@material/feature-targeting":"15.0.0-canary.ef9b2babb.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.ef9b2babb.0_1665998329201_0.6325442044445528","host":"s3://npm-registry-packages"}},"15.0.0-canary.cec7fb987.0":{"name":"@material/slider","version":"15.0.0-canary.cec7fb987.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.cec7fb987.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"b385c8bbe411eead2b84b96fa4c3c2872dd912d3","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.cec7fb987.0.tgz","fileCount":37,"integrity":"sha512-am6XA4HN+u2OcVrfTbhEURF4T+PYhGanVr37SOCuytw4tXU3g/RIpSevhWbdNtAHdgg7ejIRPRjR0yoo6Kan9w==","signatures":[{"sig":"MEQCIQDmA2iiA3NJgEsw/wlyZ6t4U1FrqRptS1iZMxBJUFkGqQIfWJrxAR/cpqQAdPoLknmqEGW3MFidOl1wvr6PrzbTIw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":877936,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjTTUBACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqoMg/8CbXmgNhGEMfxEubPFhlootqnzS8XfMW1C4LNYEVurfA/jvqy\r\nVTlsXCCXestzlfIv5ub5UGopmkDRR3ixI5TOHqTfpvKeTgRDyT6WBOQkyhES\r\nPZzuxYyK043ZAl8siYGfFaqt/AQF4ZRDOFZ75VBc4Gz2NxNSMXSLTRRoiFem\r\nR0wVf4CeVvGt6ea1G/R7hTaVUP5RkfC1L5JNASNAc0Ekgz0npXIBGMavAJta\r\ntsYo8P+PtLm2uHhiVW8lkA63/Zu5CizVLNkz4ffrufmcx8LkIPPFHybQcdqT\r\n11L5D6OJOZm4++aphan5syEvEgjDEGUAjLmPWwpm493hnF5Zmsks2T4nJSnW\r\nl/+6i9NmCvg4FUsrNqNp+2MCF0FM7Y6RQRYsAMQgY62/Arsxw4q5rrVnR5Cu\r\nuznXURstkXjkA4NCMJTeLPyLqoauovS6aRf2Pl+lv6tR61j3YQ2YzNx5MT+2\r\noySvc0clmd/4PINfbylr3LiNnrDTo7I8/TnGlSkJLGqVwqFsAy9fta/NdCyT\r\n6XIt5eGc2nZ8PIZytW3bmH1V/4qpI2xPAXpBVH/YKWcxMYY8fwWQNJMpB0QQ\r\nEgRU7veXeIeiHi7tvRDtnTeSxUGGwPw5d06SLllpyq/LFHaEGKpZDnulWBDS\r\nKq1xfv8vR1uYN4jdWnEGKEp6giqQIV2Omj8=\r\n=PS3L\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"5af4beeec511ff0266173424b4b179e209402a5d","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.20.1","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.cec7fb987.0","@material/rtl":"15.0.0-canary.cec7fb987.0","@material/base":"15.0.0-canary.cec7fb987.0","@material/theme":"15.0.0-canary.cec7fb987.0","@material/ripple":"15.0.0-canary.cec7fb987.0","@material/tokens":"15.0.0-canary.cec7fb987.0","@material/animation":"15.0.0-canary.cec7fb987.0","@material/elevation":"15.0.0-canary.cec7fb987.0","@material/typography":"15.0.0-canary.cec7fb987.0","@material/feature-targeting":"15.0.0-canary.cec7fb987.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.cec7fb987.0_1666004225535_0.8603802421382696","host":"s3://npm-registry-packages"}},"15.0.0-canary.4fff58b08.0":{"name":"@material/slider","version":"15.0.0-canary.4fff58b08.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.4fff58b08.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"59310f80bcbdf1ac495d8b6f5a8226d50881419d","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.4fff58b08.0.tgz","fileCount":37,"integrity":"sha512-OufK2fmWdS6Ua/oYUjIe9YTIoG90V+cMl5ZZOoTwm5hMj6eB5MHbcG/30znZMHeCX5A1A1BpH+Yee6/Ox/p+jw==","signatures":[{"sig":"MEUCIQDVnQA4Odafe/mc9nwpYiwjlFw4Sima7vXkrym8W81IeQIgK5FEZF9X5UDQOfZESA4tDunm5wZhku+NgO57JZWWATM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":879901,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjTXNrACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqI7A//T1ddFuBnd9kPUfEHjHuq6pxG/7CI11V5hmAc0C0OZ7d56IFt\r\nm62g15q4Xm/6PaZR/sO3jTkhdENqWyCEXnowRQzizCw+P+vn2MYzbDMWxlya\r\nS/G2eC3EAa6oSKx2kNTriD9C5AL5LvP9L+BU30DTwONMvEwajyCfbJdoFBrl\r\neD8vvPqXdWrnBh57cLBwHYqx0SWSRlOMPNVppX/GSxv7zw6yysyoAlH1UFYq\r\no2jA4MFM52i7z+IlozTdtfZaWWdLVHIku7RmqlwE+jhUHwnoJabVV/dW/qVa\r\nrODIzSeLN/byPWb4saCHUWoY+5SGPEVYv34dEoeuzyPrzeLmyh5v4EB5wWkO\r\n2vpn8f53cwUs7+dDgmFhSIOFeoizjqObSaH7bVkL4OS0jwLmmlQHItlSqMea\r\nYeAnkj/lVWDXLqaL9gxFYV6wfxhQWM6jGLvmxPkxcqE20gSFaKMVLm+q7UlM\r\nzbhBjtfqDFYN9zc8rgFGEu4vvZB1Wdkxu7Bdt067PgEqDgpy2RplyDf46hTx\r\nce50Ml7HHcdtxNNkVLKjOUqoW2KH1njzK2FYb3oRS6O8ji/VfL6J+PzmEr5U\r\nd6RLVmSTqmglGN0weuIhX7xUh2imjf30YhzV5no7WcFGfzTaKc3EEqB9QWsT\r\nHfGBWXyMW0kAtgC/0bXIULTKGSZDwg0wxk4=\r\n=yZmc\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"b44726c7f5a5db16ef660807b5247cd71a447c80","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.20.1","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.4fff58b08.0","@material/rtl":"15.0.0-canary.4fff58b08.0","@material/base":"15.0.0-canary.4fff58b08.0","@material/theme":"15.0.0-canary.4fff58b08.0","@material/ripple":"15.0.0-canary.4fff58b08.0","@material/tokens":"15.0.0-canary.4fff58b08.0","@material/animation":"15.0.0-canary.4fff58b08.0","@material/elevation":"15.0.0-canary.4fff58b08.0","@material/typography":"15.0.0-canary.4fff58b08.0","@material/feature-targeting":"15.0.0-canary.4fff58b08.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.4fff58b08.0_1666020203599_0.2598703317316351","host":"s3://npm-registry-packages"}},"15.0.0-canary.587d8f871.0":{"name":"@material/slider","version":"15.0.0-canary.587d8f871.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.587d8f871.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"701601ace4a3240713058865854d06e6c8179179","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.587d8f871.0.tgz","fileCount":37,"integrity":"sha512-u573YoP7NMDjFffJPp3DiiDCTQ1qWt8xoEWr/ZoZmChw+Y+u3s5MQY2woIpKGZE1LF8v5vnxFnyY/Pg1vv9zpQ==","signatures":[{"sig":"MEUCIQDUA0nYNqBgWsx54ySQ41sGwjg7SPfof2fcLorweGybFwIgS+JpjGAffmA/xQIWbfUfC5nUYYmxiTVvrApBquCZzbA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":879901,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjTXt/ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqC9w/+KDNDn6AzhAXbiCA6HQwBDZ1CMaUOwUikx/E6n72QgfIOICS9\r\nHKFQpWb7p+jDGbA5qm05bhbTdP1aHI02SK0+eXkexwL2+RBHO7ztwhNcUewI\r\ny6EJLzUPn+mPbO6+SW6iJrIazRuT55m5veaVZUjc2Bn6E506plfPFBrceGpd\r\neut0VtIBAvn4FLKSeb60bbcmvlu1jY2TAsEY1vCNJZHtlG3QkWjqRgZlJrhf\r\nCPfBfkXo48+uzrcQ82+CVgWMYUEvPterDlx/3olfw025m6PF+FFFtADZiH49\r\nTZUs5/I9Qg3SA3SfnfJf3OgBpbJ/PdPpRRGfPdEo0O+abcnxcPrO0qMahoW+\r\n03NklxYFKQ1MYZsuQagcvF9T6CPgtnsv0tnPE1ULXQaSs0p/rUjswn0v2xME\r\nqIKfBaeZefTTPHdMjOI4wmaB1W/c/8WZ8AtttZ2fPHrkIXuMfiuRjXIQZdow\r\nFucqCze41jbxjz6/JcKVO166uYuGcAuWWFwgOFarm90Dpt5rnoPCp2wG0N+Y\r\ntmt293rIqeD18xz/KTYrQTg1Xy7aNeTEVWwHKE/mC/rX+qj71UDnk1EbKA6K\r\nBZJrP+3hdO4W0HNiPehH4xn0zMXZZ37C0levMkKyqqYwHpJ6cQdpohshuzId\r\nFngiGC32NO/TUXTmwuKgnOl0HYEuHXnFWGE=\r\n=1pnl\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"2ec38be871dc355461961e4ac44d48ec44c42a1a","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.20.1","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.587d8f871.0","@material/rtl":"15.0.0-canary.587d8f871.0","@material/base":"15.0.0-canary.587d8f871.0","@material/theme":"15.0.0-canary.587d8f871.0","@material/ripple":"15.0.0-canary.587d8f871.0","@material/tokens":"15.0.0-canary.587d8f871.0","@material/animation":"15.0.0-canary.587d8f871.0","@material/elevation":"15.0.0-canary.587d8f871.0","@material/typography":"15.0.0-canary.587d8f871.0","@material/feature-targeting":"15.0.0-canary.587d8f871.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.587d8f871.0_1666022271103_0.49474239779633966","host":"s3://npm-registry-packages"}},"15.0.0-canary.edf4b98d0.0":{"name":"@material/slider","version":"15.0.0-canary.edf4b98d0.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.edf4b98d0.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"590fb6d470b5876b30368c6f6a456f7d448c1ded","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.edf4b98d0.0.tgz","fileCount":37,"integrity":"sha512-ykoH5URVdHjX3+S4/2IiLn78337z0nW5EjGhqZV/RPa6zorWkwNs5xry84Tj998040AxomEUR8U1SiIMD07TCA==","signatures":[{"sig":"MEUCIH4zfz32MTx26lWDBRQTBKAcs27CtxIkZBy4XTSwF7OZAiEAwBZoaBZPiG4wzn4bEywbZw84HkQQ2KMEvEjN0yK/ako=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":879901,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjTYWpACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmpu1g//T/dii6tDHbHCdvFAf2Wza2mhXEnJ4L1Z98eUjM0gb9iLwFjP\r\nJK6E/XAgrNICAM1TrtP4iCcGKG0+CD/8CzGdku6FWbJSyYl9IsQgY2+EdP8P\r\nRmgSkfrrg1XJUVz0dXQ32HICPqOiipRyt50PlE+pE8Z0XSWXN8JAByvHAWY2\r\n88t+WjKS1gM9XKDsjv/Wo5aGLCHPxXnM2IKDygKQbDpbTVqXK4Mchy4fwL9o\r\nxeORURTvZwZv8B0JMOVlaRXuINQGL336ulcCI2X7JMZizPWcfhUbjabCmFyA\r\nyBYvHOB17H1unFI/TEFArZgeK9n3bbduaPqsKHEI+1WzouY2E6J4yFB7rjxL\r\nRCKEN/OUxduENOIlfCKRjKiMJnfyFzQWhYe7a+O8l7YmDmuShxZO6Eez/os8\r\nyfpUW04DBHCqFmEka/ielYDeNzvOrWrXq3Stlz4dT+BFmHEzUGH58p10N2Ki\r\ny3DF5nqqTwmb7MwFClk+GGw+FLlggn03uY6b2T8hsPW8UUYIAimTqmBnoKRp\r\nMnf6vXis/FCm5XlgXSbKB76Q9IvBP5KpBMe+Apgj+DgWtD9DhyoXWH5hZOlY\r\nJk7XgoN8NSQLC23lt36DQ71zKNsb/2oKN/erkVux+zaQfvUCaL5g6CRGH8CF\r\n2ygo607OOlBMKJ9XNSl8yHaJqeic1PVHLGg=\r\n=D75y\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"ad4766965d2bd24e69b2e2e6940c960907c93c1f","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.20.1","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.edf4b98d0.0","@material/rtl":"15.0.0-canary.edf4b98d0.0","@material/base":"15.0.0-canary.edf4b98d0.0","@material/theme":"15.0.0-canary.edf4b98d0.0","@material/ripple":"15.0.0-canary.edf4b98d0.0","@material/tokens":"15.0.0-canary.edf4b98d0.0","@material/animation":"15.0.0-canary.edf4b98d0.0","@material/elevation":"15.0.0-canary.edf4b98d0.0","@material/typography":"15.0.0-canary.edf4b98d0.0","@material/feature-targeting":"15.0.0-canary.edf4b98d0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.edf4b98d0.0_1666024872830_0.41781349590679917","host":"s3://npm-registry-packages"}},"15.0.0-canary.024ac5f16.0":{"name":"@material/slider","version":"15.0.0-canary.024ac5f16.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.024ac5f16.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"8e3c32ad846d6fdb52ef55909189152d67dcf0c1","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.024ac5f16.0.tgz","fileCount":37,"integrity":"sha512-YMcB2SOMam4mOLJRDZpQZrudHMZrtgvYCwngmjgeM8FeqGilMbFcuIwcndQUKHuLqKp8j2ATfPxO2RpKERFXsw==","signatures":[{"sig":"MEUCIQCcoziToIiHFcStpwusMBkoz2QxHNZTp5skoRLjbfji8gIgaflSvunmHJK5AMyyFNzRjdyIJeOWZI5P0EufAcZinVk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":879901,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjTdp6ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmqejw//UZOgWJ6FmFdghLAUrgbyVqPDGM1JMTRLAy16RWHaJflV54Ve\r\nzK6g/Ty58UR6GL+wRbSpsC1OKz7xi2PT8FxvIbkUnuDibdG4ykbwxlcqty+U\r\nTXn8xgXuCWkw5PGXNp6XygLYWyeq8ECg4rfX0piuqghlONzuR42vuu0hzRpn\r\n4Ocu5D65bOMATx/JTfQXh0aEyoiFjE998BqExR99CvkFrYq5jHjovHzIiwTs\r\n+qvHl50qaWVgZvaEiy4lqhvt1jIB+aOOPDtqAPSa6XElkm4344u6wQ8ttTC3\r\nKvluEWLZYRdKFT4muA+x0rtzNLHdGcw2PixZS3m0JK3iyZi1juZXen0eqvs2\r\nxYNy69lk55j2rZzvtMwdh7STW1rNSKJD2Q3Vp1PMUdaBI8m5gKnzni2E05hn\r\n4khFtP5s1SVWaI91MO4au9wGpMtCWmbctK0dzD83CzzrlWwYkRtXR5tra3l5\r\neJYk7A2KA+hIuNMIt2SK5K1oFjFZtJYIh9oLJlWztw4mLEeL5NinK5yF7DAJ\r\nMnXfnkdqiARql0BG20f4Tsc9Dwej28K7ilDN/D1O3wNNz0+nqSSy90K8DVNR\r\nSSqT0RTMMq2O6B2AgftWGk9Uje7Ra489sTEGAgTAtq8NqxzdvSy9mQW6rWX3\r\nApIPrMKpsMnBPmJ5nfPt6MAhwcJPl0Cmfa0=\r\n=yVMq\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"9ad8e77cff1167055c10b93b4082fd5b4e1d8643","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.20.1","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.024ac5f16.0","@material/rtl":"15.0.0-canary.024ac5f16.0","@material/base":"15.0.0-canary.024ac5f16.0","@material/theme":"15.0.0-canary.024ac5f16.0","@material/ripple":"15.0.0-canary.024ac5f16.0","@material/tokens":"15.0.0-canary.024ac5f16.0","@material/animation":"15.0.0-canary.024ac5f16.0","@material/elevation":"15.0.0-canary.024ac5f16.0","@material/typography":"15.0.0-canary.024ac5f16.0","@material/feature-targeting":"15.0.0-canary.024ac5f16.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.024ac5f16.0_1666046586392_0.8206281322574773","host":"s3://npm-registry-packages"}},"15.0.0-canary.c8bdf6144.0":{"name":"@material/slider","version":"15.0.0-canary.c8bdf6144.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.c8bdf6144.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"284c1853af68e9ff3742710b206637f1982c316b","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.c8bdf6144.0.tgz","fileCount":37,"integrity":"sha512-R0MgDcGJhWNukIawJpzRpwd7uaKBqPnK1AG/G0B09RIUfQEHIy3ghP+RdsIWF3ASyazLkXU2sGywW00NIWZsHQ==","signatures":[{"sig":"MEUCIQCvrgeNd2Uz9CbD0ZRj0C30Cj3qTKJX9osgdatiu5ikEgIgRFcPgw64jFhegmxVhuoBzcXfO8+H0+6VGcn7DS/LEdk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":879901,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjTu9JACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqDBBAAmpmhSX5s3x27b+7oIuFhNIspW/LwofPRj7kUS6K74P+igmPd\r\nuDG4CcHpIRcr/zpY38lNPtjBLuqNmOzpbiEj5OUku1F3yBcnouelR1/iR12F\r\nHjxavScJHGRzeof+kW9UOfL3dXMkY3PDs5dJqqxsn4Q2sSwqDpyGGBSOxF6f\r\n1by63i2/KziztgVqFswIbvNkoUeWd1EJhEwsrPPB9dKQwiM+GZOv/5DuPhUL\r\nTyAJL2XDqbOcnNiym18YXWGu20njowylzm9Dq0dGKq/SItv7XjyT+Gij28Or\r\ntrRjQaIU4BVIVhbylDvNjVTee3VZ61qHYzrRSSzWDaOxmIEn0GBI3heNhux3\r\nKJlcKmeflmZ0nxa4aBbUIcgbC55AAAJY5UVLFdYqmxou+eED9o3MMQF0RxUI\r\nq06/Lq4DFyzYVBTO2RYrRG2IGOkuANMnX0w45kX3qDaVM8EhMcPz09P8bOEw\r\ns7EuZR4vdAq/Jl8PCZN+FehPYKXalKBfJth1BJMHdLVmMHwr9WGHNSnoC75O\r\nEliQvSNCfpb4a73cXwxXs7EFEq4MLoz4A799//9iQvg5YJxnhbOXuo80gB7a\r\nezHgdsvhzk44KSW05fyI9AqXRoO7AGwcw8KBuPvip4E46txmT4OiR5nxrMuJ\r\n3Vwe6ZPdzm6rF3TTAUH2YItgRTCbpuS4czc=\r\n=W6zj\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"92f4fcf51598cb8f9b9e03a35332a980296c24e2","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.20.1","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.c8bdf6144.0","@material/rtl":"15.0.0-canary.c8bdf6144.0","@material/base":"15.0.0-canary.c8bdf6144.0","@material/theme":"15.0.0-canary.c8bdf6144.0","@material/ripple":"15.0.0-canary.c8bdf6144.0","@material/tokens":"15.0.0-canary.c8bdf6144.0","@material/animation":"15.0.0-canary.c8bdf6144.0","@material/elevation":"15.0.0-canary.c8bdf6144.0","@material/typography":"15.0.0-canary.c8bdf6144.0","@material/feature-targeting":"15.0.0-canary.c8bdf6144.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.c8bdf6144.0_1666117449400_0.9830458902530397","host":"s3://npm-registry-packages"}},"15.0.0-canary.bacda4885.0":{"name":"@material/slider","version":"15.0.0-canary.bacda4885.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.bacda4885.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"875dbb5547735cb468feff248c9b801c68b6dff1","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.bacda4885.0.tgz","fileCount":37,"integrity":"sha512-t9/lL7YsSccFqn8ycWrG7vmRLGQSt3G6e+3oRWKFg2aCoIFaaPxPMdU8YL85a5iFLVeeHwfRMCCVlnq2glv2bQ==","signatures":[{"sig":"MEUCIQCpENaN/3W4F3rG2lEp3kR9WNWLFHtwu2CjR4nIrVw4TQIgU2xbHrXmFdmb4zA8ouvx0ohUpVev+y3N1MMem2qjb90=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":879901,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjTvPUACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr6eQ/+Jg6olfu2TbzNSic+228R1Ww9XFz9OU2sEpts6FTrJcWPwzdl\r\nu/2tp7znoa4WtKOsNBdmQDg8Q9ltiy4raWOIzsN/v/N8j8bE1pv4LkJ2xe1U\r\nIc7wAyl9bz7G3I4TdFFMFXgi2hEOvdNvCmDAlmy3lxr438LTQpsDu/5u/DSK\r\nJFJN61TdZcSeOfS5jErz2u0kpyMIwX9N2eIymrlE68+4DlLcg9tqCWpJN6wB\r\n04UDs1rNKmxijjP4sbNfnj5qikkz87vSTpUpMEnj78Nh9zSLqRZPITW9xDZA\r\nAOgYWWVdAtdvnuA6rkzTZ0eE1LKqfwtpag+/B++JoLdxCNHq3a5753IUnyFJ\r\n1wGUP0Nzgnf+fshKc7s4UCTiVUSRhRFkHi17mCJMJ8kR/ehS3Xwzt+WXmfbM\r\nNdUvrQipu4lZocqLXYYVD+E2olYg3cIPkiKbVN+XJiGiIjFdUxPmjQ9ZCMDE\r\nzHNOJz5LlEIwogRN+kUUntZsYZgyy1bmoqlvrUQKXvQ8UMAdjLcW1P5pfcay\r\nqhRW//8FEJpUYPGbQWL3efcHBjUtjOtEWLUm6Hce0md9Lgw7vrA0yB6Xjy9V\r\nPLZdRJ4S4KAkyVovsdVsZga83+ibJ5xk1gZCKKWF9+hZSCN6wf+KUqxDe4gV\r\nI3SwyLjBO8LTwfuiSTvW0C7zwTbwfK5NDVU=\r\n=nwv7\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"9e0a7dc5fb5e2d1554093d85949ffa6c2aaa33ad","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.20.1","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.bacda4885.0","@material/rtl":"15.0.0-canary.bacda4885.0","@material/base":"15.0.0-canary.bacda4885.0","@material/theme":"15.0.0-canary.bacda4885.0","@material/ripple":"15.0.0-canary.bacda4885.0","@material/tokens":"15.0.0-canary.bacda4885.0","@material/animation":"15.0.0-canary.bacda4885.0","@material/elevation":"15.0.0-canary.bacda4885.0","@material/typography":"15.0.0-canary.bacda4885.0","@material/feature-targeting":"15.0.0-canary.bacda4885.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.bacda4885.0_1666118612483_0.9615179420701194","host":"s3://npm-registry-packages"}},"15.0.0-canary.92b2556cf.0":{"name":"@material/slider","version":"15.0.0-canary.92b2556cf.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.92b2556cf.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"fd27a3250066e9ae150bd7ba9d6a90e1c78d2cce","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.92b2556cf.0.tgz","fileCount":37,"integrity":"sha512-wmOieOf6DodcYPuLH9n87E+268s8k7J91KvEA5fPKCD9mgPhYz++oPmdg+h7y6ACi2Gw9RzhWrSW1TYmPgCpNg==","signatures":[{"sig":"MEYCIQDzV0Fm2qZ///i1jghNfpA5t8FulK/CYJDDMzhm1ymc2AIhAKwfMH9eIIIOM0HpeRGLXw+nS6RwWwyUtEAE2UMnqOws","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":879901,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjT09iACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoGxQ//Z2RLcAC6Nt4bZUW/AEGTpr7F6Mj58k76hs2R2TDtQKJidSEp\r\nTupWEDDGAE6hMv4FA7kY2U8Pfx4N8dEsCjJXDFi7hYEyhjVd+84zs4kW2SYo\r\nk+Mku5ULLLslMKX2ZL6rgaF1jPW0u9Md1NoR1NPoMppdkF/9PfUFoWAt4y9P\r\ncCK1xXgmxFu5ThYR8Zd67eqbcOuuzVH8jN54l9EbousRjHIDXidBTzbezco+\r\nzQf7bYQSdHRnBOGjgqH0RnFAL1NU27aN0g/zkjdGJG4HhYkqV165upbNxA5R\r\nd9HutVVFyn+jrTBm8WYr42IbTwan28xlyuYOMwsp9f5b4iC0r3t39bOmR2pJ\r\nqxrHF/Gu2IpRizanikZ1Arih13rTsj5nA/WgvQZmVk/154IwwD1e/G7Pdtae\r\nacuNR9bxndds+iIzxcj3yYCR1GaTVMWn1S3zcSF2uXp1T7HDhegK5ZqH+NXx\r\nTxVpN+mv3hAjx1+bxdK8MJOYsokq2esIWy5FciON0zf/W3TEbP6cQFdcQw6H\r\nGOQwb2aDAIjKOKLYLdEYC8Hk9Z2VU98QXluW9skjUYYn1+9Go0ge4kF5tjyD\r\nxgM0TqE9mVWDZeJeYHqMmxlxhvTosgWkS83AwnHQsuK1HFiVwE5VWJVCJgkp\r\nZHojmfNTie4EOXTzcUa+BXSd9eo7wCOK1cA=\r\n=SKVV\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"7ac326ada7a9c6e84bacf5e01a6d22e675dcda8e","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.20.1","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.92b2556cf.0","@material/rtl":"15.0.0-canary.92b2556cf.0","@material/base":"15.0.0-canary.92b2556cf.0","@material/theme":"15.0.0-canary.92b2556cf.0","@material/ripple":"15.0.0-canary.92b2556cf.0","@material/tokens":"15.0.0-canary.92b2556cf.0","@material/animation":"15.0.0-canary.92b2556cf.0","@material/elevation":"15.0.0-canary.92b2556cf.0","@material/typography":"15.0.0-canary.92b2556cf.0","@material/feature-targeting":"15.0.0-canary.92b2556cf.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.92b2556cf.0_1666142049994_0.7765684547759146","host":"s3://npm-registry-packages"}},"15.0.0-canary.cc804509a.0":{"name":"@material/slider","version":"15.0.0-canary.cc804509a.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.cc804509a.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"15bb2e731c668c0991139c8df709d5e9cd314408","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.cc804509a.0.tgz","fileCount":37,"integrity":"sha512-+yWbV99jDa4PCo7vguGbsljQ19Cn7sXK+QJcA14tcbEkdU9qnl0oorhv+bP2mlTe51pQQFmzVDj7ZtJ9JmsC3A==","signatures":[{"sig":"MEQCICqhOpCRGHrviL+lcijbvtqBW1/di67EZgMh/TTVe3irAiAQApVmzKeUKuExaNEai1TpAA+17PpW1PdES1esTongTQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":879901,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjT1BCACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmphrA/9FoNCekLyMHMfJkzDi42TGtGQUgzOSofqcWetE57nPjdvIAsS\r\nq5MwtZdkkoemUkIa3z0IJIRGucc3KUNJfZNM3Fk+UMuqyXadRyQtEWTkw5Be\r\nJalL1LRlbl1k433xtcsUpov9iB4qfHbXx2+fyKHq9tlwvNXo+V/zBgYSJ+Jg\r\nA/ZII7jiR5BLI4GfSZ0+FbmDEk3kUE2myvSdM9HgLFXu1CVp20plNOSIWwfP\r\nu4fVu7LdwsHPF5hMr/p81NHmTXjBldQeSw1hDZI8vUIjIa2BheDcVjILWe4D\r\noRSZEOjpMoVU40jEv5muFUtUIVR2ozUdpY/Sp5Lv0sdPHDJ3jhKFdr1PDO09\r\nK99vy19B62kHKDqg3fNAuvRBjZ3AxwHFjjQnskckZgvFdtGUf/zM6ijIRSog\r\nuWyu3IkAn9fA3ELFpJLs5Y7ovl1Jh8Q4ZqllCf309pyitUtRJ61CMRfq3958\r\nyGw/lazZSU6zPUfZCmgTkxKxFWTImacOw8oRdeUciuDJkrOZ+kexLDTQZ34G\r\nHzf1Y4xQs3lwlhD1qdF6lcY/jpyed56rbBhf6/XtZwjiZdjN9OmCIAVpLkJj\r\nA8vUz7Yv2ZMemvVeYbFYNEaEwBRDmJ2gN3dSUrSxaBdyqwFHTfAUj5QDTQLC\r\ne7e8zv1ca7/erhogmKf0U0kaynOIfHojTzE=\r\n=ltqo\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"e8cb944f6f2263dc4b4fec5d7ade2bdb5172b4eb","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.20.1","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.cc804509a.0","@material/rtl":"15.0.0-canary.cc804509a.0","@material/base":"15.0.0-canary.cc804509a.0","@material/theme":"15.0.0-canary.cc804509a.0","@material/ripple":"15.0.0-canary.cc804509a.0","@material/tokens":"15.0.0-canary.cc804509a.0","@material/animation":"15.0.0-canary.cc804509a.0","@material/elevation":"15.0.0-canary.cc804509a.0","@material/typography":"15.0.0-canary.cc804509a.0","@material/feature-targeting":"15.0.0-canary.cc804509a.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.cc804509a.0_1666142274599_0.31832126689478035","host":"s3://npm-registry-packages"}},"15.0.0-canary.982bedae9.0":{"name":"@material/slider","version":"15.0.0-canary.982bedae9.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.982bedae9.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"dc41770220c89f4155659b15390e337685a3a1b5","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.982bedae9.0.tgz","fileCount":37,"integrity":"sha512-CO58IdwTDUz5JCMN7OjSScGrAGdEncBUzbsPYVz2zWMB3IPmYKDr33++SSiUYuD1B3thq3trK1LLhKtrlIqsGQ==","signatures":[{"sig":"MEQCIERkvL97pIOWSDbeQCGdju1JQTPdWmxm+khGw9HHbI8tAiBXxwd5vOq9/LiLX5IamQDDGURVHcMM6gyVtinX1B1cew==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":879901,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjT1T0ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr3xw/9HPTLNUG3afpE5AJ7/MNicsa333tb/LZTvd/pwz7YySGCLkR8\r\noKiw4fXGmuThmA0v2tF8JHAZDZ8avASO7hXfrsWMlA8FqkIG6TGYtfVhDabF\r\nFB84keogQ91pEk6WU4kiJRnS8ywjT/vHyJDqv+EgsUnTzGxV7kWhQeD4q9rF\r\naJ1tQKU0i/+RQnlbdkRATOmdC+rO3XAH2th8yZjjyb7YRP9EO5Zn7Uu01aUX\r\n2i5fgxlXQ3OZt6s0iwO6A2akhubgu6dc/apipppB7MMjA+tNlE6IG19gYQgU\r\nzkc6FsxGRqBeLFqiPSQ2bmmC0NgqFMGhzvVIgVscTWPO8mXofg/2A4BV9oMF\r\nhD6f3XnZDAQJ5EIbTqcYZktyrUMCYQGZjq/eDSYkJc35g+iB1WRabwmLfDZ7\r\n9nUk6iTARtGerMbBpmioVxdGDpW+6RJCZbuoWStgIffqmmJaHg0Qr+1GUJtn\r\nrck24zv4q8hCIdZlz/X7Lh2iAlHnezz1HLVz5VQRuG1vHHdUygs4+BEuE89E\r\ndqxV8N+SwNc2OB8WQa29QhlUtL8X45Jz5lG0cqM/snB+TLr1Mq3rczbWMvvy\r\nzGlQEB0IFdMnL6292HVgbM4okamOmPwj/P44PtQXrfwOUjyhCgrXQMdsY+DN\r\nfOhS2i+98x0IBGmywuaDmiV5s4/dhwG35x4=\r\n=cMsQ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"247fc73217ef7d2438e876f1477d141e6970c9e1","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.20.1","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.982bedae9.0","@material/rtl":"15.0.0-canary.982bedae9.0","@material/base":"15.0.0-canary.982bedae9.0","@material/theme":"15.0.0-canary.982bedae9.0","@material/ripple":"15.0.0-canary.982bedae9.0","@material/tokens":"15.0.0-canary.982bedae9.0","@material/animation":"15.0.0-canary.982bedae9.0","@material/elevation":"15.0.0-canary.982bedae9.0","@material/typography":"15.0.0-canary.982bedae9.0","@material/feature-targeting":"15.0.0-canary.982bedae9.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.982bedae9.0_1666143476313_0.8853825291156441","host":"s3://npm-registry-packages"}},"15.0.0-canary.ee40081f4.0":{"name":"@material/slider","version":"15.0.0-canary.ee40081f4.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.ee40081f4.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"8789bcc77084acf9dac127b9b7505e6d0760a7fc","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.ee40081f4.0.tgz","fileCount":37,"integrity":"sha512-aVILpJYRK6Mip6FEkN2WRsqg3AWqIwr1caGrL2587qWF5oEsdMDe2M5ySMAOhp4cuV1me4GGTUNcdTHlr18AzQ==","signatures":[{"sig":"MEUCIQCKCcrLslnEZK6JV/B4mKdqM2Hnyj2Q36esw+U2NFyAYAIgNNjLcQxqCJdmMdDY910tVLnUmx8762Q1ogWfu5cDcg8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":879901,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjUFo4ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmofKQ//Rg4HVbVkwbiFCBQxhCh0TwJETdYKLMSNJ7bnIodBX2ai3QQu\r\n3xoNNwkqrSHeKZqloj8G8Scis1Fq+zsPIVXLw9DtMUbXATaiUOHusUgPb3cd\r\nEVi/vyujV7mxqFDtQITnXitFq0ebyHBw74RGqa/B1isXKAapJAmGXuvX8Xxm\r\nELF+zIQRutYAoFRF26y8wgrT0lmGibyIYhNcMX1PiitLB1fojKOP+jDHEkXj\r\nwYl99v0gZ7+9IkS2BEnIu9T2MyMiOLsqbT21ejSyDB+P6h4+SotJ5HMGkfW2\r\n1DSpeGtwLY7UKx+qWv5B5KXBBWokj1Pg+Zvvh1EDU2x6KarC7jPwqGPUKRtN\r\nYy+Jn95NNCpD8qZasYUUAw6X7d0zfJIHx9o1DBoFPLT6epb96HBv2V9R79gU\r\nZgp86P3Q1WS4cuFsPXO/Jmf8Eb2g10RQzpOhYmvhtvOnjtzqo63ML7h6DqEg\r\nyPtA+JEN7ejVWZBKhwvzsj5i3Y6wiz5MJYCAUlJy1dSZJ1GHBJlIx4uuqj5m\r\nApo3/RkXjo3Qc3xkK3Vpa+PWS8DB+SrlK7SiMO0AuDQUUEZiWt6f9QxSfuux\r\nfqyPFCdz4c/sglJbPdGPQJI+C0iMJBISImgCSLs5+R8poVUsd6+wWsdILe41\r\nmrdhYTS5OR0Vy6Xr1ANrBQbdJQ8BvtLo4sA=\r\n=riPm\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"04ad48e358b6eef4ec9ee359b0ab906b30425504","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.20.1","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.ee40081f4.0","@material/rtl":"15.0.0-canary.ee40081f4.0","@material/base":"15.0.0-canary.ee40081f4.0","@material/theme":"15.0.0-canary.ee40081f4.0","@material/ripple":"15.0.0-canary.ee40081f4.0","@material/tokens":"15.0.0-canary.ee40081f4.0","@material/animation":"15.0.0-canary.ee40081f4.0","@material/elevation":"15.0.0-canary.ee40081f4.0","@material/typography":"15.0.0-canary.ee40081f4.0","@material/feature-targeting":"15.0.0-canary.ee40081f4.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.ee40081f4.0_1666210360068_0.06654196326990314","host":"s3://npm-registry-packages"}},"15.0.0-canary.98f1b54e2.0":{"name":"@material/slider","version":"15.0.0-canary.98f1b54e2.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.98f1b54e2.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"e131877225b61dcc5eb2c88e6eacf01dd252c8e1","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.98f1b54e2.0.tgz","fileCount":37,"integrity":"sha512-vOOnPlbDRBfMlZniBRGya62RJmVUc8m/897AAbw7kvwB4Er3uAV5r+TLt5RoSyZv3DeObOjJlhifiOpflSQLLA==","signatures":[{"sig":"MEQCIBlCJNIDcQf1wlVyxG6dmF17+IML7oNtBP60hsKDJisdAiB0Y8JvA4tBH93hXyF9601BrPBgFVy0HswZJDVxpP0irA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":879901,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjUdJZACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqYPRAAjBYkeu2G7h5z+yGEQp0S2z7Ufg+vlCEGhOqXR0fC2nkLv0JU\r\n1nWABp7jaOF0GKDC/hOKK3rL35UxMt5DSbp0c9mgy6DBIEkXE7MSS3gqcTaR\r\ndvOpIj55xfnumrQJFcIRHu+r/JWEItJK95AKZn6HNZa0oBeBXSk9aKAS4MVr\r\ntAyskkdavUCY1yCW8ObWxOmqNLXiMI/p3k904L8eGT8FZPbe9Ukt4F8M6N/e\r\n/a7ZtALsVhM04jvs80NYXRjAbP4fziunrdPYl4FE84XGBwm4w1Q4ryKf4I2s\r\nQHUMbXwwTumUg4HmRGAJ6CO0bHuYkJt3BnwuqWTLHbamoEL8ujmdOaHvsLvB\r\nAR22OE1HfnzZtJmIxtfbSOXZhTZAhO8nug4CYbuVuxi25TLIIpuqS43itxFV\r\n5XXYCzTBILUIOwBg5w4MT45uhcPxLfl5v2UsrLJgICDI3U6rJ8piWm2WvL8j\r\nVt7PLGEwsUP9OrHZEMdxnqbwHurfpFy04DW0a5svKyPRa9qEPIIEup4MZwnI\r\nnTi07iRXtPmaNbXPF/y+q8ejPzXz57kgnGKIfxHO4jOzSi9UN1f6cW1TvfoT\r\nMsbi4PMCmt9NRRYg5lqfB8I37pEDOayXxEpkKZvD7BuTVSXnsu6B1rjc7CC8\r\ni3Q8OeL9DgZPEdeWrXnRMk5WeKzttXal+YA=\r\n=Buyl\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"aaf0a191532b3357cda509746499ff62e3aaa47a","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.20.1","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.98f1b54e2.0","@material/rtl":"15.0.0-canary.98f1b54e2.0","@material/base":"15.0.0-canary.98f1b54e2.0","@material/theme":"15.0.0-canary.98f1b54e2.0","@material/ripple":"15.0.0-canary.98f1b54e2.0","@material/tokens":"15.0.0-canary.98f1b54e2.0","@material/animation":"15.0.0-canary.98f1b54e2.0","@material/elevation":"15.0.0-canary.98f1b54e2.0","@material/typography":"15.0.0-canary.98f1b54e2.0","@material/feature-targeting":"15.0.0-canary.98f1b54e2.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.98f1b54e2.0_1666306649525_0.3017208883368636","host":"s3://npm-registry-packages"}},"15.0.0-canary.e74b7ba7e.0":{"name":"@material/slider","version":"15.0.0-canary.e74b7ba7e.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.e74b7ba7e.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"31884ef69433c63d14b14e96b685b76fab4a1048","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.e74b7ba7e.0.tgz","fileCount":37,"integrity":"sha512-PjgpzgsfD7SQsv281oX0Nhigav7qNBC7jvseLWfklutWbqkeP3xUOQ8D/gctqBnp/4+Dj2yqHL+2qLPCExcU2A==","signatures":[{"sig":"MEQCIHJGC+CFwJPRwtmmMsrYfPNq2bhNuYM3r2FAgW86QonJAiB4LcEJz4WMC1jA2nnmW8KUxSs73Vl80N09LeLQUcTYBQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":879901,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjUtGYACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmo4PQ//fR9p4qZSZ4fQcmn3K6qgOdbqF5u5Hi4UTHcZqkMkpiZMxyIe\r\nBeTSyk35Jb4celhpGxEOzWFBznqAMN/xhKxy3QQKaQiGaFnSWk3DwQoJMpI7\r\n6Iei+WuH5uePmnNVUwUPVRZfKfx9uwGj1j4jtHdB15O1BGph/2GHTM8d9JjX\r\nHae0i4W2ENRaOEwFDmWXSEKJ/Bx/EnczB74KzclLymBoN86MDTLXZ+7eJKOO\r\nfM7iE1O1sWea0LCnG6Dtf+ll7yBSBk28tydkWtRf/vLCQOhmfWvgp8fngpG6\r\n4TJryZKRVy09K96xvv8wk+KjycE06oUYvpTT+Y4pE5rEFY0SabL2rp/4KIjQ\r\njZbf7tUxASUj7DGvGXffnc4PRWMagGlw3okYF0eeUm+08uetXf9IhwQpQzsw\r\nYjwpTtmLLf/s26wRSdV4lttpGQp/n9fpt6K1Lo22sVU2gp68kbQu+AjF+A1a\r\nPE/OmWh6E1KqBkj6wrIAs7WNl4/yGY5Vm+9zbp1poDZTFiHFPjLIiTYMqm+Z\r\n/aptAWLJV0S/JU4QU59s/qXYwFZyGlAxImZWCprERIcEbRxqjyMi7mTeKI6V\r\ngNZkBpWwuMzxVccC+52u3wA0MONFWpFKfr2Nxt4Gt4gsrDVXVFLVqaEEWxDo\r\nWs85OPoLFDEQwXA6ZJS3Nv1aCw2o0z+BDxs=\r\n=XyGN\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"e30e36776ed9bc98d53938cfb5e48bf5d2cc67c4","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.20.1","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.e74b7ba7e.0","@material/rtl":"15.0.0-canary.e74b7ba7e.0","@material/base":"15.0.0-canary.e74b7ba7e.0","@material/theme":"15.0.0-canary.e74b7ba7e.0","@material/ripple":"15.0.0-canary.e74b7ba7e.0","@material/tokens":"15.0.0-canary.e74b7ba7e.0","@material/animation":"15.0.0-canary.e74b7ba7e.0","@material/elevation":"15.0.0-canary.e74b7ba7e.0","@material/typography":"15.0.0-canary.e74b7ba7e.0","@material/feature-targeting":"15.0.0-canary.e74b7ba7e.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.e74b7ba7e.0_1666371992571_0.7586338333582976","host":"s3://npm-registry-packages"}},"15.0.0-canary.ab55c07d2.0":{"name":"@material/slider","version":"15.0.0-canary.ab55c07d2.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.ab55c07d2.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"5a79c77d7af6b8e2bee47cb421d55949266d6a95","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.ab55c07d2.0.tgz","fileCount":37,"integrity":"sha512-e+7H7NzvUZsxvlJf457gHrIdy2zq7R8FoNL3V/oe57vQ+d7cGtc7Ej6sKgeNr1YC51BK1VotpKXjl3rk9X0OhA==","signatures":[{"sig":"MEUCICARuxnl6Av/dGmVustkJ1t5FMgFYfcIuUuaEUCJ2uejAiEA/WAolkEX7ZJL4n2CfflV/FXxm05zfJ3Taoo/mKQK7gs=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":879901,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjVDRLACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoDiw//YBuw3JDeWwQ+tlkjdT5d9+czJrgfRxQY6HwNwgfl0Sg6dsJM\r\nSdL2b1LuH9WYnwDMH7AMnFwe4sWTSlrqlgoW/LAd+15Q/niRNXmbm5xzO3w+\r\nzEYbW/xtQr3lLa1LcZF+dpwM1xhW/yFa35Gw4DCo2HEt5XcD1Mig/kofE1a4\r\nTNZfwWs/HGxGDwMNus1taiDQa8HFnzayAcfKr/36UNf/8lZKWnA07ykNgKAv\r\nKLn7Qv36GXdprhsvP+I/CCTiKyIy/Mu+2sjvvvufGrSjDLX37td+QmgQ4xiF\r\nE32x0gnyQ8ZdCAKKUjH5DX6mgnadEAa4i1zmEzi4SVOSc6h9iNamWz5taPAK\r\n6FJd5X1S7JR2F72hE6hxknMooaw3iFT5zMETZthSMfnzSmV0hizlKrnoeSAI\r\nbd8BiQ0gWyM+F4YI1NYi76lESJzTcT1rsFy4mxXLdOm3K5SMVnLbbt6EjYIh\r\nMOAcEhz5iPahmnbVHZYkGV1gi+DizlyE/aiS42oMqC2hta/6M/6tk3MMtJom\r\nRa17SN4HotIh7Nxkk1B3uaTZIE1KS/VceHsODhIHivzmSrO9jYl3QjEZMh5r\r\naeVmmH1wRAIjSIs5u0wp8Jbp4RTkFsABV3vKysOgSTPI9g6L4zbOUZgb8xyy\r\nVzwUE/uG4VqhZvf35nwPu4bUbXi416wjE1U=\r\n=aP1+\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"7fb32c724b7903a8060cb457aca1f150a15590dd","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.20.1","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.ab55c07d2.0","@material/rtl":"15.0.0-canary.ab55c07d2.0","@material/base":"15.0.0-canary.ab55c07d2.0","@material/theme":"15.0.0-canary.ab55c07d2.0","@material/ripple":"15.0.0-canary.ab55c07d2.0","@material/tokens":"15.0.0-canary.ab55c07d2.0","@material/animation":"15.0.0-canary.ab55c07d2.0","@material/elevation":"15.0.0-canary.ab55c07d2.0","@material/typography":"15.0.0-canary.ab55c07d2.0","@material/feature-targeting":"15.0.0-canary.ab55c07d2.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.ab55c07d2.0_1666462794886_0.5848351122325446","host":"s3://npm-registry-packages"}},"15.0.0-canary.fc539db34.0":{"name":"@material/slider","version":"15.0.0-canary.fc539db34.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.fc539db34.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"6e6b5fbbb48fe3248e92a7dbea4503106f89daa6","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.fc539db34.0.tgz","fileCount":37,"integrity":"sha512-UlXj8YXi0VupDfj19xxGU5HV7xe05vid9t8NYRFkVb6aMaYMk1+AyvThYDrmFCK8ScL5DmZYZCSO4DnOhVr8uw==","signatures":[{"sig":"MEUCIFu33dsw6ZPHfynVq85D9uE4A6k4orKICYuzrGNRbcQHAiEA+pqw1fjiPsALH8udG5XF+Yl7cjtEHS6gwXhySRbmw0c=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":879901,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjVuCqACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpsjRAAjfe23k1ECZ38kyj7bYJ5RaU7wmmNVckZbnJpXXrHB96fwesC\r\neGgj6tuTv0Fn9F4LwN/PZU2tcFyoS6f59QmjNY1vsIpZRvUFqaY08ORcBAy8\r\nT2Y04O/2aIVtiJHG9DdI/YhB4gDvAmaSswuF0OFJJR1wG4R1NFzY4PscrwkS\r\n7YiJVJjeIywQRp1MfKetRmpiFmlX6Pw5lHCkRUB9A+QJ7aODtbHokIUze/C0\r\ndHIfni8/6eoU+zWgkRE9TYRB7WDLgLsLGqFCLt1CT2XKJDsjPVwdSMHEutKL\r\njKRalP3FqtAmNx01Q0dzNHPKqtiZrUh68NJtXsP2Rc5vIRrGFPkgcC61fbUy\r\ncUnqALKDRp3WnjtVkZVj5VZYvdir1Pov46CDmIhLJBtY3u7rCLkXAWLczOI1\r\nwwe6MlgmZJsnNl/bUkZz2QXxrpyOXvh9iO/oeQe32Y4+ctswtfg0WsFuNq3y\r\ndBVGz0EtzdzCX+eEzwnLmyyXeaCp4H1CiVfRIIQJrCVDz0edHGm94CdkubeS\r\nWc352+fgmpgTUjj5NHm8m5qXxUqeMHiLUb3ICyvgtnvd58QojyyND4/DEBDN\r\nm0iIudonRcOFldpGPqKaUwXV/3dIu5ZFaiP0KxFH/qC5SxuKnxF40LxHJl+P\r\nzOfyL+a8RptPZ+Ie/CJ9vWSQOpE7IQjUw+Y=\r\n=WB3b\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"18c679c73aa42d66117f8f1a88ab7cbde6f2a201","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.20.1","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.fc539db34.0","@material/rtl":"15.0.0-canary.fc539db34.0","@material/base":"15.0.0-canary.fc539db34.0","@material/theme":"15.0.0-canary.fc539db34.0","@material/ripple":"15.0.0-canary.fc539db34.0","@material/tokens":"15.0.0-canary.fc539db34.0","@material/animation":"15.0.0-canary.fc539db34.0","@material/elevation":"15.0.0-canary.fc539db34.0","@material/typography":"15.0.0-canary.fc539db34.0","@material/feature-targeting":"15.0.0-canary.fc539db34.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.fc539db34.0_1666637994219_0.8747919420910053","host":"s3://npm-registry-packages"}},"15.0.0-canary.e340b04c5.0":{"name":"@material/slider","version":"15.0.0-canary.e340b04c5.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.e340b04c5.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"3c88bc0733df22a16f9b92e871d0c98bc9cae228","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.e340b04c5.0.tgz","fileCount":37,"integrity":"sha512-mzn07BW8tgatjj74QMvf/eFJETuR94dH9ahQpv4BJtLa/8ugSgVspzqSLml4SlTLDNJwXDlGstO8kmGcVZgWgQ==","signatures":[{"sig":"MEQCIE758R5UhwJx9TrddKpL6WASY0t4Pa0Igg2y2wmcFJpXAiAhrv8e3Ffz0lqq0KBvL8Ed3FnI+560hJllg8aAakR25w==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":879901,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjWHUsACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrZnBAAlaBhA2tks1lh4UD2qXD+8wnSrWaTebB5ush247cG8zedqBmx\r\n5QMkfGUm7P/QFYKaDCXiKV+UIeTaBPAc6QqTZZM+NCq8dlcKoudy2iIvHPR2\r\nkxJ6TjcVWcJ9PsJNKs5RvWL5EgjRWSSxa2ANA4hQ29GMdfSANlnufeOEV9eP\r\nb2ElZB/Stzb94qYevAemmuaiTUIVVZ5soQ81UmshzXAA0Nl0Qf7BMtQKix/O\r\ndNkLPevQ++/eVFEzSQgWClegouWjyWE3qLpwtLmEULLLMED6x4CjwBMA2J+b\r\nrTI+DiWoRGlo3qS/5lxR/yn3OZa02CA6PKqbh7jx0m6xxbrLI/FtmfE44qE2\r\n5LIiK+TOAMcF/5n2naces93rud960bTrNguyDuke4fybqhGKBrYv6odhslnq\r\n7kcbjnYYPr/Z5Wrtgg+9XR7McnuadxEBV2MHsebIBZMFxyHuSp7i5tMmSXYT\r\nP1BSRJpMn041rU0dWEjbCNXm6wsXlFDB76UYjpm087J5O3lOuKkBPfgoQ3AF\r\nHbsvv/IlKM8o9g+sA2dWYD1+jTETaU93wnbVZfhI2rNS7T48T8iN/f+u03bN\r\n0u894hYD4v3kaWdkPEohCxVFZMUBrvBAj4b5E3LPIgvk4WTp4v+2C1WoSO85\r\nlV42UGS5bNXz8JPpiA5GBY9s+D4GAaXjOgc=\r\n=eKdB\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"f3e39db57f42dc19c08bf6e97cd6918a3ce32dcc","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.20.1","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.e340b04c5.0","@material/rtl":"15.0.0-canary.e340b04c5.0","@material/base":"15.0.0-canary.e340b04c5.0","@material/theme":"15.0.0-canary.e340b04c5.0","@material/ripple":"15.0.0-canary.e340b04c5.0","@material/tokens":"15.0.0-canary.e340b04c5.0","@material/animation":"15.0.0-canary.e340b04c5.0","@material/elevation":"15.0.0-canary.e340b04c5.0","@material/typography":"15.0.0-canary.e340b04c5.0","@material/feature-targeting":"15.0.0-canary.e340b04c5.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.e340b04c5.0_1666741548034_0.6013112233431073","host":"s3://npm-registry-packages"}},"15.0.0-canary.2c1a8f8fd.0":{"name":"@material/slider","version":"15.0.0-canary.2c1a8f8fd.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.2c1a8f8fd.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"70cc22ef2df3548328b25178d486ecf5371e3b5d","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.2c1a8f8fd.0.tgz","fileCount":37,"integrity":"sha512-bbSayyv8+TLcOcjrNigA3edI3pjJ9jPg7LYPIsgyfhjehqP4EPdB6VASrDjuoWk95/F8QvM7sSdg9d2ifS/JXg==","signatures":[{"sig":"MEYCIQC/P46mog26LG+XeOjwJXNbpsptR8vMq0OR9RWVvOLqrwIhAN/j32oaZfJKeb9LhKmGzqbDaxTVykpVZuYWncR0XsqY","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":879901,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjWW7sACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqrRBAAml+S0ryX2U28fXFEsYxwr0zMHm9dFUg+Haf7d9Bv7ZUxkFcG\r\nx6nI9CHQPOHSll1IHPbBLMoam6zSwfzHFdCoPnbeTbn7XIe+Prb+eTdCebZp\r\n9qlAqYO/NLujdJUqT8A8/jEhtQt7uyHz3ON8M6DgfgTcK6Ss/IljzZ3pLVNO\r\nwegW01VJE5G9DDidE4Ysm02we4nlYf9dh9w0Y9RpmLZhLRvOhVAMMjefuDUO\r\ny5UVJvdVXFz0nzjaBoUMz2e16nxOqmFabBRqog3f5onwKirT8iVJaGS9jOXM\r\nC3IhDmB9ZtDGWyT/DIMjBssxzIo6hU141/RFjfF8+OMwkAhHfnPJCpZI8BQ5\r\nzmLWpj0GdRrQJb6kJM6twwO9sXoLb7lMi86/z1QYuU7j3IC6daxL4ookmA74\r\ntYV3CrmaVEWVhgzhIPidFUDQiVP72jSGdCQdqTBePlvnPXy3FmRQrCWzbUdf\r\nVwJfcmJzWeiHsuAf0Wc8TZc9A7G0pCc6Mm4LIHeRSEzQy0Io/iNm6dpHNWUj\r\nCr7STViITN4a8uNBbK4pS04g+xLIN90kkJYfkZMj/1ZaMoi4NzO1qfzwp+la\r\nD3LcEunWTLSElLik04S2us+5ypesslCLHkVhFIea4YR+5dOmalG0b9Ogzv+J\r\njsO3p8Py8AHdjo3TWljYYsU62GVtkue2Bc0=\r\n=W1in\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"dbee023b5e37423b8695520d95f2d00d884bfd5a","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.20.1","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.2c1a8f8fd.0","@material/rtl":"15.0.0-canary.2c1a8f8fd.0","@material/base":"15.0.0-canary.2c1a8f8fd.0","@material/theme":"15.0.0-canary.2c1a8f8fd.0","@material/ripple":"15.0.0-canary.2c1a8f8fd.0","@material/tokens":"15.0.0-canary.2c1a8f8fd.0","@material/animation":"15.0.0-canary.2c1a8f8fd.0","@material/elevation":"15.0.0-canary.2c1a8f8fd.0","@material/typography":"15.0.0-canary.2c1a8f8fd.0","@material/feature-targeting":"15.0.0-canary.2c1a8f8fd.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.2c1a8f8fd.0_1666805484522_0.4264046559895991","host":"s3://npm-registry-packages"}},"15.0.0-canary.ecfee946f.0":{"name":"@material/slider","version":"15.0.0-canary.ecfee946f.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.ecfee946f.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"12c238943a18a29309fa6b4ef3327684278026b6","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.ecfee946f.0.tgz","fileCount":37,"integrity":"sha512-NwFZ8FSH5NCx4dlmNF+ReFzQcaXStRCRaTCuPNshgvAdHSYI5NuswUv1pRnECBKPK1QrT0LSuw/Pltoz2jP/lQ==","signatures":[{"sig":"MEUCIQCjBdInrVfV45fi51nLdQtwWlqyf75CZAVLmXBq3b293AIgP4O3BiC8ZmW0IC+mZD3LM2jKrNqa71wJI8jOhxhGmPs=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":879901,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjWZWGACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmrh+g/7B96RgzSxZZMmLS1PRBmvUu4RvsbXxi6jhXWdGjZw5c77oXMA\r\ni/zsREYUVEZLuU0Z5NY9M4YL6qb/upxfZh6CPn9KtRRRMVJeLv5e4vFAEzz+\r\nLtX01LEhnXJ1aumSlCLsgIKINYV3k9sUmrvBoHXqlpPprgs0UXUNDMdrEV5U\r\nnv00DiPWnxmig28b0wEGv9RN5rbfuF37PCPYVXd7y/oNRSzyPoa0Tb0daa/z\r\nDHG0n/nDQyJqOgQt4jhFJJVnM/ZbCQfWAx4+pbkfeXOLfJOkrnltcVFMqsLv\r\njgNw2AGEK+XRlQt1CwUPoysOLByJwsk8ienXTfyQr80o9TN5dN5n0TcImjv2\r\nsCyfTpSR9yYqRZ+e5SpBHCGQnx/uT6CiO1iKLaX6C3wrFjXNb6rmLrrCi9li\r\nAtmW5gXB7a+A7lYL1QNparm3zL6UMgELz/ShXjXM4NEghqQ1rk1gS8aE17a6\r\nnXFPpgFVQKIRupLy/Bc3W5sI90jqObuQOi6OCfPexTrdZq5u4tbyBIg/u5yf\r\nbctNRHFdfgMA7MXc/UjPfKYhZmbsOcRz6fUyL2iDfJQ5DBmeBT8YaE3LowN1\r\ndw983m6HmTSgIW4xFGQKLn2sGT5bBHYsqUXo8oYgpZKGgsavpuXyGhfJV4Nl\r\nslJkWWcJf8Gv7FVzm9KktKacusfp0mirgb0=\r\n=HAsY\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"dbe05d725a401275de1e88f9d5bd6cd2079a0047","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.20.1","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.ecfee946f.0","@material/rtl":"15.0.0-canary.ecfee946f.0","@material/base":"15.0.0-canary.ecfee946f.0","@material/theme":"15.0.0-canary.ecfee946f.0","@material/ripple":"15.0.0-canary.ecfee946f.0","@material/tokens":"15.0.0-canary.ecfee946f.0","@material/animation":"15.0.0-canary.ecfee946f.0","@material/elevation":"15.0.0-canary.ecfee946f.0","@material/typography":"15.0.0-canary.ecfee946f.0","@material/feature-targeting":"15.0.0-canary.ecfee946f.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.ecfee946f.0_1666815366039_0.6033505789798248","host":"s3://npm-registry-packages"}},"15.0.0-canary.73ca9dbb0.0":{"name":"@material/slider","version":"15.0.0-canary.73ca9dbb0.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.73ca9dbb0.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"4d50e7c2034fcb0ddaa4b2b5568f92b266904831","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.73ca9dbb0.0.tgz","fileCount":37,"integrity":"sha512-VdACH7qDwk7H31Lc3aTSk0/nj2uLJAKPXqWqcraHR1H9NQmsUldbcbkxGulIc/Vktc11vuMWVSfn9ZUgu/bjZA==","signatures":[{"sig":"MEYCIQD9lgktsTH2R3n05vNJRzfqGiQdD1UpqB1rZJl+fum/1gIhAJvSZWdfxPODmpx51AsnSFf3nBkJUKwvAHTDpgPUICwb","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":879901,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjYAbbACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmptmw//f1J/GIMjRFx8uYun6xAGfywAHZybYOmQcX6WqeYN30eYUM7i\r\nPDLsE5v5II1R9twoMWuSX9zPAJeuZwTuP4pTwMcIMv6vJh6vjhK3OT3obEtW\r\nK3LBTnLOeTcbwm2NCHvljf52PaQCWK9FgmsA9f3KIdwvzbkzL4qv6Q0SfmV+\r\nVwq6C/BamdiJY+fkAJqACwM3v3A6wMyvSWKfmGeltT0gZx+LoRa92l+PlQHy\r\nMY4l41BBj+ue2VmUuDs/uIxhsP4+G1a0i5qjj2gHceWaLVpdRK3KeUPnkfPN\r\nmvXB0FoxnWf6UvswFFm4rsuo00wHQm/FTt7N7g6ZG2eNVKDaXrMv8VGwnKMF\r\n9ilnop9Pj/h++uVpY25yCQ2KQQyPJdxzRtUpwKrPTYkO4//nMu0gbsN0ylik\r\nWUDPUbmDr9JZIUqajff0bdG4ae2nwfh8ag+zEQz9r336cMg8YU1qkK/Ki6T/\r\n2XK9643DbhUGyrqs563eH5SfTTcLCaKnyEfL9QmSOavDYrln5wbB2lK8lpmS\r\nqWvHzDNIK0zSXFmcfZ+ZWtFhVcw3JjOdTRFMZa22JPR0Y/zwdIn8Ls46DFaG\r\n1TNi1+Xt0b9cpdXzBFuj7bJMIJYL6HFv+SGXvMHt+iWvR39NIajhTNA0AOl3\r\nrW/TG9KdszqTXX0TTWQgrU3lrmehu/+1knI=\r\n=ZtE1\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"3b1ecde6148e6e8d98c4b0c8a4dd2ba56e95586a","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.20.1","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.73ca9dbb0.0","@material/rtl":"15.0.0-canary.73ca9dbb0.0","@material/base":"15.0.0-canary.73ca9dbb0.0","@material/theme":"15.0.0-canary.73ca9dbb0.0","@material/ripple":"15.0.0-canary.73ca9dbb0.0","@material/tokens":"15.0.0-canary.73ca9dbb0.0","@material/animation":"15.0.0-canary.73ca9dbb0.0","@material/elevation":"15.0.0-canary.73ca9dbb0.0","@material/typography":"15.0.0-canary.73ca9dbb0.0","@material/feature-targeting":"15.0.0-canary.73ca9dbb0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.73ca9dbb0.0_1667237594558_0.6034466781358248","host":"s3://npm-registry-packages"}},"15.0.0-canary.357f2e5f1.0":{"name":"@material/slider","version":"15.0.0-canary.357f2e5f1.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.357f2e5f1.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"4e293a9f5d4856b13fe768073cb33eff68552447","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.357f2e5f1.0.tgz","fileCount":37,"integrity":"sha512-BgViDv/76r4Tvwbw1x9S71x5eqMjgHsqrWeIj3k6Qt818Xab+RY3mdHIuCQOb74LkjGaSKUXQmI5Vqq6oefPSw==","signatures":[{"sig":"MEUCIA45+BiyIUrQAimWDqv8qpQivJcembD0bhRmUfncLqCzAiEAllmOnoW/UaOHWUvYRJaZ2j6X1eyBgzDs9uLTeKpWzO4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":879901,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjYBjqACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq40Q/8C3pLj0mQadp6cdkesF213zHRvwfe6jvVRYoxLZiXIu1rGIbH\r\n4HdSGTk5F7bq4hnXE84hguemkDxAczkPmko9ozTWQgdtaA4Thvk7T4klp8II\r\nI5LsPtgefGB2WSSOdIJZtiYIQ01as5FFilQoAceCopP6aXyjVLxWZ3mXljvt\r\nHaGvf0hre+SXDvz0C7HqWZCD5znu4D5dx/7lm0BgNmlA8HaNlIyxKR4CS/CT\r\n8RH399+TIDqNvyEgCe7n+HQsD+YP6Isx6Ot+5FyEiI7uCqq54gcCn0pIb/5u\r\neCHdnXNw4FtrS9UmQqrnZ3G3HcOYRPb1u3wOnz0Zorm+2nK7oG0UOuTsVSOC\r\nS//v6jq9weWP+DmpQG77+H4IW/o+jgmEk8b44zTR21FeiR7nR4IQ65kz5RMR\r\n1QLO1RaIl2eJO6uJnNntcyiRyUt4bDNM8OhS/D5AoQStqUPfE03a/+aGEwFe\r\nETbyJY8Xo64CdUXPphwc/6wAOXo+ReCOpkJEwT0enRFYOo0YCv4EaTPwRdcN\r\nnbK+R/oNs5PLlXOBgCPIk9/+pQSGHPrgnJp0nv0NRwiQn1Fzq1oWVGK+xkx1\r\nS2fXy0BceRDmDSSM7sdOqhxbQa5UkxwhTsIQ3qDaVAKQiYi1s0l0653xu7Am\r\nM8uGvl9Tz4anKKAaO4gY78wz99cHWH2NlAo=\r\n=uLH/\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"7f8af87642d395b497ff80efe06544dd459b947f","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.20.1","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.357f2e5f1.0","@material/rtl":"15.0.0-canary.357f2e5f1.0","@material/base":"15.0.0-canary.357f2e5f1.0","@material/theme":"15.0.0-canary.357f2e5f1.0","@material/ripple":"15.0.0-canary.357f2e5f1.0","@material/tokens":"15.0.0-canary.357f2e5f1.0","@material/animation":"15.0.0-canary.357f2e5f1.0","@material/elevation":"15.0.0-canary.357f2e5f1.0","@material/typography":"15.0.0-canary.357f2e5f1.0","@material/feature-targeting":"15.0.0-canary.357f2e5f1.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.357f2e5f1.0_1667242218103_0.5960559793046423","host":"s3://npm-registry-packages"}},"15.0.0-canary.eb103d4b5.0":{"name":"@material/slider","version":"15.0.0-canary.eb103d4b5.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.eb103d4b5.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"85904d12b2e87fd0c63d793055d419c1660cfbad","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.eb103d4b5.0.tgz","fileCount":37,"integrity":"sha512-YYk1RK530nKFCBupf/7YlZQEi8LpcUCzhg5RMUdNjJ6oDaylV6WAJo59QJ3Rj74VCFHe1po9X4JjzEZdod8LXw==","signatures":[{"sig":"MEUCIQD4GQot82Sk5gnjiAhJuOWC3XHuc60UJfsxjlIf2g3flwIgffYWkoxj6mdnREBUnhSZ9wz4ZBk9NdTNNe2KB9o0jUc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":879901,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjYCiYACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmqr9w//V9Bhor+DhKmcM85t+xZVPzbBo2/dq9+cZ1HLmlhfT6BQb0Mr\r\ns8pS36ZWoiYWrq6XWJLGr8KdDZoqgTo1HZSaRDkpZFTBPsToiGf8dhILKMDT\r\n9+vNrcgcHRoVnP2bqW1gfb1r1Hr1RfMNbv/gpPta9Zoy1BhedKccb1xWbpXI\r\nITomuASEKhYOo0N5VLq5BVu2hXvR6rKbznbm+FscJ0QLu8yIui9QUxF7VY99\r\n8MNdj/VMJ007EdlS2TRUsPncY85IQhwS2EVyNZ00GXOKXLgCwa2lTMJh6sqg\r\nxNsAZW4ykq48wSiRdIjKJVzLkB8NTZJlh+jYyfMEdev2tTLg2Cak6RQhzXnC\r\nbTBBQTOryCrj6kTrYD0ShVMzu2ixXk1LwRrVeM05/m7y0FOj1V4xMP8gq+CV\r\nojl1rrWD0yXnC0Usat3YmHz8wXGbPZyjIomcMdkDSW+n1sIY2Tf5zrHEt6xO\r\nFcOO0+vyNWLNLqM8hLhinZ0k9mnvYLjUBm6XUICS9v/6qEHiGB24kIBs/Bvr\r\n3/nhHhVOOigPvoxvkEl7MDf1lrB7lix5NYjCVrk6WpzAhfG+TpEFAJStGI0l\r\nlVKLNU6jqmVhdEqrmjQEydjlV4RhXxhdJzPB/aNI4rGEDyDwoKfhP7p63kn/\r\nvXcfPYfwvHWtAvMahyiDoT1OBp/NpVSXrU8=\r\n=G6RR\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"6fd82c2abdb8567ca00c6847142375ca8ac18b90","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.20.1","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.eb103d4b5.0","@material/rtl":"15.0.0-canary.eb103d4b5.0","@material/base":"15.0.0-canary.eb103d4b5.0","@material/theme":"15.0.0-canary.eb103d4b5.0","@material/ripple":"15.0.0-canary.eb103d4b5.0","@material/tokens":"15.0.0-canary.eb103d4b5.0","@material/animation":"15.0.0-canary.eb103d4b5.0","@material/elevation":"15.0.0-canary.eb103d4b5.0","@material/typography":"15.0.0-canary.eb103d4b5.0","@material/feature-targeting":"15.0.0-canary.eb103d4b5.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.eb103d4b5.0_1667246231997_0.08241349554076338","host":"s3://npm-registry-packages"}},"15.0.0-canary.af5f01223.0":{"name":"@material/slider","version":"15.0.0-canary.af5f01223.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.af5f01223.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"3728d624a8529f4a17b058aa858fd99ca98e65fb","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.af5f01223.0.tgz","fileCount":37,"integrity":"sha512-vPSYzrp1BcN7xI7q6c3jvbH3sD4C/rNNmoipzv1lYYjdmmr/QACumdAWZmCCC/W72sWKoqHbuAglPJ523xS/6w==","signatures":[{"sig":"MEQCIHyxGkkAjaPPPdg8fhOexxBK0Fz0KLOlN9cw/Rvni4VsAiADJpVwl/ZyRQYIh5Fje61bhyqt5LKeJT1fCIGnbjG85A==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":879901,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjYWdyACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmqmuw//Y3h6Rgu1E61jebbQPDBP0VnB08vArF+cAThOMEI43FUSf0GM\r\nulJWtsBLZUd09P2zdp9EUwDsiE5wE5bCFQGPGdML2zmGiQb4RzBKd8T4PeK8\r\n6IsqH/AtshbjdNG9TpCN0ugpoxlKFUd2NljzdWpwCW0MYgVs/RDhdGzbkAaV\r\nVF1e5tc8oZiA6M32bjdQ2zuDtzy+W0cO0Fcw3UlsihOC/1FASIBQ9CESrmA3\r\nwPA2qqjptc0nel/anM6c+M+BdYM155oVfs6cKBMi5HB/25FbHHQ0CDWZxF81\r\neleybrKNFLFsww/NG9o3S0rv+hb37URokEBPIzzWQcuotEn7vgDmBpGRWW7E\r\nuMQdFyEhipgRrU7cQ3zuCUT4IbHm1DXWvlK9sz1meBRg/hzstiGALZeKs8oo\r\n4xFAjG+TjjpkUK8sktPb6oacRWWkbYVV5xqK6MiHRRBRRZRscFPrmWUj4+vv\r\n5SZU9xi2MULI4xATNeHSyS99oNWuVF7Sg86dWROSzCXjlsrdp0KTFNI33Sjj\r\nfuFKcp6ZapwOPRqcU6vpIFeiXCP6IdZLUGN0zoS3uXM4Hc5oR29Yrtu85JSu\r\ny9egpo2+QrbQA2YHZaD7vNXhuwwuTLxD5m/2YwC6AMZMIeu1zIhISFFIWh0d\r\nXYIONgUpATGYFK8aLBWKoXXTZKhjjD+XIDs=\r\n=SwWo\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"cc7d8ea77d18e30bad947332164ac02701e1ed9d","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.20.1","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.af5f01223.0","@material/rtl":"15.0.0-canary.af5f01223.0","@material/base":"15.0.0-canary.af5f01223.0","@material/theme":"15.0.0-canary.af5f01223.0","@material/ripple":"15.0.0-canary.af5f01223.0","@material/tokens":"15.0.0-canary.af5f01223.0","@material/animation":"15.0.0-canary.af5f01223.0","@material/elevation":"15.0.0-canary.af5f01223.0","@material/typography":"15.0.0-canary.af5f01223.0","@material/feature-targeting":"15.0.0-canary.af5f01223.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.af5f01223.0_1667327858512_0.9859937450697838","host":"s3://npm-registry-packages"}},"15.0.0-canary.58733ef41.0":{"name":"@material/slider","version":"15.0.0-canary.58733ef41.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.58733ef41.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"50d55efbbe6ad2fafaa6d70816758edf512f38ab","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.58733ef41.0.tgz","fileCount":37,"integrity":"sha512-fjII7tFHKLK0HScPz/8Qq9H0m7RkUgCQmIO/G0g1lcPiFcfmASUoeo8yC9OiET6+wHOG6Gv1Lieu15IrDD0hxw==","signatures":[{"sig":"MEYCIQDiT6s4NRfwxHDFqiGzIc5tLmCkCHl2P8STsTGLA50aqQIhALTjd1KVmrdFn+uJXCIXI1Xjh0dWn19iBrqECSmaGNo7","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":879901,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjYrLTACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqCUxAAkKvLhMZ2YXzzidhnxYT+2m5j74Zww/k2EyRTU5loRmHHeh0/\r\ns9RyhmI7WBbO7VowfSW7Rm6OEnyR7+bTpWD4eMcdZ4oZDD9vLR5rDeNNtrAu\r\nJwyiVk87SjHvmZRAF6Ex4rd1aTkSLa0kxAUvZlb7IH/BlKqW9sahY2Rv1Aer\r\nhmKfE6kt7W4D1g5fhvR05uxJeinX+YYEW9m9UPHufzD+95gMRmurL/Pr+fsj\r\nG5bmVsIxq3SW/g4hwXRxxR8dcC8KOcq2bQDeolXFjcwoXrz6osPxOJt+uR+Z\r\nht4q7Gr1/jnsKnZIv++6nyzgAusPJDtgBjFVRF/cazteU/o6PYacdUs40E+M\r\nODmVHAAqBpdmzDwFxG5AlF0bnXpX6JULW1paNe16AsAiPhUFV+FPT8ow/VIs\r\nWGl3VByg6fo/W9j1Jt7S9rVWhdLLeInHv8+47kwzVMmWWXAClPDowiXtomEv\r\nV/7uZOH9FLBoWNWk9fdMFn7ZGr6Yo2Vp50Xq5QBlfftzOcA+0qMZpQOLgAJN\r\njjsjDwu3sWFIYsmcmw6LZ2Sm84ATtAEF+i+6e6AF+ESiXgnpRwJLwtmXIeiU\r\nesDrT6E/EHTk8dYyJ1qo9WIU1PM6Jge8Sq5J0tYr8XqBD+06uFpP/UljvmvJ\r\nya7OPL8wAG9xYRIMnKWDDyJMwSqI8HNJcaw=\r\n=FRjY\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"7754bbdf66b8fd61976d3dbbe04b991d9dbc0caa","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.20.1","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.58733ef41.0","@material/rtl":"15.0.0-canary.58733ef41.0","@material/base":"15.0.0-canary.58733ef41.0","@material/theme":"15.0.0-canary.58733ef41.0","@material/ripple":"15.0.0-canary.58733ef41.0","@material/tokens":"15.0.0-canary.58733ef41.0","@material/animation":"15.0.0-canary.58733ef41.0","@material/elevation":"15.0.0-canary.58733ef41.0","@material/typography":"15.0.0-canary.58733ef41.0","@material/feature-targeting":"15.0.0-canary.58733ef41.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.58733ef41.0_1667412691320_0.9764221258188177","host":"s3://npm-registry-packages"}},"15.0.0-canary.909b48215.0":{"name":"@material/slider","version":"15.0.0-canary.909b48215.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.909b48215.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"4336dc24d67652b1a8a3873839e74ba97c22a17b","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.909b48215.0.tgz","fileCount":37,"integrity":"sha512-yLV/cxpIoFgAX+uZMXyIs4NnJxPCXZM8eBY6PYJj+gHAgTSiuJG1zjv950++Tkb+ka3jPA/sbB3wX0zLBypozw==","signatures":[{"sig":"MEUCIQDPxORYj5fpJO7JI6egDEo7ixQ+9m+Bx2l1UnM811j9dwIgOfJ+u4NPtXmW5jHEDAk8mQAVYa1bxXG1cFP0os1ySs4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":879901,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjYz7KACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqnwBAAlWyEyBsFxHbG+q9oXeoq2UjYB3EW9p04urZ099mPggU7TYy7\r\nO12qMPWD5e9fAzOlghoN0aKgvzjGwzjgP0N/K9y/Ot4Bbho/cXSH3LkZejvZ\r\nMESlpHCvZR/oTVYtD5zwywA51IeTE6xNpkCc+NJIzKWPIgk9l51pYQrZIBxb\r\nCshoNYqX1dAdB9S4q5WlV7qGyJunJ5zV7mdbGhSbYQf5sq0Pb1WhSlS4EvMz\r\nsVqUZXF6X7CuTpTei6NoluKdFBKRZ0d3yaSBTDIk7/Wc0GnJIs44xMglRXwD\r\nFfZa8m3hnB/bHkvtt214z0HMd3KvpFw+iL5aywX5ZC/qEEfjXBFQWlyW+MRP\r\n4lfsF7qLTLweuyQGz9Fo95CeXkVZNQ6xRHir5rmwtqv3wj/hRfGI3+QWEiL7\r\nWo0BUUfUOr72cWk8p1/wPn3HrK76FO3oWXw1qkNk/pUcixZm78Ecw2crXwCI\r\nKPlgIxINzycUC/zWLnSjlsBb+D1j6J6NApgFJF6FFL2pLCdskNqgAgCE1cAf\r\n08O87h8pbxPHwyq/KHsjn5n4yZBlroUMCGcivOMKuAbEaNsm0rKSu5TfU+jp\r\nnNfoc3l7ScYLQN86mQTBa9KyFu5uYeY3vaXnYYQkJHm48nJsgOJYcXQpofSB\r\nzIfVNhkz88R5yjEfWLzXSGYq1CYK30IdJB0=\r\n=Wc08\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"68d372ae12d017bf28fa2ad3c86cad4f70609116","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.20.1","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.909b48215.0","@material/rtl":"15.0.0-canary.909b48215.0","@material/base":"15.0.0-canary.909b48215.0","@material/theme":"15.0.0-canary.909b48215.0","@material/ripple":"15.0.0-canary.909b48215.0","@material/tokens":"15.0.0-canary.909b48215.0","@material/animation":"15.0.0-canary.909b48215.0","@material/elevation":"15.0.0-canary.909b48215.0","@material/typography":"15.0.0-canary.909b48215.0","@material/feature-targeting":"15.0.0-canary.909b48215.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.909b48215.0_1667448522010_0.12433195201112857","host":"s3://npm-registry-packages"}},"15.0.0-canary.7f17127d5.0":{"name":"@material/slider","version":"15.0.0-canary.7f17127d5.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.7f17127d5.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"8c744de1eefff22bbb3bad0d2f661e754eaefe3f","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.7f17127d5.0.tgz","fileCount":37,"integrity":"sha512-llUhvHwe1EbgitywHDHPdaSg0NnlXjHr0KECNSAdJFLdtM5uSMCPtsDmEWiPR5Ra4InkLmRfIYhaKiuZAgTwsg==","signatures":[{"sig":"MEUCIHS4B3DtdsPLDxAHsgWfaxC2ug70Yc7p/Jro4iyZVDyIAiEAiRiM1y3fTjOF8zM+vMUf/rt1WMJKE/yf5TuwYaL2ApI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":879901,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjZAZOACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqBXRAAiB3/X+/wrFyCdLJRI30fZjFJNOppHc5+pUgQfRMjuHKUNnzd\r\nXtBSAQNVjSCHXPIloXD689UMYhnOduCqRdfOdNl6ZlAmu5d/2HugYxXbeY99\r\nTLFp98LXKZIUsAycJMLaLOrrwWNXKXvikLnIQ+Nx0ZsJ12wLUN9t+ykDgblt\r\npBaINP4EK4KB/Iy1B6p3xZZFF/LLrcS+gu0kGMHv6FNw2V5Qs6uxq2BCEpnz\r\nFtrW6G0Q1eCPHxOxkLZEOnx7VB+mZbV61T8emvd/gVxo96jDFai1rMwi6CHa\r\nISRxwYrGys8shEMi2OpPAVZGdtxSndtR0sTYYw7apo0PXXAEpKblfONfPG8i\r\nWpEn85WaBapC0gv2dz3hy2W2/QoCpcp2S51eKErvQ4/RlsHuqljqeGmFT4nl\r\n+iA0AAcdNu9+ONnFWWbFBmkqShu4Fy8+IGWLTVKMds8FrvTAtTqwCCWTyRIH\r\nV9436gqolPpYhc1U1FRcm9rlqCRTy/2TQ6giBBmP0Aw09XlrR/nBqW8+1lIk\r\nZTElp5EeBlCCx30s31aOqvI13oJ7SJ4Sy8WH9TEMMoStn8jxtuWDg/QGsJFL\r\nbYBQapHSb6yt6jc/Fhqgr1hQjsVCgjgO6OAUtZbV4sEKYTTVJRNboMhCjj3T\r\nlEWaSxWjh1RuMgEGiydRGvslOqP1xLxkFY4=\r\n=iwOI\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"26e22af93057c0fa00e7fa9eb104abdc96131eec","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.20.1","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.7f17127d5.0","@material/rtl":"15.0.0-canary.7f17127d5.0","@material/base":"15.0.0-canary.7f17127d5.0","@material/theme":"15.0.0-canary.7f17127d5.0","@material/ripple":"15.0.0-canary.7f17127d5.0","@material/tokens":"15.0.0-canary.7f17127d5.0","@material/animation":"15.0.0-canary.7f17127d5.0","@material/elevation":"15.0.0-canary.7f17127d5.0","@material/typography":"15.0.0-canary.7f17127d5.0","@material/feature-targeting":"15.0.0-canary.7f17127d5.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.7f17127d5.0_1667499598084_0.0698402670645093","host":"s3://npm-registry-packages"}},"15.0.0-canary.da95e2a05.0":{"name":"@material/slider","version":"15.0.0-canary.da95e2a05.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.da95e2a05.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"61ee54adb043d1043c659cd17f27f50cb80081e7","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.da95e2a05.0.tgz","fileCount":37,"integrity":"sha512-y9UajOYB+dqO526vyBJGCdZAX7UALTJXcZwTb1vkOG5kW8Gnzw+DvfzWei45ZSlEr2EdTeJ+zXkADtsZuHoz2g==","signatures":[{"sig":"MEQCIH7S0XU/glVYws2lLSWrROhcmLuwbz/F0aEdk2iH0JMGAiAd9Gdv5D2FpJL+yO8MxQD/yS+0gmgLL62hYMMmOufG5w==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":879901,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjZUUIACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr50w/+PNyZzVAMJ3JWUNFnP6io6z/9hN/u7jIcpYKfFVz3yr8TQGqS\r\n1kgEhajyVz5P9N3JqJVKzWDKGaoGAgE8GceKtxK4AgTTHvBjc7gRnOPu0jLD\r\nxKHpveUtiMyzXWK8C7lJemws6tZGznxEmhr2Zi/uKKRxXVI9fFy14wmQx6uV\r\n4/oe9jdqt/3Ez09sEnCgt0tRm8I0h/jRKC3ghrlaFbbuXlclAyNsbNDkSerE\r\nIc5thj/k9hXp+AKxpTww79MCoyYHpryy7JIhwHOeczXVs2SmV1hrxvpTujHQ\r\ngXvf54kQx7ZK4xcjWCO/C4OvaUj/uRDfxSJ0ww/TxOWC+073WRBQ2hLiye1i\r\n6dXbDOPHoFiJwMCNiOzHB5calu4M1BeggTz0zPY17q2yBmEGY0LC365yZkrR\r\nEB7R6SqPrLI9WhlPz9BAjZcK1dPL0TD1nxW87s6xYawxRaEeiF1rRQqUwWSW\r\nxyBU1UMxIOW5fDisI6zDlR9Rhs6/vhd4l2aOvLmxoQJoO2K7nUh4IWg41DJ4\r\nv0oyqkOBmc9CD81j5bcdlTQ2OcFqUzowte3SFSaY/dwXB0qVEnF0f+O5C9tg\r\nyss0PO3HWwArG1B76whr/8d3HMhVUQWmd7GPQdZEwLho9CZSvcJHZdUhho4f\r\n1OvlhEkHxkRVI9p4E/iFl8g8hmVznddZF9s=\r\n=fglW\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"eb47dc6e824d05fe1a33c55066101c99ce1fe241","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.20.1","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.da95e2a05.0","@material/rtl":"15.0.0-canary.da95e2a05.0","@material/base":"15.0.0-canary.da95e2a05.0","@material/theme":"15.0.0-canary.da95e2a05.0","@material/ripple":"15.0.0-canary.da95e2a05.0","@material/tokens":"15.0.0-canary.da95e2a05.0","@material/animation":"15.0.0-canary.da95e2a05.0","@material/elevation":"15.0.0-canary.da95e2a05.0","@material/typography":"15.0.0-canary.da95e2a05.0","@material/feature-targeting":"15.0.0-canary.da95e2a05.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.da95e2a05.0_1667581192424_0.4846623548898308","host":"s3://npm-registry-packages"}},"15.0.0-canary.4832e2750.0":{"name":"@material/slider","version":"15.0.0-canary.4832e2750.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.4832e2750.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"ad33fcb11e655a491db3bd0da80560709e64a3f3","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.4832e2750.0.tgz","fileCount":37,"integrity":"sha512-PctX6Zf6zyCky2PStxwxnk9MECtJxTt4sSh4cOLef0eGIlbiUxSKf1u58DPwLIH5hLnAx0g53//g8pgdkZ7ZuA==","signatures":[{"sig":"MEQCIGaFSnJMo4A9IHErMubkQojPrCWkVc7NyjxZmc0gV2dKAiAiWXgeITFhzuygFKZ0aRso9BzGHm9zyeUGNOFTiNuh0w==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":879901,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjZXzNACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmqg7A//RWGf7qCVePwDlDfg0IWN1uq/pQEpDhecd31Qz1/fOcye3KxX\r\nGrXkaqbtv7Km0jRKPKZXS96ibygoxZg2qHHW+jd2B2wQcA0odSO2RQ7+HlaO\r\n8b5fJzyWifbLMPy7ucgFPqt9pLG4z86+cNq+dtc9iUMvoQO1nEDWrEegdP1h\r\nMYExGI0zIMwSTXG/icR5R5lHmwfxOdYMbLv3ltKfsdNYrGS5Yg6pZOQc+9BH\r\nEu3xxT1vio+vSvFnESahMY6i3gHakF9pavTcZDl55uzZxMGGed2FUU5OOUFI\r\n+/mkZOIrMxlOiAiFBc4FdCSqD+N8aGTh4o1nHbQgOV7ktp8kypH41kDCmBqz\r\na7dI15Dwr2/e4uf33CJNWRTOOAocAadnhSJsAW5KTF2nYJWdhPQZLaGb+5o/\r\nM/zztakjbweqU41s7EG3+zP7hpy0V6De76c4fOMOH60vQ4cnFfyU6OxlxV3H\r\nXEYBEBM+FVbl38HQNotN2UBI0La9fpoU8bIC/S3J75wAAb89pujQddddgfNj\r\nMiUvXGGeh4oYl51c9RZFOvUAlnPnLp1VgrEY3kHHDfKhx/e76KgAPoUl3d2w\r\nRbBxD2Uu+CpT1kADd8N19K4Ou5HqrKP7RWARWiwki6gDK6iu/Dlhf09IXx6d\r\n6/Za1MddB9kZVSoTcyebqspQK0UYrcda9bs=\r\n=eEYL\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"258def578bdd5ff3b52dbbfbe6f06e14b2b74045","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.20.1","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.4832e2750.0","@material/rtl":"15.0.0-canary.4832e2750.0","@material/base":"15.0.0-canary.4832e2750.0","@material/theme":"15.0.0-canary.4832e2750.0","@material/ripple":"15.0.0-canary.4832e2750.0","@material/tokens":"15.0.0-canary.4832e2750.0","@material/animation":"15.0.0-canary.4832e2750.0","@material/elevation":"15.0.0-canary.4832e2750.0","@material/typography":"15.0.0-canary.4832e2750.0","@material/feature-targeting":"15.0.0-canary.4832e2750.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.4832e2750.0_1667595469028_0.05697376922566644","host":"s3://npm-registry-packages"}},"15.0.0-canary.215506426.0":{"name":"@material/slider","version":"15.0.0-canary.215506426.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.215506426.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"8607e24e0d1d07e1c605e3d270ce79b95d41b4ac","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.215506426.0.tgz","fileCount":37,"integrity":"sha512-PmcwE3dpSTb8clP8VvMwk1X7SW2yZ+wcqKHZbdNmmQ4sMj14acCuLpEQPs1uSeaFyEl6sLagpXpu6xXLq0+SKA==","signatures":[{"sig":"MEYCIQDMx0K1kizoQ+F7BThYnDmz2RO2Tm0J+ixINHH+KdjlwQIhAOU6Q05AZrs3PcpQ3W1m9oWXT42LtspfZYcl3QJNu/CE","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":879901,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjZbclACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqJsg/9HQFPlTqvuCRc8zz9SydNUAqgPI94Hx7hbI0VJYJusjrQNctN\r\nUzZ6G0Zf7ZSppX2Blk04dS0+NFeLLmtWLDjCv3/z2/eAmy7FyZgCcu5tZik/\r\nHsPOHexhip2aBemCodgzOQjK+cyJ8N0wRVFEZIvW/jiuw+a1kvsyKPPPYPD9\r\njwkknGB1hme9julkwJC+COwoxfaYFgoQSIIwm515vMMyvekndGUn6Jvulwld\r\nJjKKX/C9RFrWdmpdILhOolIxG2l6ux96GdEwkhQnxG5a+BXk6L29awhMNjf+\r\nJRzje0gBTrp1sXXKh1i3+/aBRWgbaXoZMT6Ch3kDFDvZscddJcCUAr7tu/3S\r\nC1r9BAUDBRV04ZGi/7bmQtrLvEf25WBscSi/iG8RpTtw0TEFfaEmhZcMIplj\r\nvuX39sPH4cP2e7teSaFa1NbVH0deSPPke+gBKvB3awfXxdTyj97OaeddB7tQ\r\nKivK33+Iaj2gZCCRoiom5JzIM9gzLIYCdEypRcSWU9f4SiNqYwPArXak/64z\r\nxMj5/HYD/S3C4YsJAyoplnvvoKjQ/vJvonpnTzyP2XR/Nl6M/99Gn2ga924y\r\n8kol3+8PRCFAiozjs9gjw1Hb+1AEtQT5dDqZQxcQJokhCbsmwgwpODD9ZoTC\r\nYj1XtVOgGmxDPI2pHFrh3ajk7a0eK8fOE2k=\r\n=e8rS\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"c7da5104ce280eebfc1b0cab2279b8acb906babd","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.20.1","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.215506426.0","@material/rtl":"15.0.0-canary.215506426.0","@material/base":"15.0.0-canary.215506426.0","@material/theme":"15.0.0-canary.215506426.0","@material/ripple":"15.0.0-canary.215506426.0","@material/tokens":"15.0.0-canary.215506426.0","@material/animation":"15.0.0-canary.215506426.0","@material/elevation":"15.0.0-canary.215506426.0","@material/typography":"15.0.0-canary.215506426.0","@material/feature-targeting":"15.0.0-canary.215506426.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.215506426.0_1667610405443_0.6621644475047384","host":"s3://npm-registry-packages"}},"15.0.0-canary.4cf917476.0":{"name":"@material/slider","version":"15.0.0-canary.4cf917476.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.4cf917476.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"2e40a5e6bbabc349d30815f0e723a31c7bf380ad","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.4cf917476.0.tgz","fileCount":37,"integrity":"sha512-rsa+RcQsG9NGpOHBoeN0HquRyspKCmP+2cDbSpZxikOeK3dCe7rkZUOlOlQNuLcj9bfp/eEFfk+yUUy5fDbR/A==","signatures":[{"sig":"MEQCIA3OFXwVjsJzMe5NxahQz3IJdnsP7PwWsVfzFcAm3qfPAiAqp+RRyY4cctiKpNIjr31+uoXJGP6GJ8W8bI+9CxEo8w==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":879901,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjZqXCACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpsNA/7B445e8ngPKgWCIkbRJZDq2bkYep+AkMj8q6lm24S1JEni6JC\r\nIPG43JPFLVJzdqk0od5+EE4VNPJRVyO/iAxBFzw2lzyrBrA6R9E9PVruteg9\r\nDMuxAcTAkU0BJrjJdOW+Yg0xMxAQdnxnkt2egN0w61x2SOeIC2azxjjL1KZD\r\nSNDKy+Q2HMIPsLlSv1chviqt45J024M9YTKD6tarRWZ4wJwam2x0R+G0Pl0X\r\nDMm6b5+gj9j9gOsX4gkPxHmCrcNAAhEo/u7IsJSx9MeFFq2qLrRcFEPiZEI6\r\nMobbCu0aYLlbeawKRye2IJBn8BoX0ZK2CsnhT8tmZ8RZcVWh9XKiagPa8T71\r\nvu4gozqRo7WMqYxMkf1w62h9Mk0FewachXxNgVE/ZqumIODu/DuBXq+EOrij\r\nkkWqVkK8125ya/lKiBYltrCZOjI0ajgPYun0FU6f1yvz+NAhqmEMtlVcNBvL\r\nMksfcAJxJh0oeQJQV5Lc4xt+R1w6u76R3nqekOvIc+AUN94iqKlrwpoAOQwK\r\nYRIsptso7mgnZFaMOZekfvfozDgXTKRF+eW1hjaueuq5lj/zT0snti6vTOgT\r\nQNVId+1YUZN+1UAuMYSKBR/bxtky31R5MaDskBBnMUM2qaaQoXKJxeasXX/M\r\nH+mbHkdNIDAg8Dk3tHPOts6M9Jwd4Jx04aI=\r\n=1I6p\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"c7ef38a54cc085b34eea4d38f143f3b65dc649e2","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.20.1","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.4cf917476.0","@material/rtl":"15.0.0-canary.4cf917476.0","@material/base":"15.0.0-canary.4cf917476.0","@material/theme":"15.0.0-canary.4cf917476.0","@material/ripple":"15.0.0-canary.4cf917476.0","@material/tokens":"15.0.0-canary.4cf917476.0","@material/animation":"15.0.0-canary.4cf917476.0","@material/elevation":"15.0.0-canary.4cf917476.0","@material/typography":"15.0.0-canary.4cf917476.0","@material/feature-targeting":"15.0.0-canary.4cf917476.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.4cf917476.0_1667671490588_0.5455366382216082","host":"s3://npm-registry-packages"}},"15.0.0-canary.eef14bd32.0":{"name":"@material/slider","version":"15.0.0-canary.eef14bd32.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.eef14bd32.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"d9db8bfdfbffc1249a160f9cd6972d17b6548988","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.eef14bd32.0.tgz","fileCount":37,"integrity":"sha512-KXNuz466gZPloE6T7VGn4YyMzsRgyDezuLHdtwVrAZ04/yBlfzkXeaOShOD9if5tuWD7VuwoQHqaX0iMv4H2Kw==","signatures":[{"sig":"MEUCICRGiDkpgxvO26B5o9q/c6lb31SOEzbhqtIR4RcKRd1dAiEA8bgoI2CFJkk88S16CXrvBX9JRcchX5j612ZWpOxKCTQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":879901,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjZ+4AACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoCSQ//X/xVYdt6yrT9TcJAZTQOxDopCsR7i+m13zcp6sq6vBBPimDV\r\nLXaYI374m0xLoCo6BDByWe3Hhrb6d+VhlDBISCP2s32oQEkiFjRawzFKxogE\r\nLy+ZApR082n8TtlW33ppuoOiWWfM+phEFNpT0niwBGK1hYVHTByW3KgltWJv\r\n/IqWMLupmWimiFuBfyTmrkCNF63cGOVyo738JEyhd3TJ+ceH/g5CWrMTJu1Q\r\nAO0Ew/vu3IJ/sL2jrI43rZAgv2BeqEyVZ2rthcnVoqK2Zz1aE5TM3Fvbrxtz\r\nXQaHTiCr1Ubp/vPTj3aFCPC/boEM7/tw2aivuqttLIRKKR+B2zJFYFJXNk3N\r\nQY2a7OBL7SteBuqAWa5hXTc6JlppuYW1DwuEZpUPYNa4MG02mtrLIs4zQQ0W\r\npGLMbJi5lykKeYabjUzDJpw3f+rigKhDQDfij9XCHhwXzOsABS1v1NVS3JWm\r\nqCuZM4yVdxzJGricWK3q8WTXN1mCe1PzZaqJ5Lb828/U8mRFy5GWCsXbU0fp\r\ndrjOl2meYDLo/SE21XwVFVLlqkb39gzcUGJ1c/IjY+4gVPAD4hXYH70Q8aTe\r\nwm3hHKSWLegTNLYpAffEJ0Pf/ePqV1qRF4vqOhjrAwHlFVkSKSzkedeC96G6\r\nHw1ESKH6/AagJNXUfY9dJSrjEA1OYG0D7FQ=\r\n=3+j9\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"40acb6cbe1201f5ef758bfb96da3145ae3c4c1a5","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.20.1","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.eef14bd32.0","@material/rtl":"15.0.0-canary.eef14bd32.0","@material/base":"15.0.0-canary.eef14bd32.0","@material/theme":"15.0.0-canary.eef14bd32.0","@material/ripple":"15.0.0-canary.eef14bd32.0","@material/tokens":"15.0.0-canary.eef14bd32.0","@material/animation":"15.0.0-canary.eef14bd32.0","@material/elevation":"15.0.0-canary.eef14bd32.0","@material/typography":"15.0.0-canary.eef14bd32.0","@material/feature-targeting":"15.0.0-canary.eef14bd32.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.eef14bd32.0_1667755520644_0.13586529634751154","host":"s3://npm-registry-packages"}},"15.0.0-canary.6faa29fe9.0":{"name":"@material/slider","version":"15.0.0-canary.6faa29fe9.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.6faa29fe9.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"092c3c3849a98178c99b5816a24a177335f14a4a","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.6faa29fe9.0.tgz","fileCount":37,"integrity":"sha512-9svV5UdsT86Zj1wWX33bTKLipr/QIwiAHWzR/zBx1TK/vKEZ7/C4E+5g1HHks55jWXX3Tp9B6x8klfEGMlzmnA==","signatures":[{"sig":"MEUCIQChMpS0VgETcoxesFI6O8551TeV/T1DyMiDAI2Chr53rgIgBWLr4VTH5i2YrHzA5cD5HBTtTyW9kCPxK4aN4GrlKDA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":879901,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjaHgCACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmrb3RAAjsVcGKIYdpUds4SQxf3YBHvFVPwwYUfBL23kWp2Mmg/1V1bt\r\nyDc+8O9SCz2xs5VZHiPsf2HZI7keFhfeTjv9XEc8v42/2Z9leqlLHC4gga1z\r\npxepSJBg3cDL22mwSfDteBLNQrLdl0PS7et3+nI+vR+YHAqzQ8I3kccft+pc\r\nuUA09F9ULrchID5FkA6Yyr5s7RH6Qw3fPJRgeJXzyp+wkjmLnwG/ipXZeAJL\r\nG7528RhH6gZ0v3Tw7t4Gc3fKck/HGuq3If2QQhBrSnALBqgcLciHRcQC9ajr\r\nyfU3DP6AjcY4Aw08L7UbcAR90cf219//E8dLkUcrf05DlUIcVOXqubLjW9yt\r\nHEiNMFcWFFKVSsaTCenlJ+k1Ncw71tKick7XPNILQVu4vVMPLFiG21u4eJBd\r\n8wMK3EeYmo1HoMeN0RuVPqt7HjI+u6SuoHY6gBBJ+1fRq3MuwV4Jw5l+sz58\r\nUXbgDgqbQTxvo3gW9Kcd006Ptv1K//WC3rrdo8XRH6tSdWqNkVhT3h5+5hfS\r\nWOqWXZ+5sIM+h+vIc/y5WeOWRVkAZBB0KRxVQEDSzUVFvhk7UKsTAhaMwZOt\r\nonMYcowA7l7pa04h+rpXtsyksb8+3+iOZahyX0FG+PyuAX6M7Ttp1zgVfDMg\r\n6w+xzjM//A73Lnx9zzGnyDC7tTYaRoVRSZg=\r\n=A9vH\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"1403858386443f73c0593105b5654b6ad8596a9a","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.20.1","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.6faa29fe9.0","@material/rtl":"15.0.0-canary.6faa29fe9.0","@material/base":"15.0.0-canary.6faa29fe9.0","@material/theme":"15.0.0-canary.6faa29fe9.0","@material/ripple":"15.0.0-canary.6faa29fe9.0","@material/tokens":"15.0.0-canary.6faa29fe9.0","@material/animation":"15.0.0-canary.6faa29fe9.0","@material/elevation":"15.0.0-canary.6faa29fe9.0","@material/typography":"15.0.0-canary.6faa29fe9.0","@material/feature-targeting":"15.0.0-canary.6faa29fe9.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.6faa29fe9.0_1667790849834_0.3905138109398545","host":"s3://npm-registry-packages"}},"15.0.0-canary.9af09b967.0":{"name":"@material/slider","version":"15.0.0-canary.9af09b967.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.9af09b967.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"876d0e1e26fa95b9fe2cd482afd0cff757b7d1e4","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.9af09b967.0.tgz","fileCount":37,"integrity":"sha512-qoBJsO+7BejVLbFbTwQYRmnP0LASw+qbnck4c8+tPv6pS4ZHFEpUFUB///aOA1Dq3VYhxsZhJZLPbdVBiojo7w==","signatures":[{"sig":"MEUCIHxw9EZPbhMxTLjXvYaki2EAFvzYWV4fSYhSxKRIlk+DAiEA+4Q+2a7tJN0m6340VS0E2QR04q96hZYiNIT7SNhF7YM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":879901,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjaU5XACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpN3RAAhYVbwH72to/jG5kUnocONRjFOzMi0+l6eNHzmZnbFIYWSY+D\r\nsCCQ5/ATUmF0oG16JZkiwC8w6Di6DqctLgupqPbxzWYVloyYZ17NlWaXceVB\r\nVQIs/xURftTb1LFLAwYxkVFD9OYgsRqHAgaM+hN5sMQ7seNlE0zEHFFVNmvq\r\nK7EYO6zqYL30hR2ZMyVFK21ZyaJUmAuoV4GLdbPFXT7AbZMlwabZ1kEo1JsM\r\nWi5chy7JcmN74i9fRsTdlA4BUsTctKktq50b/iU76oTqkN0zCxci55ZzxIz2\r\nt+qdFir++NCW2NC2zKfBJEjibaRcpZXakODDXpEkM/sOovle9mfUJurSXHTK\r\nZXtFuY6oGKw+L3mpC0EL28C5PILLqOqfoPD1ydTWgz5024jdkQvvrlSacwi0\r\n7Hr5O+BtF5t2Q0E5lCrq/BRDqzf/OmCBMaFAK6yyD3MaKuON18VWTDm+eo6r\r\nfGytPYy93w9BUsLvX3JVCes57jyP/I/6h7hXI47cJyegyIyacNyX2BYlTa7G\r\n4dE10q/MlMBSyFeNPGn5uOwrAywOojjkDGNzRl6VtbEKgbwiEuWerSGQrYhD\r\neAVFsg87t6mFmrY4NFrmPWt1Bwp9yuasSh2ReHZMl5kY+SGnNGD24yrz7IAD\r\nY+fVdt5Br2RBICsBMfcP4JJ08uMMuGdaM3I=\r\n=i1Jp\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"745e702463a22f4c5de6e94b3527530a9bdcc9d9","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.20.1","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.9af09b967.0","@material/rtl":"15.0.0-canary.9af09b967.0","@material/base":"15.0.0-canary.9af09b967.0","@material/theme":"15.0.0-canary.9af09b967.0","@material/ripple":"15.0.0-canary.9af09b967.0","@material/tokens":"15.0.0-canary.9af09b967.0","@material/animation":"15.0.0-canary.9af09b967.0","@material/elevation":"15.0.0-canary.9af09b967.0","@material/typography":"15.0.0-canary.9af09b967.0","@material/feature-targeting":"15.0.0-canary.9af09b967.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.9af09b967.0_1667845719544_0.4696403271044738","host":"s3://npm-registry-packages"}},"15.0.0-canary.0f54fbb93.0":{"name":"@material/slider","version":"15.0.0-canary.0f54fbb93.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.0f54fbb93.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"0af7d5655b256ecb8f498d08b037323d4b4510b0","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.0f54fbb93.0.tgz","fileCount":37,"integrity":"sha512-PilDckxSW6I/aIeXREvsoPbSyAa/38I2o3JZXvNSdx6Ui3PzrtG2zyz6FVzAxSx0zVCTHU1NMtJfAZS1/XLCIw==","signatures":[{"sig":"MEQCIAjPeEoG8dkGhGDozzI0n4QnKSbHeZ+WM2H9FuPJhNpBAiA5KOPBP0CLge/v4VErS0/9WqQTp+0VByrdb7EyNdFD6g==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":879901,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjatC/ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrRuw//Zi6a2yd35SV/6VpEHSDiBVv4V/k+VaFRgYknBZtEalrpoEml\r\nrMc6F/cwfEORjTYjYzFcY6zVjQbIaK2BS3aYPXrqYRn3GsPFosQaQyJJPHNm\r\nb9GbuXRNtg2J2YAgQgAH6o9Sx46l8ugkH0RfSKGvsd6cFQkftfDcuEnYLjoG\r\nG1E9SxY2FLqdr5aw7sGIcmRWD4P1Aes6bJVD0uQRs3xym4yIIf3iX+MhCyO4\r\nejHwoK2de8NFQaZqE1eV3QUD0OzrVJYGfM/lpXw4oivGDMx0qB6eISDbM03y\r\nah7Qy6GDm2HDpmvhDqwNoxeeSwKEEE+aOpmB+Obft5hUmznjQanTh2+kRJrb\r\n/GAGNgFZj9Aw7gg3P/+fh9x6+HXrwHpGWJdlLa9GDockc4aqOxlMTuoF2BrI\r\n0ncFt5Txc27qDrHa3tWgDdJPIfe91+TwYOVvqWjUAu7dwnCM+leeil395l0o\r\ni+bxuGq1XcgYb72LOlOItgyLQJ25YXzvfKh46FKJ+BAfKfZqormRh2/w6YeP\r\n1PJZu/Oz05+78AQNJPN8JNc7zrgoVUsEfKhjqDbIaHXEf7rBCEKn7cWytFyG\r\nlkjEZwxi8dT71HDb5mZDeg+tshAgVKwY20ky+WyWfje/C+VY9hN5RaBZcCwN\r\ncinYkqt3tb6Mz+2iBe9kP5G2J1iED0PamK8=\r\n=1Q6u\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"5d2d1814fad8065dd869bd95c156c04ad45926f7","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.20.1","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.0f54fbb93.0","@material/rtl":"15.0.0-canary.0f54fbb93.0","@material/base":"15.0.0-canary.0f54fbb93.0","@material/theme":"15.0.0-canary.0f54fbb93.0","@material/ripple":"15.0.0-canary.0f54fbb93.0","@material/tokens":"15.0.0-canary.0f54fbb93.0","@material/animation":"15.0.0-canary.0f54fbb93.0","@material/elevation":"15.0.0-canary.0f54fbb93.0","@material/typography":"15.0.0-canary.0f54fbb93.0","@material/feature-targeting":"15.0.0-canary.0f54fbb93.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.0f54fbb93.0_1667944639474_0.47073490316806343","host":"s3://npm-registry-packages"}},"15.0.0-canary.a8d47f9fe.0":{"name":"@material/slider","version":"15.0.0-canary.a8d47f9fe.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.a8d47f9fe.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"118833ff3fec6b8071438442a182aafd886cd5d2","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.a8d47f9fe.0.tgz","fileCount":37,"integrity":"sha512-KnGuxDN0W/59v37h9HhTe6f23Ka7jyiOsXyY/nZvbcBM3I2fvMdvXAlr0v17FKYEjrmYrhXhrgZ3Ptt/Z6yFOw==","signatures":[{"sig":"MEQCIHj+ddffoyWVM1/NcleGW8ifY5SUGO+nhASASgafM06kAiBWO+sGLrPA59M2JVd2lWF1Yp6JdoZ2eIBUGMNw8ufgog==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":879901,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjayonACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrFTQ//e6jNsHOwdqRfquXmPmsL0/FLIIQh91SlIvrCRwNOH7khB/xr\r\nYFZ17A8BqnNZvCqbl2JfS+wjgODMkU4rxPhCo9yPWftYH0r2ZawJy4wil8dP\r\nVY4/BE4jHYrqWOVo/eujp9JFNMIJtg2Vl9YLKZIFUstxKv5jfW1KIDBlFVqG\r\nGsuCJKLk2czqwAU3gvvGchpsDcbo4ERN40bTfMHJpsLze2AUwruTr/xPKEaE\r\ny7YCNUJo44uxTWXbyUMbrPnftARsqIb7DZMPet29qF6nbO0lcht/FRwnjjdk\r\n7CfCzOOJ9awd/JKlbhyA5lRHfQX7AJm9rIiNf2AOCZC8dMPnOUaXiZ2vMT+O\r\nMHE/IcoupN+OsgklDSVJwRRQ5+2WYNmxSgSEMrtX3KOQCU/68yTThoNZPU5Z\r\nwdV1poyRbL9VlAXvLAyX+dIRojw17vT1njefB3pwsr0SsKRQbi9GJMpg3pwV\r\nibCmtgxgDv+6RkeBSZ0qiWbbzbY5Jb3m382aupHIx3WRDeiNVLJfzq+9jEVK\r\nOq23fa8Orcex5DQ4EuG5lIPuNqFXx9gbnl/iH1PTvmE3iGRBXouob4aR+U/W\r\n7Uw3Rm8PKWbhJGXoMsDY0o12RPntobKEt99z7RM8yAhxsc2osmrbG7DBUffy\r\np4m7Fpkf3QWF7aODtG9fxsGYKl3tDiEiga4=\r\n=gUDV\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"37662af94525622cb00ae2dd17f31f6a93b4eed8","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.20.1","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.a8d47f9fe.0","@material/rtl":"15.0.0-canary.a8d47f9fe.0","@material/base":"15.0.0-canary.a8d47f9fe.0","@material/theme":"15.0.0-canary.a8d47f9fe.0","@material/ripple":"15.0.0-canary.a8d47f9fe.0","@material/tokens":"15.0.0-canary.a8d47f9fe.0","@material/animation":"15.0.0-canary.a8d47f9fe.0","@material/elevation":"15.0.0-canary.a8d47f9fe.0","@material/typography":"15.0.0-canary.a8d47f9fe.0","@material/feature-targeting":"15.0.0-canary.a8d47f9fe.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.a8d47f9fe.0_1667967527096_0.7959967226988578","host":"s3://npm-registry-packages"}},"15.0.0-canary.66a1e75e6.0":{"name":"@material/slider","version":"15.0.0-canary.66a1e75e6.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.66a1e75e6.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"e7c7883528e119210c6cbdc86f16c3c085cdd11f","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.66a1e75e6.0.tgz","fileCount":37,"integrity":"sha512-LmSKJBoyRH33ETTjjyUU0KjC21q9YcItDe2iQSj3ogcbMcLwYVOwXifBfioO67yJBv3r3qZwtdiWZ9XIJrHvbA==","signatures":[{"sig":"MEUCIQCSe81oZl7erRWhFnYXTm0D4OMDlkbvZ4gqVa9h6RXvRgIgCIrCzgU5zhloTkV8CbaA5sxnHiAAPcHTWd8iOa1l1YY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":879901,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJja3SUACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoHrg//RVAKCD63ozSxWliGuhJddlvkes7TTnLhlY7J5CGSKtVSVcOb\r\n+toSe2+TKhvxGKb4iUxgyhs8RFfRy7/cCCXWJBlQpXNKOo5zAawJiKrn4u8a\r\n+RVb9DSgbP5CwaEDNbknHjrPNYfTP0z1SIyy75roDTonSAAVY7KwYgmhrghb\r\nV1D38TCY+4xpPbXIP+wPB03h2jU88ErhCB2xREZmrNT1Ltb7tu+tb5a6LXP2\r\nILdTs+p2ljUnMCtfU35zqVr23w7Zj4CNPosGFvu/9YnC+x3w64aoYSGu0zBF\r\nBM0pRM/Thny14wNUF8mTSL2vkHSQzzR9BqKE5Lge9sbxp5GZHfBZLgOXRiN+\r\nT8jkYWKOrXbD6tDzJ0y58Tl2JUGvGPcb13WS6ge9IosO2N8xqLNJsfWkVkIp\r\ncVdzcUtKT09bhA0f9aLIlaQS516HiL7xrHst3h4Alav3vIy4X23b5XMB6R3l\r\npj9RGNxBclsbEBtsRi82wNkKuN4w3FuqkDt8Zg5bICvcYhvdWJqTQ2DkE09+\r\nJB1igygUh07VSQvjdJk7ns8fu3NfyXEVf77+SmZJFJCUn7jqvOKOKUwQkS1l\r\nCsCyv9pleP4G2edbkRTRCKSFtoWTJr1K2z3ao0RQNiptQrnqQ8f3gmjS/BE9\r\nNAmOliVPB1mLVZlDlu/61YABPPeYr9GGVws=\r\n=yALu\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"8ed0cca778858904bcff29669c6dca407f25ef98","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.20.1","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.66a1e75e6.0","@material/rtl":"15.0.0-canary.66a1e75e6.0","@material/base":"15.0.0-canary.66a1e75e6.0","@material/theme":"15.0.0-canary.66a1e75e6.0","@material/ripple":"15.0.0-canary.66a1e75e6.0","@material/tokens":"15.0.0-canary.66a1e75e6.0","@material/animation":"15.0.0-canary.66a1e75e6.0","@material/elevation":"15.0.0-canary.66a1e75e6.0","@material/typography":"15.0.0-canary.66a1e75e6.0","@material/feature-targeting":"15.0.0-canary.66a1e75e6.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.66a1e75e6.0_1667986579936_0.6196298366846131","host":"s3://npm-registry-packages"}},"15.0.0-canary.5e5c2afc0.0":{"name":"@material/slider","version":"15.0.0-canary.5e5c2afc0.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.5e5c2afc0.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"9e7af6a2f0991103f62b3f04bfd5152ec5b252a1","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.5e5c2afc0.0.tgz","fileCount":37,"integrity":"sha512-S7B7NvVilR76ctpHm4BWFEHHaDKLQAQtD2f06k743P9QT7IErMAoJzXK+GBPD4nxO5V8PtexKDmPcyUs2ZIikA==","signatures":[{"sig":"MEYCIQD1ceY7U8feAjwO/24Q1ypR3k+UVksj8fWl1DW1pXt5nQIhAOBApRv2kWLOw7nnQTfXPZ0XUbpyc4fNr5jN1KH9+pZe","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":879901,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJja5TaACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmo/AQ/+OweBYCbExLUNeQOZXggBBtuOJOYDoFKFzJcgN2Y5BtJ8jL6U\r\nvgyvdsnTJXjW3QHo+4FB78MR4lr/mU2A7tzjP80U8ihsbueJkXHYliGG3Jm/\r\n8m8vj7Lg1kW1FFphd2aDKPD+XaOwEwrodHkqP7GZebLXkRR7AkX8BN9fya4V\r\nXIs2GpdOUFicyiAUeMOOTS7wRN6mzQ4CfXrHMXJ+RR9ZlnJgYUZL9EtRhQsd\r\nAqi/H0jsRXBmnmYWXbGpKKXwyXCRKBZhOWoeWZJYWlICiB3qH39swM+nE8PT\r\nXu2QwmTTZz4urR+waLWRJGknZFeWAJd9tHlSz5Id6cYrXNCO6LOBxUIBw5kF\r\n0ab0auphQRg9ngAc4y8nrok3oC4lS5RvUUNTpaMrxvhL7TgpRP1wyWVuymaR\r\n6FSHl/krzvA8G1ip/3KoqNIjpB3VU6ZRQjGffx1iGJfpU7GT1AC2m7FeIF/P\r\nNOkxibXFU1Ec1x8CScH4p/6SbF2r9cWIjXdgM8aYTe+/rPmKWCMTthb/YXRb\r\nZQ5NQVGTbmssylVbuZfFHB2M63gqCay/o4BwDzsG5maa1z3jcK8ym5JK7qrH\r\nk8p1jfYplowv+CKKo8Ixfdz5wucM/18ha/5JR4LeslE5u2MGzGH1Nx3JZbOX\r\nHg2fair1u0TEMG1IrTZhPedK5A3O0b9AlIA=\r\n=ihI3\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"f14204a01be3c79ff286a8287a0ab731c371492c","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.20.1","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.5e5c2afc0.0","@material/rtl":"15.0.0-canary.5e5c2afc0.0","@material/base":"15.0.0-canary.5e5c2afc0.0","@material/theme":"15.0.0-canary.5e5c2afc0.0","@material/ripple":"15.0.0-canary.5e5c2afc0.0","@material/tokens":"15.0.0-canary.5e5c2afc0.0","@material/animation":"15.0.0-canary.5e5c2afc0.0","@material/elevation":"15.0.0-canary.5e5c2afc0.0","@material/typography":"15.0.0-canary.5e5c2afc0.0","@material/feature-targeting":"15.0.0-canary.5e5c2afc0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.5e5c2afc0.0_1667994842153_0.20617185825983864","host":"s3://npm-registry-packages"}},"15.0.0-canary.3e3f43359.0":{"name":"@material/slider","version":"15.0.0-canary.3e3f43359.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.3e3f43359.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"3a1cfa25ac65a8c8afeb78bb85a53c05db1baa8d","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.3e3f43359.0.tgz","fileCount":37,"integrity":"sha512-s9sYqsijP9KUWII171c2SoeIbQDD/SCY7RNmnpDTCVah/5RYHuGCGbimTwK/ARWckHDbCTq5t4D5ACr5MXP1jQ==","signatures":[{"sig":"MEUCIGBlNOaSSPp0+H6hci1z0ecnLjKrn6vsLLW34oDOOG6yAiEA+rcOfCjex5C3B1+rW9aAhn4bbmQIS6S5XgdpS+JzJfY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":879901,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjbAecACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoLDw//cSUdN8vXHPHHqPod4NBCLqpkyND+2QUm1yeg8Cejk8Sm44Xx\r\n+aRW4iau5TXwPtHek26fnRquT9vtjgzv3BUDfOjHR6B9pj74SipL7jNwA2cW\r\nT5lXIDzOQxRWzY9MVrtCDO+nvlD42Lc0CXw/iGYZJVJy+R8F4FhRd5s5etdR\r\nJ+URQxxmgtL5d+VxgEtWV/Cun39PQhEWV8q/S55Mahr4O37NI5Ctrfi7/0bb\r\nFd8q4GzXANdlxrX9Ssa3KCqZgmpPZ9q6H0omm0LhSa/oPe6gVIBVtQwKv2OL\r\nQo10mBtJbfEFJZsD2xIFF0zhnmyAa3OzUKwVGFca7BYEpRO1vTwr7RlCz5l3\r\nQRU0y1cunMN+ea+qlHo4dEIh313Crr6+2A+eYz7w5mKiyzpYOkRE/85j0v4a\r\nEu3GA5RGGQEXKLvV4zwp3NoHWLV0SCE1Qh9rpUlZQ0JFNfyPoyLSdvlidGh6\r\nofOEZgVP9vZudtqUryMB/5/GAxsb2fn/tvE/+Fb0wNgkhJmysVG/8EJP061K\r\n5+Y6/oxsRhOG9bhLJgyfDfJIB12ZDr4a6NeHkGooQ4emVD2rlPOxZtFB5ovo\r\nsPmwp2ofm5xjvJ4PYTnnkDQvAwI56hdTzndOua2ZU0f5wu4ZDudJFAdT/idx\r\ntuuKFBmgqDfCKdPMJeG+sLJ1DIvjgr5EvTg=\r\n=JmJ2\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"722326ecc6026aea1f22d8b4e1c9901bc13141e3","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.20.1","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.3e3f43359.0","@material/rtl":"15.0.0-canary.3e3f43359.0","@material/base":"15.0.0-canary.3e3f43359.0","@material/theme":"15.0.0-canary.3e3f43359.0","@material/ripple":"15.0.0-canary.3e3f43359.0","@material/tokens":"15.0.0-canary.3e3f43359.0","@material/animation":"15.0.0-canary.3e3f43359.0","@material/elevation":"15.0.0-canary.3e3f43359.0","@material/typography":"15.0.0-canary.3e3f43359.0","@material/feature-targeting":"15.0.0-canary.3e3f43359.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.3e3f43359.0_1668024220038_0.9588643622472466","host":"s3://npm-registry-packages"}},"15.0.0-canary.3f667fac6.0":{"name":"@material/slider","version":"15.0.0-canary.3f667fac6.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.3f667fac6.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"29b9734e9ffd5b1e81174d16e09596d0cc7f860e","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.3f667fac6.0.tgz","fileCount":37,"integrity":"sha512-hG5vF6vy3dDUbugiJKb1Kky7/9/ojtoBAjEvN9id4tWv0aqoUf2MbiWVOsBCgAXWuM8ojUSN4WksRa6/RpZcQg==","signatures":[{"sig":"MEYCIQDSapkAADfaCUTgYiwN5tX+nU5mQPQH5OhCDsvwh+m2jAIhAICicKdiMeKEZcj6w6T2yGFiFQIHKqcN5+3YNpmMpCsa","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":879901,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjbCR/ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmp+HBAAibx5CoeKpF3aL0DvR92xWDy+h0Fx/mwc9bEx7egiq3PpVi98\r\ndhfg3gpL1gXyFq8mjDOASbJ1T9E+HnRR3283gVk+5VRtzQ0kgddF/Y41AGme\r\nPPSIe9d4T18C9mU6VEDYSjcXVYeFrWOwe6nA55oc2KNpVQEw5JQFCWASpI+q\r\nGa0x8KIWS3j+zwqZGJ/0I2MRXrbF5P464l/KpABcdQTufaLBN70LhP5pZpNk\r\nyyyADpjDLJoNUXPQJZcQftinkIIHaxKhfO21UtIGVPHK6LYspNetYyACQep2\r\nzFzxzFxtknns+bc/N58IfNXIzi48kMgpp3MgGYQdnvcJMKYGQjATDtpzhdgN\r\nGHzwWYkVApwozoViXeswwv92ts4H58Xkj/RVnrAeM9Qq2OBQyPks+An8G2qd\r\ntTRbHnCwqxts/txve+yYPD+wafp19arVeYzHg0qRuZ83BFKuCmBhb7Dw+ONZ\r\naos4tN8jQ7ddZJmWvxy9IQpAEcIZZQ0aDUlAymdOL9UYkE0Kqw6qX/A5x+iD\r\nj7+yZd6w2peIznxWfEUpN0FbDClAJaG1iKDJLoIab/EVBpaap3Tj2+7ez36/\r\nX3QUgiepPl++ShecL5dBZww425ZeBhjcpIBCvOZ06bVgDtRq2DqsgLCy4bg/\r\ns2M2t7CeRKhHC1aPxCFqMxxxFkleIa/9Mjs=\r\n=OfG9\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"0980467335d47e19b4ec72e32644ba0a08bc0c34","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.20.1","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.3f667fac6.0","@material/rtl":"15.0.0-canary.3f667fac6.0","@material/base":"15.0.0-canary.3f667fac6.0","@material/theme":"15.0.0-canary.3f667fac6.0","@material/ripple":"15.0.0-canary.3f667fac6.0","@material/tokens":"15.0.0-canary.3f667fac6.0","@material/animation":"15.0.0-canary.3f667fac6.0","@material/elevation":"15.0.0-canary.3f667fac6.0","@material/typography":"15.0.0-canary.3f667fac6.0","@material/feature-targeting":"15.0.0-canary.3f667fac6.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.3f667fac6.0_1668031614752_0.2696835555151298","host":"s3://npm-registry-packages"}},"15.0.0-canary.faa28c1c5.0":{"name":"@material/slider","version":"15.0.0-canary.faa28c1c5.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.faa28c1c5.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"78b512a759f681d14db478d3316894c908654fe3","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.faa28c1c5.0.tgz","fileCount":37,"integrity":"sha512-Wa+qa77kInA3qTIZrpImQqYBUmUoVeEy/NYTcFM3kg9/VPxykQZPYjkQKzwRhwpVk1ec52Pdg6FHqjOXbUrp2Q==","signatures":[{"sig":"MEUCIChpx2GKFpOCZbwRIIapt2WiLeBfv9pZen7fxeBsAOVhAiEA9MADpTBRn6voYLFMkyfXHv1ByM26Dnxd3MWSSDhjA0w=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":879901,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjbnoWACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr1pA/+KPMUBDjhISUiEqePbfBv7OmucXmq3XbcLs0vZ6q46PE8S5B4\r\n3JbQK3gGPUHrjAlLipSOXbwF1lFTNW7V99T5rN8mor1/fUS0jRzuH8FrN8uD\r\nGCEbUGVF9D6YZYde5ZLHlivemOYdUyY/nsPHK/yqUaPKG2E/XJNAIqZ4Tm16\r\nKCMoLsfb5A40ePwIaDF+zimNIzdr1hDUAXjOsqcmuu+txtJ/2hYVAJC8tfv5\r\n4zTWEDW9gVATmsIzUykaeVrHAY2upKsdiOzud5Z3iSpNJawiYIztca/zpkkQ\r\n+XcOXle7B9RSckj27WucQanbzLed6Qr38j5YWZTe5j326l6DNALiglkfb5NY\r\n/P3obhyZ8GSlBJf9zhP8VFaDV8YMlYmrHQwSMv/svDBxRLkrKx67ScYQ50Lj\r\nomyAa7BBVj1uoBuH1ERvo2E5Jb4WXJt+uGMkYMvsZ3XPWDJiUCn2U4yAHPPm\r\nZOnubMledAYNnEGlC6FIE+agEKneAS4Jx8hiHp/rBm6lssbKGWVkEtTxObaB\r\npJDoCvVgEwN4b+KBJI8Shmcf/Rcufx3pnpayCcPODR4Gf+uz9iDOHtQVVKfE\r\nCykJtRmT2dwY2Yzbub/iDCIRBLpfvNYGscL+NAilzbP7GWncykgnUsB9S4+7\r\nf8DXg7/YWvpAkvbVF53SiZN/qCzBPr2Vqqg=\r\n=Dbix\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"d36350ee1c0fb11d053acc0cd521939199fd696f","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.20.1","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.faa28c1c5.0","@material/rtl":"15.0.0-canary.faa28c1c5.0","@material/base":"15.0.0-canary.faa28c1c5.0","@material/theme":"15.0.0-canary.faa28c1c5.0","@material/ripple":"15.0.0-canary.faa28c1c5.0","@material/tokens":"15.0.0-canary.faa28c1c5.0","@material/animation":"15.0.0-canary.faa28c1c5.0","@material/elevation":"15.0.0-canary.faa28c1c5.0","@material/typography":"15.0.0-canary.faa28c1c5.0","@material/feature-targeting":"15.0.0-canary.faa28c1c5.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.faa28c1c5.0_1668184598429_0.6171430183556621","host":"s3://npm-registry-packages"}},"15.0.0-canary.a868c7866.0":{"name":"@material/slider","version":"15.0.0-canary.a868c7866.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.a868c7866.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"16b74aa55c1c97b12d2d29cfd3aa8c203c82f0e3","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.a868c7866.0.tgz","fileCount":37,"integrity":"sha512-ahSCwWh9fHJ5JD1/30ZbGFv4z2/0PwxTv4v+TJWmcgjB9/s+VbUY9LKiCXFHnJO0MoopO3/MwPXCR4OK+HFjjQ==","signatures":[{"sig":"MEUCIA5VkL6mZ3iqmi81spCehHtcFz2wBGiybQaCaK6L8FaKAiEA1HqOadqLpLbpR+xn8T/6+fNGL7RZNn6YKZ3ygM/wBbI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":879901,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjbno+ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrsCA//RZhtBeWGgr4ax3jq7GLwFLUY+ivy4q4CwhpslEGW9ds82RjC\r\nMI7/tR8K3xV+uhuLga6/uiWhCn6XCWiBM48qg36Z6h3hhJ44V67Fa9v9HmOr\r\nhk9HYP0OyXUBFtMHuzsIghelUfsqZoo42MfUnQ3IgqXGcG/DQ0fJ/0KOCbrb\r\nbRBPUoKO9xOd9+2wTZCPtNgLRwo9aJsRqu1OCiI+RQvxfl1SCqfkPNCSYrhJ\r\nJUbBx0hL/P7su87BBpbNhSvBsmpp9elNWpx+NtPt0gNb/iLXNz8SV9EsrNYS\r\nfPgfLtsV/X1TNtxrs4fNMMXuIhNUcQV8kjt5srLA6J5anTsDZuptIst2C/uU\r\nY78CWxhXT4K3dVyx+B5e8ryw3cTOWw5MQkwt6e6H8CMl+a/uuL+/2ScL3n/Z\r\n2iu/WVkk0CI6P3/iRBgHkwrhZ2RDo+xWkggs38NM7CCz3GOJ9O0DB0aSqR2/\r\nkyeiyIAT54yjlWCvZI34ZAbfFU10pT/Z2VPAwYaI6sOjP/wfcH0yvOKpzNMW\r\nPLeoTJ+wNsvpTF1uPc2bXtMlDmisSU0MA7pYJ6LvbZbGedPhH3cnc+CUY2wt\r\nyyxO3Zdvyt/1oTFIh15RDbXTybzQSXECVrYESmVCnIH8MD02C9fyKpMPB7Ps\r\nVbp09IIARNzN8PEtWal04F2Ar92qfCR9SeQ=\r\n=N1xG\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"d35416d7d3365898437e980f43ade48e60904e85","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.20.1","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.a868c7866.0","@material/rtl":"15.0.0-canary.a868c7866.0","@material/base":"15.0.0-canary.a868c7866.0","@material/theme":"15.0.0-canary.a868c7866.0","@material/ripple":"15.0.0-canary.a868c7866.0","@material/tokens":"15.0.0-canary.a868c7866.0","@material/animation":"15.0.0-canary.a868c7866.0","@material/elevation":"15.0.0-canary.a868c7866.0","@material/typography":"15.0.0-canary.a868c7866.0","@material/feature-targeting":"15.0.0-canary.a868c7866.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.a868c7866.0_1668184637963_0.9895542171524774","host":"s3://npm-registry-packages"}},"15.0.0-canary.602fe8efa.0":{"name":"@material/slider","version":"15.0.0-canary.602fe8efa.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.602fe8efa.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"dcadaa6101404a8ee0a0b8bd113155a708d29b89","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.602fe8efa.0.tgz","fileCount":37,"integrity":"sha512-o0YjKIDw/sEaZJHW1q+9RO1BOjVLk8Um0HpTl2vMAIBUwTDm5jvumdY/jPmlNGOPzTuVV7HspEFtmzS85x7jaw==","signatures":[{"sig":"MEUCIAjXfB7m2W8HTGLEXqmh0HTKPrB5YMJlFdJRoxUlVldEAiEAhW/NA650gHycw14RmLxppxYhtFp5bwVhCIyjzkwKKiY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":879901,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjboKGACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqfGhAAj+/uW7JR0LAR5RDvP/fZMiLQ2S/+2jvwUNVwX06kc2Jq5ztc\r\nR4ZBzoswRvz/x0fMlYYmZyd7eLdwBb5YLPl8Jkshknz5ug+eypSHJv4cP1mZ\r\niAJO9Q8f+DyOsBDSrT9xAcd34ECDiZ+ErscnmQPX1DXyWYKW/A/2tOWHvhhh\r\nkcb7oPBbdZEnEpcJutY3DJNHKinfwJ+a1mqCrI+3zgeWGJtm6rYEsWRNcO78\r\nTt1mIVliSJmmSUw4ol3sxWdRsrESMo0k58qJOivJLj6Dw593lkYeyxkICslw\r\ny6e2XD57sx6l1eqZ2xZd6977YhJukSIqPluq0xxN5IDk5F8SV3lzOrPLzs0S\r\n1LjL6UDwnIsxV/XfOax7BTOSXPon739N53alTA2unqmlqmzICtzc/RR7wfEW\r\nevgvRRxlCPlMRatHzN99g6gOI1OezqNOty4Daug/ozjoBxlwFPdasg/G9DFt\r\nLBr7Dsc8hUG29We+Pnw/x95YEyUm0Qkb8KCQT8axNplSYXRMtb/nqH5mIx3b\r\n40B9FcmuXkz0Bdb2WuyoIPey68k0hetpfuCwUOWiA2HJa+aGZ/CZ+8XouwFi\r\ni4a+6BHXLD6oehZaP0H5BPJWIjaEC1N3XQtjcVK49ryLp9jxtoJ4G1D1fosZ\r\n4qHrgFLGf9WSQ41yB1tenIA/F6ZZF3hWma0=\r\n=ErpC\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"6bdfaf09ca41b2fd7e3db4797bc2f536f8fbbade","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.20.1","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.602fe8efa.0","@material/rtl":"15.0.0-canary.602fe8efa.0","@material/base":"15.0.0-canary.602fe8efa.0","@material/theme":"15.0.0-canary.602fe8efa.0","@material/ripple":"15.0.0-canary.602fe8efa.0","@material/tokens":"15.0.0-canary.602fe8efa.0","@material/animation":"15.0.0-canary.602fe8efa.0","@material/elevation":"15.0.0-canary.602fe8efa.0","@material/typography":"15.0.0-canary.602fe8efa.0","@material/feature-targeting":"15.0.0-canary.602fe8efa.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.602fe8efa.0_1668186758189_0.7616451743099142","host":"s3://npm-registry-packages"}},"15.0.0-canary.558c2be62.0":{"name":"@material/slider","version":"15.0.0-canary.558c2be62.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.558c2be62.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"c4cd32ecfae3406aa214802f8df34af3b3ed7f85","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.558c2be62.0.tgz","fileCount":37,"integrity":"sha512-qAgwpzPGbUcB6007RSnmie81o/nNFEzkeRURm75/J2VFd45wh6Ty2APN/9S7OpaedZTSzse8P7ZKB2q1Zma13Q==","signatures":[{"sig":"MEYCIQCFXFl4VuUffwWGR4R0Dcf8y3RhG/2MzegGTcyBzpI2yAIhANvExKTZ7CvfjVS9mkHkTrXYP/K6VPkXsl7Q/DohkAcV","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":879901,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjbtCpACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq0Cw//ZH02macTOL/Y/v69XTgKw5B3tk2yhxzdG0BUpAvirCRS6Wwt\r\nQs76oWHgIFVB4y+1dL4XvfUZPvC+Gx5ehvK4gYHaDQ462Mt1xtocCpfHiNoX\r\nTacodyIobkBZMbytd9NeV9qFK17eycwaicIKXBEEMsL7aVyrFSNDzTXmy8KT\r\nRLBGxrDpBsXeCIxkVHPXrClmjxUR92lPMYoJJ/f4Sd9RAgoZgHuKkhLGFRrQ\r\nRxTlyfKECjUm13bufCydamPqVdTR1nWC8/aIilgulAgZXVUGfzCI3hZd0I4m\r\nY+moDCwTklSEuNeJfJ96NUplKlTQ2Hh2toFs+Fg5J2yYVFKmE4shQwK1pWcN\r\nj07oMR2pM5whd31kKcEiDCe5uX8EfwEO6JRiDxPY4mkysPSYrZn9na+XJXbo\r\nF+dtnoIezgzkiMW65teDsA7icZqmPlG4MRDQGhcEAlxIPlsPd8MtNU2c39fS\r\nnb0abQK4MGsQga7sMuyXh9T6AJK/VuGg8cDAybZU0KMPua6nrNYaLbwIZczL\r\nuQ3E9CTtzZhYZgceGwL+ma5HbQfjntbwcokYcAOA0t3YBRy1KbHUoNRUqm/X\r\nAtBCnS47h8g13Xbxpy6+DjgcXMOiX+PHG2TMRY4BNnVfksOb9DowwtZjg8nT\r\n1pv1Y7DJDcTyi8a9WsL0pmXpEeCnY2NdqJk=\r\n=dgYJ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"64666caf2aacf562ab6ab5b701e89f28a9bb5c74","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.20.1","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.558c2be62.0","@material/rtl":"15.0.0-canary.558c2be62.0","@material/base":"15.0.0-canary.558c2be62.0","@material/theme":"15.0.0-canary.558c2be62.0","@material/ripple":"15.0.0-canary.558c2be62.0","@material/tokens":"15.0.0-canary.558c2be62.0","@material/animation":"15.0.0-canary.558c2be62.0","@material/elevation":"15.0.0-canary.558c2be62.0","@material/typography":"15.0.0-canary.558c2be62.0","@material/feature-targeting":"15.0.0-canary.558c2be62.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.558c2be62.0_1668206761736_0.8372961147316738","host":"s3://npm-registry-packages"}},"15.0.0-canary.b5c13a7a8.0":{"name":"@material/slider","version":"15.0.0-canary.b5c13a7a8.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.b5c13a7a8.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"2bd7aaaa59e6e4c7263f2b1269f51fb0c6421412","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.b5c13a7a8.0.tgz","fileCount":37,"integrity":"sha512-R9Q3cVkxYdq4m6qxFsPeI21GKKjesSfFmV6eugQJszHnoWmQlnH1AtpZ+i82yET4yRxZn//1nEd5zyH5JTsprA==","signatures":[{"sig":"MEUCIQCAZLs81/fhc+rkpuORj0ZRjvqCunwmFoYJKcXTHg4G8wIgJ2D/kc901+p7SPqpchGNcAIBvvIJQzCh03YojtVWM6M=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":879901,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjcmXaACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrSLRAAg9Jr9czZlWyp6DVrFdWGHVqUs/WdicP180KmVIeBtVI5NnPG\r\ndo3hWWzpCW85S3cM5JiJxhcjrNlVOkm962XQ9/HBNbeGYO+XQwaFtqji8Ltv\r\nFdpKvnmt3lQqSaOC2mU6f5rMHrgakQ2gMW52/bdT6LjViaNtdp6tzL7EyOVW\r\nJyZPrMdiQxEaL4acMxUho7jGaIkS9gzAE3w9gxsp4s7YSN0aEltNdC/PM/pC\r\n831QJ8dIKk5tmBpdIz3VI7LySbBroI2GRCrZue9WnB3Z467jVmJ3k/41NmFW\r\n/NdQAJpYxnsAUROUsjnFA8hsAqYEsvA5EjcxFZ1cMDYc0/7z58z9MAOm+UIU\r\nNlebgeadRbgP4iQQL/0uhWNenlDsCOt5deddeSe2z+h/+p7E28pWss7lt03+\r\nw7h81N2qgkSuX5/n+bdmMJg9+8p61Sqp9BcPiwLHGbRnIIClJmFcf27C7Gd2\r\ncR2iTtwQ3cVe7cQZuHsy4DGKeZIqGR0gwcP5FNF9HSz0lS64LARAYggVWEc6\r\nNJ/PTHtgbhZMXFaGwHWDHa1mzIm5k8uu2AeKn9d8FE8cvf8rg4+NQBD0KsAN\r\nURPSPBF31hIDzxqR2fFTQArPcfn8WbXNeaxxczDD+QyvGE3inn9bfSfz9/1T\r\n2AxF3j+Mbwgv/GKu1xGGIEKvdbbukoUWHEc=\r\n=HcFV\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"d7e326425877e3ba53b64755680e3503090a01cc","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.20.1","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.b5c13a7a8.0","@material/rtl":"15.0.0-canary.b5c13a7a8.0","@material/base":"15.0.0-canary.b5c13a7a8.0","@material/theme":"15.0.0-canary.b5c13a7a8.0","@material/ripple":"15.0.0-canary.b5c13a7a8.0","@material/tokens":"15.0.0-canary.b5c13a7a8.0","@material/animation":"15.0.0-canary.b5c13a7a8.0","@material/elevation":"15.0.0-canary.b5c13a7a8.0","@material/typography":"15.0.0-canary.b5c13a7a8.0","@material/feature-targeting":"15.0.0-canary.b5c13a7a8.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.b5c13a7a8.0_1668441562151_0.40993096388836214","host":"s3://npm-registry-packages"}},"15.0.0-canary.a6e1c0702.0":{"name":"@material/slider","version":"15.0.0-canary.a6e1c0702.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.a6e1c0702.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"f398259a7099cd18d68e85ffdb23ae1ef00f59b0","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.a6e1c0702.0.tgz","fileCount":37,"integrity":"sha512-N28ewdDJrTV0GIGxCjUonNknXsEsKFBvAcmXp8s/PSj5ShtPhz5ESJCQmzFry0xqvdGENs02DYzUT6M3+AJxtQ==","signatures":[{"sig":"MEUCIQCzVHygLru79HYh7UyJ1lyyNd2FxKWuT9ZquVEQu2+DCwIgImKxQGdlNOa+sA2RZUQHY3EWZju9CgF2mv704dvRyr4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":879901,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjcnqVACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqF1BAAiJMkdPEr+//FzZWVO13PJJgdsffFlaXAf/8MevD+RqpOKzW7\r\nocis2AKzRVzhzIzr0APWqjeSyux0w8OpHRo9Evy+r6MCM5m9gE9iK9/EOjKC\r\nYF1OkoU6BF+DynYfH83HSXj1hVZOlZMH6Oz5ark6mSpmennOMGnFdny2zoyV\r\nuj/KDKGzLrsLiSAa5YlCyEdR85TAV5Igb2bWrepXvK2z8Y3ve9l9lI/QYYri\r\niC2C6GdsYK/W/wdehbHY9I9jYE1Hppd1budgt7qORk/hjnwD+EynxlDzO0aT\r\neTF4lIsAw3YVxSrC7tdQFaHyYaezKPncWKpsxClXWouEMqnYZyo/NYHJ186U\r\ncoWmYluQqbEgghCTJ9Llh6e/8dp6Hn/fDpw1WdL4Yp1WHtis+Ua2qH/9XPVq\r\nsFyCMJXsmZZtxX+LKG8D5tzdODzOf4brkQz9hadbZlyUL3PM2xisZ4WCWmLW\r\n2WPNDJ/RkxkqhsOYOPW9LIYGBytWdlKl7FBnfM3yAuDjXa/XSnN7h+JHJ3qK\r\nezqQlY/HpvX+MjMQtmDvChhAPa+5aJJLjGv6lCnvPtfyHbRhZmQm2T4x3atI\r\nASxRIpVj4lGHUZfCltrZRC/UlIfqUl+G/ctH23GS6/5kgpcDhFd1saCZfWUj\r\nhWc68NxWnEjUtenHrIoVgAlqbUmclrq5OGE=\r\n=5zt5\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"3c1ee7333cad68ece747437d4bab1a737d6ea96f","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.20.1","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.a6e1c0702.0","@material/rtl":"15.0.0-canary.a6e1c0702.0","@material/base":"15.0.0-canary.a6e1c0702.0","@material/theme":"15.0.0-canary.a6e1c0702.0","@material/ripple":"15.0.0-canary.a6e1c0702.0","@material/tokens":"15.0.0-canary.a6e1c0702.0","@material/animation":"15.0.0-canary.a6e1c0702.0","@material/elevation":"15.0.0-canary.a6e1c0702.0","@material/typography":"15.0.0-canary.a6e1c0702.0","@material/feature-targeting":"15.0.0-canary.a6e1c0702.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.a6e1c0702.0_1668446869261_0.0471044098959692","host":"s3://npm-registry-packages"}},"15.0.0-canary.b6f8a06de.0":{"name":"@material/slider","version":"15.0.0-canary.b6f8a06de.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.b6f8a06de.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"8b8a603aff52587f49cdd0c6b7f00e677b4e27a4","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.b6f8a06de.0.tgz","fileCount":37,"integrity":"sha512-PxcaGIGK2vU/yMFxm3y2fzlA65uEnQjGTE0iNvycgRXYlmsI5Pz55OcqAV5pdrqEUUTdzgfwk+9rlPc0xib5qg==","signatures":[{"sig":"MEUCIQCK/yOSLFn28gktpJNFumhvqejMCG72QRyfzAghkIwvmQIgfiBUUTAtR8cLAdxt1lpPN5KMrjcNbfvq7H8gM81RlnY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":879901,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjc1vqACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrYfQ//S7VErh8dAlpIfNwSsWR+Wjy2Cv0jkD4kCn+bt+gFPzIEsbpr\r\nOmGkhaAGkP/vYgNlYaeNZJRym4sX0xoWavgjOAZYfEsDFeiZw4XFKpRbzINz\r\nixqThP1BcNQbvbghAj8kLARtr9DBCLxRGwNPY7L0HO3qrBsLjSRMkmXKBRAL\r\nG9ePelcolFWZ+3z1lNGY5sMeKdGCPZUjDz/nf76wgDM/LIWnqdMHfYbliNnI\r\nAH282qCJ9jh2EFrjVLtmT20rGYkMB6Wv+YC5SUzXorJoSN6tC+AMrIPB0qjX\r\n+T25vv/nGC4cBeKs/CXdxNNSenHJKFhV3Wq0YdbOoifE9If5bDVlz/MRw2w3\r\nK72MDGIxjzCdR09wsGk5J1krn0rNjcE3hIHItcQpyiV4bw6T0P5QP8Wv81mX\r\nWlswq5DZ0+s89B0AStQDhTy8vB+g+lZuSA4EAF/00+MnCidK3teCX634PAbc\r\nN4TjghGspwktj+JJTdfCqgzOmG0siLgFUeJoMe7M56OVBFsoQS5oCHWtp2p7\r\nq4V1p9VR3Pyiwla3EDpsP21QWBrOthC8aED2Gqaethekw6TMlaIuBV4+Srog\r\n2y4IiLgov8Gxcx3eZBJqIO9+dTX1zNzy/U2+5ogkDySeeAvXo1epU8H92v4Q\r\nicxSb7BHsbsjyj54lChit0ulfvMHN60X8PA=\r\n=DA0K\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"92681882b16f14e6a94df4b1ac983fa86e242640","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.20.1","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.b6f8a06de.0","@material/rtl":"15.0.0-canary.b6f8a06de.0","@material/base":"15.0.0-canary.b6f8a06de.0","@material/theme":"15.0.0-canary.b6f8a06de.0","@material/ripple":"15.0.0-canary.b6f8a06de.0","@material/tokens":"15.0.0-canary.b6f8a06de.0","@material/animation":"15.0.0-canary.b6f8a06de.0","@material/elevation":"15.0.0-canary.b6f8a06de.0","@material/typography":"15.0.0-canary.b6f8a06de.0","@material/feature-targeting":"15.0.0-canary.b6f8a06de.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.b6f8a06de.0_1668504554302_0.2230403522296558","host":"s3://npm-registry-packages"}},"15.0.0-canary.0163f3ba5.0":{"name":"@material/slider","version":"15.0.0-canary.0163f3ba5.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.0163f3ba5.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"e0d397040c861b39c384cb50df8222d4be28d8cf","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.0163f3ba5.0.tgz","fileCount":37,"integrity":"sha512-muFOwad+1GgNcHfVXuGfBjyqU4IH5FuU4k5Oj3DEkv2EL317bpe47cHCrYJkU1e2SEOzsTGThnOEZUL4JiR/rw==","signatures":[{"sig":"MEUCIQDOam4Djp5WS9wJv6D0kqBuV/zxFytDnfwzTOM5yCMkqQIgOsUPZvG0+Ylbhhm0e22kx31sMSAVWG1hS1darh7jD6Q=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":879901,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjc9RRACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpTvw/8CUUZasokMZunPN9RUz96XtTLujZuurgFHoI/8LfHD9ymqBuz\r\nbSXmxT0j4fuFSyuBPhZJaKJyK/mfKCsPsoUoUbt0qZlhX0HdM7q8pjyG3u0V\r\ntc1jhMe2qBzlCFWYnrdxZQko6f3M//Wr1K2SC6zr20eZq18XUsH9ADri+vCt\r\nGAPcMYEdAeYGGBJkPWtZuHdtyNex1aMQ/s53IXosqP+yjVhtaB8yGIUw6uPH\r\nEyraAjIq5367C/W7EWGdTgn+RyS6SXJAkOI+qYcqdr4O7lAmn7rmQYvheh6L\r\nuGlorddMRbleacszOP6w8J7zq5H9Q2oUeqPFLGPabxWtk5FxPX+emOpDXPNC\r\nrYzXUK4bJJoWjG4j1MqfmZR8Ro+ATmhGxix3i1/redMMBvUapAYOuisw2fhH\r\nScVsR3UCg6eHqHhfRCLyPRT6rSS9m2AHN0ocxPrZzrVvOOQzRgMsJoQ6OfQO\r\n+GJAYy6FpbJng0U63vLGXag/SNmKHXmSKdQbf1YlIVXdwtKjpOAITuJo7MSl\r\nweTu6qWy9DIpzowylS8pJj+4NdUOUphjcbJI/Ehkj63PyAHw9uYp+io061Al\r\ncHzP5fHwEgqQZtSGGXtLEZmRP8O1R1Je7yG5t8DMzw4cTZ92Rp6+4IIXvEbv\r\nFU0FNvzQ7MTSxFearPQ3alu25+NqdNfX16M=\r\n=wmRg\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"4198cde77ba33a68c74eb5e814d92df422f464c8","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.20.1","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.0163f3ba5.0","@material/rtl":"15.0.0-canary.0163f3ba5.0","@material/base":"15.0.0-canary.0163f3ba5.0","@material/theme":"15.0.0-canary.0163f3ba5.0","@material/ripple":"15.0.0-canary.0163f3ba5.0","@material/tokens":"15.0.0-canary.0163f3ba5.0","@material/animation":"15.0.0-canary.0163f3ba5.0","@material/elevation":"15.0.0-canary.0163f3ba5.0","@material/typography":"15.0.0-canary.0163f3ba5.0","@material/feature-targeting":"15.0.0-canary.0163f3ba5.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.0163f3ba5.0_1668535376986_0.824103738612145","host":"s3://npm-registry-packages"}},"15.0.0-canary.66c5cbb94.0":{"name":"@material/slider","version":"15.0.0-canary.66c5cbb94.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.66c5cbb94.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"63e87a87d796843d080bf31bfbe37af14ec1b82f","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.66c5cbb94.0.tgz","fileCount":37,"integrity":"sha512-J6v6SQiw0jrYI1N/CpcPUvDfG0bXp2KOsR1T6H60NTEqDi9g3WZoi5Xt9loOvmfb06ANOKobZAx+tV6y3d6UXw==","signatures":[{"sig":"MEQCIH8+iPeIjrRXwNl4qCR3ryQq6z29TzUy+zsiSTVTij+LAiAwByTB5zcjSdsCL3uU6430worf3ZyCn8AAyQj5OJLRzw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":879901,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjc+jxACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmpa2hAAhjU86YUKLsPorUGHz1iQxLnJsR1+9+25WIYZDZ9UIfW8sjEv\r\nV3qgJIzX/4Mq8IP5OxK0ajlOifoKDs8RImrv+jRCnYZ+ZLzJy9HHrufpijcC\r\n97/y0xW/VGllWeeNsGy+/qhZOvU08XqLFLkP7fkTk5XVMwann26AKRbWX4qO\r\noyIDj8mHpglOX5+JLm4n3hJOusELIWfC8oH+R3lNwPu8lX49Ca+jb3y1DhKK\r\neMG1LW+DhSqG7tGHxeXUAA2GW/YAGN4B4KFy7Pu5CbPTFneJL2h/m4+KLUx5\r\nuy1ue+J6Q1GMo9MRSah4iQvIuvMUs4YFjNFedUKUM/yyHQgnqSRtResiLAeW\r\nEejt3d6ojRz8JdXhiPMzj3PR3UJofHsGG53hK3CG07dQVQ9hMlf04Z7PgJa6\r\nvp91qP0Qh/t9eioucFTAhbhx9l2xSNypYfGDnJbftruuIxp4Y7vd01vigkDy\r\njn62L6O2aD8+Hl8wmtI3oGlg388GSwQ1aIACLrisKyBqgAjjn3Snl9bjuMUo\r\npQqnMd8V3q9LDpsDM2NB+ARHCkDPdeS6MMwFiEvHcpt6U5vXDPzywQL6RBds\r\nMXkLihc1qNLPCCtYOTwo0zTzUektzHJoqNO+fgO+C7aoaI3MzTd3ovte30tD\r\nizUURJ3PmmHHf0SsjNDHEx9j94zRMTPU9w8=\r\n=FX1h\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"5d01716a4e4556657b2c4ebb469b826660673327","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.20.1","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.66c5cbb94.0","@material/rtl":"15.0.0-canary.66c5cbb94.0","@material/base":"15.0.0-canary.66c5cbb94.0","@material/theme":"15.0.0-canary.66c5cbb94.0","@material/ripple":"15.0.0-canary.66c5cbb94.0","@material/tokens":"15.0.0-canary.66c5cbb94.0","@material/animation":"15.0.0-canary.66c5cbb94.0","@material/elevation":"15.0.0-canary.66c5cbb94.0","@material/typography":"15.0.0-canary.66c5cbb94.0","@material/feature-targeting":"15.0.0-canary.66c5cbb94.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.66c5cbb94.0_1668540656919_0.5132292121925484","host":"s3://npm-registry-packages"}},"15.0.0-canary.b01136063.0":{"name":"@material/slider","version":"15.0.0-canary.b01136063.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.b01136063.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"e5cfeecf6b17c3f355696c8f321f1c6150a288ef","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.b01136063.0.tgz","fileCount":37,"integrity":"sha512-v0Hh9mc3qx/OH/7p6e6Q3eyjM8PTNULeHdGfgXaiHBlN2m9ccXTbR1D4X84HG58MGJiJHKeO/OqarkizOfgkhg==","signatures":[{"sig":"MEQCIFftgFAaFDtf9GK/wf7J1nQL3+4On+V8B8LHykDQyEeWAiAMKTm5f1GdyzYrXp/+HGoOMJt/4TpJFJJmFiRK3hgDZQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":879901,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjdCvpACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoXuRAAjEav/XjpwyC9MeArttrEGxrjkGJNBaMQ2zEgxMVexonfZ2qZ\r\nAGSu+NIDNWNgX8dAcW6CT36dROJPwSs5fNNxwmh/ehqRVcfrOlLtNhOLlf0o\r\n03lGFPX3Y5T0nd6qciQCL4/OV+evQMiGlLDx6YQLys7w+Vzy4IjOPjxe7Ysw\r\nZ3My7QJZk2aTr1KOL+o2wmtfC/u4H7Sf8hdljum3VZZmsiko4TEnRy6gufsu\r\nF9YqQ2iCBHV+7yDHMczi/t4AfTE9yqNcWxlCDmdxgrOne+H57JKOXMUwxRMH\r\n9iwKLnY29Zxq+1ZAOpWPyiCqUqer6qCI6gstazo7df8Z25pZNhQLRmUVbm07\r\n/xmvOG/xUUcSrRcHTQ+JNKQBinbksgaHkwXVp7RIPO3HxJ0Qqkkwn5iKy8Yy\r\nVUrZUcfm7oKAQ8Fy0efXD2IjHJkzc6r1GS3Jnz/0rFZ5hbdwhvS9L7Fw9oAe\r\nPveBpEqzvuCEgCBpkQ066f6+k+p62WS3B/ty34hhpcFAoFFAaMF3Xm221QAz\r\nOTVQjl/aUAjgs4+85Jml2CWflkgkgLXUb3tLqkSYivNCVDvRvUMpSeyM8FA1\r\n94xB7kKTXajZc47dJSAgKVez93OX/YoM6VWT+khYcwlcbsUezAySrJ0Gc4di\r\n4xVuR8vc1Am4HB/RhRSGhr2eanFttuWs46k=\r\n=hAg5\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"125921cea459cbed7dbe3e1c938761a0cc03a263","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.20.1","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.b01136063.0","@material/rtl":"15.0.0-canary.b01136063.0","@material/base":"15.0.0-canary.b01136063.0","@material/theme":"15.0.0-canary.b01136063.0","@material/ripple":"15.0.0-canary.b01136063.0","@material/tokens":"15.0.0-canary.b01136063.0","@material/animation":"15.0.0-canary.b01136063.0","@material/elevation":"15.0.0-canary.b01136063.0","@material/typography":"15.0.0-canary.b01136063.0","@material/feature-targeting":"15.0.0-canary.b01136063.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.b01136063.0_1668557801298_0.2838068365202455","host":"s3://npm-registry-packages"}},"15.0.0-canary.01da0cabb.0":{"name":"@material/slider","version":"15.0.0-canary.01da0cabb.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.01da0cabb.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"62163450778cc6b63331a0e3481c7532b88c4b37","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.01da0cabb.0.tgz","fileCount":37,"integrity":"sha512-tI+4ZfFOVnSEaMGUMad/h7nlsY2lWtRKxYsiIVSvebvXuE68RfM8Xq91MPfaUa5hFmzIXdzY9sQEfF4hqu8D7w==","signatures":[{"sig":"MEUCIB5ufPGA05L5NyCUESY/qK27SQWjLEBqfy6H7SLPjd/LAiEAjv029VqC352n1KILTLCgijd13ps2DMARzaZvl1fENkw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":879901,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjdKndACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpHRQ/+INsF6BU18e8f+Te8zUamEz+4P6VT0bjV/pzgFMxwz3Auf6sW\r\nuaBchvmNXZcVGc0NBn+Yn7IRSmRb4gBZPynKI9Cuwjv4SL+oPKmrDc3ifjoJ\r\nx98dfxBGTRDdQnlVps8+v0D3TOeGC4NSJlFaCZWDXWinZa1uigbxeuWXq4sb\r\nM9JQ5zX3ycAkvh510AshxEYP3b+Q1l967IIJ8UBxEifvu/LlQIqvQQbeNI0W\r\n5j+MhI55BnMK7OUtdoJHukDOvkXBZabeCVkFdzj/wwRuwwJqwHo9RwhQ/lg5\r\nvCXJJQXTSXBMEnoR3rPr/GbATx0lfAx7pMAxFzzE7NtxT8xLqM5ug6ZlzXju\r\nAXvjv5Gcd/bXZMzfp/xJ9n063y9jxQnS/j6/rC7yrc3OV8F8RMn1OOpMkuLL\r\nNplMJV5NcKpx8mPZHJ0kWmLk2jLsfClCoavBLGUVXlgcsRkO/HfYDRj4tCpW\r\nbalbJ3alV5FpYgpJAqbaunY5exZz4h6K5bzVXWWwpyJ+OpmJkIONSCUhGoBM\r\nh61iJxYoliByC4T2bMxBHouxTiBoQugocXlIA/Ecd7j3mnBZ6GJTnKtV19sI\r\nHx1K6U2tllCrMZ9slf2mLATt25jNWghcjlpbB+qEYG5IaU1rCjPpHjHDoPOG\r\nyRzl+mIJ/+TgLrBEXmuQ1+nd1eDMnk/FlwE=\r\n=0z33\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"63a5ccdac9b23a6c70c2bc776e20ab703cd1dbfc","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.20.1","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.01da0cabb.0","@material/rtl":"15.0.0-canary.01da0cabb.0","@material/base":"15.0.0-canary.01da0cabb.0","@material/theme":"15.0.0-canary.01da0cabb.0","@material/ripple":"15.0.0-canary.01da0cabb.0","@material/tokens":"15.0.0-canary.01da0cabb.0","@material/animation":"15.0.0-canary.01da0cabb.0","@material/elevation":"15.0.0-canary.01da0cabb.0","@material/typography":"15.0.0-canary.01da0cabb.0","@material/feature-targeting":"15.0.0-canary.01da0cabb.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.01da0cabb.0_1668590045077_0.6539713568633945","host":"s3://npm-registry-packages"}},"15.0.0-canary.4ac393164.0":{"name":"@material/slider","version":"15.0.0-canary.4ac393164.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.4ac393164.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"2fcbb5112ffe05afabe5957379d5a14b3e975cad","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.4ac393164.0.tgz","fileCount":37,"integrity":"sha512-fP/Oi++GIpFN2wwrJU1hWQqSbCnFGPK62485+gTR7EeIoHefz2ByqiIX/tXt/PeIZQRmef17vQtZ0fZ4VMYU4g==","signatures":[{"sig":"MEYCIQDcCSJoUhnv3GpoRqfUOBEeLbOc2B1Uklit/0+jZ8JvYgIhAMc3+6tOvHhl1z1cObRIlsHkgwJT+2xyZZjPbr/3AJPu","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":879901,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjdQzXACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmp3mw/9Er6WqXUpi61DrmW680gs4a+MHuc7gdVksh2ovJRWuyIPBjqb\r\nMN8cQK1YhjEuvUrdIuzjtc/GhCBGyoBdimTrwmC9lIE0mnG8zu7sJNBKLvIE\r\neLKY+7c1kbGtKslPYm8lDf8V0gVM/tp8qSuVpSSjEqVy0vcjL9LIAxUObc+w\r\nEvErc+EJG5H2CWX3dDnVMIs+u23Uz4c9UEXziBfc2ETvqrYZ+/ht1OwazJlz\r\nxCN/Mp19/jNEu0AsJYfcFH6skSOT76RmlCWXb8RBD7pLCVjQihf9Pq6s1+D0\r\nZMDNjeHKqOlJnodO6ZueDvN9DFOB9HbMPOeb9bNCG/AVQk2g+g1GcPHmsW3h\r\nOQiSqbg57aMBCkkyaxa6kt+foBhTj1ojg8SXA/xPdSc1vkcct0QcVgcsL6GG\r\ni6KDTa9VUGyybNv/ejGjxJOBFvoSLm5Npl5wU6eDYCyid1FNu2WHJ9Gqso9v\r\nTJjJdc4wL3JqptR7Yvt02erGh982Tp4eDWp+yAWJvzLhPodIgPo+hF/f2Vqg\r\noYpWrU0URjpX0SW2PeIqvJIs9KUP25np8G/tn7UIRgnuiPL2WbTkBd4OuC0K\r\nsQf2v9DhQMrjmYqzdE43Tt/RNUJA9wnuR5zLhMCaun4mBrvKrkHcA20UD83T\r\nF7YTOt0rj7BTm0VktgVUBNfCh61eBpz1GxQ=\r\n=58Tj\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"f14d3444d266ac4c6c92142c377275be3fbc5d0a","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.20.1","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.4ac393164.0","@material/rtl":"15.0.0-canary.4ac393164.0","@material/base":"15.0.0-canary.4ac393164.0","@material/theme":"15.0.0-canary.4ac393164.0","@material/ripple":"15.0.0-canary.4ac393164.0","@material/tokens":"15.0.0-canary.4ac393164.0","@material/animation":"15.0.0-canary.4ac393164.0","@material/elevation":"15.0.0-canary.4ac393164.0","@material/typography":"15.0.0-canary.4ac393164.0","@material/feature-targeting":"15.0.0-canary.4ac393164.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.4ac393164.0_1668615383435_0.08932349302167975","host":"s3://npm-registry-packages"}},"15.0.0-canary.6048fb563.0":{"name":"@material/slider","version":"15.0.0-canary.6048fb563.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.6048fb563.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"4fb1c56129ae27285d9d35a3a6550284a28c56d7","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.6048fb563.0.tgz","fileCount":37,"integrity":"sha512-f/6cemzPHOfgCMepuw1pkvhkLRcuOMyxgpd46b8F1/nKYXumb0lfeegN6AaiyfpxirUDFfaUhnwMDbSJZ8oWCg==","signatures":[{"sig":"MEUCIClklZyUqnpTwrpA8asP1vCRi0s2fTVu+ltfayuPLs1wAiEA3EOpMjkNQxcExMaMvEdyGQ6+FzfsL8X83l+Fy0CAJuc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":879901,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjdQ1TACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmrxcw//WSAFflz4Qe27F7AwEcE3JU57hY3juCSafA8bccsoyzjj1hqr\r\n79oGBbCcdNG6vtxDHi1Xh7mPdOMpeGK4hTUfJ+lsiidrj908fh8V5qeEg46y\r\npENa9LzCkrvHnNuYBSI1iTDCAIK1wrIqXS4OX/kW/dCED0QW1wrTehl89fCv\r\n4adIN+oG4oL/O1F+5/JWjNXzUTzmMJIuzO9YOkoAOxHVXLaRjYLOTFNoVcKX\r\nATSQKnDbJ23DwhhLfgUcKpwerUDDKFuGMA3QTp1LWUh/05UDBptiJ9QxQgvm\r\nFf0rfTEJzEB2M0DipsCQY/drsqXHSvstUu73u7LudAFO+j32+cm8aIe53hba\r\nYYhf9AfCGRh+OwLdmBjUIg+pJgXJ2VeJVQDy/1wSM47RNLTY2efxYPVuC0EE\r\nXIhauP8s+An8acqab4FvdAX7p0Pk5OMiZJyMEpW2Cu8BQvB5yl+tdIA2YIwE\r\nCY+X8myJl7xj6ch8JrzTmJkSFZ45jRSN7buK1SsBxKZcNzE3olyY5ocj2r6z\r\nsVkcSX6cwWNjGhTsRJNpVlHs+LvHwmEac8A+QN+cmdkERqEmwL151y9j2rcG\r\nYSUzrrMUVV13Y2+XrAHmNsS3zIKFi2Ks3vlUReX2c/QptI9+nT/7myLmLvzh\r\nsplfXzlzuAYSj3SaMSbEcL7pcXE0qiajtWU=\r\n=MgfN\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"590020431978794ff2128a91f19756dff9dbc37b","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.20.1","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.6048fb563.0","@material/rtl":"15.0.0-canary.6048fb563.0","@material/base":"15.0.0-canary.6048fb563.0","@material/theme":"15.0.0-canary.6048fb563.0","@material/ripple":"15.0.0-canary.6048fb563.0","@material/tokens":"15.0.0-canary.6048fb563.0","@material/animation":"15.0.0-canary.6048fb563.0","@material/elevation":"15.0.0-canary.6048fb563.0","@material/typography":"15.0.0-canary.6048fb563.0","@material/feature-targeting":"15.0.0-canary.6048fb563.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.6048fb563.0_1668615506824_0.3695663937731819","host":"s3://npm-registry-packages"}},"15.0.0-canary.f7f56fff7.0":{"name":"@material/slider","version":"15.0.0-canary.f7f56fff7.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.f7f56fff7.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"98eed59a5fb7baa696a89a238f4a831a7a5f2c73","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.f7f56fff7.0.tgz","fileCount":37,"integrity":"sha512-SSJyL18uluz/Dku5OXyeGBXl+5EnqfYrNj05Q+EIoxIL6pFspHKK47nmJK+qcK+QdYcx6DHnx1bvFcnpvDiIsA==","signatures":[{"sig":"MEYCIQCXzj4mK3MxjOK5SzFiryvpxt5+pCLVV19XTWVX/vj+AwIhAOSEsmVvkRcCwBw+5XAZHVuRJ0bodKQLQttktRn4KhhE","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":879901,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjdUCBACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqLMg//Sr17d6DpqXfQun725xZYuONEK+OFgJsIPbaDmsqHi+dItghY\r\nq0KUlqUiWsmcaWSJwwasFUnTc8JU0anfVA0alDlmLh9cewQWc1LUQGg1kRzW\r\nNlNQmwT/BpSz8DW6woHICbwGTm5xBziHsVb0z1VyAzm1Ug1bxy5RQH7mrch/\r\n3NUwg+pnhRMBNAVrODVMSCctR8dHLVIMpR5ngA9eKyAyuJykxNx9p/JbMnqC\r\nrRPy1IwhXF/kVJbF6XmZCszIK8vOfU7ifQWQZx+5RslR0OrRja3nMoQCs9Bd\r\n68/fZ2JquDTqpv2N1uDHzCNrgMv20ke16WTkUY+OmmbQIE0YJqnWaBHRVPiO\r\n4p8CRE09y4VRTOzfA2e+FuQY2ocvayuW7WMWwVKnVJckGcJrzLnWjaU3N/Wn\r\nCgv/IB9ToHqlZeokjjnr5D6QaqvRHDOUvRp9NvxzO2GaiSY2qejey7KgO+Av\r\n6pPcQbe38YeFlWUvlCifdjoZWPM13hh2mdEdrYphu3tLgo9PRbvrYZqSGvjp\r\nsD/2SNBiFZwDBHNrtDToHv3+btx/LHF6Tx7904VNhcZReHH6MnR0QbzILsPe\r\nae0qbSt5Z5qoH1n3jRUWjkgZ+FCcM1s/B1EUWznPw5KsLitE3IuBPK5y5FuO\r\nixo7fMtQ0vghqozndZCpuqO2AKb/6uQqxTY=\r\n=7NRF\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"bc90613e754d04f738197ec3f3f4602e9b362d8d","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.20.1","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.f7f56fff7.0","@material/rtl":"15.0.0-canary.f7f56fff7.0","@material/base":"15.0.0-canary.f7f56fff7.0","@material/theme":"15.0.0-canary.f7f56fff7.0","@material/ripple":"15.0.0-canary.f7f56fff7.0","@material/tokens":"15.0.0-canary.f7f56fff7.0","@material/animation":"15.0.0-canary.f7f56fff7.0","@material/elevation":"15.0.0-canary.f7f56fff7.0","@material/typography":"15.0.0-canary.f7f56fff7.0","@material/feature-targeting":"15.0.0-canary.f7f56fff7.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.f7f56fff7.0_1668628609001_0.2024824502359075","host":"s3://npm-registry-packages"}},"15.0.0-canary.7c73f6134.0":{"name":"@material/slider","version":"15.0.0-canary.7c73f6134.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.7c73f6134.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"a7f65b21d2c85804bb923981abfbc10e7ddbb7a6","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.7c73f6134.0.tgz","fileCount":37,"integrity":"sha512-rLv8x5kubf8envXYNB4UFg+EHmwi1NCwbh8ZEP+QRa9YKXb2NXtXxUt2oENQv2dENH07VnFP8Hg1ZjN1sBTpyQ==","signatures":[{"sig":"MEUCIEcJXXUnIYQl78ENLFScDyjjelZx2uIG2I6KBtCKkHBaAiEAlVHENDBUIxB5xt+IpfpInC0LxWncxfXiO+Woe1SllPI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":879901,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjdUF6ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrA1A/9HB9VRSH/Gn88iZjnGF9C6Z1SsQbZGgnMYmzvrvHjMhVIs0cA\r\nyB0b0gUjQLAanqn2/sd/xL8/qvdad+zGfdZInwOCtB5i8jarclNifg/j+alp\r\nOQfuH4tnPPAvmjwIMMImQndw9uPkT/YvM50Ac8+3O7qoAd0XmcCHjIdM8oJu\r\nSQSjxgVAsbTmVgR06huWW5Its6t3UyTdcHKPbC1Mub1cfzUnAGdD3bMs0t+e\r\nnysZ0MVyUf+N6WXN1qk+khmkyqFJ2GzSIdwnbAWOoNev2/gTSny59YZ/r/Ug\r\nzKkIW9Ncm/8froSwtoZXEtosX6ZRqaSOAuyJmRrTgCTDghzBtU18G9hD/gh+\r\nkDHuW3WR7jtiGk763YZh+DWS1S/lriBZtSQG8Xj+rJpvJXG0BEMo+erwDtBG\r\n68hXMEVwiC1PoqscPfs6l9DhJVknwj8UOfpNCV4Ed4yNFqqWcJ4hQVBV9SaD\r\nTGW353veJp6Qz5+NjtpRZoXt6brf+3Va6zxV5ExgJWUNIYakOVcW8gU6Cc9I\r\nQiyRZf41sxRToKIZR/tJQAHUVT2mY7UOoqETlqsqZS+dZ3Tocb7yoNeJOUNk\r\nRBqEAadRvO75y4+wKn+pOO9dCa4ijAc7MMQz/B3nmxeAztvZ++m1zHmPS8kE\r\nmltwRtbcFOu4SqDnkV2q1tAhidQRHmBEdNg=\r\n=tNKx\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"14f53e565ed77defe907254a486b9ecce4b45146","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.20.1","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.7c73f6134.0","@material/rtl":"15.0.0-canary.7c73f6134.0","@material/base":"15.0.0-canary.7c73f6134.0","@material/theme":"15.0.0-canary.7c73f6134.0","@material/ripple":"15.0.0-canary.7c73f6134.0","@material/tokens":"15.0.0-canary.7c73f6134.0","@material/animation":"15.0.0-canary.7c73f6134.0","@material/elevation":"15.0.0-canary.7c73f6134.0","@material/typography":"15.0.0-canary.7c73f6134.0","@material/feature-targeting":"15.0.0-canary.7c73f6134.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.7c73f6134.0_1668628858677_0.9175199075037102","host":"s3://npm-registry-packages"}},"15.0.0-canary.f1e037150.0":{"name":"@material/slider","version":"15.0.0-canary.f1e037150.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.f1e037150.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"d6aa0651d108643adfea948978192053124f8999","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.f1e037150.0.tgz","fileCount":37,"integrity":"sha512-d2kEPbtavVfamkI4/KSjcUac0XCH0ME9Hxp9x/ZFh5cW1ms7rxqYj4JQyH6NQ041hHBbaAkh6o4jJiPjty/HIQ==","signatures":[{"sig":"MEYCIQCDWKk68LxeJytanBAlT1exSXek0SuI8HPYqDlzIzxUdQIhAK9o1ei7PLfE5I0MlgNE3kJkQJHy4xdp0hhJfJYY3gTw","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":879901,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjdUKwACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqbMA/9GgDTGEWR5IljsP8ntE5augn19w47p80g48zBrJodddFzUydd\r\nPanQocjs4myQ9k+llq8EVaaX8+zFBNqOZMelyl6Oo5Rti2U2ZvazEgU5XvOk\r\nRcXXJZwO4wvZad/vgCgURKqDyRriM7xNAVSmVE7OC3s+TWrIN5bg0vLovORk\r\nM51PHTmtFDQPdH5KdO98X7/jkpTcRM8I/gKrtiObDMuomwQN3RY9CLrcnb4v\r\nV90O7gsauVl3I86ieXwphzR5HnxZXXL5C/doDxCSUR1Iu5fTm94podXENyId\r\nOz98Yk98ckDmfHdLJ1SfsHXXCIfasE8+WS/W3qLpIsji48QZKHY40MRQLtlv\r\nSNwIoEIC7PpChxwFQ8f3QV4YIeOcTVkt+dbC4tHQFDCWkmcSSarhh4NhXdUr\r\nrts9IZLK9eKj1FIC3MMgoezzCuzvuCDAqFGUYvMDi7lqATzkbevq707tmmzI\r\nFnguoJcOXVbypKbttAFlugfcJ0+ij65EmLmGKH2sH3ApEWYpiiRY4Kwa9lXa\r\nunUxXihbV6e7xK1k2hPPEFTccvaZemO1OQi8GzXqe950JSlks4CdICmfxh97\r\n283L2vdachxXJv1GN3r34aR0TPHvaOFEp+oVeWEtREN728hdv9uLpKZ3LJLD\r\nez+Zxwhvz0dC2GCVAYbDaBiDzZjc4QvkHXY=\r\n=Odgk\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"a639195febefa28bbed957ef46942b3da6a4cecb","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.20.1","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.f1e037150.0","@material/rtl":"15.0.0-canary.f1e037150.0","@material/base":"15.0.0-canary.f1e037150.0","@material/theme":"15.0.0-canary.f1e037150.0","@material/ripple":"15.0.0-canary.f1e037150.0","@material/tokens":"15.0.0-canary.f1e037150.0","@material/animation":"15.0.0-canary.f1e037150.0","@material/elevation":"15.0.0-canary.f1e037150.0","@material/typography":"15.0.0-canary.f1e037150.0","@material/feature-targeting":"15.0.0-canary.f1e037150.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.f1e037150.0_1668629168283_0.9355011202411283","host":"s3://npm-registry-packages"}},"15.0.0-canary.40b18d043.0":{"name":"@material/slider","version":"15.0.0-canary.40b18d043.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.40b18d043.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"e2c4b23d63c9e33401742e10d1479277c62aa1fd","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.40b18d043.0.tgz","fileCount":37,"integrity":"sha512-r8sZRYsn+qOP4F4VuTXHKSJ7NYv9cu1BMDicqv6Yz8slqsC0gZUzu60eCjMGrE+0LuCl7+DK82dx7PYPRdI2uw==","signatures":[{"sig":"MEUCIQCMkewN1kL/lAgNSkGX6mYd5Yo8fBjvfAAxnV2K+iw/vwIgJS0zTiNk/zTmlJSqbunyAVExDLc2az0u2/JUrE7sWlI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":879901,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjdWtXACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrZyBAAiO4VCRYOrIWSmuo+ekQrYgI6XDKV6mJRyQBH6GEQKx/fqZSN\r\n2t+qau3h72V6HwWXG3IzijmzND7PD6n+m8DhgQB1EeEj5pmf6RgSRUODNAGr\r\ncCkgmPJWsbLHSfc0GZVzk+6Q6CL433S38C3E/qsrGeeqZnGjg3zhamAzAI+w\r\nFhK0TTHq6t47LKGj6if1/2sotrd2+Lme1w09+tWBdGOgoGKx6kfhXqu9p+MW\r\n01PXU2afaBTb+/13FZG0PDdhkmuToBDJW8aqj6km/8QGIsjCJ+051EHvecBC\r\nN/2clJyQOXPYoyTdzWwUkSrArtYZZehusVHZsbn59lNMfPyA9nBRdvdw7hVo\r\nD682a6drWWCx1i0gqdCgtpl89EWqtfOscxLSRPigjNc6j59hnwUOreK3ZFdN\r\nakC93rftLZqkNpIe1Tn42ex7cCR7pulU/NS9/6wLj7SACFUszb1KmqdFz6CD\r\nncf7uxIcoN50i6ZujyPVhUPN68Njmm1MJ6YgjiLFQjWngbnQ3zITt4/1gwKi\r\nqr9nt9LQSVCDr4hOVMtiClUCtEnexiPveLg6kTpXukwgoWzgK1BXwFiH7x5y\r\nW7R/NYzyA7Fn942yElFvR3XGjnhqbJm93VuKmfZv2QgNVRig42q6E9eEu5Q/\r\nEDXs2BF297ljMnz21acE13TXhQqZ33b1B0Q=\r\n=9Yuz\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"9ccfc97518c89cfcc2b5e776dafe81024d137f31","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.20.1","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.40b18d043.0","@material/rtl":"15.0.0-canary.40b18d043.0","@material/base":"15.0.0-canary.40b18d043.0","@material/theme":"15.0.0-canary.40b18d043.0","@material/ripple":"15.0.0-canary.40b18d043.0","@material/tokens":"15.0.0-canary.40b18d043.0","@material/animation":"15.0.0-canary.40b18d043.0","@material/elevation":"15.0.0-canary.40b18d043.0","@material/typography":"15.0.0-canary.40b18d043.0","@material/feature-targeting":"15.0.0-canary.40b18d043.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.40b18d043.0_1668639575393_0.47679698054569397","host":"s3://npm-registry-packages"}},"15.0.0-canary.86bde5c06.0":{"name":"@material/slider","version":"15.0.0-canary.86bde5c06.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.86bde5c06.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"30ac49f1d7f1405d1b37377726e348f09e8d9a6a","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.86bde5c06.0.tgz","fileCount":37,"integrity":"sha512-an5k0N44tklnR6tUGNE9u/i9WeiWWPMJxcBuB/SolzKudfC3l2MFJXhK9fffs0AsqsdErTLFRK4O0vcv6Qy9bA==","signatures":[{"sig":"MEUCIQD4jGde9pmkyZlbSHDfQQ119L5spJ0DrA4l2Zi7+2e5cwIgDGnE+pAflRcSo55/ZF+t5hhOaXdWOgzSBUMwY59XiMQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":879901,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjdW23ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmobVw/9H9CrgIor0H7DpYYBt6Zs599SRlyPvx6CsepWbzit4P5mohQh\r\ncZ1W5Dj8JLpSfDoYdeVzix7UOLz+BdAHdiaryyXm/HViFWpofAbwxD7Vd0wI\r\nNuo7uivYzx47P6/6ttm18FnVtvO/4UxpUMIZd5FwAd9el0j11yzJDc2SmMV6\r\ntsELFwh2sw+CieO8lhlUIuLIkvALeGvJaxe+l963xqTSm0tEfK3nFXLbkPxt\r\n/D3OF4ndQ/SJd6QP0v6Wl5xk9qAmYrWkc7RczgSOFB8KUcP4y6+yghZVjNjS\r\nKP2MORoTqPHcuick+FRgLSeKewIzbEvcxwEq6TqNW1oT6JkPXKOPc2+oZtfp\r\nVxPrzu45vPAzEW2TqGqTU92bX24K7WDVTB11MPS5KpMiAiPHITQEct3NGMdW\r\ncJXfMbQuxHQOgnKsnEag1TxMyp/3Bp+t5ZA506mXpOnLZZRN/qgXPITFijOc\r\n+2qF735v7b/jlFJn5fhkCvxYevbtu9MlKl1MEaAXzyfGSqXjcw0Z8Q5Rx3ED\r\npdNwTLx5ec43M+gTQ6eVzV9LDjX+qGzP0MJQXf7H2WQqzHS/y1suwI3qnF4t\r\nID3sejzf83aeef2LteBAh5VjBg1shcz1K/I0dM4h7BpOoHSDINt9610nuK5b\r\nc00fLGBwtAsx0Hfs7AmarYscrDptA9gp+y4=\r\n=Z4Dy\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"b9cd39d4936a1961536e39eb1df855c5164d5840","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.20.1","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.86bde5c06.0","@material/rtl":"15.0.0-canary.86bde5c06.0","@material/base":"15.0.0-canary.86bde5c06.0","@material/theme":"15.0.0-canary.86bde5c06.0","@material/ripple":"15.0.0-canary.86bde5c06.0","@material/tokens":"15.0.0-canary.86bde5c06.0","@material/animation":"15.0.0-canary.86bde5c06.0","@material/elevation":"15.0.0-canary.86bde5c06.0","@material/typography":"15.0.0-canary.86bde5c06.0","@material/feature-targeting":"15.0.0-canary.86bde5c06.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.86bde5c06.0_1668640183273_0.8092376551218061","host":"s3://npm-registry-packages"}},"15.0.0-canary.bb7751002.0":{"name":"@material/slider","version":"15.0.0-canary.bb7751002.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.bb7751002.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"41860fdacdadc628a82be1d1055508ee2affc7de","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.bb7751002.0.tgz","fileCount":37,"integrity":"sha512-1i4mKiUsqrrzrIegzOQJzaLieUUWiaBaTDKgJM4dIUZezJH0TB+uZqS16B8fFyT2YIBxXz4aMvC1O9M6wyfX1Q==","signatures":[{"sig":"MEUCIQCUCyMlyv2Mn3LDH9hMmsSGD//gu2InB4wYsZKoYR1WMwIgVVc2/uliVq8YYfyOZf8eA3dlB4WbL81TxTosN9ylU2I=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":879901,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjdXm6ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmpf0hAAlSTI0hJDcod1M9AtLmLOko40hIZawKEJyoGLu7Z79NzJflKo\r\nOwjmWJgZCLk5/wSvm2ODulbllAi7xqAm3Kd59ddGj/3DD2Vpsv577JvqziLx\r\nW4uEcY9O0o7OJH6MdF/O4RsRQkQyztkP8tQFvIykWECU4FlMuNMZMuuZKfZb\r\nv6IqXhRnvIaiAYuAHS9VfZzKS2i7cXaxT9QkAdKw7QNuJh8IJYPgMKYLHqGR\r\nyvj8mQM7Xonp+SVJiHmx3xYjsidVhqP41SWdWAJJqd5ihqajbiFUvd80XvJb\r\nl+RR3PbQU1WAGyyNg7C0LXYzTATQwNHqnE4VUyz/1fK4jXbrsu+rp0cK7myi\r\nKIdH8P97NPT7j8tET2Uy//FpILdYatio56cff43r3dYc0o7seVj1Dik94SA5\r\n7aSt7ywONHUVc0oobV0p+MhzxhnWe6hXxgGcbCvHFhT5RpSj4jCQiVbcMS98\r\nd9h7q6WP51OShWr1mmkWRHmSxa8hxeRH8vDX4gtgUcPxuO8qjSpKrBwHYM/z\r\nvKWoaJ7MlzHsdOjsC+FQSkgiBSq1kO9AeOarz91ZWunmxE+bNiOFpE5vjxvM\r\nvI5+HdPjEOTvA7jCHhg+K0xergen6pskahsbFKqh0EaylShgLZQHVGrOBE7N\r\nUja3rW4i4jszJA+UK2TFcMsXw+HTifyeVMA=\r\n=5+ci\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"f83cadc3a1330a69930926dacdce7fdf10432f98","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.20.1","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.bb7751002.0","@material/rtl":"15.0.0-canary.bb7751002.0","@material/base":"15.0.0-canary.bb7751002.0","@material/theme":"15.0.0-canary.bb7751002.0","@material/ripple":"15.0.0-canary.bb7751002.0","@material/tokens":"15.0.0-canary.bb7751002.0","@material/animation":"15.0.0-canary.bb7751002.0","@material/elevation":"15.0.0-canary.bb7751002.0","@material/typography":"15.0.0-canary.bb7751002.0","@material/feature-targeting":"15.0.0-canary.bb7751002.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.bb7751002.0_1668643258210_0.5912553024251956","host":"s3://npm-registry-packages"}},"15.0.0-canary.63aca9af6.0":{"name":"@material/slider","version":"15.0.0-canary.63aca9af6.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.63aca9af6.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"17d30cc738606eefcd421bfd7a345364f35c0552","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.63aca9af6.0.tgz","fileCount":37,"integrity":"sha512-kJ+i76qbTmnDXAAoRbxWumF4Jo3cfYU/v75g2BfYdWokgw3O5ch6U9ETIzEwkOuRuN+CF8VbM/lO6OQq7P2mRQ==","signatures":[{"sig":"MEQCIHH+Oz/cJD49crEIIAEAHRmREUDTZfy1W0aus4XkDbt+AiAu7bgYFZp8sVWwF5X8c3BIb6xRy+LSB26Hi2R2qE1LGQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":879901,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjdoU3ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqsGA/+MOp+C+5G+4hsGHrnSyQrTTlmKE4mX6mimTdUcwULRY23FQ+b\r\nuc/OKlo5GUay2KnywRo1VkSWA0QvNrDljQ4EO9Jl2tVJv6C4vBibydZzftxr\r\nS2Hddfe41KGqATszA302ELtwVYwmPoUSw7q0UtK2G9w5PGj/X9A/LNsNhLMf\r\nwrjLk6J24ZjTRTo24ytjaLDnjA1XKtUbPBr5tO2bAMucuDKZdlBeMskpD3Hd\r\ntmr7c6XoSFAtY9Ab33FMfJBaKhyBw7WmG5YutOkKYaRpnAkKFS0NtSH/748D\r\nLWIOTDjFJC2e8uRa+g8G6xkS+9ExFKFPZnJJaVF9bdT8GYsOF/JG8+B+lRmL\r\nVU8PcO26aIALdSGZCDBq7y14zKseH328TNfJ8Uk4X3xnucd7f2P32pfYwXyJ\r\nYGV5cxwFYzDnFy9bL6AVaK0n7JD3R/ezbEDJlPeKtz2lTNH7FwGsgIcUo52q\r\nzCrV0e2nihHaPenSjtdTyepAbOtawzof4n3rE9/OLxI4HnYhW/1atrkSz6UH\r\nU9frTDOVeNtkxglfQUp8O9MnE4ppVuJYPdjaFizcikxfbszfZKjb0FxBbpwn\r\nzahdrdQjYDs1e/ewh3/2R3yHvhigsnMVRj9bLS5CJTbMLnN6oxqVtGA86xrx\r\nagfR9m4x7+1oEm0ko16luIaO0wknvzioVrw=\r\n=rATZ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"c2c841973403116b6a405bb9aad3ae8476bc028f","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.20.1","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.63aca9af6.0","@material/rtl":"15.0.0-canary.63aca9af6.0","@material/base":"15.0.0-canary.63aca9af6.0","@material/theme":"15.0.0-canary.63aca9af6.0","@material/ripple":"15.0.0-canary.63aca9af6.0","@material/tokens":"15.0.0-canary.63aca9af6.0","@material/animation":"15.0.0-canary.63aca9af6.0","@material/elevation":"15.0.0-canary.63aca9af6.0","@material/typography":"15.0.0-canary.63aca9af6.0","@material/feature-targeting":"15.0.0-canary.63aca9af6.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.63aca9af6.0_1668711734795_0.6658351837937309","host":"s3://npm-registry-packages"}},"15.0.0-canary.56482dc2e.0":{"name":"@material/slider","version":"15.0.0-canary.56482dc2e.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.56482dc2e.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"0588a1e74fff49eeff6fd36193ba5f9d5aa1e078","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.56482dc2e.0.tgz","fileCount":37,"integrity":"sha512-7x27f158uHY7PYnWiwRS4s4nJ6aOWrJteKpl6xDCODr2uiaZpvtw/lqy6m+aTkl7ei0Gg3v6PsO9CigXYKeqvQ==","signatures":[{"sig":"MEUCIQChxNNVNjnLufhX8rZ4UNffyXJWRY7wCfjKutgqORn/XgIgI53vydNMtKl5V6QOg1Yc4V8ayk1b2T1NrVD2u2tidw4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":879901,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjdq3yACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmqecw/5AWCVJ368iMWnDtg4cJuOtu7PD29e2hSJaxLxlqF9/ClfutTX\r\nfVnrUv2Tz9gpTJcAmqruEgo8axXc3W4t3V+QzwW+uBPWL/KlYtEQJLCiffjh\r\n/VaCeCw1fMBUYEg5tjfWuBsD4jzZXTlVbu9d7DeAx8SJ7PI2Pd86/0fnZN/Z\r\nrj8ixQjL6hYadmp19i2xCKqxfGfBJvSTUVipBsWvBWFhl1QDMHEuzoDKM4wu\r\nXYlGyxbSSY5R0YTN1i32gA2MiIHCpxVd6s9rTp0U3THoyn60gZQsabdwkLPd\r\ns2es5UUK+y3xFbilcs9M8wZFoCLCjdk0gvL4nMeIQfEJH56zVpci4mepGoU5\r\nESDbupiCR2jnXPYAV0XoTBMWM0UztXTRs2H/OlqICR+CybMXLNFjZ8eHquMa\r\nvAtGyZzs4/ygx9GNjxboz/6TqRpjeGukGYGsyK5Bwh8vtl95RCgXh1+MTDCD\r\nAO8ld9xJRQ837tabsUatgVQdYefqNIE1lPZhJ+3XvmxeTRvtsBEg3dizT0X1\r\n7MEhyWWAFgIua8yXI3kRV98TqhTcjQ+h5nFHMvwt9RBSZMTddLkks8BHypKS\r\nP5IWN/hUn9ySm5ZA3qmc9CsMSILIsogj2LAJ4mp2+buCKTE223xukpFPl9L2\r\nn6kY5CzBVNDN2Pqn61ncYK2fEmBpfbNEVDk=\r\n=EPu9\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"c65945fd8948c8e5ada035d0f2538dc2ced7a28f","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.20.1","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.56482dc2e.0","@material/rtl":"15.0.0-canary.56482dc2e.0","@material/base":"15.0.0-canary.56482dc2e.0","@material/theme":"15.0.0-canary.56482dc2e.0","@material/ripple":"15.0.0-canary.56482dc2e.0","@material/tokens":"15.0.0-canary.56482dc2e.0","@material/animation":"15.0.0-canary.56482dc2e.0","@material/elevation":"15.0.0-canary.56482dc2e.0","@material/typography":"15.0.0-canary.56482dc2e.0","@material/feature-targeting":"15.0.0-canary.56482dc2e.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.56482dc2e.0_1668722161925_0.6910660468993095","host":"s3://npm-registry-packages"}},"15.0.0-canary.953e689f3.0":{"name":"@material/slider","version":"15.0.0-canary.953e689f3.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.953e689f3.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"bba6dca096815a6416181248f750f0a040a762e6","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.953e689f3.0.tgz","fileCount":37,"integrity":"sha512-jbK117V/ZHjo9eHQ2cPPnBRypK2FRPhWm7T2NynjUmH2re2rpbC1nmlIOu3/63wml9W5hXSj0qSuwa8ysC9OLg==","signatures":[{"sig":"MEUCIB8Ue1f+MR4r/Sx5Go0yO+FHnRpAaAtzUJjlgjQb5s/RAiEAvRg/grOdAkFww8BhP4aqM7yjHdPLTlJfenj3x7nXnUo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":879901,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjdrArACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrADQ//aV6iVI0oBYNninfaP6UNIYRcZ1cbGPCnwUoHMUsItqShqWkj\r\nsURNmGAz/myCNzyNA+ILYRXwRtLY7+9dY8ihkSZivvKLRTq1azqk4Jm0vylI\r\nt1F7N61da/bSLdHeCDRYb0E/WUs8u4xkuTAovyp/PRput2jS0WbzNNBg2uUw\r\nxebC77biDF6dFbIuQwYwO9bu9EqNDDcJjTxcJuydkL1jMLh8tLMcJWuGRqW5\r\nKjjybHQmTjJrs+PA5/duh/s/75Fim4x/TSN2tkrNgSptoT4A9vRcoNGe1jIa\r\nUi6FITk8XCS+hRNzhFvhtd8vEaQcJPjcq3ZEdUjZwWSrmlW4AqfO4C2mmIfr\r\nppQ4JiPH1y9lWGAPIubcc9v2TKC6IJpLGeC1qCaig9C1Uzu9yLB0Iu35qK8m\r\nbpS3IpNuC+2mZt05sTfBiTS4cQEqJwCKcJ3nNx3cZ50fXMx9Y/fzhjubkPQS\r\ndxm9fN1WPLQFo69Edd8sdBipzIoHZML1lQNwpH59N1OhdhaWpYUlRERaqGko\r\nHxxOEa2V1uf1IOiKMtW3ICMtq6elFdBpDGEoWAlHZs3nr91lkrtxs5LQkMrm\r\nIge06i4x4gA1laGN/yyvp+rNxR8j/WP0AyeRIR+D6kuLE+/i1NfEoKHPbqgK\r\nZkhZ6233ohV87PMcBHCsCSngc97OTqpAEMA=\r\n=SxPL\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"9b9adee0b4f10a2d6d77fc10e9291c3aac8be42c","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.20.1","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.953e689f3.0","@material/rtl":"15.0.0-canary.953e689f3.0","@material/base":"15.0.0-canary.953e689f3.0","@material/theme":"15.0.0-canary.953e689f3.0","@material/ripple":"15.0.0-canary.953e689f3.0","@material/tokens":"15.0.0-canary.953e689f3.0","@material/animation":"15.0.0-canary.953e689f3.0","@material/elevation":"15.0.0-canary.953e689f3.0","@material/typography":"15.0.0-canary.953e689f3.0","@material/feature-targeting":"15.0.0-canary.953e689f3.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.953e689f3.0_1668722730899_0.07839676637776583","host":"s3://npm-registry-packages"}},"15.0.0-canary.b5606a793.0":{"name":"@material/slider","version":"15.0.0-canary.b5606a793.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.b5606a793.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"30d68383df2f8f4b20a486a4fc985de137edae0f","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.b5606a793.0.tgz","fileCount":37,"integrity":"sha512-Qi3hoImOREdMk7SR8PolxbqbAfrNKH2EJ/i4vdOJFyOZc6D8w3U6pJfRKwcoZp6gpYkSgvaJBOekile7GByqyg==","signatures":[{"sig":"MEUCIQCe/Hto+ypxNntvdsJqyzjFAKmnvdP0OTcnRqfaSOqRiwIgW5QCwq/21P9EAxZH2suvv2Bsxwfz3LW0fjt/jb3KFEo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":879901,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjd1zGACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqxSA/+OAHNo5tzCOR5kt6pgTuOGqQhgtpgC9YMOB3Loa9+8T976h3o\r\n//1cldyyobqECUwsgiStUiwSQoG30gx10kqoTMkrRg/oDopdL0vVWmVindiQ\r\n/iwHbUK8Ly4J4xcUo4USmDTZHnOV/LtPdj/UR8hOGIOAmwok3eaZjHfdyMRN\r\np80k0agil2unypCptJPt4C/Dm8qh2+l+Wr6AerIoDyNrQz6hJ5iotigOZJHw\r\nu64t3Q74xEzb4QytNIsH7iw+hDXBZvP1D6eHIoWX+135MtRhWf2UzTJSEXZP\r\n2O/qImPLgUJAjio58ZCPB35j8DEjSU29hY/v20ubvxLb0xylS/QsGKn8HwrW\r\nuU6zLKm/rx06YYl/MOCWKB/m9OKor1WKLwICgu522nc797NlEb8JHYfDg4xN\r\nAf70H7HcEub/sFB/wxU2fgMSIpVr5SfwcsaOpa35uBBOpQgfBpWOaPUM7wYB\r\nDogNBlzfaO15P2VNfesQ3xnCx2d01mKhMBAsmBZ0YiK8e/41qSlwv1fBxK/t\r\n6EgQy82pwkuOlOAqQkdXs1divkW9wUtBhmTSry5LdTb1SrEl/6xtGJro2SXR\r\nu5/hrRUpr8nkTSfB4wqx6AynPB+r6Fr61FGYlSwd9jeXMtu/G54BEXFE8OXp\r\nOZ/hMp2LrrrBNxhREUNAyvhE9EEgirDB6NA=\r\n=wVNA\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"681685532cfc9993a6190aedd85bf5cd1b3f80e3","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.20.1","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.b5606a793.0","@material/rtl":"15.0.0-canary.b5606a793.0","@material/base":"15.0.0-canary.b5606a793.0","@material/theme":"15.0.0-canary.b5606a793.0","@material/ripple":"15.0.0-canary.b5606a793.0","@material/tokens":"15.0.0-canary.b5606a793.0","@material/animation":"15.0.0-canary.b5606a793.0","@material/elevation":"15.0.0-canary.b5606a793.0","@material/typography":"15.0.0-canary.b5606a793.0","@material/feature-targeting":"15.0.0-canary.b5606a793.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.b5606a793.0_1668766918701_0.7898815437637974","host":"s3://npm-registry-packages"}},"15.0.0-canary.8c5675942.0":{"name":"@material/slider","version":"15.0.0-canary.8c5675942.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.8c5675942.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"81c74210a20b8fb2d7170e8f92d9c68c9b3806dc","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.8c5675942.0.tgz","fileCount":37,"integrity":"sha512-mZNpFf89vZWF8TRJiQUOhmxL0l5KhYntFlmcZp9yADFSvkIS+wKDF3e4R2VYhx8SEExX2hUy+VGOQa2kvbW3dA==","signatures":[{"sig":"MEUCIFYdnDq2q2K5Ox3tEJu3wV/ZaOS86RdhBT5AtqlK9shiAiEA4zHM1VDNzL4QCV2cWM/AMQpiHHHBdjnkPYGcUZmwJ+M=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":879901,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjd6H1ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrU/w/+P+E327v+RTEh1RjxWU5xxg/YZSCczuRiHHp3EISYcNIu/0ZR\r\nr/NrX4Oo9niUFKZMABfyRBro4ZKvBXeQFb3/Sgx1uEdzl9yjxGMnZT4utUle\r\nU5wEJxbR+JBU7ympPmjIx6H/nP6OVLowwr7wKWdXKOQD3QgRW2nlnYuF6+l9\r\nd5LgGFug0o7hAtNPeFIUW3NUQm/T95jtxvQ+tHfXlgSGnx3yxESCbbxWVekW\r\nM4hjkyeen0h9+NCP/8tyQ2rVJTJVGyw4rVnv47sVF04vj57wM9VubLaaFtis\r\nkclbHnAQcVYWGMfWtohBVEO9YCtjZ3DBgZ/3i++3Wfy9jmpZ0JNAyDJ0MJBZ\r\nv+2S5vzFdYaL98Fbx6IpXt94/G3TkO+2hoU0gvRcfCnJaQ7nZgCu/qu2KB4M\r\n8R6wKaLG1/zLipE54omKsGYlmHPkW56Ioxzqen6DLMOvnjd9+Hzs2OY3c4vY\r\nh2UkFeFgpRMdPbuuI/n5yO2YGGyPgs1dIYJqnPeB6GRlRWzvYGjTurrYMWTy\r\nianPATnJMZk3FSpvPHYwPgHb9lOht992MobjAbnG7v7RfDAzaGHWVCP830Z7\r\nm+954/lK1mb787b1ZWdOX+BWYO3BgqdqL4DPFCX3PT181+rRZPLoBle4b2jn\r\nYqq+h9P0C0T5QCdP6aeetxPhTxxlOeSTyOQ=\r\n=QBlB\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"46367ab28a14e7ab75dbddad4b3a00d97443debb","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.20.1","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.8c5675942.0","@material/rtl":"15.0.0-canary.8c5675942.0","@material/base":"15.0.0-canary.8c5675942.0","@material/theme":"15.0.0-canary.8c5675942.0","@material/ripple":"15.0.0-canary.8c5675942.0","@material/tokens":"15.0.0-canary.8c5675942.0","@material/animation":"15.0.0-canary.8c5675942.0","@material/elevation":"15.0.0-canary.8c5675942.0","@material/typography":"15.0.0-canary.8c5675942.0","@material/feature-targeting":"15.0.0-canary.8c5675942.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.8c5675942.0_1668784629450_0.36780075243735144","host":"s3://npm-registry-packages"}},"15.0.0-canary.697fbdebd.0":{"name":"@material/slider","version":"15.0.0-canary.697fbdebd.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.697fbdebd.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"76d20a8b606cd7b119a25124cfdf9cd0798cfd05","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.697fbdebd.0.tgz","fileCount":37,"integrity":"sha512-PFUlRS4gxtK4aRGItxxyfpT6M5JmJfx/qsMZUcLyUeH3byFm8H4CWmTUBf5cc9QMYZk9yDOEun/WcIM6l68ElA==","signatures":[{"sig":"MEQCIG4wma03IwdWnQ1fAbA1ylVi6NymLcxkIsbRKxfk/424AiALRKSfKGXNe1X4jA26Q7+3qj0IrNJJxDlMWpk4TivcNQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":879901,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjd7p2ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmprmQ/+P9c9srosNTj3cq6GVTs/XmAB4B753xBGzWU9WjLe+tQcmfiK\r\nilPxSgKWB1aWqfG0GtUZgxqFJiKxnfPH/Z2hZnGiO3MObMrm3BHs2U3nH97+\r\nNxHAnJvMoIOUTlEQ4jFT2vA0tIzOpHN6o7g3KGbueQ2cLADlR+SxOEBXW7kW\r\nZ5Sjny9ct3avi88Aa3rBG1CszEFB9k5nh0YbNR3yTWSPZvSU8Cspq3vFRba0\r\nI/gxPtD0YHF4dLVqtTNUuoDdHjJST+BEMdYPYgY9QTEVPnuslnRHcczTiPfy\r\norbDoTWuoBUTfHGCuoXVxsxv+KjS4NpiFKJU+xWS8Y7uG1xxrKq8xuy8CbRM\r\n6+0uDgqVhEoWfECxz/atJ16663IDQPae7MOgooeNYx3jcOLy4W5ENuM/E9XL\r\nBdQ6z8qPfGYTy3TPB4TrTj4V5c6PGWG9TOpmGHAP7KM4XKQ7ac3tdb1g8Lox\r\nUQYbTXIxNFPwFGakRDTvfBJsg66NdV87GBteiI/sEM79B6vqs1Bkh81GEMvY\r\nLFloAeKv2MUC+qNY7ew8j1KS9f74LXxnL29HiBOuetOXSb99qAAr6AZj1FLb\r\nNMhTL7/zKaJ8LIYazXxj0vnRqeCeHQ2e0IxmpdGJ7juEStYOoil55VPsW6yz\r\nMoygrpVToGFJGHNA6Pv7KMxGBqm1A+UUAz0=\r\n=86CY\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"633705dd01d68334d80bad5e354eb7e71d9fa30b","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.20.1","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.697fbdebd.0","@material/rtl":"15.0.0-canary.697fbdebd.0","@material/base":"15.0.0-canary.697fbdebd.0","@material/theme":"15.0.0-canary.697fbdebd.0","@material/ripple":"15.0.0-canary.697fbdebd.0","@material/tokens":"15.0.0-canary.697fbdebd.0","@material/animation":"15.0.0-canary.697fbdebd.0","@material/elevation":"15.0.0-canary.697fbdebd.0","@material/typography":"15.0.0-canary.697fbdebd.0","@material/feature-targeting":"15.0.0-canary.697fbdebd.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.697fbdebd.0_1668790902323_0.9073662984418764","host":"s3://npm-registry-packages"}},"15.0.0-canary.d58410453.0":{"name":"@material/slider","version":"15.0.0-canary.d58410453.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.d58410453.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"2dcba19232789438a4d6d7c606f6e8afd393e6fa","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.d58410453.0.tgz","fileCount":37,"integrity":"sha512-bJS6hnB5DCmuPK6qZMVk22cXJFSLfwumJUKo9SieVD8ewV61Yw0BZYdbqcxJekX2Zfsurkjjs0YKtwpBrT2NOw==","signatures":[{"sig":"MEUCIFe98f5mnB2399jCtp5m63c0ElXFhR7cRprrssW0N3y1AiEA3ToKv21Sc8WRjsLkxXJNJ8qvagXcbcFh1/+6td5kE2I=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":879901,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjd9xFACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrFiQ/+JHwZzhVIa9sFkfOucOyUWOPLLqsx8XI+839ghq/w4GyCcwpM\r\n3Lsr4mTinhV2JKweEc8w48khRx2b732UoqY2oTD4zUO9YOKMahCfc4fOOvCe\r\nYEcO51NqCfp9bekvUWszZIdnxUA4OA7m/YmjXKb8ItdrX+kRK/AzPwZ8vNlx\r\n7xgyraAxzG74Bmb+ary1VKQxSCpl7beoEKSkls4HZ019JsdEJnI9aIubr+0e\r\n7juJB6iqJliB631aXPxjbPUYNRE+7snd6MnE2iSB9yHXGV21lSLQife8XbqK\r\nM0GFMouz/8153FdbKkvdIJQWboWlrHEK37pgxw4Lh9MFE11YaRA2Vvz/RGpU\r\nIQkG5DA6loYt39gjk/BsWp4gC14vnCTy6+1SeBjIgVNKhEwc9klhkt7hKw/J\r\n59y2gt9x1wU07pZrsXvyxCMA4ZHHwJiiajSBAHgtOnBzft1HtWUsRJ90AB1G\r\nr1O5GzKjzMWNvjN7gABcmVb0FW/dbKulQnJMND2hq+y5YTOHfY5S8zhnwabe\r\nGeaKsWgAZ0lvAxl4tLeN27z2218oNp2bcV3b0ZurSM7AyM4wjvuOF9BcF9c0\r\ndiXYuk6lgBG1lycE5Sk5nefpTjE9jjVLyEkYQnpyfrrX152Go8U/jbAA9HxF\r\nkegJUUe/fVgA2MsfdRRDkZGr+SBixRq+q7E=\r\n=B0Kq\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"65248afd9a1318b7afdd324f3def6a9c8e67c90b","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.20.1","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.d58410453.0","@material/rtl":"15.0.0-canary.d58410453.0","@material/base":"15.0.0-canary.d58410453.0","@material/theme":"15.0.0-canary.d58410453.0","@material/ripple":"15.0.0-canary.d58410453.0","@material/tokens":"15.0.0-canary.d58410453.0","@material/animation":"15.0.0-canary.d58410453.0","@material/elevation":"15.0.0-canary.d58410453.0","@material/typography":"15.0.0-canary.d58410453.0","@material/feature-targeting":"15.0.0-canary.d58410453.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.d58410453.0_1668799557028_0.6221011601391759","host":"s3://npm-registry-packages"}},"15.0.0-canary.7971d6ad5.0":{"name":"@material/slider","version":"15.0.0-canary.7971d6ad5.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.7971d6ad5.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"3aab26821097a8b851b1598140799977cc62571e","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.7971d6ad5.0.tgz","fileCount":37,"integrity":"sha512-OjbxB3vwZvhbTGP8EGLWoXyodbTMuwkvoFdblEiZtWrrPL0Us5hg/20n8VfUQ0N+c00mElsEv79Jsx+B0iTV+Q==","signatures":[{"sig":"MEUCIQCRQnIyfV0kE1EmnEt9TAEd/eQo3UVSqARZA/geiR8zhwIgdNsMD5UhRZMm8xWKzDOXmlubh+C4elZJ/NWEWyNA6jw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":880075,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjeJfJACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrcoA//Sgpqv3CHx8OS3Fe4EBEmUSar4VevN7Vck4lZnTNVGeJFOyDI\r\nrYOjpzmUDlKY4YcJ6RCJNExtTqRw3kW2mrv8+8agINjP5FBAI2IMyY1nqk7j\r\nPP7RwzikA2mt/hfKsaakiZ+wV6AimEBYiKOhxxEtY+VzGmlU/neO3HcjLV8W\r\n0m+RQTboGBR/sJHlQ0VrtYikd/HKcI5e7fc4WBT+cobVSZTG3h7vdlkJmkGB\r\n0eCXtsL4mpp6wTpofrjJmdzIK/meDQJ8Sme1H3Z7EtPG+7CaHuiuoxgTiNM0\r\nRfZzUpeJrcWHsj6g2yYYKPnA9PCW3Mvs+BEwqj1bnPzJjqsPTWO24OjF4iAx\r\ncbLj9/t7D6YjuoO6+sbkVcffjFfdmAlczVblpWxFpLg1XNF4+bfiTpy1URcr\r\n8e904VnDwB4i/GujG0nqQkKxCKxKM8/yjMoISaKZTT/uNAPzCz3My2bTpSNO\r\nsXMlqcxCaqx+RT987dbs1r9BNFfBkmomctoaZjxKadfrn6rpDOtl11yaZqsC\r\nzwb/YvzWD7GPJWy/S5m1ozCCWc3tpKh+CmDuc++P99zs4h068FxdqMqScOty\r\nyV0jvWE2evdNRusY8vwcfGDWXvHfhDhRh2oTMDSVq0+2TcAd+gBjSi8bk6NR\r\nzjZatoGMf6OsMsV6icW7mQAtYLeZVvek9jk=\r\n=a1t+\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"caa68cd6e7b5cf4d64e037521bea18e312048e69","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.20.1","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.7971d6ad5.0","@material/rtl":"15.0.0-canary.7971d6ad5.0","@material/base":"15.0.0-canary.7971d6ad5.0","@material/theme":"15.0.0-canary.7971d6ad5.0","@material/ripple":"15.0.0-canary.7971d6ad5.0","@material/tokens":"15.0.0-canary.7971d6ad5.0","@material/animation":"15.0.0-canary.7971d6ad5.0","@material/elevation":"15.0.0-canary.7971d6ad5.0","@material/typography":"15.0.0-canary.7971d6ad5.0","@material/feature-targeting":"15.0.0-canary.7971d6ad5.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.7971d6ad5.0_1668847561325_0.541026004837099","host":"s3://npm-registry-packages"}},"15.0.0-canary.a0ae73b0e.0":{"name":"@material/slider","version":"15.0.0-canary.a0ae73b0e.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.a0ae73b0e.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"7d23f8b2f5fc61201c5e3d4fd97299444be3eae0","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.a0ae73b0e.0.tgz","fileCount":37,"integrity":"sha512-9ulacLlfJEykMzxTsOOVc5EVvMxEXy5q8r2n4OWbfJUAIk50nspp/zNRPEgUNwT7BOMR0Ga7PxLGK3FL8eIjEg==","signatures":[{"sig":"MEQCIG/7OD41HzRdVpbw5YL33SUe6VLp7uivRbXbQuyOL5/OAiBRoFTXzeQLIfeCoC+UvR6Fl9V60tf0Yz4wwUvn/gpwXA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":880075,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJje1j0ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpC3w//eSDPSNXfsa0NED8qadvDQ3KDuUINGavE08u3rRgSARgU8rlo\r\neVYOBuKttW3JYKEkdHGfJJ3Xe53oLjIf13X/+K6/LrwCifgwVklq38178FAh\r\nD6k1XjVMHJIeybJ6VfQPKwUwUPbF4omCRFMJCLIHYWck2o31pGq6c1CtOgBr\r\npc4Up7sr7PoCs89d4KMAARTOjcQkYrTcXTKgzgKxs8AWmWmfREfLiYRBkgbs\r\nhfAoJwYo9eH8HC526tyj5ujNu4obtFyC2EYzBGhZAu8YjyxT1Zk6eiD3EiFN\r\nIsHHwagS/nVq1KdlTjcyIoe9Eq0ESL0h+46xN4CPefP5sFEYGFXfDfwP2b1m\r\nbqcCQnWaXUmT7L/leQRmbxA/brO7Vw52pT2xKTszH1fhHXiCaBlsYsZjCY29\r\nJL1yKbBoUSSaTlA+wQp6ZVKBh/HlbEQNw0ZhQXKt3+SiUMOyGVmVXgFmdUln\r\n7rYiXnlpLKsWj5Fxik4cjya0PotIiICziZSlmZV3TWmW35EcyDzWbx6cB/js\r\nuRHjX5CWH5nFyUAMsjb/vhnPen+Dvou6g1oyDjlLS7Zd7HnRsq5F4MFlXthk\r\nJqcvN3RtYSGRC0IwVvXQQEQjg9NcY/GQPNNFi07srONeozbOZY6lS5iEjYAQ\r\nm2DPOqC2MTcLOj0yBmowXYQksU8v+qq3dOk=\r\n=R950\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"92b496120a9385203165ec42657a2edf41099000","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.20.1","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.a0ae73b0e.0","@material/rtl":"15.0.0-canary.a0ae73b0e.0","@material/base":"15.0.0-canary.a0ae73b0e.0","@material/theme":"15.0.0-canary.a0ae73b0e.0","@material/ripple":"15.0.0-canary.a0ae73b0e.0","@material/tokens":"15.0.0-canary.a0ae73b0e.0","@material/animation":"15.0.0-canary.a0ae73b0e.0","@material/elevation":"15.0.0-canary.a0ae73b0e.0","@material/typography":"15.0.0-canary.a0ae73b0e.0","@material/feature-targeting":"15.0.0-canary.a0ae73b0e.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.a0ae73b0e.0_1669028084147_0.18037298425571224","host":"s3://npm-registry-packages"}},"15.0.0-canary.96f472604.0":{"name":"@material/slider","version":"15.0.0-canary.96f472604.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.96f472604.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"ceb92fcfa695f903dcdb50714763ea1de2518b56","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.96f472604.0.tgz","fileCount":37,"integrity":"sha512-WQJfC7O19DK3S0/MhzY+lli83f6/+WgO25gVdeytzk7Cv54PrcI+C32vDL0HTsg5qxcsUb2bU0eKX0PJTjXT3A==","signatures":[{"sig":"MEUCIDGppusJQVLHF629Le3BCCoJq3yqm5R3N82/oan5FtSAAiEA3ttJ/gxCERam+4JHynVbt1wHPyfU4XeKv+VOmgmkgCI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":880075,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJje3TOACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqNoQ/+PRPJWv07Dsn/2+CuHT6Ta0teLvLFQVsJX3TTxuElK23F6pJP\r\ntdjvYQmjEP8X6w7GoHSiH3Ua8ojnn7SrmdcdRQ1nCHvkNSeeIpGaYROXO0tC\r\nvyAtNztN8y6bfuyEdz01nnqpBmK4Hheo/NH8fpQB3ztaBA6bJZHya9snOcEy\r\nhBh1/X2cxSRCv7M5vWBNl3njMXM9mkfildQ9kmSaVvhwDGb7Kc9JdUzan85t\r\nPVYIihQnqY8XrdTvhwu19nlCSqLvXs4xWGoOoZj6wGN4zliI8BcEWziTN47Q\r\nJqz5sdh6OeoE6PUyGCGEIir7YeD5zvPcOacCjVmP8iTh9eV3N7NF4qe/F1XB\r\nLrPUipd64QIrTQwG3QMWumstaYgq6d8XeLqfyzMlfVhRztab/qlVFpRj3TUS\r\niytXy4+GtT1BTRBEYv2QFNxxN6KH8SRHSORWYsmToa2hIFBbjqt7VoSqOnI6\r\nHdhJE1Pf27QwJvkcmSLs7WqsA1zFs6pO29nRzKSLNatd0VWj1bioj0tf6Lid\r\nEWA5cHPPQ3FVUUXO4xC0Tesa51MliDK9XbxY7+w1ww31Afu+BKwGchycw/5e\r\n9bH4v5uVInImuyKOmTXnJYtQJ90a7t/6n/C+vC+HoLQEV6VMY0Q3Szd7pxaj\r\nvmYnG5rwKGS5eWfN0JjbctSiqK0em8r+PMA=\r\n=P3mh\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"28f313542547c982f69fc57b98811983600931fa","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.20.1","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.96f472604.0","@material/rtl":"15.0.0-canary.96f472604.0","@material/base":"15.0.0-canary.96f472604.0","@material/theme":"15.0.0-canary.96f472604.0","@material/ripple":"15.0.0-canary.96f472604.0","@material/tokens":"15.0.0-canary.96f472604.0","@material/animation":"15.0.0-canary.96f472604.0","@material/elevation":"15.0.0-canary.96f472604.0","@material/typography":"15.0.0-canary.96f472604.0","@material/feature-targeting":"15.0.0-canary.96f472604.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.96f472604.0_1669035214356_0.05149410591483372","host":"s3://npm-registry-packages"}},"15.0.0-canary.18b8f31e1.0":{"name":"@material/slider","version":"15.0.0-canary.18b8f31e1.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.18b8f31e1.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"c6595f6e85b1cfb34eccf4bff163630dad4e9ae3","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.18b8f31e1.0.tgz","fileCount":37,"integrity":"sha512-HynmRXsRBPxUeDJueTuHFfFDsVsJdAfbDXeY6Gw3zH/hZBh/DkDwfZQo5Kjxs8+Hi3ljyyQsmPe4n2x+MNBIjg==","signatures":[{"sig":"MEUCIQDFNo6u0QFkgA7yn575WXJFj3AKHbzY5yOqF/Qw5U4NwgIgPv4wo0hSUbEONy7p0eERhwhh6pfenYazYPHGioCA+r8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":880075,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJje6FFACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpGNRAAlqSF6bz6a0FrpoF3RCHlN6ut/l4D0dEHkpNGjhtD0HhRWCn6\r\nEawiCc8OZQG7UFVZRZyZ7SnVtipgjZCTWu5ATrK4n6o27EL9TakjlPT9qz3r\r\nhcYdn7LI2RUwrWmBwtpfbk/hMbWIUbVHPGEbu89214PIGqZGf8iZzaej9d03\r\nIwu4FGag+ix00aV72Xh3Zjry/chwPVoLbmRMlMlM8njIrtOgTBVQ6exnyu22\r\n+4mP0LDIFAXWOvyRZ6JBiS1K/xG1bUsFAy2770HxDNq84ou/qvnX/IFlL3gm\r\nt+L0525jxQqAA1M9lBjQ2QF4+pHIq/BGjm/1zx2ZaLJLD59pewKvMPumay0m\r\nzOl3HOdaq9qk8ElY2eI4xufEQaAmteRv+NHxnX7MEF2jhFqI+T5BDpuzHAvT\r\noPZ2bKFdNnnFxSJnJz7vfbRCwd+x/U+eGXvh71zPZkFJOBYwPHrxG4Tr+Ywj\r\nRcumn4T8TyMT/b4+J/Z7wM8cQSa13voSIoj8C6lW+6NFjCZZuLFok+XWd9BH\r\nkzXrgL3T/8C4Q1jAA49sXdDYlwE9SHjgYA4LY1RFa+OxtxJmJLuNtoKTp9fA\r\nFUyYruwB/ZgAmu2SEJ0k/f+NXB3PJ6VkKYgZ9tONW10oErmU9ePkpPRaSMyn\r\n8+2gWtOM2bl6EzWbKWrzWNcTuBje135/pws=\r\n=EYZw\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"99a6c50dcaf8c9db8b49ca9378d7bcc70fa3d276","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.20.1","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.18b8f31e1.0","@material/rtl":"15.0.0-canary.18b8f31e1.0","@material/base":"15.0.0-canary.18b8f31e1.0","@material/theme":"15.0.0-canary.18b8f31e1.0","@material/ripple":"15.0.0-canary.18b8f31e1.0","@material/tokens":"15.0.0-canary.18b8f31e1.0","@material/animation":"15.0.0-canary.18b8f31e1.0","@material/elevation":"15.0.0-canary.18b8f31e1.0","@material/typography":"15.0.0-canary.18b8f31e1.0","@material/feature-targeting":"15.0.0-canary.18b8f31e1.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.18b8f31e1.0_1669046597180_0.17544473486549306","host":"s3://npm-registry-packages"}},"15.0.0-canary.912f33ce4.0":{"name":"@material/slider","version":"15.0.0-canary.912f33ce4.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.912f33ce4.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"f557aa64cb6c7e132ea223d039f920a512278d92","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.912f33ce4.0.tgz","fileCount":37,"integrity":"sha512-TakgM/xkiZOwi57k+Rh1bKuJxewO58/pjVT+vWkdsuEKwwaOmSt4hvvzbrUDrsK21TY/Z69lKcMJh3P+3NJRCw==","signatures":[{"sig":"MEUCIAL7k0jxHXyBJfXtlOvYyyy4eWfFuDNxh1pSAu+RY4ghAiEAlqDSeonXIRE9iRWkYp+SvV1EB3oMh2jcve0TxeyFvD8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":880075,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJje7tuACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqytRAAl0xKOVEgx3+3wR2llngRucaP3lYb9MIA2E5jt97fimY5cmTe\r\nhUI4jpdDxKyo4qQHOAlb3pdTxVeDG2SMra+Mw8bpJIpoxS4RQ4gxLCIaf7zx\r\n1LaQ6V1MTpFUHOJ68bdA6CHMga1sqF3mfXQ3VqZBPgwwgevWk+JuwOHBiNyA\r\nvQXD90To4BGwiOKU4lPV9A9yhDGnhN3a4TSnnF01+MpejLgKnTJAw3SHN+0u\r\neOl8xBtb5WmDzehuXM3rSL/SlsVzBlkOitqQibOIPYC0WWj83suaLtPnzWlP\r\nEXX2Juv04F8ZfizggYC1/i9p4A193PRUu5oZLic/TcvWjoNCgjn8LUrqGN5h\r\nv+7TsOD1Oa+jWZp6pJWmDbZqfnruBlVMsBwsW96G6pZiFeoTntY5bwks0cbm\r\nbB96n2ZvqUInHeRG0rRCXcDq7exnw8X/mEG4/dawD2CJ44S5sJXKwJQ9BEpt\r\nh27EteADV1T+yW8/5hgIu4Frq4TAWI+RVNHaGDb9Yz63rEE4sT5Pv1K0FG5g\r\nKgvNJ9eEItQHIPXViS1S2KUegbedfzLgqK7DtX75uofNf2FEsxE7EiwNmR/F\r\n/mCb/BFlnJi54pDkXONLHopT3U/UffvC2XooNtD5F75voTDXUS9GQXN0Vupf\r\nAi6J6cGb6VGHhJJHEebSRxtj1Jp56QFe2EA=\r\n=OLBc\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"cbdf5145fa19b6681004b6c2d5de771b50f5b6f9","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.20.1","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.912f33ce4.0","@material/rtl":"15.0.0-canary.912f33ce4.0","@material/base":"15.0.0-canary.912f33ce4.0","@material/theme":"15.0.0-canary.912f33ce4.0","@material/ripple":"15.0.0-canary.912f33ce4.0","@material/tokens":"15.0.0-canary.912f33ce4.0","@material/animation":"15.0.0-canary.912f33ce4.0","@material/elevation":"15.0.0-canary.912f33ce4.0","@material/typography":"15.0.0-canary.912f33ce4.0","@material/feature-targeting":"15.0.0-canary.912f33ce4.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.912f33ce4.0_1669053293648_0.6658491318614359","host":"s3://npm-registry-packages"}},"15.0.0-canary.1e1b1c369.0":{"name":"@material/slider","version":"15.0.0-canary.1e1b1c369.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.1e1b1c369.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"b54d16043843e6981b395e0e57db04e43fffabf1","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.1e1b1c369.0.tgz","fileCount":37,"integrity":"sha512-2fhuagQy/Qo+1bZxSXkO/ooW9dV+mCLtSq+mpFqhZ9sZfchsBa3eKZ9rzpyCwqOnRs3d+0bt3Xk8E93ZTPjpBQ==","signatures":[{"sig":"MEYCIQD/RXso8UCMcZ9IIuSwM0OvIaTQQT1gteAISel1BPhHAQIhAIIWw/PHju6LEQ/9uNhJOr9FLVikrXKyK3S+lROTQmeW","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":880075,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjfm4NACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpxQQ/+I+dgFKwch7Nk+RezevaL5FyHaaS5JTSNBkEDqoyKmai00B0/\r\nuCrPHqNCvWo81uqYPXMiNNwRiditC0+cyeq7jvvBZwnK5VoF9vb9WuAeHIIe\r\n+29WsNSWJI0WYHyWwxNWV4bmUSPr3JRNsczKtD6kaSIOysme0S8n1bfZk6vD\r\nwerYU0MYU2Hg/CU487zDoGre1DcCWoksVxIuL7u0lpqLyAEfCtCIWzNZ+7Bc\r\n9NxJosF4WzpDbfs29yeM5bDme7wVRT1axDt+yQ3rNuninbSgCo4h9opzlVAI\r\n6Qn8XgKFiuH3hCksNkoDs7OnIS2NEXBnxvkoqIZCW5bg3OmdRM9wlRQyru8Z\r\nfS2qpPdlsj5oR7G0xX0r5o7BuPGIqR+5PBeSExU9DXHhKSorNvFK0O0/fTFA\r\nRstna3cWRRBKJV1NTdHRspPyHCa0dH/IF7l/DXf00FJLkWyUTNvtGEzWP2/T\r\nWl+T4EuyPkewFmPrcg1DXbYWoaOEAs3WdA+Ek4HjtjZfxRj+EeiESt1Tjfd3\r\n7JMgeivlw0+wR7Ue6WgPEgLcpGXoos0hvAcex7jgF7s6BJhrl/CXIwLdqp23\r\nIdsGw5hG3QnBc0A0MDDTCm1GQ41byxRQv5aI4jiTBTyh3gwSYKpIjNuNR2Ie\r\n5Di6D/NmkYZkNPMIqnJhyQ+784EM8XSMR+U=\r\n=LgZF\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"b59baa6ec6a8114401e616de0c9d3675a34e4206","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.20.1","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.1e1b1c369.0","@material/rtl":"15.0.0-canary.1e1b1c369.0","@material/base":"15.0.0-canary.1e1b1c369.0","@material/theme":"15.0.0-canary.1e1b1c369.0","@material/ripple":"15.0.0-canary.1e1b1c369.0","@material/tokens":"15.0.0-canary.1e1b1c369.0","@material/animation":"15.0.0-canary.1e1b1c369.0","@material/elevation":"15.0.0-canary.1e1b1c369.0","@material/typography":"15.0.0-canary.1e1b1c369.0","@material/feature-targeting":"15.0.0-canary.1e1b1c369.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.1e1b1c369.0_1669230093733_0.8885027287165579","host":"s3://npm-registry-packages"}},"15.0.0-canary.a2ec49244.0":{"name":"@material/slider","version":"15.0.0-canary.a2ec49244.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.a2ec49244.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"091530d7fe89cb66309285c5d85c88a2418eba48","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.a2ec49244.0.tgz","fileCount":37,"integrity":"sha512-bU5JTTgLbkCuSlFwzCcn7wXMjOhUcV9TYgzdbiouuaI5Mjfd82aNvwHAk4KcceS1BNK9FkUKXlQ/FUwLHVjv3w==","signatures":[{"sig":"MEQCIEs8NF2x/0usc2KtHRSNyi969mrvhNC+IWvxdjFbn8qPAiBepBqmXGPyoqocvNHXdfL/0Y2qEqgpQapoQk0CPeQOhA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":880075,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjfnUhACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmo+dw/+NOaaNR90TQxP6+qpj268XYyuAIzYRsg1sCXoMZlsTup1rmby\r\nme2lFtr08s4adJEpw0qqEq8yI9LhpBYz70G8iBk2JsVTfxbvhgpQOwcDWfCv\r\nTrZB047xCO9PAT/oGpxVRhivb0aQU4k4r0hfxxm0Bk7nSAYYs2zMK372hzZZ\r\nBE49Kc9B00h1tG1791eeGTOKvk+o5frKmj+1BEaIDfHsZVLbnoFU58zpNc7J\r\nTs/gR5v9nz5R+F+n92TZ94Q7oCchIkRRCcVYhLbh+OjqNDAWeReuLKvjYrw1\r\nNl5dQZV83QTGXEI3jMCZwYCiavbAfPpAAMkJVq+rKq8v3p1pLi9FbpozkUC/\r\ntUrxY1T94H92hRKS1aV1QnnjM+4iK3RmgQPdvfYpfov7O2BJ+Q8Feh71Yb2w\r\nTWFBmOO+L5MZTk/WpsGT0/aFTeC1uBAXcMoM9nXl5VJivlKPxjVAHsK8EGYf\r\nvNnvrFbiUnzM9rU+jDsdZFkNnRE2sP9pJzZiRBKcpFhHn4k1kRQN0WwCeg69\r\n/aTwLivDZx0EE2CHCm4rF8pOfHI40Hjyv5eOGxoGFpTSP2oW5O3n4IuoJaNO\r\nW+NDsSP3thtouPnaFhCd347RzIRRUdZzN2NmCgVF0+f7MCJDBvSeDDI5pk0G\r\nRpVsiAXgsAYeqLpCUhOh0cdpHFyHgQF/jlw=\r\n=jMsB\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"fc59d471222d0010e05a636e8c3a9a5a9abe2b3e","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.20.1","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.a2ec49244.0","@material/rtl":"15.0.0-canary.a2ec49244.0","@material/base":"15.0.0-canary.a2ec49244.0","@material/theme":"15.0.0-canary.a2ec49244.0","@material/ripple":"15.0.0-canary.a2ec49244.0","@material/tokens":"15.0.0-canary.a2ec49244.0","@material/animation":"15.0.0-canary.a2ec49244.0","@material/elevation":"15.0.0-canary.a2ec49244.0","@material/typography":"15.0.0-canary.a2ec49244.0","@material/feature-targeting":"15.0.0-canary.a2ec49244.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.a2ec49244.0_1669231905071_0.5735740585745586","host":"s3://npm-registry-packages"}},"15.0.0-canary.a7458ba0b.0":{"name":"@material/slider","version":"15.0.0-canary.a7458ba0b.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.a7458ba0b.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"2ed7785dfd8d02f08e3f40c44265f4d6db46f950","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.a7458ba0b.0.tgz","fileCount":37,"integrity":"sha512-Nw6kxknbTCUsnGEjVYO/wiYR2kFQp3kXRNrcr/4CvpTtf9ouvBgWAAW8kkD0ud22oiJ2eBvvDyaKUtrsgOZN4g==","signatures":[{"sig":"MEQCIBKmWGymvzgBBaCQNeqBGZ1XDOGJxqyp1VwHDWPADBBeAiAPCSjz/GZuLqmY1EdR0uC1KcyJFFXPKCiMTHl5841SYA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":880075,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjfn/QACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoqehAAguZWsUgkG1M2El2LI8ZB70krCphh211VAUSMSRtuk+6z3Dp6\r\nl6yUInYLB0KafPokQZH8exrClDZbO2t3wY0GHT8Itga3nztxhJqnCgNqrQMh\r\nzZmzLhUj0KB0wR+DK0JPt4NB4Wj0llE87wqUC1fMo9jiVFB3drQAFisj9dXM\r\na3Gp0l29vUIzHrEYNZoTGzqfnXTC31GmmZuzSOKiCEDqXxeQm32aUwLweu5V\r\nHMp8uwTHpgF+xPrTBdMtXhCcEEOLwOHj4rYY3zrr4eYd58pgfUg4pEMK910v\r\n0/4/lCDD/2orHYqEFSuHelC4ktsqctYCpOfaN/Pn6e1yw6pK6jMlrQcToZOg\r\n7EqRtdCM9onv2mu7NTV7DRB8kely8+wgvlcsqSrDLD5i98LuiiSHI2M5tbPi\r\nEvfF1keDoXTjjDt6/BkwGNlaJgvi6M8nhtQZcI5QuNuK8q0gCg7ff5NacklY\r\nIEK0uMuDziFI9tfzgqDKxetL1V93e5iLUgKSO/Oz48XJpgnqXvS2km5kfpJ7\r\ntEvAI4UoiPDjA4u+xzFxbpwfJ9Igick0L/MuIllah0IRD+OOSG1KA9JTwNJS\r\nlyAdwqHzgg/oCS6P1bd0dbUoplVVFrrkLmA5OtiK5T7Fie5brKu1/HliDTdA\r\nJZn3vUzfZKwJBrOLX4P+axnRBb5NqhxYAh8=\r\n=Dmfi\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"62e6a15e0784982b77df0a1d824f81d5a15cb6f4","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.1","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.a7458ba0b.0","@material/rtl":"15.0.0-canary.a7458ba0b.0","@material/base":"15.0.0-canary.a7458ba0b.0","@material/theme":"15.0.0-canary.a7458ba0b.0","@material/ripple":"15.0.0-canary.a7458ba0b.0","@material/tokens":"15.0.0-canary.a7458ba0b.0","@material/animation":"15.0.0-canary.a7458ba0b.0","@material/elevation":"15.0.0-canary.a7458ba0b.0","@material/typography":"15.0.0-canary.a7458ba0b.0","@material/feature-targeting":"15.0.0-canary.a7458ba0b.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.a7458ba0b.0_1669234640720_0.14701985560399433","host":"s3://npm-registry-packages"}},"15.0.0-canary.7c35e5036.0":{"name":"@material/slider","version":"15.0.0-canary.7c35e5036.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.7c35e5036.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"4aa20371faaf3b64348727388c88c5de2f57c691","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.7c35e5036.0.tgz","fileCount":37,"integrity":"sha512-01tZqsgmqt4XUlYUDJ2n6K8w0IzPHKsbWvgEm02aPDf6d99LEhQPT8H0vCmC47HYIflnQZjDvQeeou5uQuhlWA==","signatures":[{"sig":"MEUCIDFdtkEkYyyWudrYE9uFuIyun+DrY6YAVD7sbVHfk1r5AiEAmZWmdMuasI9qdr9EzVbicvniX4e5qgTXefrO3D2hSdc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":880075,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjfy3yACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoJYhAAiA2dAvip+Kr/z6E9IibHGU7p42r8pLR8WZ9Ahuxms+Rug5Ml\r\ne9AHbxAtlG6+KUaahU9BzKlwFrs/BkiTa3LH5dTWQVg1T0PWc4svLROmtcfL\r\nIkHdlW0mSaCgceQStaEWKzxMuzlI68TutaF+4Evmecvvbr2Z5GM/2BPsr2gP\r\nGEyFEavlwku/Q+eD8OQv3wjF6WGM53lm3p+3YNsA5W5ax6ovac8XH3uxLOKz\r\n4rqQUBRDclDt2RdQtQHM9X6OHYnDJD+ssUwObcKz35TxImIMMT5dA+2aBgks\r\n1bmLLYPXuRNIVbJz70z/aaP3SgsmMDInPLPMlnxIA70t2p9E4Q8XcKVnbLv4\r\nifcvmZ6X0as7lhLCEZ+dc9SnAZ6Xw/r2A2xlipZV60bsYCzV41dniNEr+xlH\r\np8VE0NPgMtkwUkSWy1i/on3tgn1JQlcD3sdsQ96T3YRP+1/U/IskMG5ixWZV\r\n64siBAamfnHB83WYIfR9Yi8MzgSLuSocdSfOJYftelIFTjBW3RZa0V/5TMx6\r\nSD/exam2/bQYivzVaV/NDx5vJybddvAeXj+JvD1QPGZysxrGBhqejhQXtMRh\r\nD426sqYTb09s8qxoMZFLgiDxVG5uVtdjalKxtMFDpBnOY4vM/oGIfwNcBZi5\r\nC+UDOjzBsjQT6865E+dLZt74uErRLUZHw8w=\r\n=IzgW\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"bb1e9aff747feef28ef92f415776fe33dc1216c2","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.20.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.20.1","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.7c35e5036.0","@material/rtl":"15.0.0-canary.7c35e5036.0","@material/base":"15.0.0-canary.7c35e5036.0","@material/theme":"15.0.0-canary.7c35e5036.0","@material/ripple":"15.0.0-canary.7c35e5036.0","@material/tokens":"15.0.0-canary.7c35e5036.0","@material/animation":"15.0.0-canary.7c35e5036.0","@material/elevation":"15.0.0-canary.7c35e5036.0","@material/typography":"15.0.0-canary.7c35e5036.0","@material/feature-targeting":"15.0.0-canary.7c35e5036.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.7c35e5036.0_1669279218366_0.047105349241760575","host":"s3://npm-registry-packages"}},"15.0.0-canary.4356e05c5.0":{"name":"@material/slider","version":"15.0.0-canary.4356e05c5.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.4356e05c5.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"71eeed3ca5d4c7048e1ba605b28e4c8b83f6a7d2","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.4356e05c5.0.tgz","fileCount":37,"integrity":"sha512-riF9Szm3/QUIWmULjOInKjDTjY4oruLZ02OaxD9rToqCKRg7/fiYL66DA3Cu4byAUth2jIl5QHsFu2Bstr9Qcg==","signatures":[{"sig":"MEUCIQCjTQFxi1tlzuaCgeincu4yVyWdGKacdsONxPSB/N9pugIgMza1i/XTWrRr1t0+XttwLqF9e9UU9XtHDpyrBs30Me4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":880075,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjf0ASACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmovpw//fdry/xC1WUrVWB8SqVvgsE+8b0JZOuUN8YFGPDqAYBqzjz2m\r\niCWI/VBI3tMk+Y5Vvkrm5VS0m0s0k1vf2d7Rv3oHTiJ4HIuB7LB/tFmhUy4x\r\ndcvVS/jrw4XQPIdwcjPkvZ5alQKY2ErM/JvBUUAASF5A8L9GEOJ0IvjBrY+i\r\n7p68K8wTyUfvubksMJejdAmCJBQeQvqo6A5gRzPAvsOO6dmz3b2qurec1sSV\r\nANwp3gvnoMJdc+4C/VmY7FqFgBXLE5AXUu9bhYzrgt8eiUVIPYlb6sI217yK\r\nLHzc6pONH2aweofU/wF07mgD0HjJxryhR5JJerYt62PzX4fMJTvrRpt+DbAk\r\nbx3ur9vkP9CGSKMWVtUkoTZu6Iap3Z21vaz4ksP3PoOhBGxmBnl9xA1YnlpS\r\nKzOdfp8K2bB1gvkenoTPbz3O3r7l/iMwK602uysHWTp9XoSNKntMPgs7TVlC\r\nYMSYbqUntW2R5jzm92uuOJYiKDFxetMqD2wVBNxa0Tw16Fqcg97gd9sQoLr/\r\npVhZvnoAyzSlY/kp7Ti+cqGDiVc736Y2B0q7yNCN3lgrVWAuedmT9L4LGEB8\r\nYN5TRDfsZ5+A/yVAvYmfvt0dv/qiVUN9htBPe1168txQCi3YzW1Tzqe2kY/j\r\nQUmPWRECSAIx+6+9fGSl92inhaG/suzQPW4=\r\n=e78l\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"8f21a6abb8b52fe9aa5804b940eac0cd94256fd9","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.1","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.4356e05c5.0","@material/rtl":"15.0.0-canary.4356e05c5.0","@material/base":"15.0.0-canary.4356e05c5.0","@material/theme":"15.0.0-canary.4356e05c5.0","@material/ripple":"15.0.0-canary.4356e05c5.0","@material/tokens":"15.0.0-canary.4356e05c5.0","@material/animation":"15.0.0-canary.4356e05c5.0","@material/elevation":"15.0.0-canary.4356e05c5.0","@material/typography":"15.0.0-canary.4356e05c5.0","@material/feature-targeting":"15.0.0-canary.4356e05c5.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.4356e05c5.0_1669283858547_0.5790821477183679","host":"s3://npm-registry-packages"}},"15.0.0-canary.cb605f8af.0":{"name":"@material/slider","version":"15.0.0-canary.cb605f8af.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.cb605f8af.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"4f58b26b83a7d3163327d2b5b5c1d553553c88dc","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.cb605f8af.0.tgz","fileCount":37,"integrity":"sha512-C2HOJJafNywOs+CXQfP7RtS6wK2d+J7rpJ1UZRvMF+CXbvDqggqgWTKleTgBv26OChsna9X/gR6lzOs7cyFj8Q==","signatures":[{"sig":"MEYCIQCloKBVHuJqptyyH3lKM1gzsRJ8CVCaHu1pNbElFMv5iQIhAO/TdCmLxH3hu2AUuvhPqlqGOpF1qB7+/t1pL0hms1ME","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":880075,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjf0SNACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmrvgw//SG1heTjeP6bWAOWQ6zhvCDJec+oy8WuL2xxGgdvxBwbtFR7N\r\nqUyEmX4qK/zxDemA6s5Y1tsAD5vbH0cA12Wg3Yu1erauJDg2CqMlb4W7IMZk\r\n33CtDQoL2ZLCjI9p3AoP4e7awDx/agEzEbXXYkiQJdnTJQ+Ys/SeMmYeVUHy\r\n+j/8P6HuCI4R3a8jE3TriTA80METoWoXmToVlxjuuVB+waFGz9eOUHOFq45V\r\nB/nZ4AleYPXJwMC2xOw2I3DaY6ktAw296T6R3lc3An4/kaCApuZFofFyqa+N\r\n+ZvO3EKxfokCjq1MadFsaKhnd+4T2xmUR1T1kmx8KkRNd6zl1dmFo8pZArPb\r\nj1oNZHXdDUJK82YI+oBD1pXC+pemwrIs7gvhiIwjuHzYKaCzePRnwbH9bjwv\r\nACUlgLcz8mXV2W8IJmTb7u1HxiJN4w6b28C4j/9JewTEhBHLD7GekVCiLpyZ\r\nx8V+qGlIDWve7XOnSpOE4r+kDN+QZje3gB3AZn5v86VyU2yyvqu7sq//BCQm\r\nZC70OYlYHsgKxz8iqnYGvDdNmOpqf8cjq6BEf3/JTz8QTYIz6SGhIMaE0y00\r\n3/6oX6gLYjPTS+0oIcWONHvqRid4hindcZryJD9ysWqSs8T6gWkUJdoMfpVF\r\n1w7Irx6mKI2y+vaJ5KepJ5YvtiANpL+RaEA=\r\n=m0qF\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"9d617d11bc1506bf595e8a4f05413067775d3880","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.1","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.cb605f8af.0","@material/rtl":"15.0.0-canary.cb605f8af.0","@material/base":"15.0.0-canary.cb605f8af.0","@material/theme":"15.0.0-canary.cb605f8af.0","@material/ripple":"15.0.0-canary.cb605f8af.0","@material/tokens":"15.0.0-canary.cb605f8af.0","@material/animation":"15.0.0-canary.cb605f8af.0","@material/elevation":"15.0.0-canary.cb605f8af.0","@material/typography":"15.0.0-canary.cb605f8af.0","@material/feature-targeting":"15.0.0-canary.cb605f8af.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.cb605f8af.0_1669285004633_0.4904461559571476","host":"s3://npm-registry-packages"}},"15.0.0-canary.05fb07f9f.0":{"name":"@material/slider","version":"15.0.0-canary.05fb07f9f.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.05fb07f9f.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"7d7df7244d1bc4e26eb301562593be95d7fb5133","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.05fb07f9f.0.tgz","fileCount":37,"integrity":"sha512-jSIwrX9gC2BEnDfqHpc7bo1QaxUnwi3Uhkz/gdX787XAML/1cGMS/BIlT6F0hcX9hgE+zSX1qu7+puVMZ76I0Q==","signatures":[{"sig":"MEYCIQCzrIddiy7CZa6FMgJSPYbE7CpHBp8qbP1uiNNM1yqTSwIhAIMiNSqtyp7KwR7ZqdrMybC4qt3ujFwBAQVE+fpuFpwf","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":880075,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjf6Z8ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmp8sRAApNfTVMeCbDzU4BxUQ0mNc9X2TJF/wcGxNmT0LCHQPLE0BZ35\r\nwAXr3Jeq2fGZ7EeePvtRlD935e7v2JV/o489Q253R32YNVp4+LI9Hsw4mh4k\r\nPr1lOuIq3USN8TleRbBMLSbo9JRU6XFrXYnmN2lLmqFRnzvRKUGc1WgboS34\r\n4TU/g8WA7Bsn1I6zsmGX5PmIOdFqNH2+mF7ioKFHJOCGBsgBxkehWVr/f8cj\r\nbZn/EckE7rIz/9HOIbHl1YXvXR8eZzRDZnWZBlq1jPGMJhFFOOIO4PHF9/Fa\r\nQFrQL1u7JXicboFAXVLLcrxvm2RZvd9TAmNvewLUqIo6CxJkzb9V1Xt5Glax\r\nOSapCBy0ibLrgXJPQU5emDShC4zSHX2GVirrUK1Omxgq3UCa7d49fDmNyird\r\nVL4UyfO6sIMjxiBPrLBweyT+2h5yRRNflF52uFUMioAXcKR+zH6Mci8jHSnS\r\np7VBk72rUN51d3iAh1BCvV57aUpuWdU6E3GNcn5YpJ5QRGNECOrfA1bYAgMg\r\n9s2NH/gigIkWgfnAmdKJ+0CaHtswokSozHLWFdeQwJRj4zD6QQA3ZqD+c9ZT\r\nL0J3TjJ9MEhUNzZ4ttJaW9PosOOo7xxKM+ODOtnxzvp7i/WsJEPaLAZxsfUp\r\nij7/jnSpSly4JEKEGn+znn79Rg25zMRViVA=\r\n=4W02\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"fbbdaff1715be513be46d4628f7aff9d8f7e27fe","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.1","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.05fb07f9f.0","@material/rtl":"15.0.0-canary.05fb07f9f.0","@material/base":"15.0.0-canary.05fb07f9f.0","@material/theme":"15.0.0-canary.05fb07f9f.0","@material/ripple":"15.0.0-canary.05fb07f9f.0","@material/tokens":"15.0.0-canary.05fb07f9f.0","@material/animation":"15.0.0-canary.05fb07f9f.0","@material/elevation":"15.0.0-canary.05fb07f9f.0","@material/typography":"15.0.0-canary.05fb07f9f.0","@material/feature-targeting":"15.0.0-canary.05fb07f9f.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.05fb07f9f.0_1669310075865_0.44421578278560214","host":"s3://npm-registry-packages"}},"15.0.0-canary.a911b386b.0":{"name":"@material/slider","version":"15.0.0-canary.a911b386b.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.a911b386b.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"6a4c64d9aced1f17520c9a0e1acaa537bbe3716b","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.a911b386b.0.tgz","fileCount":37,"integrity":"sha512-6YkfEVssOLidJD356QWh57kh2/gIwrCtIpZ/09HFzUb1sycl+VTVxNm0fAGdFT6BXy9NWaJy5jysrE5xVhOj5Q==","signatures":[{"sig":"MEUCIE7GNXf4l/43NdX+iT9oE30Pd/eWD1eUWjEs2FpWj0J5AiEAnE/HxE9GXuRTbRitH+zjd34sDl+fzcqkN/vyQlnZ/oA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":880075,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjhOZOACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmowGw//T701C35iwNv+mRQLrGCIkeRNPJwMBa/A+QPEFzDFHAzhiX1g\r\nwQ0ec/Eu7FDpDwPrVnfEeJsu5hqTDEON7FTRXmvfd9KLbmtWE4vVcMwT0HPv\r\n0PBPbK6GgIWAh3Vdwv7E18UnZTz4ekD9tp2glv/JVxFZDrJJ4YKu9bIPcXNx\r\nByanFaH2nASYmk+kLmt/YirDcBuFMzAUVqHlINmdxLXxsC//FhQ6OS63oNsW\r\nPwK/N7ODwgn4fxDQj4CzKhTvU45aZx3Bcg7JTILXwCpzqCbSoJgtJdYrHbCQ\r\nglCsEEPzto8I8rxvvdtiPH97IiCaNhTAZS/fNOhPVdhrWYLwYZ7EMl5Z4/4u\r\nBTYBzufffXjdZ5nlnowUT4+6NH/5SRK62WWhmoQpJKr2RwN+sjwGvJ34WkPZ\r\nG+bZlgMQLFuPvf03RrTQznt9ra6HzIkNuDPghtLzZg+8t7TOMkqmLYZ31ZUq\r\npEHGT0zN6FX97QEQlQcdIKGHwpDirTOmN/lodxAcGK/WyZHzU9K5EKORDx/D\r\nvmgOnu6a6eTB6ukzU08va15Ol5NNthY9iuL0V2g/O+9dfxJNN4XQhTFDcdnT\r\nypk5gAqquI2dVAFP0cOL5hiwkq7A6vnd4JE2gNDAekcp9Jk59snOgPhregGL\r\njQTOKyrM+mBSCKxE+UTv7LyCqHNeaK7Nup4=\r\n=Dd2C\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"2487492bf1103f4c82913b328eb64ca5b71b9f5b","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.1","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.a911b386b.0","@material/rtl":"15.0.0-canary.a911b386b.0","@material/base":"15.0.0-canary.a911b386b.0","@material/theme":"15.0.0-canary.a911b386b.0","@material/ripple":"15.0.0-canary.a911b386b.0","@material/tokens":"15.0.0-canary.a911b386b.0","@material/animation":"15.0.0-canary.a911b386b.0","@material/elevation":"15.0.0-canary.a911b386b.0","@material/typography":"15.0.0-canary.a911b386b.0","@material/feature-targeting":"15.0.0-canary.a911b386b.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.a911b386b.0_1669654094060_0.6311079579384509","host":"s3://npm-registry-packages"}},"15.0.0-canary.2aa8050b4.0":{"name":"@material/slider","version":"15.0.0-canary.2aa8050b4.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.2aa8050b4.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"91ed480235d4ca5f935de2afc167cedfdfe8a3d7","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.2aa8050b4.0.tgz","fileCount":37,"integrity":"sha512-vB/OETFwx1XXBicn2j5p+zR7mKcHlm+cBQVitq9tQ2CBsWxqEA6sqcPukxt1s8lfbJADkhQK8HRQ0gLkQG5utA==","signatures":[{"sig":"MEUCIDDqvDH8J/PUFWgJ4M4UZlYk24c7d1MoBwFRkfkT8sIrAiEA7ki6TVfQmPgz2zB+SOlW6FqbmcsJ/ldQhZQ1XVZMaCw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":880075,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjhQgfACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq12A/+M9cnRMWOr1m6AtMdVefXqK3FUTv0vykOGD/2iCnz0qZqFDjh\r\nHegX0GVxaHHCF8xquH3s6IfUuLwULNaG/4pRutEi0Ew9srZCYTl/FPDbaJe7\r\n+G8mqCSiUowBzGhkw8zWDowvsSdyKmUM2SAtUYsUFOblD5eqKVQUdnbDDgr+\r\nwaqrH6aTBKsN9Hi0kpqmKp0O75Gjn1TRe2RA0clVJiEtPsNxSVB6ghhVQGHa\r\n5doSrCnWATdezLaRfFNVCIW/rRu1s0Aq6eI1FyCnaQ/QkC0XI6wXwhlxP65d\r\nyGDGaciwkNpxLMDfz+bbzhBX6MWWGa+QFqTezM5VuFT98CKZPRzfytKtalrW\r\ndRf4Hackpw8l24bvCX19vOPUVLgo3Rro5I1lUZ4Tc63XSTp7O1yFofvoSF3p\r\n6pmnVVD3/4FQwfZcFgS+o+Iqn7wFGU5xo1jj35PRsfTV8Sn+LbI+UbnyopdL\r\ng/2a9qKHQGqvuqbK9K/5p7m3qSqCdsyONM9dfhmC2v4gZNBdkiGHlVpsil57\r\nDkejU7fHLTP/CTm1hj7s/8/NSdnXhpgzOirceft3dZFTkxiNQCXqHfEDKW2z\r\n9ZFFx5pXeyHX7qQoDyydFNdwUPocfEchcuqc3KdF/kN+4OBVQQ8coQ8nCKHw\r\n+5SVmvK8I8D1NzJPfoGHTPr/PA9NLM6vUQs=\r\n=w86h\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"7ea9b47d90d470adeb6f1cbc0c1c98b88392e56b","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.1","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.2aa8050b4.0","@material/rtl":"15.0.0-canary.2aa8050b4.0","@material/base":"15.0.0-canary.2aa8050b4.0","@material/theme":"15.0.0-canary.2aa8050b4.0","@material/ripple":"15.0.0-canary.2aa8050b4.0","@material/tokens":"15.0.0-canary.2aa8050b4.0","@material/animation":"15.0.0-canary.2aa8050b4.0","@material/elevation":"15.0.0-canary.2aa8050b4.0","@material/typography":"15.0.0-canary.2aa8050b4.0","@material/feature-targeting":"15.0.0-canary.2aa8050b4.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.2aa8050b4.0_1669662751280_0.18431035425938114","host":"s3://npm-registry-packages"}},"15.0.0-canary.323904a9f.0":{"name":"@material/slider","version":"15.0.0-canary.323904a9f.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.323904a9f.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"2e349bb600be3c23b7721fb9208eb4398f331383","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.323904a9f.0.tgz","fileCount":37,"integrity":"sha512-FIjqyDDn7f8GyzXewcLK4jQmwfDzMH39kRjoAr2QXEAWa2t8rQkGmr4GrPEMhq/NdnuPWhiJMSJNqed1ZdNx+w==","signatures":[{"sig":"MEYCIQCAlchbPNNDrJD+yjLnOQkRIqN218Qpiz9ipvUDMFfl4AIhANFt1sdZh8YR9fSy9TxT0z/MlFYuI73E5HOTedrADQoE","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":880075,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjhiaiACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpnFA/+JSwZdpZWxA+HtmZkZpA6peK4tY+CCej8oyOC7ECY3Rz5mlvx\r\nG5SR1CFLePIKvdxkjIM3rmtSNCmgfH9tVxY4tNyAs1OhTyDVUrHHzrMRdjIq\r\nn7eB/spW/sFImB3+swrJ8GC5ekQqozPf8jAqDAlNS9H5AHp8ZhToaoAZOtE4\r\nNiS0RxOdILdouTLHiqhcsNFXh73pvT4LZzvpusA8Lapbdir+Rmy+FcyiP72D\r\nmcBj3jpbEUkO5Aih1ZrhNvdimICrs4YBQ8oCw/ZMDbPAiPOPPc3QWfZzv6+k\r\nHPziD4rcCWzY8u54DwnCxBKJNNP0oCawsVg13jpD9JVR5RWT+5jlH1LFvYW8\r\nPIf706HGSg3/I9KCw5EqFeijPNham6nq7G9kr7Hnud5NOJCbshfA7tA/wIPJ\r\npK40qnMksteczei2fft15i1HExyBi2DP5m+NhZzSsVy7UEPv/iB5+tbDvaWb\r\nVkEv5WeAnW8H0K0gF0p67Ycf8Dkdllfoe+EjalfQcQpQNsBI6xhJuTliTQze\r\nyiVvHKOZCaok6ySpOipEh0vpLdwfDes4O24cOh4OwuXRA3zPgeNh71165vki\r\nDiN4spc/EH034CJUV9BjdBRQt5H2I1/byzM6veclSHLFlm5EqYn8oQy8mCw9\r\nZCSkH8473EHLViU4iFYjA9xf8mPzHr7hOC8=\r\n=PDi+\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"a69fa8c7160aaa07d868f5bc365076bdb159bf99","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.1","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.323904a9f.0","@material/rtl":"15.0.0-canary.323904a9f.0","@material/base":"15.0.0-canary.323904a9f.0","@material/theme":"15.0.0-canary.323904a9f.0","@material/ripple":"15.0.0-canary.323904a9f.0","@material/tokens":"15.0.0-canary.323904a9f.0","@material/animation":"15.0.0-canary.323904a9f.0","@material/elevation":"15.0.0-canary.323904a9f.0","@material/typography":"15.0.0-canary.323904a9f.0","@material/feature-targeting":"15.0.0-canary.323904a9f.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.323904a9f.0_1669736097859_0.18370090312005827","host":"s3://npm-registry-packages"}},"15.0.0-canary.168a629a4.0":{"name":"@material/slider","version":"15.0.0-canary.168a629a4.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.168a629a4.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"caab4028be7a9e3f9f16578f2b4de1824ff57d4c","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.168a629a4.0.tgz","fileCount":37,"integrity":"sha512-Plgs8emIBLAX1g45BjgwdjXAXj9mG3eCAeNZpbfZz5XsAV9QABumt+40RVS9zI0IpwIfvC7U76qns+w+GGQCZA==","signatures":[{"sig":"MEUCIQD6nxFVAsYstffNJqIQjz1e8i/TSGeKWJw9WexX3UaBvAIgH1ne2ucn6SlSezq2nP8Wg1LzneorB3KcHSSvw5GbUoY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":880075,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjhjg2ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoG5Q/7BJRB0BDn26CWI1FBeJ5uZmr8ltn9mIRV9W/GPCW7Sn1Rs0EB\r\nGq9/Nx35jVoq7KBY1J3/FB6X/+lkXCyg/qlRwZAzoPdmdolD9F63oNwu7KFe\r\n7Euto4g2LV7kFWDElJhZw9frdIvRzPkchSYYzXyOPvrRr4K0dxNhBL9y9USp\r\ngMnleAURt7vBwgpYRA/++m1iW0B8MGGX+dVJ7u9sd2LR+qWeIy5J6FuAGUEV\r\nKnv34+MSqR2rU1P3uIQIQmwxbaglc7HqMi4qnlnGbFeMWEDvrl3BGcXVnIkI\r\n6Dr8p12DriRVsXiPkCEDj7q4nE5LJuzQNgObOCdxtTlR3z7blFIE+htM4VMZ\r\nKfn47kuQzEtYcva8btSwUTus8R14stAJU9umTGQEJFd6liyH1L/AvajubWqK\r\n5a6RKkP7jW0KRM/6oxnuA/DnQwQnHMFDpa0QxgxwIJoDnDQRfJtRRfYcYoQ2\r\nw35mItx7srl6MbyM53saJkR4ungL5pyLT3qngc7X/SFIr9C+EWDpAO+cB0xC\r\n4/DCVeYejnfOwf52MxTIQKrj/uo0RgH7Y5C9jq4uW5cfCz6mzIO9SopVrSlc\r\ncdv+5FNuv9aOVv1KWeO6yY13UTR9Ka9/DxwF549y78FOZCrA5r8XNBtSDhPq\r\nCbln50FNdfpXQqYBL7VPo2h6E4EJF074FrY=\r\n=3Pbc\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"3091b344799132cce493f92839da8e544fec7c05","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.1","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.168a629a4.0","@material/rtl":"15.0.0-canary.168a629a4.0","@material/base":"15.0.0-canary.168a629a4.0","@material/theme":"15.0.0-canary.168a629a4.0","@material/ripple":"15.0.0-canary.168a629a4.0","@material/tokens":"15.0.0-canary.168a629a4.0","@material/animation":"15.0.0-canary.168a629a4.0","@material/elevation":"15.0.0-canary.168a629a4.0","@material/typography":"15.0.0-canary.168a629a4.0","@material/feature-targeting":"15.0.0-canary.168a629a4.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.168a629a4.0_1669740598481_0.07388928978378018","host":"s3://npm-registry-packages"}},"15.0.0-canary.65c411674.0":{"name":"@material/slider","version":"15.0.0-canary.65c411674.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.65c411674.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"03095c3ae87327d627560975277a1fca43729c15","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.65c411674.0.tgz","fileCount":37,"integrity":"sha512-rwYfyI6Ocodz4+I4HCs8Ifk84XdYLSNxwnW26uu1FMQ1I0UpVw3hhDwxcL3nRy2dHIFEJbwAqwZB9o24syhOmQ==","signatures":[{"sig":"MEUCICeqgzXX1WHgHXdbNLwVNoM3M5BEvV1avclmDZs0M54nAiEAgLM99zuk50PQnH+wUd5Knuzb2H4V3UT7uaQ7SlWCSwQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":880075,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjhkPQACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrWzw/+JTC5+QvT8kBGSY1qmwo/oqo6C0O+g2WXdwpH4ikHm7nlDNBB\r\nqYACJ5GJpd6I/okeBHuHuzM5X9mnrgDlo9c/Geiy6UdTYhVBzoDNC9yQVZ46\r\nvJ7HZ3Ij4Ds2fNTfvCcavT4QSdsEMMHmOIC76FW2XtB7KYjoLLub/xWYFPwX\r\nzumKAgsQjSvWNglJqUSKFADxjovHO/CnBSpQO/juaCac+Ltl7qZwBw5QGJKc\r\nzr9M7YG8kccYG+5QFBmWXAgjPHlnOPRgwo4UAuJMLwiPcDL9phUxNjt7j0ml\r\nDvvijJd9mgplToxeu4rybnmPWohGJ2s4X8ksxWReEwqo7MtVlcZIhsO2qfoQ\r\nKlmSKGQd5kUzbB4NURWigd0Q0mQkPUMWVfdap9eDPHNzc0BAeGhUEy1UR5ZT\r\nuYEyYyv7c+WteojaD58gcjwTyuFZ5z26EBNZPZvmjxrP/QAwsexmRXG2dXZ7\r\nOvKQ7hBo7uY1C2zSe61l1YhjZek3+CulMvj7A5Dd4Y/U7hIPsnWh4wy55etl\r\nQeTS4GwgVvDoBytTGzssqaD7qm+t0fN474iIFTR0PmUnD98p92rD/TiH7gjq\r\nKbrVG09bhqUQXj78WcvekaKMD4KCGczdzRIsNejM+FAEfWx/No4JfkR+HxBg\r\n2dzt82oZgIVvO+f/7m5YOWn7DiMULi8SN4A=\r\n=mMwr\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"d80879a8c467caf0f52227ec97481bf5b7f2cb16","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.1","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.65c411674.0","@material/rtl":"15.0.0-canary.65c411674.0","@material/base":"15.0.0-canary.65c411674.0","@material/theme":"15.0.0-canary.65c411674.0","@material/ripple":"15.0.0-canary.65c411674.0","@material/tokens":"15.0.0-canary.65c411674.0","@material/animation":"15.0.0-canary.65c411674.0","@material/elevation":"15.0.0-canary.65c411674.0","@material/typography":"15.0.0-canary.65c411674.0","@material/feature-targeting":"15.0.0-canary.65c411674.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.65c411674.0_1669743568596_0.25692266288043797","host":"s3://npm-registry-packages"}},"15.0.0-canary.a86d36fd2.0":{"name":"@material/slider","version":"15.0.0-canary.a86d36fd2.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.a86d36fd2.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"7c18579cc45a95d4518abf30de3832db4539ad3a","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.a86d36fd2.0.tgz","fileCount":37,"integrity":"sha512-BCqsxs+1S2beUKHH4ufszkm37Oord3SHzGgLqnkyhydQxazgWH444oZ8TzSQVMW9eBPSkp/FXcpnVQyZiVJzVA==","signatures":[{"sig":"MEUCIEIKi7PoRVoqKwD6KVeESeW6v5do7difSFym6xU26ofTAiEA2H5GbhJA1Ik7kOAJTxepaVulSvkfhbWdIJY6ALHIWCk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":880075,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjhrysACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmp3vg/+JmrLzOBi8VC7XIRQGkRSgwDwJ732GfYOtWIWe6mqNtgXPjWS\r\ndDHdC/5lBALaavUnbwmqtHjAoY7fd4Ru7fCmZQd8xfkFA6CFkkHfvWmsysby\r\nnQfXvkVAkju6xoz1v4ckT+m47CWKI9WxTzLU4bskalADl6deU16s5L39p3R2\r\nyobuwtO4c49oZXkTfbOqkkWjCbFr9YrriVZ4UEfG1TYiIN9KfwsGQazwBlN7\r\ngpOM2R8ARWrA43Fg0Mq5+UBQ16RnuFfNGVHkIRizYTQshMIVFkJ6KyV8ZI3j\r\nOqI845VEXgss9w/lQqDaR3OYiVLOgsxPESMNy/B3YKnPnvq/aNIbO9LJdaVK\r\n8+5aStY9UDtCdbZSg2NjQ0AThQkYt8/bl6ph5xUoLCpoPUHVb7QhCa0E1hLt\r\nRKkAHdV2Gzs2EeszwH8cLupSdRtfFOs04HzSNsos5se3HVDJKsIv77630Ib0\r\nAD3FPRJM9QYYtjEhTIKVev7QmMfZkws3+fIBChKtL6NmjdKpizQHfibiwD9G\r\nDt2d+IcXluSk/Q2+KTf4bXiXWCQ+UQn6kz4ieVrJZVptltG9VLHikFKvzC1a\r\nmmdwfMCE19462qAMvU5C1If+ftV3Ze6ROLAZAAs3kC7kfNTj4tMqpPQ1bOd9\r\n1WSHjBYf7xxNKNZcgJc9foidFNkSn5fIefA=\r\n=gMEI\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"85d3ff6d42516ecc839fe336441543c8df62326b","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.1","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.a86d36fd2.0","@material/rtl":"15.0.0-canary.a86d36fd2.0","@material/base":"15.0.0-canary.a86d36fd2.0","@material/theme":"15.0.0-canary.a86d36fd2.0","@material/ripple":"15.0.0-canary.a86d36fd2.0","@material/tokens":"15.0.0-canary.a86d36fd2.0","@material/animation":"15.0.0-canary.a86d36fd2.0","@material/elevation":"15.0.0-canary.a86d36fd2.0","@material/typography":"15.0.0-canary.a86d36fd2.0","@material/feature-targeting":"15.0.0-canary.a86d36fd2.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.a86d36fd2.0_1669774508020_0.753438354605023","host":"s3://npm-registry-packages"}},"15.0.0-canary.3a1f46c66.0":{"name":"@material/slider","version":"15.0.0-canary.3a1f46c66.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.3a1f46c66.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"4902818138bb6ae7da01d517677664987d85bbb8","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.3a1f46c66.0.tgz","fileCount":37,"integrity":"sha512-cTImuHgKbbteUj7yxNqDvKIS+iJYfx4KWhOB2zrL5w2u47Xh30bcvKctzSo/s6mINzWE2qW5ejabu6h3kwxBVQ==","signatures":[{"sig":"MEUCIQCL6Dp8ERmCaiyPM+yJ8X67Tv6f5J/EbQKL2SLqSZSVLQIgOeqL5LunetReCxiNfFcom1m+7/oVGz2BIutMfS13p5I=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":880075,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjh0fCACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrAog//ZskJjhpZXeP1BMGLCqe94imVjh+306KS6TxV/fD28ytl/VPU\r\n/f6k2G2+NIaBr/BYp+AFjf4mYN9Z695eP8nlvagDPvaeN9vM/ll+mXKF37wt\r\n+z8opRHY3aEihlv/in939ZCo0U/US9xAaIIicBjynFiVQOPsBrSLPOwGm3xj\r\ny+HuijvRBZVRTTL+XBTMYTpurQZUaETVDjBq1uepq9DI7kU7RY0mqoUluRft\r\nxez3rIU+HUoh9GkLg6ZOQ5+FLhYE3iGtq0BuSeEgCuC4Op1+d0BJbAvkqckn\r\nCRK+iAeMdydDS62GBPVrbAjPJx+kmeX57WxyZon38yfzQKkSETZA6qrw8k6Q\r\nB3j5OeSVGPMJYYrPOqSQClxCEdlAFGxiOVruiSyiGu6cOui5aYtydQbJnzjI\r\nqZawN0G0i+xsFff7GEN9m6pqQfmGOVwfds5yTW4Xzai2CcOu8kTYJh0PNZYx\r\niBBkvG5rLPFmyxQiZVaH4i+lgPdArEC4hjToEOi2tvx07PXzHPSnbKYjRYRr\r\nJJeinNk+855NOmjHrCb/6ApggguXghd9Bb4ItfiVKEYWTibJZEF/9DH4lZjm\r\nGUdlFJGiJrnUYDqHR0ZuppZ//5O2Sib7Vk+sNrdCbcqDGzBMb/cEOkDX5VoL\r\n6kZ+ZSrCAds0/HP8SkMct6CpikPwZhk3Iac=\r\n=9nAE\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"c3f9c47a1b8fbcf554e1fce6da44837b6d412e2f","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.1","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.3a1f46c66.0","@material/rtl":"15.0.0-canary.3a1f46c66.0","@material/base":"15.0.0-canary.3a1f46c66.0","@material/theme":"15.0.0-canary.3a1f46c66.0","@material/ripple":"15.0.0-canary.3a1f46c66.0","@material/tokens":"15.0.0-canary.3a1f46c66.0","@material/animation":"15.0.0-canary.3a1f46c66.0","@material/elevation":"15.0.0-canary.3a1f46c66.0","@material/typography":"15.0.0-canary.3a1f46c66.0","@material/feature-targeting":"15.0.0-canary.3a1f46c66.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.3a1f46c66.0_1669810114446_0.931279218085374","host":"s3://npm-registry-packages"}},"15.0.0-canary.32d8a9648.0":{"name":"@material/slider","version":"15.0.0-canary.32d8a9648.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.32d8a9648.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"17cd46952d788d1c03c09a5b245867d88079625d","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.32d8a9648.0.tgz","fileCount":37,"integrity":"sha512-hJUhLt2SIpACY0d9Mpn5hkgYDcM97oqnzoScCGTYC6+CeDGGXipiV4iRrpqB5JTEwAQ0lHrKQqkS70byMBBJJw==","signatures":[{"sig":"MEUCIQD1tQZ+FjmdCsAoVF8LY/d69EWT17hjwa4MGyzaFtTf2AIgV4ddLDPFUrdDWF+U8Z1bkpfoJWq6Vh/AvfkV1KzrQK8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":880075,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjiOSgACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmokcg/7BYy1dyLyJcSmOoGWKuTi6EZpc6iYm0b85v4LbDyUQbjajiZR\r\njHzAQkNW5t6qLkq/p72CkWJQG1Autq7pKHOj2fDVsp8sI+akvo/SJHjHFVNi\r\nRLJfUHR4JW9mG98lcITMRjqgllBW6A3WpdEzxXAGyxr+L0in5Q/ONk9TbfIW\r\nNkyLUdrlwOrPRqqaeZsxJy+Iz+Rm3HXzmQRCXLRGrPSVEb3XKcTulLlt4fIz\r\ninfEXF+g+Q89toxuPAmyoDy1nmcbyS3qekA0zzitbjJlwKWB7zFnyP7CssF5\r\niB1PEY5J0EpQSlSFGvQMcNcXdUHnKa76nU5aiyH5ZGHWoMiaJlnLdrd7/tKo\r\npCnZc58UIVkylN+EgdSZj8kUyvukTTBaahM+GTF1bMA6pweRueSo4y7/Bci5\r\nD+HK8U195FAznTlI5kydyIUer+kNgyp4l4SIJyGuYIo2AFlpcM6qMSuA7YSA\r\n/BOeqaknDzqbWmMvvKGq+DtOhS2FSRJ25gOdKjss0ugxCbzQmvtkF9Em5mVS\r\nlmwjkOODFK70wSvjD6V1jtef7UCZ9Yg/s/C6i02UGrtmKQcnlcTcnXXy+ugT\r\nPEb8QjiYP5A5iPsiwO437rtWsWx5or1jS3QduklQT0W2T01OeBYIc5LeD7DL\r\nw62oWfoovtStC4XZWfLNCHoKC5lpNwZxGw8=\r\n=d8M4\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"5833a540d2f362be3d86a707323bbeb6cee2c627","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.1","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.32d8a9648.0","@material/rtl":"15.0.0-canary.32d8a9648.0","@material/base":"15.0.0-canary.32d8a9648.0","@material/theme":"15.0.0-canary.32d8a9648.0","@material/ripple":"15.0.0-canary.32d8a9648.0","@material/tokens":"15.0.0-canary.32d8a9648.0","@material/animation":"15.0.0-canary.32d8a9648.0","@material/elevation":"15.0.0-canary.32d8a9648.0","@material/typography":"15.0.0-canary.32d8a9648.0","@material/feature-targeting":"15.0.0-canary.32d8a9648.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.32d8a9648.0_1669915808674_0.04114998185261576","host":"s3://npm-registry-packages"}},"15.0.0-canary.03618ab70.0":{"name":"@material/slider","version":"15.0.0-canary.03618ab70.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.03618ab70.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"c29b06da5c3885e871fef184956a25a5f7346e42","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.03618ab70.0.tgz","fileCount":37,"integrity":"sha512-hopMfuHeo6qJRA/lf7hsMAhCIaJw0RZpQoE6aBeaUN5mZZeEW/mKCULIj4di8ElebtkmCoBkyWOreq/MFb5OpA==","signatures":[{"sig":"MEUCIQC9zVxfqY+aiL8kzzdarI0vF+vOkM5ikm0lhVma2Umd4wIgapiXcKfLvvI/EfB9biSiFLxLmXpw1tkRNjQO0eCTVvA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":880075,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjiRS3ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpMwhAAnA/Mq1nGoU+/vb7S0df5QojyhVVJfpNuA2EAPZA2C0UR54kc\r\nBJVW9kzXMRMkoXej6uE7erBapzBGcSISd/xYB8AMhCuyW5C55mXZhZtYmS0o\r\nW5rMymsRVIAPuUBgUpjfdFu5voVBj2vlkxi9dHeCzfloPrGWQU1WBM9hpsnv\r\nuvmmo3DRw1wEcjn9Yh9HWdWTxl60D1A/n530cMNh2cAE31WOnrrhvzGmWcWU\r\nBOQ5+DPJ0IKmklPT/N9vrBRORZxnJEuYToin1ofSw7xiPNpTpjsDPNiC6TDk\r\nC2RHZcsrGuM/jHiwTD9Fa5XV5O/rRQYpUJv3rdQz0MZMtwxE28RBbPsvQTk4\r\nhGw0CO3uN1w68quFBbDJQZb1DfhzOskmNOiga6Zm6h84PdYdBgAz7o49mP/e\r\n4BQ/hN8cM3qjXBQRATLvf1OmnmbvrA2ffok0c2gG9S4bATFKh2jiA7assKgU\r\ni4Ci24h0STSxMe7TQsSr512fAYhTH9iawKGU9b5WlYWmX6Tzkf0f4ndPxxKC\r\nBBgNblLSp3EBX0D0j4AlNNo0zozXWMC0EQ9FhfPtKBFaXBnoHue+TaEtqQTM\r\nXX/j0UaOnKskPE+nXkmDGPZwDWgBndVb5j7Rbj5/nWapghqJewYovrhHtYLX\r\nh+mwuj1L44VYhFyMGdifEfr/PjxcUHD+Za0=\r\n=Pgg2\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"b7755627c14a2cf095b6ee87d1ad15c14430ebad","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.1","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.03618ab70.0","@material/rtl":"15.0.0-canary.03618ab70.0","@material/base":"15.0.0-canary.03618ab70.0","@material/theme":"15.0.0-canary.03618ab70.0","@material/ripple":"15.0.0-canary.03618ab70.0","@material/tokens":"15.0.0-canary.03618ab70.0","@material/animation":"15.0.0-canary.03618ab70.0","@material/elevation":"15.0.0-canary.03618ab70.0","@material/typography":"15.0.0-canary.03618ab70.0","@material/feature-targeting":"15.0.0-canary.03618ab70.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.03618ab70.0_1669928118777_0.8953510329299124","host":"s3://npm-registry-packages"}},"15.0.0-canary.68aaed940.0":{"name":"@material/slider","version":"15.0.0-canary.68aaed940.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.68aaed940.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"d9d37be524147b79be8eac27d26611ef3e943ec3","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.68aaed940.0.tgz","fileCount":37,"integrity":"sha512-WWHQDFiYvwG6h2ykP5l/57kClZviFgmss8+5gXNQFf9opeXAi7emJnJXPRfpX6OB9IAUY/yCsK8SdvYCb0b3LA==","signatures":[{"sig":"MEUCIFax9u1zqfB593eJ/KHAApKT9tybnDx7VtjkJCSMmx+AAiEA6S2SLX6m+H0DyXdGJPKjhRwHT+rYY2+eQ1LI4Do9YH0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":880075,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjiRuwACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq4IA/9GEwjSrPHW6DO07qMxfLvk+xAyeP8T3BSx+aRBNqjNJH4q2Vm\r\n3NetuDRq6SsrEkcGlb7OuF04lhT1nqJiuq3SshkrDuSAWJCnX6MAM9eH1kCl\r\nDSvnF0yRhua2GWXnJ+Ho1M1feEw1vGgQHkCv+52J/dPHWdkgyadOd8RQ63J7\r\nSUD8T4EMQBUlYLi7eV1QjC8ePvm67yYokWRlCWrkuYtrhTwhDduFFjlsullY\r\noXQth6VD3sEATUoEIOP6O709J79/ousMWSSOl9ShqTiZ6D0uxsRld2lCk2gy\r\nVSLdgkedqoX0ZNmSU0s1Lk/myWzGMxToJxb4JyEbpLm/9A+UQ2goSpQGh7vS\r\nqX3dlOF3EwpraKHt6EHboS1J5NQFgK6aL+85SfHAdmjydtrgm/th+BzFmAIa\r\nCDeZvgoPgtfcaF8mHgu6sqcsjQDvHGy1k5ItyX5f4Y58/A1X4NNdJeULl7Rg\r\n+cgOtjLTbtLvohfWM2C6r6XEWMSCrNeN/pGnwpAEniG6yD8D5uZD91Nzrj4k\r\nfsXXMWp0sc39GbPRIqIC5gzXIZGOy1cNAKLBkbANuF3PZmQqL4us+Ks8Kjbq\r\ndUwAO0NrxNtUJ0AtzjDhGmKtwTnfK1w9ILk152R+yYu12pmvAHvdnJLmvUY2\r\n0UkeTQO5j0e4Agl42okD482gD2p+eQ7qhkU=\r\n=TK1h\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"6092c4f3bcdf41ae7f55d37c6ad51793eb8f040d","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.1","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.68aaed940.0","@material/rtl":"15.0.0-canary.68aaed940.0","@material/base":"15.0.0-canary.68aaed940.0","@material/theme":"15.0.0-canary.68aaed940.0","@material/ripple":"15.0.0-canary.68aaed940.0","@material/tokens":"15.0.0-canary.68aaed940.0","@material/animation":"15.0.0-canary.68aaed940.0","@material/elevation":"15.0.0-canary.68aaed940.0","@material/typography":"15.0.0-canary.68aaed940.0","@material/feature-targeting":"15.0.0-canary.68aaed940.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.68aaed940.0_1669929903948_0.066773790202026","host":"s3://npm-registry-packages"}},"15.0.0-canary.f0a0bbc75.0":{"name":"@material/slider","version":"15.0.0-canary.f0a0bbc75.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.f0a0bbc75.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"01a511e36f1e5d5ab6d0956e55b2522f51b6e433","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.f0a0bbc75.0.tgz","fileCount":37,"integrity":"sha512-sxIQRTe9Rie2YHiagzriuN1QC39Df5dtH2RVeR+5DrW8KZv30IdcfMGb17wJMrAa6Mk5I2VGzP2SxDkosS5IzA==","signatures":[{"sig":"MEUCIAKwpnVnl1Fws2kBaBWYmLc/Lj9xSgbFDm/XRSjnkADgAiEAnXScSo9Ey/H5T2kueVpzdwaEMDdvB7WWG75d8HsrPUs=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":880075,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjib8yACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmonAg/+M+IW5mG52QgjkH7GzfKSUjmTXi8hgOBPvfH9kZBZLF6u727L\r\nLNCfLtAhMXXOvZcD8e4eWxUS0pU1brI0IQtjJhseoWHNiSD7NAvXwuVRYAO9\r\n8NbfPX8MpPQNjD8rkZMPO9On2ClIkjfpZPcPuLe+JFGimvz5Bm1p0QwNoz27\r\nipfQtvj9CSRgfpGxQzffR1YMi9A+HLTVR93ePQfRw1sw8EgZpQuQc6TIG4Ft\r\nqbrSpxyCOUiGJzWG/opXck/0Gucb7HrO8BQqpDzFhZ+WBIVsGNt0CbBYa4+y\r\ns4bGY2jMSWBppUSXE6IbeloNiRhMvUWLBlZqiqfSgCmByezRbbO3vy+tQZ7g\r\nJ6Gg4kB2lW41Wxrjjy29gBF2Sv97l2q3CSKDlwt47lXRVfOUo5mckDzETPkJ\r\nX30bo0+lo1/1uaA/mMC0UPj6nEncA3cx8LvsMwJk/aQMmsJyL0CAzZiSss0Y\r\njxe28aZS189Rz3uQngo6ioeU3cQU0G41gz3dGmu+A8GR2BkgGqMsairPal4X\r\nGsdnsb8QwY4NCdEEly7vr+US0Rt1zwV3prTvFZMvKJl8LMFmDNcKdfm+GuLe\r\nkIEjkDZbY0gfzZgyHwbTlFwMPUHpIMW2qD6s5ZWyw676y5nxwP/Eo2l4k5MS\r\nMF4AR0pzC2VnsOBIUP0g0YGpkrjT9pJSSNA=\r\n=Yvji\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"5111125522be9e3847929d9bbaf323f31e9057c9","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.1","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.f0a0bbc75.0","@material/rtl":"15.0.0-canary.f0a0bbc75.0","@material/base":"15.0.0-canary.f0a0bbc75.0","@material/theme":"15.0.0-canary.f0a0bbc75.0","@material/ripple":"15.0.0-canary.f0a0bbc75.0","@material/tokens":"15.0.0-canary.f0a0bbc75.0","@material/animation":"15.0.0-canary.f0a0bbc75.0","@material/elevation":"15.0.0-canary.f0a0bbc75.0","@material/typography":"15.0.0-canary.f0a0bbc75.0","@material/feature-targeting":"15.0.0-canary.f0a0bbc75.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.f0a0bbc75.0_1669971762267_0.15609769072033353","host":"s3://npm-registry-packages"}},"15.0.0-canary.dd99c8764.0":{"name":"@material/slider","version":"15.0.0-canary.dd99c8764.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.dd99c8764.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"0990732f7acf41a4366a01dbae958b255a557012","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.dd99c8764.0.tgz","fileCount":37,"integrity":"sha512-76uZiRUe2j5fv0ER1/llrKe/NzkWtpqDonLTR38V1wFVJcXNpMjJhx7mAgpgsIto0DEIFJouvUyGc1YcITuKfQ==","signatures":[{"sig":"MEUCIQCRDrCrdnCTkivZkMEU/NmByfIqUG2nZifW9pTEflvC6gIgIfyzDZOE4qd8fIHR7q7spHdg943Us357a4dpREwz2mg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":880075,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjigVVACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoCDxAAh0AhQ7IxbvCAc6ijywHwRHV5xsxMmCkvOfCNg2uPNvDu+Tq8\r\nwcob89Nbxt7LQIdOUrfA7qlQHAvmZAyRiazSxRal+FeHppmu+mgY6lTaXHWH\r\n1lLjU8HH/BOjYkopOuYomdYcHHVbh9KKThVIR/iGUUFNWcWuCVhSo+7di9aO\r\n2Bg9MeSpRhrClM31Yllp9EHl4lgaMUSVA1A8tpTShbB4L/FpTGYyJdx1FpBm\r\nhY96B9ycZVJQPnCatsdGdc4xyp/NHlZN+y5VSSAQSnB6Ynng3UGkuagtUAVA\r\nOaUweXnnIiGzudVulvSCQs2ArYBoj6+nqziqT6Tx5CQSTCdvjxsGutwutBVD\r\nCIQnqWVT+SJdcHLuaAmF6hNMb4loBv1Fq+2Wcwel5B7zxNIYZyBnJMzUAlEr\r\nbMfinH7VracPh8ARCqpHHPTkJHSXQgl8N9Ex7i37stwppj+Tnc3dtg8dx2fX\r\n961Pfl6JmzhCbDJhiozHS98xfdri/L9pZadDA/LHcLUiy3gGTPcPYb2FiIk8\r\nDSycLHMFJC+e9jNq5D9cUEx9xmB0gmFOthkBWTSqZ6jY2lOtCA1lzw9zYkoK\r\nTs6Z8SnuIYRtunWWaY5SUNGv4wxH9+4ma4SLVn6RqlGZY12e3NOYyJXd4zF7\r\nDYXYUhXkjZVhJ9DgeBfmIRtp3hQgzQ8ki7g=\r\n=MQaA\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"a9ff7973c7dab53b620d5be8d56e0c491cc5e7ed","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.1","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.dd99c8764.0","@material/rtl":"15.0.0-canary.dd99c8764.0","@material/base":"15.0.0-canary.dd99c8764.0","@material/theme":"15.0.0-canary.dd99c8764.0","@material/ripple":"15.0.0-canary.dd99c8764.0","@material/tokens":"15.0.0-canary.dd99c8764.0","@material/animation":"15.0.0-canary.dd99c8764.0","@material/elevation":"15.0.0-canary.dd99c8764.0","@material/typography":"15.0.0-canary.dd99c8764.0","@material/feature-targeting":"15.0.0-canary.dd99c8764.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.dd99c8764.0_1669989716737_0.055439167893931884","host":"s3://npm-registry-packages"}},"15.0.0-canary.fabdcca3a.0":{"name":"@material/slider","version":"15.0.0-canary.fabdcca3a.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.fabdcca3a.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"d5ef9dd73340a749d59b2dcb5fdbe7f96553fab9","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.fabdcca3a.0.tgz","fileCount":37,"integrity":"sha512-yMHfnLCMGND9zt3sI1WmvUmr6MCXdVrtzTUpepnA5WS5/nIFcIEHpVHadSAmunB4Zdqb1cXUR8obDMavzzNQsg==","signatures":[{"sig":"MEYCIQC1/a5nRwh8aUt+5Z6UsR/eXheMNEuxoqrcpFEwCkIV9wIhAIxq6KGiEeGu924rSURlK/KiS23GPwIAgYqTLhwm7E+p","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":880075,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjihTDACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpXmg//e/FT4+2h0yK8ivES+5bbi7UJxUVC/hQJrt0S9oURnEV1Mywg\r\nuPiF1qv8wkmYls/L+G6gwSQiOaD578cwIzirpsIn595NgVa4bux7SzevrVnw\r\nBimQKQUkBVlGU0tfR/S/tROTVE+efI6jnW9t9+ZZbFieMB8u5tyKYd7D8i23\r\nxKfn1vuNKEbE3q0moPVCdpizq/YkbbymLoGia295WNfeCKYNCmbvL7u6o7yM\r\nB4gakWZqat/WRbR+YcxSNbpkgXZZ3TYiGYm7lRkPXwkoORj3GrgomN58QXPC\r\n6Ko6qdBuzEU9qb3e/3DBGN/skq6NqtprmIvv8yNqQ12yZw2zscSpV1GRKs9F\r\nzODRutSqS/CiU+xCnv0GKwcWCX83LneMNx1ZL6pMd2sH7wjqeenE4MYWXe/j\r\nVarZgOXs+DdLXSwcjr3+7Q/iXoAGz403T0pS7X//pnKDuzP2Mk9iR+7Ufa77\r\noQyXQie74NT0/H0o/CU+i/V1PU8D+6DLqdpD7twpn6SfyYpV2xUfgxfGXMzN\r\nPK+jkEF5XmUDePUDraExVlZ8i4nUbMnwXOR6n2rDnzmuFOLOEenLdI0LjIIs\r\ngBqD0O1qcfAZNNERlmhGCiHishkf6s5vDz6i59kkttmSGiQIkY+Htw6NCIjY\r\ncMKHeBXy5g5oe9T6mv66ONWEplEEl2gR1os=\r\n=Yl5U\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"18ea36a1261419acae3218fc917dab4ca111bb9d","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.1","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.fabdcca3a.0","@material/rtl":"15.0.0-canary.fabdcca3a.0","@material/base":"15.0.0-canary.fabdcca3a.0","@material/theme":"15.0.0-canary.fabdcca3a.0","@material/ripple":"15.0.0-canary.fabdcca3a.0","@material/tokens":"15.0.0-canary.fabdcca3a.0","@material/animation":"15.0.0-canary.fabdcca3a.0","@material/elevation":"15.0.0-canary.fabdcca3a.0","@material/typography":"15.0.0-canary.fabdcca3a.0","@material/feature-targeting":"15.0.0-canary.fabdcca3a.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.fabdcca3a.0_1669993667580_0.05285832209182084","host":"s3://npm-registry-packages"}},"15.0.0-canary.2d26722d2.0":{"name":"@material/slider","version":"15.0.0-canary.2d26722d2.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.2d26722d2.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"da1b35f859627fd0f080da68ccc9a08b52ba3f73","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.2d26722d2.0.tgz","fileCount":37,"integrity":"sha512-wliO3mlSJTylINHa+0Bw6ldZYf4m7dvPXmSJgBiztqAWrSGTmuvuVuEWv9KPhIw4APlZYW9uwz5dlhehbWTaXg==","signatures":[{"sig":"MEUCIQCyPN/kvi9vYaDo7gyuwi4i0tIDB/0hIQHcEA1m4ZWzzAIgb9ZMmXMtSmJ6HEzQ4W648UahhF5G0Vkh/YSlaQ9jv5s=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":880075,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjiid0ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqNBBAAkhlddjv4YeSkQ2uKNU/xT6qTq4HXD9olKaCDw2H43k81l4VE\r\n1xke5nl4Jl1i+3Kc1LQ9t778b/DBca9LgKgY8G0mM+N3sUVTO1do4HZfGHG7\r\nfH7rpyMZZUItru0j3iUoCqYYcWs28w89thxHd+T2Xmzf9F90oCxOpmX4/i7+\r\npp3QGpDwR0w5Rf7Rv+RSqKYevPtWVDTgU1ZTxk6wyA4tX7vawHUvbfVt3PlN\r\nRgCI5wGo5TWonOmWYPA0ZduqyWEwgCJUDZaIzerUVpk8AX7AQy020lXY++ac\r\npEl2GSWk12qn3nfXalC/ExTtPlMvVSu5IuY86A5LpqoWIiOVQMsoSLaR7lzv\r\nK3NCtVMRGYPugwz1VGNf2v7FCFx21BUqHRDNfoFzB48DuQR1WymKyZNVpxAI\r\npoRLZ8Cr7NFPs0QmAMgT+TL0+xFJ+MkAW7bgIn1BV9AthWuAZKCjvopTqfY7\r\n03W8MjbS8Mfyiw1wps4fobfNt5oTOyzrBqiRbRUPbP4cx7E9Yebg4L7wQ7xp\r\nHuBRt7OqGggXQ9TDS8cwlZECeXR/GAr3HiBmvtJs1Nym8D+x1efm7/NSQHtV\r\nJpWSpvOA/aWKcjC88IleFkEj9+VQtIqqE+4MZ7LfKp+ToYWBVJM/lIrfnOaf\r\nkoeUCkcR7dmgVr2oRnv92iQ8dFHVw3ZRzCA=\r\n=jOZd\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"76df2659d7f71f74a86512b38245422ca356fe12","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.1","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.2d26722d2.0","@material/rtl":"15.0.0-canary.2d26722d2.0","@material/base":"15.0.0-canary.2d26722d2.0","@material/theme":"15.0.0-canary.2d26722d2.0","@material/ripple":"15.0.0-canary.2d26722d2.0","@material/tokens":"15.0.0-canary.2d26722d2.0","@material/animation":"15.0.0-canary.2d26722d2.0","@material/elevation":"15.0.0-canary.2d26722d2.0","@material/typography":"15.0.0-canary.2d26722d2.0","@material/feature-targeting":"15.0.0-canary.2d26722d2.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.2d26722d2.0_1669998451949_0.5156137407735415","host":"s3://npm-registry-packages"}},"15.0.0-canary.eaa0c3a86.0":{"name":"@material/slider","version":"15.0.0-canary.eaa0c3a86.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.eaa0c3a86.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"cff526551e99798c95e796bc2ca3911717477c0a","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.eaa0c3a86.0.tgz","fileCount":37,"integrity":"sha512-t2+rkC6FvtEZBQoTSCbAheVYLRaLCelPM80fP86K9XYN4K96EZ2Kn9tV8VQHNvfzoeni3eSjlcOhkDTWoTV9HQ==","signatures":[{"sig":"MEUCIQDoOh4UetTON7zqgj2B4rC8fM+a8LONkZ7F2rqz7yAvjAIgDd/8cKTnLbfQ3RtpCSfb1VbbzhBX98SxSoKj9Kk9Fs0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":880075,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjijlIACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmo05Q/+Piv2C9YAGkEEWzq78y4lxQrhNwRjO4Wwp9xj0SX3G453eK79\r\n9JWQ59aoUIyukIq5tBWMBs79qRvHKVXVjNarOq+r9bypuh+qZttZwysxuxbx\r\nQQGbxHnWFFjjHLB/frPSQwd5E+VF5X9DbVbKmwg5Ff8Q3jjoN/vDfwIGpZFQ\r\noyj9pi2ACmU/a2mAJGQn3wFDZD1oWCwZ4+4y821E9MA5DbO0Y6SlnYNQVLtj\r\nulr2nt8A3fQl6KjK/+7t1X45Sa6vq3c5MHNrKDBxYuC54TMhZ6rq97dc+rsq\r\nSxIcBMGczDHvyxu00bunpN8v4/VCZTTRWG4qIv5I77Ty5D8GIoyFModGnLWn\r\nyTQ2CXuxvnj6sqxiISMDVDG9L0nIUWXax3bZBdgqrLoRS8gED+5STjrr1hm+\r\nzRAJ9m+tMefxpM/IXmpSSk3fNWp2CIZPB5oz1zoavdRhzTa/KomAz8hBH4/c\r\nGvSn50Zwu8DH6dP+3r84+b9w//ECKME4tWTrcIUNWxb7GEYVZmdnA8CkQcVc\r\nvLrc+iH5V/gyg0HHrQ64D7ZeDRNZDt9B1Wq1cQeAl2bwCGITc53tD8SumPl6\r\nRlARW9bNeYLAk+7RFr2DYgf6HhcgmRU+dYEIr38rvBtzx/cgYSIUY1zv26Sx\r\n/Ru18pQVsfTFDspua0+dFjU4bAa+Qne0ZQ0=\r\n=rArm\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"c54316c7c60bacf8254758124c9235dc48d44064","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.1","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.eaa0c3a86.0","@material/rtl":"15.0.0-canary.eaa0c3a86.0","@material/base":"15.0.0-canary.eaa0c3a86.0","@material/theme":"15.0.0-canary.eaa0c3a86.0","@material/ripple":"15.0.0-canary.eaa0c3a86.0","@material/tokens":"15.0.0-canary.eaa0c3a86.0","@material/animation":"15.0.0-canary.eaa0c3a86.0","@material/elevation":"15.0.0-canary.eaa0c3a86.0","@material/typography":"15.0.0-canary.eaa0c3a86.0","@material/feature-targeting":"15.0.0-canary.eaa0c3a86.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.eaa0c3a86.0_1670003015722_0.6765485008321002","host":"s3://npm-registry-packages"}},"15.0.0-canary.79a613bbd.0":{"name":"@material/slider","version":"15.0.0-canary.79a613bbd.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.79a613bbd.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"4eaab6cfc6b93f9bacdd6469048d5856f1fe0785","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.79a613bbd.0.tgz","fileCount":37,"integrity":"sha512-VrcHtBGee/NvqovgZo6OhusJXLM8u3+bYtI8UprdC9XqO5raD3da6iETlG+DimSlnsflTRHoyupWpt1aeQeL0g==","signatures":[{"sig":"MEQCIGETheyCpdm7EZIOp44tbW07P/ZzYpYHvwbwkjOfn7I2AiAF/UXeGsY1lmEaqWI0A8vQSa6v/GxsYdNbCNRxkoRJmA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":880075,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjj1EdACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmo6Sg//cVOYsVrBBNm0cIz0eb3q8svqK8GlHhb7zjVJa2PbOutvar+j\r\nfN2GVz7WNgrlNM2BkuRI5i0tymxs79/PYrMenLDA2UvrD2urs7y1t9r6k172\r\nA/CL4TsGfr6oEzBd3wNUUY79iTL0cMD4BiF9O0WFhZ7l31eBH/uVq4RT8QiF\r\nRdARh4JClDNZlnXjYixdAVO8NKjMd+DvFoXpo+wR6Yrgrh0JtfMRkGI8GWVU\r\n/NOp0XiHkA6LgXXlSJ/0EF+yIyhZnqL+Qmf2a8eYNpnLpNbIOC+XroAOBEEF\r\nv5UiTv8VI4IWaxS8qKTpZImXAZoMS8fHW/quEUugfgSmWV7b0w3kHNZox+Yy\r\nQ0uHKPPnjQWVthSeovXHhWffH6Ibr6ONaaKo2Ac+8JqMVp4kwW0UsGNSDA4i\r\nTBsQeIuItz3+Zk9qKsDtuDhJy/Mmu24zgM6DI9arHuiRJR4iDLA3jryGoGST\r\ndIAF37dZP8m5FwIqcBJ8UdcCWmmijyRwakFSe9KqULDF4T9LWOdvxGSkXAkp\r\nfAx7duTvdR9LQKfHerjyK2/NnxsMHmXBNY9gwWMkVlnSLNDsyauRtkN1KTeJ\r\nRXJzP3RkVeqbnMWWDyaB6DXIfKxvixdnWjj/Ts1p6RgMDz8HMxhcmcAZYWlJ\r\n3TkmJwRnzdlWW5PVlJwmOhgkIqDra6HbtSM=\r\n=Iitk\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"755ec1ef0b2cccdcb0c8b888d199b4748e3ba10a","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.1","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.79a613bbd.0","@material/rtl":"15.0.0-canary.79a613bbd.0","@material/base":"15.0.0-canary.79a613bbd.0","@material/theme":"15.0.0-canary.79a613bbd.0","@material/ripple":"15.0.0-canary.79a613bbd.0","@material/tokens":"15.0.0-canary.79a613bbd.0","@material/animation":"15.0.0-canary.79a613bbd.0","@material/elevation":"15.0.0-canary.79a613bbd.0","@material/typography":"15.0.0-canary.79a613bbd.0","@material/feature-targeting":"15.0.0-canary.79a613bbd.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.79a613bbd.0_1670336797169_0.598070539543631","host":"s3://npm-registry-packages"}},"15.0.0-canary.c871fe61e.0":{"name":"@material/slider","version":"15.0.0-canary.c871fe61e.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.c871fe61e.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"8296515c1306d9ee91509475ef5f47abcd99369f","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.c871fe61e.0.tgz","fileCount":37,"integrity":"sha512-8oaIRF5OHA8XOiDtXahbL+67gpfjBGCHUzwmR34TMzYFNJFSheiriWz5pyYdtZpvbNX4106IYrB+I6Qg80CTwA==","signatures":[{"sig":"MEYCIQD+ke+SlVRmNov9ciQxKvrJUYLabNTdSL8BDPCLRLs+JgIhANDPlbcRmW9tCL7qDLXb/B5h7sJg5BHeAphEZqNHs2fs","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":880075,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjkEZQACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmpv9A//bm9GEMxBWyU1bCUmRyXFxuvOZ2eVsGy1FgWk7lWKpr00Vu7d\r\nMHHx1omfkeB2rcSZ2s6p9s1uAIXK9IaEUTUlJwH5vOOOtwf98YH9JY/2pui9\r\nQ0qa8s/rxwEpt6XOBquODtn1ZxPp4yQCYLByGTuQ7b87UNa53JqIfbd23e8J\r\nU37U3UP30HsOVCxWFBo5UFivAK/CTE7ShCKuy1u3fcukEPYoPVh/Y5qDSlDV\r\nm863Hxkh4WC7d8+D2W+urg1kHN10tXKNysfLGrUXbw54S/DpJV5fIKkiw59j\r\nwzK8RmBbUDkkbS9do0oktSiKOpdoAC2z+2UCm1PGS3nPfX6gM20HJBjqD6T0\r\nA4baiaB9HG/KuZB8xQfrj6BfN0F6bu6IWrTJhWfaPyppbC3xeVz6hCvDjiFk\r\nkcT0qxZF9qgMnKjO11x/Gh0+Ye9rIAu7gd7hLt7S9nGw9MmbVIlEOmnf79kR\r\ngO/Cnh30AH/Tle+HD1gw8oEGM/0GIE74Oj3j0OWSqK4jt8vVDygAqE0Lqczo\r\nxtU6EcDZGB1prTGkajyhmuEESnxUMDK87JfBgGXKQYAQtP6XetJEb+4Rv5W+\r\nxu0bOHC+eeKUycAHHPA6mihaUXqLeI5k2b0anSDQr07vDqgHFSd/RMzWaDbd\r\ndONtNrsIPG6mR2nV7QEeJqbL3h6MgjevrWY=\r\n=286+\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"e69be4936d1304c30ff7b83af8488b43c0ad5fef","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.1","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.c871fe61e.0","@material/rtl":"15.0.0-canary.c871fe61e.0","@material/base":"15.0.0-canary.c871fe61e.0","@material/theme":"15.0.0-canary.c871fe61e.0","@material/ripple":"15.0.0-canary.c871fe61e.0","@material/tokens":"15.0.0-canary.c871fe61e.0","@material/animation":"15.0.0-canary.c871fe61e.0","@material/elevation":"15.0.0-canary.c871fe61e.0","@material/typography":"15.0.0-canary.c871fe61e.0","@material/feature-targeting":"15.0.0-canary.c871fe61e.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.c871fe61e.0_1670399567803_0.392710124517494","host":"s3://npm-registry-packages"}},"15.0.0-canary.9eaee7936.0":{"name":"@material/slider","version":"15.0.0-canary.9eaee7936.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.9eaee7936.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"b5c5ce17d35412491e66dc6608c485de52aeb09d","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.9eaee7936.0.tgz","fileCount":37,"integrity":"sha512-4EcczTXgPusaBk/BePaRcRzjJvQPnJ67NVv1UaGeXCIwinKHnTGnN5mGiMUN9tbCY2OYIbDSye8nMoEougpRGw==","signatures":[{"sig":"MEQCICW76ybCtgDY/VC2tFUUZW1EYtxtypT2oNmsIJB3aD7vAiBeCKBhloD+neyoo91SxpxiLFTTy53FmpKL9fWcDeZZ9Q==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":880075,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjkPGtACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrRPA//ftbT18q4Puj+cuO6mX/D3XiPER+7pIdtiUIyVuUpY/XvhmSb\r\nhiaXi0RagRu3PrWIU+OaSUJMwwNW38IOkNyoCkoEEWFPkZ3uOwY+HWJElRZ+\r\nQk7B/VAhTki8qosnLAsOlTWTaGQxdmT47LJs0O8pnDCPYVCKVyzIIDHK7fyk\r\nI6lg5SI72a43YSXsxQO3DAvYD+ZTDFXx0ScvvEEjFOJh2Q2hBQgfJIl9HIJI\r\npLYg2tzH7YrM94GbWsKfnqYvh7kNYmmX1XgOgyzibg5FPmgRk4V1k6EVZXN9\r\nXZEM+pqRuAGdWRPgST0gLuS4+MEW8vCsx8qUtwsZ6flx284ONQfdLw8ORpkR\r\nf+Ad19hUCZxVDUY0pqxkKn9Sv5QcsoGBJL+UvkbEYfZ0Ugb+j34vbBfW++Rv\r\np/C8TCw2wkLoLS86SLcPTc2Bcx4QVvkM1zDZ+T/O38Tl6/EF/+r9R44aQfiX\r\nZFoeFsb9faM4FIJjwhCGO+Hc6S5lLu3fPaKIUhHKDfH6NuXqphpoCb0/6WaY\r\ne951LcBMtLi9MRdVN780Zy3kKFCE/dkmfRuUbhsgmIDjUzMlqBGSeoioZRWA\r\nmU2B7iC5j5igFxWPFE2tC6pA/Bk2SJxMMVutexX9EWWXR+S0ztfa4cKyujnv\r\nYhrovjApEnAsrVrZB8+wwW+zmf01E/2UlgY=\r\n=P+o+\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"b1b576e68a716d1a80dcdbde7a572c11ca937fef","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.1","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.9eaee7936.0","@material/rtl":"15.0.0-canary.9eaee7936.0","@material/base":"15.0.0-canary.9eaee7936.0","@material/theme":"15.0.0-canary.9eaee7936.0","@material/ripple":"15.0.0-canary.9eaee7936.0","@material/tokens":"15.0.0-canary.9eaee7936.0","@material/animation":"15.0.0-canary.9eaee7936.0","@material/elevation":"15.0.0-canary.9eaee7936.0","@material/typography":"15.0.0-canary.9eaee7936.0","@material/feature-targeting":"15.0.0-canary.9eaee7936.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.9eaee7936.0_1670443437587_0.03160703582756774","host":"s3://npm-registry-packages"}},"15.0.0-canary.1d37bf601.0":{"name":"@material/slider","version":"15.0.0-canary.1d37bf601.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.1d37bf601.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"3c36346692ab77656d1855ab575f07da21217aa1","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.1d37bf601.0.tgz","fileCount":37,"integrity":"sha512-dmq4vxjyi+zSXYvkyaYDsrqxMcWloI4XtyebJwVWRYKyJSBcUvlrnMvq/L/nYqVbqnLbEcZVN35sb+e8//u9nQ==","signatures":[{"sig":"MEYCIQDb9UaR79XOg3BiwMRyefSD8mg10acIb1XeUIKDFRQiYAIhAMKUhpjsWpOV+UhUOgXW3BAm8AtPlHT4YkKsPmyGhB4Q","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":880075,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjkPqnACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmrteg/+LojvFd5pArGOMrGggq5wp4BARTinHhNd5ukeJQ7u1NXtqKIu\r\nkkHEfhGb6v/Orw7yYDSKfa6KUmMNVtg/6ssMOtDV7OLZqP3iTnjYfkvJLOX5\r\nYGm5r+gsOu9LG0BwmyUXS7/uWDPW1VyNyRLlDZxvLyggcfJ2SkvOfdKtWx59\r\nB+5HlbdkI8rRvlSSy6Lm4ZtyyZoyy0z7foQA2cj82TY1F69ZFP1hykeS98l8\r\nF2W72Bq7ryFs2nNsaMZarmwM2ruh8oyxK2Dvu8OSczAygd05u4ztPV9VeQjo\r\n2W4LkgAnm8RhOFBPi3nPVPZzMtrI1BNQu4/oDEGBeTESqkTf0mFyR0YLvTCc\r\nHY8Ke6Hd298b5uMQUZxjBJBvzu3LYuUtAz/N2NN16ghQUdhZy4VPt3g63tz0\r\nlNG7glA6UsHmXc3b+9XSYIy3PcoY03a/e3rtogSF35/Xiq/XATRXiTm93XTF\r\ng52sFZd599YLwiZe1ELCTo62qpqOw9CW4vLQz+STO4oV5Z/2qWdbMQCAMonm\r\nOO04vvheVlsjCgoZhLU92sGqkUU7sxXj0+AuNY9KqvlrNkyPGdef+blegzz+\r\nKJXzlp1HYgUJvO4vRUmtjD+6652f/axIFKhGkhM62VcyY/xqQNZ3aWZHvaA9\r\nJgFbBhflcb9cVZ/65puneiqY7P0tZ39SJN8=\r\n=9tkV\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"747a03f19fc88f7a2358a382989e729013e06df4","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.1","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.1d37bf601.0","@material/rtl":"15.0.0-canary.1d37bf601.0","@material/base":"15.0.0-canary.1d37bf601.0","@material/theme":"15.0.0-canary.1d37bf601.0","@material/ripple":"15.0.0-canary.1d37bf601.0","@material/tokens":"15.0.0-canary.1d37bf601.0","@material/animation":"15.0.0-canary.1d37bf601.0","@material/elevation":"15.0.0-canary.1d37bf601.0","@material/typography":"15.0.0-canary.1d37bf601.0","@material/feature-targeting":"15.0.0-canary.1d37bf601.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.1d37bf601.0_1670445735016_0.7927743855153349","host":"s3://npm-registry-packages"}},"15.0.0-canary.a5fe069d5.0":{"name":"@material/slider","version":"15.0.0-canary.a5fe069d5.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.a5fe069d5.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"1debc8585e93d9eed856499c1f2cfc3630a5f4bb","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.a5fe069d5.0.tgz","fileCount":37,"integrity":"sha512-X2HAhz7XuT7OsccA42GAy2j3Dr3BsYexq8RynJkbjO7/TrMm3yzeKYb59O0I4y3Npcihsf3WjxfttydfnoA01w==","signatures":[{"sig":"MEYCIQD2+CtJv27nFWS4hJGMbYE1d30JWUIDurSipcd4xHOg7AIhAIxjmQ8gZl4SE0pELsNu0Ety+ySqCPAuX5qHFYUfoz7g","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":880075,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjk4JCACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoPgg//aPl429OukznXVbtrQIMRpnprStGXvwSij0eibCLgs7e0of1X\r\nHHldd+XG3fAj4JYdIaFYkZSX4/eg70pQryLGrlcIvsS2X9DXsekkHiO8P/u0\r\nZ5Wx43o3jHtnTWH1HH4UJi9hq+4n1817jFxlN07lfU5kUPlt7+bMkfXfpqID\r\ncT7GbkogE17l/XNjFXHOw/KfNaPgo6U0FVPnu64oGYkztalRzkfFYZnDLkHl\r\nN8e41JibF2BkGdbT7VlK9Zcqdt8dPKPaTB44UQVCZzU0J1RVCfhtOogE96SD\r\nuAFFOhZ0NOzGBOJX495xplwr6GrHPEni7I0Gwl6ViC4OI7Ls/tRSLbV90Dqr\r\nA4m3yKPn1f6lNDCJDyGcee5guJ6cevIZM+azvds6eyjWQSBTg/fdHNipdiq/\r\nhz+1Ur1NOoxFymwapsEPUCBR3ERuSN4Fxz9ca6p3IdhLyHVp6z5EaH5tlFv2\r\nyZrM07du3FkWHz5XWNKLE7xGgmb5JPRSJ5rZap+8R8oYHBcyIT5njQRdfZFL\r\ndT6/4bAPOlxp23Lf9mbzVJ1mKqb0yMqpD+oZxJCAgtN7d1yyz9kvA10sRlMl\r\nzBU5nm0WAWNfJEchsUvL9Q2ZBxJIa+lvx1WuVIpAeE3vcrF50DIyyg2MljCc\r\nMGUxL8m5TWvOvX9T9gT8r5F/Uo6pxuk/uoY=\r\n=t3sc\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"c41dbe93704a7d03ea10d8f1b4de13fb8c6e19ab","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.1","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.a5fe069d5.0","@material/rtl":"15.0.0-canary.a5fe069d5.0","@material/base":"15.0.0-canary.a5fe069d5.0","@material/theme":"15.0.0-canary.a5fe069d5.0","@material/ripple":"15.0.0-canary.a5fe069d5.0","@material/tokens":"15.0.0-canary.a5fe069d5.0","@material/animation":"15.0.0-canary.a5fe069d5.0","@material/elevation":"15.0.0-canary.a5fe069d5.0","@material/typography":"15.0.0-canary.a5fe069d5.0","@material/feature-targeting":"15.0.0-canary.a5fe069d5.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.a5fe069d5.0_1670611522013_0.8373966358254035","host":"s3://npm-registry-packages"}},"15.0.0-canary.ce8b5326f.0":{"name":"@material/slider","version":"15.0.0-canary.ce8b5326f.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.ce8b5326f.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"f1a9f4d6a3e3106ff11a63425524ae12f4c38d68","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.ce8b5326f.0.tgz","fileCount":37,"integrity":"sha512-xXpNPw3nxPffj3F2Mmbjs7mfEFY019trtNY2376FKx4WCN5K3JRNc761NY3feMGtgqZrWZedk/57sWGuebbNYg==","signatures":[{"sig":"MEYCIQCaAqD1CgS4hLWaSXU+gFGAfZzMs+c4bKSALyNPZsIqnAIhAKD2tXK0KmSgnmliTr0auoDiLtNjHkc6W8btdignnlfm","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":880075,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjk8VfACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrkHg//ft41oLGRUJmplcsECS7vURbpsGhjCOpi4khZl8xw+HWeU9wm\r\ncV4Jk454J7qjB2BDWXaX0NWv85PX8rs2ODn9dPVZCZuyXQ3zn0fv9oRFNul+\r\nAus/740KOKFbreiZZiI4v06dhuSLjJWnlAIxdixvwWMAWEVnwoiiGsSTjwj4\r\nuMH2BGl/ZIFHy+wkr88vR6GbQrhkqpCw30FLG/eW97+vUPfVBPIzKLQvIo+p\r\nRN0zmXfu8zfn7u1+9wIT8TrPUXk2pD++Fi07lV0ACZTMAS1cV3OtX5Ilxt3K\r\nGp56idAK7i692y088KXruTdinXCO32q5W6VJ4QyBKQCJqdC1Sdnd9Pi1Odx6\r\nkSJ4IEkFRs7K8J7/fK8/eSE59/Us1vVGY8U2pntWQUwl4kVdzevF/Cuo3FVB\r\njDrECjzXCnFvJdl+VjVPGqriVBPdGtUNe2ql8QmFqu5LhHBtI19fve1XgRG0\r\nhRq4jvK29AZL4Uc4jNHCZZ5DpXkVuFMukgxCS+GNvDahF6wWWjKtQb3w18Q6\r\nzuIqkUqeUzxro8mjDYkJs2Ls2r9ccUp/2nPd9jE7h4/bPHv/GPZbgsMJcPA5\r\nlbkxdAg+4w6crRWkC/3wUIAe5U89SL6z9P9CVPMm1rafO80q7VJAove6BpTB\r\nd35YdgDB5FuhFpaiPzsk3UJjb2IZOsf0Yug=\r\n=G8b1\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"8ff7f9974a16b8178376e943748356193d364587","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.1","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.ce8b5326f.0","@material/rtl":"15.0.0-canary.ce8b5326f.0","@material/base":"15.0.0-canary.ce8b5326f.0","@material/theme":"15.0.0-canary.ce8b5326f.0","@material/ripple":"15.0.0-canary.ce8b5326f.0","@material/tokens":"15.0.0-canary.ce8b5326f.0","@material/animation":"15.0.0-canary.ce8b5326f.0","@material/elevation":"15.0.0-canary.ce8b5326f.0","@material/typography":"15.0.0-canary.ce8b5326f.0","@material/feature-targeting":"15.0.0-canary.ce8b5326f.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.ce8b5326f.0_1670628702808_0.9607257683415824","host":"s3://npm-registry-packages"}},"15.0.0-canary.43f5323bc.0":{"name":"@material/slider","version":"15.0.0-canary.43f5323bc.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.43f5323bc.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"1e55e3738e6be008797453b8e4f6ef0bc5f33af8","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.43f5323bc.0.tgz","fileCount":37,"integrity":"sha512-OWMMV1b8Qjsz2doMTnOldZOkl7SDGDh0gGcpkNzPUyCn/p7cQtjg3gWzz3XWX171L+SKmRfqpw+M+i+Rzdgv8Q==","signatures":[{"sig":"MEUCIQCYaeEpPKL/WDAT48GMayVZ8cYkFoOLIqEWNA5SOJsz3wIgVLrA37+CaVJsNYNtIRLag3N1+HoDKvYZ51ou6WMf4Eo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":880075,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjl1shACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoB7A/+NhnB2Wy/hkm/uCyK7J8AZ6TSAzRPyQH7PmeINNIs4HdGmG+4\r\n5f3aE8iPUFf6kpa4a8inMeMpaL1bkSlxry0GeJjkHZG5GeG+R62Q4WTcRr8s\r\n7doFXPIYNoT7aFceV4Pa+M39B3ycUDm9dCFSDkN0q3ofrSHA9J8rbb8Dv6O1\r\nF6KuI75ZtbyCb39Utw+qCtRGVME/D8FJ9nmyGAyHmcOeNakuUFKcnqm2PtcY\r\nCPzFlzgEx6mPbw/FjiUZyjB8CACgf7iX43J2Ug/gJpIYwRuwTxQU1voDXG3i\r\nHMP9DIzMHf2yVx+kSK2W7aSYnqTuYdcHKLKgkJvrB23EfnWhR3QLCLLn5FAC\r\n3jfbIW/n2ZeyGUXNtAOAom3/ZkgB8BmsCp4xxZkdwXNPFP8L6l1WHyjtLJL8\r\nEvloRQUbLTc1GERTARB0c1hrawtFcj3NLLtLCvf8GelHx5F4l2iogAxwKiK3\r\nwuWAFoOY4x6R26Q+hQ5+q2747yIb1E27SltMYP+q5RwxxyNn53ZhW7KNNvj2\r\nJOgR78Cii/9QDFiW5twKmkho8Z1WHBcozIo8aKjmbn6vsOtqiVSyvhjQBZeU\r\nqeZNsaaW41Tsmi0cuksiAsCjOebcltorUlZ2Hd0Vn1XOTKk3jsXAWRCDwiUp\r\nPEBFbCXVsjxhr5K5J6QTzsFHWtXRVRVSR68=\r\n=Eu/k\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"00be798d56184d5daa74ad6f53d4992db90688bc","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.1","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.43f5323bc.0","@material/rtl":"15.0.0-canary.43f5323bc.0","@material/base":"15.0.0-canary.43f5323bc.0","@material/theme":"15.0.0-canary.43f5323bc.0","@material/ripple":"15.0.0-canary.43f5323bc.0","@material/tokens":"15.0.0-canary.43f5323bc.0","@material/animation":"15.0.0-canary.43f5323bc.0","@material/elevation":"15.0.0-canary.43f5323bc.0","@material/typography":"15.0.0-canary.43f5323bc.0","@material/feature-targeting":"15.0.0-canary.43f5323bc.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.43f5323bc.0_1670863649164_0.7424268361260447","host":"s3://npm-registry-packages"}},"15.0.0-canary.5490e32e7.0":{"name":"@material/slider","version":"15.0.0-canary.5490e32e7.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.5490e32e7.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"55727e20e23f1a3db6136e547f19a8945932884a","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.5490e32e7.0.tgz","fileCount":37,"integrity":"sha512-Enop1aKaUSO0EZO5fDEomKu3Fjvvgcm3elL7GwuFN3gwP/D+MeyR+QYeFP5bv8/FdnITKHrbiC2b8r6UPdFWcg==","signatures":[{"sig":"MEUCIQC+qPg3v+1sy7flDiFCruHHXiJbGoJRjetdtBM8wlaskgIgGXeGIy94cCYDq+WC1+7lxNSrv4fWSfJ564zEo5GIEoE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":880075,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjl17PACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoZ5A/+PYF2xUYpWSLFwA7bHE8cXATWgZhuwAhlLAV0fDHtS0Gu+g2e\r\nccDJAjr6V+wKbPcpBvvaba2GQrz4gmYJGAiwuXO0FX6V00bgCuuUgtLl8BYJ\r\n2a0pCEVSNY/SzaUXiCO05/g/mjugdUiwWthRzZB7AL2VsSqH7/oCfoBOrjXa\r\nfbS2LlumKPEE4VJzftWeu6mljVk0Ko2kZ8hW/m/A7IcRlaBxnDwb9TPGszlf\r\nqDIaMl8B49++7tbGjM+nIFLH57QuIoyrfg0xUa2gswrdFX0YGKyDjReZO9Oq\r\nRaY3lDIo7GPgi2Dqqz9z5U+rGwu6fApum/n485e0/vwRKlB2YqwAjsNRvtUN\r\n4iwhC1e3DeFTIytC3KkJEiwmNTYpOlKOKQdv8+jCDNa4DJdpr8roDHzNuS5z\r\nb9+9TYIim4nloPVrdJNWfX6XmvRb/VyoTAHuiOtb1VamCuAY41jleCz9IXUU\r\n+5qKGXqRr7NGChgvseUxgJJIJVSFRNBOIrAVLlG0nahjx02StrvrXygLL8s0\r\n4bR9bZmFEVhPt5v1+bQk/CLDDtlE2A/5o3w1qC1jYKVfghxe+XAfaHi75tX9\r\nMoLvIPxl9Qj3PX9/fOqdGV7Xkqt53+kC/8Lmu/oHa9kNwVDMoN5cvu1qcZ7f\r\nIklhlxwxqlgrTCBGtao66UHLAupD3HwZuw8=\r\n=avF9\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"968b84204c7a8626355569e2b90063abd574f7a8","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.1","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.5490e32e7.0","@material/rtl":"15.0.0-canary.5490e32e7.0","@material/base":"15.0.0-canary.5490e32e7.0","@material/theme":"15.0.0-canary.5490e32e7.0","@material/ripple":"15.0.0-canary.5490e32e7.0","@material/tokens":"15.0.0-canary.5490e32e7.0","@material/animation":"15.0.0-canary.5490e32e7.0","@material/elevation":"15.0.0-canary.5490e32e7.0","@material/typography":"15.0.0-canary.5490e32e7.0","@material/feature-targeting":"15.0.0-canary.5490e32e7.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.5490e32e7.0_1670864591502_0.5069227329969328","host":"s3://npm-registry-packages"}},"15.0.0-canary.817002c29.0":{"name":"@material/slider","version":"15.0.0-canary.817002c29.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.817002c29.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"a8aae8750c2cbb90eb1d1aa40106ffce392fefeb","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.817002c29.0.tgz","fileCount":37,"integrity":"sha512-2VH26nkY46gxszfT1ERlz1CbF0SFyz6feG9cTMle7i9/qwKix0VoTEFx73F4km43GEUJETIWMByIgqVW8c8QFQ==","signatures":[{"sig":"MEUCIQC6jTtKCCg7kmq3YjtRCDxmM0xDxRBV+ruzBNlGpBx0dAIgAUjFpNw5HDxMmm4QBjMOeQ/cr2fkFYoTgqMqhIoSpIo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":880075,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjmPS3ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpnkRAAiyOR/Qnh0BtVnrfwjmu4L8nEdIGjUTGa4txuOBoonj02Q/9r\r\nH9AAv+s9et4gHCVJtcolc7juaDgmJcfT/5V3ixnhUuO7l+3zdHb1+aS9pP9l\r\nJ0hG266V2cXET5Cnq1IT1CGTPKKr9pxIVtluwc6i/RmwLmvdh/D5HIpAMdpZ\r\nvEIXiiHBLm51kKhucB5wyXkZEnToaFzRj47c5Nid/zgcHwqdmnUW19pQOsrp\r\n/nGV9/odNCQbNR0KZGZmDztjeko0M+iB61w3qgctb3Q5ioZOzP/bTIk+t94n\r\ntwdVW5BZNKt787uvQAedAgH45W1BCM+klcCU2Po+MfLnvQ/OD8ptxCp/gBFG\r\noTzAFelSB1YEoWPHRQP8zT4QtiIASDnY88ohAvpHLGHCMEmfziwi+K3Fm81+\r\npMJYPndIbKtkdyP3A7+LJBSBoJoTjeGPS9NIZAAMLqUguKfM2Z7TTseZhlI+\r\n7HGQew3y0nrBY4N2LLUynHbcMmwv9o8gH2C/ZxBxaj0N+6ZIvksrAGFlmAQA\r\nzpUdOhlYLt8e3ook64atE1/ALMD6iBeAo0HV2Jo6+NmYXp0ik6tEJwQkP3bP\r\nQlb/ho97n9EA3JuODh7a6GLywxRRHf9aEBQS+DkoqVjgzTTyJZKF4Vy1CC2Y\r\nHNnzioQHrmPeFowcPOrmnWwaPzn+d9c/t0c=\r\n=LID+\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"8a85122d0f4bac7142c66fa54e2fe9a569e7c4a3","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.1","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.817002c29.0","@material/rtl":"15.0.0-canary.817002c29.0","@material/base":"15.0.0-canary.817002c29.0","@material/theme":"15.0.0-canary.817002c29.0","@material/ripple":"15.0.0-canary.817002c29.0","@material/tokens":"15.0.0-canary.817002c29.0","@material/animation":"15.0.0-canary.817002c29.0","@material/elevation":"15.0.0-canary.817002c29.0","@material/typography":"15.0.0-canary.817002c29.0","@material/feature-targeting":"15.0.0-canary.817002c29.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.817002c29.0_1670968503260_0.9280707130752586","host":"s3://npm-registry-packages"}},"15.0.0-canary.313a1326a.0":{"name":"@material/slider","version":"15.0.0-canary.313a1326a.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.313a1326a.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"2eae7669d087c79e0d2adadc54fa23e76b6091be","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.313a1326a.0.tgz","fileCount":37,"integrity":"sha512-Zh+0OaJAbmsddJHD0CMaJZ4Y+6ARzBESOc6ISnEzFYGQBjxnNuYFJv2ZP55zkeZbx+ka82r2vJHC1hy9QNdfbQ==","signatures":[{"sig":"MEYCIQDC1mwwjw8G8K395vR4eP7bgU9rlc+ThhL4lSOvMm16NQIhAMnGwzy5V4lNRhzDKbn0UjJ6LXFQyQuoQ0YR+e+5BGka","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":880075,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjmaWgACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrxWQ/+OD9qYCVbl67gROKjBKpQ2jVbns8YmtBf2f/eS2DD8IQKF8p4\r\n5wJ1ucc4PJEdToCGSvoIXHa/qXu8jIqDctaLhlzIPyOkslHEZk51Rrq6sqCa\r\nc9HURYc4TYqtklyeSUQrAATwtxnbS4IFUEyHwHObbxOJE8zo55u9Ti1MADzb\r\naEDVCSBFWuV+hy6p4J6AyoD7nYe126WaEuEjz6J9TuK4l8UVsgifqyTxktjl\r\nSDnQSKBUBeFb6kammzG2PeNDuRrbO2zYvGg/Cl+v/fqYJJLy6rL4OTnc9tN+\r\nbOF8+cexeLT33IPzo3uaqgQD9zYnnMYQHB9oaUjB8mYOem8D15XNVe4kVzcs\r\nyBZrc1nTJ95oa00jKptpdTSQpWbSK7nASzZxcgLldX3v2S7dAGoV2hFWLmDF\r\nuOO+h/Un4/4afOElVcqAvoRAlH0EBa1nkAn5ruZx4j0WmlI3XC4GfzwI0QUT\r\njs9+2GjwtyaHcCP9xsWBjNW1880y6YdJQ4uhGKh6RWa56mWMGeg6zZsVyDIm\r\n0dEdWswsuHkhLm1rMHybNTbjO4PxI5QNPt/qCHzDLlRXvcM0y1sfpRyECJbW\r\njec7nUrwYkrPN9yJcbJtTquEibeDSJAMpdnDeWE7ZWehncC9xqD+kMPGCFJY\r\nwkBUPd+FFe/CJMhb0FFk39b2uB9lbaUHu9o=\r\n=rpwJ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"899522d523dc8a23968f530bb4de8698a5b0e78a","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.1","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.313a1326a.0","@material/rtl":"15.0.0-canary.313a1326a.0","@material/base":"15.0.0-canary.313a1326a.0","@material/theme":"15.0.0-canary.313a1326a.0","@material/ripple":"15.0.0-canary.313a1326a.0","@material/tokens":"15.0.0-canary.313a1326a.0","@material/animation":"15.0.0-canary.313a1326a.0","@material/elevation":"15.0.0-canary.313a1326a.0","@material/typography":"15.0.0-canary.313a1326a.0","@material/feature-targeting":"15.0.0-canary.313a1326a.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.313a1326a.0_1671013791770_0.273906656673947","host":"s3://npm-registry-packages"}},"15.0.0-canary.a69c14e10.0":{"name":"@material/slider","version":"15.0.0-canary.a69c14e10.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.a69c14e10.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"7abaac97be2218783b8be27b1897f16ae9eb59c0","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.a69c14e10.0.tgz","fileCount":37,"integrity":"sha512-WAYrlJL+sPEhM1Z+9vQCHJbpxW6KmANI+7Xdf6mOeHOzy8bTX/jBKxuP7xqQQrSYPEgGkDg/K32yQoePZNtsOA==","signatures":[{"sig":"MEQCICcdjbMfnBJgdGkK9CRm/OWWZ5TnHqxwGRUSRLr3bmI5AiAAogdQmNttQzfloJ0aq6MEXmucEC4i73/LSfKZMSmWEg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":880075,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjmbFhACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmrtpg//aQHEyQspRtf5YIJx6YhN6OhJt9oTtpLpZfceKW0cRlY2N4CC\r\nsBZ+qSiBWppodGC/MXer47pwfAbwSH4KyTT7vCiQLk8z6d6orxEMZ9bhz5/Y\r\nSC4KIio7LGj36ka+ye856wR8uLs2yb95HD1xLqgx52mlKPvaoJQGo7BWbSEt\r\nD22OtZtQPUlxRKh5yvZLdTRiNUyu49qQu/eBkTTIta4fiybJNTfI/GUt9M36\r\nchQY0xeFoja/jUZM1/W+ck3DUKLGzYKUm86LI+F+GEgAFnSHUTYRuOYdcVHc\r\nV+DXJtMF3YdwqvO/hE2N4bhZan86zjPEBtJxCO2ER1YC5TfXlgRpjtrWxmgV\r\n0dZiNmp9VK1MDtq1JJ2Omd/cHIktbShKpWrYWC0CfkrgL630DQ1VeJEbISGU\r\nm56hBFf/Zn0lqpAqC+Aa4f0LLmxq5SjbW2/9zNNjqiNHv9jTWYxe9jpxZNMV\r\n3i+anOzUuExzMOs1/ivm9AZLJSXiK+bASqd+g+QG+cEJWQf0vl4hNbn9amz9\r\nK3YfXwvLLNVLDw20X4katwfxm7IGkl4+iiCOaR9NNIof5LrPZQ6tJnNczyJs\r\nbKVnFZL4ua0nvfxEhy3h9xiIMFn/GMkFPHM8Y2pIwqN70RSz3UNjzIcDV7gZ\r\nCCP2EqIDUiMMR8cw3gWli7rXRR1pEl2FMzY=\r\n=LD6H\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"39b456415cb22d1c1b4de3d505f0e2412c1f5316","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.1","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.a69c14e10.0","@material/rtl":"15.0.0-canary.a69c14e10.0","@material/base":"15.0.0-canary.a69c14e10.0","@material/theme":"15.0.0-canary.a69c14e10.0","@material/ripple":"15.0.0-canary.a69c14e10.0","@material/tokens":"15.0.0-canary.a69c14e10.0","@material/animation":"15.0.0-canary.a69c14e10.0","@material/elevation":"15.0.0-canary.a69c14e10.0","@material/typography":"15.0.0-canary.a69c14e10.0","@material/feature-targeting":"15.0.0-canary.a69c14e10.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.a69c14e10.0_1671016801156_0.9679213729114295","host":"s3://npm-registry-packages"}},"15.0.0-canary.f43e0ceb5.0":{"name":"@material/slider","version":"15.0.0-canary.f43e0ceb5.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.f43e0ceb5.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"632c3dd5e568d194692cea2c30ee5248130f2637","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.f43e0ceb5.0.tgz","fileCount":37,"integrity":"sha512-QbIoSgAhgV4HNocVf82jShCDqn1fwdyPQy/BKYUGfOJ68SZyRJ5ARWZjX3H0Mx0pRuUtaGkJXzm6Qtc/+e7Rmw==","signatures":[{"sig":"MEYCIQD8Wn1xWzFNjljKUgz7J1Pd+H4Cp0xKziYQPpAthxvYaQIhAKI/A1GeOz2FQe9ESysFq0ER51nxS/AXn+TJvpK5EaUC","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":880075,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjmf2+ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmo7Nw//WV/I6SwnO4hgfLVW93liwVLmC5vHEZhrD9MSfE4WWGJZej0U\r\na+KZ9QvI2d6M774n5r5aAF9efd5s0b/MSUMvjtf15rlNJCCGte04RjEEDTAC\r\nADvd70KRgORUs859nTN3pi/z/W3jzyeEw3dcQwKTCarY+vPdcm96yJdmlYy9\r\nzvncfpHt3WVGH4SsAauaGIizPbiUHkbadhMbaw0wA3rlid7Z3M0PNEfXrNXp\r\nFJTb1xfwYU6F4c2cqN0hy10V+g8cxFjylZMVhO1e1MZl6bYh7eAo15/ZJoUB\r\n3sITPARGhmoq4Q1bCZx+l54pGYPXcRsDDhP4FF78fJUD/rvkqSFBVs+8q5lf\r\nq16AbDyRVgwUhe6OPd7G8sUj7wEUPTN+ag9YTh4+sS7RV8XvqYHOe7MKxbYd\r\nTMWw5tgKSjhvm2grb9lNrX7vTUf4D7JDy3Gk63KifsvOFR6pdflGxXiwB32Y\r\nNzG2ozIY+GxgC1ztnrS6Vot0IgLolb8UU84Kx6prRp9zdehAVrJrtbzRONGx\r\nIkmeqAAGlc8AAakkuYjPZIBsLXEmdqGl0N2/nqi3nZThfKHwmwckDOLEokPl\r\n9cluJlsvRe5pRBJ8ZvtPcSmUdbVzURhbQZG9wr2POgg+faURbbJ6za8CebJD\r\nZvtHUuistZhQZCMnIoqxMcrIZPYKwaH+Mh0=\r\n=QAqP\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"35662ba23c37e102fa09f72d61e38e5ce3b10881","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.1","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.f43e0ceb5.0","@material/rtl":"15.0.0-canary.f43e0ceb5.0","@material/base":"15.0.0-canary.f43e0ceb5.0","@material/theme":"15.0.0-canary.f43e0ceb5.0","@material/ripple":"15.0.0-canary.f43e0ceb5.0","@material/tokens":"15.0.0-canary.f43e0ceb5.0","@material/animation":"15.0.0-canary.f43e0ceb5.0","@material/elevation":"15.0.0-canary.f43e0ceb5.0","@material/typography":"15.0.0-canary.f43e0ceb5.0","@material/feature-targeting":"15.0.0-canary.f43e0ceb5.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.f43e0ceb5.0_1671036350426_0.8221150440505471","host":"s3://npm-registry-packages"}},"15.0.0-canary.34767110.0":{"name":"@material/slider","version":"15.0.0-canary.34767110.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.34767110.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"e423b2c5e43013814ed3fa197f8d231d36ecd44c","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.34767110.0.tgz","fileCount":37,"integrity":"sha512-Zf/8VR82Znnnc7+hHFxKiZG5u2dUUOUOnIVLXiE4UnlZdEwkgf3ff0Ats2PxIaA7eNo1M3B0wqH7AaDp94vd4g==","signatures":[{"sig":"MEUCIQCoW23EIHHKLKQPd8/fjruGybNjlRvUkvdUGsvVVIZY6wIgBrWRLBb4R0+V64hq/SOBYw4o3k09GbjxKuPFGTrJn5M=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":880074,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjmgZDACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmolZA/+NkofAx2u+5FWdNUSRPwcu6SZ/ypqPT4uHamKdJvSFQ5PkAnO\r\nYjoUrRRXIuRjPi9zKwpN2DMkBQ6DHB47cWrXf14ylTuaAjabZpeNyORlsxfh\r\nmCGt8iocBNRDIAEOGqKNDLX8kFvgYTv6vhlEDX7JmbAfEt7pLrvNnSpWDc3k\r\nPR8c73fIC/t9/bm2p6ffFdV4CVc9asiwbPfBjGnhsNzU9x4HQsqSYmZ1vD+T\r\nd5ILmtOj+vbte9Rpu2dKGCmBltlNtmxWflbVFWAobMKupXb10VxrNcs9J4xW\r\nk5cTQL5DjuIpailn9p+tMpsdaou0QPXpzV2tKi742qibGg6OuxZQSqgIpNcP\r\nLnsPgZwTUExvARJgrZSScR+5r4TQMMDssAKfpqbIKuWdZCSzMcYzY5TlZ2hs\r\nMo/wsDNN6BI73GDAYxZYM0S5vR+qg1FVwjJScQaDhdgWcz4+aAWeGWtSdP5c\r\noDlbbDJx/fcY8PNubTeBf8OqSnMV/OHqtH7fDkFsSodCwm0kpvbwvgj0TqyU\r\nfz5G14TAyy88INq9BJcbpdLuHcKaT0BOkTn1vHaKgr0ekXYWcDQ6355gMPt5\r\n76n2Y+QXDSeaROYzhmFwbGCI7aWKkv5Qz9w14zEG9WRHLd5MOMBM5JpgUu/Z\r\nWLb2mmieWy08GYAziFihwfqoNkQk4DwEYrQ=\r\n=HE35\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"ed8adbbccdff96503e43dbe6291e95b5d2bca2c8","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.1","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.034767110.0","@material/rtl":"15.0.0-canary.034767110.0","@material/base":"15.0.0-canary.034767110.0","@material/theme":"15.0.0-canary.034767110.0","@material/ripple":"15.0.0-canary.034767110.0","@material/tokens":"15.0.0-canary.034767110.0","@material/animation":"15.0.0-canary.034767110.0","@material/elevation":"15.0.0-canary.034767110.0","@material/typography":"15.0.0-canary.034767110.0","@material/feature-targeting":"15.0.0-canary.034767110.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.34767110.0_1671038531432_0.3444067498415986","host":"s3://npm-registry-packages"}},"15.0.0-canary.1f99f3c50.0":{"name":"@material/slider","version":"15.0.0-canary.1f99f3c50.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.1f99f3c50.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"f4f639eacf9de0ebe27158736383453c5eacd75f","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.1f99f3c50.0.tgz","fileCount":37,"integrity":"sha512-huRDjs9nlM3ocQUXw055FdeB+1i7vTGI311XPEuBuVajfD1LO6GOVTNUbgSTPMPtGDj0/0Oh0cp6l0sOr0H9Xw==","signatures":[{"sig":"MEUCIQDu5XR10qXbML0Dkma4CePASseDnnEIzutsja5sP7fqoAIgL9y0un9KeVKT4gWJq7iofWXMQHUThtF6mD+VOWOdr6c=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":880075,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjmy6YACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmo2Lw//RgOeSc/WfuAZnYvW418lKmo3Bp+pY9U4cX77C4OO1rdDR+xk\r\ndCHbu5D81lt6vwVR27VtRiNsOart4Ni9uHkrtqCCJhRAIGiI4UJ3CXUw/rsw\r\nULWjmzW1VBMpbp/EnODH1sF6c0NdGWG9/+ARb5L+thw8j0IB1I/PZilNn4vS\r\nRkJ9WIr0tL2VdR7FzO1yn313GDQ8UicbYFerlIpo+sjQxuXDrw5QQOzTE3vJ\r\nJ+kyfZm7Z7gx5imE0MtjftoyrR8UlED5AnNLVa/voNAdGdIWZvtR55xjPOam\r\nTx4LCCKeG+SpJHzw+wKQ+AOau/DPqgOmeewpPt+1XgVDPu8SHd4+M17rqOQ5\r\nldRLfAhdL+GwZXvQvz691Cq56t5UH8DjWP0f6tKvUFyYq2krXbrje7DxKBkH\r\nhlw2rAeLcMdLPaMRL/CLtditVGcBS4uLCKWfRnmvdt3vVh/x082pFpelYmz+\r\nCxPvWG7aRHudwyHbG4LeFqmOpwo9MpcYIYuMjou0IPQxU0/u+Xys0VMiFY38\r\nPdAYy52NxurBGDiK9boKjZZpZk8Ctb5JC/EKY2AQLvkRCe/1tl5GDhlMJVP6\r\n9iMzhIyLLWAHJaKPO1sReVOns0/bnavUHJ+l0UeMRtDMon3gYao/GBEIpqfM\r\nVeZ3A2YJMQT164h0f1j0eBfdYHO5GcIPorE=\r\n=xtSO\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"c9094e8faca1eaab158d26f7ca8ee4b42fb54bdb","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.1","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.1f99f3c50.0","@material/rtl":"15.0.0-canary.1f99f3c50.0","@material/base":"15.0.0-canary.1f99f3c50.0","@material/theme":"15.0.0-canary.1f99f3c50.0","@material/ripple":"15.0.0-canary.1f99f3c50.0","@material/tokens":"15.0.0-canary.1f99f3c50.0","@material/animation":"15.0.0-canary.1f99f3c50.0","@material/elevation":"15.0.0-canary.1f99f3c50.0","@material/typography":"15.0.0-canary.1f99f3c50.0","@material/feature-targeting":"15.0.0-canary.1f99f3c50.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.1f99f3c50.0_1671114392128_0.8975478966241202","host":"s3://npm-registry-packages"}},"15.0.0-canary.cfd69490f.0":{"name":"@material/slider","version":"15.0.0-canary.cfd69490f.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.cfd69490f.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"aea324aa2790744867f7cbd5d8537a264063e690","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.cfd69490f.0.tgz","fileCount":37,"integrity":"sha512-w8/tx4ihhFVasY+syI+Z8yGZaG80e+5+RF8RebEIeHQDCWG4zCWA6U3db/UEwjEsJ+t0jC0ccWNbcnxO+Q26bA==","signatures":[{"sig":"MEQCIEH9nUUPN4bbAicR28930oY7Rwz/5ZAYzXPEp4tNiM8oAiBdSk+r2rha37Q0khUMgiS8LzrCq1uZTOIVoC7I/A5qFw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":880075,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjnNB8ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrzKRAAk+LO0KE4LeSH6vG5hehDzT2a1va8y9mZv0FLPTyiP3PkS9SV\r\nzcWw4txLzcRc1JSrFxXiByYMmU9CL2QgZ9EBo2fwoP+D21KZoxwb6mjaoDju\r\n11PnUJJRfCfOje7oNfsG8WUE4CSYc2ZeS0o4nZmrRGCb0ODzpoWaeyDnzjFP\r\niuOoGDi4KVVyDOXd9Et8q8WgwPaJ+g3nkDhwof9alguzVmTskjSS9srqsTMJ\r\ngomytv527pTJcCV0DS0l7aTLAwUX4SAbI9TxvPJjOfnTVt4S7W+KxMgVqomc\r\nMP44Vc8iEUv76cVBMiW0ODyJWKesu83GXthQb1Wre19Fja7vf8R3jP1cSAsh\r\n4jIbDBkLwaqIRDnoYFi5Iya+XRhmTQIOskqOWs0GgYM/USMSWxQgM3NGdZGc\r\nM9RR1tp7jZQ9qcgrB3UzxjaFiI1gMxTg2us+0QeO8+d9fiQHhShJl0YzeJI+\r\nA5hdvJ8A1WSJuAnIQXHQf81zBvLSHAuOwUQ9UUFGdxsgvZONkFPdeH3HtTjo\r\nAX/KCa30XqjQPhL7nNoD4I2ex14mOGQ2FAnMShvHljn8S88cCZk3aS7Xx0gi\r\nLLvhiPqNV/5lKjSHW+xqNZGgeTajSll2vG2eZfLDTFL+1MRS/yVJUWiCngjh\r\n8IiENgM9Tv5aBpo7xncq9Xt+ZtAhpdvrIm0=\r\n=33NW\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"a7b9218e1ea7572b08b54629159e6f3a98970096","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.1","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.cfd69490f.0","@material/rtl":"15.0.0-canary.cfd69490f.0","@material/base":"15.0.0-canary.cfd69490f.0","@material/theme":"15.0.0-canary.cfd69490f.0","@material/ripple":"15.0.0-canary.cfd69490f.0","@material/tokens":"15.0.0-canary.cfd69490f.0","@material/animation":"15.0.0-canary.cfd69490f.0","@material/elevation":"15.0.0-canary.cfd69490f.0","@material/typography":"15.0.0-canary.cfd69490f.0","@material/feature-targeting":"15.0.0-canary.cfd69490f.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.cfd69490f.0_1671221372443_0.7955438619066859","host":"s3://npm-registry-packages"}},"15.0.0-canary.94ad8d986.0":{"name":"@material/slider","version":"15.0.0-canary.94ad8d986.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.94ad8d986.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"5f41d490c9b6e20481c9a89a670318eed8e818a1","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.94ad8d986.0.tgz","fileCount":37,"integrity":"sha512-9y0AVp7tvFokHraitGGNfX9Fd4wprrjQlUMrufm2skR0YFWKFaetB5q22K3Cl6r/WcvlViFEFQvOaxfaKOsTBA==","signatures":[{"sig":"MEUCIDCODXZV/ZEz0UlGjFaqGdie9HXAdjTTzCL18OLqBfruAiEAgDVwJYTLnOaSkY1Q1No6KYHoxPxKHi40Ldcb0iaC2nk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":880075,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjoLtFACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmoj5A//fY+hCg5CYyj0dPa0obgou0DGDAcQE+g6dL4lwAKY4tyJHERC\r\nF2nEWIsgvgq3oJYSFX+O4M9WgnqLjIy6zE0IlU33dPj7c2kcHt5hYySK931A\r\nfVfGZmc+EslMAvDGVcCBz6OyfsrFhu/YEvCQf3dYykgcblLI16syBwZhhPpg\r\nw9Ic8AzvsG5KjxwkpCatyOLm4TL7eiIlIPcgJfqpXOIL8JUzqmLg7l5QZBk+\r\n/8xPwIV/eMKAOR9rZFWw1HtrRmXVhU55sBgECdnqboEqRqguzkc9WEhJdH0a\r\nJN2/QxOUUxcd6dujHxNWrjD/JkwwaAY0gLiyBc+69P+viZhAXRDMoVMmA6sr\r\nUmlIUZ65DtRNraNDh+PxuL+/8ol+KyxjqfSyXu5tsrUH0qvx2JlifAKKMflG\r\nDvVcPwxLQhg48klQcA0XpFA0hCE3fhg0vX/JxVo1xJ9y0mV7aJsOkeOGhAEB\r\ngv59G70/oSIvJUjhaIIW/QOLgJ1yWsYF2aGSYSy6MEjaME01SWIzOsdsy8qE\r\nJnSKiIkklLwQQo5J5TvATWhZwpT6cwF8oSbHC9yu3sT4xe1EuEHUUdNyNTPp\r\nSvuqt50gQF5K9amTKiEzdmR+ZxyN1D7eGfypcYpiXx0Eo6UrfzH+QGkvtFaN\r\n3P5c4jbKI/+jX3JJOCOKsS0/wleIhK4xIac=\r\n=oOen\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"8e8a69afb313ffa8badca57ca15ad4a464b9f718","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.1","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.94ad8d986.0","@material/rtl":"15.0.0-canary.94ad8d986.0","@material/base":"15.0.0-canary.94ad8d986.0","@material/theme":"15.0.0-canary.94ad8d986.0","@material/ripple":"15.0.0-canary.94ad8d986.0","@material/tokens":"15.0.0-canary.94ad8d986.0","@material/animation":"15.0.0-canary.94ad8d986.0","@material/elevation":"15.0.0-canary.94ad8d986.0","@material/typography":"15.0.0-canary.94ad8d986.0","@material/feature-targeting":"15.0.0-canary.94ad8d986.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.94ad8d986.0_1671478085361_0.2743088069354329","host":"s3://npm-registry-packages"}},"15.0.0-canary.604264203.0":{"name":"@material/slider","version":"15.0.0-canary.604264203.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.604264203.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"e1879bce06d8f3114e0b5087fae3bbc25ccfe18c","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.604264203.0.tgz","fileCount":37,"integrity":"sha512-P+5O7ZEVzjVaHSuIhBKa5rHbvaZrb1OX6Wyrsze3w7zZgw3zdcY/m859JFONrL/WJvyudZG7aNtPEqGV9dqy0A==","signatures":[{"sig":"MEUCIQC/E6IsocZPLZrBQGVGajPBRa/4kHrWFjRN1XYJMr9apwIgPNYMd2Bm90hgx90LDtepw0qBlbuUeF0Cozx4ULENvG4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":880075,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjo32ZACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmphKA/+Jkz4Hec3BroS9xvtiYf/xv2xGt18yS08XCuikyoN0+geBTwQ\r\nuXzZJ6MGjn+yNlFf2dY2TflCVUo4OuHNDq2BQulP1cowcX07uIUFGDdSFXCN\r\n5wivsQcfvZUoK5lPcF07ErZFjv2VbFq3EW8+1II6ZQ+WuUFei82Kdkn2kHd4\r\nbhhtiR4VknFcIJt+Fx92ani/q++diuOrSCsTHUj10BmsiqbYXlme67ifYOqe\r\nW5BKg6pOgCaVp+A7EW26Nb1TsXbormVdnbs/DTfsZfcsEFE+XEz1JpOkMHMq\r\nxX8pgXBb6QfNlMa4+POrrnsEw7W7Vs1D73Avo3tqVaxZEjmWoSs/hRgPI321\r\nz4VWhVaFJENxbys6EBFOexaHn0ikDr4TP+dZatQlPzi/C4kLElnpnHMRgPjr\r\nhPMTGJAWKvg3Y3ShSM0OgdZahiLnFp/xtaqoQp9h2hBF6xAt5Ki507vZOJS4\r\nCLmaFt0A4iLnZ0+nx/55q69tnBQc4xl4XfZtgTpeFSuR78OqnmibB++G5gVy\r\n2kMB7V/BBBaU5jG4HNDI96Uqyqzt0iTspMWawz2wQJ+8SeqOtsRjvZ5XkdKS\r\nMFC8045gxV0Iqo+lhHfmqswCpFGfvYyh1zZUsrug8Uy38MfMpiDDg+jBQqGL\r\n6CHRpKYHIuZD4bXND+jAtjPR6OeDuWTtbtQ=\r\n=432r\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"e37bb80002397246ad3ebd1bf11a465b2eb763e8","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.1","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.604264203.0","@material/rtl":"15.0.0-canary.604264203.0","@material/base":"15.0.0-canary.604264203.0","@material/theme":"15.0.0-canary.604264203.0","@material/ripple":"15.0.0-canary.604264203.0","@material/tokens":"15.0.0-canary.604264203.0","@material/animation":"15.0.0-canary.604264203.0","@material/elevation":"15.0.0-canary.604264203.0","@material/typography":"15.0.0-canary.604264203.0","@material/feature-targeting":"15.0.0-canary.604264203.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.604264203.0_1671658905660_0.032491979374696944","host":"s3://npm-registry-packages"}},"15.0.0-canary.85bcff6af.0":{"name":"@material/slider","version":"15.0.0-canary.85bcff6af.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.85bcff6af.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"4176b61be36b730a8bd4be28b472d25d37c8f2c8","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.85bcff6af.0.tgz","fileCount":37,"integrity":"sha512-DbRnQvne522STZRiKLwKFe9ONC9gyjDo72HPkT6jTwG6+iTVLI3kWDDiRnaeR4NQ5QeLnMz5TReMiM5FoCyJtA==","signatures":[{"sig":"MEUCIAsjohuIKQ1NMlDLIQQXK/wYlrF9DQzG/XeiD7pIz+3kAiEA+3GQYbt7wrr0V6N3jHXB5h30bd5O/qE7nIkh8wPWqK0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":880075,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjpDDOACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmorUhAAj38wCZMJWxAuTwVgEo0SXKplRq3v+XHcmtEXBHO8Q4hKBm/A\r\nClZJOjAoO4LGuw4lyxHBOXwPoWmGfUwtuZkS2wZeMZv0raheXK27vwO5GUOx\r\ndRSPCzoMmWL1R/OlDQeGB2+trlj3n56JHnOIJ7ZJxSNlwpusqHan5gJH8CNJ\r\nIEL0Mr6nrPzUPmqNwBLnogR1NJn7BSQFzuJXLxPWli9bWepqcV+zEuxdlb5l\r\neVNClQ0YSHFXuuC+9VeZcn0wqowd/Y98GSrQbP5ZifKyGBsq531FqVL0qewH\r\nQrPyLWFC/YOCiwfTQ+3MvRMz9GzMuUniAjOoooprzl2KC6P+DmcjBosjTsDX\r\nJpckYZW7ghbsOKIIiKmAp/2jaYoFMCmcZkuZ8ix0k6aqHOy3FTl9GmCfCshs\r\ncLkaJ4sI6W4YxieRSvpUyEghmcVcLAgH9cxp0vmEaQtPnRzXCWMP2T9m413B\r\nElpbBUN2revigYOlj7J8rJtTBKM7dfYg1pVOGrEznPuh3pwaq1S82ekfr7bT\r\nBxeIFbGD/SquhlxOPEz7VWuHDq2YPLDa8wqwTYMlmQobS4fqMUx9e4lk15/5\r\nVbGPaEHbxzQJNqhHVq3dMTxMawfz/fRqv3p2eoA3Ugex+Y+KzVyaPFUBuJtx\r\n+1h2Osdz4ijJk2dsYAxklw5fPduhtQ8dr+Q=\r\n=J4ab\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"ccd1f76fc7f93266cd894275969c05a833a002b0","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.1","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.85bcff6af.0","@material/rtl":"15.0.0-canary.85bcff6af.0","@material/base":"15.0.0-canary.85bcff6af.0","@material/theme":"15.0.0-canary.85bcff6af.0","@material/ripple":"15.0.0-canary.85bcff6af.0","@material/tokens":"15.0.0-canary.85bcff6af.0","@material/animation":"15.0.0-canary.85bcff6af.0","@material/elevation":"15.0.0-canary.85bcff6af.0","@material/typography":"15.0.0-canary.85bcff6af.0","@material/feature-targeting":"15.0.0-canary.85bcff6af.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.85bcff6af.0_1671704782321_0.12345363088166672","host":"s3://npm-registry-packages"}},"15.0.0-canary.ece3e8d21.0":{"name":"@material/slider","version":"15.0.0-canary.ece3e8d21.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.ece3e8d21.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"02e5b3d2e08f2bebb66e46ad4f52c825ea469826","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.ece3e8d21.0.tgz","fileCount":37,"integrity":"sha512-Ed4eUT6RieqNMa/rlc3y9EqAsH8hXaX3s0ywWW6G3Uf3iSzH35Q5GZZCxYipv5X3tPE/XBWwyfuEj7k9eu3xpA==","signatures":[{"sig":"MEUCIE6iVaFCjv74Oqri6WhS+EYbPxbIzVDlswsi6doqqWg7AiEAvuvcIaxw75ZqFLBRhybDOVvZX1gtLK9fW7E5HkCkgsg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":880075,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjpJAnACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpQnQ/+Kl0BmmAfwaWZWKKrLZ2oMxzWcO6lMTQQffkoJX32x60idRYG\r\nAxyRyJ0msBtLyQN9e9G1cPVTplZkbvRr+KEsMjdRVMDsYlNiPHbYaP7w9cTQ\r\n5Rtl7g05BzkNhzB9fINVg7guvwUiV47+eM9GnbngIF90gswf+WKNYfg0av2l\r\njsncaSn3FUjATHkxSo67DpYnVFeY5bEXe0VwEkvnD7ZnyMG4n3K0NZmmknNJ\r\n8qRZxowbxzcLA02sPATNLxYGmoVksdVxi+ByeN1PGGCMRDjjmPZuqbkcy8E1\r\nAZ/fh0kzrAOGGD7pWykCJJxcmTd1qp8hhrjUq67znp/taRSfMVpcMWMLaDmb\r\nMSJ5OoKb3qTqDeqc7FB1oWJVYw8R2hrKQbNHT1bb2xutvcY9KT2ggZh/bb2L\r\nXGSEUrXd7/m2S3bbhac+wCqneaElZBdXnjGRz6FB0U1UublEO+Uvw5uRflJ0\r\nAuMu3Qb+Mbp879cdxbhxYTyUujoyx8i5SmZQ/RyK7TFxua8Qx2HoOMhitu3+\r\nv3eA2tseNUttnu528Bvza893Br1DsKP9DXW0ilcNlIeeLsJ3sMCCciLWTiNV\r\n7WJWhn5bqF+PNZw96IUOR2Beb1l3l4puE4crbsucQqHYpbD3Z55VytDoIant\r\n+toVPWzO0xpJ/swf6rPgltUrBv7xKYnO7VM=\r\n=lZ3x\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"1a4efd7042befb584384fcbb35f1ca445adaf1d4","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.1","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.ece3e8d21.0","@material/rtl":"15.0.0-canary.ece3e8d21.0","@material/base":"15.0.0-canary.ece3e8d21.0","@material/theme":"15.0.0-canary.ece3e8d21.0","@material/ripple":"15.0.0-canary.ece3e8d21.0","@material/tokens":"15.0.0-canary.ece3e8d21.0","@material/animation":"15.0.0-canary.ece3e8d21.0","@material/elevation":"15.0.0-canary.ece3e8d21.0","@material/typography":"15.0.0-canary.ece3e8d21.0","@material/feature-targeting":"15.0.0-canary.ece3e8d21.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.ece3e8d21.0_1671729190850_0.7079973206435046","host":"s3://npm-registry-packages"}},"15.0.0-canary.278ad53d1.0":{"name":"@material/slider","version":"15.0.0-canary.278ad53d1.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.278ad53d1.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"19e2b6932e7e2ebbd7462a5d3bd0d9321bdbf765","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.278ad53d1.0.tgz","fileCount":37,"integrity":"sha512-EdyoIGzgrGnGenKljgx4zfpHVhdpf05L+AJDCJ+0Pc3k0w1ahFbVw5WxXg28C0YWdEcK4eeSbQmJWI6FWTMyGQ==","signatures":[{"sig":"MEYCIQD0dBAYLuvL4iGghykPNV7xT/pAfXRRTUDKK05qCQbF+wIhALMCGfhj89YYzWPe/h7AU9yv3RBTAracQMha1xXtHyc9","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":879980,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjqyYAACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr+lQ/9GH2TFJstOVUK07D7S9oEm68czGnB6oP2j3zgBzJhPcIG2S3Q\r\nyap8Dr/NCncw9xEevh1SodCrQfslbcAgmqhXM3z685BhxjkvahzS5WzKsvEd\r\n52G88bOLtqh1fGqCW9ZypgCiKHFRBpgQyubTJJn/r/es0UShVce5pIm8gP1/\r\nPVOaVrmDWXGyu91hUpvgvUvV5gmlrSOoFOw7SZJScu32KFy9UJxTEI9tIaWi\r\n5IvYqpHjRFdUVud/dbGQmsYdn5GNfrnRdeKooKsYYGRv3JGNmgc0XcS1Xzln\r\nexBA5QJmJUeFgndiKlRCgMA4ad1M9efcs7yvsftRZWBTErl1Fw95VsJ+O1tf\r\nymt1GP2hwhHaX36vA234NJmSLbTx/ey+NO1ZgloSApVe3vU+xErl8Cv39AtH\r\nJrTTtQaNQoBgU9fHCgFBa/wYzUus799B4DKphlQYh+8M6J0uVYm5H6RFU1LT\r\nKt64K+AncPwkHNMD1neL/K7SpBkyAHKgceuiulrkYI1p1MSoD5n1Rt4u/aOW\r\nPUMNz0GoEdLoQdAUvAE4QeZNyf180a0rnXSYkuz0+pgFEJOQMYYhWaLUs73B\r\nT1Bb4GED6c0e6o17MbnP2qwGWk5YJ2JRkR1WdYezLhRSwrPwh1tUp2irP8dz\r\n6VxbOXxxraCZQmTaJt6bkryqJDvUEoZz9vg=\r\n=qhIc\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"967cf83d2b9fa8a3e6bd992aa107c66182e0c65b","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.1","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.278ad53d1.0","@material/rtl":"15.0.0-canary.278ad53d1.0","@material/base":"15.0.0-canary.278ad53d1.0","@material/theme":"15.0.0-canary.278ad53d1.0","@material/ripple":"15.0.0-canary.278ad53d1.0","@material/tokens":"15.0.0-canary.278ad53d1.0","@material/animation":"15.0.0-canary.278ad53d1.0","@material/elevation":"15.0.0-canary.278ad53d1.0","@material/typography":"15.0.0-canary.278ad53d1.0","@material/feature-targeting":"15.0.0-canary.278ad53d1.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.278ad53d1.0_1672160767959_0.1571187752081038","host":"s3://npm-registry-packages"}},"15.0.0-canary.a7d8389e1.0":{"name":"@material/slider","version":"15.0.0-canary.a7d8389e1.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.a7d8389e1.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"62915af593b41d3a3e1ac2c40858f160ff771270","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.a7d8389e1.0.tgz","fileCount":37,"integrity":"sha512-fqUAO8xGfE+ndO2H/As2WJREfFthENfuErucU17WBYumix426iIVeylUoyE++9xW/ZhE3VY6Qfpl+ZZNBO4gYw==","signatures":[{"sig":"MEYCIQCuQf8QQH7jj63P4r39tDKLWWSFNBZtCZJNpR0vYbIergIhAPVwwCwxbSsoEMxRtXgdygMPzXpMaqMKpa97KENIcWdF","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":879980,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjq0HXACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoDxg/+NoFD0qMbY+C+QsrRlXgRNlpzaD2XT/OM2sraVBajgigQYDbk\r\nPZIc3Tke3XHNYnhVpIWwkVHrrlwktPbzbalHFGGQZ00EftsirMGFVMkxJ6p5\r\nvsOUULRjcwIJD/sp4RxQ2DI4RD8/us33VMd4dx71d5PrWN86btqjyygsW4Vw\r\ncZYv3s109p6Sf/brhpbIPPjaO6Yt59oN2/QpOehi8VFKAACtAbGvoxd2m0k3\r\nU5JGtdUOPugqpLaWLl0eYGEScVWTrINIozF3ofgmPK3oDe5bKZe+dRmakEm3\r\nDR4eAfXkpxPYlkD0E0LiJEXNlr1GB6+jD4+i4TZayHL2L8FuPtN8h341NMKw\r\n1WZX2BIbM4jkT4F0SjzyV0yipgIen/gEnfsMKW1N14TFLXyIa1XvlMmdMjPD\r\nLlx+Zrsil1M0/iCoxoDAVyRMzg/TzCTKdgAm3uRApw9uPkL7SPouAy0BCq+p\r\ndu7kCZ9d7wmK+l3sqwIdoeI9XGQQk9YfY2HwWIJkOWdVun6v1NdWnKY2sueo\r\nxh16y5tzsZE9Y3WEedmyxP6aMIPMEgW9COitlnCNkBS8tbf1ocgQkl5gRkwO\r\nGf2+hfnjuOuBHyTa84slhBYllPyyD48oDPxK9hZoZuUv2G9v7fnJ+TrOfWo2\r\nA8x1MZq2ChRcU1cksSPsTmZOfdU0hcYFDSg=\r\n=H6JL\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"f9b27084bc44ecd4530cd2252389b0dd8116709e","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.1","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.a7d8389e1.0","@material/rtl":"15.0.0-canary.a7d8389e1.0","@material/base":"15.0.0-canary.a7d8389e1.0","@material/theme":"15.0.0-canary.a7d8389e1.0","@material/ripple":"15.0.0-canary.a7d8389e1.0","@material/tokens":"15.0.0-canary.a7d8389e1.0","@material/animation":"15.0.0-canary.a7d8389e1.0","@material/elevation":"15.0.0-canary.a7d8389e1.0","@material/typography":"15.0.0-canary.a7d8389e1.0","@material/feature-targeting":"15.0.0-canary.a7d8389e1.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.a7d8389e1.0_1672167895101_0.5519050500650322","host":"s3://npm-registry-packages"}},"15.0.0-canary.8175d5eff.0":{"name":"@material/slider","version":"15.0.0-canary.8175d5eff.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.8175d5eff.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"5c3790b6519baa0eb26054efed9ea99178abfb3b","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.8175d5eff.0.tgz","fileCount":37,"integrity":"sha512-2xPvjwXDWaQIQFnK1kZGzDjXI6L5au/F2Hb1VPk0ZJQj0FDptWUfLmLoyicyPIVdzccOkqti7X6q18nJeX0riw==","signatures":[{"sig":"MEYCIQCJSTIedPcwsFput67psRDSTXBd/nSzNjOddYycJgHlZAIhAO3jalZBcK6Pbhrbr3+qWT/h3gU2s9A1vru6cxp5mJzj","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":881268,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjq6FmACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoyFQ//dhOZc1Kxt+4h6tQeJJ4fxAc5kWogxqhvsvNxKPhdEmeXDblP\r\nxCvpH6i5mo8QLw6DsV2NxcS2xWe6DOm3VAvS9AVpGtrstKMqYUox5qDeASlr\r\nHtCF19VxG8XYgFs40A/0vGQB5QSyqEW1AmVOVXNX0eHMAhsNi3kWfPvHjX9I\r\norekSFK/SNte7xEeT9347ZsgW6q7WnJwVyBZpMaGyZ+eOVrKlD7iVjxoOPxq\r\nSzw+jpxvHbS2CK/xWeFufnxOFjhUeC+PJfLpwxhUAl5bX3v7eENxy1iSxGlL\r\n8l0uSkDyVH+/cvPRaK6BGbfmOnFLgjKvarzZaez8bIqTNJdD6HTl4UmzW80U\r\n7gQoDzpQ+T/Ru/QYLyNimi34KoB9/H/HFtKM7cyrFlXvBBUua6rzghTN7ZR5\r\njIipb2imD13+qITPbGUhUyl0Iwq2rEv5zdA6N8EPepmuPu+PVKMUP9iEU024\r\nAcmVSTGPEobFVo1CrqHhEcF6UA0rfeySABEkdQZbqBKeQS+TEcojmEF6HFVA\r\nUK0ah1UxS6FRUvkJ0xQg74AC42M7olx5vjFX0XZ5bv0/k9G/6oVODLrm2wiF\r\ntRrqFMaoOv0P3OX9PrVNJ3cmxEzHXx31breb4RZq2FVKhbyq9jQsHQXohV9p\r\nQXVJ4rSAlEWXUjlAE6f7lI8TL/8XKmzAiMQ=\r\n=A5q0\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"c3bb551a6b32480853dcc8e29f7f8513d62154a2","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.1","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.8175d5eff.0","@material/rtl":"15.0.0-canary.8175d5eff.0","@material/base":"15.0.0-canary.8175d5eff.0","@material/theme":"15.0.0-canary.8175d5eff.0","@material/ripple":"15.0.0-canary.8175d5eff.0","@material/tokens":"15.0.0-canary.8175d5eff.0","@material/animation":"15.0.0-canary.8175d5eff.0","@material/elevation":"15.0.0-canary.8175d5eff.0","@material/typography":"15.0.0-canary.8175d5eff.0","@material/feature-targeting":"15.0.0-canary.8175d5eff.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.8175d5eff.0_1672192358212_0.5817170787006638","host":"s3://npm-registry-packages"}},"15.0.0-canary.e21dcb86d.0":{"name":"@material/slider","version":"15.0.0-canary.e21dcb86d.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.e21dcb86d.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"a91e7910eaa6f21c97246078b995b6411471db94","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.e21dcb86d.0.tgz","fileCount":37,"integrity":"sha512-0m5z6deBDX7kv91xNgepFA5G8Ruyk1lkYQEKMuR+BGA8PjWDlpuI4vyrotF5785JgY1U2w7y1zsRqdW81bnjmQ==","signatures":[{"sig":"MEUCIQDw/LM8sOLtavJ0sZvchc74VYmlcyzBr7o3pW/VcO1OCgIgJy5xKXJwOEhjH8rwfnqx0qmfAI1fF0CGzudjs32uMhA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":881617,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjrZ4fACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoFNBAAksHfNJxoQX8zTRfo8C4Me++Ax2Ou2wb4KpsqMRip3UZIhcMe\r\ne3E2iyzG/I3o9xC4ap/2kj42TSXuhGCjfdUIMMdD77OZB7v+PTWYBH6WZQFB\r\nS16fqQYF7RIy6iUW2Abs/qu3GjW3AHxgNi3Eqb7zYf9xl0Op5wcVnlYefMdy\r\n6Zdt/gIjcNelpqa4v+AaIMu3OqNetQkBll9i+QaUDQCAmp3NtgcTltFwGPaf\r\nXeDDfH94TDcQMmvr+SFEc5isndDv1FgxYWvqx9G8sAhnthJ6ZQ4O/1Rr9ERe\r\nr1agN6Nj1aTqXPgR1DrfxDVQKr9FuFrTVuIwJS0cppw7riXO5qEHF1gDXHCY\r\n8q2yzb59drUQ+gZnxD8KSQqGkQD6Km4BMMPoR1vHeAB6OZ8oVVQdb3ERylm0\r\ni0EEHY5DxMF62mMOo3y4QL/ICE8U7LAFGjoTq87GckZmI+5S5KXuYB9rqfsc\r\nAz4KSbXGelDYBAFAsNboWSAwjcucEHSPInJ4oXDYupT/ZYniscMmMgEcwomj\r\n+uDr0OhNBjOdLSZOzjl0H3TZKBdsE8+TlJ1qs7qYToW8y87QE6ySpQqPt+dQ\r\nqDtQ5XdNtCOUl7FZgT4lAqxu7cQFB9YCMqx6uAECO+fyd9zekQLQ2Z4ub1GU\r\nJ8OZ10USA60pdTAHO3YuM15quTLhDBRplAw=\r\n=K9bV\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"a32b4ac6d2bad60870533296fbc4acf050735b8f","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.1","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.e21dcb86d.0","@material/rtl":"15.0.0-canary.e21dcb86d.0","@material/base":"15.0.0-canary.e21dcb86d.0","@material/theme":"15.0.0-canary.e21dcb86d.0","@material/ripple":"15.0.0-canary.e21dcb86d.0","@material/tokens":"15.0.0-canary.e21dcb86d.0","@material/animation":"15.0.0-canary.e21dcb86d.0","@material/elevation":"15.0.0-canary.e21dcb86d.0","@material/typography":"15.0.0-canary.e21dcb86d.0","@material/feature-targeting":"15.0.0-canary.e21dcb86d.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.e21dcb86d.0_1672322590982_0.45676614028894447","host":"s3://npm-registry-packages"}},"15.0.0-canary.20ab6f5a8.0":{"name":"@material/slider","version":"15.0.0-canary.20ab6f5a8.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.20ab6f5a8.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"4b68c51f94c4a6884eb8849adf1fad7fe7f52bb9","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.20ab6f5a8.0.tgz","fileCount":37,"integrity":"sha512-5G+ejQpeTxu8PQxCR0t/3wyyEadiT51p5E1LkveX8bXA6q6hUMtOvNG5HXE90VKNUqLAJbIqt2xphLzP/YSj9w==","signatures":[{"sig":"MEUCIQCNGbb2qMJnkagjuAJfVNuVrP1YaLD77OVJ9crFCZCX0AIgfsNtsERt4nOukgQopVXaATm0zn3NbLjOYAL89YxUf4U=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":881617,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjre2DACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr17hAAkdlTgyjk76u1FYut9R5eufW9HU81s8T03+Ow5lxO+cX4Yglp\r\nUSC8TCcRwcH+vYXgP4kQ0Vgme2U2bpJMzeyQgsm1NgWpwh8Y1JnL40y2sgxI\r\nZqF1wdwRA/sEkrkD6RQ9Z66GDikSZU/bmcWRtQTpJdqvEpSG58aiC2pwclN6\r\nAAtUEDXPBSTVPWRYs9N/GBgvZ/U3QEJdl1uMzMIVkeYqHIDyMJp0sD+DZtOo\r\nlLDlvfpyoYl4VlxDYlCex36OsDJQFggtJN/4rD5Enigch7NnCXXNdMwoWOaV\r\nikA1kRyd+iFxHDHSe9BtcZBkGa6VLo4nWs+s9LnwnDVHOWhO8L1adm/0D6ba\r\nJLNVK0YUP5x04dq6T7uikZt4gH6VpWYdN/XJ6+V+PJz1eQkdaJonKsgiUPin\r\nx/rdmsEPKah5PXqeFojgeF3BBQIeajfZixtxLVF4dqFIZ8JtnNIZ4ag5Iy2k\r\nffAk72/vRVcRZU9aqySxovvagCId22VqO0jCNjB0dLEKH+R7knLb1fWwhFJs\r\n1QIFzPwWvSSJTSkCEX8OgwDM6PSXr31vc5Tnno+NsIdsM43GuUZed6chT5Ox\r\nEJT5WLK/1nwOu8DfI14SfAT7Ca8OFRe208/OhX1qcdEG/n/7wuIZLoPA81+i\r\nSRXTMKbh6UzOAOfbEGavPbL6Nt+fPxVj+pY=\r\n=BlqD\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"abf2135af6e71ea44b6e6a4de17493e5923f7255","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.1","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.20ab6f5a8.0","@material/rtl":"15.0.0-canary.20ab6f5a8.0","@material/base":"15.0.0-canary.20ab6f5a8.0","@material/theme":"15.0.0-canary.20ab6f5a8.0","@material/ripple":"15.0.0-canary.20ab6f5a8.0","@material/tokens":"15.0.0-canary.20ab6f5a8.0","@material/animation":"15.0.0-canary.20ab6f5a8.0","@material/elevation":"15.0.0-canary.20ab6f5a8.0","@material/typography":"15.0.0-canary.20ab6f5a8.0","@material/feature-targeting":"15.0.0-canary.20ab6f5a8.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.20ab6f5a8.0_1672342914969_0.620267394821105","host":"s3://npm-registry-packages"}},"15.0.0-canary.b9806f623.0":{"name":"@material/slider","version":"15.0.0-canary.b9806f623.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.b9806f623.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"7d2e2a81360f01439c38daf69c1731a9f1c7a980","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.b9806f623.0.tgz","fileCount":37,"integrity":"sha512-iFejxNKcozww+RtQUgnwQAKpL4yers2XgtjsoWp40AF7uIIDDJhQpNSm8ZqkuwMY6cUa+Kb1fv8kB80AmjDoKQ==","signatures":[{"sig":"MEYCIQD39NrK7R3v0mjd15IT7y5GIuAPOz2OhKYA5ntFflRjcwIhAN27BhdK2z1GTEuKWrYE8MuvPJLLiZvhSeYJR7c7k/s3","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":882439,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjrh2OACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqhExAAi4c6EWgUn+uCfGDCyQ6JQRyE7KRpWE1dqEulISdESG8FhtP0\r\n1LnW59gHhhwPokdfWNOR7VO8S3MC45Kut0BvepZ6582Zacm7IThoVZ65v0f3\r\noV5JOzMOibAvzs+wIkH1v7K8dSKp7KRjLSgfWC8Q0Amrl2EJb0TWJDh37G/g\r\n9q9kPzTfwpkJVplSIvAt55yz5u7ZAE4Xib8Qf/ds4CD7DzkWVM1FtsubSjT0\r\nNevM0LgGP+83If7IUArGblYES8uT8vjMoFFHodotfWFrvXtt6zvQMCR+HDjM\r\nrop2kBhFw4LPHO4za9P0JCNmcQH5+qrD255L3iLWxzLvV2GetTMe0ldsFtZL\r\nYHUVNaK0uI+lOii+RmrQVlExa/QLtj0dMChYKdmb1hVTmxkDCGP1MKAENsJ7\r\nH4cKR/lHEXqQobLW/osD2HC/J2PMqr3gSHoRwOrXF/w8uD/YkEJ+L7rcoqqd\r\nR4CwLg33fm0L/9loU+SwMmBY0b3kNUoAUgHYPm8lYCVQ1od66Sf6H4+AojzM\r\nwB8FjxzxynngOuXUF3/gVjbUrkj4S9+BbMYN/P84mkWcJktrS9PLVCcyx0cw\r\nLoTSYJcpVqZ5vgTkJYwsL1zRjm2xk+m281oodymMVvXvymJ0T39MQm67HsRh\r\nJhqqGAZD0qU1Ihb4EEl7jtbGYq0vkawxm6E=\r\n=MIEG\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"0eb4b8fcbfba4d68dffe3a2b5c7478e69e2e2eb9","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.1","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.b9806f623.0","@material/rtl":"15.0.0-canary.b9806f623.0","@material/base":"15.0.0-canary.b9806f623.0","@material/theme":"15.0.0-canary.b9806f623.0","@material/ripple":"15.0.0-canary.b9806f623.0","@material/tokens":"15.0.0-canary.b9806f623.0","@material/animation":"15.0.0-canary.b9806f623.0","@material/elevation":"15.0.0-canary.b9806f623.0","@material/typography":"15.0.0-canary.b9806f623.0","@material/feature-targeting":"15.0.0-canary.b9806f623.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.b9806f623.0_1672355214166_0.3786927553735282","host":"s3://npm-registry-packages"}},"15.0.0-canary.50c9f550e.0":{"name":"@material/slider","version":"15.0.0-canary.50c9f550e.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.50c9f550e.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"5b33cafe3a1602f9cdabcccb832eb4b19e8f23fb","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.50c9f550e.0.tgz","fileCount":37,"integrity":"sha512-M6mbzdZ/oCwWqENaDGUmUBr8rmfje8+3w4ckwrvvUFYJVMWentHKt/0h+/2GneCLuTtW0uCE6DhThKDFjbqwDQ==","signatures":[{"sig":"MEYCIQD5hq+ZCj4Qwh3Roo/ZuqA0i6bJ7epoCW6cRAPDDDhyXQIhAIbKrvsjhYTNS7tUM1zQNWnDz5yB09idGF2/jBJyIVlp","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":882439,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjtE5YACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrnGw/+OmWxHD4sAFpwWddt11jMJupPiWMiqW8O9S/5bulYePPX2Z9K\r\nlz/2FMmSsxMjjmM1A98FAk5Jlxh1tQlpFqa0Wm9xxlywK+x7TGQJLvGsY9HU\r\nP5LezsWrsTRLre0/RqMzVrOqUdgdB+/M1pyRHwm83UMhG476ptHT0+c1FlE/\r\nIWbUk7NNODU7v5Guom177pNkNrpSrCe7PUVVHUhOMqUG2Pqy0jF7jxtZw1BR\r\nNY5Jb8q49N8K1/bPTGqvXE1OuSwnyOiy6uRTy1HMRPUufIMcRQ7wFbwXKu9U\r\njinqk1dW2SVXIeV67PZi372Jg0sOq20QRse0rKLWIwTA2maCjaM4d3Tq5YEV\r\ntwedt1Nsti8tXj+ExH539nPy7ZP2DP1C9VuXfm3gJgh2/A9JcKjuoJzvicS4\r\nefiwly2eCHPrVuvZ0qLLcjaHEncXzHoez7kdG+0evkdVCOHoMUKtrTQZPBPO\r\nuVvmCFLDkT86FGgJqJTzbHt1SQAAlBqsegtpWWMCo3NYXteljurciP78lD0I\r\no5GGaOx1QnHfazm1LhYOY4pobmYb7ck2Edy4c+2sBeOlb5g1gBzbnrpew8lH\r\nLK8h4mwkoM2TtF4ggeF6/Cn0sKSh+v+NCNMs0DWWtLRPDua/X9be2v/rvIIl\r\njyrlxMD4CXLo+f/sE9T8hlhotyddowbifqk=\r\n=N35p\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"d020b19d0ab5525ccca1f803a00e184efafb15e3","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.1","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.50c9f550e.0","@material/rtl":"15.0.0-canary.50c9f550e.0","@material/base":"15.0.0-canary.50c9f550e.0","@material/theme":"15.0.0-canary.50c9f550e.0","@material/ripple":"15.0.0-canary.50c9f550e.0","@material/tokens":"15.0.0-canary.50c9f550e.0","@material/animation":"15.0.0-canary.50c9f550e.0","@material/elevation":"15.0.0-canary.50c9f550e.0","@material/typography":"15.0.0-canary.50c9f550e.0","@material/feature-targeting":"15.0.0-canary.50c9f550e.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.50c9f550e.0_1672760919742_0.8368298180610723","host":"s3://npm-registry-packages"}},"15.0.0-canary.af490a848.0":{"name":"@material/slider","version":"15.0.0-canary.af490a848.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.af490a848.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"578f45e129e800858d0cf72fbe4cd087508c4412","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.af490a848.0.tgz","fileCount":37,"integrity":"sha512-k7ValyhEMV8rK8vE4B7BKAzl/KVC8xyzeAw5SilPaXYomSRC8w04+MnFH7z8wyH27T8z1RWGBUC6nI/oXHM1Kw==","signatures":[{"sig":"MEQCIGEeP06cewTDx6jrpVby0AcZ0DsakZG2UYWwhKeBIyCJAiAc+Q3XitWISmUK1q696V9mTEcS6gLjq43nLpIRI5LXQg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":882439,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjtFCuACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrwRQ//Ykh5UQDSWajBRjUS1Fzc2izzeyrzhJnORM5b4eXkP1PJiyDB\r\nqtqCMZKsDpdRDD1McFi5HqyJ9r/71OsQwmg68PN3awi08SkIJJ6AOLkVcWvi\r\nndwmMFDBZtPKL4fRxnzImSjKCbDOQPo49hKxBv6IJnpSQS/WMszB2ABfQXrc\r\n/Mz1Dt3E44G4vfq7+4srRRPxUjoKzLPphHV5q7SeQ3z3lq3brpra80teqOdh\r\nh2SUTAc3n04Gw27Zz1D/RpAYXYRPM3QHJ2wRpr5aWkOTjMdIeHJXtV38AMLp\r\nxrFySAC2alQ2KCxaXU8jpf8b+V3cOkoc5mMBki4GhpZXY3UfjCtbgBKDsIkS\r\nVqjILfwCJWK30M3QBRz/mwlaDHkT/ervvMPsHfakl5A5ovRKiFA5L8V6p+Qx\r\nQHumlk70erc5pKhXb/ClKOO7DTRsv+00jzpj24nhkPmireHNQCEw9WVsLILA\r\nIVCOZsbObWF1m04yRtbzcZq52L0pBKUMXdoKvQK54B3E6WgdK5fhOxPkLB57\r\nvEuRTDPBawpab0qeAjqhAT7qSgQWeLCvwykNYGrHB2aiHTGCEQDzTo4CI1dl\r\nMC5mWhENGVo3UrWC+rM4tWbMcAybqeJA+Dq3aRpJfB4DIjdCgMActs0OPk4O\r\n7KBo9QeoASDvqHjVZzrg1jh5d8izwjouThg=\r\n=zHmw\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"95f5499a3dea1763e53574fb3b884e8e45cc974e","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.1","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.af490a848.0","@material/rtl":"15.0.0-canary.af490a848.0","@material/base":"15.0.0-canary.af490a848.0","@material/theme":"15.0.0-canary.af490a848.0","@material/ripple":"15.0.0-canary.af490a848.0","@material/tokens":"15.0.0-canary.af490a848.0","@material/animation":"15.0.0-canary.af490a848.0","@material/elevation":"15.0.0-canary.af490a848.0","@material/typography":"15.0.0-canary.af490a848.0","@material/feature-targeting":"15.0.0-canary.af490a848.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.af490a848.0_1672761518370_0.281709943813073","host":"s3://npm-registry-packages"}},"15.0.0-canary.7cf487c98.0":{"name":"@material/slider","version":"15.0.0-canary.7cf487c98.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.7cf487c98.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"ceab942a484a912621e019b1c812d02c6aad424a","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.7cf487c98.0.tgz","fileCount":37,"integrity":"sha512-+nNWmHSQMnlsN0T0dcbeAFp2oKQuPC+xuyqLUHkTm2N34tPk9uzhap+HWthR9DsPM9MCgSGbEkiAGDZ9Uy5uKw==","signatures":[{"sig":"MEQCIGbl15FjxDs0/OyBPKtPV9NQda5k5ErwE+SbTfRMCdLkAiAW2goXAPsXMbU2Dn26feNIIdnHZLfcJzDWAfqy5EiO2Q==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":882439,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjtGhiACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmp2AQ/+O8FKQtRfB1oithRSJmMzZqiA49gvXdFjUf+ibOCpyJ6X1raq\r\n9/ZIfZ3McwCW33dmY2dx6RIVbB/ixhrmeZyzuWw3wou5pjddyJsKUWBm/Pkb\r\n7K06l6DzxaJGicOn781jaU1mvRS03HYzh0s2ygj1biYp9jolUFVz9Cg3YQyw\r\nZht/YYjqi1Mt36XCKbtf05ksT9mmV/0x/QCmaA3SN55AKt7KfX28qTeWSiqQ\r\nBCWIBQFkyeditWJzcT5dBNw7ENGnDhM2l6cRltXlxemD4OpzhvvaE5J6U1Ah\r\nn2RjGxy6PNtwzTg1/sNp2aI3aj7enHPv4d6ZqHQrPqJt8SzgLSC4VOL4ocNy\r\nET7WeBJ3DuFA0R+FPZjnZ/oPcGSgjWZsHDhdJj6uYA05+zUbZg+Y/5wOySrC\r\nKcEQQKzxlO6xZEO4cBCHjWmiW2e30mqkic7/+HvzjDnNGb6hsqxAUNvB/I8R\r\nQ1nFU6BbEu977TRSzn9h+hGtvpjPujZeNPMxFfK4O5z5LxI3sSHW6P3bTNDW\r\neDZ1JWQOrrT0OapOAutOdQtjekN7xpjMSaF+SGhF27LXbcGp6IC77BNHu5QZ\r\nzXS1Vu2rmVzn6CHW84T6o+oIfhi643aoZItWIvzw0P/oYws56FAabWb1/WJC\r\nPa3WptGV3cIoeFTARpFxuIJYEtTCdBLHL8A=\r\n=skhq\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"8d246270c785ca072651213aa63882309c7cd5ae","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.1","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.7cf487c98.0","@material/rtl":"15.0.0-canary.7cf487c98.0","@material/base":"15.0.0-canary.7cf487c98.0","@material/theme":"15.0.0-canary.7cf487c98.0","@material/ripple":"15.0.0-canary.7cf487c98.0","@material/tokens":"15.0.0-canary.7cf487c98.0","@material/animation":"15.0.0-canary.7cf487c98.0","@material/elevation":"15.0.0-canary.7cf487c98.0","@material/typography":"15.0.0-canary.7cf487c98.0","@material/feature-targeting":"15.0.0-canary.7cf487c98.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.7cf487c98.0_1672767586322_0.09644007432762991","host":"s3://npm-registry-packages"}},"15.0.0-canary.a52be2d5e.0":{"name":"@material/slider","version":"15.0.0-canary.a52be2d5e.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.a52be2d5e.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"7155df816b1eca1db90287addf03aeae0c14f7d1","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.a52be2d5e.0.tgz","fileCount":37,"integrity":"sha512-+3gDwpchlUPqNLLzLGP+E4ZP581wo7XeuUJA2lEI9HR0yR1J+YR3gWcHfPjaBZ95jMpjIaDChG+Nr5gE+nqmAQ==","signatures":[{"sig":"MEUCIDmkDPBKGoBb5I32oCbVDW07XhFIuJyQhLqLHxa0KEWxAiEAgnvFkgqpz4no/ESlm8F0XWadETch4a0ug2HR6q9dmzc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1220413,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjtH5/ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoT+g//fEdpvO5VmVQmk4H2yGh3Ueks1Jt12/8t4SjkUnyUXlm4tARm\r\nYY7PbEVC6EdeBN/U2dL/fkpSISPiK/DY983BCS3JmZxhuuOkYgARkyq8ILFD\r\n3xTJqbWvAyEzT99dlsubvZHh36pYfFs1nHjZQstjRf6g35Ge8Luu7T9dFk1m\r\nhiwghijy1IA0elCMGeZlugaN7D+z3lOA/dqGGHCU/HVxOrwobGIHg2he7wRu\r\n2w49orKt0kqcIysNhiwJICiO0o+LCrgV3xjiOKyTMXPkFW4PEZ8/67sZQ00H\r\nle72c9dYqyKIMj96uGkJgi1aMXUKxBShw7NQKrxdZTTaI4/GD9ZXTp4dZDuh\r\nQy6/cCsKWSfUkI0IeR3eDLvgTa4PPVrDHLFc0xxJVKfbHxQZusAdToRTIBbE\r\nbZ3JMFAUqL2jUQnFsi+OAzRDcg7kbf9eH16ooPkaVansMZ8KgKBS9Q8eErfZ\r\nyF4wU3CXeUK8zG+a3C4uTnluIXRuMx4T1G+XfO3LazIfwBi9YsD3MzN4H9yH\r\nJhTxobyouAqA5E+MOKUPtl5Hk7XQN4rQ0XaNr40MXfePutsgp0+9qGyM13fD\r\nLWj+hj2Tn+OQUVAWAE7q1AjZx1OqmUR8sW/mH0dNcAmmTyl9hVH4X1gtPo2B\r\nijYIp6sNkjE5q777HtH0xGViecHBBN3bBZM=\r\n=I6Ux\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"6c2c2b2b16d0188fcfc620c5bd95622d34ab600e","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.1","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.a52be2d5e.0","@material/rtl":"15.0.0-canary.a52be2d5e.0","@material/base":"15.0.0-canary.a52be2d5e.0","@material/theme":"15.0.0-canary.a52be2d5e.0","@material/ripple":"15.0.0-canary.a52be2d5e.0","@material/tokens":"15.0.0-canary.a52be2d5e.0","@material/animation":"15.0.0-canary.a52be2d5e.0","@material/elevation":"15.0.0-canary.a52be2d5e.0","@material/typography":"15.0.0-canary.a52be2d5e.0","@material/feature-targeting":"15.0.0-canary.a52be2d5e.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.a52be2d5e.0_1672773246877_0.38928886877648083","host":"s3://npm-registry-packages"}},"15.0.0-canary.e38ba17c5.0":{"name":"@material/slider","version":"15.0.0-canary.e38ba17c5.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.e38ba17c5.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"505b7deccfd30e6948353fd8207c2515039eab25","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.e38ba17c5.0.tgz","fileCount":37,"integrity":"sha512-bcOsrALsjpdZlyZz6a9So/yMWM4zu1L9DEza4TKcIYleEMdvgCaz/BWNL1TbeH46FZEbV4SswIwZm+BQLwRuww==","signatures":[{"sig":"MEQCIBEL4KHc6pk0WGEz5MGaVlwiy6j2+NptXs5uWPkmMxsDAiBWPH1CJnxgx15rdtgDn6l5LJNBeYJ1Oi0P3mE25UEn+Q==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1219420,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjtK01ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmobrQ/9HEHcNbKJIH/y0hdsuhpl4qMn2smKJJ8ieHQybbkuwm/+aRWP\r\nc78vhnbPUH1jzJh09w9nJNAnAYS+BKveCBJ25QkHXfNpXiVODQyck0Sc6Vpa\r\nRjOVNdF9+Mn/OwcWzHfm/ITFypYaXcFg2rNqxDmgNfkuyQL7Y4fjd2rNI+8r\r\n2i5YFT26W8IIs6Jn9JOUzSvbgur5E/nSRvmKhwYh5wtYoexI/5yWFrL9HsqY\r\nbUcCdboNY9D0TxgBfDXVE8FUHNYDqCvIIwmwR8sI7WOD7AQPijasj1J/AiIT\r\np7rfYxx3xO4YLJt+5fsc/cvltuTookb54Lusr6yYvUmajBRn6uBoIOtqvkKE\r\n79BwvfsMLE1Vl7G5BjD57OsA2QNBTabHKueQPxkTcqO+TPFwRUYDqwlvFacZ\r\nFJ2OV+NxEFK3jpO/PtnU1m6pPNI0WOhv8QkBQSV7Xl4eOIZMdchVpMVVz2i/\r\nPn2mf5a/6M4vLheMxczYXHpLvN+Nv4BdL85pkkP/vUP+6ZExoylgyOjg5EBo\r\no99AYgwJ4y8jjqfkdUBJfHlb7O2m1WlnLYbQ+O1pFiK04QbEYR2tPcFhHXrk\r\njXEm1n6Iblyrpb7bKOsl5kPy2rBYkrQ47QS9DBSzeBch+BKIF1u0z71dfw0T\r\nf2YfUtx/DpORK7an57cWeFSd45ZPfkxm6Hc=\r\n=CZct\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"d44100693c450240b468ed28efc3841fdde62da4","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.1","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.e38ba17c5.0","@material/rtl":"15.0.0-canary.e38ba17c5.0","@material/base":"15.0.0-canary.e38ba17c5.0","@material/theme":"15.0.0-canary.e38ba17c5.0","@material/ripple":"15.0.0-canary.e38ba17c5.0","@material/tokens":"15.0.0-canary.e38ba17c5.0","@material/animation":"15.0.0-canary.e38ba17c5.0","@material/elevation":"15.0.0-canary.e38ba17c5.0","@material/typography":"15.0.0-canary.e38ba17c5.0","@material/feature-targeting":"15.0.0-canary.e38ba17c5.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.e38ba17c5.0_1672785205367_0.9688757212899959","host":"s3://npm-registry-packages"}},"15.0.0-canary.49041a6c3.0":{"name":"@material/slider","version":"15.0.0-canary.49041a6c3.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.49041a6c3.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"74b1f718f465468f3ed74e0f52f0eea4ba7552bd","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.49041a6c3.0.tgz","fileCount":37,"integrity":"sha512-H4XkvhGWLxQhXA8wq1Q1SjCRXDuGmrDKvGzZ7zFUJJSWca0fP9aFZFTHxiVEMNDMSMzZn6Q5bGwMfDZS+neVqg==","signatures":[{"sig":"MEYCIQCBbpReTwnQ8iF/7wM7OLXjXeZDprsa0DE1iZ7/Oxh3IQIhAJwvT72lrpOIUcs1/u7DwuP8vPFIM4sSMbKPELhHaE64","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1219420,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjtZjVACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq4QQ/9FUFITSGnq7Rh7v+FVVOwRXBD+kXHUZmsGNpoJpyPQRXzY8Vx\r\nbhubvkW2sWbd0hmXQIUfWiDnqE5cXg6NBFguHcAbDojFV35f+itbCxaLwSCa\r\nqUVMXZMlpxz7Aq6xfhR9Ujw+g+vefjJvRrHFuFjI/PPSI/ATXdQ5PuTLFZZj\r\nWfI5GwiwYe5F8X5qCVoUJW5POU/14HcYGyLI9x0e7RNSFuH/kQ+3fHT8elip\r\n+3Al11l7Y0P3KAcEic2tmWHWFWm7VFazczSmjBstbeZNkUw8axgkLk4lnDFI\r\nNV/ZfE0MBwHES83VSp3wv041tlTu5Gd6P6ZDsbzsU/g7qM0gTocAVZSoByRB\r\nPZb7iLbDjFQfDDDsaYJsQqeO0o7cb4gIG7hx+5I6pkcu+FJ3ClN6nuGvlj8A\r\nSC33uP21wW9OjdYb06W2VMj+z0YxevWC5gmTEYoM0e/LXB7X1aI5fZF3DF6+\r\ncsnfY/2aqHd1ni507S+YgWIHBbRpX74tFk/uq/I7e2qRu+TeoAvhjxH+jCey\r\n9ByMAH2BWlh1vb2q4mHnXOzljPYjt9KFulROHnWcRlF5CQPjeFjDAxHRV5iV\r\nVw8q1RW7Lm+qgA0DWyfiawId+HOVBNBk97NrbKH3seeP6jjaGyGHAdj5jjWb\r\n5UqKolYTU03Wt0qSPOq77x84nFiGtasZ7fI=\r\n=wMI4\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"f012497ba1285ac3de691b5e25afe7a21ff62bdf","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.1","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.49041a6c3.0","@material/rtl":"15.0.0-canary.49041a6c3.0","@material/base":"15.0.0-canary.49041a6c3.0","@material/theme":"15.0.0-canary.49041a6c3.0","@material/ripple":"15.0.0-canary.49041a6c3.0","@material/tokens":"15.0.0-canary.49041a6c3.0","@material/animation":"15.0.0-canary.49041a6c3.0","@material/elevation":"15.0.0-canary.49041a6c3.0","@material/typography":"15.0.0-canary.49041a6c3.0","@material/feature-targeting":"15.0.0-canary.49041a6c3.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.49041a6c3.0_1672845525614_0.07430109865531986","host":"s3://npm-registry-packages"}},"15.0.0-canary.c492898c2.0":{"name":"@material/slider","version":"15.0.0-canary.c492898c2.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.c492898c2.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"c10d709c86f23e0e46ae8bfabc96ad99fa9d26a8","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.c492898c2.0.tgz","fileCount":37,"integrity":"sha512-1xbsa+qMNzkHKkIf6QWeXJoFvFhz+MyMP4FnuuY59N9tUBfWg0Xtn7SmlpadVy56PQEUcdY4QR2KF4RQOKWIyw==","signatures":[{"sig":"MEUCID+bOh9Fc3QjT4C7NjBJMeBS54C68poMXge8YQv/YaPzAiEA71wtw9z9rPzW5pTFU0h0dSWtgkEA4nTIM3FyhnL9cIY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1219420,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjtbmMACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmogCA//U6X9PaqLTZZxIbgVuhUZKnBXY3x7F7lGNtSFTXBifNsoR+ww\r\nNtQstgqaxizUPa8WvNgGwDc/nyMGtiRvtlglJkN/GYhhKdAInQ48jZnAOsmJ\r\nsTLvCL22YJrnMJMginlh0vI7bTtGKsEu457KDCZ6FG0H/ImoPa6DH0+c55tT\r\nqyy3zIynbx4K+MCKL6D1fmrXkRzCc9xTOoMebBsvc63UfHB6/KUlQn3nt44K\r\nG7bwwhWHxtyEGHdg8y7mVGfjJ3Qw/+DsAhj+Ci8OWPZ9DDn6+Z6bZL+tv+/X\r\npix+3H/kbTdWEwIsUljSTv6WEFf7hFHhRhVTVmhG6hD5ltUWCrfsiZO8BrPv\r\nJbBpCFmYT75uWyVPjFDXwITQf1O0T/OV4gB3gIN2enJP2wBTP5BCn8kT/P4p\r\nfrV3red4bEhxLPKTCRW2MkER7rC30+lsmUe0mQv384jAPWcVEnYXLfjcERuu\r\ns6MmeKn3r1W8MdB9l935T6vYHJSr6iGG/tKBnQ0z+EFamlvO9fB0Nob4W+ke\r\nEjwzGUBtnA3gE2m+maip5AtmTI7tghUA9a6TCQXv6qfNEuvi9ikDdPJXKbmX\r\nxNe2mG7Mwp1knJhFLAXYlmD0qsURJdMa6Uu7iExUCSEq8y9OmhcHuTejWTbC\r\noQlgzj5+AxcoHpf47tVQN8hN9MlBRVGM2mk=\r\n=XgpK\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"8f57d41cc546a15258de2fac7e4ddca48b2987ee","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.1","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.c492898c2.0","@material/rtl":"15.0.0-canary.c492898c2.0","@material/base":"15.0.0-canary.c492898c2.0","@material/theme":"15.0.0-canary.c492898c2.0","@material/ripple":"15.0.0-canary.c492898c2.0","@material/tokens":"15.0.0-canary.c492898c2.0","@material/animation":"15.0.0-canary.c492898c2.0","@material/elevation":"15.0.0-canary.c492898c2.0","@material/typography":"15.0.0-canary.c492898c2.0","@material/feature-targeting":"15.0.0-canary.c492898c2.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.c492898c2.0_1672853900306_0.7288519500361546","host":"s3://npm-registry-packages"}},"15.0.0-canary.d7a2277de.0":{"name":"@material/slider","version":"15.0.0-canary.d7a2277de.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.d7a2277de.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"12a1511cf16c984aebde9cebe32fbd0039a038d5","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.d7a2277de.0.tgz","fileCount":37,"integrity":"sha512-GNDQy7EXKLvRtq60JjjyuPykb7+vk8mEy2KIeV6L8EF9pXgOAFPhWpnKMfleqiEtU0044/+NtOoDNJmspMQUsA==","signatures":[{"sig":"MEQCICoDwbBAqRH2tocW64Ik82TryxlJ6sj5w/ntKKlfngYCAiByAr73GoX7I7OzaUu1QO6qCavrdtyWkRjRpXRchgGpdQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1219591,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjtfFrACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmoubw//bs1y8faZY8gOvKYVKKwHzvcstMM8g/qqA9W6ezD1jROQaO/G\r\neC+iAvAYKHuYiJ/YZL5Q2G3sBStn7IH4ZmOlOsTdLmN3iIz72LRHvY9OVMPa\r\nNjie1sNzEZyjRcBFJxMpW3GYWo5riW9wxBb0xPovs5mbaSJDVudNn8TkYHWa\r\n1p8Lk02OdnVdRIGGCoYZuHhuH1UHGF+cqh/wT9y3pZhIsIumg5+U0yJHySwc\r\nIlU/7xZVKUIvWqOxSR/Bx6RMHjEsNC0Zv5jcp2lLzT6bI2y4MnBEOF1KZ0jb\r\nidlOZGWYL3+2OYdpWPm75wDsxC0/+5Z/Vmh0JgKMiSLu0zq2VHUhSADrtP17\r\n8l1NVgQhEg4H0rzi5+P4c3j0oJE8sJVRPUmsWDhu3qQeqzICEheLXSdY/BV+\r\n9ej6crrLaKY/8z/rhhUe+zksonVpBhPuGXITAPJZIRw24hr9bPp0dyQC5GPY\r\neqXmuo1TDoxbRDaH/W8kp+QZOQoOQPYWsycRC8Gi0i+W10jNgVvzyG5U3Nlm\r\nCRirx2nxPETqewCKjwmL4GYrpz1T6uz4iVPhQXPdY4Ivmn2RDdjIDLgvQ74F\r\naYWQEZBccOnR6aCBFeVtld5+gyvFHOe6dp5ofaVWXlTHdLUbtV/vQxzoVaCm\r\nWkTL+XxQIKMjIDQ9A2lI02VlmOSSoPtcNmk=\r\n=mOkZ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"f9c71e947019fdd0ca8837669de0401f3752d1f3","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.1","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.d7a2277de.0","@material/rtl":"15.0.0-canary.d7a2277de.0","@material/base":"15.0.0-canary.d7a2277de.0","@material/theme":"15.0.0-canary.d7a2277de.0","@material/ripple":"15.0.0-canary.d7a2277de.0","@material/tokens":"15.0.0-canary.d7a2277de.0","@material/animation":"15.0.0-canary.d7a2277de.0","@material/elevation":"15.0.0-canary.d7a2277de.0","@material/typography":"15.0.0-canary.d7a2277de.0","@material/feature-targeting":"15.0.0-canary.d7a2277de.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.d7a2277de.0_1672868202784_0.2842236381731442","host":"s3://npm-registry-packages"}},"15.0.0-canary.fd95ca7ef.0":{"name":"@material/slider","version":"15.0.0-canary.fd95ca7ef.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.fd95ca7ef.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"34948bf57d2381c53c76616b1dab8c4edad0eeba","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.fd95ca7ef.0.tgz","fileCount":37,"integrity":"sha512-W8yBQrKfOjFD/cZWn543L0JjFBsPAyRMHkQzN0qw89AAR/SK4cw3b6sRoJqEHIPY6aZDWBYW1bESi09WM4lpZA==","signatures":[{"sig":"MEUCIFAP5zU53OMbIQb4rANGoQeZtUmSSpzDaxkJN2D6M4QhAiEAznKz3WzA6BnpqUEXRyt0k3HARZemOnnnCCacEVD+Obw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1219639,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjtiH2ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmof9w/9FCo0PVlBKN9gJTR1I4TB450a2+Pi+3kjDoWPao2qJJJ3zwGs\r\ncQNGhIKmXg9owvoRIbnd23TPwF9OHo3j1OhH/tmrAM9c3FLRRfu465xPb2pv\r\nua5yRg7U8wFHHsTT8FAu47wEwzmilGjhgrh9LYTnn6SY3EwtyFkVnyGfarOD\r\n9vq9rbKd7spmButgdFV+exEAVv+uR+vig0EdMU+hGd55Fw1tIu//yiaUvdWa\r\nrq4sV3GTrjxXOuq09UEox12KjbI/2gY4Be7jAe60/iBz2FsBEfIE6AyPI80a\r\nLlcL/SDXfm99ODraYAkXzfOrGNTa+jRLmvVSrXmMYsMNsI8cE1iGqO0W6yz8\r\n+6qVX/b5Ba2P2yF1m447Mq9RZtf0jBEYoT9Vg7CrNvQmu8X2KlGCGJqX0mSJ\r\nfkJDMpmkgeA6OwmLVayvhYWnyad2HA7Xe6W2aPAysZht8goDka12usRnduO5\r\nCeSrT24FJOn5EuujVA8QKKhAUYAHJhRN8VBIazDLxdRpMzNpsf3y+CboSOMZ\r\nxhfHQgJ7yvORQioF0dVKTa/tgaVm5vZw7CxPGm4xGCc0moWH0VP0rhbrZS8r\r\nqIwa5MM5H9zY8zxTn4otVlbiVFRJi0FGYTHZfrD5jxI0bSUY602P/WjZVPmJ\r\n9kGFkoRNsyFu2Psf1PFjcryF9rGaTFJhDuc=\r\n=7xX6\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"b0d2fa371ec4a3d0a8a11e19d9753b1af5d2d62c","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.1","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.fd95ca7ef.0","@material/rtl":"15.0.0-canary.fd95ca7ef.0","@material/base":"15.0.0-canary.fd95ca7ef.0","@material/theme":"15.0.0-canary.fd95ca7ef.0","@material/ripple":"15.0.0-canary.fd95ca7ef.0","@material/tokens":"15.0.0-canary.fd95ca7ef.0","@material/animation":"15.0.0-canary.fd95ca7ef.0","@material/elevation":"15.0.0-canary.fd95ca7ef.0","@material/typography":"15.0.0-canary.fd95ca7ef.0","@material/feature-targeting":"15.0.0-canary.fd95ca7ef.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.fd95ca7ef.0_1672880630331_0.58012922619825","host":"s3://npm-registry-packages"}},"15.0.0-canary.1eb44faf9.0":{"name":"@material/slider","version":"15.0.0-canary.1eb44faf9.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.1eb44faf9.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"1f6cc695e468159f762df3aa82f56fda51851881","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.1eb44faf9.0.tgz","fileCount":37,"integrity":"sha512-5G5RtS3LR9h1GFJuFiduepr9OvV337jolqKRsLEOFrJ7d9czpLNHFWTZ38fYiRGHmrDLyYhWHgJEalBkC0rf8w==","signatures":[{"sig":"MEQCIC+4pMFWdXqwEYiuZq1pBJ3otTCEQNzQnv2T24IxMJ5ZAiAwvFPATTzzIGW7xcFbiyqnwu26sG1fl6TtAc41kDZQbw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1219639,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjtpP7ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmorfRAAljtvkRga42sW64t58KyEVW70M3O4VEgCKXYXrb69zN9RzaZx\r\nt66j+Kzk7wEpvxjxap+vBwKTzjV0rzRf4SiBUwCyr6yxY3bDhHdFb6qPS3jf\r\nbVHlMjbnW9A3LmwyRX4dD9MD0jMoHuUHMmwn3es1EkSZTOr9MHOgzgoDYMe8\r\njK8rp6vWVOdmP4wKB+4YPCSu+yIIagbRILVzIgNcaIPUKDDOaJUOROF89HNt\r\nZ/FMgvtnFG+efQIKQ0LSv61Ak/soo+Q6puE5o75QFQ67ThK/ERWWioobS0jR\r\n8ejGn46QmUksPFMTGXhxHvUm17cPiE3XSC4hfu0oy0JLmT9vYl/0xmYqighV\r\n5d63R4BMXpVJ0xTi5vCW1raewJsW5VAcr+jLbe89eS9nZKxKE2pqHG7xiTjj\r\nMdLNXQ8DifFN06fFsM4HnIcTG9806fbmu/wRHBhjOtLaV+No/DLkpSPP5OFb\r\nXVVZmds5ahc5ilFFbDfb1x0mZOES63isZ5THcLZOnDx8cBdt98x1bdjdhGeB\r\nGZAXTaQO5iAqkn9lK+zzVZV37Els7Sm015WdsznUitnaOaUyAagp0VgraP/L\r\nGl7xr5rsoTWJ8Px0JMlI4X7wdLjSiFKzdXZYZWEMHr8nXicHh816DUmZ+BQ6\r\nY+bcycFReOIeDMF+ryfp1+fzDjEVAfrN6fI=\r\n=5aOr\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"e0eeb94598a14217ebc97ec3e249d126a29a13a5","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.1","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.1eb44faf9.0","@material/rtl":"15.0.0-canary.1eb44faf9.0","@material/base":"15.0.0-canary.1eb44faf9.0","@material/theme":"15.0.0-canary.1eb44faf9.0","@material/ripple":"15.0.0-canary.1eb44faf9.0","@material/tokens":"15.0.0-canary.1eb44faf9.0","@material/animation":"15.0.0-canary.1eb44faf9.0","@material/elevation":"15.0.0-canary.1eb44faf9.0","@material/typography":"15.0.0-canary.1eb44faf9.0","@material/feature-targeting":"15.0.0-canary.1eb44faf9.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.1eb44faf9.0_1672909819534_0.911617969995657","host":"s3://npm-registry-packages"}},"15.0.0-canary.adcdb7db9.0":{"name":"@material/slider","version":"15.0.0-canary.adcdb7db9.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.adcdb7db9.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"7ca6818f46405431c44dbcac9bdc23ce06c5516e","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.adcdb7db9.0.tgz","fileCount":37,"integrity":"sha512-6A/FJ7GK+ShBNsLq2xCyQN2cUGEWuVCuoNKkgxCytyuGEbZX9LtbZLbW7XRFZgAlg4CcXm0/1z3jGvGLxJTn/w==","signatures":[{"sig":"MEUCIBwalhixe2tR+UReYC5Q4DfSahyHmBE5OtFCUinTnoN7AiEA0/ORHqdctiafCnHRa+A8yu0SsIFQ3amdHAJAr2MizAk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1219639,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjtvlbACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpmtQ/+JVXstZq5ABAJruv9g25dtAJlzPG97GCFPcEyfl+3SnNebBF1\r\nNoLNItuTGyVDEslJTW4qeRpv4AsvWjj6kQbrzuFic8vyPw08YDlJ/7HWBBLg\r\nQEcSaqi6hWUiWaoahd7fl/IyTwHT+HSh4D8QfIwqlVe54BvWKMY0S+bzbjDD\r\nRFzG4CVGXuoKU5KXwigeN6+htel5TCYSTuGHpYIGx0J5Wdr0icdqHVXGh4dv\r\nfEOZLE67zhC4KM59avjUpVd7I+apQ6JwyeVVG37nAjLpeQyeawmBsgyJZRvJ\r\nb2Uzu8FxErkHz53/d1kXPS3iSBUsNoNdaeY6vfuDTL2kPX9hn5w4odTrMWPF\r\nIr7QreOYmfXv37ERl4w+zy7HAFw9sMUo+4WByeSNmHG+N5+othFyYfG7S2BO\r\n56rlLCaX3Nw6ZqcW/qz9YE3k5TM74vcj6iKW4PlBMZszhJ67zvKzucaHaN93\r\nU2LYm2xWddO64LD2YXX9jj3azUhLAXgvKTemveMMuxwF5himz7gZSKdi0o7d\r\nezgUDAeIOo+Ls4lMrouYl3+l8qJRvJy722XSAUnND6vns5HPBalZL96hShkV\r\n26x4F5wwk3Eg/EwjTMbx4UcS5p3CsFVi6QLva3JOJ5Y2bMcVHwEX/hXSmlMd\r\ni9P9crAzfPonBQite1ucVn0EUoYhiETaFyQ=\r\n=fYRs\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"2bb419da8b7b393c085616b6c5f28a3eebf832f6","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.1","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.adcdb7db9.0","@material/rtl":"15.0.0-canary.adcdb7db9.0","@material/base":"15.0.0-canary.adcdb7db9.0","@material/theme":"15.0.0-canary.adcdb7db9.0","@material/ripple":"15.0.0-canary.adcdb7db9.0","@material/tokens":"15.0.0-canary.adcdb7db9.0","@material/animation":"15.0.0-canary.adcdb7db9.0","@material/elevation":"15.0.0-canary.adcdb7db9.0","@material/typography":"15.0.0-canary.adcdb7db9.0","@material/feature-targeting":"15.0.0-canary.adcdb7db9.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.adcdb7db9.0_1672935771425_0.5491508563592298","host":"s3://npm-registry-packages"}},"15.0.0-canary.067af7eff.0":{"name":"@material/slider","version":"15.0.0-canary.067af7eff.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.067af7eff.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"bd3a61cf2fdfc5816c03839686bf0919864e8ab7","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.067af7eff.0.tgz","fileCount":37,"integrity":"sha512-REtTu4/LnS0lSRMBbKGlZtrFqrMfMhdHo7VJ/ynO0lozSnGzI58xBZ/PK0htbAWpT+YCQBI2+hdp0DFB87l5NQ==","signatures":[{"sig":"MEUCIQDkafzug/lw537KvrrIgeaS/E53bgftx9Jj9hXpvDI/zgIgGFPup7D+0wTBnABKvdO6AygQd+ks3JPu1AmgN8l/Fgk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1222557,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjuKvuACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqlCQ//eCH6TNVhy5Qh9SMYDNvBPbPSrm2JcvwTCbyxCPyYvOwvDZRQ\r\nyw/9oSUP2Eq28wZiniUs8nxT4TCM7fd5fCDnwx7D2+H/4Mb294iw4Jxt/Sgc\r\nkBzmGqubyJJWy2jVJunSk/43vUVQUzsyWRqAAB1ViZeGi6jtXuCju8hBj87N\r\nkBBTuoX2WfwDZbJOBN9KucM1WzjeR36iXXfwjM6GBAoUmrM0O7uHoUqTrLMB\r\nTh8OntiI+UhXlHYH6S81kZvqofKxKfxMyuq4n2JTcLe1SQbcCS6Rf2SF1s/a\r\nYEf9/G13a5TDjPSoVYTYDPWlkDRSC2Pb/3aoWr2xlRtZFe4gGSnKRSoKtzMa\r\nq9373e7KyJji0blxJDkq/zkaVb4kDUFWn6hD/3z/YKQScP0W6W+kZ3FjF4QE\r\n5z9MbuvuwAENgF8C7gwkbrdivnEjNZDlIEs3aeTcqRUFywE0YegP/DnI/MX1\r\nUurDObOOSY9aAQIydLKPwz814h82Oz/v45zo7bia5+njrXC57Dl58y2id9RU\r\njmAjwaSDkT1/80uA7lknGjV9Es/FqzU+sNy5k69yFn1qtNf+ngnodNoAcdCI\r\n6xneRB4rOvsQYsCYdDTKhlDZ+/d54cL7YHWZZqOngY0ynzkvxSElz+Lzlj22\r\nQHGg13l/y7tln29CDFZG7sL2tHHgNl0IWr0=\r\n=8bh4\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"1fae2c792ff8ce557995a8d5d858676b4355c7ae","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.1","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.067af7eff.0","@material/rtl":"15.0.0-canary.067af7eff.0","@material/base":"15.0.0-canary.067af7eff.0","@material/theme":"15.0.0-canary.067af7eff.0","@material/ripple":"15.0.0-canary.067af7eff.0","@material/tokens":"15.0.0-canary.067af7eff.0","@material/animation":"15.0.0-canary.067af7eff.0","@material/elevation":"15.0.0-canary.067af7eff.0","@material/typography":"15.0.0-canary.067af7eff.0","@material/feature-targeting":"15.0.0-canary.067af7eff.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.067af7eff.0_1673047022262_0.848743039441973","host":"s3://npm-registry-packages"}},"15.0.0-canary.21d1196a7.0":{"name":"@material/slider","version":"15.0.0-canary.21d1196a7.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.21d1196a7.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"9b1ec06f61854fd676f717641749a01dc7099756","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.21d1196a7.0.tgz","fileCount":37,"integrity":"sha512-mayPnVtRJpZ3VocTXzIMeoFOa3hNwUeaqh6utNNUEHkYjj05PmFjZQJe7KoVlI9+6+LbUU4K3e1Kts9vT5vqyg==","signatures":[{"sig":"MEYCIQCLNzjk5h+VSnrufYWQVFZL9/thAGqEwvCILJneMCN+3wIhANV1UL6Oq7BxjctM8XAQ9T4/WPOOTpOmjSxFfbBfA4Zm","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1222557,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJju/ACACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqUMA//c3ld9CQ1Qs1Ngut5VeeyuYnKJlQYpWBQA0w08W6413BeqU4z\r\nd81RBP3jImaHCHh3gIeYDYc1IxZpOlXFFsVDhbqJRasZtvKtZzKW9kV9Vc97\r\nJ2UKICdPHzl0VCSrFrzQm2Gw+91apFAg3Tq4BpMjX9jhXo6UPGUmHrcbiPXP\r\n4XoQ7yHRd3Vd7nJfMOEcaH/WGx68jgWwA9TESuNUIe6OEWAgcvToLPk9gidi\r\ndJ6iIuLofYsoUGjIieSmYqzMQBcXTwnLAWTKAFeqOmQaICgB1MwpLiDaWUyH\r\nZ/EpuZ4+0uBhvLbB1airLh67HbHPnFkw75O2FSdQdOtSpbQGDAFpiEqOH3JC\r\nrklURo2Unbq+m+31PwuiH/5in7WMY6OqqL8XJIOC1rRWSy7nI4rFEYpdjvdV\r\nP9buZn8J5Qf/e1av9pGehwmmWSIXk5vPNGK0vBz16A4ONzAxC8hg0NB0i1f1\r\nYzDE1S+uP3k/hTb5QpUk0qxyVJssj1cSuWKbaB14mx1Ape7VT2Z0JQSFWe/r\r\noq2puYptGull4+3qS0Kh3ZN5BY3KDLLKMsIgbV6kKSG9Pa6ZHidiLov01u9b\r\nSBC9M9eGjxAtyV1hPkX89WMCFR3YQLdduZvSkoDIOMmNOwSHLzdL9utHD5d/\r\n4ehMdMPWAKm6UeXzGS7gxNvbiJ6BdIf/HTU=\r\n=lToo\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"361e536c54e276112f021b419f666618a20599f6","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.1","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.21d1196a7.0","@material/rtl":"15.0.0-canary.21d1196a7.0","@material/base":"15.0.0-canary.21d1196a7.0","@material/theme":"15.0.0-canary.21d1196a7.0","@material/ripple":"15.0.0-canary.21d1196a7.0","@material/tokens":"15.0.0-canary.21d1196a7.0","@material/animation":"15.0.0-canary.21d1196a7.0","@material/elevation":"15.0.0-canary.21d1196a7.0","@material/typography":"15.0.0-canary.21d1196a7.0","@material/feature-targeting":"15.0.0-canary.21d1196a7.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.21d1196a7.0_1673261058683_0.5772490909217292","host":"s3://npm-registry-packages"}},"15.0.0-canary.8d2d8d3c4.0":{"name":"@material/slider","version":"15.0.0-canary.8d2d8d3c4.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.8d2d8d3c4.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"a5afaa2d08f421f9bd832e7fd5bf497f043645d8","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.8d2d8d3c4.0.tgz","fileCount":37,"integrity":"sha512-DJQ/KdqjpWD6MbCwqtvBbcGHcrDvrmSJjvWiU9HXRwsTtnq2AyQY3PrO78cSNIIIwk2mBf5suygb94c2KeuRRw==","signatures":[{"sig":"MEUCIHMjL03dc04uelZKkxicCPO4nG0uHbeaBH4MdaW/qq4sAiEAjQP8WOK7f2kIEuUelxs0O5g1LxLFIPUTbJWUaISqSo4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1222557,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjvJQ4ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmowxQ/+PSVwlB0xu6G1X7Qvg3rGYACSCHy6nknmiLYhegubT68LgBsS\r\nX5Vqg1bEtWVdsszOzRPUDVGEGaPLkEeD+idkqgcJe6tysIP21dbr54+D7KyS\r\n5fjCsPPp7Zz9rlkCOKoFZ+NTl1rTpxnmZQXqU6ZHLvKyxW10pM4myZBP1qpN\r\nS4HpGoW/qMoJsB8L4fubKreWjgMFOPopUXyNIrWyoa9Tvne4Su65EVCEu5e2\r\n/MlzYOz2E2Xsj9aXZ+LVahVkBvYuDS/E+h1VEX6G8nEErC6Coxir8zG97QW+\r\neycw0UgtibzOM8dwdjFxaLmtwaEAWbwA6v65dSQsMW3wn973pMvJIclyJmNM\r\nayPtXHI2sv7s+/ZM8xi90iyqj0VEGWP3FTJ2vRMvEvr+V81o0qBNGkcORDJc\r\no2hZu6oJ283EMmDsNMAp4EYsJIzvCNRhLMytcDVG6NVq4COU6MZTIFNqPP7m\r\nfOHgbYSLpdl2f9xYZxLMdv1SuxQtxoD0QbsNuUjQd0TXRSuYiLJ5EOdJxTjr\r\n+r8w8hHqHvdiPkPSOtF5xeXTJXt0FKwRg0nnoTD6wz2PAbM0bq7gYNKueTZt\r\n+Jv0r89u5dHc5/PWiuSMe8XjwNvg1G1Wj4iS0mpg1XMGyjiGAzw8uI6d/YxQ\r\nsMG7e8oQ+NQ3umEBZQEH/3X0SghTd2MZfuM=\r\n=KJE7\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"c2df4624468d99280d9dcb0894d04d839fc8673f","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.1","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.8d2d8d3c4.0","@material/rtl":"15.0.0-canary.8d2d8d3c4.0","@material/base":"15.0.0-canary.8d2d8d3c4.0","@material/theme":"15.0.0-canary.8d2d8d3c4.0","@material/ripple":"15.0.0-canary.8d2d8d3c4.0","@material/tokens":"15.0.0-canary.8d2d8d3c4.0","@material/animation":"15.0.0-canary.8d2d8d3c4.0","@material/elevation":"15.0.0-canary.8d2d8d3c4.0","@material/typography":"15.0.0-canary.8d2d8d3c4.0","@material/feature-targeting":"15.0.0-canary.8d2d8d3c4.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.8d2d8d3c4.0_1673303096225_0.901358770223778","host":"s3://npm-registry-packages"}},"15.0.0-canary.fc6ee6c32.0":{"name":"@material/slider","version":"15.0.0-canary.fc6ee6c32.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.fc6ee6c32.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"0b3b710ea3ae8926046f173bb9a582670efd3006","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.fc6ee6c32.0.tgz","fileCount":37,"integrity":"sha512-9ECnj+cvpHVcDL7umv1muoV2xLMzflVnR5RJMiWuQSskFHwwGqaWZ/GPD1HGI7mS0rTWt0me2Qdg2TN//R3CiA==","signatures":[{"sig":"MEYCIQDlBVYJg2FefKw9DUxjVIqR/kFZdD7ljj6JTZ86kcvGTwIhALVNNVI6IdsCE/q/lcE6Y+ANPgy7T5elMZ3ngssmiAE3","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1222557,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjvZJRACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqgfQ/+L4y0w4IgNykM6c3ZVbhxSgps/g5ogNyzIQ5o8tdf4jZCHbs6\r\nWxayRw0XQ2aSDkEashMLDrbBqLOwVaXWmtRt0BmrrErR6Uyo+Z+ryAO62S/b\r\nRvH+yYL8x8W0BL1tk7gRUwsMSxQ1vSkA6N5NP0Fy3zwcVO2rcG3Hc9zpK9Uz\r\nAtymdNP+W2cEmlcMLFPquHGO82xeer6cyCcWpq0w4WDV2Mzmzc03iaWlLv4l\r\nDCwHviX9XfD+VIYFGsVQnMgu/heytjgmjWBaH10t8KiMxJsWVjF0UkwlyDb1\r\n5gOCXxAhWFZ9yYhzPFxQhGrVRtYIAwMmKoqEIyWx5hXsePoVLqBG6ofI8svM\r\n3C9mpphICDy0h2nBIItiRR8PUzYU3HsVfOJKblLcJb3RzQHvrQ+eW3n0Wh9c\r\n93eZkmc5jcHF6ZzhmLYjkgQktyTzNZi3BCRKfpYf310NlTbBOZBMO9LzKoSb\r\n4Ndk6OdXVhafwCxYBR0eqm4nb1Hj77If0rppKONOlIGfPFWwOWEII676kQ86\r\nAus8B2ri828rTJF7YHiaHqdx+bHeWxcrQ2RAPZqZ2fsdKhAlFnXbbYmLQFBA\r\nYCN9O0cN/u4pJ8OLUL/L6iT7sV9dqmVo71ohnvWn0wmSI1N3o5DhlaPeYyfx\r\nEMQ0xGfm/nVNw7psL9bjFGXH13/VpnmkHRo=\r\n=EMEX\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"225aabdf74bdefc3d2f70f268ddd04c501a821ba","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.1","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.fc6ee6c32.0","@material/rtl":"15.0.0-canary.fc6ee6c32.0","@material/base":"15.0.0-canary.fc6ee6c32.0","@material/theme":"15.0.0-canary.fc6ee6c32.0","@material/ripple":"15.0.0-canary.fc6ee6c32.0","@material/tokens":"15.0.0-canary.fc6ee6c32.0","@material/animation":"15.0.0-canary.fc6ee6c32.0","@material/elevation":"15.0.0-canary.fc6ee6c32.0","@material/typography":"15.0.0-canary.fc6ee6c32.0","@material/feature-targeting":"15.0.0-canary.fc6ee6c32.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.fc6ee6c32.0_1673368145600_0.720170774806226","host":"s3://npm-registry-packages"}},"15.0.0-canary.73537ab0f.0":{"name":"@material/slider","version":"15.0.0-canary.73537ab0f.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.73537ab0f.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"10303c3e2eb5a605856a11e22a51e0c6b45003fc","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.73537ab0f.0.tgz","fileCount":37,"integrity":"sha512-qk6PjzJAbkMgtKJbY9D54Qoe5MyA745K7KWsAZ83Z/FTdbbjc9Z3/zZQkEP/XqFxYF3mvw1k1tQpe45sDlp21w==","signatures":[{"sig":"MEUCICgPaTcnqcC6bixSgDJC0gbdaoBvnDIhWF0VXrkjGrLXAiEA2KNDn5wCLkzQNGnRRMpl5HrrU3fmYd6T0wlX4mu9+eo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1224032,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjvaqRACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpiVg//WH/d4tEUWRy3hGabs6L90MTC5M9mnbGI7lSEJaJD0GT/bQiU\r\nPJn077Io2kwa4TaqiuzOxrSTaot22MqCBrGax+HTlKP/rzLKo3Xy+EJI0ISJ\r\nAc2KjTjCZeqAhKXbPLNI7Vm/8hTGtPXYbQpp+eEll/Mz3mWtrhdDvNrc6obF\r\nCSCXZ1xRxrv8YcEwSGsdmdkWLyMvuStkvS3klO6XKEftEX8bMZVVjPtsppxc\r\n0po5kv6oOZE+FC+zd9SYg77+misNKsw5J5vAP+NR8ZxG0ZOqvQueeg9yYE6F\r\no+Dk5oMlhyRSBnzpFelue0UlZwZO1JO8cP69nT27je3a8uHsj/5nToInmFio\r\nHPLpgflUb3eM1tn5tcUDPUzNAS8pZ74w8SyaWOnh26r/YHTHsWG1rmqAxJE0\r\nr0aYPNyGZ9ZCArjn2/hEU9ox33hKkFZSrk1WmL4Rsa1AcY8xtgT8grz5qV3X\r\n9iqn4FkzPOIx1bUOBZrqKJfyUPq8EDD1joD6KWV6sh2P3gEUohBWv7iXDeec\r\nm3pYJWzWApIzRym3YPF5o9DgIMVuEyZRwo4oJWqgLWC5nIsy60xqCC6XKMfm\r\nFASX1Qc5pPQaEQx9NuFXxz9iBnUL13h6zprvcc04TkJ5D0ZaZ/I7jgqeKt2O\r\neLugzap5Vq897c84i1mCqiMBwePOHFFX9is=\r\n=lyQa\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"cb3a480e7be3c8c7bc8f8ee0acf1ee8145f266b3","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.1","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.73537ab0f.0","@material/rtl":"15.0.0-canary.73537ab0f.0","@material/base":"15.0.0-canary.73537ab0f.0","@material/theme":"15.0.0-canary.73537ab0f.0","@material/ripple":"15.0.0-canary.73537ab0f.0","@material/tokens":"15.0.0-canary.73537ab0f.0","@material/animation":"15.0.0-canary.73537ab0f.0","@material/elevation":"15.0.0-canary.73537ab0f.0","@material/typography":"15.0.0-canary.73537ab0f.0","@material/feature-targeting":"15.0.0-canary.73537ab0f.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.73537ab0f.0_1673374352942_0.3704371399192359","host":"s3://npm-registry-packages"}},"15.0.0-canary.684e33d25.0":{"name":"@material/slider","version":"15.0.0-canary.684e33d25.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.684e33d25.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"262bef7c33648a5381390c6df751adc3f5675c0d","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.684e33d25.0.tgz","fileCount":37,"integrity":"sha512-WVyK+2pSNSZmj07M2K/a3TADoQ9FBCndfNC/vE7/wGIg4dddJJK5KvQ+yruf9R2cSzTL/S1sZ5WpyyeM8E9HTw==","signatures":[{"sig":"MEYCIQCVaFwcEGscg1XvPFHgaoU8EqIQO/LKoRCoFfnX7Rx4swIhAM4I1+SEhL8jIVr+hi0Ff+VDmRB3ooK86bcnw9eQK6Uo","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1224032,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjvbpEACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoXPRAAh3WB9PvZBVWpjkA65Tf3VAt0bYimLOZYSRjVieNnzJp+JDvJ\r\n4tsDwmuO6VsD6JXRrJBBEfIcFODICE/qIjC+QoVyZbrETb49bCDyqhSWfLW3\r\n5WHswHRxItuG75/p6r/XGGvPDYoh4YyzsrNgeQxB3UxeSB7y+SwCYXRFeTzH\r\n7X5IecfBWewGccKyss/Aq+DgxwUG0JImmQYgnAOKMmGQB58WrA1Ylb0cUkhJ\r\nHtN1HUY/ZpZVbA6bGKmCHjuN/xTq8ezUKIjvZ1QhJqPD6DA6HWM09qe58vPv\r\nxfcpdFXNTZkg2Iqk2nFn+MZnMB/E0NwAHqBnDn/6FLSq5Aut8tP7YWsTCM+N\r\n5aNFtTZbqmlV56fF4jmCuHo1o008id5QMaPsWXhJOzifa0mr+5Mhm8Pb1OsY\r\nzuwB6TxrfuOL1Gz70f+6mFPUIoAvBHC4mc8BtE5ZrkWnG+FrtK///u+UYK4I\r\nZcbIlvQRIw+fcs8/rMfxfPQSqSHRRI420msIPI7pjjNJbg0F8rPSx8zxmbUy\r\nUqTWdJC9X7PKr9IdXjIXDfBo/ZwQ1SWVx0xos/xVq8OCTI0rS2pHRc0ztwod\r\nsZiZsu6rhnJLNpMW/egz7MyJnkd66x+Rm2ZXufOaN5ox9ZaQXw7SymHq0Awp\r\n3XOYiZE03i5H2z5fr57nxzp3fQH0Uf2ZNxM=\r\n=NgCH\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"518d26a1e091925c1b3a87f4d4f4dc828580a863","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.1","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.684e33d25.0","@material/rtl":"15.0.0-canary.684e33d25.0","@material/base":"15.0.0-canary.684e33d25.0","@material/theme":"15.0.0-canary.684e33d25.0","@material/ripple":"15.0.0-canary.684e33d25.0","@material/tokens":"15.0.0-canary.684e33d25.0","@material/animation":"15.0.0-canary.684e33d25.0","@material/elevation":"15.0.0-canary.684e33d25.0","@material/typography":"15.0.0-canary.684e33d25.0","@material/feature-targeting":"15.0.0-canary.684e33d25.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.684e33d25.0_1673378372450_0.21610689646452275","host":"s3://npm-registry-packages"}},"15.0.0-canary.0e89aab6b.0":{"name":"@material/slider","version":"15.0.0-canary.0e89aab6b.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.0e89aab6b.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"e0c2bc7a8b5cd4860c4d8d1114571009915f02da","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.0e89aab6b.0.tgz","fileCount":37,"integrity":"sha512-fTgxszxPt/NK1QOWNahrEn9xEno0exZnN8XA5KjXSxF8MsQNvjL+CSPs+GO1ayQj3Vnj05h/vOdJyAbX/vp65A==","signatures":[{"sig":"MEUCIQDfLJPjU/oF/Bey+meOLeBNRxFLq7xqEjff73RtMV/t8gIgEdKy2h/fKpYTpV0lFtTrp6ZMMegyJNihNyj+T6vIPJY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1224032,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjvuFwACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmreiA/+O28KR4702v15grINKghKpJTJzmvY/UQyvCZ7Mkfk2YruIIQq\r\nQ2/cN+xU5W7A+AZdhvzexPUY0Qn8V3L74HKGmCBP8K4v/CcV57vFN4lIZNya\r\nZ9Dc520K6AXo32prh06gj9Un6JKL5aooXODF4XlwEqyJ4gZlQ2tCyHZtUW2k\r\n/RUe20Df+xK1TyX28x1tGnpxVSLLf7y6OhXZo2dEatEcBGLQ7kDr4Opjxrbb\r\nVlPhRU1c/clZmEgLNTYEVm6HMRzvaAnJRgs7KBczkOztyabZp/jnOBajEXRT\r\nMLqyLiplObpq0E/hK9OC/RdwHEqrA5ra4pZ3FExC7DrjeQUzR4QmiEp7dhAH\r\nwwTnwGJ2ZKNQ/8TXKB4os0zCj6vmoQqky9bXnWvxhErDkxPjwgQQsHBZ4Mn4\r\nrYBsK/VK4ccBKSNEEcgYonMUv5zw8prlBaswJEPoh0x2ayXvUQKBoCOwTXTv\r\n5OJdqPb4e7xGy00vncCI+WHmr1LkhMcJaaj6XrktjVvgBAYDGKdEAQCMpxNP\r\nfRsg/jarQYTrFGMWjO/gj+SJs+M+8+WGlLeuOKqcBUrtjLGMLetfdFTT9i7B\r\nLXuUHFsF4RNYBxRwLWsDHjsIGOgVdIgnkU7VkrlTjQ1iG4yMd0mzucahVnFv\r\nPIoFCihAhMG7cxy8caEo5WOnOSURNXkwcqU=\r\n=hy9G\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"e4a9f0d636d7f4d6c0fbbf49a7016627715eb3b6","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.1","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.0e89aab6b.0","@material/rtl":"15.0.0-canary.0e89aab6b.0","@material/base":"15.0.0-canary.0e89aab6b.0","@material/theme":"15.0.0-canary.0e89aab6b.0","@material/ripple":"15.0.0-canary.0e89aab6b.0","@material/tokens":"15.0.0-canary.0e89aab6b.0","@material/animation":"15.0.0-canary.0e89aab6b.0","@material/elevation":"15.0.0-canary.0e89aab6b.0","@material/typography":"15.0.0-canary.0e89aab6b.0","@material/feature-targeting":"15.0.0-canary.0e89aab6b.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.0e89aab6b.0_1673453936084_0.04533936793570925","host":"s3://npm-registry-packages"}},"15.0.0-canary.b0103d10a.0":{"name":"@material/slider","version":"15.0.0-canary.b0103d10a.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.b0103d10a.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"396aa7d0b06a1b0d3cd35afb8300038c88eafa04","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.b0103d10a.0.tgz","fileCount":37,"integrity":"sha512-XcrZQGYswjft9oVscSh87hG4DCb1FkbmvxlVfFeIrwMbYR9m01dH2r4WGW5+xxVOjRmfoZPc0+jRmFwRUJqPag==","signatures":[{"sig":"MEYCIQDJ2k8IcXRtvRleo5ROTQjt3avShkhr0HtV20YJ6SI8lgIhAPvnXvhIM+DS1xq8H+BlvbhpBAJxz539pjX+HogGLLJL","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1224032,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjvwpaACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrrkA/8DHEOuyQlczNpqn+5hBEPaT6WKgUmz51FZ+h9+7PB0SItD9eV\r\nxJdpQExdvskU8DsBUArEplgYInpk2btCX/R89P52K1PMimKGgf+bPJOxbEOv\r\nXR8zbxvYMsM3rbJuGkADv/dfjaqll9EfIRPZHsdZnYGSgxt7lwVVxiCkCoiF\r\n8x13wx4KwsjElJzUzf+CqZ+sJNd9IFzDkGZyTg+uehcZr77aImLxeHjX4txH\r\nl3unVmYTqHj0LR86E8qbgep1v4Gb0JK6Il6DogzeH7v/rFGOW53FZQfyFTVj\r\nPju0W2mJHH++Wx4OP/XT8cT2RrZHjn/NdlK3ax3YVEkU2INcOhzo5yV3gqOL\r\nI79VFfehsdVDdFLpfkmEevuoAoTc87Ptm89HCVECw88skhYMn7Pa7jp0dFL5\r\n10mPOhKaZBo25WlTo79+H8qYHqB4p22mfen4MpnYKYenXWbShfVv0m+I2SK3\r\nK3kLm4cW4BqsmKfFCg44hZvnp0uPFUeEUB45TIqbJYh8F0Saw5H1xxSoFJJi\r\ngmw9/BkRapfYKCt3Ro2SQ9npqFHyyZQCvToOAvOjEl5XZ20vdER3cMcQR4s6\r\npammS2RtWq3v4+DyQCyanGCuIaupmO7QrRG6hYpd0EN0mya5aIWvhdn4qD5v\r\njobU/u1W1fXrl+yoJ+/sDIAbB2kPBxFEyVM=\r\n=toRf\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"0e133b89a4afcc8020dbafdd4d22c734080d2d17","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.1","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.b0103d10a.0","@material/rtl":"15.0.0-canary.b0103d10a.0","@material/base":"15.0.0-canary.b0103d10a.0","@material/theme":"15.0.0-canary.b0103d10a.0","@material/ripple":"15.0.0-canary.b0103d10a.0","@material/tokens":"15.0.0-canary.b0103d10a.0","@material/animation":"15.0.0-canary.b0103d10a.0","@material/elevation":"15.0.0-canary.b0103d10a.0","@material/typography":"15.0.0-canary.b0103d10a.0","@material/feature-targeting":"15.0.0-canary.b0103d10a.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.b0103d10a.0_1673464410013_0.06456425499843044","host":"s3://npm-registry-packages"}},"15.0.0-canary.50e7a5312.0":{"name":"@material/slider","version":"15.0.0-canary.50e7a5312.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.50e7a5312.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"079fafab2dc667f9efeeb5614008d4aa9f8c659f","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.50e7a5312.0.tgz","fileCount":37,"integrity":"sha512-nIwgCR+/4yePt1IR7WRUnIirdselivazkw9XrJNMJMtgMXrHlYP7J55ANSjiQcY5zMGFfOoG6XDPILjkOmSX2g==","signatures":[{"sig":"MEYCIQDLEU3WBuRZLM4Zsv/4GUZ4ujAI/Ug5bMNjPkRUWJhTSgIhANoxpB/oVj7LC9SgL8Uqka3bbT966RV8k2Tfxmcmy7I9","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1224032,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjvyIwACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq8OQ/8CzaAexi/116G8HxR4YzECbwdSGUUcDeag+pGLexffy9PLp7z\r\nu1bzAYboR6/9ab49RA2loPINAWkIBFR+2kgT4bcxlY4jpWVF9pfQbLiwl+TJ\r\nX4/PUvToSTBs/IYFOD4SyRHCzk8GCySfCUB9YjhuIRGehpFAzjqtDHK21OAu\r\ngypKQ7pIbzG2uV/6mg/HT4B1yWoQbAn591nKkEaqK97w9R35ssUkVMtapMsI\r\njlZb41RB4OH4zCAIkC7hZHuGL7JmaHaablQwft/Ku9+iEPJt8o5Luh1+cAdq\r\nNnFeiPsgb8EKhLX5hfjlPuS0qXUJvKmWOqFVkkjBaV8LPI7NTQxONv87hOxV\r\nZc4pVkHrDMBPbs5n5N5fnHHjz6lx7Lt8YDTe20RoITiB+4r90zOICGhpMCD7\r\nqeqHJRFByPX3oSge+CsxpgFMhCfklbNp6Swopv2jw0yn4WuS5rMWt2rAmgat\r\nxjBVaeC7xB7lLU/8BMxFRhHvdViLmhqXDae0emi9LWjH44dnpzfsm9zlJ/Zv\r\nGOTG5yh+oN/u1E+3zNB8UFx5wmqVZ+Vtei/3IzJYit81obqheZX+PRHpacQx\r\n8YNNcZKIATKivxvJHsQCfny/O20BElR7KIOTOM6+Gfh3qd5doS58T98tXh77\r\nvLGrshYT6uZUNLV4h58Vod9Pkp8tBjjs+VM=\r\n=5qip\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"2d4b8df3edcb9b5e9fd8d8b6645dc9519d92f376","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.1","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.50e7a5312.0","@material/rtl":"15.0.0-canary.50e7a5312.0","@material/base":"15.0.0-canary.50e7a5312.0","@material/theme":"15.0.0-canary.50e7a5312.0","@material/ripple":"15.0.0-canary.50e7a5312.0","@material/tokens":"15.0.0-canary.50e7a5312.0","@material/animation":"15.0.0-canary.50e7a5312.0","@material/elevation":"15.0.0-canary.50e7a5312.0","@material/typography":"15.0.0-canary.50e7a5312.0","@material/feature-targeting":"15.0.0-canary.50e7a5312.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.50e7a5312.0_1673470512278_0.6457709587560843","host":"s3://npm-registry-packages"}},"15.0.0-canary.202823f54.0":{"name":"@material/slider","version":"15.0.0-canary.202823f54.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.202823f54.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"a1c1cac0aa303b1ad66144d060c6c215791e9715","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.202823f54.0.tgz","fileCount":37,"integrity":"sha512-50DtPy4D56IaJaXxE0bUVdsbAVltHs6ZOLxE9gjLk1U0+moioasTns9G+Q9giKVobLsOch8JH42crANcA4EZ0w==","signatures":[{"sig":"MEUCIQCpOHZu0t7N7W+JafmbCQjRaj325vBiOvUOpUyEgiOHKAIgHP4oi0auH0RTb5lt6cX9M7aAQ0VbQwl8GdhIwpKvc2o=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1224032,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjvyvsACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoTMg//TkquS6G4OlKrfgvnKhdW5IXOMphbf86ILnx45nWTUwqmeUcf\r\n4+uPjEawi+ElY1nGjk/GGRD8SjPPsp+F0wN2PmtmTHVlcMcUVyJnnYAGI3Rg\r\n6vwL8DukY8XQTyIW/ZoDOJmEwHlDWo9q3HEsi1Eot1+rNTplKSWxngXGBRxd\r\nP8gJpN5BNk45ZOjR5GUF5gkznI3ygieUWax85UQJnWuLkItZ7R4lyE9HI6Xe\r\nMyvPMFNrhDafUHu1d3pqYIHwmOiFzgTey5Iu7VOr5XVqCsetqzduMtUB6JaT\r\nkyKA8df42CorP6N4Kj5uy72tuYaEEARKk9VRdPf2z3mQkohrZZTZIjwbUM1h\r\nyVmPIZbE9Eh/LsRtm/p6ZYhwpQ/ytycaybvUhSNvqydROhjQL9r1jm3pkVu0\r\n9ChvmiHlQY1Ao/09o7AinHSH6rr4i1z10kcnfEz117ib8i0qSRmlMfdmPcPC\r\n2mo+hifNHKO3f2LL9E9Q/nn3xGg6lkOpaLI1MTWq0GZQxioL95xk23oDPPGR\r\njvzlThEo9QBWz8P1jUo2bRIzCnv2El0WZSBKv5ARaWRCvHGfUALizFZjokA0\r\nDbWAR06jfUjGHKuLkysXHmqJRkQpxz55r6Fn5MBktJyBfLuq13+kQcksIMjn\r\nR4Vbeii0Oh6anIv+hQmCfconTbiqeTEUbQg=\r\n=Chfi\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"6a4dbcb0b4c7d96a85ebe59a5ff66d2469e177a0","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.1","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.202823f54.0","@material/rtl":"15.0.0-canary.202823f54.0","@material/base":"15.0.0-canary.202823f54.0","@material/theme":"15.0.0-canary.202823f54.0","@material/ripple":"15.0.0-canary.202823f54.0","@material/tokens":"15.0.0-canary.202823f54.0","@material/animation":"15.0.0-canary.202823f54.0","@material/elevation":"15.0.0-canary.202823f54.0","@material/typography":"15.0.0-canary.202823f54.0","@material/feature-targeting":"15.0.0-canary.202823f54.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.202823f54.0_1673473003968_0.11755824247819113","host":"s3://npm-registry-packages"}},"15.0.0-canary.199fe2a2a.0":{"name":"@material/slider","version":"15.0.0-canary.199fe2a2a.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.199fe2a2a.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"ebe6ba1612e3b91e92901e22376df3b3d980ffaa","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.199fe2a2a.0.tgz","fileCount":37,"integrity":"sha512-W3IofmTRvSewQQihq0U6u7e98RvMN8KVmjGLupADkCZHdp1bYFkGcKKXU7xju2M6oO40AW5dK+32F1bJwouNOA==","signatures":[{"sig":"MEUCIHDXeTS68iK5XKPJmLpWBWzXpB0fWSg5wEC4d81pgForAiEA48vRRgTotrvlePilIKus5csjuLEqK6J+eDE37O9vxE4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1224032,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjvzCbACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpCQA/9H0ez3ggidzggA7SRH5y5T/WTb1v37Z2NNpWQtiHoopnRqC/0\r\nXC8cXwchrXxB6xUnIRUnBIFJj4RfNpWztENfbiB1SnjTYjpTrS/ppsYay+2B\r\nl1TXIvEsM2VYDL6Dzpe34iEbpGVJWhMtuEpzSBe1zpVPgS0DpDZk+uhqJevX\r\nBqaeaEhbZlS4apibXDzVyPFGc24Z8ypSMPdwF0DSw8SSaugOmSaIXIwcvPAB\r\n72/Cj9BFXdt9vzi5owgdvxAFlTYgvh+lBO2duxQXLz3ypYwSd/02zC6wBczk\r\nzgS0hW/wjmS7YwwEykQmO5/IvHrr90Me61hJ3EK8IBgKhWm3iF5FddZnpMnp\r\n//29LDSTxef9qVZ2CW1Kd+Jt3qzQVdNVGKJXfTPe4H+vwt+hxPFpIVF+pTar\r\ny70YL0oZTLI5hMpl4y8XHvG2BSotXRrKsz88McmwG3Pr1sTi9q+LlKmQVziU\r\nFH4MxEm1753P/Rc3x8QDuS/9EY7Off/PMTubTSAGJ5ktkZqPbPE6IFvzFc+I\r\nr9wBW8Jq8hpeom5B0k3eHDLcFWm1++xx2uErI7n2NwrUN5uO9MqqYWbv6HlO\r\nBPNC1HA8XNz/FJCePq1/RxixGn6usJfJLV2aYogZRaCfHZlWVUiNNuonkTJ8\r\nCuQRv8oyZ/NSRc/QfTLa1SoofvUnEgHWdXg=\r\n=j48T\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"eb39fefbc3ca102a52db83ad19b42f1a2b52ecd1","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.1+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.1","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.199fe2a2a.0","@material/rtl":"15.0.0-canary.199fe2a2a.0","@material/base":"15.0.0-canary.199fe2a2a.0","@material/theme":"15.0.0-canary.199fe2a2a.0","@material/ripple":"15.0.0-canary.199fe2a2a.0","@material/tokens":"15.0.0-canary.199fe2a2a.0","@material/animation":"15.0.0-canary.199fe2a2a.0","@material/elevation":"15.0.0-canary.199fe2a2a.0","@material/typography":"15.0.0-canary.199fe2a2a.0","@material/feature-targeting":"15.0.0-canary.199fe2a2a.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.199fe2a2a.0_1673474202843_0.7288076350283506","host":"s3://npm-registry-packages"}},"15.0.0-canary.8c0786d6f.0":{"name":"@material/slider","version":"15.0.0-canary.8c0786d6f.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.8c0786d6f.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"bc08325219e2bed3558a2c35a38fd44b737ac73a","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.8c0786d6f.0.tgz","fileCount":37,"integrity":"sha512-sHUwdnpY3ckPr9chs08OyrzURaxJyZODk/QByGV93qq7fi2YpkO2kkSksEfKOkdhPr6XWF2qFI1cy5CA6/6LFw==","signatures":[{"sig":"MEUCIQDf9ynwCUyw03XxLEoeq6b0ZezjnxsF7zkIDBbyaY0xowIgJps8gDr9QDxEmt+TxVpLo5weUdrJqVdC7P0jw4aiazU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1224032,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjwBsgACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrrnA//Z4zZ1b++EekPNKoM1UmMfUuCIioT3lfIcHblOEOZJUdNFY+a\r\nAnmlKVJCrA6MohMv7mhl++n+U/8DyKDu2EsFJ/BCYs9uEmCmairmPzUsgYXv\r\netCPQmar6qHK+uQw1BVu+wEMfZq0wa+BYs2n4gm1SfQ6kUxxWjin5JR/Yb8c\r\nDg/Ez21uJ4Xxe67nEVLNNM9adVH3wFU0YLvAtMinB4QHdN/ZOVcxI/aLKho+\r\nctPcIpGXmOPF+0rcmCfI6b9lfg8Af3wC5sT1ACem3V+mweOwct2/sLyLB35a\r\n8icoGZUMFC7rUQUVShJ3v99LXop1Ip7Ra6g0bkyC3BpHnTX/9XGSxG7F/Biy\r\nsnnjXzq17SmGt+nErpyt+IZuCo4WOD3vIyoaxoHiYHGtreP2+o4eqcNQn+3+\r\nosOWjyVtwL3a5rYtyJGEk4WOwP/3fc0dyRlG524jjF1uEuWhe6Z4Zg+9w1Rg\r\nLggGnW/xSYfK/zxDrBTw48lKr6ID/cGN1H6w4IaPG8pnGFSpWIHp/+l4RgI8\r\naWcqcmm5V5gnlnoXslz6dy+ALJsyxeSoXhXeFy3SBjm5fPg0BxF8y2jhK5DG\r\nt5f56q65Rx1C8/amTpDUT/N/L68JeGBzH73cLMXItFBsjpaRsgZCPFXeD6aJ\r\nZlURCm7z+HmOdZYQt08goGTIdce4j4/PjJs=\r\n=ghhF\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"9016794346c3c3cab2cf31154ef6a35eb5598994","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.2+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.2","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.8c0786d6f.0","@material/rtl":"15.0.0-canary.8c0786d6f.0","@material/base":"15.0.0-canary.8c0786d6f.0","@material/theme":"15.0.0-canary.8c0786d6f.0","@material/ripple":"15.0.0-canary.8c0786d6f.0","@material/tokens":"15.0.0-canary.8c0786d6f.0","@material/animation":"15.0.0-canary.8c0786d6f.0","@material/elevation":"15.0.0-canary.8c0786d6f.0","@material/typography":"15.0.0-canary.8c0786d6f.0","@material/feature-targeting":"15.0.0-canary.8c0786d6f.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.8c0786d6f.0_1673534240134_0.04356141340998376","host":"s3://npm-registry-packages"}},"15.0.0-canary.8a74f7c6d.0":{"name":"@material/slider","version":"15.0.0-canary.8a74f7c6d.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.8a74f7c6d.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"a21d3a6b8c366aee7073e83de178d871761e6ea2","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.8a74f7c6d.0.tgz","fileCount":37,"integrity":"sha512-ZNcvC7HV2d1zSFARJxzvGgOnszxCQ5KZGsvL9sfRsg8BhHe1tGiyXuPe4gZL8hu2YKIAlZXlz4qVt8uOjmhqNQ==","signatures":[{"sig":"MEYCIQC2xJkML7YOgROBSzYuZ/i5efj49a/HCsvY2EvVJR6R6gIhAOK6En9jddOYQifKic4kF2NYFpwuVMtrqSL+LT2412gd","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1223023,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjxvYxACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrllxAAootVfz0IwgcmEt6LuzRuhVZxSnsy9gDq/BpiralGf2z6eVJv\r\neFcN9aHew2YGesEnGYwrbct/k5JwSUu9XSRPVMjDuFV6Q1HFXOos25Hpfjfk\r\nqoFLXGom+NVvZHkDuJmZJLZO1gyb3aJrPOaY6DchZdIHquS0Ajqw4pX5gYBM\r\nU5+xpLENJTlso69+q2xtqC1QhuLcd8iShtqjVyxQcDnzPSUoOEcGddnvB6Ec\r\nLY+jGoxfLcRddy1u/P6DTDdR9c+3MDpBpbrm+anPkX3+KQRGI1V3E9uEQPHl\r\nUg64BOW5NwT5fWAHAaSoR4Zi0BDfP7KRH+iZQbD/Vs2rsTvi8KOF7iP0kMp3\r\nnmVmVB/S4d7aX906e5sL1og5ODYdAiclKdLO0KmBF790gnT7vqo+Fu1vwtBA\r\nhdDrJQdkz311W49n9Z2iTg9JNdKx6dAvLsupA6oASZe4XqzKBxeU5OS+qws1\r\nUhkp2SymXvpbg/JNUCYxP10DWy09gPJEYDS96WQ/nT3Or8iVhgnYhNiTDZSY\r\nGAMkT9DIUvOTVHEZtmo82mYJC5t30pGdguoz0QLxOJiPklz8Iul7CGWUNron\r\nHla6F0/9k4bw5V6tcxrajarrjgwOyrd5XHNBxXx2TtIduhnniwknUHWH0bn/\r\nMX0xs38hcUcUCaXpOZrE6WrpQU2Z8rQuTdM=\r\n=Hzp1\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"9c676a1e4329c32508a9e7110198a336dc704f58","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.2+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.2","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.8a74f7c6d.0","@material/rtl":"15.0.0-canary.8a74f7c6d.0","@material/base":"15.0.0-canary.8a74f7c6d.0","@material/theme":"15.0.0-canary.8a74f7c6d.0","@material/ripple":"15.0.0-canary.8a74f7c6d.0","@material/tokens":"15.0.0-canary.8a74f7c6d.0","@material/animation":"15.0.0-canary.8a74f7c6d.0","@material/elevation":"15.0.0-canary.8a74f7c6d.0","@material/typography":"15.0.0-canary.8a74f7c6d.0","@material/feature-targeting":"15.0.0-canary.8a74f7c6d.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.8a74f7c6d.0_1673983536772_0.4463756665957588","host":"s3://npm-registry-packages"}},"15.0.0-canary.b4687fdc1.0":{"name":"@material/slider","version":"15.0.0-canary.b4687fdc1.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.b4687fdc1.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"2f527f7b866476f6622c02487a09f8b546f5e470","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.b4687fdc1.0.tgz","fileCount":37,"integrity":"sha512-3E2FPNcAVG0p0k7npy+aAQ4Yxsxy2gXxGlKw0JVd7yUc6lSEfsjDenr4EDrofDysv5W+gM+BTv3qN5GL0jCQwA==","signatures":[{"sig":"MEQCIA8v69AQ4Imchnc8tN4b6w3ePDyy0Hi32S9bzg3Tn8oKAiB2yOUQdcK9qDIH0QSODvG9l6rTqrdaUbtORyYJlMLDpQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1223023,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjyZ8JACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrLQQ//Ua2jxeSF82zWP7zNBq2wIscrtZiFrVswA3ohc0wHN03TbFDh\r\n2UHXPIRCqEP6r2kTVapdVkyVMa2mPYnVY0ZqO4yhW5fLy7/gq06sqpsgWvr0\r\n2YIJk+b+Du2ptoi98rAJMNIfaFtv16a+LfKnBK5mAm3+f6AA0vpkylp3rNAR\r\nHjHpz+/hfqJN1hK51iHdF9hyNRmUhrHp/8sdh/0bNHSalRrJ9mJJL0MBKq+N\r\ncF4OAx//v9+t6hcafaK/bYQnyVhLrpR/rkBaJvPOgTqcjzzqEwfQDQO5GsNS\r\nRM2xH21DwHmOBwLBVscoT+GzNeTP6Kh9ws5dGBqdS+leseRHhUl+DmJuFkJL\r\nm4+cUTLlautnl+Qm0QvkSfQMwCjjWKAbSnHvlXRBMewyfQ2uBkoo5MWD3YfZ\r\nBUgi+pCHVluHn++Mu/la4lBT8UZ04gWuhBLCBKsnAc3OYG2RBaad5l7sCbEh\r\n+3iHTNfrWvM1e1o3ZyDjZ6J4lnC+kxAeHYl0lt673EbL83Ou8pxU1UDASPf3\r\nvqCx7KMcyRHlUtIR/srQajRetJ9Rx2fYnzkuvVInHvI9SmmFsbtUUWGQRs1O\r\nN2/QwIceMZG54CMsg90Y5BWNVbl6QEWvBPm/XmluyQ80ILC7A5TB9VxQGAT/\r\nvD9/AdamZh2rojQgx7JAN9MWWpLgaWSpyng=\r\n=OmgT\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"c9ec43c7d66a73ecf591f982a42a582e639a50b3","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.2+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.2","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.b4687fdc1.0","@material/rtl":"15.0.0-canary.b4687fdc1.0","@material/base":"15.0.0-canary.b4687fdc1.0","@material/theme":"15.0.0-canary.b4687fdc1.0","@material/ripple":"15.0.0-canary.b4687fdc1.0","@material/tokens":"15.0.0-canary.b4687fdc1.0","@material/animation":"15.0.0-canary.b4687fdc1.0","@material/elevation":"15.0.0-canary.b4687fdc1.0","@material/typography":"15.0.0-canary.b4687fdc1.0","@material/feature-targeting":"15.0.0-canary.b4687fdc1.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.b4687fdc1.0_1674157833396_0.6563125419387623","host":"s3://npm-registry-packages"}},"15.0.0-canary.b836b9892.0":{"name":"@material/slider","version":"15.0.0-canary.b836b9892.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.b836b9892.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"9b729ed07296fa2416ac81a0e590c9e9a3608436","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.b836b9892.0.tgz","fileCount":37,"integrity":"sha512-O9o8CmlhawNgaEPEslPrvvHC9BQG4ygWNq9gNHD7Z0qRYtgQgvGV86vyuDl/puzkxruMmOcWsAsW3uxZsVDH/g==","signatures":[{"sig":"MEYCIQC8zmVP0LkRS5W4h/luXJdFkRXc6E4ukZh8b8PQ+QDyQwIhAK9cGwOmeGA87jQ873ob+6NYkPAc6iXaW4ZDQlsENpS/","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1223023,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj0F5LACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrkeQ/8CDQjziW7J4R5xjEy5E8RaY7YTKQDNe6/6fz9jQzs7fkxC4ao\r\nMitnT76wMlODIdcPKFw9qQElp8FUibutla6xBuYpQzRbF5lWPvEMlk+xYf7i\r\nJWTiFys4/x7mcVSMYgOKwEhmgNw/WJQLM+KwsQxGZNiovIPn65ci99spiCrV\r\n7MtD90jWJzV+aGb62MtNqFVrlGmsSzcBgD8vWv4jyyPZxt+/SAB52OJZC/u5\r\ngrmn6stTwu9uAHVPCnSeoDpgIfs4NRuxNgL3t1koQgNLtP6WEA+etYXZhdMJ\r\nSPnTJpVr0gGOGbB0avjoKeK2HURJNx31TMW+9SjBr0nlxrkInIf6oYuzdpmH\r\nRK031WBmeDHJkRVr1CvO+uWeBDmDEkhkTLSHPUb5YWZHv7rOfWbOEC69efGT\r\n+N9aDIXdq/nouUF7Xe+Ke0I3KhXYszkHdflnHaTFyQh3q9pizYIl4vDFCpEc\r\nIPPbHqdpbSzhKJgcVDCGHOVslLW1WRfArIp7ue+ThOFN1BIjlWWwkzH5+wWc\r\nXMGQawdthZfvbQf0CER1jcDjvvJYwuwVL2yKr8gD5c9AWcQhUj54HbFi4spa\r\n3rRumoII9uobJWPjgiI5J0koNKe6XTJcBePUfmwUTMw4dykU3EmhXXW6oCpW\r\nJteeNBx+zmTY1sPbrfkm0019vZOm2LKjGmo=\r\n=K9kR\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"3a9a0b2e64227ef1f8979cd5b82be3767b100551","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.2+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.2","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.b836b9892.0","@material/rtl":"15.0.0-canary.b836b9892.0","@material/base":"15.0.0-canary.b836b9892.0","@material/theme":"15.0.0-canary.b836b9892.0","@material/ripple":"15.0.0-canary.b836b9892.0","@material/tokens":"15.0.0-canary.b836b9892.0","@material/animation":"15.0.0-canary.b836b9892.0","@material/elevation":"15.0.0-canary.b836b9892.0","@material/typography":"15.0.0-canary.b836b9892.0","@material/feature-targeting":"15.0.0-canary.b836b9892.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.b836b9892.0_1674600011471_0.20358322139668128","host":"s3://npm-registry-packages"}},"15.0.0-canary.e8912fd37.0":{"name":"@material/slider","version":"15.0.0-canary.e8912fd37.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.e8912fd37.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"684cd38d61a25f422a751f64f51bb2367993caab","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.e8912fd37.0.tgz","fileCount":37,"integrity":"sha512-wZg0HoAx78Ul/IvADle3/cS9pvAGAFwc5MyOEG+2lPHdhdK+/G1Yp7BIs0zTpcdj9PmvSChbf7Q94qCUIpW0aw==","signatures":[{"sig":"MEUCIQC8PyJIWSBRKmeILt/7076DwA8qJwMKPnMkCNCp8onY/QIgSBSOxUrQrHcVV3RFuBQbcdTeyYEgJP+ysG5O0asJ/nY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1223023,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj0sbVACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqLGA/+I9hHXegNkYxUJKXwAhFFjaCpZCJnElmTQ9P9G4RXDFol08jS\r\nIHPbIZ8Mk68UiBlCJBfAlnKqi5HrjrZVmywHaIvVgFd3hm647v3nqWVkiBXD\r\ncUzEE794l1Ajroet3D7L/kmg3+PMAHSVe0FCMdcJJNHpTZFyyUvwVw7q0TCd\r\nmLv4vqd+zY+XpWWNLCKYdXU0H1ENX1l9b/damstnZsi0RmfC9bCr/3uu+NaC\r\nKAi+ioaujo9spWzZfbRyVGW1dsf5yEbamK/PYIaRW90RmOinZYNksqUKk1TC\r\nLDZTAxsHZuvTPvxyPn73OIV3Onc1RzJS/cOMUSwiZnbKIK7sh/dDPBA2GCU9\r\n7AGjQxZRGSFYEgDSb3d8ng44svrEw1gbKWl7e4JJmz356DYAUUY+B7QCmAzd\r\nqh7tl8zNo903ldZdaQgp9vSo6+NE932K3ESTo4+wd6zgfhOFgot7vZgm4Hn9\r\n8bjgF/DVwtDNC6joxRv7CQkd05828BgQOjBYGhCL25DovI7I3/Aq8uonFHDm\r\n2xbjdkkDYSzBMzyuEwojAN06AvfTvMOqU/aNP50cwlpchl0BDHfO3FPTWU15\r\nxQlKpuz0SpPVfYkCiSCAl5d2E+7EKuqkKrzPN/0HmJ9RiWFsVsvpYzG3BNha\r\nc1x2mnyFHwGLvmyWlPH+q+tRARBzqmVQRTg=\r\n=Chbj\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"72b44fe55689bb591aeaddf242920ba73a6e5bb6","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.2+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.2","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.e8912fd37.0","@material/rtl":"15.0.0-canary.e8912fd37.0","@material/base":"15.0.0-canary.e8912fd37.0","@material/theme":"15.0.0-canary.e8912fd37.0","@material/ripple":"15.0.0-canary.e8912fd37.0","@material/tokens":"15.0.0-canary.e8912fd37.0","@material/animation":"15.0.0-canary.e8912fd37.0","@material/elevation":"15.0.0-canary.e8912fd37.0","@material/typography":"15.0.0-canary.e8912fd37.0","@material/feature-targeting":"15.0.0-canary.e8912fd37.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.e8912fd37.0_1674757845186_0.03991100249672508","host":"s3://npm-registry-packages"}},"15.0.0-canary.16fbd30ff.0":{"name":"@material/slider","version":"15.0.0-canary.16fbd30ff.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.16fbd30ff.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"6b548bfe0a99762bac9d2556c92edbca56b3735e","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.16fbd30ff.0.tgz","fileCount":37,"integrity":"sha512-2UDj/mT5l203xUzYJdEknPXuBYJ5/JRoTqXcIeo09hUhbGs30AQBqKnufLefeHFWX8kF9o3oAX7bseKRMpUt5g==","signatures":[{"sig":"MEUCIQDBEne9m3S3ZMKU1cLlptf99YpuePWeyC8wIbd9URH6WgIgXttHAOyLdsSGYU7hnpyaNdUtxhoa/Z/pHeXXRPuRn+I=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1223023,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj0sgGACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpBNA//XQre8l5suv2ZhB4CLMAjnvbE7cg3SoMQ5u7fUwrkfs9D6LSp\r\nCmmMoL90pfW+c3FF2xHFFNW7h50zHjPF8i4jspPDffSw3rwT8p9nweCCixHn\r\nUi1r4izUFlXJrcsUGg7aEyjOjXNghDRPPo2SMpDnRJCiV90eITdgRRKQjWv1\r\nohZA8LR+kuk3Ag2NaIwcJJ59fGOrT7R66Yw1nEc6VHMOOs+w26QUvwOo2KdI\r\nGRnrz8TnySIGGZg4J3tVNemiMWtsKHaJNLCkXlOackga5iXaKdruMCYJFQPS\r\n0YmymJ9PQWV9Jsgw3x8ymhvRTRcrP0hUkZHXITdVKnSNN5+Ld77MtAmKM6+e\r\ni1ZRusPZ2TwJIk8vHfq0hMblktSZSo2MKsmEyVOka8LSFFGArH0jzqmJuW9i\r\niwA4Xt3PQK0qZVA1LJC4e6fYk+HApCjAeoMg7rKdMQd1b+LfgKvp81N7Jhm+\r\nqGXHGo+CSDZQtuK2kQmTIa8DMyW+mfviqMC4X8FZsW2MVyh2OuFDv7jdZotz\r\npgpIUU7ziVPqjPHU9LY/Uq+qUNZKl29ON4F4bt3h7OszF0xWJ+K5wxQuDQ72\r\nPf6WPVGPSgR2vW2bhFdT7h7nmbsF3sT7tBxnLfME6IBh82dWIF+V17j3d/Yk\r\nrXzKDD5Mgh75+tHlOeUNoGUMZGjynnPqRBE=\r\n=Z6VL\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"f4c39ff05bbd1045563670b4ea50b0be51a91d01","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.2+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.2","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.16fbd30ff.0","@material/rtl":"15.0.0-canary.16fbd30ff.0","@material/base":"15.0.0-canary.16fbd30ff.0","@material/theme":"15.0.0-canary.16fbd30ff.0","@material/ripple":"15.0.0-canary.16fbd30ff.0","@material/tokens":"15.0.0-canary.16fbd30ff.0","@material/animation":"15.0.0-canary.16fbd30ff.0","@material/elevation":"15.0.0-canary.16fbd30ff.0","@material/typography":"15.0.0-canary.16fbd30ff.0","@material/feature-targeting":"15.0.0-canary.16fbd30ff.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.16fbd30ff.0_1674758150276_0.9257279881746272","host":"s3://npm-registry-packages"}},"15.0.0-canary.033ae083a.0":{"name":"@material/slider","version":"15.0.0-canary.033ae083a.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.033ae083a.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"155d9bbda57ededd3e5462b2600031b099ee62c2","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.033ae083a.0.tgz","fileCount":37,"integrity":"sha512-/iTwraRV/+umgMHFqChJ079YpyU1oB0dXyzcE7oN4BL3BUDwMkOnvlABhNP/XcYyUIlM/G3PqgsmdKFRLcMOzA==","signatures":[{"sig":"MEQCIAQTqMCSRUtg6fISU44JHpD9wuaBymcOYEmZGzWxvNx1AiAfIVj3F2Zfyc97CXeUrb7tEHWZyeUz7mrVL1tqMJpnFQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1223023,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj0tQ2ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpNIg//ZdpRGFUuhMLaBh/cCy9LYkruEUmVRGnJfo+V3xf8V0yyWsVP\r\nwoStG0FeWvkHeD9ZVzA0Acm7ig7kj5GQJyWz/spcCpE/Ys858nUi4raeFlOk\r\n+EE8Ijys8X47f/Yezz0raiwfDpQ/anM4FQ8I+B+ppV6JY80L9fXh6lbhQfFJ\r\n6ibjoP8csC241+rHZ2/iQRC4pnT0yxfIN8o8s7WX4+fe1xOJFY/jg0uKjGWJ\r\nFC4CX0IQuqHdiPGKmkZXp+4wxX+KY068aYkVAGf3MtyljsMUbiCVWHL+FbgG\r\nFKRk7CJlWl3NiVIsyLkq9H1vpGS0wkh1B2HwNocJ0oP9BaMHvN5jyYn4Maqy\r\n0gGbx0JgXoHZj3u9O1ebIhkiAJSQlWQnR5C3kPD6b+8OW4kAXajWMBGN2nCA\r\nk4xOfslDWwTFPjxe0XkRgNdBLUPSu6RhnKKx0G8fsTkiDtOnuP9aJLsMTgZ9\r\nxjB61if//B0Hz94hXz/GDmbO1jWxzJcdvkJhxt4CIhKG/3a/k8Lo5pWYonp7\r\nkrVcMi7qISRwLahOFjYUQsKO7CUwC8Z76/x+m5NyhxL36wQQ+SVNzwORm+yF\r\nBV0DU9d47funKEnLDAgDUC1fkUOZSEKQqPxnPzqUrugFroCvLLvZbQ6RUV/9\r\n2XzNgoSm8CEiVuGv7SKViVv1K1sblSH8UIE=\r\n=fs5P\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"89ca938c110806d9150a3889a7d25689661c2fdc","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.2+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.2","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.033ae083a.0","@material/rtl":"15.0.0-canary.033ae083a.0","@material/base":"15.0.0-canary.033ae083a.0","@material/theme":"15.0.0-canary.033ae083a.0","@material/ripple":"15.0.0-canary.033ae083a.0","@material/tokens":"15.0.0-canary.033ae083a.0","@material/animation":"15.0.0-canary.033ae083a.0","@material/elevation":"15.0.0-canary.033ae083a.0","@material/typography":"15.0.0-canary.033ae083a.0","@material/feature-targeting":"15.0.0-canary.033ae083a.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.033ae083a.0_1674761270395_0.5873795057939621","host":"s3://npm-registry-packages"}},"15.0.0-canary.3a705fa1d.0":{"name":"@material/slider","version":"15.0.0-canary.3a705fa1d.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.3a705fa1d.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"b3a0ab7b41b11866dd101076fb549114e4386091","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.3a705fa1d.0.tgz","fileCount":37,"integrity":"sha512-/fxyOo+4KLAl2rLgXeknTsmSR0oVm/FHOmlFD4ruIJLzeFBYhY0g68tOj95kMM2UiCqtDAnOqwskwxEVuNS3QQ==","signatures":[{"sig":"MEQCIHqaR/LRU9rcHevQ9W8Bw288aeVYM0U5xGQJp4xTf16DAiB10J2hU74bODoAbCQKwm0J+glcVNHk4GZlQ6nmLs8StQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1223023,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj1FPOACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqWrQ//V/0EsptqApv0Rsa3dUa+A2EUiUc1rq6kVxJ4EAeHRkSU635F\r\nLAST3xcMCt8NMCl3hXuWkivdaP89GPkukGafnY0pYryWhpYiJNRt2v9qSjbt\r\nAMuq3R3Z0We+iPUlSiSExma8/BqCAIX8MCakswi8VKgN+KkMfxkTD+jI400C\r\nRWcv63pbc5QAuu3wz8/IhSTH3pylaguNbQ9dh+fIeY0sxiHAAxHC3UyZ8Pj+\r\n64bpdPx6/oWsOz3jGGMRisH7V2PoCOOdmaW3v36/9k8yzOmUZdEbF3GkSxYD\r\nfqDdvj+llhR0LSVrNgCfMy2HkeFO+yzmSBdO0Z4AnVXVGP4kANFn1hjEEJqW\r\nlTremExIqUz7l1KUb+cDGKu3psHIBDU4sw10oNqYAALzx7T7RWwV9N8zvbfz\r\nnEdrUhFbRZBLWSlMaqt9Aj+ErKQs4U4MLYhzAINiA6n/RnYTV8lGIB9vyHOm\r\nrBeh1g2rr8Gp8DOIdkJq8NyXnyCPnPkVp9bD0hI2L/FjFEc/E7DRDuSmfEmD\r\n12Sx9VLRinm7stbaoQ3NyfHyiMYaeMJXGjcHBREHhpXPpMPVRr+eGqicQfyo\r\n9/xkJN/vGVIh8Tacuw0Z4i/OQKq1TSqBLSVyIAwvhX8P+GT2fM1r+U4Lf8Cv\r\nHZX7DOVwLC8Irlc6fSlXJ1bgUg3TvcHy23Q=\r\n=El+3\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"7e0f3737f51c1319f66762d8021d6aea33391733","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.2+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.2","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.3a705fa1d.0","@material/rtl":"15.0.0-canary.3a705fa1d.0","@material/base":"15.0.0-canary.3a705fa1d.0","@material/theme":"15.0.0-canary.3a705fa1d.0","@material/ripple":"15.0.0-canary.3a705fa1d.0","@material/tokens":"15.0.0-canary.3a705fa1d.0","@material/animation":"15.0.0-canary.3a705fa1d.0","@material/elevation":"15.0.0-canary.3a705fa1d.0","@material/typography":"15.0.0-canary.3a705fa1d.0","@material/feature-targeting":"15.0.0-canary.3a705fa1d.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.3a705fa1d.0_1674859470419_0.1428656684542473","host":"s3://npm-registry-packages"}},"15.0.0-canary.d6bea2ff2.0":{"name":"@material/slider","version":"15.0.0-canary.d6bea2ff2.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.d6bea2ff2.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"b0d6f8e904f3c9a3ee0013673d8b50f965db48b0","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.d6bea2ff2.0.tgz","fileCount":37,"integrity":"sha512-fEFphle9jMMpheF8A1Bq03pk2/rS48GAVxfBhTUyB3kCTPMluGAzXWRXmXFW1sDWFkRFFMSaFcyDG9p2bqT/fQ==","signatures":[{"sig":"MEUCIEzVCdVvAODEd4wyYupS/qVymhY99KuJ9lAAGff9K1fhAiEA/Or2h+dnRz5KazeJlTRziQ7s/NG9MBN1mXQIcuddplc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1223023,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj2TQ2ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoPGw//bnkZg+a5r3Fwij8Qhfozt0m5zEuHqvv9ZQ31jqFIjSXSYuov\r\nmumfzBMstvc7HZ6PjpgtjP0fDwkPtEngJ1a75Zi/Qre/kgAcFVD0IUTD+8FA\r\nGbH9GWUyfQSl48gvsLqJBv2jYY+qElYUF56FnAjDx9RZXuAlQOuSwSP8Dv0D\r\ndWUUEtFkGIBWnbeuAxzYu1HgC1BoDZBj64bh4Ysz2UoySG9RUZeQ4BeCY6jT\r\nfwqd2d5T+4gh7zQ+WITeu34MIbcqnZcqOOW98rjNH7zmffCMKbjfXL6qzsQo\r\ngTeLupcQcrtrA+X4azEagPC6UlvMYe8KggR+Ybqb9lteGsB5dBZAjkCFiG/w\r\ne9TIdbV85nsDyFYl5Ly6uFyUHottUDRrTaep/HThsz/WTS+kVF7du83UUN59\r\nOxnNtWRN/uRrPM1gGuNZaetQCc9731+RB6sjVHun28oyBaDlik2n01gdIuzU\r\nKWJkvG2TwBVcLQrUSYPpOLqVCQAeWEQ80SCP+P9J0aZz501Vp8F9iZh0D5op\r\nabBL+lPcvBmV577b/Wyw0UzC8zB4azY82qJxMeQS3Q94vscg4sQlyJEVAsHN\r\nHZpJxFP4dIfB9olniltGV4DxKnrKz8e93GbD12H2ERYId/0lSn1a8i3kF6vL\r\nxAneUtS72dyxotFQFRktboKg2RnCO+U/x/c=\r\n=F6Dy\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"e4210a9f21a7e6ee007d475d5bd7e229dd7bbc00","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.2+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.2","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.d6bea2ff2.0","@material/rtl":"15.0.0-canary.d6bea2ff2.0","@material/base":"15.0.0-canary.d6bea2ff2.0","@material/theme":"15.0.0-canary.d6bea2ff2.0","@material/ripple":"15.0.0-canary.d6bea2ff2.0","@material/tokens":"15.0.0-canary.d6bea2ff2.0","@material/animation":"15.0.0-canary.d6bea2ff2.0","@material/elevation":"15.0.0-canary.d6bea2ff2.0","@material/typography":"15.0.0-canary.d6bea2ff2.0","@material/feature-targeting":"15.0.0-canary.d6bea2ff2.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.d6bea2ff2.0_1675179062249_0.8081429417663055","host":"s3://npm-registry-packages"}},"15.0.0-canary.0c94182c8.0":{"name":"@material/slider","version":"15.0.0-canary.0c94182c8.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.0c94182c8.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"7562fb9181c0477effa9cf8f7f31f3a185594e96","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.0c94182c8.0.tgz","fileCount":37,"integrity":"sha512-cev9oSlJGBHn2QilzkBwJ8Or++WRXsboTgnh2df43sERIOoHDlkwe0CKn8g2QKmdwuR7J5TXRK83dRvM7Q/whQ==","signatures":[{"sig":"MEUCIAWkzm09sO2sFNjdSjJ0WdTbTux8X9y8ITN76JHbx7rsAiEAom/7lIwD7Grho/hQxFNo4KoRWdnRMe+/FVVQZRJFB4c=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1222889,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj2qUiACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmo/iA/9HAG5VGQv29jf1kcUS+1yj/PZ/Pd2y7Xz4jBF+mhrUj6pBZEB\r\n5jKvty1CzbYBF7P/1m5Gal37x5nR4nNrUHF2nq8OLISGjzyFkJ0r+7PUHdeF\r\nDrWYLpkq20rvEXmzstpbRq79X4AB9DO60BZ9pEF0c7oosWivRrGYlT9dNSm5\r\nDRgUPAa9yaevZRRefrs4uR6sDFCKCVr3CCDwD0UbTxtkn0iYb0i+MsBcMQ4j\r\nIAOoxVDCJnna3nKhmJRg1lCmQwLf3Y4wJmiKZnDjg9ebPFgeAVEjNYrTrbp6\r\nffPVNLCgsnUH810Y4WpxmoHBeLPI8UaOOPg4D3Ul5uyTk8SpzNO1tVPKPtyn\r\nvAEQeJyZ+Wc5y3zcWBc8D7gjpTxIwKaNONCKZBHu49is+ZuDfIr9DSzC/+Gp\r\njw6gak2wiOTVK/AwFqtvupU7/ZK8BY0regB94vFvTIZEQAPe1GK66j0GthQU\r\n5bwvDAV23dhivEj9GIlNZfaaMzw4Bt/ePAmtacZv7XNpio/eMgtrfRxxncZR\r\nU3RGNzQG+EK7Te56Qtu6VOkJ0j7Czcxp0wXGlhlnYxDwGrgU8MKsaQYAMHcC\r\nobjVHNTr24Dm91XOURGH8VZxscom7gK0UXXcAG7bjksilC1Tq7pdymQJO3k3\r\ndVoSqzY1X+WB4U5sqRYvf62BWdSml3Etcp0=\r\n=Csvh\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"9e58d1edf6370fb6c26f762d83ca31f928149e41","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.2+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.2","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.0c94182c8.0","@material/rtl":"15.0.0-canary.0c94182c8.0","@material/base":"15.0.0-canary.0c94182c8.0","@material/theme":"15.0.0-canary.0c94182c8.0","@material/ripple":"15.0.0-canary.0c94182c8.0","@material/tokens":"15.0.0-canary.0c94182c8.0","@material/animation":"15.0.0-canary.0c94182c8.0","@material/elevation":"15.0.0-canary.0c94182c8.0","@material/typography":"15.0.0-canary.0c94182c8.0","@material/feature-targeting":"15.0.0-canary.0c94182c8.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.0c94182c8.0_1675273506559_0.7855793430704181","host":"s3://npm-registry-packages"}},"15.0.0-canary.15b221540.0":{"name":"@material/slider","version":"15.0.0-canary.15b221540.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.15b221540.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"c4546dd60ca87b1ffe95985cf1a619b372f47653","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.15b221540.0.tgz","fileCount":37,"integrity":"sha512-QWUSQXb5Yrj4ntA050g4f82uSxWO+KSvDAUj0uLOLaWgt3WI9VaeLrv/qKWZaZmzzj2N4t5YMoAfjQCeS6x6uA==","signatures":[{"sig":"MEUCIQDqpK7W7l9eQzd/DsWToyy01RuavCOyLcXLaz2UmNP5qgIgAtTqcpVG6kj8DozEwPgNe4+n6ULBpcOCwDtcfRIBUVg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1222889,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj2qcfACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmpzbw/9HQFj7G5adZ6tVkJCEzrhYA4wt0ONLOiKS0m0HXCQLNtKFslq\r\nGpba/jTFXbNMTvH7npBjekxlES5BgVXfIHoEVf+kKoHRyRnCRHHoHWsCcoRG\r\n5LGbeTZEU9Aqnhe50c8tV+94FreOvWu4IJOnpgt3+WMHEX2qvDImwCruJr9t\r\n5Xi03R9ScATPLvcengNTG9nGwTP/n5tJAISzRlMpbjaoswKAAhxAqPhrM9gs\r\nykNrDSIS1j2tiwAT3H4jYAD0OsMk1VCWHwlDi+fJRH80siVR5JTZvAswk0rE\r\nK2Boefkm1zZDri7ijRs9uSBwDqey9RqXXb6pPNvVdPCQk/raFeAkwTx+PFkM\r\nlDO75GA5zQzLIGXllBZsbc6/Bc05P2pzD1H6n0LgjGqTKSW+g+zke4A6dXOx\r\nOc88rWQfCVB6aDuGADU0etUOMTtmN+TTV52IKU9Y02TxGr5lZN1JjlPpXnmY\r\nNqm8SwTKmJ4iKHpDN7qy681mXjNh5rjP9olwnO9AHQddIul1r8mA2FJDTI18\r\nxi0kk9obvZvW6T6m4WNlCOCLZu3jFvIM8hXNpzxcWvig18pl5lpOCEE2DSS5\r\ncNj65c1HX3dSAYYVINcr3WpMWBcjmAz6E/Tut/f91u8ODZPVYUCQlCvGsInA\r\nsNSu2/+kVdevPR+dS7fWJtdGbROJUgPpTvE=\r\n=LEnQ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"a4bc6d32435d33a7b99197f32b85eb0b730acd30","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.2+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.2","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.15b221540.0","@material/rtl":"15.0.0-canary.15b221540.0","@material/base":"15.0.0-canary.15b221540.0","@material/theme":"15.0.0-canary.15b221540.0","@material/ripple":"15.0.0-canary.15b221540.0","@material/tokens":"15.0.0-canary.15b221540.0","@material/animation":"15.0.0-canary.15b221540.0","@material/elevation":"15.0.0-canary.15b221540.0","@material/typography":"15.0.0-canary.15b221540.0","@material/feature-targeting":"15.0.0-canary.15b221540.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.15b221540.0_1675274014888_0.44417270639239526","host":"s3://npm-registry-packages"}},"15.0.0-canary.6a4b3f834.0":{"name":"@material/slider","version":"15.0.0-canary.6a4b3f834.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.6a4b3f834.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"0d2599f55822feacfccd98f656dabf0a09b2f919","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.6a4b3f834.0.tgz","fileCount":37,"integrity":"sha512-f4Nzt7ndmwTg58dnK66tjM2coBIepc6iQnWxhtqyhwFNXN/m1c+X+7f+oqUlqJF9ZdUK0jGxAlfhjKiKNvXMAA==","signatures":[{"sig":"MEUCIQDweZNLqJGsCtYxakM/8gNWj6SsKa54AehZK5ltg9K3IwIgfQW7irGHxgFBPjFjNrUh/ICPA/jnamN+R7p4aATBNuo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1222889,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj2raLACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmou/xAAh5fmtXT4GpPHr4WRtVqGdnQo2FYevsTi6y7vx5OlB5WXK6O8\r\nqL9kRjvPecw4zonta5DFsC49zXQBRKNTPJKXa7p89Xg+gGWoR5cB8IsGk/hT\r\nEdtx7I5ms/SWS4TAWC6lmo2nDKp59vfB157ebZn5hdw8X/uEDEKFh/7RHp4l\r\nU3v2tz1LpUuhZ0abdCGeovkWhqAxZ/mpNR9cSPVLBjG29EvJHHBIXaXotrJw\r\nn62KjldhkRC9H4e6s2B+o+q75JbsTVMqhpHT0rQeHi4yiXM7Tth7M7SPaRNU\r\nKVZuljrclEqyqFGtD7ApDQFrwR/4TPj0GR7TuEiOUVRmCRHW3Y3vE9bwIfub\r\n5lzFnL8OQ80HCLSDFvBxpHOJWfoRewFZh4WDTKVhHsnPW3Uh5Z7M6YRAClPd\r\ntnPHeKft8YKYmNN5VJ2SLS1YVrTs+Epvl1N/caq3xk03bSuENEdo59e+jjMJ\r\nzlk/MypXZ19GTE9MYTrxV5nQXNvNXLDQRWG/ZMjj8qg6hStfSXcY+Oyg2LZR\r\n7ufteOPw0pRrG8/0YknyKShvQt6P9KNKln0lNAFYJvUX9D7o/diq4O4MLKdD\r\nJDt0Mgi0Wee0JDFbxU+k+waMmtRTjn/u49Fht4CwWJvVjppkID1SR2ijaZdv\r\nTOAUXhzr7DLkigNBMb++AdgJW61r+RIwghM=\r\n=2jgG\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"b1f2d06637869496d98898f4cdf709ebbd279ed4","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.2+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.2","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.6a4b3f834.0","@material/rtl":"15.0.0-canary.6a4b3f834.0","@material/base":"15.0.0-canary.6a4b3f834.0","@material/theme":"15.0.0-canary.6a4b3f834.0","@material/ripple":"15.0.0-canary.6a4b3f834.0","@material/tokens":"15.0.0-canary.6a4b3f834.0","@material/animation":"15.0.0-canary.6a4b3f834.0","@material/elevation":"15.0.0-canary.6a4b3f834.0","@material/typography":"15.0.0-canary.6a4b3f834.0","@material/feature-targeting":"15.0.0-canary.6a4b3f834.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.6a4b3f834.0_1675277962981_0.19315717452133052","host":"s3://npm-registry-packages"}},"15.0.0-canary.b177b40e2.0":{"name":"@material/slider","version":"15.0.0-canary.b177b40e2.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.b177b40e2.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"dcc26971616250757ac32b50c86097d432b06565","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.b177b40e2.0.tgz","fileCount":37,"integrity":"sha512-heFka3PQPAHQCtiUz7rqw4n6upbVu7+wSlwluULABPRSIGnPMDhaK3RMYKTrL8lp5P9siuIPMJhOZsi13IBtDg==","signatures":[{"sig":"MEQCICrDBWkyOwrEXjTjukjH1P9u/zxOPf4Ld+xFqrFdMA29AiB4MYXqO+5AfKXadj6hrU2/XBnM0E7X2BmrnYhtuOw1OQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1222889,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj2y9wACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmp+kxAAhq1AQmJZTmJoUmXCccoPoLAEF4n6gAZQqadCqtV/mjOx+isc\r\nsWoUeZre/mF/BEchwftmtdGWHymhZy/PdaAU/DG0u1bkWPxzspVjPozsl1OY\r\nThYHeEyRdi+NduY/oxbGM/3NmWKbeA9cYmWKBYXnc3zfjkhQ6rphtCo/n/ES\r\nCtQnte7Pyt8iCACw63mv4OfVBNA+IcHwy/rhycifubqMufAohqRI3ZojeJj4\r\n/HAjmw81FiizxIar6lMUhXg3QBBCS2+DgqBCQXe8qL6ZzHW+bGVk0J1ql1c8\r\n2UKx+0OBOcC++xqtqylmlj5a/S2Q5+I1cg/n1QCJ/bN3rQq6qs0dVdIUJP78\r\ntMnI2PU8YF/EohFDsAQWhhkTEec5vbdFOyX90WzYRuGgD5NTKfz0VZpUWKSU\r\nh5VxMWLxMtNcO2dt84JFYH7iUgYFv6Wg9Tt7l6WKrG0SVCdQnVlIFJMVNQZ7\r\nC46xd9gfByzvBEBAxTnCX4Vq0Y6Vua+ZfRivYhl0a/qGLmg6wBdobtFzMf8F\r\nNfUCfKEfXwPqQGkZZ88LW1Ff8gssBX/fEAbd3GJdTKszNuF1vOpf0q59zLDf\r\nbKWECwkwYCapskRxoCMnyM2kTA965bObpDcyqX4beuZdKh8tY8IDeAVcXCgP\r\nFJTc9Zngp1YySAru1B5LtHPq1hBiybLsrlY=\r\n=SqC3\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"e3b49a7dc72f9c88710ba68c63d4ddce56a58fe7","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.2+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.2","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.b177b40e2.0","@material/rtl":"15.0.0-canary.b177b40e2.0","@material/base":"15.0.0-canary.b177b40e2.0","@material/theme":"15.0.0-canary.b177b40e2.0","@material/ripple":"15.0.0-canary.b177b40e2.0","@material/tokens":"15.0.0-canary.b177b40e2.0","@material/animation":"15.0.0-canary.b177b40e2.0","@material/elevation":"15.0.0-canary.b177b40e2.0","@material/typography":"15.0.0-canary.b177b40e2.0","@material/feature-targeting":"15.0.0-canary.b177b40e2.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.b177b40e2.0_1675308911776_0.8862455697647202","host":"s3://npm-registry-packages"}},"15.0.0-canary.d9f821042.0":{"name":"@material/slider","version":"15.0.0-canary.d9f821042.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.d9f821042.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"c3f4727772e1a8ca878be7d06e2c03eef44ce9a5","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.d9f821042.0.tgz","fileCount":37,"integrity":"sha512-Hkky2LWOPAvewtgIwbzo4IyQxFHvUC1DtuVVNO4Ry+VoO5tVTaOy5diFZg4+pnlTIaB/RW4vQU2nZM8s2jvhZA==","signatures":[{"sig":"MEYCIQD5zNo9SWmYuFReoTxMg2i2XbmyNEMad9WxPhPaCvXz9QIhANUnrHx4DrwQNzGqRNpurIEecZw4cUN9ViaMxd8yPCgB","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1222889,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj2/VFACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqIQA/6AmFkvHsCqlkI7XGc1o6vPpP8dpEh1hhDW61ldV+KbWMb09Nq\r\nt9pkt3YmDxEwyGREzAUrONsFeMriR1y9QhtbqstpFYphN05oi55KGGqsH5gc\r\nAnnXCmiLjht/vyGcUe51L0H8DTnLu5kVZviiFo7azm0OXaXb0HUcDUcKq4Ue\r\nUWuHwoploatfCuIQMgbC/yaryGRacVxEI/XnSgwsDC/ETkwUu8k7GI+VpbFB\r\nE2Z/PBHJ5LZhVIO+YahsFGdQF8LfmFJnzeDZdJpEM7VWNRjRrasfDJdEtc9Q\r\nr6V0fBoCjh8zIMut85WyPXQbGKsmr91L0KlYR9lEB8jXW5NRA7RZUhgnUBzl\r\n9VIqoJeUCnGX1aA1zHAD9q/5Bvim/s32odRvGNaapNtCEr9O5gnbGlOXThcz\r\npHqqhqv6qb6yij0aYVTb3aFsRkZGK+QViDG8/280eo0vtRGf/Z2RDdyhl21I\r\n+vP4PwGtV3ZQ2HFDRR1tsDJI7WtUhQc6ACAljhnRA4X8sSFmlDOncrckABpH\r\n+j1PyOXn9lswEhXnXWUhOM4ZW2rCYBMnV7c5UMGhQjRg9VAgHTUFElnSKPW9\r\naSNGe5YGoUmyIdHoomPO2K0/22HYXHCtJUH2M6COV73HsrhupFB+mRemDTSD\r\noMaXgharZOsLz2o4lcWh/et/F02mfFBiFKo=\r\n=IWix\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  <!-- ... -->\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"9748fa2e1dd5886715f422f644830717544192ec","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.2+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.2","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.d9f821042.0","@material/rtl":"15.0.0-canary.d9f821042.0","@material/base":"15.0.0-canary.d9f821042.0","@material/theme":"15.0.0-canary.d9f821042.0","@material/ripple":"15.0.0-canary.d9f821042.0","@material/tokens":"15.0.0-canary.d9f821042.0","@material/animation":"15.0.0-canary.d9f821042.0","@material/elevation":"15.0.0-canary.d9f821042.0","@material/typography":"15.0.0-canary.d9f821042.0","@material/feature-targeting":"15.0.0-canary.d9f821042.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.d9f821042.0_1675359557508_0.1785733890152048","host":"s3://npm-registry-packages"}},"15.0.0-canary.47c7deb19.0":{"name":"@material/slider","version":"15.0.0-canary.47c7deb19.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.47c7deb19.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"3ef37ef68256165e3e7d8f9fd0af6348b01e5270","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.47c7deb19.0.tgz","fileCount":37,"integrity":"sha512-3XW38E1F9g/WJht/77aE92QNbYan/+CLihHNW2ZPFr8jChyg/A+Xq6RdGipN+3RalpNbwOSVhFqINFgDKGtAfA==","signatures":[{"sig":"MEUCICHp0KpzT0j+DT/pja46MftUidN+DVLsl0tqCPPYfxVAAiEA20JkX3H/SQM+5GECrP+bYEqAxNevFA4iYdyjfs1/kU8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1223466,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj3M9fACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpnBA//WQ3t9Dy2peWzwgZvGtmeajv7N/NVmlzHANE5222OO3KJhYNY\r\ntWk+bQ1eAqiXMjqoo0fZyFS/6gPjwlmpSCi1eK+B3+jJqhT/xXmmF2bsyEHK\r\nGbtWzdxY08/le0ALurxsKZiSeXonoig82wV3QZ/IvQqQ6SI6yV0JEPwZuSGV\r\nhSDN8xaFVUbhZEMNIB0EWGE2Nrm+qPScV14fL6Cuz1a0oiPaKdfxQcT5Lleo\r\nu+Ix/RBQTx25Oe3XkrH8n3nYgSvaMTmNbP4xZlsL73Tov7N/mzq8fpZWOJlN\r\nCx3oazmFgskzM4DjSIGNkHUctnoNvTOziNSecaFrUps94s0G2BiuUrAwVjVd\r\nr0pyrK2a8HdF0BHViUPNPHu7duIsE2DOWWDtlFOVZJs34EHnNVZpRkS8FTOt\r\n0LOoHeF83p7BCXpqYLrKy62efwuBbs1xavj6PV3MVmNEGZX/a9ulwYTJdGoQ\r\n7Bdq1jMm+fkzpgrrY4+4ABf7fLZCkaa0SBpo6J8sEP4VjLkVdJRQfijzaXEJ\r\nOkwd41wevTxamyUmZ6JZvMXNW84r6A1z5Avi9YL4R6+SISFWmVpctrQbNbd2\r\nwB+AgWY4arTWHOyKIUioLRQFW0G0s4jwzelbGJbGQBNgN4vLk97dpAX5qiyN\r\nLOFHJ3W2PTGE0XNA/N2YUIlI7Qwki2KnrEQ=\r\n=n548\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\">\n    <!-- ... -->\n    <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"d5a6886a0dce343fed87311107975111f62309bb","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.2+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.2","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.47c7deb19.0","@material/rtl":"15.0.0-canary.47c7deb19.0","@material/base":"15.0.0-canary.47c7deb19.0","@material/theme":"15.0.0-canary.47c7deb19.0","@material/ripple":"15.0.0-canary.47c7deb19.0","@material/tokens":"15.0.0-canary.47c7deb19.0","@material/animation":"15.0.0-canary.47c7deb19.0","@material/elevation":"15.0.0-canary.47c7deb19.0","@material/typography":"15.0.0-canary.47c7deb19.0","@material/feature-targeting":"15.0.0-canary.47c7deb19.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.47c7deb19.0_1675415391184_0.9653819985945964","host":"s3://npm-registry-packages"}},"15.0.0-canary.a16dbd1a6.0":{"name":"@material/slider","version":"15.0.0-canary.a16dbd1a6.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.a16dbd1a6.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"b1b3684d42f18d2af0129e32b48c9bb6fd14a2b8","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.a16dbd1a6.0.tgz","fileCount":37,"integrity":"sha512-Y9+qQOfRmLLX+U++jawmCvMRgSUD1akYH6unUpmQx1mJitvRlQmYgv/B+5lFOZkQ563iGIHuJotc3JmqRsg/lw==","signatures":[{"sig":"MEUCIFrZrO7kS3fm+Dvv0iQJ8nceyw6o8XlNmoqD3U2DCrXLAiEAs10bH46ap0zo7YxcX+FVbw6p213z4mYDRVcDuJEcQ9o=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1224763,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj3ff+ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqC4xAApIBBDOQWiqw6Su0dpLPAlB4uGRGix7inndRnrA5tYvHYZpkV\r\nFH44JCP/ABQ5NaMNX5szSnd6J10Q34oy8Dkq3011SRRcF+ykmQVYAj4BL8/v\r\njHXZAnwPlMM+fVDMJn6wEfvGkTAdEjjKy+a0XXxtz2YTumn/LP6jHJ16CpXe\r\nQglOVMvhIoMjAR6cQgXPdz16k+hv7/v71fq0Z2VLD5VOKMRPxUOvu3GUSx/G\r\nZr1d2DEPcTfGbe8gzdjHvgJ22zOeUdCv1xLxhIBTbNql1VLiTWu0eI2c/jIS\r\n+q5HRkvR7v7bzVtpoQTf9L8VAW7fFrJVHzwXEMXp8f/u32eod+kn+XMFdkpj\r\nDP5IBUF9tmXoF6qAxQzTzUE9e8JAk/JBfVfqPzShxeSpkw7y50QmjSBWwJ3y\r\nDQ6m0x3bDH08Ly6MZLEZskWdMOSnXgytcamdeMMXuC9PYE1ByLUSB8bcSZx9\r\nYEovc9sRj2NP49AOd68zUdD6ujs/C5UmLFLmSMY7l+BhGbJ5feZyx1U05+EM\r\nYSVgyptn9XARf6Fv4Xjl4Wh3MSuvaTGKnhEVGojh8sIYNWh/TbFKH/Y812Wn\r\n+OFwyHTWzWS8leJx/r41OTeG86BZBWG5D5huV0qj17M+xQ72CX/6PX8vZUIq\r\nNEjCipbj6s9kIczD4qqojKu/Cn21e0p7jYk=\r\n=u21l\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\">\n    <!-- ... -->\n    <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"6b1923aa24f460ae50c61296787e46f524bcf15c","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.2+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.2","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.a16dbd1a6.0","@material/rtl":"15.0.0-canary.a16dbd1a6.0","@material/base":"15.0.0-canary.a16dbd1a6.0","@material/theme":"15.0.0-canary.a16dbd1a6.0","@material/ripple":"15.0.0-canary.a16dbd1a6.0","@material/tokens":"15.0.0-canary.a16dbd1a6.0","@material/animation":"15.0.0-canary.a16dbd1a6.0","@material/elevation":"15.0.0-canary.a16dbd1a6.0","@material/typography":"15.0.0-canary.a16dbd1a6.0","@material/feature-targeting":"15.0.0-canary.a16dbd1a6.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.a16dbd1a6.0_1675491326709_0.878223553338153","host":"s3://npm-registry-packages"}},"15.0.0-canary.93416f87a.0":{"name":"@material/slider","version":"15.0.0-canary.93416f87a.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.93416f87a.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"56f3a5b09a5216c2ed84c99b8a51e12afaa7385c","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.93416f87a.0.tgz","fileCount":37,"integrity":"sha512-48UEVIUx5Uo87PghkudMQZZ/fJfsyrCznyfMXaMewF8ewJufm4Dj+Gnww2lqsJ1C7pzqk/MBTJmkcj+A4/60ug==","signatures":[{"sig":"MEYCIQDjeXIV2+5A78plwK4z3uD4jFM3nN3CSCf3Uy9GbSZZYAIhAOqq12JoFjc2JcJ8I0bDnysL6WmhbttWZd0DhaZz1+Aj","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1224763,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj4lEyACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrATQ/+PU6UvBPzKnv6SIklZehpUsflGlu4tuKP+OaNqAdqK8pUc21s\r\nFr4ojRCsEvSrc7N0EPZREOBW3sF6J/T++p/C+j4BvHDLvYvEiTDtd0ChoeDv\r\n4OTcmsB4EgCnVCjZtWciGnSzNsH6mroCiLHbdYZ2IkjQM8IlyAEkKo+X1N0V\r\nbK8UAsf54Ty930Tgfm6/94pYdA5qVf147UYyH8fVHIeYA1orYlIm9pTXVlIv\r\n/WCcBBTtQtQkPPhsOMLMeVYGkPIrGcsqc3l26AKzoboT+6rmj+WzXaRiQlfi\r\nW6RP28+k5sUIqci+CuC4EvzbdfXkAYx8vcRhdR/1Z6yi40WxSkScq89ipQcR\r\n69ORqbLu+UGL3znj2KEFOR6yfIZNthL6qphc3u0HD0aDwJTXN91fH16qU12X\r\nxQYbnd4xuyC2RV4wuwgAYoSjLPnJaE+i8N1RVV4RJVCrZhXypIjY4GwjztRM\r\nm0i+9D3d+WXwCcPO/1vjau+Nw8DHhhSj+QvcO9tTffD3bTAbZUxGOLd4zxzb\r\nJObLH/h2tKe5vl7zTIPgTtxPG9YnYEvjsu67mmCrd3gREPIw89D7+s0HTwWU\r\nBslVCR0D8wCvUhQpiCUZIyV8UGcAUug61Ge1OWf1oBd4AdLMlq91FRtVBX1j\r\nUryXIJL4Ln2avIpoVwnM+7ZCQgkmQIclSl0=\r\n=lR1T\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\">\n    <!-- ... -->\n    <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"b9f82375a462288f01ce4e4efe6047a3fdd9f9a9","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.2+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.2","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.93416f87a.0","@material/rtl":"15.0.0-canary.93416f87a.0","@material/base":"15.0.0-canary.93416f87a.0","@material/theme":"15.0.0-canary.93416f87a.0","@material/ripple":"15.0.0-canary.93416f87a.0","@material/tokens":"15.0.0-canary.93416f87a.0","@material/animation":"15.0.0-canary.93416f87a.0","@material/elevation":"15.0.0-canary.93416f87a.0","@material/typography":"15.0.0-canary.93416f87a.0","@material/feature-targeting":"15.0.0-canary.93416f87a.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.93416f87a.0_1675776306628_0.5577166487117842","host":"s3://npm-registry-packages"}},"15.0.0-canary.49b8e7442.0":{"name":"@material/slider","version":"15.0.0-canary.49b8e7442.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.49b8e7442.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"4e210a44aee600ba0afd7424194aa1b85c729d1c","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.49b8e7442.0.tgz","fileCount":37,"integrity":"sha512-b4WlfO2CYZTzapysnJhePZgES1DFudF9fPX6ffLsFbItfPB8JKwbUQlsGSygy5ub6ZVZD1wC8vvcO/IS+/h0cQ==","signatures":[{"sig":"MEUCIB1jqfINHRcqV8Wn2lXVdRtJsyhxQC31DgOPhG3KXHFMAiEAileIKbgQRLG7wYdFs9C2b3ujXtSapYCCr8kSVuf2Z2g=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1224763,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj4tpnACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq+4BAAnhL80BiSnR+u4TX9LDHMkmPELADumg+aEDXluS9DMNj/TYQG\r\nzhl1mF9VK1AZ8VAx5rQlmEpil9S9VtqT4hRcz20IMmCtyx5kO/Qi5yv//ywk\r\nniPDDWUKuxk8BW1qaddnd3iCzQHeIiZvxK3n5hivfTBt7nB2/XdDlroqebh4\r\nUyCMYzrCnoOTIg1Clr6EBOknD7961i3jjjkGEfv1kpVli4R7JGOgPquJdRjo\r\nmXyAv+dAXdj6nap6VEooSEONc3x8QYvXeaP0r3531uZs++xmQmxa7rCm7byU\r\n8581qiZ2tyioaFu2ybWoexEI3K52nBj/PdwZi7GdMZHFzZtRP/KrZWuaLDf2\r\nCQwgoVsgXypIjZW4qSdyqFdE1fi9N8b08QZFTEIIxOlw8hnGEw4H//cI6F6c\r\nHNxNwzGK/qVAgcZHbBSxOKZRNMq6n2gvHhZtduQqQPOvL1uXp/R9/FAIS0cF\r\nsV92AinyoV+/RUFZKUaoECCweQAR2JZ+e9CJV5/2Iea7p4Q0ZIZZv7lGrPJV\r\n4PBIVYqmEZl2zEQoZeW1En+zjwBasd/GMozfhJZ5JcG9S6exgoRNKjDcY9i3\r\nMXnRxXqtGgBCuUO9tw50cI3yikKkLdsMAAlPZrVGBtYfgWYi84sAAx9A2L8S\r\ni/9uWawGYLyDOG5odAExaVcbMNvMsxFJmSI=\r\n=xJrd\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\">\n    <!-- ... -->\n    <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"0ab5eaa3ea130a4b79ba5511e4e46e1f99b9e662","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.2+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.2","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.49b8e7442.0","@material/rtl":"15.0.0-canary.49b8e7442.0","@material/base":"15.0.0-canary.49b8e7442.0","@material/theme":"15.0.0-canary.49b8e7442.0","@material/ripple":"15.0.0-canary.49b8e7442.0","@material/tokens":"15.0.0-canary.49b8e7442.0","@material/animation":"15.0.0-canary.49b8e7442.0","@material/elevation":"15.0.0-canary.49b8e7442.0","@material/typography":"15.0.0-canary.49b8e7442.0","@material/feature-targeting":"15.0.0-canary.49b8e7442.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.49b8e7442.0_1675811431397_0.9477536690372907","host":"s3://npm-registry-packages"}},"15.0.0-canary.de38de758.0":{"name":"@material/slider","version":"15.0.0-canary.de38de758.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.de38de758.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"8c46551a4578b59694baeb29e90f37b51c13eba4","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.de38de758.0.tgz","fileCount":37,"integrity":"sha512-3LuOSQ99zeANZLVvcGjmg2BQWeapqbdz04yi8NiqTU0MAyIK+gCeUagDu4LyTZn0WpkGenNStR0+M9fBkNsBgQ==","signatures":[{"sig":"MEUCIDcDY61u0qL97xaBIO+ZYomxTtupzbqLKLQnvYBgytTPAiEA09p3zIbDaU+5EGdDK2aIVLR5FPxPgu/kQwwqATs4+RQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1224763,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj5RSZACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmopNRAAgNz/wVFLCFyM0bVi2sUeaaVl7jMDhdjy4vAImyhL9zNaNpDo\r\noRTlYQIoMIgMRUBo7rSvcWK1cbOPBtVFdppIA8sVd69h5nAaapOAfaBWk+KV\r\nYaxMZPOMGYU34LPMAuPAM6fBGS5VZJG4Pp5SBBFFn+90Bvw6cw/Jjxz085j+\r\nuWUVMcbSeiClAgsUcr+PdBOEFRoa7M2Kzv0o2yhcjiMgV18843DHSyHcB3xE\r\n05yam3Q1Af1Mx2a92dPYcce0e4nBu+yJ9b6Jj1OC6tf6KLAum/obVo+T5y8n\r\npjQKhFSPwCjsi2uh3lWmy+o57A3j/3eIYRW7ftTWYOLXuMsqsb0mPSjjZiaG\r\nJIbX4WTHWvFjS4UalrIbYCLmZ1HzynFMLSd8xK5pacz+cokM6Cny9Nzp8x+y\r\nlTZsf8IbNYOhecsiafGmcSaOCjz9B2dNS87gWKD8AMXVf3cOKposcyJCb1wR\r\nExJt3LVaVC81wr/vtM2l4LvO8YChzFgQK4JzziQCzX9osFcUsBOUCMnEzPCY\r\n88LEWhjQG9ktOJS+qHCwhw7dio/lfA5cdJ6ZilxLvBZjdo1cRQhx/cNzwT7r\r\nnIeCH5wF828/58SUHMcK4yAKzusEbx7JwOtRpupPjiMi2dF4pkGyR7RJo2JR\r\nFTGM+5dYn9aXZ0lcF+0UOhUyysI15eovsb4=\r\n=/tsa\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\">\n    <!-- ... -->\n    <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"72df173af8eee38e00bf9af0ca5a77d5b780763e","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.2+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.2","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.de38de758.0","@material/rtl":"15.0.0-canary.de38de758.0","@material/base":"15.0.0-canary.de38de758.0","@material/theme":"15.0.0-canary.de38de758.0","@material/ripple":"15.0.0-canary.de38de758.0","@material/tokens":"15.0.0-canary.de38de758.0","@material/animation":"15.0.0-canary.de38de758.0","@material/elevation":"15.0.0-canary.de38de758.0","@material/typography":"15.0.0-canary.de38de758.0","@material/feature-targeting":"15.0.0-canary.de38de758.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.de38de758.0_1675957401424_0.36673019752236113","host":"s3://npm-registry-packages"}},"15.0.0-canary.4d62de70c.0":{"name":"@material/slider","version":"15.0.0-canary.4d62de70c.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.4d62de70c.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"1afeb712d565f5165faa6049df16765950ad0555","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.4d62de70c.0.tgz","fileCount":37,"integrity":"sha512-ZJnG92vxlgzfBGbshFx6h60/GFYDOIP/Wy5jpDKbh/+jcUNJYniwLRXXUhzv2T3YvwzV+wD9P+rlct1XAZaq3A==","signatures":[{"sig":"MEUCICo30ifXS9tyZ+Mu69nkhWR6vK+L5EfJit3MfI/7eZoeAiEAlD5LIm0YSJhsFqQJFRhrEkhhUCv8bLvSwPQ7ko1hdX0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1224763,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj5W3QACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmokqA//TTTVwn0mH/QhhDjFyqauHerRleFwHWtYnoz7+sXh7jTWPiL+\r\nH5Z1ObUvsuaYuGAufNfbyYflWbUSGIO3o8JGtE/PlICvibqdlPhZbWXtkrKc\r\nou/OPFQp8MH80lHFRDKzIIsuLnyIDXlmck85iqTOX6OMGNacxfQ6lQOm4pJN\r\nwyPUQtGP9mO06AbrcOF9hD83IusKDiBr8fE7Vgw5EMcSNERP8MDnH8JYZxqx\r\nRdilvkicZB3lPqsjOP1hYvGVyXa+Md0SLNDHutE4vea/PbQIH6Lyi/Qdx472\r\nnqTaS+Fy5ofRKUDxaPeZl0ufzrvZrzXyujbrn0GyXEl/+K0cXePqu5Ltcdlj\r\novN06eoRiv2LqoL05X/ppnb5/pbMLw9lxNpEYWXsPcTF5DjTcm2L/+bTNr2+\r\ngAWODuTy8EI554hZEtdJFPruiq1jbx91bT7N51iBEQfsAy88grShGzhlBCaY\r\nah9ZzlGasH71T5UyfXtCOInG1BO89Oac6ay8k9jOQ0CRZF9oGrURfP1kg7P4\r\nk+JFNIzaRHaeqsA/wDqDks1OIHWdc6zPvsoH0dyNoimuXSJM/PmVAA3OmTBp\r\nYmuAC4whSYARmY5bgscVjGKZG2Cu+1QLXA16tSJCQlOKwkVJlO+VouciYdWP\r\nPmAiHF7GzvB7SE1WTEerdXLlOJUVqKY5dlo=\r\n=7UVH\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\">\n    <!-- ... -->\n    <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"d2081b5045fc9871ff56b0d31ddacd235e2316d5","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.2+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.2","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.4d62de70c.0","@material/rtl":"15.0.0-canary.4d62de70c.0","@material/base":"15.0.0-canary.4d62de70c.0","@material/theme":"15.0.0-canary.4d62de70c.0","@material/ripple":"15.0.0-canary.4d62de70c.0","@material/tokens":"15.0.0-canary.4d62de70c.0","@material/animation":"15.0.0-canary.4d62de70c.0","@material/elevation":"15.0.0-canary.4d62de70c.0","@material/typography":"15.0.0-canary.4d62de70c.0","@material/feature-targeting":"15.0.0-canary.4d62de70c.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.4d62de70c.0_1675980239788_0.8286506010400594","host":"s3://npm-registry-packages"}},"15.0.0-canary.6fcd8d418.0":{"name":"@material/slider","version":"15.0.0-canary.6fcd8d418.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.6fcd8d418.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"553a2cf9a3a502b159657bc30d9601bf7d9fe47e","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.6fcd8d418.0.tgz","fileCount":37,"integrity":"sha512-Ll4v8Dd3fo2fwVZDFUdENU7LPibwYbOoEqIpXTScJzim0pyy9MqPCjl6JoPRp9P8NiHmnJthRVrg6gaJl/KMWw==","signatures":[{"sig":"MEQCIE2r5t0dm3YabjBZEa+D6nmy37/HdMXJ1mQ8A1XCEhPsAiAoE3XEPLsaF20+JvpXSf4PD0s1ASjiVSclaDmtMtPJmQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1224763,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj6iQVACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmpk5g/8DXgqNH9kjAlD9NwXrYMdfpEeKpsK4V+WRWXws+GwjZpE6+Ft\r\ncsUZxGNla38cNMeI/Dqs8WVr3HUKNTUER5wCcMqa/Z/Q8XDq4a7Fdg2bbxlw\r\ndMCBiaQbdpciHS9MQVrhx0X4X47PhQ8tPD6GlzW6ijkeYu9ncebFNpkGtqly\r\n7CcDeMK8H1OIPyqdBlb9Ib0i1903ec5jAh8bF6V7fXNuIaP7YwkLL38IHVYV\r\nlkcg0sAhhr0cxUxZn5qaqFac3xii5PWT18i312dAUuFh3EY/qlXH2KHYqdpa\r\neM90/3445hBcz3JaJkxnWUbXvr+AEKVUM+hkv6A/hgkNyFWEwG7cGGcEYF5v\r\nHUWBXWxWcy9p5Zu2xmqVD7mZuAHMv0zrqA4Q0AxCre9IkCZ6lIssVj71lmUC\r\nT1ZtLNFwe2idH1txLLfnllu8HSQGYX9Ko2EpQTcsseb3F7xXIBNND7OlhA/G\r\ncTaner6kpl/ANF2SDsvnt8BX55cLaGmkpnBx/33skIDcCgXxToSc5ewVv0ZX\r\n3bBBcVh//av29SHL9mtIRA9CTrEfpIe4yXG3A3XuvdL1jZ57ZoIuBaHvDrNA\r\nl1f9ovVdVW62ctxzqQnpmpYFTEsAUm/q3lF2w9PevJtqKlyzSTYuO8YqyzJq\r\nQ2JWdBQtj0sxVYKBaWQ8Vtm6IViZhwxAZgs=\r\n=fTg2\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\">\n    <!-- ... -->\n    <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"39b4fd2a38e7ab9611f614a59dd1694de0b94cb9","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.2+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.2","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.6fcd8d418.0","@material/rtl":"15.0.0-canary.6fcd8d418.0","@material/base":"15.0.0-canary.6fcd8d418.0","@material/theme":"15.0.0-canary.6fcd8d418.0","@material/ripple":"15.0.0-canary.6fcd8d418.0","@material/tokens":"15.0.0-canary.6fcd8d418.0","@material/animation":"15.0.0-canary.6fcd8d418.0","@material/elevation":"15.0.0-canary.6fcd8d418.0","@material/typography":"15.0.0-canary.6fcd8d418.0","@material/feature-targeting":"15.0.0-canary.6fcd8d418.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.6fcd8d418.0_1676289045498_0.9107247714364961","host":"s3://npm-registry-packages"}},"15.0.0-canary.066d9439b.0":{"name":"@material/slider","version":"15.0.0-canary.066d9439b.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.066d9439b.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"9b5c5d76d0fa1348b6b7084037335bcfa6cd1662","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.066d9439b.0.tgz","fileCount":37,"integrity":"sha512-/jULsee/iJdrdZN77ZG+N1JFIGtJrvKq97nkyLJT/2DmvWi1riEOiIlMl/TIxHeoWJkodCdqfhG6NdTX2NzP2Q==","signatures":[{"sig":"MEQCICz4rnE5p33B8IDS7Vs8mPRiB3p/PPADpnIYeCvQm2n4AiAIhBU1Y/aXSVKhN4PBzoftcAulM6/UwoKm1PQPkPHqdA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1224763,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj7TlzACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqVpQ//XeJoqf85NA1vVOPAdFUzXMQeN6eTlceNhou/KokAuMawLtkL\r\nXWLW+uIIDwA8r0HPelFUci4EccmF6W09v7U/PpCTtXbMTQwG85fzVS/s8V4s\r\n/GHrLTAJOBv/AHHNjFVk5vtpDzZMzoo4gDZZ9/bXg7i3VxfRtZ47b+lM29Oz\r\nzbn6yNYPgnoZLyevQ2a2zNu3ocfMNRb0PtaJCQxIFiRb4WcwFZTebFy5g/dh\r\nzvg6McS6hTmyxKLTnRv+o0tCYn0aYx36fWttdCilNC9igNTjsP31z4HGTBjk\r\n1oFGPk8hc/9oDgN3naEVXbzifRJUF1BazZDXJOVnu7ipAF8RqIIuu8nviiMm\r\nJE8wErGJGXZuTgqg1OcOvbWmO97oYnbRFtKasSFykd0u9c7fEEOT+OF+Vvbr\r\nriP/tJ73MN4b4TgEHJL5gSq2SYvyynY5/hVQfMFq2LGyW7yqgCkTrVsDt8Wb\r\n5c2WOz+ed4+frh5q2+Z5JHyJ5IBvmP6nt643ux+635n9/Hxe1yeI5jryzP/m\r\n82eGN6gupsIoOC9pe7VBiHCG953GL0iq3t5D7HL7aC8g0exZBUw5ZOuQ2O61\r\nDBHFzBCyAvhOHq2Xytxj68qEWJWcV5yceVuKQvQ1XXlIlowTq250vDFEVdN3\r\nBzzlbowKD9mwcYxMAFpNhJ0BMrEVR+j+0cU=\r\n=lezR\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\">\n    <!-- ... -->\n    <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"cfeee3e63b3e6330deff033d8054adb710498810","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.2+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.2","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.066d9439b.0","@material/rtl":"15.0.0-canary.066d9439b.0","@material/base":"15.0.0-canary.066d9439b.0","@material/theme":"15.0.0-canary.066d9439b.0","@material/ripple":"15.0.0-canary.066d9439b.0","@material/tokens":"15.0.0-canary.066d9439b.0","@material/animation":"15.0.0-canary.066d9439b.0","@material/elevation":"15.0.0-canary.066d9439b.0","@material/typography":"15.0.0-canary.066d9439b.0","@material/feature-targeting":"15.0.0-canary.066d9439b.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.066d9439b.0_1676491123044_0.5941700156792562","host":"s3://npm-registry-packages"}},"15.0.0-canary.7ab32468c.0":{"name":"@material/slider","version":"15.0.0-canary.7ab32468c.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.7ab32468c.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"b154fd01a5e6d00658a31e2ad9ea06701488fc2e","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.7ab32468c.0.tgz","fileCount":37,"integrity":"sha512-TGsl47rQhPuG2hqvkJNMysTQX7o1pcsZ60GRwSDIQytzbpkmdMUumWPSTKN8SPyve5k5PSVuFKk2o+xJqXRPFg==","signatures":[{"sig":"MEUCIH/thCDKyhTGvmgegXUZH6OOK7HMCShLhej8QG/ghkLgAiEAiJYkLBeJKg0HZwZfxkmh05k2kJOPGpwUD+nFi7vXBGw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1224763,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj9Q7YACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqFZA/+M0pspqE39+rp4Ints6ruXHGANGQiHVx0DTCO+xD0EgcXeu+3\r\nNkSdH31cwsHPHaKigNjb48Ozll3Pj5q8uWPNbvp0JKrWPZf7M1dQc3Pgqcto\r\nf1GcCLS2i2dQS/epLNm5j+TG2k1h8ZSPQi1eGrdRQ/iqH2/TZfNQ30CmQyt6\r\nD8gP7B4UNoaqF26DScGR3ivXjjcNlPF1r9pEtE4GKiufRK68NPLP5vz/zkvL\r\nPgw651V0aMbN91aJBdybowPmBaQTSnFqBfCc2zQtfidcMbxjV2+PosQpeALQ\r\nf3SQpOi5olP/CqKv1EX2O09gE30JcDokkc7ZyMh/SAl0cBuKbu+AdZ5pQam2\r\ncutiwIJ0u8GlIV4nmb60ENf/nnqgEnfur8pulOMNnst6PZwZI56TW/hLXi9M\r\nTmZPon82E2s4kOp+kyEGoW9f7jpRTt+VE6LW6VkyYoi7dsLI0cBFElpeH1B+\r\njSz3jswugje3i+o+Io53ShyGaJ2ISglHEgh+/i6DxL1Ga4O34uTTL7Q22/GT\r\nCj5t23uH3to/kkhousoMyrqZKhsBgooQ3xE4UTJ66YOCYGdeTU15LJFiNDgs\r\nwuh0kEVwPPkfYMYVHV0dt4GwbwXYUxajRVVIuL1VzNdHTuCwZnUw+evHa8Oh\r\nFUVOIdnTPlkHEVY54ZEwhs1eT4op0SLZNqQ=\r\n=Y8Yz\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\">\n    <!-- ... -->\n    <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"08b12f363223d69b2eae5d2719e9ff0da773381a","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.2+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.2","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.7ab32468c.0","@material/rtl":"15.0.0-canary.7ab32468c.0","@material/base":"15.0.0-canary.7ab32468c.0","@material/theme":"15.0.0-canary.7ab32468c.0","@material/ripple":"15.0.0-canary.7ab32468c.0","@material/tokens":"15.0.0-canary.7ab32468c.0","@material/animation":"15.0.0-canary.7ab32468c.0","@material/elevation":"15.0.0-canary.7ab32468c.0","@material/typography":"15.0.0-canary.7ab32468c.0","@material/feature-targeting":"15.0.0-canary.7ab32468c.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.7ab32468c.0_1677004504216_0.10202779109495097","host":"s3://npm-registry-packages"}},"15.0.0-canary.fa27ba61d.0":{"name":"@material/slider","version":"15.0.0-canary.fa27ba61d.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.fa27ba61d.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"de8b43c3f2ed260eb586b888d8316ac004e4a624","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.fa27ba61d.0.tgz","fileCount":37,"integrity":"sha512-w8h3Rl0eapVsfb5ivUSBamqmpRk2OLsGQehdtq/c2Xu43PWbkb1ZoFQtPrdCthPa2V/wZckY+uMVFYp+xZ1cHA==","signatures":[{"sig":"MEUCIQCSwQdkuj6fAe8N/F1vSwhqZUppl+2lqIilBBFhKDc/DwIgPk/F6v37l7h6n2BblgYRSTTgmYiNtX03MM334FunjmY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1224763,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj/NhiACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmqm8g//QWQ92/EsIlLfOotO8d0XHWjuysEojAprW4uxaTQ0YyBNgnqI\r\nUer1eYo6EtF4pT2aC/IOgfqhap9vwnc8XCacOJASVtBp5sd6QIL+m/ofAXdF\r\nq9f8LRs/VkoLATek8muikzLKbQsLOjV/3Mg/NxT9963M4esuM/BeJziL6O3Z\r\nLGP3ko13W1ambYucdXniTZ7qsgN+aU8sPi6CG0r1l/2XhYyUJYScnKmtpwqB\r\nxsaQBJlIjsjNJbkyLl8BIv4MvY9h6Pqr47WC1EZ9e2RQqmtzbUJ0AkyQg/iM\r\n0mRCZ/7XQrgCfxKYHdF2BCxF5NJajz2PIoMnzuvQ6AQqqiJbLzGrOjhL2RWZ\r\n7IbJjQ7fkXmqj7dYVkoyjTIMFYsNwIB2jATBe0rS3UN8bIrFIBNfhkq61NP9\r\n4PtourF4c6eiSTYc5THoVxcP3b85nGxYO90yqC1S9CLiX+sbI37lMhl0Lxpr\r\nnBOp2KuDxUMvuWlY6bPKPHROoVH8rsOAlp12KAFft/08LM1Wegw1XuSNpbic\r\nLkX6QOFAIXXXTBdlNSaWCjSJ6DY1e9jkZ9og+WheT3nNvNGPcsyiqSpjTZvP\r\nb24oFyGMIBbhtw3y6KYiyaUHz29ZUt0dl1Vtpy7Iqyh3b+CXBdSPlc9lpGsU\r\nWqqeP/7UIezoxkLYZP1Kgiq6kcPdwQakqUE=\r\n=Pv/3\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\">\n    <!-- ... -->\n    <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"ed40c112543fe3ecfc009ace11a6f0c3f82fa26a","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.fa27ba61d.0","@material/rtl":"15.0.0-canary.fa27ba61d.0","@material/base":"15.0.0-canary.fa27ba61d.0","@material/theme":"15.0.0-canary.fa27ba61d.0","@material/ripple":"15.0.0-canary.fa27ba61d.0","@material/tokens":"15.0.0-canary.fa27ba61d.0","@material/animation":"15.0.0-canary.fa27ba61d.0","@material/elevation":"15.0.0-canary.fa27ba61d.0","@material/typography":"15.0.0-canary.fa27ba61d.0","@material/feature-targeting":"15.0.0-canary.fa27ba61d.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.fa27ba61d.0_1677514849882_0.3419747157916302","host":"s3://npm-registry-packages"}},"15.0.0-canary.311ab4d4a.0":{"name":"@material/slider","version":"15.0.0-canary.311ab4d4a.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.311ab4d4a.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"c90d75407503fcadced5605f6fd5e3d931a56815","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.311ab4d4a.0.tgz","fileCount":37,"integrity":"sha512-G6YFiClqT8O/0m6mA/Dr6Qg6wuRWywJo6M6BbKjdOC9xillwhfi6Jr/+iwAOvoXUgHPSUYSEOSmHUL70xfhHhQ==","signatures":[{"sig":"MEUCIDtU/8nZCPAge5EcR+nwKnKYm/Cv2iDK0xk606IF2bcBAiEArOW1k6VCCb7lBANmVyOgpz55vNDeidrb7J3MBpndJtE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1224763,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj/N1xACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqulQ/7BuPnyM95t/iGGCCJ2ii1J14YrLQJqjp2g2zhP60egFiVi4Uq\r\nKjgsHsGcqGrZf8BRMWi5fMD8D3GSbHEl4O2CDQiuwG5l1ToBF0/RbstBjaxm\r\n5Kd5bDkeTPM8/uGSvOVa1tSDkR8WUjdA/cpYCWrcyXOpoo0wYO7j4UgDV3rF\r\nT5ibBviaaLqeB1S2PIoc4neL7dvNx01vukGOY9qFRLsNu3Fz9Ny9vAahei7M\r\njBqpEigsdhglnuojBVvD05xacloWt0Ulv/HfkIXk4pHd5Yn32vWWMmH2EX/F\r\negd2eMeuIQcfXH1VTUEijAWd0hugQIHqSpSpvbaUJ/KmonYK9+3vToI3HLps\r\nNXd1i6+VKjm5AT/fVk+Nxs2Dxb5U5DamrUkb5RyPq7TsI5RjCdm+isAqVNjn\r\n0bxQj7p2uffJ8kVXl4Aq9bht6lAqLCAQULx/gmS+olFhTH+7+oNmA1ne98lV\r\n/QvR9GeFZ765yPZWtd7UeyL98Po6Dfeahrr0f6r1Xli55zvEoxBIyaOAui5x\r\n53EhngbIoYxXforc3ph4WBedM96VdicpwIRWmhk5ooIFgYIqzneavNduqN9P\r\nVBhnNtgXeTN+JYJglBJehbvdWJXwlnqTYTpI2wukFifTbRH8qkBv/AV0J9rW\r\n3uu5EC5ZVXkZE8i07JqqRcLvDUBY3xsHbrI=\r\n=QWYh\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\">\n    <!-- ... -->\n    <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"07f8d2f7bb4b2f30e60a6bd8739befd9d17bfbfc","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.311ab4d4a.0","@material/rtl":"15.0.0-canary.311ab4d4a.0","@material/base":"15.0.0-canary.311ab4d4a.0","@material/theme":"15.0.0-canary.311ab4d4a.0","@material/ripple":"15.0.0-canary.311ab4d4a.0","@material/tokens":"15.0.0-canary.311ab4d4a.0","@material/animation":"15.0.0-canary.311ab4d4a.0","@material/elevation":"15.0.0-canary.311ab4d4a.0","@material/typography":"15.0.0-canary.311ab4d4a.0","@material/feature-targeting":"15.0.0-canary.311ab4d4a.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.311ab4d4a.0_1677516145036_0.9609636590610444","host":"s3://npm-registry-packages"}},"15.0.0-canary.5cb8e2174.0":{"name":"@material/slider","version":"15.0.0-canary.5cb8e2174.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.5cb8e2174.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"8f9fc93af32b6e0ea543200bae38376f9d0a3b0a","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.5cb8e2174.0.tgz","fileCount":37,"integrity":"sha512-K3IvzIWbjdRhIHUBlU0fi6RXGJP8DLv+CSSmcJrZdvkJuq6102kMIOzOcBbjswhSvB+WnIF1zTiWdtQ+2GveGw==","signatures":[{"sig":"MEUCIEtxRjFHGoBkm5YtPiWEMXzWoH3ZidZxUnaMg0focVrTAiEAgzofSIX3atyfb8vO7FGTaQNFcxVyfCQuiYAKHHkEBrA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1224763,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj/38dACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoKLg/9GGejT2+nTUvhKsUamy6pltJk2YhRD3jwANxh2MRqah5V3/+M\r\nHo4qeoxOSSj6nXfB9OhO0qlmTD9jQ0NNBkbovQhszKVxAsGbpGBmTT3cDkfW\r\np4Xdnfm85X28b9GtHwMXeH/W5XcRRVVPYEbRu9jEqW2mMSLV8BH5NyWlj6MD\r\nzaVZNpbrsR9iaKAoikUHrQnzyQXw/V0te7c+/BzaIn9N/1ACp78rb6iSQxZI\r\ntn0DtfH9jCEtqJO6wiKucKl1enZHLJuE+su157Xwnab3IlM+so4HstIQ7ofG\r\nlXBf02tAtfCYAfJelUgveVjw2+Nb1HCVdeh/Ud13VFDq3n0oG2TzZmYn5Hb5\r\nhXxs4QlHKOSvC2u8Jwlf1GnoeSy4lUvxUnXnACeSmS+13FWB8YblZlsXP1qC\r\nvN6OFh7Gw84SreizVoiws+csCbI+2+Ukr6EfKhmTVRrt6S1AnIQTLFjrqQn1\r\n0YAhfXQkO7gFJFQckrn6AW3dg4CC0DBsNTTb6+Lij4xPq3/kw2rTSRvotpeb\r\neAGFWmxJW3S7E50esPvTXABfV2mDTeWXpYHElWBUDHvKd7nEOdxPCUxw29WL\r\nbHPMH1laLoWeCmdoQrjtOgUf5DNmW54LNd5UFmY93viriB1ttET3vuDNvhRQ\r\ny93YVKxGZsyvoirFHrgaUYigPCM/jh5BCMk=\r\n=Gx8s\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\">\n    <!-- ... -->\n    <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"d57edaa5a3a3079c48ef7c804f0a642bbb682478","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.5cb8e2174.0","@material/rtl":"15.0.0-canary.5cb8e2174.0","@material/base":"15.0.0-canary.5cb8e2174.0","@material/theme":"15.0.0-canary.5cb8e2174.0","@material/ripple":"15.0.0-canary.5cb8e2174.0","@material/tokens":"15.0.0-canary.5cb8e2174.0","@material/animation":"15.0.0-canary.5cb8e2174.0","@material/elevation":"15.0.0-canary.5cb8e2174.0","@material/typography":"15.0.0-canary.5cb8e2174.0","@material/feature-targeting":"15.0.0-canary.5cb8e2174.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.5cb8e2174.0_1677688605398_0.5491788361158592","host":"s3://npm-registry-packages"}},"15.0.0-canary.f32339937.0":{"name":"@material/slider","version":"15.0.0-canary.f32339937.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.f32339937.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"7a759854e77c38734883cab091cdd73cd22a8c7a","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.f32339937.0.tgz","fileCount":37,"integrity":"sha512-Rs34yztpM0e7CAcIiCkb5IYc+B6BXJrW6V4rfuXTJ/Wmqha63ZYRCkVUXoploUOBOPC50u1aze6OK/IutYW+Jw==","signatures":[{"sig":"MEQCIDSOIR2BEzdlDlsmTC0TTRC1nV94Hu2WolBlPS5DMuE/AiBDChyOC8fwEd9U0cNV9i46PyN/gpvltcAqgMi6wA1jjw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1224763,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkBgPRACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrUkhAAjGoAr1fACF4s0WNWY7MYRnVyDlqgPr+WxVKI/DEsAC24jwiL\r\nkgbU8Ho71JRQM+ZY7TOqVYDbFjbS0JwmwZ4AGKBKwH7kQs2+IbckxRitkHj0\r\n0+/n41U11cAWRXCPLNFWc0KxpYJlgFvO+QXKWu32OtBYPdMYPdPsEOIrZiTt\r\nBMEFyp3JrfgH44F19dzrzYl1+dr9EByQNeuG6xJyWZ3ZmJOUMnDljBYoktUU\r\nQbI2iTJmmPAMJ1cjU0UZvVYWpQp5ceAofLOsExC+cwBnT/4XysjFbn3Srivd\r\nw9ENa6IzP+PzmzJzz6DJhKDHJTkaJDVfWm+t9LUBXPdhGKaQJYPLjq7eOci/\r\n3jAckcguIGWu7h60FCLKgNI0/pBp4FlRGlfmE3iLJo7FUYRyecFkUSGxvRLa\r\nssvtIM6jot+X9O90HakoOnRqqkddn+6MQYmIAn5GFCvKOdP9JtH+BZNTUAXD\r\nNw5OY5RmY24r6Upp73qrep8Vxqbc4UuttetGeodHAbKpir1GH86RAUB+UB0o\r\nTcbic6Lkk805lIV/On6PwW8bm2oCAR65FP8flH7W3w9rglB0QmGo+GkZfHrd\r\nS6TyJVuzpqCxaRbgzdlUDghXwI2mLxMcbfyP0Ls/zLVeb23/egb+PXD6icmE\r\nNwNa4tytrpYirhKC0sQlfu9zFuYLFb6Qb70=\r\n=22qz\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\">\n    <!-- ... -->\n    <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"b6c5103b89138f008c28f70d93e0d3faed285061","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.f32339937.0","@material/rtl":"15.0.0-canary.f32339937.0","@material/base":"15.0.0-canary.f32339937.0","@material/theme":"15.0.0-canary.f32339937.0","@material/ripple":"15.0.0-canary.f32339937.0","@material/tokens":"15.0.0-canary.f32339937.0","@material/animation":"15.0.0-canary.f32339937.0","@material/elevation":"15.0.0-canary.f32339937.0","@material/typography":"15.0.0-canary.f32339937.0","@material/feature-targeting":"15.0.0-canary.f32339937.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.f32339937.0_1678115792904_0.4787320913393893","host":"s3://npm-registry-packages"}},"15.0.0-canary.7644d63d5.0":{"name":"@material/slider","version":"15.0.0-canary.7644d63d5.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.7644d63d5.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"4ec6ba18f99daced0f32ed9cb5d450e7b9b4de4c","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.7644d63d5.0.tgz","fileCount":37,"integrity":"sha512-WrP/p1HTniWdXGsu5MVBPujaMjRLzqfC43pgchxC6Bh3ExR2rySPUtbgAbjN9LHz7f6CB9tqJ47jdJSkOw33lQ==","signatures":[{"sig":"MEUCIQDNLre6z1Q4VudXf4tVBsuSajTHcdJwp0GdSL4eJ6Uz6gIgbNwssOmgKZRreB7to/INT73+3/rrD43WSJq8TVDhVBw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1224763,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkBmkHACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmoarw/8CCyGNEy4/mhSLg4xZwGVVqIaxDUWkkJ+tWq7LZdMKuo+4iqd\r\nTVcGsYcTr2i95eY6IiwH9+5QSzgVcQhe0oizumaU9ivul5+tp+p+i2dNhhNE\r\n5F70OIwHmb2jecH+Gkfckq/O/HA4Cs/FQQx32VOVXcHguMPtc/CvDS+1XAj1\r\nlc+ty6bmOjkvVw1J8ki38Ej1SDxTYmGj+gALWaWOCvLnCxy5E86OfIoDK0bA\r\ny8we2nzWVlW0n11D38LlL+8i1AD9HXSDE217I3xIytl7ZCTxhs1YyQrBwA6x\r\nGgD1QzCmei/JOzzNwMSr5lGtEJUsMXNeTFqrN6jJpyMALLjh0QAdd5IDdmgA\r\nIeLmJKYJNC9EnjnLc4q3NcMiXElABW3MXqz77a5y3RrQhTBSJAnE8NmVf1As\r\nD7YM8Uzd5doC8kziu8oXsM6ofcc6cX5wmhzz65U9wEg5AXBEvmuwo/wXP6WA\r\nV41Or3elGgdbC4j8uib2tGBfJKxIYqoNMgvX9PS51lj2cOUxZoyxEZNWt1fY\r\npe1+t8VQuix/ZUevaV0TA02u5i6cbrABM14ymqoNaAkjnL81UdBhRqn4z9S1\r\nl/veqdyJGmh+grpBMLLCQ1En4GjzJuBw4QhsUfKpk85y4AghTRT+OlhnFRLB\r\nTOyAa99hEFqDciq43RW+OIvZmixFfG/3HAU=\r\n=Asnm\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\">\n    <!-- ... -->\n    <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"a0332d9af18b36becfa025c452efffd11be59943","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.7644d63d5.0","@material/rtl":"15.0.0-canary.7644d63d5.0","@material/base":"15.0.0-canary.7644d63d5.0","@material/theme":"15.0.0-canary.7644d63d5.0","@material/ripple":"15.0.0-canary.7644d63d5.0","@material/tokens":"15.0.0-canary.7644d63d5.0","@material/animation":"15.0.0-canary.7644d63d5.0","@material/elevation":"15.0.0-canary.7644d63d5.0","@material/typography":"15.0.0-canary.7644d63d5.0","@material/feature-targeting":"15.0.0-canary.7644d63d5.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.7644d63d5.0_1678141702749_0.8412100699499454","host":"s3://npm-registry-packages"}},"15.0.0-canary.d96330c08.0":{"name":"@material/slider","version":"15.0.0-canary.d96330c08.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.d96330c08.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"2d752fa39b19df99c5fdcf2796d10dc4f6eace0d","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.d96330c08.0.tgz","fileCount":37,"integrity":"sha512-e/BhzVaKHpuvaH/od6UAjcSeiNqdfdhhp/1UBlihf0npjW+wq078kChqcDxYoVN6SCUemF+2JMVBOvVZ/cXd5A==","signatures":[{"sig":"MEQCICQOpXqFCUxj6R16nxdhQ/e7lC9ZchtbGbx3o9w72bMbAiArM2WNah4ohAhQqDfI7famKha68cMLcv0Q+lMlj6T+pA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1224763,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkCHS1ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr0TA//fxcNDAr7Rf3QFy3OKvifQzpE9aPDxEiaEcsWqG7h0C0uNBU+\r\nkiOiYJKlpQz1Pc2Hoy7bTWDuA1my+VNnN8xtmGW9P8pTWH1ztBcljYYMwdeG\r\nRcAgwllfFxVmmlFS59injPzpM6YhhRoG5RDy96iAegAPVqP3H0X7aNU6X3D1\r\nHorX6DkhfVcw43nntA/gi3vxLpg7bGeMgqBNXhFsA/kUt4r7DIOpHP7UkwmG\r\nKip2lKMMWq4KOFo2bl5Ve3x8xli+irH51jyvuUMFAWXgvrZfN32QviTMPO6x\r\nQikXOQtvh0+Dho2vfymkwxKza3NPGJ6g2E1/DL/B8yfrmqZ3pzTzq5DP5wU6\r\nTaFKEf7oXldaamsjrs4XRQ5vAYfRychQg6EPFr4pbKH3CNmaRo2tXCYw5O1a\r\nsWlkvwdJ2Xz3E62pjqxkLQcklbaH5mOpFUBjZBZmNdp8fW3d+hskvlVTgveA\r\n1Tix/4VNgOCfoqC+5xLL5ktr89OIIE4YlTepdtaszGi6g+iBbifezV7RcVCg\r\nw72zI+YQ8Hrg4M1g4ToTAaqlJPFY0mFqkkWX8V+PN0psKB47NiUplYNuOzVx\r\nNc8Pn27oi41k3iMXNbUk/XgrwAc+0asIIYqlVQdvisgUXbQZqj+iTsw1l8AM\r\nazpPwKLL34HSxv3mTIwVZ2OkkxDdgc4EOZc=\r\n=YdLL\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\">\n    <!-- ... -->\n    <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"6a6d53aa84a0c0a10bb15c3cfb596881140bddb2","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.d96330c08.0","@material/rtl":"15.0.0-canary.d96330c08.0","@material/base":"15.0.0-canary.d96330c08.0","@material/theme":"15.0.0-canary.d96330c08.0","@material/ripple":"15.0.0-canary.d96330c08.0","@material/tokens":"15.0.0-canary.d96330c08.0","@material/animation":"15.0.0-canary.d96330c08.0","@material/elevation":"15.0.0-canary.d96330c08.0","@material/typography":"15.0.0-canary.d96330c08.0","@material/feature-targeting":"15.0.0-canary.d96330c08.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.d96330c08.0_1678275765323_0.18560154905338666","host":"s3://npm-registry-packages"}},"15.0.0-canary.c99cae77c.0":{"name":"@material/slider","version":"15.0.0-canary.c99cae77c.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.c99cae77c.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"b2e13eed6af0bd913e1be5dfed8b92851c945496","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.c99cae77c.0.tgz","fileCount":37,"integrity":"sha512-FGpoZ6hbbQ2oDlokkzdawOUVy94Wu1XG9LqbVP0WihIjKLBy83XmMXciMG4XSQy840dG6HzgWcYYkN5vv90NPA==","signatures":[{"sig":"MEYCIQDe+yLVB+fgOkd+vmII6XwshZQADSH2DPErO5n08nXC2wIhAJd938KK2ww0+zzHpJlpig5SZuik+WzkmwRojjns/hRk","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1224763,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkCR21ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmpapg//f/uklMzLoDbmcNzKg4BYL/ZT/rR35/hNurKtJpkvbjENv150\r\njXWlPXdt6fS9LeZfdQ8/33bB9zq4F7o+SfwcwBu9Ypx5Mis1TmMQizVEYBAj\r\nPbsReCaybyeZj8+ftO+Z7tnPcJ9GzDGW9+OZk4X3hyG1PUnYDetAeht/2fKR\r\nMoyGvwG5SYtLyPlCRBWFRv42T1PBShCv7VmuzMnBw8DDU83Xqsa9N346WtMb\r\nFkdmA73L6GDZYJ6AFfO3azfx8atWpsWYXodSQ1gTeSb+4YmBtDjsPqgWYycR\r\nOcskLCfUmwtDi4PFyD74PbIGx3uFyXgOIdAExsMh9eiB02KNPbLt78XohFq/\r\ntgLN7cXIQxf65mwea5NElF7wQBwEamsNbofq0eYSoMo2taOE91Id6d4DCffM\r\nUbwcI+9C+NMAx27qlNw/CicgKKeFJ4XMm5gCh3joV1KeHBCiKbnD8CyQBWRO\r\n6BAayYODQKthPmCLq+xoc2XaRMlqo74p3G2TjIACba/blWpqb3M9c9Bue70Z\r\nSKxrHz+DeItMcQkWtLsH3jwLh4aAcSui65SBkKfdZWIevvdCfwXRYsT3LV4Q\r\nCgYLj/UkCANQUEeYuxX/CSTKyYksV7BQnX5ogdFbEi1gc7YGW+wg4pq25uEd\r\nS2x8bZVwoPst+FRFC3Slf3OvSzSBINyloF8=\r\n=tuh0\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\">\n    <!-- ... -->\n    <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"5b6a7c1a1c133381bad395ae040de00c64b62e42","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.c99cae77c.0","@material/rtl":"15.0.0-canary.c99cae77c.0","@material/base":"15.0.0-canary.c99cae77c.0","@material/theme":"15.0.0-canary.c99cae77c.0","@material/ripple":"15.0.0-canary.c99cae77c.0","@material/tokens":"15.0.0-canary.c99cae77c.0","@material/animation":"15.0.0-canary.c99cae77c.0","@material/elevation":"15.0.0-canary.c99cae77c.0","@material/typography":"15.0.0-canary.c99cae77c.0","@material/feature-targeting":"15.0.0-canary.c99cae77c.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.c99cae77c.0_1678319029625_0.7183842269378089","host":"s3://npm-registry-packages"}},"15.0.0-canary.6023b1cd3.0":{"name":"@material/slider","version":"15.0.0-canary.6023b1cd3.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.6023b1cd3.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"baf3a30c7708ae7986bfdddc430aa8a13a50718c","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.6023b1cd3.0.tgz","fileCount":37,"integrity":"sha512-HrHH01ScSmBGJHPj4CgqCKBZd3IgjnzA8+NOB7xQ/toH/YeEvM8D767BeaHCnI6ksW0hJ5/Bd6yfEYoTETbAwg==","signatures":[{"sig":"MEUCIDSQIRn47MHUE5Un0sOQ3rt0XhTNzDWNiqWy50FU0B4yAiEA+MMggR/yCpHMlL42hc/w9DaSSP2/+PXiCuJauq8Jtd8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1224763,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkCezEACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmp+6A//WFKqabkdlducDmek2uJmpcdnfp5vQvaWw/sZmIFyfXm7lD/m\r\ntrh1r8yYuINRQ9V3BCIW7+qgLOF042a6aLmEhiHwPxEhN8UltVCsr3ki/2kc\r\npn1kyPApRc657syD/7K3/S6+vj6dA0ZUlfC/EETPVOaxuB1K2RFNAtnNTY4n\r\nYYUnPxySTMpM7F/xqC8dQkg74iwmDS132081SFG8m+BOLVaPy3wQqRGbQ+sH\r\ngYm2pbvB3/2bpwCuvBVC3tGSYarWovzVi+7ohi5TZ3lwQ92daWPNhPlXq8nX\r\nVI9/XMdccxCG4UjhgMjMELEDlODsN3qvqEzqPbvYi9ERMFt/ohkaRODdqgOW\r\nRSkPtC4f8Qw85tMUPYzEa+IQDJFcpllkCBF24bDjSi12GvoHO+GSkCXmyAL3\r\nw4tyUkc1iyo3+6ieKs/IvjvoGUSMu8WyTn2Jr7jyzesIGgeGw7C3/U4p7ASx\r\nxF64QZs3BAq3bsljN/AidZKBftlSj6wb1neVJy5GTSLCFrzSneMnBj3NJR6e\r\nZozMyblUfmP+oDohs5I8T9N7GBxRjGYdsj+nY+3O8kQ8qj5+cfQlKSj3FVjr\r\nocckk3d3utKyGOjFG6/E5B0cjZOVPjCLiJk7i5eNleSoBQz/oH6k/SJs4LcO\r\nwuXjnCBF/Su5cFLm/Quz2GbyiELw5ZdLkGE=\r\n=K7ZO\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\">\n    <!-- ... -->\n    <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"4d11f175faeacd8e5fe534611afbad84efceae77","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.6023b1cd3.0","@material/rtl":"15.0.0-canary.6023b1cd3.0","@material/base":"15.0.0-canary.6023b1cd3.0","@material/theme":"15.0.0-canary.6023b1cd3.0","@material/ripple":"15.0.0-canary.6023b1cd3.0","@material/tokens":"15.0.0-canary.6023b1cd3.0","@material/animation":"15.0.0-canary.6023b1cd3.0","@material/elevation":"15.0.0-canary.6023b1cd3.0","@material/typography":"15.0.0-canary.6023b1cd3.0","@material/feature-targeting":"15.0.0-canary.6023b1cd3.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.6023b1cd3.0_1678372035806_0.9976737279619592","host":"s3://npm-registry-packages"}},"15.0.0-canary.274610c77.0":{"name":"@material/slider","version":"15.0.0-canary.274610c77.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.274610c77.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"8ba1dcf9dde2eb7de974e6e5e234f2332d095707","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.274610c77.0.tgz","fileCount":37,"integrity":"sha512-kRfSTNvtN6a6jq3jY7ZjonuX8UlBYqIEDmG5jLFe85zaxWaenJvrLXoxdQEGbxIsIuijbbO7jiCtgHGhnorQMw==","signatures":[{"sig":"MEMCH326huMs6LV2cpcru0kExydK9VLLhPmTxw1Rr1aZKLkCIGwuIs5WDGLRcOuq/Brdpm1LaIuRVMSDwCXtPaLGfosK","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1224763,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkCfRbACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmo7hA/+Ly/qdJC9GU7ff4d+FXJadkzNRyvei73RWS5s41qRjzUn1lEl\r\nwYwvj60bCPa1NflMBwzuNiSFdFkRbkT6Dqx+DLSZfO5Kpob52L4mn8ohf/Ak\r\nF6XhFWXBAvQ0bQAZ/9Qx9oqXOjY6lnhXRm89zBftTkQeGz+eoZHbqyUpGd7d\r\nAmTSc6YvYnAwKqkl7N4JhIQcGOChPjoueSHV1kHMfbhhmxo1XPNnvYrHulKh\r\nteoVklEjK2kpWWKi3h2ChUvx0NDqSqvKfY+UhsoqV8FD/07RJCTTqxngOwia\r\nY0pmyM+SEIGovsLmAUBB0h18bRREha53kuL3RfzyNLZUySpOJYgtKW6gEpEU\r\nWj6BaaeJczIl087v4ubRvvEnVmuV6vSkjWo4VP2UEnaavfc/nwmdvEAgIG+5\r\nt6ItLtNvWS9qfBTgaFZLFL7z7oO9lFi6ggUQVMKRhp8x/7QrbLgh+UhAK8cR\r\nyk2KHWuAKaIOZ5eR4njD21EAxfMIMdIkPwxKRjHfUPeGuDX8tSf87InExvDh\r\nCLHqOO+yV9DpNJnhqvbzVFmV7se0djeQA6TowrXVREhc6QKlFMuTWax71qBx\r\nxNCJw0tZS1zyGZlf2mskg9HkwmF8IDb7DXrfFImh4oIUmuZ3jjcTGkz1ix7O\r\nUJPjcL5nbRtsSLpqFbuSulfxxGmvafCEMh0=\r\n=aKtF\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\">\n    <!-- ... -->\n    <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"7a2b02c682ee73deba431503de1a6f1fef211c10","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.274610c77.0","@material/rtl":"15.0.0-canary.274610c77.0","@material/base":"15.0.0-canary.274610c77.0","@material/theme":"15.0.0-canary.274610c77.0","@material/ripple":"15.0.0-canary.274610c77.0","@material/tokens":"15.0.0-canary.274610c77.0","@material/animation":"15.0.0-canary.274610c77.0","@material/elevation":"15.0.0-canary.274610c77.0","@material/typography":"15.0.0-canary.274610c77.0","@material/feature-targeting":"15.0.0-canary.274610c77.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.274610c77.0_1678373979038_0.31122729143214123","host":"s3://npm-registry-packages"}},"15.0.0-canary.a274583b9.0":{"name":"@material/slider","version":"15.0.0-canary.a274583b9.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.a274583b9.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"321408e31896c86246fe4c16af0a86e2be3df3cb","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.a274583b9.0.tgz","fileCount":37,"integrity":"sha512-ZqOBNEXNs9cToNJktfh6uvayKt7VjsUBRLJyRHGwMBDgVEt82MtaH2aIDYS/ACvIbCpTTtJTkmzESEiC+lXVCg==","signatures":[{"sig":"MEUCICEBwDqYRZh/AkOVW8vndmvn9LJmA0JUqtT+OciO6woQAiEAocuXwLwkr8SDF7aDpc6vDbR3554cVND8ACfCm8MJCjo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1224763,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkCjk9ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmosWA/+P7xOMwtbOYWI+qWziqtX2biqqa+ijIWWQ8NHAxwE3rNL0o5p\r\nrTe43wgfEluP5myc9lyBPa+5gkaxTMEj2TVIqtG1RHprOp3cLyEKmjI5ADCR\r\nJI6eRQmGWxwuPtYpEHW42MZdzjnAaP90OuM3kmGrBFOR4d/nMM5WZYtKsfEI\r\nFwYQ1FaZEK6nOZh/RpgHHZZb8T5F2trqd6H55ClVGrAwBI97namGQFr3RL6u\r\nfP0S3pcUJecPpdqtnLwrhMzf8F7AqfsOqii9XikprYFAtDwo/cTgCZ45AH5e\r\nt/VtTuCetyeZixjEf5lzIsSFwk4z3+34vuIjvqemujgON0OIhwpfCEfxVvAx\r\nW6edeapMfuew+CtByy5ZNzyh/uUasWdnsPGPwuUozJzJXalywvNLLpKEo1oI\r\nZlKvv9jKUX5Tz98DMXkAKUuZ7uwF8ha9pjt1s/0ubfHxwULVdzAbdX6xtKIr\r\n1Vm4ROxjkP0qbH+epTkv0QAcW26pVW6YAUEIPxKS0qazuZOG6DYLM9mU2qFn\r\n+S7WQ9JyuOElXBpsbQEXwgNFpsy+WfSfhxdIkhsIdAVR+2ECMkQZhIw0pvY8\r\noXzgsj1PqCRi/NRdBE7COOSNIZR4V3Y4Hl8EgcnugJvqVTBQJjPbjDizHDdQ\r\nqlkyu0ruIUDQT7BFkEOuz6wN0wxMzN6MJk0=\r\n=dmRg\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\">\n    <!-- ... -->\n    <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"7a7c8184214014c45d0ba8b4723714d1fe91f266","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.a274583b9.0","@material/rtl":"15.0.0-canary.a274583b9.0","@material/base":"15.0.0-canary.a274583b9.0","@material/theme":"15.0.0-canary.a274583b9.0","@material/ripple":"15.0.0-canary.a274583b9.0","@material/tokens":"15.0.0-canary.a274583b9.0","@material/animation":"15.0.0-canary.a274583b9.0","@material/elevation":"15.0.0-canary.a274583b9.0","@material/typography":"15.0.0-canary.a274583b9.0","@material/feature-targeting":"15.0.0-canary.a274583b9.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.a274583b9.0_1678391613082_0.9245707331371591","host":"s3://npm-registry-packages"}},"15.0.0-canary.da22ca960.0":{"name":"@material/slider","version":"15.0.0-canary.da22ca960.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.da22ca960.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"510d5d2605b218ba27c304ebdba799f7721a28a4","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.da22ca960.0.tgz","fileCount":37,"integrity":"sha512-/kZqOSJbhEkjC35uvB+E/xSd0cro/kqwb2YMZGDFaMLp3dfRYIldjXQVrQwf4pfFuVHGXeATt+QRqlZAuaIfMA==","signatures":[{"sig":"MEYCIQCbunK6MWGW+4u6e22PM9xsydgB3dOsBP2l92qfBrmV1wIhAIzSgYWAndJoh7zKDDbYWiUqL6dZQd/7EBGW/Je1ccza","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1224763,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkCj9KACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrJpg//dFjehwKE4Hc9VkWCy5a/qXOZaXzDMNzO1uu+mXLV9i4215Gc\r\nJfIRVp7b/WdndVsSZaI44Vu5FT+EKwdJnSlZGTeuS7wHeT7tMK7oZsMdI8CY\r\n5fioOuJ1V30CrUuyz+joT8XEwHExU+8ylkmRwKMp34YcRqXfrCyM2azfa40S\r\nKL14qI/IKA0j3eOcjdmMyhuXgoUIYTlNIsCzMexh47MGNKH11z51bvEmUdzn\r\nCMmJ4rcI84fHSjgynne+B5MZjUNKucIZx/KzsO1PGQFLpJysQ6ZHIwhXwaZK\r\n9lanxcnFzWYzKkHQh29qXgBbfaNu8C1AKNBeM+SWTnSHtyIF/j3cJHiW41yT\r\nmfDU0zDMGZj9QCI18oZTkJLP4dqUQcQl+4MTs4MPm7yS8Z2AueIBvIIVnt2d\r\neU/o85tsGIkeDsjO66+U8S0thMJyAUTZ1QBizn7/UKeozGvC6Sa8mwVnRjFN\r\n9BESgI9lV2YpSTeSqBiIYK+Cl5t0z4/tx3aiSshOvXpeJUOE6L5D71uIkprK\r\nLknho0tNkjq16b0kts8Vuan9qClm7lGZnYi8ZXWGusthjfoIATrxtwH9+vrv\r\nntAI0RHXfack9+4+Qqe1fLo8OMl6oCyM2GTb9Xl6ztM5hUCah0FCHTBgRN6i\r\nPqL8ERjramH+noLSCmcaJpWi/yoorcr1rY0=\r\n=tL7g\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\">\n    <!-- ... -->\n    <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"1b58f37865efc4ba8ba06e1190cef502dee9f902","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.da22ca960.0","@material/rtl":"15.0.0-canary.da22ca960.0","@material/base":"15.0.0-canary.da22ca960.0","@material/theme":"15.0.0-canary.da22ca960.0","@material/ripple":"15.0.0-canary.da22ca960.0","@material/tokens":"15.0.0-canary.da22ca960.0","@material/animation":"15.0.0-canary.da22ca960.0","@material/elevation":"15.0.0-canary.da22ca960.0","@material/typography":"15.0.0-canary.da22ca960.0","@material/feature-targeting":"15.0.0-canary.da22ca960.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.da22ca960.0_1678393162037_0.5787225201700186","host":"s3://npm-registry-packages"}},"15.0.0-canary.304a94e8b.0":{"name":"@material/slider","version":"15.0.0-canary.304a94e8b.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.304a94e8b.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"d6c7050c8bff32fc7801aaa85aeedcec3daf343f","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.304a94e8b.0.tgz","fileCount":37,"integrity":"sha512-xrPygk8ZVNfLkw0Ya33XLlHvXDegep+9pgRtLUWt4yk1+9qycOSpDJVFFA15MS16HldNvjUoR0msbL6Ft2LTow==","signatures":[{"sig":"MEYCIQDQ+JBvRGR1XwyAKa8QM2+PO9s0h0CCQf4vYdtvavGMcQIhAIotXotaB4+T8eg1ZuUbojw62oeBs55gUSfC84UO+n+S","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1224763,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkCkWBACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpCyA/8DDqe8UjtkRZ/OqBhltJkj5N8kvggATSeSPJ3jVEDPQrQmquN\r\nObv7b5rMbFRXHixt6sxchfE/xd3FB3dwK0rxBwqvHgBGXIaR6fyce7bBqodG\r\n05nMpFCeMf2cqnFmdjWgLDWqVq8Ap63lqfjJmdj4iPcC+j+fQ5OCn6FpK++a\r\nb9qPpYmJwtv5z8FOLyhZ4dR31ZFaXYKW507Pu37p3r2Ok3hM2B/xKhG/9oM2\r\n9SkUuNgPOmUd1DP75w0ffIMG6ZoxetpLMjPbCuUcfnDRcKw4u0aBGBsvl1Yy\r\nvI2BwsH/KmPR26TEbz5sCmasyLZAKdJYozrfZF4YWErJyk2wuxL5ZCZn4IMa\r\n8Izy9UrJzyBqnWICtp1lXrtvy2mk89MEy+925969GTqv+WYJ5eJObWeSATit\r\nhUSmc8WWxll9mjGyFpXX8W6VnSiK7MwlreQCZq1pE7Um+EKxvneqlHLffK9H\r\nvMMu+GKG+UqkrPckoNA3gOyWvTmlFzpCeREs8wb4+1ozj634AOmtIOynjHgX\r\nOsLbQ+6bi9k9/kQxehQ0NYje8hiXdSWW6GAFaZey8FamX6u7FOrJKcO1C7Ux\r\n49FD4FADcJpEpA6jjZ4aHg9DhlP9ccCx8O1I5EabacSoFMauUPnYbfxVhjx5\r\nqRsQs12WV93YSW8qX52wxZWZjSBlUv4JL58=\r\n=n/a6\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\">\n    <!-- ... -->\n    <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"e7550e10d6a01c606a6dd78c58c4ee6e44c3f062","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.304a94e8b.0","@material/rtl":"15.0.0-canary.304a94e8b.0","@material/base":"15.0.0-canary.304a94e8b.0","@material/theme":"15.0.0-canary.304a94e8b.0","@material/ripple":"15.0.0-canary.304a94e8b.0","@material/tokens":"15.0.0-canary.304a94e8b.0","@material/animation":"15.0.0-canary.304a94e8b.0","@material/elevation":"15.0.0-canary.304a94e8b.0","@material/typography":"15.0.0-canary.304a94e8b.0","@material/feature-targeting":"15.0.0-canary.304a94e8b.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.304a94e8b.0_1678394753088_0.508794925487307","host":"s3://npm-registry-packages"}},"15.0.0-canary.6c265915c.0":{"name":"@material/slider","version":"15.0.0-canary.6c265915c.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.6c265915c.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"aa4206b70d4cf8ade1fcced1ac2a8f4df7785c8c","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.6c265915c.0.tgz","fileCount":37,"integrity":"sha512-9kNmIenbPZa66jWvgYBL+jVkqPY3NyITVUrRje+TtS4T1gYk3UymH5x48yRu04rsEJ9c0amjfC00IM5syByadA==","signatures":[{"sig":"MEUCIE6DrBzIJU6bzU8brDw4MEuM1sNp4ztOrlxYZfLGxS8QAiEAjkRUuk/7ziCV+8mQbeHT4gMV7CdkNv8on/QrYnpTdyw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1224763,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkClQbACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoE1Q//fZ2X6nwcUJQ+E/bceeGjCvQi3u6hdtfxzCjuRsG2rTcyH/PP\r\nF65RQw4TLPD5eYoXmRlfJvRjYu1702Yj+bl6f80ZKGoYpCPuDqc/K2ESllVb\r\natmtNf+jXsUZS1FJN1yRd/g5wjxe8a/PLY2WpzRbfVWAj0T67AGbA+W+lgan\r\n22wFMhT1O2Ve4coXlvo2y/PFPsGuf9KhNQJGnlSQRb+ZG33J1TzEY5K1VrGH\r\nn2nsjP5dC3AQ9gjycIWap2zIJaneW9t3EN2dPch+ZH+vi8IuAsavgaDYaPX9\r\nnNES0IZvygzrNvahVJdz2eNxBEQB7bPp0/2CazKcCx2VVXLJbcbwL+wLNikx\r\nktr8jds/EZTeim5oqvMQJYXXnUW4RbT7a/DHkH3bLxj8gEjWct2CUgWq9MrB\r\nFzZgWD1CLqiyyOfCjHtLwfADtwuHlEgxYmwdS2tURPtQAQh2JHvjRLD4sXFb\r\nkrEICUersP6NBGPihF5Toh8ZeuzHbNY8/ixK4yaul6Md/KHGA9j+Ua6kiCSI\r\nf/+qAOgs4CLn4XkmnDzYJUinR8SminRxaDvd71LDd9Ooj7w0zDyUvKKfL5UO\r\nSiU11x6THCbdMPgqaWoGS/JRJyyw0vmxRtUfH+bndj29jManul0WvcCLxfbq\r\naID/dRKNVscanX7eBTzOd0XtyNBD17I5bsI=\r\n=FUHF\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\">\n    <!-- ... -->\n    <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"2226d2e658d88eace91ac63729977eb6bd7a9af9","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.6c265915c.0","@material/rtl":"15.0.0-canary.6c265915c.0","@material/base":"15.0.0-canary.6c265915c.0","@material/theme":"15.0.0-canary.6c265915c.0","@material/ripple":"15.0.0-canary.6c265915c.0","@material/tokens":"15.0.0-canary.6c265915c.0","@material/animation":"15.0.0-canary.6c265915c.0","@material/elevation":"15.0.0-canary.6c265915c.0","@material/typography":"15.0.0-canary.6c265915c.0","@material/feature-targeting":"15.0.0-canary.6c265915c.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.6c265915c.0_1678398491141_0.35173356066626393","host":"s3://npm-registry-packages"}},"15.0.0-canary.de5224633.0":{"name":"@material/slider","version":"15.0.0-canary.de5224633.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.de5224633.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"5a596ee35b2b68f1a4c74385f867ebca6e104eb9","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.de5224633.0.tgz","fileCount":37,"integrity":"sha512-27ifPhloRAyTHI5Xh7ypqr3rPjTSWr5TIQAeGrpGa3ioeu3qGpr1BCVO69vsDsThL4eAT8NBRocdH1Sfwo+B9Q==","signatures":[{"sig":"MEUCIGGKS6MN7MvI2WL6skYTCFO4bKcWd3OI9sqqSGhZoE50AiEAicZdysRieICkdzU9H6jk+lu5nD8C0Y+GE8jMQueenmE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1224763,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkCnI1ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmopfg/+P4OKzD5LJ0ICArHFmW5GJKx1sL2iRFqEnTa4N+jsl8iKzAva\r\nXwglwCsp1Up1kFgdivwhBBYArKVSDsOcrjIJ8SAB0por2n+B0ETlzIWQW8E4\r\npN2xZHgVI76m/4IH49Gtt4WPVeYnlHWv3IVV3L1AGb6jVbLIr2dQsOsMjDaG\r\nLuATMzlb/gD8urEutQuOB0bPtmwd9ZqH8JpbJ8UcStxwcSHtwFa8ZHtNs9V9\r\nGG3PRBildYwwN9US7Rh0ww4H/jf1jNLOvpqwhs4g2DO0GMVTq3B4OC3vgPn/\r\nzBDA8uJuyLL3wZ3bMIQiSE7rEenEA8KUO16pnPyH5zonrD4dSjsPzpvzUB77\r\nwvcd2AJp80F6vZcO966o/qYbimRars1x4Z3kIGA4DhatqbfTduWLGabSkT7i\r\nDuamF5YQkRAYRFx2E6Jv5cuSrDD07pCqeas0qhcI5Vj/Q9Owj4kHY0iG6Ozf\r\nb/nJNxnjwXRAtZtdntwyHIeIOs4L03KpteFB/REpW4owgdB8iOYfJLc3dskG\r\nF4ygsVD3G0lUP1295AyI5+2mXVJ/Md6J9bcrwSUQdzZwXLGbETmb1DgZ5baO\r\nvYN1tSMU1BkSNFli3gwNSN62JrG9wJSqia/Qku/Zf7kvm2NbSQ9DbznkdM/I\r\nLlPM8uBkNQ8nJcnI/AhqYDi3G0hVSQ8EWQk=\r\n=eXCw\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\">\n    <!-- ... -->\n    <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"994c620135276cf7948cc54b286c6c306c3ac01b","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.de5224633.0","@material/rtl":"15.0.0-canary.de5224633.0","@material/base":"15.0.0-canary.de5224633.0","@material/theme":"15.0.0-canary.de5224633.0","@material/ripple":"15.0.0-canary.de5224633.0","@material/tokens":"15.0.0-canary.de5224633.0","@material/animation":"15.0.0-canary.de5224633.0","@material/elevation":"15.0.0-canary.de5224633.0","@material/typography":"15.0.0-canary.de5224633.0","@material/feature-targeting":"15.0.0-canary.de5224633.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.de5224633.0_1678406197026_0.31280802540888364","host":"s3://npm-registry-packages"}},"15.0.0-canary.8879557e6.0":{"name":"@material/slider","version":"15.0.0-canary.8879557e6.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.8879557e6.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"c8019deec716ae07a8f855f4c2c218f8b2ab7972","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.8879557e6.0.tgz","fileCount":37,"integrity":"sha512-k+f5fo1MqCCMJGVI7uXv2U9D7yANESkOkGW6z+Q3o3IT4/6uc6qBFueeB1R4Aq1iLi3Ae3S9QVsQkt/0mswNRQ==","signatures":[{"sig":"MEUCIQChX8DQaHZ/8dbFeuV/0vtE7axaixe4gz1+hUDacF1gIwIgGIOE5fjTVMMIyHwfaXEEfCcnkH2r6bHiu7zuKTJyn+k=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1224763,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkCznvACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrLpA/9HeUgWsWQn/fxl2DODd8Y+0EJfIM1bArHS8bh7eiieWXb22IU\r\noae5iCfLBHY9QHnx7AYv4csnu6Pvnd75zOxLUutf3jlnLTLaPpg120HN3IkH\r\nVLm8RSVpc0GTAhO9GGPvObyphYLXYeJH42Kzmrp9KgOUPQ4Y+2S+1jA/PRXz\r\n0aPRCbGuFZOT4YwX5JRxy39lHE78hycFBZxoNm3HEgs6gCymWTOLZfIT1XbL\r\nzNJ59o6niKvGUxzaOPNEU9QEOivPgobickz7Ccm5gJoGHlIiAaiUQOndIvqu\r\n76RBIwvq6MxZEi7rSkzZ7spmyId0SjkWt0bUbfKdU2p+Q0zniIbYSqCxwLNP\r\nWBE5HY+5unoVsBBAy2SC5w3eYqhJo12wUj92/WHv0Fbe+GZb1lqKr3wy/tud\r\nR/MupD+a7Gg1Ou4O7WKJMKZFD7fxmGZ99Rg9eTVxmguiEw27gfYUYhvpdroT\r\ndi0rGVJjvAMOZjGwD5iiylu6dkTrqu3njTarAvNDvqME/+d6K6F+TnRynvlT\r\nMvthpi9HV9PdTykci1H+AwApn+lOhKxiIc9q2fKDU0ZYS+IOtPEi1cA0Mu0y\r\nAk9wUY7l2Z9Z+sh/bv4RLcPJsmN5WQ1q4PLzeZx96/HywNAA0obsOezsD0iR\r\nDTyABelgpgKaKSTkD9Aq09a7gHHVWcc6c8w=\r\n=LLp9\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\">\n    <!-- ... -->\n    <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"28f7c223e2bb4a686b970a425d14b1d1edd70546","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.8879557e6.0","@material/rtl":"15.0.0-canary.8879557e6.0","@material/base":"15.0.0-canary.8879557e6.0","@material/theme":"15.0.0-canary.8879557e6.0","@material/ripple":"15.0.0-canary.8879557e6.0","@material/tokens":"15.0.0-canary.8879557e6.0","@material/animation":"15.0.0-canary.8879557e6.0","@material/elevation":"15.0.0-canary.8879557e6.0","@material/typography":"15.0.0-canary.8879557e6.0","@material/feature-targeting":"15.0.0-canary.8879557e6.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.8879557e6.0_1678457327654_0.22142399004839652","host":"s3://npm-registry-packages"}},"15.0.0-canary.23073a303.0":{"name":"@material/slider","version":"15.0.0-canary.23073a303.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.23073a303.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"64db33ad134f857b228eb76ac023bf23760a4a28","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.23073a303.0.tgz","fileCount":37,"integrity":"sha512-nz2HNL/JzMWWMnXUVd9WUmIsGCfldtw/VnaUXc0PbrsK34UbDBOfScVHEp4jzvuFDW86HLTJhaKuejfTUmk2OA==","signatures":[{"sig":"MEQCIGzFIOgyLMJvcct8RdJccOWu5uS/w9FHcrYMrQKOIif+AiB38WPL19qspWQNJGS9RQQHQzO3NWfDSv/o5E4D8AuW+w==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1224763,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkCzuaACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpjVQ/8CQROqv5jBvMtwUol17+oqun/rAS0Sr/G4Yi6ozj8nebPtAqX\r\nSgbqt1IcgveXM1t20BazQ0MCQzeOIisIjjW/V7PNaF5OYC3F3aaMHRIWnuUG\r\nTV/CQxnfuf9QREek/GsrAwtMD2a/Ytp1iuuWB736Fook5VUVoMy7zqtoYLCn\r\nCD33spAqFykIkhcWTT3rXpoy2xGIWa6Sm3ejoD+OvnMrUzmh41rEC6vZiifU\r\nEsXQm+6DKcZIBRxTghHRPpAvesDMVMSXK/maHdNJNy6JJV8r8WJA47ycJOf+\r\nivNH9wY8O9IHKcgW9XobESFSvwiFYRxnUtSHET6gjBUXWDMtC83KaBUNEDQx\r\nHCB4H8arerdvPHLTZhy/U6AKNwtf1KnTdoF95Tm3dLugj5CuneedmrSbz7P6\r\n3gQjdeXFtYmV5uc9ahvratqtEjHWlp75Hbb59iTtbVF9PyipAR+ekbwRsD77\r\nWvAbs4xgA4pbcqaipwRegl5q9QQBBc45bymqLe1fgMieAwcmCS1VPV3RuFuE\r\nbYRAIfSFpBaeDuiIU4krp0/N4EezEoTrZdyjFT965hnjM/EuRs7IJs88++GT\r\nZ3GqFfL9sAg7mwhyTo6l/O8o0kktTWCx3OcaeyeAwXPo5/xhu2SFyEnzxlM4\r\naeIxDsao72N/yj84MMWpjUKH8auaHPxao4o=\r\n=zu1H\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\">\n    <!-- ... -->\n    <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"2d7826e2ebf1c1fde12f47b603e66ec0df229a8f","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.23073a303.0","@material/rtl":"15.0.0-canary.23073a303.0","@material/base":"15.0.0-canary.23073a303.0","@material/theme":"15.0.0-canary.23073a303.0","@material/ripple":"15.0.0-canary.23073a303.0","@material/tokens":"15.0.0-canary.23073a303.0","@material/animation":"15.0.0-canary.23073a303.0","@material/elevation":"15.0.0-canary.23073a303.0","@material/typography":"15.0.0-canary.23073a303.0","@material/feature-targeting":"15.0.0-canary.23073a303.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.23073a303.0_1678457754619_0.5407355544356605","host":"s3://npm-registry-packages"}},"15.0.0-canary.51c7d4014.0":{"name":"@material/slider","version":"15.0.0-canary.51c7d4014.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.51c7d4014.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"342d17d61cae5665931e178e61ee19fbf9debec1","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.51c7d4014.0.tgz","fileCount":37,"integrity":"sha512-D1Y4kQa4eNGOqHnoXb39Pz4oQYFotD2gTSoMvbT6DGcPB/lFnrXNmk2QUM2jogBMUFpYqENjcXoWXxc8pxwOwg==","signatures":[{"sig":"MEUCIQDFS7f20JoJy05c1ZGbvD2ep99R1HaFSPdJ9rLc5W+CrgIgJn7MkgWTjpsiuZydrio/LA83jtaehHFUU38O3azM0vo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1224763,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkC19TACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmoduw//XQZ0eE08P2QjpSDGGwIFGbDct7ubfSolXWkUgizSndHy5kPw\r\nG/hQunCDADuaBzTu58/L/knkwD3zUChJdFgBOT8b3HME4ninL3a6dheEfYVw\r\nQ3mz74BBosf95OESqYfzEaJtYcVuOblfBzQz483646sFh3D0LwGauqJSOmXz\r\nPseSQHGJjOCRKhTwCOqRDpybsiQfdsdJ76ulMVK3i+CL6U8dVYSfTu2yNFQ8\r\nZqvmWc28DpqIXBTmfJV5QOAVQHf3MPr9sOjtdV+Q6+w8DMgHFRfGYQ7N9B0n\r\n3jfPTgR73Qafl5gPfrEv3D4qLNOdf2sbz0igUebzEszufUNA14KyEPtlFFaf\r\nm1ZjIlfaakAJGTAU2FCXkepNn1skGwvCC8nBW1/wINxKTZVogAMEk912iN19\r\n09diBgUpI4QJzCHb+b7QgKp7et/14x1lon/WjCF4GmV6onOkFtS7LqWzEX4p\r\nKTApsoVUYFhEqKMI3UdlOpYf2c2tpibihPanSGtJwusbGu+Av3O5CIsDV8Cv\r\nK5IJSzArwG3hVcNgcmOuGAWeRQ0LIJUEJ+all9emHrp8Uh3D+oO3y7ENlVgy\r\nrZtoUpCvOmdP6X7/MfKebcWlbemV6owbCZRSagSx5T5RsZOxTPlP5ydWKaUd\r\nybpZo3mt1rNBfVLarNA5QXTfSzzPrhpLUB8=\r\n=IcUf\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\">\n    <!-- ... -->\n    <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"0485e6059d69163f12d83408c09b1d41f6cb8dba","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.51c7d4014.0","@material/rtl":"15.0.0-canary.51c7d4014.0","@material/base":"15.0.0-canary.51c7d4014.0","@material/theme":"15.0.0-canary.51c7d4014.0","@material/ripple":"15.0.0-canary.51c7d4014.0","@material/tokens":"15.0.0-canary.51c7d4014.0","@material/animation":"15.0.0-canary.51c7d4014.0","@material/elevation":"15.0.0-canary.51c7d4014.0","@material/typography":"15.0.0-canary.51c7d4014.0","@material/feature-targeting":"15.0.0-canary.51c7d4014.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.51c7d4014.0_1678466899658_0.4566930710675472","host":"s3://npm-registry-packages"}},"15.0.0-canary.1175a5be0.0":{"name":"@material/slider","version":"15.0.0-canary.1175a5be0.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.1175a5be0.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"70136ad0f71705283ac7064c37ccb56a3a0815bd","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.1175a5be0.0.tgz","fileCount":37,"integrity":"sha512-a6H98NjC01n9/+xdWHgnZIgj9Eop7xADDVPm5V3696Ke+HB4FybXMZmOgF1dqJnK2UsX+OkJhhVgFmwZTzjQIg==","signatures":[{"sig":"MEUCIQCzw1zRsdXjoaf5gc50/sYvR4Ogsc+y/PQA7Lujz04m7AIgdN7Te3pxNxW6wzwo3NVAdqu92BFd9682OorPnIWioCs=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1224763,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkC5e1ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrMoA//aTa3QkrMldZFOn0DbbHlm6GVtJFPFSr/VOwS2f3u/TnyYFjf\r\nnr5sEY3SuUINpiAi88omgxekWlCEcjrwS9UVpdkMzL8sfsvsiEiKX6qk1ug5\r\nwjU1xQObpXXUDI6AJopc0pzeCIULtlDw3zKvPh44o0BAYKUTB6ibj6WRaCcX\r\nXXKE8OYNm0Zbbuubz+A+04Ka91faQMfbMUmYQ4j57RJgxvH6zsl9ZjrpMqhR\r\nd7o5Fp2uNCSQT7DaJzgm69pFWerPvvqrzUxRSsSeO01j4HJGbuHPwLcPmGbU\r\nsdbS3Tt7llpVw7ayV5+cZcRbH6SH1+ckFIG8yOV/TAvpA+LrHwPNdlMTZ1yP\r\n8Bqgtj046LgWsLvpbW/qLeJl/ks99Bdw17JeYVdqaZ+yEyTbAuYEKiMx7fpE\r\nuIfJff230G38ndNiACK/A5YwTAPBML+ex+MTFA3skCHGIFfNT+jRPyR5T2pf\r\nj8IPyA48WJSUOChXPuw610NyJVmNl8t5Wtn6OMiDLxFr9WzRpOjTtSjv3QG+\r\nFechlrT2ZVruVJfJ6Y1gfCNKAdLPt4b/G+fugozX3bT0oiei1hXK42wqJ/WE\r\nIW+8Z4wOPGXKOxnMpMZZTF2Of2ZLpAjCyvtkGH5CZd3yMs0WFJy117u5hKtw\r\nWGHIMWnkJ1W65wtCGj/GJLyf5IoiPKceEg8=\r\n=YEce\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\">\n    <!-- ... -->\n    <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"1fcae3e4ba7c60c6a51ee8e61b01e26a324b1ab2","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.1175a5be0.0","@material/rtl":"15.0.0-canary.1175a5be0.0","@material/base":"15.0.0-canary.1175a5be0.0","@material/theme":"15.0.0-canary.1175a5be0.0","@material/ripple":"15.0.0-canary.1175a5be0.0","@material/tokens":"15.0.0-canary.1175a5be0.0","@material/animation":"15.0.0-canary.1175a5be0.0","@material/elevation":"15.0.0-canary.1175a5be0.0","@material/typography":"15.0.0-canary.1175a5be0.0","@material/feature-targeting":"15.0.0-canary.1175a5be0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.1175a5be0.0_1678481333389_0.047702191324102916","host":"s3://npm-registry-packages"}},"15.0.0-canary.7adf3af80.0":{"name":"@material/slider","version":"15.0.0-canary.7adf3af80.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.7adf3af80.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"1ebdd69cec7839c53c0f6576d2fc511f9b635c8b","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.7adf3af80.0.tgz","fileCount":37,"integrity":"sha512-xsnk+GZtOlW/JY+SHwmkTOpuaY6bR0hYjG9X9oSDDymSZgnKxHlGapCRYQOrJkfbwD0ywTrDrbK+O1s2LUswJQ==","signatures":[{"sig":"MEUCIQCRUBMqe/QZNA4FMzrpwKQDxi5zagmLRaXYlsoY7Ebx/AIgYtFiuieK7zxzJ5oVoX2PZ3IFTh0XHixoKDmqBImiF6c=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1224763,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkC9ifACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqhZQ//UGlzu8zOEa3IQfcypRTsYN2+IjsNvMKLGSMXAm6Ah61bH9Bb\r\nCOES+Ilmovc9xKKspb8CL17qRfTC9vSXOfwKHy81FH3QgK5eCJIOjk9Z3X/5\r\n1LOuM4kuOv2B9Xqa12MhxE8Mm52k2by2mBTkqB7UlGM5U8kImUjAXzVk3Pah\r\nRqds7FPcirtHlNG2Xe/ZSC+03kEEbHPNXEgGT20VFkqrl2rCqJF0U3r4V0o3\r\nrUvcrCODCD98V57qVuq3JhLv442U5eoJVBz4O7f8iQljo1owwG1CXlXtVvOc\r\nQrHLPwo/fAp+GA1ItSSK7NsQR6NinaF4vMrAkskFyIwH28f+UXtRWRUJoq0Q\r\noGYUz5HGRFOVJZxLdLaYPm5vnJ2tetYiu0U41WetpBXtD6V/kTpl4Shuttke\r\nyWCBUoIzsbNzDvGT0DBwUk8CTKfEiY7ZKIefA4w9yyavn2L6C7AMHFjQS57Q\r\ngbTz7AHfjI+BgoLxwQnxeOrqBKQDhpTbOB5tXIk7ZeptQc4Is6grwV9dAS6l\r\nkyduQYmMDA8oW2Waj4MNaIZb2Zij7lllYM8IkLtHO8KEmxT1D6PNYRGzhJU0\r\nKCRlyfvv/15/PZYfnmTx/WZaXGW8u+ZKnC+vlEtkqRUOaEktGdlLjA4MjjBY\r\n+fuiJGnUhZwZ2zJRWS0w1tHgztpnXvpGv08=\r\n=W1CC\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\">\n    <!-- ... -->\n    <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"57b0835838a903c8ac3ba6c8edf79add958481d7","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.7adf3af80.0","@material/rtl":"15.0.0-canary.7adf3af80.0","@material/base":"15.0.0-canary.7adf3af80.0","@material/theme":"15.0.0-canary.7adf3af80.0","@material/ripple":"15.0.0-canary.7adf3af80.0","@material/tokens":"15.0.0-canary.7adf3af80.0","@material/animation":"15.0.0-canary.7adf3af80.0","@material/elevation":"15.0.0-canary.7adf3af80.0","@material/typography":"15.0.0-canary.7adf3af80.0","@material/feature-targeting":"15.0.0-canary.7adf3af80.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.7adf3af80.0_1678497951510_0.06340734047022734","host":"s3://npm-registry-packages"}},"15.0.0-canary.82554d770.0":{"name":"@material/slider","version":"15.0.0-canary.82554d770.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.82554d770.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"12db62e8f572475fa4fa4ea443b9cb540d1d3ffc","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.82554d770.0.tgz","fileCount":37,"integrity":"sha512-1bvPDrXhUFkQM6aaOIhsOsG8FKPIPLeGkLkJmjAINa2BPBt+Iz7UiWKMuxrtN+NMXM6g0oj59+CjccYYW+FJKQ==","signatures":[{"sig":"MEQCIH0nFWmHzHpKcYUEA9cH+/NXSkoUuO5fGeh8/waRa7eIAiAPOKuVed5slVEgREQCMAtqu/l2ZnboPXLXJnCN7NOMMA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1224763,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkC9t+ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrLFxAAnZUjjpkqHDDFDfjOERVLyFx7QVXzexiJmkP4m4ceb7afJ2MW\r\ncG8t44Q4Egd3JaeHhmsT9+m/parBQuMUPWlGmTi8J/DdMiSvU7oJh+p+slEY\r\nEv5idUW8Fp2/vJ+szn3ZSSagznLYpKyMR8zNGF8bBHNZYlkiWyC54DBHlFSj\r\naNMGgQGD/c2m+b2hGSsTptP+2wxLbhAoYBZdnDoWIbjKI3Y1+YHQfdXZzsN7\r\nA18vsuZwiOWSEG25VCg9nKbeJouJLQonqB/eZ2bkobpApdQyOLy30P3yIdT/\r\n9SjhSKxHxo0Lh8nOxEHEyvkBjdXj92oaU6CFq7N0T7K+SJ+Hx1uO0ifGbzLb\r\nA8jz30wgDL/SsUzfzTvZ/tRkqrM/cAfU4zXVqb4uOj5ctopfGnG9Dq0Az0MQ\r\nrOAKqfQm2JpehPCF6TIQGesVacti6in7Owdr2J+jxUNTypmCvaDf3zU6as70\r\n8OHVKPCNGAtI7T9pct2uUnCrERwFSkwhV/iJ9/Tc3+CypOEcY5oZLSlY6vNO\r\nOboTOII8dZ9mWZL46FM2UmayKtdLkrpzC7Avt9xKEyKUKqe+rMc8xYvkPFdI\r\niAGg/KPwCiEt0DWs8IfiwZDhfVsObaHqVEP+LIMYnm/fU4sqKMebEobiu9Kl\r\nC09hJ2seIdosG894mLUKn1BhQ8iFwC4M88g=\r\n=gcXW\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\">\n    <!-- ... -->\n    <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"500cec655918e97ee1edc3c86ebccdac24a28f56","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.82554d770.0","@material/rtl":"15.0.0-canary.82554d770.0","@material/base":"15.0.0-canary.82554d770.0","@material/theme":"15.0.0-canary.82554d770.0","@material/ripple":"15.0.0-canary.82554d770.0","@material/tokens":"15.0.0-canary.82554d770.0","@material/animation":"15.0.0-canary.82554d770.0","@material/elevation":"15.0.0-canary.82554d770.0","@material/typography":"15.0.0-canary.82554d770.0","@material/feature-targeting":"15.0.0-canary.82554d770.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.82554d770.0_1678498685819_0.49602165271572574","host":"s3://npm-registry-packages"}},"15.0.0-canary.93fc524b7.0":{"name":"@material/slider","version":"15.0.0-canary.93fc524b7.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.93fc524b7.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"0d3bf560a0e0f87d3548e25aaefca28c42945f00","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.93fc524b7.0.tgz","fileCount":37,"integrity":"sha512-N4SEBgHyYwC6UcJ/qJYv3MQYmJJHBJ25WzU9upi4xCb+U3mQyBYIO6sKKuHp6Kfuez3cUy/++zk5hEHB3ACpFw==","signatures":[{"sig":"MEUCICHT9NgmO8WoNlO3ukMWuqBIlfujjJcvtDLHMXGiGd0vAiEA+kw4H2DiMARzwtWOuL4THHRptXOkDHhriQM9Lfy+Dt0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1224763,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkDuFVACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrhJw//cMiYcjOyjfTa/0i+sEIcYwFr0nRsQNDx/DQMGOzu4HUZciPr\r\nhNB8EI83B4aa27QMAI3Pm8VGgt0AvsVZ3l33zc1ctcxlfXwKvd4r0CSebZSA\r\ny5u4d9gvX+gYAMZJhAfkzTBwwWUnhj59F2u0R+a5pI0UBWxaNHm5yzDHhC7/\r\nP6vNluoolNzNpj55pXoFr9X0vawaU0mrT2CE6K+g589Fpn4gpKD9akvVIB6t\r\n0W18EN+D64WVmMNLVpyLLRsS8PF7pT6Azv7ZldGBQd8K2a+9Ow9POo6GCBXs\r\niJsXgOxJ/cIw2s9hiyQaorkUgtUTRCP1Qn8mJSj4KLcxBf+0uVvPO0q3gIDx\r\nXRlNC6Y8n3lsd6eP0MIbdd1eEq17njclECQNNyYv6TvU+YWiiOyAkwtfiDx5\r\nELGTUFttoWPVdIrd5IYwNom9Z9UZawj7hqK0fAqiLzO9NvsaF4oFpl/9z4Ol\r\ngXrdjmah4A7HiCfJtEAviWgcUBh1mKGebOp0pVkmTGDiDuMx2AF/t1W/gDjN\r\nEHyugBQh/05QXuwvLFIE7yypp+oSmoXqkU8upfR2X1g9mx3Bi6hz3sQ3QvXv\r\nFL7FvgHqa44PMjJdMmgMecCswYLr6FSmBQP2Z8/fEpdyO+6g1eoN5pM34S+V\r\nnDyLSVWV1jcHlyArrKkvZYXbmMdEAzeRyTs=\r\n=EmBw\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\">\n    <!-- ... -->\n    <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"338daa93529c874da1af6eeb4fafb935e014e096","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.93fc524b7.0","@material/rtl":"15.0.0-canary.93fc524b7.0","@material/base":"15.0.0-canary.93fc524b7.0","@material/theme":"15.0.0-canary.93fc524b7.0","@material/ripple":"15.0.0-canary.93fc524b7.0","@material/tokens":"15.0.0-canary.93fc524b7.0","@material/animation":"15.0.0-canary.93fc524b7.0","@material/elevation":"15.0.0-canary.93fc524b7.0","@material/typography":"15.0.0-canary.93fc524b7.0","@material/feature-targeting":"15.0.0-canary.93fc524b7.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.93fc524b7.0_1678696789692_0.4015220190760813","host":"s3://npm-registry-packages"}},"15.0.0-canary.50be0fbae.0":{"name":"@material/slider","version":"15.0.0-canary.50be0fbae.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.50be0fbae.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"842a5017b5a6817a9a010e573191187f9a188566","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.50be0fbae.0.tgz","fileCount":37,"integrity":"sha512-uA0iArvUVx6TVTSGk+rS9oM3U6+YmcyQRHPhQ95eTRCJrQIaXkmYvHRij5K7WOKGr0vZgOPytGiKLXnff1QPmA==","signatures":[{"sig":"MEQCIAq78VzWJvUWQTNzd1LNiEqRZdOSH+vYzSAqoMAgu4dZAiB+mlTpYFlBdLi2bI38ED+/X9X9mfxo74rx1JwW3Zilyg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1224763,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkD2EiACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmrs6RAAjOsMUAcuc0ZT4qCHgPxzMejKVIvguTm2cIb8gnpe8zxTcSgW\r\nP2eRU1eJkOrwZ/6HzsaetUoSbGwtgTWPMH8ZHpv0pgxWFmsWDfG/nkkTmg2k\r\n1w3qid53bBLYpoxaNfN04iVcp2F43JUwblRFpHUQ38EuIfF6p2zrXgzQjTFL\r\nFjIoK1I/Mb1bD+D3Omv87vj7tDq1hpiqiJZ42Bhh8GRk5YXmE4uek1F8b6c4\r\nmFpFKINNUFjNp25GRAY7vDbyUhpIbGOtRdrtpLNdTtOT2d8fdkfQYO/17NAQ\r\nrH7PS6oHa7ZP5zhsKvzCaTO7pw86IneU1PbJAEkosTVyawPMXFm8TCzmViGK\r\nptKNTaKJuct4cjqf3lQdiTDHIN6DOsqbtcAF8XlPbqaS2oKFvYwdK96Fol18\r\nxTLzBZC387bb9qKjowA6Z30wbRmIL348+jgzESvzDm6CemMw6XqtnNLNH0ow\r\ntNAiXIqkIXGezATIvwfKSKv7xo/hZ82Fe8yD8cW93lU8ZBbwfBs4VWgquVbU\r\n8+sk+Qpbf0VZROv4SWx8wn6cgRejpvvZPCYTmJLR/vKIq4c6FT16vTQyhV4A\r\nQ80wuyL6J/goGmIvt3mapCPNrrbLLfhUvjv9xpNMksAKvZ6ki66MD/r+HI4b\r\noaDWzBnTQcz3PX3jqvAxKwfKuxDsvA4J5ak=\r\n=r4RL\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\">\n    <!-- ... -->\n    <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"405d98c2882461cee8d47ab1b16a4666ccf7129c","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.50be0fbae.0","@material/rtl":"15.0.0-canary.50be0fbae.0","@material/base":"15.0.0-canary.50be0fbae.0","@material/theme":"15.0.0-canary.50be0fbae.0","@material/ripple":"15.0.0-canary.50be0fbae.0","@material/tokens":"15.0.0-canary.50be0fbae.0","@material/animation":"15.0.0-canary.50be0fbae.0","@material/elevation":"15.0.0-canary.50be0fbae.0","@material/typography":"15.0.0-canary.50be0fbae.0","@material/feature-targeting":"15.0.0-canary.50be0fbae.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.50be0fbae.0_1678729505976_0.11088304820212191","host":"s3://npm-registry-packages"}},"15.0.0-canary.6b5ffccd9.0":{"name":"@material/slider","version":"15.0.0-canary.6b5ffccd9.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.6b5ffccd9.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"ec439f145356485e3f7bf69c3b731fed9d2d1de8","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.6b5ffccd9.0.tgz","fileCount":37,"integrity":"sha512-guOOwWzE6K3LREVQ6n76bErB+BYFaA43w/WWsvxmnwjaedHThDXQRNBoFk7YAYv1vxnig5PEa6Pba++UBzLTwA==","signatures":[{"sig":"MEYCIQD/qdibS03glUgs2Cny7FW4Aq62jE+X06DpkN7Rr3XpMQIhAPNDwxUUsW/XJHZZMoUStYkWQvDrJheUl0GXo1dakL3D","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1224763,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkD2HsACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq0DBAAkvAKCJjOVlmGQARoz3ZqButOLPGy4n9UDBIJgic72tL5Obsi\r\nEAy0CNqzjjdF2L4m+2fuwNMzd8KHbULx3oRoqqNJ2jYuhs5JBNhHaaZmL8f6\r\nRkx3ogHi2q62xDoZ2/8OprBBrixaJkvJYp+kdkGQaWy3Aivxdubl+MQrLZ9m\r\nEU5nr5/uunExICxnStAt7iQ6ExOO7obqeyOoiPRcce7YVACFCHkkilGUfG5q\r\nTxX3ht2rU1W7eveZOy6TkTF+i/cq39tdJFjVOxH/VULUaLqWck9C/BEC6Ja6\r\nYM5/om15v6ee6UnRKd3Nk1mjqCPAJNiJ+n7Ski9qPKP86RSZ3fHflt8wISw5\r\ndyLZxRKOolqtonagfTx0RcDhf2QP30vpny1gnEVRixnRWEVjfmjZ9Hkblcv6\r\n9Y6tB9+xD22LxOicngt255THg1tWRZbkjuWks/9CXwA2VhKTY/gBwNGFWqNT\r\nXHrW2gJ42oVKTuNsZVDYpN77CPttyA/ZONDCDx7ZZjIZPfkt/MfAgmm4CUKa\r\nh946W6VVHe1IEpaRWr7XMzaL7pxBMqei+ICSD43vLwJO0uc5FtRs04M2QQRg\r\nfwduYb7NgXdA84h6dSV4wEkf954SS8rV53wgYcp8cIrfMPIVgK6F8Cy4utfx\r\n68ILzregd9dzOACbdF1SyQShLqL/nE3mPNI=\r\n=96z3\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\">\n    <!-- ... -->\n    <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"d30761453fd80caeae042d8999af672f9c3eaa28","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.6b5ffccd9.0","@material/rtl":"15.0.0-canary.6b5ffccd9.0","@material/base":"15.0.0-canary.6b5ffccd9.0","@material/theme":"15.0.0-canary.6b5ffccd9.0","@material/ripple":"15.0.0-canary.6b5ffccd9.0","@material/tokens":"15.0.0-canary.6b5ffccd9.0","@material/animation":"15.0.0-canary.6b5ffccd9.0","@material/elevation":"15.0.0-canary.6b5ffccd9.0","@material/typography":"15.0.0-canary.6b5ffccd9.0","@material/feature-targeting":"15.0.0-canary.6b5ffccd9.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.6b5ffccd9.0_1678729708537_0.968836911700141","host":"s3://npm-registry-packages"}},"15.0.0-canary.1c8013f4e.0":{"name":"@material/slider","version":"15.0.0-canary.1c8013f4e.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.1c8013f4e.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"8ed95477542b8e41a3be88ef26ba064757f38d71","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.1c8013f4e.0.tgz","fileCount":37,"integrity":"sha512-LPfFWp9EZT1F2egRDLgE9GdmH56G/Khd/NKDZeyObI/2UmLYRZZ1YjbaizhNmBJtbSgeRXId3FOrdBGizVYvUw==","signatures":[{"sig":"MEQCIGEsdLz8lyqt4A7SqSpFqXQv5/lHGvwQpVdJbLMAJy+gAiAhoKffP0bUVSo9gdpLxHqdT0AxcKVKQT3gyBUE11B//g==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1224763,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkD2WGACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq9gg/+OU3pPqYIQzQF8YHW+faNqrzap1ovMdsKkpMQ/5gk/O/ZDPXS\r\nV1EaxggtClQzqKhG3L9c3l4PpNm/jnBFOSE3IhiwuL2UIWJqpi0NboARAyd/\r\nQD0DS31ydnmyddV5MxvtEfQ22cQgkhHvw4490yYTB8DStdMBHx1iZWJsqeDX\r\nH0x/WfYYQOuEGzqSZNJ6rAl+X8BEDFEsOYAajfowEhJTXOqDUQDZ5REYvXrA\r\nwOX0NpFyYFWQ+I8yRKzqCCP8qJrivAEBO5w4d5wZVr+oP0jMrdBzus7Xh/CN\r\n4E+1RNcaS0QVLClRIFdMCQf775aJj2d6XuWPrazqISRywjxcaqu5DYxIj7yk\r\noAuG8IG7/Q2aiudWDymLF4d+oz2qwwk1PXu1Gektb3a/L+B+9vsJoj/RcHdw\r\nuphlxkQ/MYRXfY5QgeiHbogLh9E7SElX1DPgnOqk5IIPizAwF0yI7mQHULUS\r\nYiebSafjSmiwjE78cOWiZV7L6smMXD4myeg0OOi8kOuRDtWr1xKjAN92SG5L\r\npQYCQegc31zLvErah6OH+yTtNl/KoUTduK/676G+kZhlQljQTgThiDh3EXdG\r\nfDYENP27l311sHq+9Aq+TS+iqjwECEZcZIKmvV0z8u1NKFk1ksK6fUspmSnf\r\nKdjb8Lp9BwlGNKflX6wGcm7s0x5h/o8T7IU=\r\n=ASDQ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\">\n    <!-- ... -->\n    <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"ce86f06ff0c2637e8cfa4965aa614efa6bb86046","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.1c8013f4e.0","@material/rtl":"15.0.0-canary.1c8013f4e.0","@material/base":"15.0.0-canary.1c8013f4e.0","@material/theme":"15.0.0-canary.1c8013f4e.0","@material/ripple":"15.0.0-canary.1c8013f4e.0","@material/tokens":"15.0.0-canary.1c8013f4e.0","@material/animation":"15.0.0-canary.1c8013f4e.0","@material/elevation":"15.0.0-canary.1c8013f4e.0","@material/typography":"15.0.0-canary.1c8013f4e.0","@material/feature-targeting":"15.0.0-canary.1c8013f4e.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.1c8013f4e.0_1678730629728_0.517639879707233","host":"s3://npm-registry-packages"}},"15.0.0-canary.112715df5.0":{"name":"@material/slider","version":"15.0.0-canary.112715df5.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.112715df5.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"057044e92553ce3b2a8b69bce414af0939a2a033","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.112715df5.0.tgz","fileCount":37,"integrity":"sha512-bTjQlId1dGHH+BzfG+74e9w7ehFvpTTQLjL6nKH5tc2jQ1sjifFDQ6phlVS1+UwHPkXZaxDkUla1GCxiKP8gUg==","signatures":[{"sig":"MEQCIEc2XexEOF9Brp8ZWx1HM9qjaeaHvecZ/mL5Dozxh5biAiBe72Eo71aPgXo8XRyUuHo+6MdH2LBkY+Upyt2YdFcLHQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1224763,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkD24JACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqP+RAAmIcHzEShit6HLM6G6y0nUZSuJrZlPFaT+7oMPjCYI4qzlzlJ\r\nkeXv446lBh/o6ycb918Fk1GksJZcF7Syr8tKIl/kTnNofzvUpJ26qGnLY2CC\r\nYeahYkgqlRYwPng9pwuFKI6CGhh6nFQ2ISZmTq6eGlxZ070WJQIgGe0Ez2gB\r\nYjqVX/PuMQVtrfXoLAa9upsYLfb7H/qv80hkukDFSxQS8tLVzkl+XepqZP6t\r\n18jT8DZ2EuXRNnFKI4I1wY2qcyXspaVwHl9G9dX/RaZNYbzUaX6tytjGtvs/\r\nFr7/KVr1gjPxrNvjP3q/F0kop2aGMp6xP65t5+con656q0O4mzlWTfLUpmWA\r\nggMWHHXMr7I4qqmuKJvewVDBwJkBEOa2Y5gWh05zUiLlPWyeVwRcgOHOPOyl\r\nLy0CXKZKDNWJ6NaaRh2CZ0KlUAjf10PbsTfksDygpSc8F80gbSw8jru3nzH2\r\nUml1rfJT5FMPRdZzCdY8YvZIiF46t7NFgHQWQKuryyZOx1tDOmRNkSQVJgvD\r\nyIzx0leqIswv73fE/EX1gU97xUf9EC9iguKlhsYK+0ypKGLvL6lCz0HDcHcE\r\nl0PYnFAkDoG9wY3/yaFZHpakTQjtDAFLcHjkqY/3bwpGxMrKWfU7dltPr4aY\r\nTGcCydOogXnA0X/chIgzsR6wSe54nNQflXk=\r\n=u0AT\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\">\n    <!-- ... -->\n    <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"3894873450b9dff1b92031fcd1d00ed1ec3ba9ce","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.112715df5.0","@material/rtl":"15.0.0-canary.112715df5.0","@material/base":"15.0.0-canary.112715df5.0","@material/theme":"15.0.0-canary.112715df5.0","@material/ripple":"15.0.0-canary.112715df5.0","@material/tokens":"15.0.0-canary.112715df5.0","@material/animation":"15.0.0-canary.112715df5.0","@material/elevation":"15.0.0-canary.112715df5.0","@material/typography":"15.0.0-canary.112715df5.0","@material/feature-targeting":"15.0.0-canary.112715df5.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.112715df5.0_1678732809146_0.39277653240378263","host":"s3://npm-registry-packages"}},"15.0.0-canary.d250911f2.0":{"name":"@material/slider","version":"15.0.0-canary.d250911f2.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.d250911f2.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"dd789b64e904340ce0832b18870cfcc7d43577ec","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.d250911f2.0.tgz","fileCount":37,"integrity":"sha512-tMW1TXyOmQrGZlEcfRvB7ZiY12jxXSMjnCFbKrPXnuUq+ZP+geZxV2HlPAVvXtxtJBJkQ7BBHk9ZTeWDtgK1Jw==","signatures":[{"sig":"MEQCIEaPTpx9Mm3GUhpVHj1mhgszvSMMPwXQj9tXiEXYW337AiBCZ4j7bBD5sC81B40frjPuqO7O/kfVNsM9ujcB3oAfEw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1224763,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkD3pFACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrEPA/+IB5irbdpFtQLjGNFxO8fgFspZm1Z5JTkU7Ez9YL1IWY6YaYE\r\n1bF3Lm8W3/0ttq+1hsrYfyMhl/fbSyxtaEWnf9gPrw6BKLHRRqW3XOYg2w7v\r\nGAMYxHvoMbWkWrBLDAigp04eVeP5vShZBIfH9j/W2q+pf9Uo3b6yS7CGzYIa\r\nk4Psxm1FheDQyvRDAlcUDYBa6VLpEbycA6LnsPW8Q/xG1UCDXbjpBTkZdtgP\r\nPeolUNocEd39kbLnuXJWZ468Fl6E1wbzYGNFXQ//fULXC+oB7scqQnRckeTk\r\nadhJFohWSqMQ/wLdDe2OS113PBBeMpGOl8LqorjiSNXe365yxtHMQEzG97iD\r\nhpNZVJj+HWDnfgAd/bovZs8QLRdpXmDxoYRKkKm7FdTFaV4cgSV/qO8WpENB\r\ntPVKhvP5rDKEF1zH9x0GVrvm3FXxUWQ7ynJnC1a16b8EquiRLz9Xj2DY5j/v\r\neRdGm1B4sJd/S87dVusiqMReSbzwXLkw+hJVklceh2D0o/3Miuhe5bJ8426O\r\nuHkYmN1M1ihmnUTO3N91vD4Lg3vq2ME1+mCceddDsL5mW82j5ub0EwYBSahL\r\nr+jdMzLYrYG4fIzyJp77ebG9+YAqcgQzdd0fs/4fl4tP6+9v3jaRBEttFqvJ\r\nFAoGQjUS4r65z0dN5gK8ousZllvZENoMUvM=\r\n=0oW6\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\">\n    <!-- ... -->\n    <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"7b4ac246b31922fb4beb9ed168dba262e499c271","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.d250911f2.0","@material/rtl":"15.0.0-canary.d250911f2.0","@material/base":"15.0.0-canary.d250911f2.0","@material/theme":"15.0.0-canary.d250911f2.0","@material/ripple":"15.0.0-canary.d250911f2.0","@material/tokens":"15.0.0-canary.d250911f2.0","@material/animation":"15.0.0-canary.d250911f2.0","@material/elevation":"15.0.0-canary.d250911f2.0","@material/typography":"15.0.0-canary.d250911f2.0","@material/feature-targeting":"15.0.0-canary.d250911f2.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.d250911f2.0_1678735941127_0.48945746300771464","host":"s3://npm-registry-packages"}},"15.0.0-canary.7cd925c12.0":{"name":"@material/slider","version":"15.0.0-canary.7cd925c12.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.7cd925c12.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"d4f7d5998ecdf1ff716e8a88dc40508056232880","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.7cd925c12.0.tgz","fileCount":37,"integrity":"sha512-BLVpHrgIfn3I0AMYY0IGC+YyhzquzwdSxaI625Dv5g/ZtbNZUKIugdWxLu85FV8eNQgkkLe/y3vLKULJX6d7tA==","signatures":[{"sig":"MEYCIQDdGLGMPgRYrZeKlbxuQJDmkmSV7JNu5WrGx6GWAPcWkwIhAKh+UoWSjye1UZpTrIUEMaxKQhi0/G6mspc4gEoK91t/","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1224763,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkD3wQACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqGuA/8CqRh01UZRBNEBtNiIpYo4Yan6ljWr6dswyptAm6JtNaXXoKh\r\nSHt2FwApXoXCqMkTBD8iWk+9kJQyInqrb8J4DbcL4wbtQW+mk+2OBB4rG2zP\r\n7DaeCdUwjPiwk/QxyHwBo8UOLnEruKQJ8JVla2a9bp75e2LQwGR3vZK3H/jf\r\n9pcw/7psUFjTmUf6keCdr3NeSN5uv34C3PYxrUsJH4MlcZ+/XpRgkkbZ16Mx\r\nQ5G2N2YiFUKy/3atgUTQU5Locg+JsvtJZFNw6+diveH+vJCrmydcsKZeMg9w\r\njLLB3DKbx5LbAJTD/2vw7u1lsekP+qvwSd8WZrV9irrh23tA5BKYQBGEkwoq\r\njT8sxfebbefqQ8WjJ93w4Zfr9ry6XQOX6DqNW+0936DAMQ4Y0kRP3c5UwiWt\r\nM+BnV6HkaebSzOUxLPrslk2+lhUsEaOSHwBQ/W2GB2vmq3u0DwYonWLJQFj1\r\nIKLg+78uWqRwrNY13Z3XCKTfxTGVpCNMkcHH2RiFhFDrYKSQ1vtm+Xb1cjf2\r\nMfsAWQzQU2eSQCvkcwHBjm2x0qS5zSaGqX4KdWacwI8Ut/DBNxNjGih/G5MA\r\nKxEBLB6zo1UkGH7RbST88kXXDlrj5ukbPvpQRCHYoiz6D7zdgqKAiNgDyPFu\r\niwInsMNVUYbUBbXw0yDyhwt8OnAx9OWCyDE=\r\n=nPB9\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\">\n    <!-- ... -->\n    <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"96310a5c80e3e92695b6d6e2933e9b0c82e58a20","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.7cd925c12.0","@material/rtl":"15.0.0-canary.7cd925c12.0","@material/base":"15.0.0-canary.7cd925c12.0","@material/theme":"15.0.0-canary.7cd925c12.0","@material/ripple":"15.0.0-canary.7cd925c12.0","@material/tokens":"15.0.0-canary.7cd925c12.0","@material/animation":"15.0.0-canary.7cd925c12.0","@material/elevation":"15.0.0-canary.7cd925c12.0","@material/typography":"15.0.0-canary.7cd925c12.0","@material/feature-targeting":"15.0.0-canary.7cd925c12.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.7cd925c12.0_1678736399817_0.2861790780718889","host":"s3://npm-registry-packages"}},"15.0.0-canary.b2ddacf73.0":{"name":"@material/slider","version":"15.0.0-canary.b2ddacf73.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.b2ddacf73.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"c36288af72a3e2b0861192d1eca811ec651f9abf","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.b2ddacf73.0.tgz","fileCount":37,"integrity":"sha512-weyDKp2Euxa8mcXEroRKY3CScNI1L6jZ22Z/+xCPECZ7D0Iw9Os46jQqduQqWmB4881NiJR3K8Y7bdeu7miFuw==","signatures":[{"sig":"MEUCIQCQlJWTBnunOUxzXMKZM4cD1lBpTFaqQQBvK/IAgtn21wIgF4hMVzVk9eg+pQmcvn7hoBwOOzhkdpNHicLx/jaxbFU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1224763,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkD30TACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrxaBAAm2+ANVi7pa3AyJeIvjAJrvec6OSwgSpu2DN9S+wgkPJ8yPBS\r\nNAKBoNC7gjqW1UtPrD9V1XOC4FUAimE98v/qi6dT0+iKG9VP5oW/of38d17d\r\n2AdPfOTAb+kvGVjRCY/o2HZGHeCbt7gV15wUtqloQRVZcVF3KASTRtpY6bIc\r\nHZzN36JOQeqa3jkJRIz5+zzOMf9IfzzSCV33bWxk4gMQnDUatHOPYMQA9iBp\r\nF6uKaCBxGgDJSCUxvNwECKlhc+T8opmF4g5jxVMfWM+4lzXWPn7xJhCXjGUL\r\n2r7RS00hLe5V/J6wJD4mo+NWKidplVL1UhV/7PMSWOMeIRMXkX1V30R2X3YS\r\nii/S/p58ItDvsNWQSdIDSbabsXDtvutV1j+t/3mte8xooRUvM/ISCXZX1sK6\r\nNi6dAfQMZ0XE2UeUbEMyfFZt0H0uo9+bgUyOfT8SX2XmSN6OssqmDMVx/KNH\r\nXLmSBDRQNitWKaAB0xvUqPSL6c3WBykGGODMYQxSv7RNqBn9ALHNrPmW7o+y\r\nN/z92WtVDoSeFlQjXoDAcEE6WeLddQdRDdfpozFyLr+euAxcLo+HIHRMg7vf\r\nbbmk58cb4wfnukXQmOxwnxGBwUhpImNdsvef4BpGvO0Xv+pjMGKSmMZloIir\r\nEpT8wz6Ag6Nerp7m3x/4MCJnNO7aJq/RlIg=\r\n=Plqv\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\">\n    <!-- ... -->\n    <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"860a6f0b439760b894931fa6cb354412764bd21f","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.b2ddacf73.0","@material/rtl":"15.0.0-canary.b2ddacf73.0","@material/base":"15.0.0-canary.b2ddacf73.0","@material/theme":"15.0.0-canary.b2ddacf73.0","@material/ripple":"15.0.0-canary.b2ddacf73.0","@material/tokens":"15.0.0-canary.b2ddacf73.0","@material/animation":"15.0.0-canary.b2ddacf73.0","@material/elevation":"15.0.0-canary.b2ddacf73.0","@material/typography":"15.0.0-canary.b2ddacf73.0","@material/feature-targeting":"15.0.0-canary.b2ddacf73.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.b2ddacf73.0_1678736658762_0.9567204721851403","host":"s3://npm-registry-packages"}},"15.0.0-canary.989ae2ecc.0":{"name":"@material/slider","version":"15.0.0-canary.989ae2ecc.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.989ae2ecc.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"84da5a3d486c27b5b7c02fbaf5ee66e22bec6fb6","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.989ae2ecc.0.tgz","fileCount":37,"integrity":"sha512-vxvsiNu7znZloGSDIOlT7Ns1o5AIGAZ20NvNn68U0M3SI/SAX59YgB62JG+RiA9tA59XgxPqv92YIfiuIKOz6Q==","signatures":[{"sig":"MEQCIFQu2eKJbiokQ/RtDQS2IqTpeYjnWxh1MUSADlaqv/VwAiB21SlDsgBOYV+PIPaF0J4iky/uHr+tllSRQjEeIsioOw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1224763,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkD38+ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmowfQ/9GfiGjBKBnwjQNjbuunBgoLj9azgWjXQwbFnk5vtmlEwdH6ZY\r\nIMTd1qokRIRFvCfIogidch5qMXwjErc95l5y2khox23oqxdJYtbWWEenltcd\r\nSfYtyqEQ3sN7+RnycF4NzS24E6FaW//5CIvpfXFH3eLI9Z4hEHGlI6VG8LcS\r\npuH0Y3pjR0ZciDA7FlI5RAh8T48oHSboEubFti/nunMtdQ72yyL28UL9ieWw\r\n/boNzRIl0gPbCJ/kCQXBSN3fUdGSzyBPGxdrkeYnjOP1Hm9aXu2/hZ8Uf3rp\r\ns7+s2Wz2SpNeuhHz9gPXOoYc4M2zNXk+zT6FtOdEkP+krLVapnWKgmkUoAP/\r\nK6m5C06+ydMG8VmW9eq1RxHK3INEAMgjIUkotfKYgrh0ykdhmzFeRWPCkMbA\r\n2MGyxKrmQpZ/zNwtdirMB/QpzjpYSDw5jmtSLMZLAERPztNwn1CkJGlOmVE2\r\nYNIm+7s/m63sPSQzD4o2asbcrJTRnJGYcxzfs1FS6al4tUnInZ1RdWjocQY1\r\nMVBgZFrWw65YaEUobA6r4XU3HECTVT/qiNQEZ8ztZnH+eOm5s2h4ZxoTilVB\r\nAArTFwAVUQNxjiqACFTqXjeixt+OFQ9VheLCUUokarqGHTZpyb+ZBMy1vUf0\r\nlBk8O0DQVO294GNo65Ved9l5sSW4f2rY62c=\r\n=5dCQ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\">\n    <!-- ... -->\n    <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"52e0f05ff74ddff1d986b27e08df13644c056b63","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.989ae2ecc.0","@material/rtl":"15.0.0-canary.989ae2ecc.0","@material/base":"15.0.0-canary.989ae2ecc.0","@material/theme":"15.0.0-canary.989ae2ecc.0","@material/ripple":"15.0.0-canary.989ae2ecc.0","@material/tokens":"15.0.0-canary.989ae2ecc.0","@material/animation":"15.0.0-canary.989ae2ecc.0","@material/elevation":"15.0.0-canary.989ae2ecc.0","@material/typography":"15.0.0-canary.989ae2ecc.0","@material/feature-targeting":"15.0.0-canary.989ae2ecc.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.989ae2ecc.0_1678737213966_0.8477176063702434","host":"s3://npm-registry-packages"}},"15.0.0-canary.89c66483a.0":{"name":"@material/slider","version":"15.0.0-canary.89c66483a.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.89c66483a.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"63d6d9fb6e770ffeb1156bc843ea22580b9f6743","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.89c66483a.0.tgz","fileCount":37,"integrity":"sha512-W5ZODLU7HCT/51Sqtzc8PhM7ueLT4Rha2kP3bSwX+BiuyKtEPCd9rMvyG0CjttkhLMX+4gXHQLutP6KdOBpfQQ==","signatures":[{"sig":"MEUCIQCAeAtST7wB7MwMGJVAyIJJW5wFt+kvjWX/bSlXGpJ6pQIgB+LCZ0FNjH4yaFuRBQ9OQ4o3C6DMM3QcTu5ev8iqWhU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1224763,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkD4TOACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmo8ZBAAhRMZWKrOS63lxMkdoZUVVpAD4v1Um7lXDjMYljUimXUmaLTV\r\n0pwzYa9hyWFsJ/t7bGpncbZGAYClOTo1J1IcS1J7PfOYTZPc0ABgx84VDpqh\r\nCSMfKvN6UFfXcdmp2TQLmyqeg5xMOMt6+1ZOn8/o+XNtJSH2/YNeIYqllKhE\r\nk+CW2tY6baf39L4acq7r09csU9EAAZQ5EBOrK0SER5YWdEP9uhmzBvMPMwB0\r\nNxGeu+pdhz/qsdl38RtczjB+rpqORVb09sJ33e7HlASD8OaffNl954aC9IGN\r\nXuceSMk+bzZt04biNSx0X0izlc+nRZDsbnfG5fX4svJkCyQAbLqsW+s7u5/6\r\nUOE1mG4sJvgs7LeCNK4zlNER21DLe2egeeOnyy0yM3wD1B5pvs+AKdx9jyvN\r\nj0odx3vXOoUhz0Yh6yHBRGfHFhFLzIWlWfSj7slmGrhD/OHrwwr4vKcT7/IA\r\nS6zFNyssZ57wsRBpBAqhgC0TutH0zTCf2OiY0Q5BkIDRAD4QR2pxazXihhhL\r\nPp53cv2lZ5UtyxO4jQ53ydAaBdXI8afOpI0U3u5oDeGFx9mdF0tAWR+K+cpr\r\nDWWvz5hd/J3DFli+n/7S3cF26v2vm1uXMZ7v2BuWXCQFv/cpBglyzSJ6d1v7\r\nwW/Wr80Du4XSX0Bvx/NRpfFl3IK8zpctDdk=\r\n=I0e9\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\">\n    <!-- ... -->\n    <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"1e255ddead4716271020e03e9b0b302eacbc4153","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.89c66483a.0","@material/rtl":"15.0.0-canary.89c66483a.0","@material/base":"15.0.0-canary.89c66483a.0","@material/theme":"15.0.0-canary.89c66483a.0","@material/ripple":"15.0.0-canary.89c66483a.0","@material/tokens":"15.0.0-canary.89c66483a.0","@material/animation":"15.0.0-canary.89c66483a.0","@material/elevation":"15.0.0-canary.89c66483a.0","@material/typography":"15.0.0-canary.89c66483a.0","@material/feature-targeting":"15.0.0-canary.89c66483a.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.89c66483a.0_1678738638506_0.756680798649985","host":"s3://npm-registry-packages"}},"15.0.0-canary.6a85742c2.0":{"name":"@material/slider","version":"15.0.0-canary.6a85742c2.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.6a85742c2.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"6462c76cfb9426251aa7d7d95a89926049863203","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.6a85742c2.0.tgz","fileCount":37,"integrity":"sha512-bqEJFX5RZXSEwUuChRley6ri2vl+ZBKCYoVkbvEDMcfIiGt64fG2LIvsg+N+FWUXtvOth8uXfUA/LAseHYScSw==","signatures":[{"sig":"MEUCIQC66QNe83nnXHzYCj+OaBYv1Asc+TKxpPKB0XB5sB3vFgIgBFN5o61anjm5euHhBn9vn5u2imW7yIBb/8jspTJFCXM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1224763,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkD+BtACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrpsBAAhCG0thoRkwnlWSRb53h9ddjDmcxHNKBbC9YBTx9HO1ZSp8dy\r\nrtvOx95YHxv1ojfOdvEfQIgU4lKyd9FPxDh/FLubWd4SrGEiksFFhlCSNojy\r\njtlr9PQ2H8gTs38du4s8VcFvzzkP3UbDBALXLcMEjqj0tqbsLjNtbZvPvVpT\r\nYyKeEVO6cU0LoDv3ZusNHYnPIkbjogdwKlWlo8AO6SgWiLFqO0z3ShsMRchy\r\nJtgSj8T/3hOd/B+Xoxt2pTJyoGjbfIhqPFx8YHoIxWUDM6cPI7LfuqSkWV2v\r\nq9bwEWKsTiJ69XJAaPaqe6WcFLPZFjr/J7f9TzjASrArWbt63n21CYBF+Ena\r\nNaCF7RR8tkCesppJFco10TTtCbgM7YuLixhTv9UoFL/w/NB5Fo/T7PoQEEQh\r\nQlfggBz5ObnDZqp5GmiRUdFIVHQJm1zjK0aKeD4G1HDLb5rfoYBeYH5XDq3e\r\no9x2x1aDSEHCkgyqhAUhAAAXosPbXHELQed450kxbGu6vonfD4l1NggR/VsE\r\n+mCbEni0Q/sh7FYHeZ/v1qmRR+PJZoZfZfGpVmq2y5Pgs/OkhnEnzd3rR2QR\r\nRNze/HBw4tJAGAxAStwVFyNToZHqLUadfHYW3Prw7YS3ilOrGlFjOVptjKKi\r\nVjYlBjsAZeLfUlMA4sZlj0Lzgkj1RBzY35U=\r\n=Hj7E\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\">\n    <!-- ... -->\n    <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"a2a15aaa59054337e585758eb160d9cab97224a2","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.6a85742c2.0","@material/rtl":"15.0.0-canary.6a85742c2.0","@material/base":"15.0.0-canary.6a85742c2.0","@material/theme":"15.0.0-canary.6a85742c2.0","@material/ripple":"15.0.0-canary.6a85742c2.0","@material/tokens":"15.0.0-canary.6a85742c2.0","@material/animation":"15.0.0-canary.6a85742c2.0","@material/elevation":"15.0.0-canary.6a85742c2.0","@material/typography":"15.0.0-canary.6a85742c2.0","@material/feature-targeting":"15.0.0-canary.6a85742c2.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.6a85742c2.0_1678762092774_0.41966223266911595","host":"s3://npm-registry-packages"}},"15.0.0-canary.bb6cd78d5.0":{"name":"@material/slider","version":"15.0.0-canary.bb6cd78d5.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.bb6cd78d5.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"aafa264baea8a84cc8b5090f7379f1b092079aac","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.bb6cd78d5.0.tgz","fileCount":37,"integrity":"sha512-mZ+2l1WkmrfOxxcaEbl9+zBd04GdwscTBDYYPjDZJ/6kp9AFeoj7zr80eSjUdkVUiT5kGyCxuaDLIWX2Cc0dNA==","signatures":[{"sig":"MEYCIQCUlJRyNkqrQANeOHke7QPB/KVIzEjdeXYIQYIPV4agHAIhAMMDYPzSOQ4WyihCj4MlXVZLOatwt89espTADkUsWit0","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1224763,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkELpKACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrbNg//VeqyplE3tCscg4ZxNvIkVS0UgIKtVHJNTFSxQ8xWskpWHGRf\r\nz1WgM67hrbopkiDlXjfZvxKrHFHNehEB/Fzopbk3Gehi0rVnJyUu7EeF+Db0\r\nJHF3aKtt6nk/BAmibW4b4lNcT4qGzTIbkW5y4qwHeNMHlm2O1tdj97m1KTuw\r\nyv012+X5WhTWRYORr5DU6UrmU73kgVpXgyU+mCPfDM27D3Ili4gCVYqALcoN\r\nnBlRHAUou91ExiMzCfYe8YdTK1LAthYrp9Q0udQnBPEqs9CS/bmAU2TFI3r/\r\n8h0jz5G0pwHa2sAWfYue+LlVoRTKBVHxmYoyajUFHtmun4N6VzFIKo1aQ/N6\r\nMFF9wrLIIDZoIOObpN/BX0Jz7CrbI3PbXU9my2WuPJCM2jQJhPHg2adC+fKM\r\nsSejR51qrDf21A9UxPhp6BKfsoNMqKbGClRLEkDgXpuuIr/a+b2rpf+yW6Zq\r\ntHncNmFAPtWVs8t6l6KbTI2O1QYjXejFnjwYoIjiS7mYdU2JqPhxRT+VsLo+\r\n2tk+dztVMiEtmKN+PeQ6DtWSaNJE9leMNdJsJYlILn3JprWBgZTUZoJPD6nk\r\ncQjKgGsyIjboYAY3iQ/KsF7HFTXLP+A8Tm4/neXXO8cHHKQBNo8Q59kEm0gL\r\nE5B8N6HnCpfbo4PZdiucBiwMkPPRyErFtDI=\r\n=5PjX\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\">\n    <!-- ... -->\n    <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"fe016d599b297e4e276ef5b37b829b25f0607b93","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.bb6cd78d5.0","@material/rtl":"15.0.0-canary.bb6cd78d5.0","@material/base":"15.0.0-canary.bb6cd78d5.0","@material/theme":"15.0.0-canary.bb6cd78d5.0","@material/ripple":"15.0.0-canary.bb6cd78d5.0","@material/tokens":"15.0.0-canary.bb6cd78d5.0","@material/animation":"15.0.0-canary.bb6cd78d5.0","@material/elevation":"15.0.0-canary.bb6cd78d5.0","@material/typography":"15.0.0-canary.bb6cd78d5.0","@material/feature-targeting":"15.0.0-canary.bb6cd78d5.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.bb6cd78d5.0_1678817866230_0.9259913104255162","host":"s3://npm-registry-packages"}},"15.0.0-canary.5f94aa37d.0":{"name":"@material/slider","version":"15.0.0-canary.5f94aa37d.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.5f94aa37d.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"a9497b11c5743b217f35f986bfddf01e9f09430e","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.5f94aa37d.0.tgz","fileCount":37,"integrity":"sha512-Tj/rzunhjnGSo6sCexvSLrEItk66fAJsDCKz3UFhx3foqganwgoshuSO1KlL7zfsxDFATyfVY+QBSpPQlDVQCw==","signatures":[{"sig":"MEYCIQDSIztUMyDZKMV+vmkuj+I5P2BUPVNO0lt+nLDf8QinawIhAPmWqev5BfQOEszU/A8drkCeYsfTKkpfO7ICiuMqlLRd","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1224763,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkELsPACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqE4BAAiTI7aT/mmp4M8fdfINoNVuT5j7Rd+WaKd795gooOF0lJTBe5\r\nBW7UTiygg9PKpRcHvlyoUhV+ir3ctByPjliA75ac5SEEX0vwLfGCCnSmnl7v\r\nq9St3tGy8e0IUihL2Yz8LpWYwxFr2SLflsJ6DoUKHUT6AbQVv5WxRBrO1v7h\r\nBfG1Myae5gMhLonkpeXonTgswEVWdrBXbi/AxzUKdmRskdHmzMvB0gh3z529\r\nWdiD7V7dLOgXJcZqnyAZldB92hl53BFtZ6Hq5LhxF/xiEN7tW75+tW0syRfU\r\nV1n6uHuM5YHSltGqAeb2Ml68fqrDB03tOaMIzLMSX+Pn4LJ9vlxuWMfACsgV\r\nAAGp/fnQ+a2zthKRShHJFoUj3Zgl0Sl0jz1O/dyxmAAPDjP9dCpnL7FMgxDr\r\nOWTPurlEYSGBpMJkF2R8TenUsRI/6wCM8SXOAZSrVqfCZQT3L8I/Plh1gd/m\r\nLa8YpmfWzW+Oredq40GNuczPEjLQ1v4Bk9yrfVjrm73yNf7J2Xl1CMq770ED\r\nw81Wy8bHkH1hduSVBAI6iO6jdl2DL1T1bX+7/zjTr7HPP8DMYi9kAAE44EEV\r\n732lpBZhTKT/nOXF3Q1L/+sT8UzgMQ22Z/TLCA+DT+4G5/Qau1lsQF4iqE5J\r\nAXW5WBiI//kRAddVY+RdMkTa3hVMTc7mXPU=\r\n=QahP\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\">\n    <!-- ... -->\n    <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"95db647ce856eab6b1eba2fb1794f3b0dbc3dd08","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.5f94aa37d.0","@material/rtl":"15.0.0-canary.5f94aa37d.0","@material/base":"15.0.0-canary.5f94aa37d.0","@material/theme":"15.0.0-canary.5f94aa37d.0","@material/ripple":"15.0.0-canary.5f94aa37d.0","@material/tokens":"15.0.0-canary.5f94aa37d.0","@material/animation":"15.0.0-canary.5f94aa37d.0","@material/elevation":"15.0.0-canary.5f94aa37d.0","@material/typography":"15.0.0-canary.5f94aa37d.0","@material/feature-targeting":"15.0.0-canary.5f94aa37d.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.5f94aa37d.0_1678818063126_0.23667054965929868","host":"s3://npm-registry-packages"}},"15.0.0-canary.1bd317240.0":{"name":"@material/slider","version":"15.0.0-canary.1bd317240.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.1bd317240.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"978423b2a76d66621f34734078be7e2dbb9aea65","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.1bd317240.0.tgz","fileCount":37,"integrity":"sha512-q2FZ8sbM3FyPTBNSh4G4k9S8yLCHtsyMDZ1MgzRmBmhSmILhNd5tko2itfQ4DaySsIvE54QNzDCzIy/WnNbFUQ==","signatures":[{"sig":"MEUCIH0rF824Yf7aH+leBOxtuTXVkYx49OfpdGR7PJZycZ6jAiEAgI906DUljy756IW393EiaitM2/sFkA9LmvqmeMXRXs0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1224763,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkELv1ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmpliw/+NVxMC/HpmBxt6rZnbxfgagtDyeavWfAB1Qvfu1nagf6GbApr\r\n8N2ZWjUAKESbr2mLv4GPJKqrVHYITCdZbMBxLg/n4ROYTiyhMXq8xParlpp7\r\nfQ/nt3H5J6wa/tns9y20pWDCDyfLjNUz5Kt9GsPQw0BQQQpTanuEAahJ71oc\r\njAJbnpkOOCjoxIdVesF2Qu6ADhwbZ91YIaQxnnDZL/MCvHx8HF6fGjHILbF8\r\nCMbuFSxWPu7GDt2ubuIx4jyexxhZeHhUB5Jpv/mWwVTAyzW3KaMxlkp9v3C1\r\nYQYgHrHNcVigZJTMj1c1qfJfj1Lob1r63JMb/evyNh7WdydslelnbLVnZqKs\r\n/pcgSK3sIZU6NGVwFvmhzhZu3qc6k7SpMcHp8xCtnKnGDGbk/q2DF64hSyjr\r\nKtz1nFc8ZeDQIJyHm2OuiWiinVsiooH+zyk+AeuLkV/MgcYYNuT3Yl5KGql/\r\n0E+JYKGdbhp9B0hZeR3BHFB9uAQlpmO0Zjod4lcoz3zSqzq1SC9US64kZZQp\r\nDTr34GLoROi60ro/4It7+8I3OXueaD18VNPcxyLmz4q40HDFMahTtSMThcW1\r\ntyjxrPm2O90xjYe/0BgSio3uniaS/xaRIKx2qT6xuE9komwARqGjCd/M5zur\r\n0nfkqs/tYsyN4B3/V9I5v3QjJpQbhiQ07xk=\r\n=xf8Z\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\">\n    <!-- ... -->\n    <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"eef3d63106c71dffbe823b04d07e86a84dfd4d42","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.1bd317240.0","@material/rtl":"15.0.0-canary.1bd317240.0","@material/base":"15.0.0-canary.1bd317240.0","@material/theme":"15.0.0-canary.1bd317240.0","@material/ripple":"15.0.0-canary.1bd317240.0","@material/tokens":"15.0.0-canary.1bd317240.0","@material/animation":"15.0.0-canary.1bd317240.0","@material/elevation":"15.0.0-canary.1bd317240.0","@material/typography":"15.0.0-canary.1bd317240.0","@material/feature-targeting":"15.0.0-canary.1bd317240.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.1bd317240.0_1678818293591_0.8227935067754133","host":"s3://npm-registry-packages"}},"15.0.0-canary.d441d2a2a.0":{"name":"@material/slider","version":"15.0.0-canary.d441d2a2a.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.d441d2a2a.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"5a876acdac14870d40f0d06da3e4710d17fdd3f1","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.d441d2a2a.0.tgz","fileCount":37,"integrity":"sha512-ho2whscNtapZPyLEWM11aJESpb3PLAcQ5r+5LuITF6FpmqrUdFfxPHGT7i477BoM9u/MWYrA/F2rIgoW2+8/ow==","signatures":[{"sig":"MEQCICVcBeRIiGbomqAwixaztW75hjUQDa/UA5rpbw5KAOgDAiAHWZ7d3KTg/k5y4Un/WknhjxFayiIXYPK4+teFySfT8A==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1224763,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkELydACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqkEQ//XPQJU0DKRyfPitc9FpaUABQm56M/Addrc1RIPLEKTawrjn79\r\nzIE6aDTPDL38fN1M3Xg+st2e+Pa4T6OHUt69ESVNdneCYhhqIFGnRXAq3mbK\r\n0vckBrbmNzZK4hbF8/voPqoUEHu6LqmP07bMzY4h6MspE6X3GznAv86SeVaV\r\nGBkuFWWxB8qrQaiNgcJQxS4G73XyFCKnZ4kizWiT1ReTjTf6s8jRwdKs/edZ\r\nSgIIDuvZFXQ2WfNk20bxEFYTQ5z+PccBD2H7uKabiVsodaB6NWCd+GkPjw0l\r\nXUmJfQHJTVog+YWoLD0sqvWvOOTkvSJ57BIkP1IqCDPL/X0sk+1L9fcnA8fE\r\nAANSLd2f4jIfuDaBwmuhEFMAtAgFJFSWXmcQsA91D/RBSY3kIZFIorwL2HM7\r\nURuKAdOrcxFfTLqYkFvoCFxGs/ZLtzlFSURFALLYPRzzOKdaqY//8M1rrPdZ\r\nQtAUcakOXAy7MHdl985fiQ5pQLYTM2kvnq85D9tbTCLwnUAJk4/sL3ef7VrC\r\nijdQxbjtOYpZqzhmv7e2SDN3P/eNg0//Rgd4/a4wlEeYzO8OBQVyYaZJh1Ce\r\n9v+vkZ4HE/bVz6Q9NHALqy2kTDKiv+45xPtkVqURGFtrvCBFhuAva9uMdbKI\r\nKJnmR2hU8Dq0NMAG95U4ZWUd/2KWLNbPfNk=\r\n=pgAH\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\">\n    <!-- ... -->\n    <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"3a1d95c90b2fe34c5c04e44571f94badd66748b2","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.d441d2a2a.0","@material/rtl":"15.0.0-canary.d441d2a2a.0","@material/base":"15.0.0-canary.d441d2a2a.0","@material/theme":"15.0.0-canary.d441d2a2a.0","@material/ripple":"15.0.0-canary.d441d2a2a.0","@material/tokens":"15.0.0-canary.d441d2a2a.0","@material/animation":"15.0.0-canary.d441d2a2a.0","@material/elevation":"15.0.0-canary.d441d2a2a.0","@material/typography":"15.0.0-canary.d441d2a2a.0","@material/feature-targeting":"15.0.0-canary.d441d2a2a.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.d441d2a2a.0_1678818461290_0.15913428079116865","host":"s3://npm-registry-packages"}},"15.0.0-canary.fff4066c6.0":{"name":"@material/slider","version":"15.0.0-canary.fff4066c6.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.fff4066c6.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"555bdb489e6d549e2a6a6f1e00ff331c76667944","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.fff4066c6.0.tgz","fileCount":37,"integrity":"sha512-BWPMRlDLL7cLxmUKSOQ0h7tt7gZr3/J6nodvxcD+TYH9hd4srh2W+Mm0BgQfq626w0q0HdqM5DVJL0LbZRstIQ==","signatures":[{"sig":"MEYCIQCIzo0NWTKSqmSVEcFMJ/XTQH+oGjNJtJd7fYtv8/jsnQIhAMD51xCXNicKlU5mjWDWXG4Jnhdo8xSeTfVsnWp+peo3","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1224763,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkELzDACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmp8rg/+L3chwjiPxwf4ZsSd3klEKS58liu3zxs6eHKobInfWvZ3/Mow\r\ngmANu/mwFQzaXzCm5dkLO6Uaw+E4VimT1gCgGIrYXy4bEDYvVc4R/lbUelfQ\r\nN/JZVwRzvLr9l28BROCuSvjvR/Gxw+sgXI43OvjLylEF1Wgpp6zgOJsI1I4P\r\nJw34uiy6cdjG8D0OwPlAJAU5MC3RTFZF6rlXA+iqy/Uy3tjYMBUAiEokY4I3\r\nTH/HEI+dSCiJ1nqze8AL11ych/RVgvWx1mTEEXNMqEuAZ8c6+6+EeWHd5rgs\r\n0r1Yxj1LZ+apNoxtXcP3dS3nmiDx6CyQKwnS5K/jkxgqRZUN1quuNqtPjwi5\r\n5yuK+z9spRucpR9lVx3BJeVZ2mnbcHb+nhwEzTnMMHnApenfPLua1vch3+SZ\r\nc+N7npoXN9d0YHfEPePe3esZ41il8uTNBb3V4fLB3XQr/SN/URtSvPDOZtBL\r\nmpB71WbjrnDaC5DoIHYEv0d5c32umd7vKWexQxAimvkaYfM0tklepD+r0xP+\r\nsQyI+y7EC1wFH3ReMbrAxdLZfgTu5acooElRf3a4FTICnNPbSnxLH7b2CN3g\r\nz1BEXB0xeKvMQpFoVl9WugmLLVBajGopIq/Tub5XB1Wgqo6EppJw/zP1QmGB\r\n9uIzrRw9V/IW480ibAM7x1jmNr7ms1ontws=\r\n=h5wo\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\">\n    <!-- ... -->\n    <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"9d24b185ab8c87061ad27f4e7791690a12e10135","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.fff4066c6.0","@material/rtl":"15.0.0-canary.fff4066c6.0","@material/base":"15.0.0-canary.fff4066c6.0","@material/theme":"15.0.0-canary.fff4066c6.0","@material/ripple":"15.0.0-canary.fff4066c6.0","@material/tokens":"15.0.0-canary.fff4066c6.0","@material/animation":"15.0.0-canary.fff4066c6.0","@material/elevation":"15.0.0-canary.fff4066c6.0","@material/typography":"15.0.0-canary.fff4066c6.0","@material/feature-targeting":"15.0.0-canary.fff4066c6.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.fff4066c6.0_1678818498743_0.0091844282910154","host":"s3://npm-registry-packages"}},"15.0.0-canary.87809c710.0":{"name":"@material/slider","version":"15.0.0-canary.87809c710.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.87809c710.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"c4a0d1ce6b7d2c87e1bb77a0dd21d97706bfdb83","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.87809c710.0.tgz","fileCount":37,"integrity":"sha512-N1e0sOECNsbRgLI9heQgLh0bNJlItvgrgyKMJhbZv+0PZmx/RC0Rue8LD3mKD1VkMi9cDKS6I4Bo3AZQfDasIw==","signatures":[{"sig":"MEQCIBvO5+FWHNuWV1tgbkXU7cOsvqbuf7yOeh2u+bCqn+GjAiAUZvEOIuHYhmjjOXCQIPtWh8AuDUgs90HiNFOPRxQb8w==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1224763,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkEMCDACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr1dg/+NAm5PT26UHqsqC7w3+qvAMw7NMWmlDxY/MKx2YC/E+FEEcF0\r\nuPgaSuphcs1jcnpco1wbBndu57XDm3MuR16w709Fn31z4JnirHEp6f6cT+bR\r\noYV0AkD0Ru3Ooq7bbTmXSmGQvnQ38Qg7Sc2qQmeVJTAIDVpRVApljjn6mtr/\r\nicByL9sngXev/RWC/c5J+cCYeSWEnIfhoqQR8gLiTo2apMn48de5oJz0PH72\r\nVGfu5xeFIP+mtCG05JQWELhwdYbr13hsuwOrmMt1vgx+UQISr9CbVGLzIkwF\r\nppDeUZxNx2g11Ns4xdaaFDodviIdhR6mvwHfxfTwfnYGq5Z/o2saSZSRgvXK\r\neWOOege4ZxlXnXvDJnEUPR1yOg0g6fjOt4Z8qlVMu32abwWTlPsnznVBZAfy\r\nqeCkXqK+qr/+sh/7x+jHnpqX0ei16kEx1SO4YsRH7f6mtD2arzeQ6HtR30zR\r\n6zKEDE5ZDxzbAHMFzd77qqnRF6YlOF2yuIy/pZX4QVHCFTS9QHPtH5vtYaHV\r\nKI5/o2H8PK7EofTiy+6X5v6YZhYebNuwF8+hAEky6ELYjX8ezwnJyyGRWyvu\r\nEfSQbWXhYfXPHJpq94jom7NqgeVbxmV2lFMW/WBiP2V5DvxAjzpzUViaFjfa\r\nQnsmgRgrdBS8nwLcboi1L4hmeL281zX2/E4=\r\n=4auN\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\">\n    <!-- ... -->\n    <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"ac65d4def7491c4e414883c6cab7e075c7374b4e","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.87809c710.0","@material/rtl":"15.0.0-canary.87809c710.0","@material/base":"15.0.0-canary.87809c710.0","@material/theme":"15.0.0-canary.87809c710.0","@material/ripple":"15.0.0-canary.87809c710.0","@material/tokens":"15.0.0-canary.87809c710.0","@material/animation":"15.0.0-canary.87809c710.0","@material/elevation":"15.0.0-canary.87809c710.0","@material/typography":"15.0.0-canary.87809c710.0","@material/feature-targeting":"15.0.0-canary.87809c710.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.87809c710.0_1678819459161_0.9526029011566006","host":"s3://npm-registry-packages"}},"15.0.0-canary.48d30012d.0":{"name":"@material/slider","version":"15.0.0-canary.48d30012d.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.48d30012d.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"5d68b96203ba78d0abab175a929c19e5b74fb0c9","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.48d30012d.0.tgz","fileCount":37,"integrity":"sha512-Y3Ol1V6hpJw+vf8SY3XAQrx3rSUDXekg3cI5rwDRWxXSGk0i7ZkQKVayZei37MiFIwGNwcQfXfwegI7LYBTbiQ==","signatures":[{"sig":"MEUCIQDpwOGhNY5kiKEqLde88MvndLGPOsKFXNgZuMHuGDeF9gIgd7Ufr7qO8ScXO/5tC0WNt5AtyBKRYAdBNLXCsDs10YE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1224763,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkEMGGACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrBQw/+Kqbh7qxq6xzQaqxvpbLbg371aQZINGYl5fWeZ4DW+FG2mNZ4\r\nobQBs4LZFKCsoG5y9kIblHrUIAe5d1if6OsDnyDsUxIoRkvA8FKQcFQpW8+N\r\n6t3uAMA5ZnQRWQQ1oVIDnfWAtOY7RtEKnSHYumnYUXcKIzqGVOZJVLwHdOSu\r\n4VpxkJ8KTgZP3jtQjJEiu/bADaI+NS+n0pETfpp6QaGYus9YsmHSJLyMMDIx\r\nX7B8DPcP30L5xhOwo7/MpSifFUKwW++RW5i5fDo5zEKJPMXhE4ZCcC0zFG1c\r\nzSfA9JmM6ovbVnuCkgM9dRyIVU8YxiNsoBRNJBUgEH/qMdSBmJfC+C0v/6vZ\r\nIeeBFPmnv1m9O+9NyBpqN9DRDxIrmKreesNMdsepY4BXBbP6ENJwznIRuxki\r\nCdT8HU88s5ceHwMd67zrh6HaXIVmBJKOkRoZbpK52/vW3zyb8s/9S/pB0l6q\r\n1dA3rc0eoJ2JPp0ZEuwKcZ207MNzmdtneQHvRJSGkVctNRH8Nua9SAUc5iw8\r\npTuaDaGQA5ZhiTXLR35qPKWXSzWKDaDh1EFm5oU4nequeO8yF3Lii19Ga/Pq\r\n0eBwv3PUBJYy3tOCQ6Keb2+ItbfrMSx4Ei5D+Kpk+TESZRrbunhh8MCx1TXq\r\n7Vd/AatK/O4gzaGw4OJz8sWr03nmrC7Rf/E=\r\n=spxv\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\">\n    <!-- ... -->\n    <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"f2e4b43d20ea58b52a223d31b8dcd3f813d1babf","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.48d30012d.0","@material/rtl":"15.0.0-canary.48d30012d.0","@material/base":"15.0.0-canary.48d30012d.0","@material/theme":"15.0.0-canary.48d30012d.0","@material/ripple":"15.0.0-canary.48d30012d.0","@material/tokens":"15.0.0-canary.48d30012d.0","@material/animation":"15.0.0-canary.48d30012d.0","@material/elevation":"15.0.0-canary.48d30012d.0","@material/typography":"15.0.0-canary.48d30012d.0","@material/feature-targeting":"15.0.0-canary.48d30012d.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.48d30012d.0_1678819718540_0.4430013732564979","host":"s3://npm-registry-packages"}},"15.0.0-canary.419b23cc6.0":{"name":"@material/slider","version":"15.0.0-canary.419b23cc6.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.419b23cc6.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"e590779065e2b650c5099f83ea77f1562219be39","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.419b23cc6.0.tgz","fileCount":37,"integrity":"sha512-PELuI+nuBdLUtGlO2VE3JJ3XII9A7p0VckW8RSsJDEh7jG1Ud1MNbbALLtepE6v0IicGhLYpp0g9Hq0srVRQaQ==","signatures":[{"sig":"MEQCIAEY22Wk2wRsp5gs5EOWbmp8UToCF+H0ITY1jJ8gn1FRAiAfcEhFxdBtF0GzlNVWGiNewX0OxR5nKRCt4Jr4J9pIIQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1224763,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkEMQbACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpwJg//cA6LjMI+ezcJSq+Fmvt0Qt8lydO5AzHHrM6QX+xoZ8LNKW20\r\nrgHaFlZDeWyvmx7dekNiPS57DVABPQ5YsH1E7C7w9PKipCHg9a4ye1ZpzW5e\r\n8Cghndfu4nRP7Q/B4VpDGeS009IgNb9wrFK9xG7gz0YcXzQAW6i/X/rdpaTg\r\nS0NkQQAuMhcPgYRmdb5bTLjGCbXPa6KHHaSMyQcsx5dEJlCvhfNrt+IzPgKm\r\nyEQJ2pXTgkFd3CtDzerNKJqY3Z4+jjgGTJT9Fk+6NfecwOZbyQAGYNS8PS1G\r\n43R0QXbYRnmtN+9oq+y+XkzW0ZSQeTfGNJYV5L+lZIu1BoWnKlNDJE7Hu6Jb\r\nnAYUxXietSFC1ScT7kQFkBJ5DlusZliXz/hJrQU7hVuwdajARtM3Tag10n5J\r\nydywMEySl7IHjswML/UaQGFJTBw3SyTuNAJfTmLYaehzqjpJ5G9F6nVIfFNg\r\neYXUn6kBmD6dpDSHNEfpSdOaYbcv1yiTfZoOyS7kX6rjBcLdlfQIHc3PrGUn\r\nQmJXiz+kbhsBg04IA8GkLUfH/y8WKpBDbdgwA8BIFL3LacvZD0MjrMyQ9I8e\r\nKQ3+4JJl4VAdLG2FVVYSiuUluYJVs8idj8vuEbwS9cC96lm4is5C1Lw9SGEH\r\nE714lOJVzgPetvIezoKX1BQLzbe014NyOQ4=\r\n=1EtP\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\">\n    <!-- ... -->\n    <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"3b1188210d22a02ba5ae948779bf92655e47aac3","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.419b23cc6.0","@material/rtl":"15.0.0-canary.419b23cc6.0","@material/base":"15.0.0-canary.419b23cc6.0","@material/theme":"15.0.0-canary.419b23cc6.0","@material/ripple":"15.0.0-canary.419b23cc6.0","@material/tokens":"15.0.0-canary.419b23cc6.0","@material/animation":"15.0.0-canary.419b23cc6.0","@material/elevation":"15.0.0-canary.419b23cc6.0","@material/typography":"15.0.0-canary.419b23cc6.0","@material/feature-targeting":"15.0.0-canary.419b23cc6.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.419b23cc6.0_1678820379627_0.6580521443724878","host":"s3://npm-registry-packages"}},"15.0.0-canary.bf86521f4.0":{"name":"@material/slider","version":"15.0.0-canary.bf86521f4.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.bf86521f4.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"7d73d5a69d7835756a87f678805606d534f15fff","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.bf86521f4.0.tgz","fileCount":37,"integrity":"sha512-05xP7sbzsJPMBffPXvYf6xjlD5T/JdtaSKoTyf9D6PbojuC33VhE4p4ebGlQLO7zT0tWIHlNXYvLx1l75lfXnQ==","signatures":[{"sig":"MEYCIQDEPhMTyrkNoi0PHz37K3UJ9HXnktUK3Rzt4m2GhODbCQIhAJjHNZi602mXay8RF2ymjlHIGq+Q6e1brSMaI4JOfbdU","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1224763,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkEP/KACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrbWQ//bClFpioacaLOgny0Y+u0MnDy8knHhhGuZj47IHpU6mVeE+Rn\r\nnn32xWS0bqaHBGumV7AzeI03swX8SNkOgWM+/tTpDJh936/hgpFWpL3wrm0n\r\nM+I/os/364NN9sEWtULihkwXB4Zge3vGmeQ4SCnyrSiRgBlO/C1fdoTk56cy\r\nf9wRuE191NvgoqisbasKWq/eNGprp23yrLicWEGizDoZDUte34tZRZIqHagZ\r\n637HpAInpo+cQKVC9XpYZaMqcPI7SWiZQkNRdAO+UWLMFy9VkHcnk9MB9cFa\r\nuOPIljxteguj05WFWjNLbcd/iZoR1KlxRXhA6P+Ad7dfYO4UcbvL6TqYZdVK\r\nXjmq8OL/CsmwaFv9WDXbWK3GBqS/Oi/ynLqu7rWHARS7+aSOCdPxXJoReskO\r\n15HiA+PlSy3Y7AhAzJ379kP+6EovUFXWBjXuZuvOGojFwtPgS2gkzGCChkbk\r\na1Aq7j9VyO4C4TFUKaxaHVHH3jLl5biqjohNZp8DPFN3lao00rv4lbrGBO7g\r\nqUw2bIwSoMvwundBF8wC2h8yKWrtzlPMPseaxI0c16vywYchTbdxkdRaQlI3\r\nIUhfLnJTQlzcJ6t91MxR9VD+jC8QuxN0qjAPaFtFO/rqSaRONi2BkiXoBniQ\r\nMT64/EgsBybjELddNONeI86YbuE3mKUBzNg=\r\n=Bdjk\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\">\n    <!-- ... -->\n    <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"8f5c1bf1449cde9c918f51bd033762d247655b49","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.bf86521f4.0","@material/rtl":"15.0.0-canary.bf86521f4.0","@material/base":"15.0.0-canary.bf86521f4.0","@material/theme":"15.0.0-canary.bf86521f4.0","@material/ripple":"15.0.0-canary.bf86521f4.0","@material/tokens":"15.0.0-canary.bf86521f4.0","@material/animation":"15.0.0-canary.bf86521f4.0","@material/elevation":"15.0.0-canary.bf86521f4.0","@material/typography":"15.0.0-canary.bf86521f4.0","@material/feature-targeting":"15.0.0-canary.bf86521f4.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.bf86521f4.0_1678835658493_0.6931329022193422","host":"s3://npm-registry-packages"}},"15.0.0-canary.11f3d280e.0":{"name":"@material/slider","version":"15.0.0-canary.11f3d280e.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.11f3d280e.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"12d84d2f3e8798b6a869f3d8c4aaa54476cb8e8c","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.11f3d280e.0.tgz","fileCount":37,"integrity":"sha512-uHcx93NvsyCV5Iy8rQx1Zm77EIhmwINEi4gPXksRcnZK8QN06+ZULupsSN2+s3NBM00Ksn+9UzDCopo0sWghRQ==","signatures":[{"sig":"MEQCICLEVX+BW4tgdtDv63Gt9zCMQkvjyjuPG02izoxhpHY0AiBM0KIFsvmmts9rP7vbiKz4FoXHF8wd0Y2+kw1Nw3YMsw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1224763,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkEQ1ZACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmqccw/+NL3IAVv1JFN9SQd+TunZZE8boD1RFvJMfhdNjkjAPpispmEz\r\n0emPX+wygoj7oacnNL8lpIh3d000Dl1baCVlHIAkYyr7Vkfxr4hh+BuIHRy4\r\nxMQcCLAGJQh3eEDi/oHKC3J1lB8XtvjDjLFZA2WJPe+CUWNiNvMrMI+nJDoU\r\nYDX6eAmFuoyaULFI9panFCx5qjm8HJbhCtXNeAdH5iNne19V+LpbBaHndr5L\r\nDws7/dUR1KKmuzdydWPxL7qLWPxB7HhaaHg2a3DbG83CXCDlE4Pq5PYoEOWb\r\nJp0umbmmASw1KCjyiRy8371lJbaCpHABEov4Y3ZAYT/4TBwx70ebYh4N1K3G\r\n1nzRxuA2rEChSEId/+Y18MR3j82ftJ1OE2nPFUvTjKwmBDmPl7i7BKjEFC9/\r\n0Kt6OVG1UVkspnJ+upVGnJeZRi5ixzIixn1T98yoOkoBH+whhcInXG58DXwG\r\nXL9ztPp9pD8wEGUkP1Ol/AFkBy8PF6U/foWAGsyJIaMkXeLk6Z6pMmjBfV28\r\n20oTy5oP0TYY2RL/euYSkJ6HfI1K+qYGS9+f02xCao3PMUzOdWsFo4gg7BqX\r\nDWdNnROxssHuF+op1EN1q+q/3255uN36svY8feBN93ndcQGC/QQzK0Upfskl\r\no6v5Ow69qhtepnLs3SxYbcF+T6PZXUg0HII=\r\n=9Dr4\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\">\n    <!-- ... -->\n    <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"8e5a0971e8b535be016fdfe963b22dbcf1353e53","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.11f3d280e.0","@material/rtl":"15.0.0-canary.11f3d280e.0","@material/base":"15.0.0-canary.11f3d280e.0","@material/theme":"15.0.0-canary.11f3d280e.0","@material/ripple":"15.0.0-canary.11f3d280e.0","@material/tokens":"15.0.0-canary.11f3d280e.0","@material/animation":"15.0.0-canary.11f3d280e.0","@material/elevation":"15.0.0-canary.11f3d280e.0","@material/typography":"15.0.0-canary.11f3d280e.0","@material/feature-targeting":"15.0.0-canary.11f3d280e.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.11f3d280e.0_1678839129286_0.07974850221176388","host":"s3://npm-registry-packages"}},"15.0.0-canary.b281a409a.0":{"name":"@material/slider","version":"15.0.0-canary.b281a409a.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.b281a409a.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"1fc9031b29cf80350311f39cc4c3aa70efea49e9","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.b281a409a.0.tgz","fileCount":37,"integrity":"sha512-CkCdDMsyVZCxrQvTQnFW3YeswPTiM0DHOJOA88sW/G9sOSVy1lkp9Ry+FS0K92wgm7bBKbwqm2cNMNX4UCY+9w==","signatures":[{"sig":"MEYCIQCQsCw3kR87PbxlElJfVA05J33MWXQ6p7dEp66yYRM1bgIhAOVPcXhh4WhR5dIHwxlBtpz3sGSP6bq4shTVO4TqqEEv","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1224763,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkGdBTACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpClg//cpJ0z/oISZqmotW/Yvs0w0etbmMYi5A6+YzkFQdytN7VY7um\r\nVDClf83bXOrd0evPAG2jjvowUs1pomiunzMYfQYwhBEPZcU7fvnTKzmyzQXj\r\n7iU9/WpHFkLDsRiYG15+wkPhpQNQEdSOCGdmtzTs1or/uQbVGJccEfuZixS1\r\n+vBbYkyDYGU4ikjDgRG0x8VhP+dvCkkJpq/789wS5I+2dxdN9Zwd7ENKPbgi\r\nKSPqzn++eTovZTn9Sivzz37B8tdE6EuJDJVmU6NdVviOvb8lO3Xy2MFBGT96\r\nY+HBhV79lABJS7kSsehP0T0Y+MCeZ84vfdRgx7GdJmkXVj2YJK1V+JwddIcg\r\nb/mozvS7z/OeoY3Aoz+sTNXli0yeoc47khQMBJcLcgZ55F/o3WTW6IYdKSwn\r\nDQg/qkb216xjG0QjtYlgKDCUhqlSHuhDVeDW9m92K4LW9AZhiC8fJqC0mlh8\r\nyFuzP4DV1zDAp+aWxgq5jsufcJuNGGm3cfgTykJH05vlckjb+7wQp5sQbiN6\r\nBGEEubxp/HO9yDTGqN3f5KeSbQOVF8OW9akO1QCTYyqNqG4/xWqA1w2zbFg9\r\n53ovyBtyxFwhflW/P6GpkT7BOrlXnnWiziyVf07ihrtfOApSBmVtbXhNt9sf\r\nDHsQAcTHXuLhWtsd4yBHv7w6kxiaRV9nDZE=\r\n=4u5s\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\">\n    <!-- ... -->\n    <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"b924c47aadd36bf60d7c29e466ab3899ae4085d6","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.b281a409a.0","@material/rtl":"15.0.0-canary.b281a409a.0","@material/base":"15.0.0-canary.b281a409a.0","@material/theme":"15.0.0-canary.b281a409a.0","@material/ripple":"15.0.0-canary.b281a409a.0","@material/tokens":"15.0.0-canary.b281a409a.0","@material/animation":"15.0.0-canary.b281a409a.0","@material/elevation":"15.0.0-canary.b281a409a.0","@material/typography":"15.0.0-canary.b281a409a.0","@material/feature-targeting":"15.0.0-canary.b281a409a.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.b281a409a.0_1679413331235_0.5926616670368834","host":"s3://npm-registry-packages"}},"15.0.0-canary.39e473690.0":{"name":"@material/slider","version":"15.0.0-canary.39e473690.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.39e473690.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"106c9d56d61603518701322b34be363cabcf5b32","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.39e473690.0.tgz","fileCount":37,"integrity":"sha512-0XQfpkKcaXJYYTDHH+W6kTw1Y0JJbkmEdWsDQfAL7/b4q9Z9sTtt64tH5c/U9qiOxLLK/jJnQ/9INgfgZ+jJzw==","signatures":[{"sig":"MEYCIQDbU7VrvReSqiK96lA0pYqREek0Kip9n6C3lOIwPXHuzQIhAOmYiICGrF6arZF0WbTLEBMbdvpbd3avpRSbUHQVNFf0","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1224763,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkGe7YACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpPbA/+IIuyLqBdmW10ynKiemIOAEs764N99z6AhcUP6dCPrgB2OjYP\r\nXLmftOIMbmNy+kebgzdr3lUst+ieSQi1J1PEBLNWW2xFMlkl9N+Ext5lUxUR\r\n9b1rXCo6Rm4kNqRtNy6iaafZLWE4+iyWo1NWvr+T/wFMvUubS1l7fd7ErYPt\r\n16E0QOrsR8aV1g5F3Tt6ki2Y2W8Hwpnm/WWTAi3ZgkyoFrOyB9z6lTO7kgKO\r\nrBlc3ld1wTS51iSdeUBRLlReRIXmo+cWdmNbHQYWv4owSV/xmAo2RMDOdVYG\r\nO67elYQFK80AAeZ5NvzbZ5OMhAsIP9PqtGwed6zQu2le0xjTbsMTDbIaIPle\r\n0CiILEdHSKou8aOVvw2F2Q5KJxU6ipwXRMMNB/hJO1jgp9JhUSIZQtGxAM0+\r\nENqx9iPSR9kMqM7v0tgCVoKbhJzAbS+cepLPECRsRHez99EVs7PidY5kPrfa\r\nXWNbqKqkzyKpfXk+dExpfXdCAwArbM0C2kDRIENMF1jBfBLnezEsmGtjwNy0\r\nTd8N0vHqNiFmDjk2vAUeSkFFTmqWLm2J8lmLZTxT41GxR39PVg7buTiCHNfB\r\nRxu9f75YqI+OO+AYwRgTvMCLsoRvoYXE+4LEPxb3CZT8bdXo/dzF/+1kj6c2\r\neH1sfVzaBIKdvzkZ60NVToORBNZiEITDLek=\r\n=z4vV\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\">\n    <!-- ... -->\n    <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"2d372eedef7c583c60aff8d4cd51f8de971cb93d","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.39e473690.0","@material/rtl":"15.0.0-canary.39e473690.0","@material/base":"15.0.0-canary.39e473690.0","@material/theme":"15.0.0-canary.39e473690.0","@material/ripple":"15.0.0-canary.39e473690.0","@material/tokens":"15.0.0-canary.39e473690.0","@material/animation":"15.0.0-canary.39e473690.0","@material/elevation":"15.0.0-canary.39e473690.0","@material/typography":"15.0.0-canary.39e473690.0","@material/feature-targeting":"15.0.0-canary.39e473690.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.39e473690.0_1679421144328_0.12378572815219657","host":"s3://npm-registry-packages"}},"15.0.0-canary.cedffb44c.0":{"name":"@material/slider","version":"15.0.0-canary.cedffb44c.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.cedffb44c.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"444c91d105d165f5b2cb80042417df67e0b78247","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.cedffb44c.0.tgz","fileCount":37,"integrity":"sha512-DsEA0AUCzFzmiKNjqZUxV2z5ZXUXBNI1gI6LjDx/Ksqqz9XIqZDCL9rfWaSGN0BgEb+HU71p30ZL8hW2qKvM5Q==","signatures":[{"sig":"MEUCIQCjuMv2mlkBd5Hb0FwExd6FMxt6hTqAxmVkPMoHoulb8gIgYA/n8WPBGRuYXb4zYQ3pAnQ2wTGJpo0MKkSVcOD2oPY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1224763,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkGfB6ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpDvQ//Uw/FudZ7nCB4h3j8QzxURprd1/Kss9cCLGQC1/ITL6k8SDkg\r\nDanH543HjfgBnds/JFtmo5a6ghcDD5RTBE1ZKHZFMucThi2kqe3jiuMTSOHY\r\ncM7snZa6ev/A2PldPHgh028o0KOM1A86Ge5gGxPicRIpT9Ivm/pMg3hrTaYA\r\n9ZEUB8GxTcjt/J1NunEdh1moz8bD9mhUbYI7/beH3xzoSF7TEvghVYV0Jh0J\r\n1qJb/qRd51mgvhxiWJjAwcYkrfIKhxEsvdt0j4U72J67g18fE8g8wwaYfsLO\r\nMTbudYNAjk8V8Zw5WmtFoLONzI2S1lZaMA5z+J8wqYZGNqJUGlsEyt2LpoyG\r\nwmlsOPI80SvnJPH7BzpfmurTpSKLtNX7dwG29PrkRNg+grSkvUXS9Qqh1Z+s\r\nKl9a/9v7bIMszqap8M1Hb+5m9N7vChvAG/+XH9wrQNrUPXMwV/TXmiDOqIy2\r\nKj1mkZ9ZzvX/VlCZ8vdISn3CQ/obf/y9db2b6KSRsO6I17xAvd/xnNYUr1nB\r\nOUSQlt1sxCosYUTGLmqrfmanklg8CXtNg+2hMLpN7nnVqMExk2YsxkssuvW+\r\nc2Feh1193FwthG9FptiDKrcuMQYfyVXhPlMLqq/VRMjFXCI+hY9uabtS0r2J\r\noWwREljqZemENp+ZwgrAMq9UFfdVjCe9bHs=\r\n=BEF2\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\">\n    <!-- ... -->\n    <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"37783644942291b0c5d41f7499a79b5f61bfcbfa","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.cedffb44c.0","@material/rtl":"15.0.0-canary.cedffb44c.0","@material/base":"15.0.0-canary.cedffb44c.0","@material/theme":"15.0.0-canary.cedffb44c.0","@material/ripple":"15.0.0-canary.cedffb44c.0","@material/tokens":"15.0.0-canary.cedffb44c.0","@material/animation":"15.0.0-canary.cedffb44c.0","@material/elevation":"15.0.0-canary.cedffb44c.0","@material/typography":"15.0.0-canary.cedffb44c.0","@material/feature-targeting":"15.0.0-canary.cedffb44c.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.cedffb44c.0_1679421562443_0.9027139570781935","host":"s3://npm-registry-packages"}},"15.0.0-canary.36a4cba99.0":{"name":"@material/slider","version":"15.0.0-canary.36a4cba99.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.36a4cba99.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"d003a3ac851c0ca3db8ee4c2504e2cc0caa75629","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.36a4cba99.0.tgz","fileCount":37,"integrity":"sha512-XbxHmQuvQGRpTlayYi8bKbmsIxrc1lyWilP9QsM1n/hqtVFYYmWZ3XR055eFgIq8z9ah5PC7NZdqeaJYrmkEMg==","signatures":[{"sig":"MEUCIQDJ+Wi0TF5EouG7GN5ov873EKelICX4Krq7CNkZCvAPVQIgOfnuapMeRYppq3O7SCJ52lfvEvuZBpjYo+VprY8RarM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1224763,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkIykCACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoaXQ/9H2Fh0TxCrsev4OK1qe/mBHbnx6xZiWlUIAPzs6RkxqdtkWNE\r\nbs9RI6Y4EztBjYVOJE3lgN3IwFkLoQEGzC2UC679sKg0Lxa71ldAkP2rT6Jw\r\nZwx2ijGMeeWfqC/4z0SZHH/E7lTtGHKLRT9P0jn3OjEd8T5aKR+6INoVwk49\r\nAGo7uwktkLy6+vAEQg7y5hDrFVZQJe5Y+e9Cr3YO6jbTz/pGP4wxySjQCwvr\r\nOgkACUh0ajsK5xg5Tyel8ayHoIB9CB2smYGW5ZNhFiQDh+0tA0bm2wM9ypZm\r\nn53uV20Jp8kJudWMRqM5gXl4H3Nx0n6cJ6I2Vl+2zFs+8Ag158ecdYtYqK36\r\nmBnk0z2KiD1DQPjDD4y16Tiz3ZoDpoiTTX55ExcoGge509F0g8rp9fSzXSlw\r\ndZckwBbtbpBwQs92yaXWjuSqA2qUinse9ZVZoxr21OUTll9zh5xKR5xtzVwm\r\nTIOYZ+iEb5lKT6ffi3NNwKiGiWwRdzS0xOnx/xSmcH04uGqMZD+LLVd9uF7C\r\nB+BEE3JEbKhA7DYNBvbjozRvtela7yULhMIrbeKV/bZK644d7pa0zL2chRi2\r\nxklmY5FjOUr0zYnwFsOWAAvk7k4Y+rtOsbt+1ymtKA4bvLeH12MgS879nWZV\r\n2H2H/S5l9iGXTEao4oYLN5I0wZBHShj1B9I=\r\n=HbV2\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\">\n    <!-- ... -->\n    <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"9895102e50a9e7eda73e0b0039246bc56c79a7bf","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.36a4cba99.0","@material/rtl":"15.0.0-canary.36a4cba99.0","@material/base":"15.0.0-canary.36a4cba99.0","@material/theme":"15.0.0-canary.36a4cba99.0","@material/ripple":"15.0.0-canary.36a4cba99.0","@material/tokens":"15.0.0-canary.36a4cba99.0","@material/animation":"15.0.0-canary.36a4cba99.0","@material/elevation":"15.0.0-canary.36a4cba99.0","@material/typography":"15.0.0-canary.36a4cba99.0","@material/feature-targeting":"15.0.0-canary.36a4cba99.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.36a4cba99.0_1680025858434_0.2123380678273683","host":"s3://npm-registry-packages"}},"15.0.0-canary.ed7e82ded.0":{"name":"@material/slider","version":"15.0.0-canary.ed7e82ded.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.ed7e82ded.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"a4615c7f0d45d7b6c8f81b3bf983ffd583c2c29a","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.ed7e82ded.0.tgz","fileCount":37,"integrity":"sha512-su2k2aFnPAoOwpKULECiG5p8QjZGFQHiU6sq0gb4qrxVKN54hNKUiKA1igrW+5McVG2J+kDG6buRgcBJJDdn4g==","signatures":[{"sig":"MEUCIQD4W/3bUQFxMUooTsQoN4YHtfU8Vif56Stlm+4DzlCAogIgH2+cYUUk0w+QU2FRGkBSZk1ZSEhMwMdLwl9LoG2B+7s=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1224763,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkI0+YACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr//g/8D5ZTbJgi5IK4nO/nWXUIuRJHN4VotbISj3D5ZJixmXTP4wWi\r\n7MauiTylARe8d1xhfYUPtcw9zPDSNNxHwA9X7KA/ZQFygg6kxLlmHxyZcpog\r\n7E3up7QFBCbjFqmVZNkp7Z7VvisykHkfzrQX2wuZi2TmRyQQ5Q2X4lJ4VAze\r\ngXB1sAYWBRddL4QOimSWRp6FCXz/Gp353lwT9hOgRhoWLHqtk+93Wl5/m9oc\r\nvx6dkWeqLgNh/QeFWGN3FkyX6SLOJ6d4uMTjKs2DhFt+skUrCidnUnpncv8M\r\nCx1aRpwim/qvIZqNol1F+hWVgT6H0ZNSCNvErbXNr58IC9tU25Atrr3t7Mi5\r\nvQN+GnrjVOzmcoqhW9kktvcV5YRaHb3NWcwf1xX5YUJXXf4DtjHuwdGEMxRE\r\nnNUBSTJsluUKQRBGrY9+8PKvGDC/zawLw9bp/gZ/eG6oBhnB+LpgMkliPqPm\r\n+oCuy/NgX5Q9Iemo/fOMHRrc0gZvXVdGaKmKeePa6NJ+99zUP1+deuJ/6DLd\r\n8W88f7SLcNdAp6HM+0M1HD1vpisr6AWQtD6NlGsaJgxSfUZsgwiaovwoe15I\r\nm89wVt9Kur00GY9aGcE/7+M9eR3ArSXUVRjl44P77L+KdFfLUBEF13wV3LcI\r\nsfUjsjnf7DEEbihkHDAgaG9VaEE73ryXJ5Y=\r\n=MFBF\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\">\n    <!-- ... -->\n    <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"037c17ed14cf732acefb4bf7cb0a6c61f643b991","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.ed7e82ded.0","@material/rtl":"15.0.0-canary.ed7e82ded.0","@material/base":"15.0.0-canary.ed7e82ded.0","@material/theme":"15.0.0-canary.ed7e82ded.0","@material/ripple":"15.0.0-canary.ed7e82ded.0","@material/tokens":"15.0.0-canary.ed7e82ded.0","@material/animation":"15.0.0-canary.ed7e82ded.0","@material/elevation":"15.0.0-canary.ed7e82ded.0","@material/typography":"15.0.0-canary.ed7e82ded.0","@material/feature-targeting":"15.0.0-canary.ed7e82ded.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.ed7e82ded.0_1680035736157_0.5961083790391066","host":"s3://npm-registry-packages"}},"15.0.0-canary.55093ee1e.0":{"name":"@material/slider","version":"15.0.0-canary.55093ee1e.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.55093ee1e.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"0a38728b9bf30805a1ebdd2ac99f780b1c97afe6","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.55093ee1e.0.tgz","fileCount":37,"integrity":"sha512-hyTUrff59soSJnN8IFQdXfHsvCGyyTH8DTkejgsK05bCT7Zk7N+UojpXSKD9+iEwwdngfXs0RALWKry/MwEQGw==","signatures":[{"sig":"MEQCIGGJJorOFWOqJlGaXGPHXQl2DsHDRkwdpfcYO66iMN1hAiBbD01eXyOYEcxqDegZH6oqujJH9wlVIU6UQt0/M7N6hQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1224763,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkJIhOACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoMMBAAhMB5kJt1KKXZ+jQx07836gtt97BA7DtPP8+Gc2jHGlpsdOI1\r\nM2pyGIPvU56Wvmwe+gWdbS9OW2ggoVC+RUsXcTQ8BXDG1Um2aOHfPTwS0nrb\r\nrUs7mSYF4tEdFuRkopB/lC8HgbqM58NgeU1WFvYI6IGJ6DlvXPQ3JHnqst8k\r\nJLltDezxFJ99K+LDJaymgas9MmlBbG1rMmUSEPNjAaxeDX6S0LSXmtSRkQSM\r\nvQAqiuxm+crCmdtHYrnoMy82wvXlxsZ5i0nouDYCTdmzjsIW2sGtzpMF/GQU\r\ni+napIcXvFYKleUSl113bUKEGbdyL1idLeNblsaTH4w3aJTXRE5jPOrB91+L\r\n8lXE6tvZMq2tjrFjn5/YQwlrYWJUEx0jspj/RMRXyUlerRds67k0p5N5O5wq\r\nB3Zqlw/OJdLRTt2Nij/diXLPdaqql0L0utv8nNE5Y2KtTVTtXD19vwBTsjO9\r\nFFFMlamKTJj9cFA+/j0QlZg3dtUqMKHpUOh562QRltea6aW6vPK6BRmrDxcj\r\n7SDZ6PvWiCnfCmXKgcjYfX4nf26Fkxvkb6j0atVK2NNJ/Mza7F+OcjqpOozt\r\n+h1m+Y1Fn8nvDcPrRsdLezp3y/nLsqYaA2eGcWZ/X/35wpn+PeIXjE6Uo5am\r\ngK3rFX3Kcj9yv/T08kZdWQY6KiwqAeE/dYA=\r\n=6rN3\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\">\n    <!-- ... -->\n    <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"98de61151738b5091fc2b0e261c18efce05e87b8","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.55093ee1e.0","@material/rtl":"15.0.0-canary.55093ee1e.0","@material/base":"15.0.0-canary.55093ee1e.0","@material/theme":"15.0.0-canary.55093ee1e.0","@material/ripple":"15.0.0-canary.55093ee1e.0","@material/tokens":"15.0.0-canary.55093ee1e.0","@material/animation":"15.0.0-canary.55093ee1e.0","@material/elevation":"15.0.0-canary.55093ee1e.0","@material/typography":"15.0.0-canary.55093ee1e.0","@material/feature-targeting":"15.0.0-canary.55093ee1e.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.55093ee1e.0_1680115790223_0.17349537121859715","host":"s3://npm-registry-packages"}},"15.0.0-canary.0c53abc81.0":{"name":"@material/slider","version":"15.0.0-canary.0c53abc81.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.0c53abc81.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"765a637c5a0ee4c76a326c383cd1ecc479194a15","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.0c53abc81.0.tgz","fileCount":37,"integrity":"sha512-gA496ye3kyBXZ62ALnD+7q0a+/MmCYD/QQRoAPbfPk5OoS9oDOWYTb/J+QdXMP6EmULuU31ruZb9ebXBNziPOw==","signatures":[{"sig":"MEYCIQD28SQQlvcKhsE82h91KED+Aig6BLxfUQHyT6ZENrpmLwIhAK8no8T3C2h/jh6VYKvhqg9iHUKedh4c8TzDBV7c8PhU","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1224763,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkL3TlACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr4zQ/9E5p8RgwxWuqsHWifNS8vAtomvLV81aiQScSIU+dP+jAr7s4o\r\nmKgf05Qx7fpmcSXIUeuD7Fz4gWKtSt5AM1Ln6Vq0mTrkTzf++vl+/XTjaelZ\r\n16abfQQ2acM5CHAdy3t2UZmdmU0NksMjVztT074hFdjj801NIKKWOMVb061f\r\nkUSRg7oEchBf4QoQf51WoIXarPio1ZVsEMH4tgBZB7lgRGmbjjdlRwvNNm1G\r\nGcaBWT9WHXXVEuH5wXwgHtobeUMrmvfVGkqFtAyziPz6LtkYCxwd2Nftzn+A\r\nem9rp5tdbtO6A0zAr+Faw27WA1IHmqWgYuvWuzkXAHmlgdBzuHJ+SLtHfdPj\r\nUwqLniq7AeRuoSOpJRs8LFcZj80Z7qRMNn++cNEZdUEUiScYvZiMxYH+XJcc\r\nIuBD3GpQTVPhF3TE0YA/0IhvOXf0mVqToGm05R438vh7pgfMzLL3gqYMonxw\r\n/YQ6VvzlXSc7oLMY9HtcAJt9zgDCvPCm6jdVP56PUH5GYB10djTVKj25tqdv\r\ngjMUry4Ykaf/ofn9DPXXz8f5vJBBOIqLdhJPkk6WV6Yt1CYudeHkKm1sZEdx\r\no9qkU4Pi+t9DycLfJqdSEQzyr8lROXUuSLv7mPwUgZJJ5afvHqL3mHJevZvW\r\nU+WaTTtbRsc9AN8ayuGRGlLiDigdRut9W5o=\r\n=xmD+\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\">\n    <!-- ... -->\n    <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"6f7be5b2317c28dc06c5b0bf4a8cd44df591750d","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.0c53abc81.0","@material/rtl":"15.0.0-canary.0c53abc81.0","@material/base":"15.0.0-canary.0c53abc81.0","@material/theme":"15.0.0-canary.0c53abc81.0","@material/ripple":"15.0.0-canary.0c53abc81.0","@material/tokens":"15.0.0-canary.0c53abc81.0","@material/animation":"15.0.0-canary.0c53abc81.0","@material/elevation":"15.0.0-canary.0c53abc81.0","@material/typography":"15.0.0-canary.0c53abc81.0","@material/feature-targeting":"15.0.0-canary.0c53abc81.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.0c53abc81.0_1680831716724_0.10997488651698117","host":"s3://npm-registry-packages"}},"15.0.0-canary.51311e69e.0":{"name":"@material/slider","version":"15.0.0-canary.51311e69e.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.51311e69e.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"b2b8db3d75f3b66627bbbe156f86400b4ffad73b","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.51311e69e.0.tgz","fileCount":37,"integrity":"sha512-piezf4BeTsXxI5NH2nspM8W6qBl0+WCrnjC6rHgokLWfPBJAykZMf18kmfsw/qxaNR4D+QSNxvVBKPnZgxUAkw==","signatures":[{"sig":"MEUCIGQmWFE/hEZh/46F6lH9C/ItlJvTHXhCpkyX21sm8xUwAiEA5SopuY9uMt5X26nfy1VrwXABsjSmj/tJB/C2iJ6OTnU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1224763,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkMFwqACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoUoA//dP0PorxUTDmGSunAuUDSddd1MGg8OIpgBpxHoKcOAYcVH/BI\r\nmN9DJ1JEV+8wLKegffL9W7xrRC1Lk1+oc35rS/LjhAAU5Rgg17LSCxeAC2Jm\r\nIFvsyqYTh4APD/fTfTCPDHisVuWLaZeSHB9035ZXqrEHRkfkR3sFPrsxEyM3\r\nLstlrR/OXEewxbAQ8qY8SdaampB4S7gCkUnWd2TfEhAz4erO7g7ho9n3imoF\r\nTLTepg8PnJ3X5pwlcRhwaUq8Wb+k4wFX+F/iHOQp9TzijZ+72j25SkzvJjeB\r\njpjsBU884xP9tAf0KlmXMxgqghTJ7X3Pc6IHX7um/kSzEy9Ha9n44dll8OSx\r\niMzoinCuOcZL/S9YH/lxCSsE3yuk60zxAdJH1Gckmd9x7yiAb69LwEfEuRGU\r\n1stZ6ZBS2OZgnWxhy4xGkLfMS7Nd4prdRRFJr5TnAkZPewlOJzFriHs5GEGh\r\naITvS3IJOd0j4VlbvOJysKyPY8b/Faqctz0fzOtlxaNddpTECZjlnPnR+/Gv\r\nGXMfTYSrAdHcSM7uCe17WamddV6T5qyaAKesRbZUb/Vt8nkPXt2a3XGxAY3z\r\n2R6j2Hvm7gKUG2NurJ07zASAXOcYDbpzIO5uxRT25Jp8WP/3oasWBkELfFU2\r\nb5R5RwHLmkCd5a1pO5KV7RV+3ylvLaAqezo=\r\n=q5GC\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\">\n    <!-- ... -->\n    <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"20cdc4f9c3bc9046fb111c8b65ba3e9609585dce","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.51311e69e.0","@material/rtl":"15.0.0-canary.51311e69e.0","@material/base":"15.0.0-canary.51311e69e.0","@material/theme":"15.0.0-canary.51311e69e.0","@material/ripple":"15.0.0-canary.51311e69e.0","@material/tokens":"15.0.0-canary.51311e69e.0","@material/animation":"15.0.0-canary.51311e69e.0","@material/elevation":"15.0.0-canary.51311e69e.0","@material/typography":"15.0.0-canary.51311e69e.0","@material/feature-targeting":"15.0.0-canary.51311e69e.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.51311e69e.0_1680890921766_0.0022136518054050036","host":"s3://npm-registry-packages"}},"15.0.0-canary.113b1a38e.0":{"name":"@material/slider","version":"15.0.0-canary.113b1a38e.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.113b1a38e.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"cdcd4b632192a79335e7719de270c36b47f0383f","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.113b1a38e.0.tgz","fileCount":37,"integrity":"sha512-MlG5NJg085TtiBCW2r5ZMqcHQGZggqZSRQKtXcWj0Lst1G9w/Y4ULgYoiGXxDdwxJleZkXK3JszyG68cCAdwuQ==","signatures":[{"sig":"MEQCIEyI1wvKoMmXPud0vOsilX/TPvZ8YUx38nXBB5lpshl1AiAQC9qZ9nmOUbl3mBMxfg+f0vINOR7I53Fs/ZX8FPV99w==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1224763,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkNIWeACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoN8w//eJ6StNo6Fuxz1tpMl1b20JVb6ZdhxWod4lO/Y+wljzDExiv/\r\nUx2tABYey6mFGX0Xw4V3y90yEgIKPxUsRFIeaLzIaBgPHl+/2ArkU7Cdjwr8\r\n3MPX6xOt5aO7IwdSJdmltFrnuyYAUpW5JoTXjaT+4oyZr/sF8tJmVSq8zlOr\r\nuBLgF8CR5LzUnkdLUY1zjhGU9RVfZ9bD/G3d9zbjhmTPs6muVQHpYtpNOkcy\r\n6sj1+5xqStU1dfNyneaBuo6NRXGQoqfx0oVWG8RtZYuWu4x+WmQzqu/H+AXD\r\niUpTDM1ZmgZ/o6QiIJgCeVeuoor7FIhQk6QeFbpiMFiuDObcbqXev4sZU1p1\r\nNUNDVbANKkYAtboZbTx49KOo7AMRpXdsotMawOOD5LAwZ4k8EZda/qAfmDvi\r\nVbQu6q1vj3MP+ZyQlKTjXy4p46BZXt86Jn/zWreAmQTOmsKG84jDe5Rvx6LP\r\ncD2ppWAcBiIqy0A5MIaHLqfkrhw5CCWkOck6FjpGo8xWsKR9lyXtLNF8eHLM\r\nvocAu26r/wS4M5NpYleXIJN6vHwByf0XoogC7BxckrUsgGs0wwuXj/xsQHjA\r\ngEuAeVOpGpnQTv3Ew/dElN0yfi1Y1Ueg3miH5Iotojz6H90jIgMBCuONNG++\r\nV7ktQtXf+fr8c/bttrOag13QDRHVzCp3uO0=\r\n=L6w+\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\">\n    <!-- ... -->\n    <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"3613349b6481f716239e1a73c710c0d5fe44df72","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.113b1a38e.0","@material/rtl":"15.0.0-canary.113b1a38e.0","@material/base":"15.0.0-canary.113b1a38e.0","@material/theme":"15.0.0-canary.113b1a38e.0","@material/ripple":"15.0.0-canary.113b1a38e.0","@material/tokens":"15.0.0-canary.113b1a38e.0","@material/animation":"15.0.0-canary.113b1a38e.0","@material/elevation":"15.0.0-canary.113b1a38e.0","@material/typography":"15.0.0-canary.113b1a38e.0","@material/feature-targeting":"15.0.0-canary.113b1a38e.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.113b1a38e.0_1681163677838_0.857104850953136","host":"s3://npm-registry-packages"}},"15.0.0-canary.ea2191426.0":{"name":"@material/slider","version":"15.0.0-canary.ea2191426.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.ea2191426.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"297251bf1aaf44cfadcdf40feef38ea9ad30ff5d","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.ea2191426.0.tgz","fileCount":37,"integrity":"sha512-X4h2LdrlmhjLBE5A2oi9PBbKxjw1SLcJe9iTRt7tx5OqynzLqjeVxthr6YPiIuLuQpuhCzXRGytE/HCy/OR5WQ==","signatures":[{"sig":"MEYCIQC2UXj9WGxNsjYToHPGkMfDf7xCjtbz+kYxyC4okns8UQIhAOteCSyCXl4wXQkQg6Ru/l6ZVNt77ax9hMHdSzxswHA+","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1224763,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkNdeQACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmqt6w//T4r2v8lz/dyehrfXbb/6CdYQf4fI+QBCZyGBcJ18VtUp01nl\r\n6zPIcEyZEG75nE0ELrdr49Nc2GnSEKrrE/6czd/rorFJ7xQGpi89jXjczHhy\r\n72UGE8c86KD89TxWenwsjMl0W6Vb5aFzS95WZIC5JoNB9BSn6Yy8l9arhppU\r\nelMa4cvJORX0PleUTw/uNV+McMmL9DrHjIPQ+/k2OdOOzu+pCmQekGa16t34\r\njMGYmexdka0ZJpXZEq9TsoOd/1sf6CnDwZ6amQXsttgoj9VunuxjnR/GL+lM\r\na3znr05hz0tBPmj1w2e56B6Kf/+odSesdjqeIchT4KYnYZnBE/zIO2U+oad7\r\ndrjIEvyM50w6tHL4DkrjGyNo5JhqYcOfWkJGCvShso2U9mr5BqDOuoLFofFv\r\nK6ZY3iTHOxrRwJ+cY1lB5l/LmqJB/zvDXhvPHc4XziI2odCBRE4hHXbx5v/G\r\nNlmLgpG5tosqKK2/fM3/zEb+KW9fsQ8jCvC/3kHeZaduniVe4BuTr6fK2WXr\r\n3TnvbLz79rr23oA1qCu8R3CO+Y9fWOsa1P1hzLi5v93jjaap3bLmbQiRDBW6\r\n2OQO5uDP1DIGJKclp2EKn2wW+t88owNRkbsY6/heWBw2MfH7tGeHpXW1Fowo\r\nW++WThmhD/XUxYaTFKMxHknOJ4O8R9YU44o=\r\n=h4GE\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\">\n    <!-- ... -->\n    <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"8723a8c5fa13530d57b1651464ec28e9ed1d4bb2","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.ea2191426.0","@material/rtl":"15.0.0-canary.ea2191426.0","@material/base":"15.0.0-canary.ea2191426.0","@material/theme":"15.0.0-canary.ea2191426.0","@material/ripple":"15.0.0-canary.ea2191426.0","@material/tokens":"15.0.0-canary.ea2191426.0","@material/animation":"15.0.0-canary.ea2191426.0","@material/elevation":"15.0.0-canary.ea2191426.0","@material/typography":"15.0.0-canary.ea2191426.0","@material/feature-targeting":"15.0.0-canary.ea2191426.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.ea2191426.0_1681250192014_0.0845685592830081","host":"s3://npm-registry-packages"}},"15.0.0-canary.5a5c38538.0":{"name":"@material/slider","version":"15.0.0-canary.5a5c38538.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.5a5c38538.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"d3c3c1100d942cde7490e2fe7d9a4009f7d3f31e","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.5a5c38538.0.tgz","fileCount":37,"integrity":"sha512-exKb9vDS7DicTCUltD8GNZd1bnzcFY1tIGrYI4xOHTVyaAMY21nngcORh5GQrlyw9PJWilKmG1V1GW7bo7yCUw==","signatures":[{"sig":"MEUCIB3d6rSEUSfrggUTLmKj12d1HGgwv0NxdDze8tq5EqWAAiEAtwwyx2N/lXXW+XgtHzpAZ6baNHz7WAvh8xjXMFD9loc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1224763,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkNd+tACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrsaA//e05lW3zvLcTGjxlT1STNuOHzUSXA0WzjjCaLC3UMm+cDKvyy\r\nteKGHg975Z2rA7kWh4oxytSvXkFL1FbW/CDbRCvn5KvMJvuF7SwCWXx1/rpA\r\nhjkE2I/+ZNNDErRhIjRlLAZdbE4YBw95v/qWcGEfhCPobbBULsNu0u4eAbdA\r\n1gCx8Zyn3dHSVTl8Yuo/ES8v3HMYaSZro2Jaxymdw3DXLRUvZ50yxGcJJX5E\r\nlQN1+cNB2EQZHBKeEchcoKRuydfJ+Q/w4uEhVPJmJhvqpZb+e0GxP3vkXaKQ\r\nhPcxuqvyIyZW6uxDqzVbB3t8n7gGIQPa7V5Zc0QCQTIMbrBprtzWRKXa+tZS\r\nU1uCwzqLvjqxfkt5N9EElChdMqKbkiV4CYnH2EYIzKykq8Vs5jpiDkljMmLG\r\nDbQHthPfLZfIphIrB4ybovV1wJdbZopz2OlqDDLVyDxphN/E0bMBqyULDdDQ\r\njeKi1J/7s2QriiM/+5aHrLbSsIdwMZ18ZObRalZkgU8YC6DrVlfgr37UL99b\r\n6AiHzN0Tiv3HQ2hFvWNgAcQuZoditeIeH6p/Tm1YPP4WQ3bQPrsllxbMemfb\r\nuj3zFpvm0Dnici6Hh/Eh3dAHeFknvjYdeOHqlA+Um1LmgtUiUmsDZvP/3YWt\r\nOqbCMPiNYb2iG7pnHSUlC/sqLbJsB5NSJ3o=\r\n=sBMl\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\">\n    <!-- ... -->\n    <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"b05f00c0040fd0d1250297d4fa4236a5b6b00b9a","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.5a5c38538.0","@material/rtl":"15.0.0-canary.5a5c38538.0","@material/base":"15.0.0-canary.5a5c38538.0","@material/theme":"15.0.0-canary.5a5c38538.0","@material/ripple":"15.0.0-canary.5a5c38538.0","@material/tokens":"15.0.0-canary.5a5c38538.0","@material/animation":"15.0.0-canary.5a5c38538.0","@material/elevation":"15.0.0-canary.5a5c38538.0","@material/typography":"15.0.0-canary.5a5c38538.0","@material/feature-targeting":"15.0.0-canary.5a5c38538.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.5a5c38538.0_1681252268782_0.5352373554581571","host":"s3://npm-registry-packages"}},"15.0.0-canary.e4b5ea7eb.0":{"name":"@material/slider","version":"15.0.0-canary.e4b5ea7eb.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.e4b5ea7eb.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"8e81c7cd4bde2b0f4a66e9c42cc584befab48b32","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.e4b5ea7eb.0.tgz","fileCount":37,"integrity":"sha512-lfcZrl3LDHHmKSq9b1NDR1iS7ajAgvLzHuJjkuOpuitaQh50k8BScF5xZDW+msaT/46dCTQ1CHQkXXbUKR8Tnw==","signatures":[{"sig":"MEYCIQDYgTjdqp28vpQub8QaO78n9paQAYKBINXLljtnyrqcYAIhAKNSmAM3jsSWSSFviCeV/qp4IkpZ0zqh1mGXjbV6CZWv","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1224763,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkNeeqACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpNrg/7Bar4X/NQFqWy79O+Qliw4yVMgZ3kp2EBgw5G/D0i9sZWwYko\r\nxEed97acIBZlEJhLhK8VysAwcjB7WR9AclOQasmamqHB3v4ApcbPjTgTU+29\r\n6Zjh3YJBRHSaftp1k4OoMWu1QADib7Q7QT+ssLi0YNFQcG2AkMPs7o7hWcGD\r\nyLKRkKoLyAj8Jj0Yjf8QW8KU92p1OV1MSXEiwgR3HyBhpbDREFCthiE6w2Cv\r\njG988EBU9CqOm7+JP8hEOSClOLUDmP+q3Zv9R6K/yaUlYU1FdIU4ZxubeKmw\r\nNnMLRJVOYR9m4kyRmKW5yyOJhrG8BuOxEhAZ6rtCrOm+4Wy0CiBhu8UP0fVe\r\nY3nZBREJ6RnP+X72Uygho/P5RvjLD2458N8OxztV9z6t7RGDEZSRIR/MFN2w\r\nnSlIeSTbCNFpMBkeK6+U8rxcbFegzlcr9nuwGx5PrWuo1+bfb1TxZAOPZXa3\r\nPBT8RqWUpGnFsyyT6tZr0Ay1Yd7pFn3R+Mb1FnOjeE7RzFs1deFZGh4S0huA\r\ne3cc3/o1mmqMYG5V1niI+Rgs/H0JPN7hdKVx2wPXjbv1xiirtq+Xd5MVmxxB\r\neMY8XJb2ORMLB48SmJjD6odpIE5zR5d56CP4dKg/2rAW/MlxzOX9E0umQzXB\r\nESKVCBNm9AgfOWXsLaMg8v3Ptmyk63HAEqw=\r\n=X6/T\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\">\n    <!-- ... -->\n    <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"cfe1a97277f39a7f96340673857504470245556e","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.e4b5ea7eb.0","@material/rtl":"15.0.0-canary.e4b5ea7eb.0","@material/base":"15.0.0-canary.e4b5ea7eb.0","@material/theme":"15.0.0-canary.e4b5ea7eb.0","@material/ripple":"15.0.0-canary.e4b5ea7eb.0","@material/tokens":"15.0.0-canary.e4b5ea7eb.0","@material/animation":"15.0.0-canary.e4b5ea7eb.0","@material/elevation":"15.0.0-canary.e4b5ea7eb.0","@material/typography":"15.0.0-canary.e4b5ea7eb.0","@material/feature-targeting":"15.0.0-canary.e4b5ea7eb.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.e4b5ea7eb.0_1681254313466_0.7925505476156729","host":"s3://npm-registry-packages"}},"15.0.0-canary.a094dd9c1.0":{"name":"@material/slider","version":"15.0.0-canary.a094dd9c1.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.a094dd9c1.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"a1d46639c7cb8276dc67b86c76d6281a36fb09f0","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.a094dd9c1.0.tgz","fileCount":37,"integrity":"sha512-GNqu/IaGzEwA6R+PU2p4MgwlIqtpDp+xF/uaY2byYrEQusvuJeSPt9HvCga8OzZQu8hEUUQsNSEOK2yVNu2veg==","signatures":[{"sig":"MEUCIQDyBbsZ7fiBs+POMLlx+myAKA/XhPfwlzsNR5BafRZPMQIgAoLnOL9Zst90tGo6BlB5uDrkmsC6BcNvFzASRkql+aY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1224763,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkOdcIACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrAeBAAjHvP2EO8mxRV+nEl4ZZJfwKsrd2JmT+u0MGNErO/AlX0CceA\r\n1/0vmXwwTHIeLQOWsLizV6vOHKUKe3IeHjmHqhks47KyS9oui4hUk7wJHnVM\r\nY41zhyQCMOegH5MmFRtc8PusOw1aedj3joF7NhSY/8XZqwkTsnm94JdhmR78\r\nFrcaPQ4spHOx/ACOUTl8828e4Di18PmaVNYXw0T2JdOUEXFMQ6vTBcVTXyNu\r\n8s/H/1t7wsWxMrNYJSfZEC361/tTVUHnw5nxgFjtCq/anTGRLTEJM8NRzTaH\r\nGORBS6iPDSkmbctCNnjT65I3ufcEFp7qLjf6RwcbMMcP6Z6LGz+ZFbYAa1F8\r\nTRuM/IRy6XGRAlEh1lND5aY28f8bra7vRuu3xXN5Ay/Ve73Xk+7l8q07HkOy\r\nO1yUTVDvhOGJFmAqRuQ2TVcuEFE0NBiShjacLDmIQ586BHgJ21+zgVIkuidM\r\nDgEPUEBMDFqiauX6pJhBTene+d/ffMrUgEFkQdBYOgMWRfOfVgDjwgoPp+Ns\r\nL8bBohVzBlc+8XECFE0CCCRtzeroOPrZF9LXJu+lRh7u7KsZ5D6euuSnNdxz\r\nSHlKo8T/pR/YwvWc2IAg/QRHvCNYNzLd87sEXxQQPtnC1ZLsjS4joBx7qt40\r\nkkap4oA39eGeYwflZ2OhSnSbYxT7KC25UiU=\r\n=+94c\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\">\n    <!-- ... -->\n    <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"aa5164e66f4afe6547ceeadc8a793bb4f489ff5f","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.a094dd9c1.0","@material/rtl":"15.0.0-canary.a094dd9c1.0","@material/base":"15.0.0-canary.a094dd9c1.0","@material/theme":"15.0.0-canary.a094dd9c1.0","@material/ripple":"15.0.0-canary.a094dd9c1.0","@material/tokens":"15.0.0-canary.a094dd9c1.0","@material/animation":"15.0.0-canary.a094dd9c1.0","@material/elevation":"15.0.0-canary.a094dd9c1.0","@material/typography":"15.0.0-canary.a094dd9c1.0","@material/feature-targeting":"15.0.0-canary.a094dd9c1.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.a094dd9c1.0_1681512199682_0.2506997066220804","host":"s3://npm-registry-packages"}},"15.0.0-canary.f771b091c.0":{"name":"@material/slider","version":"15.0.0-canary.f771b091c.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.f771b091c.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"57f5e83375050a3cdf2a1b094c52bd4c9120f210","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.f771b091c.0.tgz","fileCount":37,"integrity":"sha512-S3f7+srrWPrvitgKXblxBgZqrB/EFNOlfO2gMym1IgvturdPSjV3V2VnnK9JNkKP1YWDdL5q+uv9DE7D5HUO4Q==","signatures":[{"sig":"MEUCIQDAK7H5YCmkSxvy3kU0IssEJuvlf6cSM/nCuZeaq3jOxQIgPFjw9K89byxC5kBNDgG86FXE0PnU0PGAS9idCwAwXXA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1224763,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkPWgeACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmo/tRAAnsVBs8VfPcduPqsrHN67h9xWkrS335/FIGTMEH3x8QKqav8C\r\nHxTGCLOZtMGr0McrIF6DBpqdDbQphukWpRDsBoyZ02KmCxykU3uMHxFYWVuL\r\nijD34MAyLe+UjaCEUuWIDbuHjwBbOiKm1xaKlmEYJGur7qTVk3yPnHl9ABGB\r\nK2RZVqul4pQCmj3mlp+JippZWF8XQ5uI8ZzDZdW5LUrj8ohAFvjM+iWUmjwo\r\nveQQE6pTDIh5EARPG3kYRNYlAINBbuA60nWXUfxRDK14AQHuS1TQuSFytyeQ\r\ns5pnC2wP+YffIexNdmU5Z3FmqcxmKvbSUG3H1bHVwIWh2uPQ9kWR5G9Vp797\r\nQOGk2nyFGuCuc3Kvbw4AhFcd5ZyyFtDbyK5KqhoSe0ZWdxtgy2o9yyfL+k37\r\nqIoadU5LVSOs0O3JE7DgkEsbrN5+b5B3kP1H4dI+4PPCsmhmztEmC1iddcj0\r\nOpGdEP86Ty6XfFd86HCfDh8rveHVFM6RVAGPai8NFPZr8ELygRCio45+e94w\r\nwkgsvUmCdGB3u3Nu3s9m9vPRV5V5Nl7484ny21n7RcrxqVExmvxTUhbHfPM3\r\nAz09ebDC6Tgno3P+oyrijUxxdY69SVpjqhAZ74QjaeT7wnHJbiUF6/0SAZoR\r\nqBlQvNMePwkbuZQvQiw++ssLS1Uc56F6Tuc=\r\n=r0SR\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\">\n    <!-- ... -->\n    <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"de0e292c8ebcab887041fc4a59b3c0172f4d4310","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.f771b091c.0","@material/rtl":"15.0.0-canary.f771b091c.0","@material/base":"15.0.0-canary.f771b091c.0","@material/theme":"15.0.0-canary.f771b091c.0","@material/ripple":"15.0.0-canary.f771b091c.0","@material/tokens":"15.0.0-canary.f771b091c.0","@material/animation":"15.0.0-canary.f771b091c.0","@material/elevation":"15.0.0-canary.f771b091c.0","@material/typography":"15.0.0-canary.f771b091c.0","@material/feature-targeting":"15.0.0-canary.f771b091c.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.f771b091c.0_1681745950311_0.41995261651090554","host":"s3://npm-registry-packages"}},"15.0.0-canary.79b1b612b.0":{"name":"@material/slider","version":"15.0.0-canary.79b1b612b.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.79b1b612b.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"9057466b3280185cc031aea282416a2e488183b0","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.79b1b612b.0.tgz","fileCount":37,"integrity":"sha512-MCF7uo4JZuQ+7qHPHKgd0/qHao6GpioG732hcEJrDmtgNOvTizQ/RVH4I05hyCbCOzYDH5Vtbkq3V7W5oV2eqQ==","signatures":[{"sig":"MEQCIFzOZZZAhEG7Ufs1oizOxrBhKxs/iY4EMJ3l0xW71+UeAiB4/DcVHCk/DXDW6gbJWHm9HPTAhbrk0n9GgQzEEIpmBg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1224763,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkQHwOACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoZsRAAhN5rMGss2kuJdRFZV4O69RCh7b2zPO1BDkdtVuoa45Ghd4he\r\nHBzWDaPiL56DIMlV1nnm5P3bjpFiyG66RX/EYO1no1pwTJlJR2BNXE7yWUZA\r\ngBB1CtKjuDHudYKU6SeAGiWlMY8IJruCJ7ALgZL48dGLq0wKyKjVJ/FRdpHI\r\nvbedl0BU+Ed2ryt2+TD97d4DAhgFbZkvoZiilF/XOol6m14VDimxsmePKNht\r\nQcBUU3pgbjLJI893BNcPQguIxaXxl0ZhI3imdcpkx55Q8dBehO7DeIdUEcWY\r\n2YFDyF9+DI7a/ponG/NaskU5m72ey/U3J5nxN+e9AKkGTvhrgNcf1Uoq00yy\r\nwjkOKnX+3buOQehQRbcAmRUtHWbxBFLYMEb5YyU4cdh6sdv0X5/lYLRc8laZ\r\nB7Zf1CqU+rlmY5NdsghR7Q/MKFWZmy6yw8j5D7EC0bF59LOhqhBUqoNZC3Os\r\n7xQXtBqy5F6SmXX9l/02kdMYNxbB4+/jScIa/FW3/ekytOjBIQ6qafEjjghU\r\nj8xhgtI15OudkUuZSZbv9tb10rKfdFyoUxKPKqipLpfvNcTubYnY3P5N4rWa\r\nl/pkr69MSXIuLf8RarTMop9DJfd1kJVwnHtB9ydgFN/XjI4gPsGqu4/ALNyJ\r\nX6oxKITTmY/0EQB8MvtYWz3guBd09/tfUU4=\r\n=DsNo\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\">\n    <!-- ... -->\n    <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"c8248a1b49ee37b1782b19aaa49b5626c914916a","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.79b1b612b.0","@material/rtl":"15.0.0-canary.79b1b612b.0","@material/base":"15.0.0-canary.79b1b612b.0","@material/theme":"15.0.0-canary.79b1b612b.0","@material/ripple":"15.0.0-canary.79b1b612b.0","@material/tokens":"15.0.0-canary.79b1b612b.0","@material/animation":"15.0.0-canary.79b1b612b.0","@material/elevation":"15.0.0-canary.79b1b612b.0","@material/typography":"15.0.0-canary.79b1b612b.0","@material/feature-targeting":"15.0.0-canary.79b1b612b.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.79b1b612b.0_1681947661913_0.05449361604574432","host":"s3://npm-registry-packages"}},"15.0.0-canary.6f50071e5.0":{"name":"@material/slider","version":"15.0.0-canary.6f50071e5.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.6f50071e5.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"d390e577e0a0d223dc40c1676392be21efd59c55","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.6f50071e5.0.tgz","fileCount":37,"integrity":"sha512-PpTpfRTbNjwTtLlRn6NgngzK/Hv39NMiFuSVlMDx+lA0trbyHBw/LrNid51FGc4zWoAO8+QOty1UfALNH0TrSw==","signatures":[{"sig":"MEUCIQDGGsn7ylJ7ja5HQSdezOqI37jhrg+qa932prZBu9EubQIgWY0yRPXYOGwiiRzAtPr77ubJzaVx4WuYl0BA+FNiQ/A=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1224763,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkQX4OACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr4FA//eGG4v30MVh38p82d7rSnJi26SvKH+Z0wyoEZSO4DeDXtIU74\r\nWkjqA/uJsFFlXgkjRZfdoROoMjYYfi9AT5OCh8MkCKkJTgJVpzEcjtyameLY\r\n9/uZdh4Z325YrP6hu+nrEEjiBNt/4fkDyawgAptJ0T994DR7KKd6R5lsRX13\r\nXY+d9HEupzf6eSXBKoIo9TcrSybSQhyLUQ22ma6Ri739wU8mmAsOrUDhKTyR\r\nwxVC/wqDEepGWOJIuCxZiZt3K8RJZuPnlTtP7Xv0Xzm9gEoO92K38dN3V7Rn\r\n3HoZLAx91XeFsQjeweV9hbG6SoHjCb0/hCKb7VUzcSsDmG8o9Kbz6nPayxBx\r\nDw1u3I+wiECi+4sgfZ3rgSjixDPXXVMcqRnaXBxyNNVGNtrb4xuBroChfZ8f\r\nTB2ur1ENw9FBwlhHjGRTtNF30WRExh75X6ha0xMHdNQO7TE0bEIwELdS+tcT\r\nD2Iw7Ke+U2GlzK2sPh+y4eKoDz5+/tpuZt3sn/FxS2g8qLTSvmA4YcYzaahv\r\nyWyPM84e/Lp3ws7CXb8elZ0E9h6c5Vwp6ZAHdqf8qb5yqYKe5O2IntGn2WMs\r\nc4MrguWatafvea1xN/2LC46X+mS4k8oDAJqZgvea+s/6v+5MrKHGHipL4aWd\r\nYGmALTrDAphTzORpWU7zCnworYk5rUgB674=\r\n=j6Ea\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\">\n    <!-- ... -->\n    <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"0a5eb7e7a96b7f207546983c0f79d6fdf23f5228","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.6f50071e5.0","@material/rtl":"15.0.0-canary.6f50071e5.0","@material/base":"15.0.0-canary.6f50071e5.0","@material/theme":"15.0.0-canary.6f50071e5.0","@material/ripple":"15.0.0-canary.6f50071e5.0","@material/tokens":"15.0.0-canary.6f50071e5.0","@material/animation":"15.0.0-canary.6f50071e5.0","@material/elevation":"15.0.0-canary.6f50071e5.0","@material/typography":"15.0.0-canary.6f50071e5.0","@material/feature-targeting":"15.0.0-canary.6f50071e5.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.6f50071e5.0_1682013709784_0.6494042381184364","host":"s3://npm-registry-packages"}},"15.0.0-canary.ef754381c.0":{"name":"@material/slider","version":"15.0.0-canary.ef754381c.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.ef754381c.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"03217f715cbf4ef78bed8bcddac18be2f6060f4c","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.ef754381c.0.tgz","fileCount":37,"integrity":"sha512-9FfpUHbKlX/gZ3XRakf2omtj2kttr6njyPSWqxerEQqL+zrIyQKMfbvj6GbVGCCiGRY+cv7os9+Rj4762ECAKA==","signatures":[{"sig":"MEYCIQDub6Erhil0uAadUaQ9ZSO4rnMALGu+ly1HJk3CwQqMdQIhAND98a9JjzZ5qCI5tSRoCb/FFQS2k8kDzTyVMKK5E/ii","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1224763,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkRuvjACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqE+Q//cluDqiehPzdVHpxHuCqE1zVv9Qfd46l2TYapHqkU18rJmDRt\r\nSxyXzGELEU5qk5aM+LLPsvXoQ2AGRGknU12CsHxNvKKblyLqhbqABEEm3eK+\r\nYr/zZx7XVqc/cutrHvTJCqy2MzjhXukiGGdYW9vxTB6Zx3uUGH/+zSyW++44\r\n/6SDpBBhEaRncpHuuF0EFBEeQT6u+PPgwt/c5IaSLiKxODOMXKaVs3Rkqdog\r\nNsSENXyRYd9LRwsrLgJRlyG9lxgbENvqmZUK3j/ABD+msg5HiCQG872qwAEb\r\n08CRhoFzFNEZD9PXzkYvh7po+F2l2OK/D679e49iZ9v6RpTTVXoG1Vype4Hu\r\nWhTEjj20DWebUvK9YRo6RZjIpP1GZqZofBTWqt0t5iwEwGc0X/ahxt6wZReY\r\nSBPAs9yShWK2V5PFECbMGqRkbpCnMWKoyGG8rppjWEKjXsU4GuXWYQsNCLk/\r\nLyag7gFfiLInyRP1mUvUfWjyZ8toAjGpbQyZWpvOh4UEE+v7ePFYdlWnQu18\r\n1Rq1kfKwai+hxsdrbsiylRXdJTOVbTbp4ol1YuqktxYnXHUa3Y6zD5EGiOVN\r\nucGsjX4rH8lw1iDFz04GZpE4Gd4/RwxJY3UKac/+GKSBcrQOtwirW5J0n56H\r\nLaKxxRg62JsMmI+6o6gOCc9J4Bws4uST6vE=\r\n=q235\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\">\n    <!-- ... -->\n    <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"998bb9432e40056ce6ec836100d9a46f72ace249","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.ef754381c.0","@material/rtl":"15.0.0-canary.ef754381c.0","@material/base":"15.0.0-canary.ef754381c.0","@material/theme":"15.0.0-canary.ef754381c.0","@material/ripple":"15.0.0-canary.ef754381c.0","@material/tokens":"15.0.0-canary.ef754381c.0","@material/animation":"15.0.0-canary.ef754381c.0","@material/elevation":"15.0.0-canary.ef754381c.0","@material/typography":"15.0.0-canary.ef754381c.0","@material/feature-targeting":"15.0.0-canary.ef754381c.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.ef754381c.0_1682369506753_0.43327909315020063","host":"s3://npm-registry-packages"}},"15.0.0-canary.69ebf61ea.0":{"name":"@material/slider","version":"15.0.0-canary.69ebf61ea.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.69ebf61ea.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"b169b849375e9246bd905e8f17823d981aa3b1f9","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.69ebf61ea.0.tgz","fileCount":37,"integrity":"sha512-y1QzuiK/KgExlA8ysek4kWM1u3gJyy6FlcJiuohO2rqPZ0ekudfxp9xIBDlrRSNZcH60n/UpEdKkTWIpoq+/7A==","signatures":[{"sig":"MEUCIQDHw9XRU0tXWBOVbnytQl3zQG/pVSxzeJDianKjoufXXwIgYyzB2htWG178l1QJzFh/wbxneuXtzMwtbrRpIlaHOL4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1224763,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkSq9SACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrBtQ/7BA9/hlyHsvcrbBQdfX8Cbt5ojmR17KZoQ96y+oUFMGH79Dt7\r\nc4IF8gTZ3TNeXpCmUdBoIiBxZw8jp0baPKotTXXWpYo54RqrP2tyF5zJVL+e\r\nP44Y3enT36/PMcoDOPlMWLomHoKc80Im1V6/CQlM2rQReBatWEEjUf4rZ911\r\nSj1nHFev6tmJyuTNNZk6IN3xfoeXaYsOhEjs9sYyA56AsBl/ayYJPG/17N3V\r\nY0VJ2I9/IXfqqSwHovg1Hii+iDyCm/gheVPJG+Hhu9B4QbB5lopceDQ9jpKr\r\nE1E69kSuJje+HwF9BvdexyOHyEYvHJaZD7g82qd1E4d74L0Z4QJciA72d2k/\r\nRdIpXlHl+9cG10zid9Zm6zeQmb5xsugPJXPvg79Hjixgv2zGMkPY7zn0jCO0\r\nWtEXLwO/yMcsxSngoo6eRqfjvC4Oy8DAj5zlvSxqM3yaIjol5gSUhAO4j88X\r\nnhgd/lTnH/Si+v0/bWkFCEiVEO1NHcXKmYABqSd/L3FaEJ3YLKB9ekX9olVE\r\nrtn0iLR7V84zJEWmifSmSgae7eoKgI86Y0cga7xlPpiWzSX7RQRSgW94yg4r\r\nQzMJyLaBnn+NghGtePHm/XKDVIftsCxqwGzwUNavFJeOysut19zqfXNBKX7q\r\nzJWrGDZJSV+5W9BW0Kba7OxDPoKLdrmLwmM=\r\n=Fcf1\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\">\n    <!-- ... -->\n    <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"e68ad025642429a51f137e9f3fc853364faf0622","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.69ebf61ea.0","@material/rtl":"15.0.0-canary.69ebf61ea.0","@material/base":"15.0.0-canary.69ebf61ea.0","@material/theme":"15.0.0-canary.69ebf61ea.0","@material/ripple":"15.0.0-canary.69ebf61ea.0","@material/tokens":"15.0.0-canary.69ebf61ea.0","@material/animation":"15.0.0-canary.69ebf61ea.0","@material/elevation":"15.0.0-canary.69ebf61ea.0","@material/typography":"15.0.0-canary.69ebf61ea.0","@material/feature-targeting":"15.0.0-canary.69ebf61ea.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.69ebf61ea.0_1682616146044_0.9332803712955784","host":"s3://npm-registry-packages"}},"15.0.0-canary.b90be86de.0":{"name":"@material/slider","version":"15.0.0-canary.b90be86de.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.b90be86de.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"bdf90aef3675b4a2102df39b824d8ef79ebed83c","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.b90be86de.0.tgz","fileCount":37,"integrity":"sha512-GeI+td8MUny6/7sFoqGUuV10x6viyysXrxitcEn37oubn+uPZKu7sIsrmVqHCL6JWQMK79SGn7Z1R0rvtqZi/A==","signatures":[{"sig":"MEQCIE4Wcf5mOEGmoTZPk5xONsNSAvw3rPfm9wG/G6WX5LOFAiArnrkX5z1Mi9bsfG6sGcylHJ9TAplbgCFtyTPtNrxwqQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1224763,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkTGNEACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrmaQ//aUBRdujxHNmqZYVBlY2LhSXfxRa9SEGcPkHCL0mwy+6P8npb\r\n2SLry9x/zkJcroBdDjfFBYVpoA1FVWroeA4zWc5bLCyQ/GudtiMj4tLr7AYH\r\nHtNSYOTCKPoqy3ryufMDGppqBlE50gnpW5yZ8kjHOLFUkc7RM4Sc395xX/fh\r\ntzfv4U0Mtnb45gfbDVZEyR05CJeBpj+u8BS5eNKbeJh39oibYCi5FH5MgDhp\r\nnCFEy8cdQbvxutvUZJ0fLV1myc1Dw9CIgu1+atYgT3zU/oaX4AStNXSYCJMa\r\nrQ8fAUF6BKLMhCchU32j1i0QVDQT6jlWWGcgqarIsegM28Sm6XsFAaJpTAQ0\r\nFQKRue98s4RZCRk6Tpj8ExTlIsSjZeW9qHiVYZr3/pMl7+LrgObDDXnEhaaG\r\nvgqwPTYJwPIWPCb0gyDN/DbOUjf9yYHPPrSKs/9FWnAWPGFeZ8iXPtfLQ0c9\r\n5lE+2WIdlqY3u2iMRVECYkAzZUNsKOsu9odcV3bs5RhQla+Paz+mEtBdnmIW\r\nF342VUGnZ924vDEj7oH0H2gaZS+KBAIeonZzIimd4DaNXidQfEWKV2L5uwml\r\n1X2bP+bRL38J+8MmGbdOK60YcnzuBYbPFLhFqejElDIbZc4SBM2AmRCUQx6P\r\n+vs2cEcZEoJUnMghEp5+Yu4suZ1RD82LQhs=\r\n=H996\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\">\n    <!-- ... -->\n    <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"903a4c00d6c4501b4eae8ac0007164ef4a97ce0e","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.b90be86de.0","@material/rtl":"15.0.0-canary.b90be86de.0","@material/base":"15.0.0-canary.b90be86de.0","@material/theme":"15.0.0-canary.b90be86de.0","@material/ripple":"15.0.0-canary.b90be86de.0","@material/tokens":"15.0.0-canary.b90be86de.0","@material/animation":"15.0.0-canary.b90be86de.0","@material/elevation":"15.0.0-canary.b90be86de.0","@material/typography":"15.0.0-canary.b90be86de.0","@material/feature-targeting":"15.0.0-canary.b90be86de.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.b90be86de.0_1682727748537_0.8511028817151085","host":"s3://npm-registry-packages"}},"15.0.0-canary.51f9c0c28.0":{"name":"@material/slider","version":"15.0.0-canary.51f9c0c28.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.51f9c0c28.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"843879b03ac930a92b6893fe4c2b1a26a4f0ba46","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.51f9c0c28.0.tgz","fileCount":37,"integrity":"sha512-LxZRzXMRjc9mmMz3PYY6QOl85WHH9AoBox3+kNaB5J7Q9J/LaCRdqHHpOvh05n+MVZcecaV+UdADxQ8dJbR0Fg==","signatures":[{"sig":"MEUCIQCnDMEd4Ik2bGCDnR2U6fdRvHyaVn41o4ynzGxYeEJb3wIgcB94e9kpdH5q57hn8GF/wFhEYUPh49ECxKptDCo5gIk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1224763,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkTGWNACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr2uA//U0iwFpe04/z3cLl2RFtb3yLO6Khf/AZAxQs0EQrwWQXmFPNo\r\nkD9TVKu1ImHKB2N6PO1b6fTLvDqzSZfSC6ZzZhvmbSLukBmHr3g3P+qP9tSM\r\nRNofG8OjMtXRafIqXdMV2dFnWKzZvKa6gpp3NC67n9OYDg/yIYJ76zvem7KV\r\nthLktm1TEZWFk2nuPZDNzRXoY07tftKDC9q/wlc67g5WhgMQZwWA29qn2Qed\r\nto8dMk1utV1jDR6cCiyHCzLLy20pdRSmvEKxYHH9dLb0tFH0/btaJi5dMiuK\r\n63m0np/JVML5jnV7R6e2FjOd6CDej2vZWpvh2cPDhUXg7LGsrrhJ8pdbx9DA\r\nV6DwKg0Kq0VaGJfNTtpSvGLKU1CfeB2EDZTCNO0S1yKJgUDT3uAT6pR8ZeFt\r\nJ2R2pz7bD3xByvyEGW/pbNVA26eQnF5cc5Nm1Z9WGsM5tSU+RPsDA86kSm4V\r\npkUolRQvVw5d2a9QQlO3vBnY6JAF7cwt+FaZ96e4Rl5XLHXJmP+BYSorsixE\r\noT/+iZIsyg03YVCE+HJWRrNf9bzbSmIf40K8HvDiF0qFKOKbJqd7rH6+HHpc\r\nZSux/N5f+zkgNrU6+3JtBu2MKPau1aSL29VsqHe5TNg//1E9NU7gTRaNYJED\r\ny6Pd2ZBVnJAG4fr5vTjf7J4v/BtIOzxuokg=\r\n=DSIY\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\">\n    <!-- ... -->\n    <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"87662f1719363ac8e600f73ed8a7795c25d8add6","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.51f9c0c28.0","@material/rtl":"15.0.0-canary.51f9c0c28.0","@material/base":"15.0.0-canary.51f9c0c28.0","@material/theme":"15.0.0-canary.51f9c0c28.0","@material/ripple":"15.0.0-canary.51f9c0c28.0","@material/tokens":"15.0.0-canary.51f9c0c28.0","@material/animation":"15.0.0-canary.51f9c0c28.0","@material/elevation":"15.0.0-canary.51f9c0c28.0","@material/typography":"15.0.0-canary.51f9c0c28.0","@material/feature-targeting":"15.0.0-canary.51f9c0c28.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.51f9c0c28.0_1682728333493_0.17253950888526726","host":"s3://npm-registry-packages"}},"15.0.0-canary.4e840d685.0":{"name":"@material/slider","version":"15.0.0-canary.4e840d685.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.4e840d685.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"8dc8495e400381a22ff3cb3038f7c80030c9cc87","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.4e840d685.0.tgz","fileCount":37,"integrity":"sha512-HSiIe9vwPOH4lBm8OydmcJMuZatYoSuM3h0k5FWHobEhwNlzuXweKyVOaowJNnLy4ZZHRJxi7AFna3ouCNZf8w==","signatures":[{"sig":"MEYCIQCxwD4RSJ156LrnD3he1lbRo3hFxJKiQvFxOLLdZ9tYtQIhANtyxoaaCwg8gS3l6HNaoB/sPMx6M7XHxPPWr//uO87W","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1224763},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\">\n    <!-- ... -->\n    <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"feb1f9f53257b520aff6dfe5dd1a15e319e73a40","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.4e840d685.0","@material/rtl":"15.0.0-canary.4e840d685.0","@material/base":"15.0.0-canary.4e840d685.0","@material/theme":"15.0.0-canary.4e840d685.0","@material/ripple":"15.0.0-canary.4e840d685.0","@material/tokens":"15.0.0-canary.4e840d685.0","@material/animation":"15.0.0-canary.4e840d685.0","@material/elevation":"15.0.0-canary.4e840d685.0","@material/typography":"15.0.0-canary.4e840d685.0","@material/feature-targeting":"15.0.0-canary.4e840d685.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.4e840d685.0_1683041671954_0.6383652840023297","host":"s3://npm-registry-packages"}},"15.0.0-canary.10b8563e4.0":{"name":"@material/slider","version":"15.0.0-canary.10b8563e4.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.10b8563e4.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"6d1e6c12c0d8ba7ed09b8cf8be2744d988461cbc","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.10b8563e4.0.tgz","fileCount":37,"integrity":"sha512-xbwB2RfeKZM8XvrNGUQM/Xb9cb6Rv2XtqALjoDwJXscfJJjD1Z6NemOykhXCKbHQDtLRoqsB0kfO7Gn+sxBEjw==","signatures":[{"sig":"MEYCIQC4HgZoh/9EivqyAZdsPmO9bV1Av+Pa66dSkOKU9LFgqQIhAK27jZOmHyhx2TLHwdPsC0mqZLhm3aVIFDWgekzuCmDl","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1224763,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkUZ/uACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmoevw//SFQ2bz8QzAL5uue0SIfsYobuEhIAr0pt+gMGt4uIR36tEpAp\r\nyDes2LVDRjE2h10Ek039s9fLLn4ztqnN2mv0BulOtHjBXD1xbgTc+HYCB93E\r\nIMZEkajZtv2SgLewZqVD900RRPf48dISHk3U0pQvMrzGYZY5uIqXJoUogBgv\r\nVYijPUrMpMQk3CvxOCY7xHkp+UHBvykfgtdK0C9gl3mPc3b5ZlhcjVfG7lsb\r\nsnqeavmadcCWZHU3kdT9PJ8UcKhFV/25RR8pX9ChLTaJIL4txolOhCCviqtA\r\njskuoSCHCeGXedoJzm9O6LWhC5EB2EumNGLPscHaG4+G6EM4D8uDlIZRwGIZ\r\nECI9uidcoylWnnoW0Sk3X8/uJ52NzB/8AggwAMhIr5uLzv5XuPlGAO8uc0Rh\r\nujyCHW2XEBxLsNW3YJUGd2fZkssFvywQ2RC79gIjBgT1nzw3fCZQ1Kd+YVQj\r\nFnDYqqy+LKJtB04mEn16ZpNsrsdYtRTCj7DHdZOGNBc5lSr/8xveBqjUrmU9\r\n9XGz5JpLXAwLgzxhzF9lSvGcG5vdgQjwjQoGIqSqFTMrbrXvAfU7BjiyD7Ea\r\na9I3OaE6v1urXZLQOTb8gKkH0GLUjlTqpYoJkpOKZggZ/UvxBIbHjbiMjP4u\r\nTnbDPQNGmA928/f5dwTUm1OYvf5o2BLDwvM=\r\n=VJPH\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\">\n    <!-- ... -->\n    <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"5f71dcbe45f5245c72c0fabae0162af558c5c395","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.10b8563e4.0","@material/rtl":"15.0.0-canary.10b8563e4.0","@material/base":"15.0.0-canary.10b8563e4.0","@material/theme":"15.0.0-canary.10b8563e4.0","@material/ripple":"15.0.0-canary.10b8563e4.0","@material/tokens":"15.0.0-canary.10b8563e4.0","@material/animation":"15.0.0-canary.10b8563e4.0","@material/elevation":"15.0.0-canary.10b8563e4.0","@material/typography":"15.0.0-canary.10b8563e4.0","@material/feature-targeting":"15.0.0-canary.10b8563e4.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.10b8563e4.0_1683070958599_0.45957895791990033","host":"s3://npm-registry-packages"}},"15.0.0-canary.736b7fda4.0":{"name":"@material/slider","version":"15.0.0-canary.736b7fda4.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.736b7fda4.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"e67706ae1c494ca715ccabbf1d29c88c912fc3de","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.736b7fda4.0.tgz","fileCount":37,"integrity":"sha512-98MhHnWo1AzI9BOgdyd6O1to4oAU397Xiq5y6gc6J3qkB69Omb5WlSGdMdtJCOkhf+uVZGvFkibO6keRPDurgg==","signatures":[{"sig":"MEQCIC++eV9Z/4VAL5lJUR6MWtps+y4IeYoEPJWqCrqb+DsEAiAeZzuo6Ob7e8JldMKKczyWawUQE5TbKlFMNIuJLgGBug==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1224763,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkUnlcACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmpd4g//SS50nEMumSeQTDVkUIiQhRShyT8JdTlk2FWE6Dwe4WqNj6yh\r\ndoUY8UN9U2WHtFV8hloQPnEWUWNz50GD+YmI84Jly1zEpHJbHRWXkhHI/BIJ\r\nSm+Ol/7IB2mPIqAZ0v8Pht84I6W2qCri+SXh7BO49sm4hJIsCPXn28iakvpG\r\naSMLiohXmxJ5xw3fSsiOkAJIkl83nl041Ad1KVrdNbuECW3pFoQC56wLUmAF\r\nrHAICkwwIUhg+H4ikCNmFBH/Pmzu9bMHtjfnW1S1tHuACwmTG2EuCQgFwLeG\r\nmiuNCFnaMJN1SF2vGP89EL8iwnWg4AoRM5t3uxIcV9gnSniPmmLYOMN3PzXf\r\nZsIyVFDYVcbZcXcPTlmS0kYiy11vRKKClulX/gghzv8mIlkkOjCi8uiLU68t\r\nXgwKh4EcgNDjKfDKl+o6fFst6q2xrbY6+NdQZ/a2tY/BL38E75HnC11bz4Sh\r\nv/4yO8SXvX5NQN7r0HTyciv8bAxsru0rexoS1b6KHLGynCJ6ZAqPdPOl7Gc1\r\nN0VoFOcYunMbdZGeVN9u/bmQYTKAHIE+RAR0vv/b3SrOICLVuGegJA/EUkgc\r\n5l3bnsGF7IDFmeWFvAxsPBkLCcQaRIzCzAHo0PJC3TDf2t5WQX72zbEogdiv\r\n9EX/vXNZnMZUEq+qGniGX4ZMSahmJWLh4Lk=\r\n=5Cvv\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\">\n    <!-- ... -->\n    <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"b9ef54594aa8f93612aed085460f035d0aba61bd","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.736b7fda4.0","@material/rtl":"15.0.0-canary.736b7fda4.0","@material/base":"15.0.0-canary.736b7fda4.0","@material/theme":"15.0.0-canary.736b7fda4.0","@material/ripple":"15.0.0-canary.736b7fda4.0","@material/tokens":"15.0.0-canary.736b7fda4.0","@material/animation":"15.0.0-canary.736b7fda4.0","@material/elevation":"15.0.0-canary.736b7fda4.0","@material/typography":"15.0.0-canary.736b7fda4.0","@material/feature-targeting":"15.0.0-canary.736b7fda4.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.736b7fda4.0_1683126619989_0.27915180987738575","host":"s3://npm-registry-packages"}},"15.0.0-canary.0e533c5a1.0":{"name":"@material/slider","version":"15.0.0-canary.0e533c5a1.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.0e533c5a1.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"51595c7b155182bcb22b05e489f55cb0765e2d0d","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.0e533c5a1.0.tgz","fileCount":37,"integrity":"sha512-2x95EutC7v5RcZu/cAxsahPDOhnFibVwargHbWaXRrnmw86Ea8qFdjvvTvCNR7JhZz/skBC6qRY/xZZTQL79IQ==","signatures":[{"sig":"MEUCIATzapmS/UhK6+x0vw9taXAywnpXPmhc8mgJ02C1E5NtAiEAn9SYQ3ss18eykY2BvyXfvBoOJwowqXKbGGwbC7k0P0M=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1224763},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\">\n    <!-- ... -->\n    <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"6b9b4497cc6457c9e92ab3abdaad626c73e610a4","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.0e533c5a1.0","@material/rtl":"15.0.0-canary.0e533c5a1.0","@material/base":"15.0.0-canary.0e533c5a1.0","@material/theme":"15.0.0-canary.0e533c5a1.0","@material/ripple":"15.0.0-canary.0e533c5a1.0","@material/tokens":"15.0.0-canary.0e533c5a1.0","@material/animation":"15.0.0-canary.0e533c5a1.0","@material/elevation":"15.0.0-canary.0e533c5a1.0","@material/typography":"15.0.0-canary.0e533c5a1.0","@material/feature-targeting":"15.0.0-canary.0e533c5a1.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.0e533c5a1.0_1683305838969_0.29214134050195684","host":"s3://npm-registry-packages"}},"15.0.0-canary.5f01c15a2.0":{"name":"@material/slider","version":"15.0.0-canary.5f01c15a2.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.5f01c15a2.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"3f5f2938fd5d97168c86fe79264a3f57d804cd01","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.5f01c15a2.0.tgz","fileCount":37,"integrity":"sha512-UTm4Kan7QbLCBnVvWyB6L5OCFmOPlLYGmy0/AFspV3qxx4XkDcwzXbr0TF6vp3zo737thRF9bkjZMEwuMu9ZrA==","signatures":[{"sig":"MEUCIQDl8MMMZ7qKUO+C18y8MNkGqiRWwbR/zGR3ELcNzwocsgIgYG5qDjQBgh9x8C+ZMYwnMT+0G1PB2RUbIcucrWygHbE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1224763},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\">\n    <!-- ... -->\n    <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"7bb1c5dfc575b36654ae046d1f4ab3b27e8c8f9d","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.5f01c15a2.0","@material/rtl":"15.0.0-canary.5f01c15a2.0","@material/base":"15.0.0-canary.5f01c15a2.0","@material/theme":"15.0.0-canary.5f01c15a2.0","@material/ripple":"15.0.0-canary.5f01c15a2.0","@material/tokens":"15.0.0-canary.5f01c15a2.0","@material/animation":"15.0.0-canary.5f01c15a2.0","@material/elevation":"15.0.0-canary.5f01c15a2.0","@material/typography":"15.0.0-canary.5f01c15a2.0","@material/feature-targeting":"15.0.0-canary.5f01c15a2.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.5f01c15a2.0_1683307627043_0.11046840372010114","host":"s3://npm-registry-packages"}},"15.0.0-canary.3b5b55e31.0":{"name":"@material/slider","version":"15.0.0-canary.3b5b55e31.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.3b5b55e31.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"920f8849adc93cb7bdd6f7e432f57491c75de710","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.3b5b55e31.0.tgz","fileCount":37,"integrity":"sha512-Eu/h6pWfhVxm2t/oyQlUXyzh4x0nynvZZl2XanZ4v84Bt4eEGSwjaECQdaU+Wf6pAkwZRx5Acl3LiyV6cu8vRA==","signatures":[{"sig":"MEUCIAZJ8VTLjldGjpSx7uVGdsL+HL8yNNRMtRw7bP1p0jjZAiEA3I7JbuL2ZqhpAmAaKfoKDmb11e1tIhSUqCraxzhahFw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1224763},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\">\n    <!-- ... -->\n    <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"c262d9ee39655e869886d1584551a096ae56dabc","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.3b5b55e31.0","@material/rtl":"15.0.0-canary.3b5b55e31.0","@material/base":"15.0.0-canary.3b5b55e31.0","@material/theme":"15.0.0-canary.3b5b55e31.0","@material/ripple":"15.0.0-canary.3b5b55e31.0","@material/tokens":"15.0.0-canary.3b5b55e31.0","@material/animation":"15.0.0-canary.3b5b55e31.0","@material/elevation":"15.0.0-canary.3b5b55e31.0","@material/typography":"15.0.0-canary.3b5b55e31.0","@material/feature-targeting":"15.0.0-canary.3b5b55e31.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.3b5b55e31.0_1683312006567_0.5844313103354157","host":"s3://npm-registry-packages"}},"15.0.0-canary.d0788120f.0":{"name":"@material/slider","version":"15.0.0-canary.d0788120f.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.d0788120f.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"73fd647b76afe25dd9a37049d488f6fad070ad61","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.d0788120f.0.tgz","fileCount":37,"integrity":"sha512-Tni4AoicgtPmzCm/USka1CB3uQVK9o9yshb3hrhFRYieGNiozwjGp2qpee3oc/pDhMPIgLt/fpchAlSg9k+BXQ==","signatures":[{"sig":"MEUCIQDEX/GcDL5JgcgSgShLK/hj7r5g5psu1zHBf2U0igkfNAIgeqHU46+d+F8yTZ0n0G6n+LEAUIPkTHH+gtKvoS4hCKo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1224763},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\">\n    <!-- ... -->\n    <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"7eccbee262206623b89c40dadb4e11abe30d5e45","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.d0788120f.0","@material/rtl":"15.0.0-canary.d0788120f.0","@material/base":"15.0.0-canary.d0788120f.0","@material/theme":"15.0.0-canary.d0788120f.0","@material/ripple":"15.0.0-canary.d0788120f.0","@material/tokens":"15.0.0-canary.d0788120f.0","@material/animation":"15.0.0-canary.d0788120f.0","@material/elevation":"15.0.0-canary.d0788120f.0","@material/typography":"15.0.0-canary.d0788120f.0","@material/feature-targeting":"15.0.0-canary.d0788120f.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.d0788120f.0_1683620642562_0.1398961562363934","host":"s3://npm-registry-packages"}},"15.0.0-canary.f52358dd0.0":{"name":"@material/slider","version":"15.0.0-canary.f52358dd0.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.f52358dd0.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"496e26454505a672df4a11f58971b600b0a0c986","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.f52358dd0.0.tgz","fileCount":37,"integrity":"sha512-edhOdOUpLPOXet+HC+DXoHTaxL5f23UgHkejqI3bjsZyuob4EYzoge4Ak7RogydvDBKte6cXyjwzWXtYig8E2w==","signatures":[{"sig":"MEYCIQDGLxu/fio3A+MJOPuyyXSEE63/pnEmcFwbT2pNODRjwgIhALRO2nNbNXVEtHC7TifaEv3Dytj8usQNZvOmI1EKh5HT","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1224763},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\">\n    <!-- ... -->\n    <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"a4baf07a9736a6e1fa40001f7198ae1865d67392","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.f52358dd0.0","@material/rtl":"15.0.0-canary.f52358dd0.0","@material/base":"15.0.0-canary.f52358dd0.0","@material/theme":"15.0.0-canary.f52358dd0.0","@material/ripple":"15.0.0-canary.f52358dd0.0","@material/tokens":"15.0.0-canary.f52358dd0.0","@material/animation":"15.0.0-canary.f52358dd0.0","@material/elevation":"15.0.0-canary.f52358dd0.0","@material/typography":"15.0.0-canary.f52358dd0.0","@material/feature-targeting":"15.0.0-canary.f52358dd0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.f52358dd0.0_1683901879938_0.6156170860442509","host":"s3://npm-registry-packages"}},"15.0.0-canary.576d3d2c8.0":{"name":"@material/slider","version":"15.0.0-canary.576d3d2c8.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.576d3d2c8.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"22ee3cdebc2fd5c6ef7a03531d978bbecffb77b1","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.576d3d2c8.0.tgz","fileCount":37,"integrity":"sha512-80GPBNJXWO3tCK95P49H+Ru/+Q6E6NNwGgZHx6L5ADFKJt5k6jZLwjZ1DlX5kqD10WpV3qVggSxbP9/TgGdNAQ==","signatures":[{"sig":"MEUCIQCGdaRAzwYyWW6dHIay/cBCxXJgmAxOjv5PFvnBb4nL+QIgXC0IK4SJnRqqRiANZlG2uAJxbgoxHnam8QjvfqXHmko=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1224763},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\">\n    <!-- ... -->\n    <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"6ace19a21b6654f14cad48fc007198859874c910","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.576d3d2c8.0","@material/rtl":"15.0.0-canary.576d3d2c8.0","@material/base":"15.0.0-canary.576d3d2c8.0","@material/theme":"15.0.0-canary.576d3d2c8.0","@material/ripple":"15.0.0-canary.576d3d2c8.0","@material/tokens":"15.0.0-canary.576d3d2c8.0","@material/animation":"15.0.0-canary.576d3d2c8.0","@material/elevation":"15.0.0-canary.576d3d2c8.0","@material/typography":"15.0.0-canary.576d3d2c8.0","@material/feature-targeting":"15.0.0-canary.576d3d2c8.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.576d3d2c8.0_1684202451672_0.05629049485111759","host":"s3://npm-registry-packages"}},"15.0.0-canary.19bb36a46.0":{"name":"@material/slider","version":"15.0.0-canary.19bb36a46.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.19bb36a46.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"d871fb79cd425ff6f8301c0e917a5b626f2fc82b","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.19bb36a46.0.tgz","fileCount":37,"integrity":"sha512-G30hmhEDnvDD66wDOSise9kYrMMuG5lTa79M4emOoEMkBM9rDsTJGtwGZ53SCnvAsmivu5MJdK6CT2LT9TNj2g==","signatures":[{"sig":"MEYCIQCGcYaaj/98QKFJSSlZko04/QcgqXESc9+ChZks0E8gLAIhALZzfNjaJztLi06ixm2hS2s9HU+8AKthEx3+GYiVnOWj","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1224763},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\">\n    <!-- ... -->\n    <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"75157be315eeaa02f70ed69f97e44a7d40d53e42","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.19bb36a46.0","@material/rtl":"15.0.0-canary.19bb36a46.0","@material/base":"15.0.0-canary.19bb36a46.0","@material/theme":"15.0.0-canary.19bb36a46.0","@material/ripple":"15.0.0-canary.19bb36a46.0","@material/tokens":"15.0.0-canary.19bb36a46.0","@material/animation":"15.0.0-canary.19bb36a46.0","@material/elevation":"15.0.0-canary.19bb36a46.0","@material/typography":"15.0.0-canary.19bb36a46.0","@material/feature-targeting":"15.0.0-canary.19bb36a46.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.19bb36a46.0_1684266891365_0.5519103601647912","host":"s3://npm-registry-packages"}},"15.0.0-canary.aa5ac7fe5.0":{"name":"@material/slider","version":"15.0.0-canary.aa5ac7fe5.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.aa5ac7fe5.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"57b95ce724e9e56bf2841254d06cb71fbf40bb28","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.aa5ac7fe5.0.tgz","fileCount":37,"integrity":"sha512-VNVQt0vY7iSYUQhz/TUaaxN6zk+ENfCMZLUTJAoGW1oubYT3yvEDM00a640AZ9NyAKJ7vnpgfVOtR+IEW0lkpw==","signatures":[{"sig":"MEQCIB/sCZrhyW/SBdJpBxuOkUx8TGA4/uAeDUz50n02SLPUAiB1O08h/g01hgszY3VmB6EGPrv8WEPhm7dSeTG5ekietA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1224763},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\">\n    <!-- ... -->\n    <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"83e86542dd6facc8ffe487d31111412ee18b5bde","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.aa5ac7fe5.0","@material/rtl":"15.0.0-canary.aa5ac7fe5.0","@material/base":"15.0.0-canary.aa5ac7fe5.0","@material/theme":"15.0.0-canary.aa5ac7fe5.0","@material/ripple":"15.0.0-canary.aa5ac7fe5.0","@material/tokens":"15.0.0-canary.aa5ac7fe5.0","@material/animation":"15.0.0-canary.aa5ac7fe5.0","@material/elevation":"15.0.0-canary.aa5ac7fe5.0","@material/typography":"15.0.0-canary.aa5ac7fe5.0","@material/feature-targeting":"15.0.0-canary.aa5ac7fe5.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.aa5ac7fe5.0_1684776399499_0.7040043272119874","host":"s3://npm-registry-packages"}},"15.0.0-canary.90291f2e2.0":{"name":"@material/slider","version":"15.0.0-canary.90291f2e2.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.90291f2e2.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"7b1a5a41e98615e7f187ea766c139b99a77a5151","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.90291f2e2.0.tgz","fileCount":37,"integrity":"sha512-krbdGHcROlvnZ0X7HT0d+PvJummczeShQeWeV/ZezXnQM7bQoy86qfwtX4ai1dIXYkF9qKTFlta2zZezTJyf5g==","signatures":[{"sig":"MEUCIQDiYBGmC5pIts8tfxTuxkIVuLKiVGQ3RgPVg7cx6ferhwIgMh8kG5yAWbZehIxY0DuCEjGkqrH3NKSnwTrDmIgYn7A=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1224763},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\">\n    <!-- ... -->\n    <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"a1c306471717b15ae8f0b481703ed1b46162df25","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.90291f2e2.0","@material/rtl":"15.0.0-canary.90291f2e2.0","@material/base":"15.0.0-canary.90291f2e2.0","@material/theme":"15.0.0-canary.90291f2e2.0","@material/ripple":"15.0.0-canary.90291f2e2.0","@material/tokens":"15.0.0-canary.90291f2e2.0","@material/animation":"15.0.0-canary.90291f2e2.0","@material/elevation":"15.0.0-canary.90291f2e2.0","@material/typography":"15.0.0-canary.90291f2e2.0","@material/feature-targeting":"15.0.0-canary.90291f2e2.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.90291f2e2.0_1684863817424_0.07307434408155289","host":"s3://npm-registry-packages"}},"15.0.0-canary.446734f27.0":{"name":"@material/slider","version":"15.0.0-canary.446734f27.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.446734f27.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"a9ad4cbf86c7f6449960d55960b921dda060c89d","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.446734f27.0.tgz","fileCount":37,"integrity":"sha512-prPrGubugJe4m5CSWwMCD5/rkrEue5sW4hL3Pg8P6bpE578zGK5eFs6yl1+A5/7hm7C6gtUOJYkdQAJVnzDYSA==","signatures":[{"sig":"MEUCIGapsciUsofmT7rX+PhYKMCmYETc0XH1TlsNyNrqxNgSAiEAgI7TVsYGoiqP7mZXJka+6f7L4m3O3QGOTidKUzJkgM0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1224763},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\">\n    <!-- ... -->\n    <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"a2536a849aada5f06aa85deaa7be06f44f620023","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.446734f27.0","@material/rtl":"15.0.0-canary.446734f27.0","@material/base":"15.0.0-canary.446734f27.0","@material/theme":"15.0.0-canary.446734f27.0","@material/ripple":"15.0.0-canary.446734f27.0","@material/tokens":"15.0.0-canary.446734f27.0","@material/animation":"15.0.0-canary.446734f27.0","@material/elevation":"15.0.0-canary.446734f27.0","@material/typography":"15.0.0-canary.446734f27.0","@material/feature-targeting":"15.0.0-canary.446734f27.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.446734f27.0_1685483343904_0.6723500127307618","host":"s3://npm-registry-packages"}},"15.0.0-canary.19de312d8.0":{"name":"@material/slider","version":"15.0.0-canary.19de312d8.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.19de312d8.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"b0512ea885aaf5ab7cf7f79dcb93ebfe2cce5e82","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.19de312d8.0.tgz","fileCount":37,"integrity":"sha512-l+1ZhX7AsXVXBNO+Qmw1/8Fvvf6QKMQolRTwksZU85rsg6RE/KWg++FaLuLpzLnPIadZgYRgt24ujWGgsvfsKQ==","signatures":[{"sig":"MEUCICPbYt3pB4ZWdVJB5WD7SIvsHcyee3OKtIQ3cdWDrAR5AiEAmbYmPUgQw7nJBx6PCzIyT2cI52X1/3OgzR3XGTOzK/o=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1224763},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\">\n    <!-- ... -->\n    <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"dc3811573a34ccafa5c09bcf14574bfb95373958","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.19de312d8.0","@material/rtl":"15.0.0-canary.19de312d8.0","@material/base":"15.0.0-canary.19de312d8.0","@material/theme":"15.0.0-canary.19de312d8.0","@material/ripple":"15.0.0-canary.19de312d8.0","@material/tokens":"15.0.0-canary.19de312d8.0","@material/animation":"15.0.0-canary.19de312d8.0","@material/elevation":"15.0.0-canary.19de312d8.0","@material/typography":"15.0.0-canary.19de312d8.0","@material/feature-targeting":"15.0.0-canary.19de312d8.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.19de312d8.0_1686071958005_0.3528775211306652","host":"s3://npm-registry-packages"}},"15.0.0-canary.6081d829b.0":{"name":"@material/slider","version":"15.0.0-canary.6081d829b.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.6081d829b.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"8ee72c7c99d3e93045d637c0a483f118175c895a","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.6081d829b.0.tgz","fileCount":37,"integrity":"sha512-UN2pNbFxozlA7mJR6JQiLivy/ra9e4O2RHFoZJdycfKRI2S0RBnnwtZ5Thk05TALjjGP71s7dOD0LWaSaXOWBg==","signatures":[{"sig":"MEYCIQDuzPgGuQO8KW+5tT6HQHSGNvZjzQuYtyxnlZzf4fGTTQIhAO+fKHS//bkD2Q2UcYPD0g67fXIeILdvapQEpEukdFwf","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1224763},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\">\n    <!-- ... -->\n    <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"033569cc4deafe32dad2bf8cbd1de8789bc85668","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.6081d829b.0","@material/rtl":"15.0.0-canary.6081d829b.0","@material/base":"15.0.0-canary.6081d829b.0","@material/theme":"15.0.0-canary.6081d829b.0","@material/ripple":"15.0.0-canary.6081d829b.0","@material/tokens":"15.0.0-canary.6081d829b.0","@material/animation":"15.0.0-canary.6081d829b.0","@material/elevation":"15.0.0-canary.6081d829b.0","@material/typography":"15.0.0-canary.6081d829b.0","@material/feature-targeting":"15.0.0-canary.6081d829b.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.6081d829b.0_1686100492840_0.4903413651607531","host":"s3://npm-registry-packages"}},"15.0.0-canary.b26c34a68.0":{"name":"@material/slider","version":"15.0.0-canary.b26c34a68.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.b26c34a68.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"5584fa84f8cd8b59ca70b8a85e3a4c86bf571885","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.b26c34a68.0.tgz","fileCount":37,"integrity":"sha512-k2IyNWvt0RJPLtRgUSpPODRCd4D56BWQylbzd6VHO4WUaSffltO+NdW1Zr/38AOBBzZIgbxy1h0nwQY3NFxU3Q==","signatures":[{"sig":"MEQCIAHPp59x6e0lKJ3u7a/KiHFZIsv1BXqIacz6jQJOi1umAiAqlIezgu5FePc7bckcWbRv+nT99kQ8w/r9l32RScNVsw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1224763},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\">\n    <!-- ... -->\n    <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"28919516866e588c52e4e6358c3c4d2523993b74","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.b26c34a68.0","@material/rtl":"15.0.0-canary.b26c34a68.0","@material/base":"15.0.0-canary.b26c34a68.0","@material/theme":"15.0.0-canary.b26c34a68.0","@material/ripple":"15.0.0-canary.b26c34a68.0","@material/tokens":"15.0.0-canary.b26c34a68.0","@material/animation":"15.0.0-canary.b26c34a68.0","@material/elevation":"15.0.0-canary.b26c34a68.0","@material/typography":"15.0.0-canary.b26c34a68.0","@material/feature-targeting":"15.0.0-canary.b26c34a68.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.b26c34a68.0_1686169154600_0.48165710747526225","host":"s3://npm-registry-packages"}},"15.0.0-canary.4fe911371.0":{"name":"@material/slider","version":"15.0.0-canary.4fe911371.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.4fe911371.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"f20649b00076c7a566882d46850d3a53da7054f6","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.4fe911371.0.tgz","fileCount":37,"integrity":"sha512-Qe5jT6DCNIvvj6mgqMC8LUnBrqoBM64XK57RrSE7dcGEwVxeqIIr/Qzo5+dTu+2ez4glC9MNgNX1/V3OjgtDrA==","signatures":[{"sig":"MEYCIQCadQ6Z7Gmq6QfDJHDGeF+lxYyPnq0yIdglPatVme3Q2QIhAOxHfF4d7f5vXLYFysyaugnAr1dksd9/vj3UMObes8eA","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1224763},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\">\n    <!-- ... -->\n    <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"a9de53a24d5e0f79f94310f061cdf2ab718df7f4","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.4fe911371.0","@material/rtl":"15.0.0-canary.4fe911371.0","@material/base":"15.0.0-canary.4fe911371.0","@material/theme":"15.0.0-canary.4fe911371.0","@material/ripple":"15.0.0-canary.4fe911371.0","@material/tokens":"15.0.0-canary.4fe911371.0","@material/animation":"15.0.0-canary.4fe911371.0","@material/elevation":"15.0.0-canary.4fe911371.0","@material/typography":"15.0.0-canary.4fe911371.0","@material/feature-targeting":"15.0.0-canary.4fe911371.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.4fe911371.0_1686179214653_0.9122218234440158","host":"s3://npm-registry-packages"}},"15.0.0-canary.a9ff9866f.0":{"name":"@material/slider","version":"15.0.0-canary.a9ff9866f.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.a9ff9866f.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"1eea1de558c1eef54f422d062c53cc579bf1b49e","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.a9ff9866f.0.tgz","fileCount":37,"integrity":"sha512-CTQjSMEu+M+ddDSGopR9J0j9PpHJW3kjlzCbBE4k0+PhasH4fBYtZoYotYK1JRI3rv3omhqhj6a6/RLtCXjGJA==","signatures":[{"sig":"MEQCIDNjQosVzDPqBgIRog56Be8vwcenNmvVdawbchGDmYUDAiAv307MK+TeDgGQ7MCsU9fCLuhlTbWNrroIRZtI5arP6g==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1224763},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\">\n    <!-- ... -->\n    <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"5bed0ec6cdad0c38b52e8ac98994b2809d9c8f50","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.a9ff9866f.0","@material/rtl":"15.0.0-canary.a9ff9866f.0","@material/base":"15.0.0-canary.a9ff9866f.0","@material/theme":"15.0.0-canary.a9ff9866f.0","@material/ripple":"15.0.0-canary.a9ff9866f.0","@material/tokens":"15.0.0-canary.a9ff9866f.0","@material/animation":"15.0.0-canary.a9ff9866f.0","@material/elevation":"15.0.0-canary.a9ff9866f.0","@material/typography":"15.0.0-canary.a9ff9866f.0","@material/feature-targeting":"15.0.0-canary.a9ff9866f.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.a9ff9866f.0_1686656345358_0.887999578825065","host":"s3://npm-registry-packages"}},"15.0.0-canary.b994146f6.0":{"name":"@material/slider","version":"15.0.0-canary.b994146f6.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.b994146f6.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"2bbe6539a9d6aac602f093dadf62ef6f8e8afc7c","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.b994146f6.0.tgz","fileCount":37,"integrity":"sha512-dyT72+Kp//AEajJxDUVoMoizUjf2uggVMGXOaQ7FhpGHuf7LC3EyEjrrJ15efFzYgTjdJUU1YQkCwGmdt6CQsA==","signatures":[{"sig":"MEUCIQDlbx2KOViwe47seNiyYDIdqFd6qdjwm0g3FGnsYJvk8wIgBCcEA9Df3PgI2GDyWPiVQZAp5yfeyD6fnB9QmvHWUP4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1224763},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\">\n    <!-- ... -->\n    <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"e537228a5d88e4fb9c651aa15b1d56bd81bc63bd","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.b994146f6.0","@material/rtl":"15.0.0-canary.b994146f6.0","@material/base":"15.0.0-canary.b994146f6.0","@material/theme":"15.0.0-canary.b994146f6.0","@material/ripple":"15.0.0-canary.b994146f6.0","@material/tokens":"15.0.0-canary.b994146f6.0","@material/animation":"15.0.0-canary.b994146f6.0","@material/elevation":"15.0.0-canary.b994146f6.0","@material/typography":"15.0.0-canary.b994146f6.0","@material/feature-targeting":"15.0.0-canary.b994146f6.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.b994146f6.0_1686776680844_0.5925691539566063","host":"s3://npm-registry-packages"}},"15.0.0-canary.1fb4b1a06.0":{"name":"@material/slider","version":"15.0.0-canary.1fb4b1a06.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.1fb4b1a06.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"ca70a1deb11f2f8f602a3b8a7edf50c0f5192b9d","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.1fb4b1a06.0.tgz","fileCount":37,"integrity":"sha512-pbHMFHucfop5xB9/9CSQBEGQ5cTeTBxGK2U5jpTLEEwoWMtT9lvMMA45txToRQlnQ8SYfy4qgMloCjYgnOta6A==","signatures":[{"sig":"MEYCIQCrjZ5XeMHhT7aGLzz31Ux3q2qNMvhHtUUBtPJm7s4xowIhALRrMQx+7kZUpZryowo3xafA78ZNFlfzWYnYmTDeskJq","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1224763},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\">\n    <!-- ... -->\n    <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"1d1b86822f3fc9f22a5fdfc1c381d5a4ae983829","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.1fb4b1a06.0","@material/rtl":"15.0.0-canary.1fb4b1a06.0","@material/base":"15.0.0-canary.1fb4b1a06.0","@material/theme":"15.0.0-canary.1fb4b1a06.0","@material/ripple":"15.0.0-canary.1fb4b1a06.0","@material/tokens":"15.0.0-canary.1fb4b1a06.0","@material/animation":"15.0.0-canary.1fb4b1a06.0","@material/elevation":"15.0.0-canary.1fb4b1a06.0","@material/typography":"15.0.0-canary.1fb4b1a06.0","@material/feature-targeting":"15.0.0-canary.1fb4b1a06.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.1fb4b1a06.0_1687892290049_0.6381682700225424","host":"s3://npm-registry-packages"}},"15.0.0-canary.c64a2776e.0":{"name":"@material/slider","version":"15.0.0-canary.c64a2776e.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.c64a2776e.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"4d3a0d7b3ff083668534f20cb71a5f7dfc6b3f0c","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.c64a2776e.0.tgz","fileCount":37,"integrity":"sha512-81khiT25EbHGwVt+3dn5bdxumIYI7QlHsPrWPdCSv7PWZ1oIG4fAZFsUtPsd8CrxHFdFN8KzlK9nROVezDHjYg==","signatures":[{"sig":"MEUCIF2RpbNrKwAvkXUpqatSI0LQ0fDM0l/DAc51G+hVPehtAiEAvIpLD5N4X6bIvMi8h2/Leh/ZY8cRW0y42MeBfe2s+0E=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1224763},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\">\n    <!-- ... -->\n    <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"271b0c446646af573f67960820b6b2a86a9bda88","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.c64a2776e.0","@material/rtl":"15.0.0-canary.c64a2776e.0","@material/base":"15.0.0-canary.c64a2776e.0","@material/theme":"15.0.0-canary.c64a2776e.0","@material/ripple":"15.0.0-canary.c64a2776e.0","@material/tokens":"15.0.0-canary.c64a2776e.0","@material/animation":"15.0.0-canary.c64a2776e.0","@material/elevation":"15.0.0-canary.c64a2776e.0","@material/typography":"15.0.0-canary.c64a2776e.0","@material/feature-targeting":"15.0.0-canary.c64a2776e.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.c64a2776e.0_1687897058043_0.09566999339409077","host":"s3://npm-registry-packages"}},"15.0.0-canary.b05d9eb7c.0":{"name":"@material/slider","version":"15.0.0-canary.b05d9eb7c.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.b05d9eb7c.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"20cf46ee53ae89b029244f9045976e2d90982efe","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.b05d9eb7c.0.tgz","fileCount":37,"integrity":"sha512-wEQJpJx42u18mbhN6BXhZgiWBdZbmhUryQjyOkvec770ZudGmH6tWzSGcBtrl0BdG9NFNn6y/BRyNDrzApJGkw==","signatures":[{"sig":"MEYCIQCHr0AKts/ovWyuDUNEA7TZCeIF6HINwK2IAhuJ71sSMQIhAOOUygnkoQe7Krj8dSOpE2xYaXMW2Blf3oRsP2Bwxskr","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1224763},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\">\n    <!-- ... -->\n    <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"854245f23fe0f7b3dd1163ecefd940b26718c134","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.b05d9eb7c.0","@material/rtl":"15.0.0-canary.b05d9eb7c.0","@material/base":"15.0.0-canary.b05d9eb7c.0","@material/theme":"15.0.0-canary.b05d9eb7c.0","@material/ripple":"15.0.0-canary.b05d9eb7c.0","@material/tokens":"15.0.0-canary.b05d9eb7c.0","@material/animation":"15.0.0-canary.b05d9eb7c.0","@material/elevation":"15.0.0-canary.b05d9eb7c.0","@material/typography":"15.0.0-canary.b05d9eb7c.0","@material/feature-targeting":"15.0.0-canary.b05d9eb7c.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.b05d9eb7c.0_1688055876630_0.5656023493294275","host":"s3://npm-registry-packages"}},"15.0.0-canary.2a9697dc5.0":{"name":"@material/slider","version":"15.0.0-canary.2a9697dc5.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.2a9697dc5.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"7670f48e632780a732bd4045d618fbc154625034","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.2a9697dc5.0.tgz","fileCount":37,"integrity":"sha512-4ZjEXQszruJ7f9TDbWRRpafP3qborkN5XHPXqUek/DDOUrKlGcgpK4/w4eiob/OsgPED4BrD16qiJ36J9+uIxA==","signatures":[{"sig":"MEYCIQDK+g4HryV9HVVNS2fXQsAdZpNSxfoRLi3VlzXF7l8KHgIhAJ700OIitu9TFCxoeskYFuD50kYM0716TiivKQXz9BPf","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1224763},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\">\n    <!-- ... -->\n    <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"fad1e5223c83a5b7a83a6ef81f7ebdc83a85672a","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.2a9697dc5.0","@material/rtl":"15.0.0-canary.2a9697dc5.0","@material/base":"15.0.0-canary.2a9697dc5.0","@material/theme":"15.0.0-canary.2a9697dc5.0","@material/ripple":"15.0.0-canary.2a9697dc5.0","@material/tokens":"15.0.0-canary.2a9697dc5.0","@material/animation":"15.0.0-canary.2a9697dc5.0","@material/elevation":"15.0.0-canary.2a9697dc5.0","@material/typography":"15.0.0-canary.2a9697dc5.0","@material/feature-targeting":"15.0.0-canary.2a9697dc5.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.2a9697dc5.0_1688163285179_0.7850767110079875","host":"s3://npm-registry-packages"}},"15.0.0-canary.0c52adeab.0":{"name":"@material/slider","version":"15.0.0-canary.0c52adeab.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.0c52adeab.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"6fd96e3fc42dcf311a795b17ea27cc71d7f7bde8","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.0c52adeab.0.tgz","fileCount":37,"integrity":"sha512-E8G8/fUhl9FS7xGAxZr7g1SicZXE26Rh41OxrAo7MhVVfPNlXryMTAy+wLxaZ022qo+tjFC/Db75t4IX1jEoLQ==","signatures":[{"sig":"MEYCIQDYvRw9Bu2r95Of2IP3if6v1s3XH/9H/IYIDtXrVyANvgIhAJ5OnDwYjEm5ko9ggWcoflDclyZQXn/6jyjnABtNf7c1","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1224763},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\">\n    <!-- ... -->\n    <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"972024dd57885ff944ec073de0cd956353bfa7e3","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.0c52adeab.0","@material/rtl":"15.0.0-canary.0c52adeab.0","@material/base":"15.0.0-canary.0c52adeab.0","@material/theme":"15.0.0-canary.0c52adeab.0","@material/ripple":"15.0.0-canary.0c52adeab.0","@material/tokens":"15.0.0-canary.0c52adeab.0","@material/animation":"15.0.0-canary.0c52adeab.0","@material/elevation":"15.0.0-canary.0c52adeab.0","@material/typography":"15.0.0-canary.0c52adeab.0","@material/feature-targeting":"15.0.0-canary.0c52adeab.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.0c52adeab.0_1688574404921_0.1447016004957271","host":"s3://npm-registry-packages"}},"15.0.0-canary.83355c322.0":{"name":"@material/slider","version":"15.0.0-canary.83355c322.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.83355c322.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"46c1728f0e8fda24a1629afbbebd94001733dbbb","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.83355c322.0.tgz","fileCount":37,"integrity":"sha512-6EJtuUY3Gq/xJw/Yh8IJ7pGoyBHBM8o7M5ImFDvadgFCo3GyQFBByjjfOSdzrQRyHTQFIpjTiitE1H5JRL8mRQ==","signatures":[{"sig":"MEQCIANv4KLbhqNcJzkPMmlEtFFovpCDskC0Z0PF8nEZummOAiBdCI93xn9P4U+wwCTlmLTJFtI9/LDl2tko/E6IGUWoNQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1224763},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\">\n    <!-- ... -->\n    <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"173401c2dd65fb3babae5b8e998c0a0032ff819d","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.83355c322.0","@material/rtl":"15.0.0-canary.83355c322.0","@material/base":"15.0.0-canary.83355c322.0","@material/theme":"15.0.0-canary.83355c322.0","@material/ripple":"15.0.0-canary.83355c322.0","@material/tokens":"15.0.0-canary.83355c322.0","@material/animation":"15.0.0-canary.83355c322.0","@material/elevation":"15.0.0-canary.83355c322.0","@material/typography":"15.0.0-canary.83355c322.0","@material/feature-targeting":"15.0.0-canary.83355c322.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.83355c322.0_1689001597383_0.2112363100848409","host":"s3://npm-registry-packages"}},"15.0.0-canary.bc9ae6c9c.0":{"name":"@material/slider","version":"15.0.0-canary.bc9ae6c9c.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.bc9ae6c9c.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"5f9fa85cb0b95f45042b14a510d20ae894ee027c","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.bc9ae6c9c.0.tgz","fileCount":37,"integrity":"sha512-3AEu+7PwW4DSNLndue47dh2u7ga4hDJRYmuu7wnJCIWJBnLCkp6C92kNc4Rj5iQY2ftJio5aj1gqryluh5tlYg==","signatures":[{"sig":"MEYCIQCmz2p2z0eHN25WmjbNB8qRmROmhyJ5NgsO9tyh7hQbQAIhAPvV83dlkjzmer39N8sO3ahXX5ys41fko4frzazAdh5V","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1224763},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\">\n    <!-- ... -->\n    <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"9f0b9b80c267d99daa258e635481fecc4cbf0acd","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.bc9ae6c9c.0","@material/rtl":"15.0.0-canary.bc9ae6c9c.0","@material/base":"15.0.0-canary.bc9ae6c9c.0","@material/theme":"15.0.0-canary.bc9ae6c9c.0","@material/ripple":"15.0.0-canary.bc9ae6c9c.0","@material/tokens":"15.0.0-canary.bc9ae6c9c.0","@material/animation":"15.0.0-canary.bc9ae6c9c.0","@material/elevation":"15.0.0-canary.bc9ae6c9c.0","@material/typography":"15.0.0-canary.bc9ae6c9c.0","@material/feature-targeting":"15.0.0-canary.bc9ae6c9c.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.bc9ae6c9c.0_1691097743428_0.4775994164145798","host":"s3://npm-registry-packages"}},"15.0.0-canary.3c44cd956.0":{"name":"@material/slider","version":"15.0.0-canary.3c44cd956.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.3c44cd956.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"412988e9cf91ec8ece8326746bbb9695e48022c3","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.3c44cd956.0.tgz","fileCount":37,"integrity":"sha512-+ZLTPAYukkIVPEe6iPGJIhYwn9gXnfOgruBYiNsIONlO+bi4CMFzSD6vtqwS5K5IsbzT0IebganvIGyeB3RYng==","signatures":[{"sig":"MEUCIQCAl5imQ4zmlBgh0Yew699rMdPhIwJcqbN66ltKuDev3gIgFhcMmTcp++XroMq7nkC+MZuB6jYtxugerRtNpLotsEQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1224763},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\">\n    <!-- ... -->\n    <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"6e39da189328fcabc7040a629e312efe5f7cea80","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.3c44cd956.0","@material/rtl":"15.0.0-canary.3c44cd956.0","@material/base":"15.0.0-canary.3c44cd956.0","@material/theme":"15.0.0-canary.3c44cd956.0","@material/ripple":"15.0.0-canary.3c44cd956.0","@material/tokens":"15.0.0-canary.3c44cd956.0","@material/animation":"15.0.0-canary.3c44cd956.0","@material/elevation":"15.0.0-canary.3c44cd956.0","@material/typography":"15.0.0-canary.3c44cd956.0","@material/feature-targeting":"15.0.0-canary.3c44cd956.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.3c44cd956.0_1691430537692_0.11859814575303251","host":"s3://npm-registry-packages"}},"15.0.0-canary.02702296e.0":{"name":"@material/slider","version":"15.0.0-canary.02702296e.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.02702296e.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"34ce3c83cde1c97461a97ed6f5bed4755f4300bf","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.02702296e.0.tgz","fileCount":37,"integrity":"sha512-16jP7q63ZBj4iWHtc7WVs+WqgyEslc3jJIfDRLJdiGRdlnb7YJm7zlL0G4/QhhwH/qTCud7MJ7SC6lESuUygow==","signatures":[{"sig":"MEUCIG38mfg7TPCLQp4QB+tZwv3wa6XC+vg0VNYysQBtN4phAiEAskKmR6cmUPn5fsgUvYWXalXr+HfZ2eRt5D/5EeCZp+I=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1224763},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\">\n    <!-- ... -->\n    <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"22335673bc742932498b2538321ed9dcfd692879","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.02702296e.0","@material/rtl":"15.0.0-canary.02702296e.0","@material/base":"15.0.0-canary.02702296e.0","@material/theme":"15.0.0-canary.02702296e.0","@material/ripple":"15.0.0-canary.02702296e.0","@material/tokens":"15.0.0-canary.02702296e.0","@material/animation":"15.0.0-canary.02702296e.0","@material/elevation":"15.0.0-canary.02702296e.0","@material/typography":"15.0.0-canary.02702296e.0","@material/feature-targeting":"15.0.0-canary.02702296e.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.02702296e.0_1692965156397_0.7837598400471388","host":"s3://npm-registry-packages"}},"15.0.0-canary.872b65832.0":{"name":"@material/slider","version":"15.0.0-canary.872b65832.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.872b65832.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"9619ea0cb7b31b54c3fe966f28e4e280d42c29cd","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.872b65832.0.tgz","fileCount":37,"integrity":"sha512-J5miAcDKdRUgHQ1uBunzrjtYqCimMcURhD/mC+lN06v7S9GE8xzg1AqpXq8ko8bDHgqbzy67jdxo6vcY5PSDaw==","signatures":[{"sig":"MEYCIQCTd7Nsrk2xpqpghheOuXIG0ktvUlZ3VhjQuOWzONLANwIhAP60iekuEZZLLiCYwhac5i1bypbIP73cc6O6WczKPsjK","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1224763},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\">\n    <!-- ... -->\n    <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"be0901c091f812355b2d192c49bd051d8daf7a98","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.872b65832.0","@material/rtl":"15.0.0-canary.872b65832.0","@material/base":"15.0.0-canary.872b65832.0","@material/theme":"15.0.0-canary.872b65832.0","@material/ripple":"15.0.0-canary.872b65832.0","@material/tokens":"15.0.0-canary.872b65832.0","@material/animation":"15.0.0-canary.872b65832.0","@material/elevation":"15.0.0-canary.872b65832.0","@material/typography":"15.0.0-canary.872b65832.0","@material/feature-targeting":"15.0.0-canary.872b65832.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.872b65832.0_1693397664671_0.5381841489980583","host":"s3://npm-registry-packages"}},"15.0.0-canary.89b2e4122.0":{"name":"@material/slider","version":"15.0.0-canary.89b2e4122.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.89b2e4122.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"a5821d27bd5e7deaf6fc29174eb56056b685d6b9","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.89b2e4122.0.tgz","fileCount":37,"integrity":"sha512-Xwb5B5El/aWwBbp7YNkJIpRQn0y3p3l/jz77pVlH8MLQmPPE+lN65L7GOR67Ci2iww5u7irhVUEZl6hjQZ0nKg==","signatures":[{"sig":"MEYCIQDG9injJom7V3ybVPuBggQnmTKMbEirFX2oDYd0gga2/gIhALRvx0T9nbrjgay05U8n6nicL9dTUWblE6jT6Eax0L+p","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1224446},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\">\n    <!-- ... -->\n    <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"68bd55db9489546e515443239f477836e16db19b","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.89b2e4122.0","@material/rtl":"15.0.0-canary.89b2e4122.0","@material/base":"15.0.0-canary.89b2e4122.0","@material/theme":"15.0.0-canary.89b2e4122.0","@material/ripple":"15.0.0-canary.89b2e4122.0","@material/tokens":"15.0.0-canary.89b2e4122.0","@material/animation":"15.0.0-canary.89b2e4122.0","@material/elevation":"15.0.0-canary.89b2e4122.0","@material/typography":"15.0.0-canary.89b2e4122.0","@material/feature-targeting":"15.0.0-canary.89b2e4122.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.89b2e4122.0_1693498067271_0.9300489748069287","host":"s3://npm-registry-packages"}},"15.0.0-canary.7a3942e7a.0":{"name":"@material/slider","version":"15.0.0-canary.7a3942e7a.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.7a3942e7a.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"28977fe4b729a91877a45ff1f50a763937504d21","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.7a3942e7a.0.tgz","fileCount":37,"integrity":"sha512-7sM2Dvi7uiUJPA8DOknR9bHFVVOiuvyDBq8Y2cbDqPKMaJJSoCoT1AVUABs+6K4uR97T4xmXri7GdKR4DZFZbQ==","signatures":[{"sig":"MEYCIQDDsovarWOsWkte+mwEk+uBeuIfWzj767pI71x4PK7dgQIhAM39kddOtMOhB1O3wNAotEC5QlboL+J5BPL10G0dnWbK","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1224446},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\">\n    <!-- ... -->\n    <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"e61dc0a16a5b376c778548e5a6cecb56f5c5704d","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.7a3942e7a.0","@material/rtl":"15.0.0-canary.7a3942e7a.0","@material/base":"15.0.0-canary.7a3942e7a.0","@material/theme":"15.0.0-canary.7a3942e7a.0","@material/ripple":"15.0.0-canary.7a3942e7a.0","@material/tokens":"15.0.0-canary.7a3942e7a.0","@material/animation":"15.0.0-canary.7a3942e7a.0","@material/elevation":"15.0.0-canary.7a3942e7a.0","@material/typography":"15.0.0-canary.7a3942e7a.0","@material/feature-targeting":"15.0.0-canary.7a3942e7a.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.7a3942e7a.0_1693507239275_0.05355124980706227","host":"s3://npm-registry-packages"}},"15.0.0-canary.54feb3020.0":{"name":"@material/slider","version":"15.0.0-canary.54feb3020.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.54feb3020.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"0a14910eacd2da823c0d89c3ed68c12baeeca0e9","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.54feb3020.0.tgz","fileCount":37,"integrity":"sha512-884dxG/Sjzpr+3vTfYVVjY8j2YvDDJguKlj4XK9hW3kHLBSIQ901RnzjV7BTDle9pAkD8Nc3yG6S+at9TgX7Bg==","signatures":[{"sig":"MEUCIA3N7v+jyRY+JBSyefvLdkzqraW+DNel+3Qsuh2VEme/AiEA5SnetIDVmKNjhwpakZSp0EkX1/unJFcEH/OgEhm2d4o=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1224446},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\">\n    <!-- ... -->\n    <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"5dc5cb94463af21f898ddd58cc4d9e4fbf803222","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.54feb3020.0","@material/rtl":"15.0.0-canary.54feb3020.0","@material/base":"15.0.0-canary.54feb3020.0","@material/theme":"15.0.0-canary.54feb3020.0","@material/ripple":"15.0.0-canary.54feb3020.0","@material/tokens":"15.0.0-canary.54feb3020.0","@material/animation":"15.0.0-canary.54feb3020.0","@material/elevation":"15.0.0-canary.54feb3020.0","@material/typography":"15.0.0-canary.54feb3020.0","@material/feature-targeting":"15.0.0-canary.54feb3020.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.54feb3020.0_1694466359196_0.30818807762889966","host":"s3://npm-registry-packages"}},"15.0.0-canary.6cda3ce8d.0":{"name":"@material/slider","version":"15.0.0-canary.6cda3ce8d.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.6cda3ce8d.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"e6a271ef270d9807e8b42d6035af49189291830a","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.6cda3ce8d.0.tgz","fileCount":37,"integrity":"sha512-rzW/CKCW/zF7F6w5FKCLJm55xR26zzwnCC0P2gs6DbNbJ8yo9p2HAF+Mr/sEgYpA5jAIu4fdrNmCva6NHbRsnQ==","signatures":[{"sig":"MEYCIQDWSm5APz2gha8tQgAc5YkqquOyLoCBXqOCD32tkuzqqAIhAN+G9N/3C2vCB4lPAVY4dU0b2dSQiXJHYjPEY39q7pIh","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1224446},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\">\n    <!-- ... -->\n    <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"adb36c6339e7bf37fe1e8ca96526a9673ca602e7","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.6cda3ce8d.0","@material/rtl":"15.0.0-canary.6cda3ce8d.0","@material/base":"15.0.0-canary.6cda3ce8d.0","@material/theme":"15.0.0-canary.6cda3ce8d.0","@material/ripple":"15.0.0-canary.6cda3ce8d.0","@material/tokens":"15.0.0-canary.6cda3ce8d.0","@material/animation":"15.0.0-canary.6cda3ce8d.0","@material/elevation":"15.0.0-canary.6cda3ce8d.0","@material/typography":"15.0.0-canary.6cda3ce8d.0","@material/feature-targeting":"15.0.0-canary.6cda3ce8d.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.6cda3ce8d.0_1694483169007_0.7320954531099177","host":"s3://npm-registry-packages"}},"15.0.0-canary.205b20b36.0":{"name":"@material/slider","version":"15.0.0-canary.205b20b36.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.205b20b36.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"4278811a4fa4995c7327905d635e2793af72e94d","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.205b20b36.0.tgz","fileCount":37,"integrity":"sha512-oEcSsrVN0MHDGPDiYNT2oEvfzu++85Qfb6IekxoXmysm/G0NCFK3LxK9rW84SNmzBfZekrgS6w8GePvgnCZ8Hg==","signatures":[{"sig":"MEUCIHO2rKNY3K/rwbf1iabPum0KqJkacG4o5+s0qCSS3QTCAiEA61r4jNm05xxujhd8GROV5WkXmUi2c8gtkvJiaNO5nQ4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1224446},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\">\n    <!-- ... -->\n    <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"00fdcf619c34c502844acb0f2485e99595aa138d","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.205b20b36.0","@material/rtl":"15.0.0-canary.205b20b36.0","@material/base":"15.0.0-canary.205b20b36.0","@material/theme":"15.0.0-canary.205b20b36.0","@material/ripple":"15.0.0-canary.205b20b36.0","@material/tokens":"15.0.0-canary.205b20b36.0","@material/animation":"15.0.0-canary.205b20b36.0","@material/elevation":"15.0.0-canary.205b20b36.0","@material/typography":"15.0.0-canary.205b20b36.0","@material/feature-targeting":"15.0.0-canary.205b20b36.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.205b20b36.0_1694625507071_0.032404607844013","host":"s3://npm-registry-packages"}},"15.0.0-canary.22bf82024.0":{"name":"@material/slider","version":"15.0.0-canary.22bf82024.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.22bf82024.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"222bf2ab3e3ef429f5d2704039e41198ed4434c7","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.22bf82024.0.tgz","fileCount":37,"integrity":"sha512-TFiyaEZVpfZUCEpe4cHPSh0ET+ElQDzUaS2pW95T+AV3HF/oCF7yAC9VHeifuFjdr7rUm+HryC/FYHB/xCV5dw==","signatures":[{"sig":"MEUCIG4YLqRHXhYTGuEX81y8bPPw1D4BNs9R8rodkGbhYI88AiEAj0OsrqIjWON5LbTqXWLfz4UauriSxS8BE/vExcRTW0Y=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1224446},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\">\n    <!-- ... -->\n    <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"eda4fad2a8a727b69db60b828bd92df7a8956143","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.22bf82024.0","@material/rtl":"15.0.0-canary.22bf82024.0","@material/base":"15.0.0-canary.22bf82024.0","@material/theme":"15.0.0-canary.22bf82024.0","@material/ripple":"15.0.0-canary.22bf82024.0","@material/tokens":"15.0.0-canary.22bf82024.0","@material/animation":"15.0.0-canary.22bf82024.0","@material/elevation":"15.0.0-canary.22bf82024.0","@material/typography":"15.0.0-canary.22bf82024.0","@material/feature-targeting":"15.0.0-canary.22bf82024.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.22bf82024.0_1695028368445_0.24913247606110578","host":"s3://npm-registry-packages"}},"15.0.0-canary.a246a4439.0":{"name":"@material/slider","version":"15.0.0-canary.a246a4439.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.a246a4439.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"ae6506a049ea9b18dc781dec5117a723cad408b0","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.a246a4439.0.tgz","fileCount":37,"integrity":"sha512-is1BSBpxaXBBv+wSVpe9WGWmWl59yJEeDNubTES2UFD0er3BmA+PdKkL09vvytDnBcbKf77TbxaRiUSGVaKUQA==","signatures":[{"sig":"MEUCIBSZfwzrZ93IOLXt1fqfKwYDCrEf2MZJULAWiGu68VHNAiEAkSzOn1LL3wuFCjLYba3uxN5YEH8QZPS+8k00fRIDqg0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1224885},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\">\n    <!-- ... -->\n    <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"40201df8b7e53b61aead4acdfa34b48fb1d155b8","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.a246a4439.0","@material/rtl":"15.0.0-canary.a246a4439.0","@material/base":"15.0.0-canary.a246a4439.0","@material/theme":"15.0.0-canary.a246a4439.0","@material/ripple":"15.0.0-canary.a246a4439.0","@material/tokens":"15.0.0-canary.a246a4439.0","@material/animation":"15.0.0-canary.a246a4439.0","@material/elevation":"15.0.0-canary.a246a4439.0","@material/typography":"15.0.0-canary.a246a4439.0","@material/feature-targeting":"15.0.0-canary.a246a4439.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.a246a4439.0_1695059218228_0.6931701917233386","host":"s3://npm-registry-packages"}},"15.0.0-canary.d153db62b.0":{"name":"@material/slider","version":"15.0.0-canary.d153db62b.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.d153db62b.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"7b17dfd23bf01415ed2abe6a717efc7b1c58c970","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.d153db62b.0.tgz","fileCount":37,"integrity":"sha512-SdTgtNpgWfw4ZqpNzoARGeumtl3PnV3MbQqdbCm5wwPGBEyoAStFOh1TFOojzrTy3F4AHnAa1pQv5UogkGWyrQ==","signatures":[{"sig":"MEQCIB/7Xqw8DUktabx7XPeVsZN35NcxnqGehWSndFaJJmcRAiA9hT8JhRsj9mSkydlJuaD0VigUKFvth3WDbuRGJj0YnQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1224885},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\">\n    <!-- ... -->\n    <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"4ca05c144c691cd06cd5926fe0bc54818e462202","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.d153db62b.0","@material/rtl":"15.0.0-canary.d153db62b.0","@material/base":"15.0.0-canary.d153db62b.0","@material/theme":"15.0.0-canary.d153db62b.0","@material/ripple":"15.0.0-canary.d153db62b.0","@material/tokens":"15.0.0-canary.d153db62b.0","@material/animation":"15.0.0-canary.d153db62b.0","@material/elevation":"15.0.0-canary.d153db62b.0","@material/typography":"15.0.0-canary.d153db62b.0","@material/feature-targeting":"15.0.0-canary.d153db62b.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.d153db62b.0_1695150957748_0.8892404420106912","host":"s3://npm-registry-packages"}},"15.0.0-canary.2528c1c3b.0":{"name":"@material/slider","version":"15.0.0-canary.2528c1c3b.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.2528c1c3b.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"447bb010c6fb80e06075d8f16efa49f99d098197","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.2528c1c3b.0.tgz","fileCount":37,"integrity":"sha512-LdLAEYOhxjhLYI4FxTRrE9/2PCVhmbhdGTzVXKz3H5DMG1fLN0wT+D/T+/LWFrdYL3sG4T2SSwpOnyw0H+jYPQ==","signatures":[{"sig":"MEUCIEPhTuRJdZQply3tjdgSpDD7jr00pW5/xePd42eTwpu5AiEA+dT/Ux1D5H+JP6BZfxTsZcvv/D5+olF0FBjte2w+goA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1224885},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\">\n    <!-- ... -->\n    <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"98b5b57bd5356f48610a254e8c4acff388d5fb7b","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.2528c1c3b.0","@material/rtl":"15.0.0-canary.2528c1c3b.0","@material/base":"15.0.0-canary.2528c1c3b.0","@material/theme":"15.0.0-canary.2528c1c3b.0","@material/ripple":"15.0.0-canary.2528c1c3b.0","@material/tokens":"15.0.0-canary.2528c1c3b.0","@material/animation":"15.0.0-canary.2528c1c3b.0","@material/elevation":"15.0.0-canary.2528c1c3b.0","@material/typography":"15.0.0-canary.2528c1c3b.0","@material/feature-targeting":"15.0.0-canary.2528c1c3b.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.2528c1c3b.0_1695233247458_0.44278590634070225","host":"s3://npm-registry-packages"}},"15.0.0-canary.1728a6dcf.0":{"name":"@material/slider","version":"15.0.0-canary.1728a6dcf.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.1728a6dcf.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"84f52396d63a03057405cdd069744935b5d2589d","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.1728a6dcf.0.tgz","fileCount":37,"integrity":"sha512-Cc2vTax9akqNira2pGsza5ErxcDGL3FXt1xhBsolTdF+455zPns2NgqqUfi0odguuo2JZund3gH7oyF0coyrGw==","signatures":[{"sig":"MEUCICVyI9o0VXTkrnqo1geV+ACisC4u1otJgO12+wBDLNxjAiEAjhfBrdjMfiY854/T/bYRJ/hzWpnNZ7hPYP1iXfYcqWI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1226286},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\">\n    <!-- ... -->\n    <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"3828aedf4f344a948780a69956ca4f069cef3daa","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.1728a6dcf.0","@material/rtl":"15.0.0-canary.1728a6dcf.0","@material/base":"15.0.0-canary.1728a6dcf.0","@material/theme":"15.0.0-canary.1728a6dcf.0","@material/ripple":"15.0.0-canary.1728a6dcf.0","@material/tokens":"15.0.0-canary.1728a6dcf.0","@material/animation":"15.0.0-canary.1728a6dcf.0","@material/elevation":"15.0.0-canary.1728a6dcf.0","@material/typography":"15.0.0-canary.1728a6dcf.0","@material/feature-targeting":"15.0.0-canary.1728a6dcf.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.1728a6dcf.0_1695691441990_0.08023361282182462","host":"s3://npm-registry-packages"}},"15.0.0-canary.ebb636f3d.0":{"name":"@material/slider","version":"15.0.0-canary.ebb636f3d.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.ebb636f3d.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"3be72ecebf08893db775fc1c3560297baeeae141","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.ebb636f3d.0.tgz","fileCount":37,"integrity":"sha512-hnA+7r4M/jy9VWZ93CH7RLs88Io5urqt3LPd5pELSZyEq3wK6jZe7w7Tuqf9QyvFazPDxal+a/vHA4QDkYbzHg==","signatures":[{"sig":"MEUCIAjdnmOM06fnmMtt2gLroTBzREcy6/+pIWoDkNT479ECAiEAyU3/UKH4gf9Hy8OnD5ukXMi88HwhPGpMZzuXEM6hK0k=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1226286},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\">\n    <!-- ... -->\n    <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"6f62607a00dd885ebbe422b247dc4acc1ded22cb","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.ebb636f3d.0","@material/rtl":"15.0.0-canary.ebb636f3d.0","@material/base":"15.0.0-canary.ebb636f3d.0","@material/theme":"15.0.0-canary.ebb636f3d.0","@material/ripple":"15.0.0-canary.ebb636f3d.0","@material/tokens":"15.0.0-canary.ebb636f3d.0","@material/animation":"15.0.0-canary.ebb636f3d.0","@material/elevation":"15.0.0-canary.ebb636f3d.0","@material/typography":"15.0.0-canary.ebb636f3d.0","@material/feature-targeting":"15.0.0-canary.ebb636f3d.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.ebb636f3d.0_1696016712040_0.6216064335414662","host":"s3://npm-registry-packages"}},"15.0.0-canary.c0d21ecc9.0":{"name":"@material/slider","version":"15.0.0-canary.c0d21ecc9.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.c0d21ecc9.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"f3dd8b78d50235aaff54807381c649e961d01c38","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.c0d21ecc9.0.tgz","fileCount":37,"integrity":"sha512-GU9atw+ZDUTM+oReAMNUljUwnBKMyQ9iUtpQLEC0U0Yf+IULqMbB/KUbPxTUIAOwCHsDF9f1e0SXwnzCS4sVuQ==","signatures":[{"sig":"MEUCIAqtFLEmKSE3XUVd39vovvv/eO+6QsRswO6PxJQEytcQAiEA8sBrD/4YCUWL30swT+4rqAiceyTc2M+yHGL2V5LeV00=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1226286},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\">\n    <!-- ... -->\n    <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"0a932ea790a12d359ce4ec7c5c4c7aec7edf565d","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.c0d21ecc9.0","@material/rtl":"15.0.0-canary.c0d21ecc9.0","@material/base":"15.0.0-canary.c0d21ecc9.0","@material/theme":"15.0.0-canary.c0d21ecc9.0","@material/ripple":"15.0.0-canary.c0d21ecc9.0","@material/tokens":"15.0.0-canary.c0d21ecc9.0","@material/animation":"15.0.0-canary.c0d21ecc9.0","@material/elevation":"15.0.0-canary.c0d21ecc9.0","@material/typography":"15.0.0-canary.c0d21ecc9.0","@material/feature-targeting":"15.0.0-canary.c0d21ecc9.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.c0d21ecc9.0_1696880257013_0.15537435835774827","host":"s3://npm-registry-packages"}},"15.0.0-canary.127a44b28.0":{"name":"@material/slider","version":"15.0.0-canary.127a44b28.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.127a44b28.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"9d0f1c55a813008cae6e7b105a6f2d5084ac044e","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.127a44b28.0.tgz","fileCount":37,"integrity":"sha512-N4BZVDXpJ58sRNtC9IhLvwADAQxF+AeiDz6mlMMeh13RX3cnio1Y3lXFzjb64mcjMYCoJMzlKLizMlTvbBlRnQ==","signatures":[{"sig":"MEUCIQDnUu9hIdxbqDiHrmvqSmTjz4VDU/lcBwODybEMBE23cgIgEYSdNHpmZeLIwZvTraIIolzSb/cEGEZ6rA9ctl+jop4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1228926},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\">\n    <!-- ... -->\n    <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"88d1fc2c5354e751ea3ab567d26bb1886ee152d3","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.127a44b28.0","@material/rtl":"15.0.0-canary.127a44b28.0","@material/base":"15.0.0-canary.127a44b28.0","@material/theme":"15.0.0-canary.127a44b28.0","@material/ripple":"15.0.0-canary.127a44b28.0","@material/tokens":"15.0.0-canary.127a44b28.0","@material/animation":"15.0.0-canary.127a44b28.0","@material/elevation":"15.0.0-canary.127a44b28.0","@material/typography":"15.0.0-canary.127a44b28.0","@material/feature-targeting":"15.0.0-canary.127a44b28.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.127a44b28.0_1697140885194_0.10122092102626645","host":"s3://npm-registry-packages"}},"15.0.0-canary.0ad128337.0":{"name":"@material/slider","version":"15.0.0-canary.0ad128337.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.0ad128337.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"60f03c236d98bcfb1baee3c61995e777744ccc9f","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.0ad128337.0.tgz","fileCount":37,"integrity":"sha512-lv7GnbZBcN7NYDc3MapNPiQd8ZtOQJ3Hsz97OwjxVPnA0S/O9dfTqWfkw6XFOsUMiRP3hb0qxAKQ5LKq+wYVqQ==","signatures":[{"sig":"MEUCIDtsC+2K0v5my3YIyZ2F28nipCMfpFw9ekpRfb7DIiU5AiEAwStTuXKIn9sO/dotDnSrqTb5TE6pFciQ99pmb8XccTM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1228926},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\">\n    <!-- ... -->\n    <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"bb76f531b61a52aae34c7a1efa45824fd32e49f4","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.0ad128337.0","@material/rtl":"15.0.0-canary.0ad128337.0","@material/base":"15.0.0-canary.0ad128337.0","@material/theme":"15.0.0-canary.0ad128337.0","@material/ripple":"15.0.0-canary.0ad128337.0","@material/tokens":"15.0.0-canary.0ad128337.0","@material/animation":"15.0.0-canary.0ad128337.0","@material/elevation":"15.0.0-canary.0ad128337.0","@material/typography":"15.0.0-canary.0ad128337.0","@material/feature-targeting":"15.0.0-canary.0ad128337.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.0ad128337.0_1697741575263_0.35122106886124893","host":"s3://npm-registry-packages"}},"15.0.0-canary.9cec94097.0":{"name":"@material/slider","version":"15.0.0-canary.9cec94097.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.9cec94097.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"edb7fd173a968e67bc88cda2747668115fb4dc43","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.9cec94097.0.tgz","fileCount":37,"integrity":"sha512-KNXoqLwo3kFhWzTPI/k+FiG/uEQ6mwQKyJzPLrtRylXSlHX+g6mn6pNt/fZ2LhVal5Nqzu7mGkiTUd813XHk5g==","signatures":[{"sig":"MEUCIQCdQq/hPBpqQfNADfLZR26uWhVYA9+Jgzq50Jfqh/MdBwIgXqXsxB6EKk8ZNvh8YmHFgW60rHhDKxUn5Wr1vDmK6tg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1228926},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\">\n    <!-- ... -->\n    <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"1a8019402daf97efb72456551503dfb3fa31466b","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.9cec94097.0","@material/rtl":"15.0.0-canary.9cec94097.0","@material/base":"15.0.0-canary.9cec94097.0","@material/theme":"15.0.0-canary.9cec94097.0","@material/ripple":"15.0.0-canary.9cec94097.0","@material/tokens":"15.0.0-canary.9cec94097.0","@material/animation":"15.0.0-canary.9cec94097.0","@material/elevation":"15.0.0-canary.9cec94097.0","@material/typography":"15.0.0-canary.9cec94097.0","@material/feature-targeting":"15.0.0-canary.9cec94097.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.9cec94097.0_1697757014103_0.45939627570999875","host":"s3://npm-registry-packages"}},"15.0.0-canary.c51a0bbcc.0":{"name":"@material/slider","version":"15.0.0-canary.c51a0bbcc.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.c51a0bbcc.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"56a7e2d6ee439097c7a5ad6fe8b1ed85114875ab","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.c51a0bbcc.0.tgz","fileCount":37,"integrity":"sha512-N0bwmagbDxl0oCg33EnmYnps+awmQjEs238IeiZP3831nWr+236JiJ98roPywwIJK2+a1tnaqiF8f1QhqHc3lg==","signatures":[{"sig":"MEYCIQC1S2W4b7K4TwnW5SbgGNW/LkqrmT8fIutCvrDPdP80LAIhAMbO8j40CaLKsMXMa4nco82LnTFtgNYB9w/0bahFtbLS","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1228926},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\">\n    <!-- ... -->\n    <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"e65c7fe6dcc6d6069f00d4d2f8c55e61710d046b","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.c51a0bbcc.0","@material/rtl":"15.0.0-canary.c51a0bbcc.0","@material/base":"15.0.0-canary.c51a0bbcc.0","@material/theme":"15.0.0-canary.c51a0bbcc.0","@material/ripple":"15.0.0-canary.c51a0bbcc.0","@material/tokens":"15.0.0-canary.c51a0bbcc.0","@material/animation":"15.0.0-canary.c51a0bbcc.0","@material/elevation":"15.0.0-canary.c51a0bbcc.0","@material/typography":"15.0.0-canary.c51a0bbcc.0","@material/feature-targeting":"15.0.0-canary.c51a0bbcc.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.c51a0bbcc.0_1700081937186_0.2922117235380266","host":"s3://npm-registry-packages"}},"15.0.0-canary.d76666ad4.0":{"name":"@material/slider","version":"15.0.0-canary.d76666ad4.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.d76666ad4.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"4940c66752a16fead2b90cb954beb2dfe988ccd1","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.d76666ad4.0.tgz","fileCount":37,"integrity":"sha512-+YzXpMgX/YVX0bqNsiolg/yalugsxiDLI+PO0rvzy+/1CU1JrUTwj9tU5VHQkT0RbNLW6X0LObSYGkGjsaWYUA==","signatures":[{"sig":"MEYCIQCnloIp2iZPvkNX/MqhWw7s9u49D6r0UUv/kPdkw8pkQQIhAJpVmXAVmLufwKz2ZhUyfSOC7rEaRv/t8NeGv7yVtFIO","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1228926},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\">\n    <!-- ... -->\n    <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"8fc3640e389fda0098b42091a9a1ab8653fc6470","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.d76666ad4.0","@material/rtl":"15.0.0-canary.d76666ad4.0","@material/base":"15.0.0-canary.d76666ad4.0","@material/theme":"15.0.0-canary.d76666ad4.0","@material/ripple":"15.0.0-canary.d76666ad4.0","@material/tokens":"15.0.0-canary.d76666ad4.0","@material/animation":"15.0.0-canary.d76666ad4.0","@material/elevation":"15.0.0-canary.d76666ad4.0","@material/typography":"15.0.0-canary.d76666ad4.0","@material/feature-targeting":"15.0.0-canary.d76666ad4.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.d76666ad4.0_1701123201956_0.46123789248952396","host":"s3://npm-registry-packages"}},"15.0.0-canary.8656bf0e0.0":{"name":"@material/slider","version":"15.0.0-canary.8656bf0e0.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.8656bf0e0.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"e5ae8ee0305f66f05a12f158bdaa3027d62b5496","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.8656bf0e0.0.tgz","fileCount":37,"integrity":"sha512-p2bw7+R9LemgvDMYwxiFru92Kl+prYv+Vybzy5+zh+trnRIPG2Zbi/CRO0MIjs65mIY3Lm9oUuYgb4Mp0ObzWg==","signatures":[{"sig":"MEMCIFHa3gufwWUrDHWEek9GIHihgoHuUVhwAqm97bmmYYcBAh8FqU5nYrehIP9nMNPlUr6l/VdCjkMxCC/isYbkADXL","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1228926},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\">\n    <!-- ... -->\n    <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"36cab37e468233da3044a10c1df388f634163cc1","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.8656bf0e0.0","@material/rtl":"15.0.0-canary.8656bf0e0.0","@material/base":"15.0.0-canary.8656bf0e0.0","@material/theme":"15.0.0-canary.8656bf0e0.0","@material/ripple":"15.0.0-canary.8656bf0e0.0","@material/tokens":"15.0.0-canary.8656bf0e0.0","@material/animation":"15.0.0-canary.8656bf0e0.0","@material/elevation":"15.0.0-canary.8656bf0e0.0","@material/typography":"15.0.0-canary.8656bf0e0.0","@material/feature-targeting":"15.0.0-canary.8656bf0e0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.8656bf0e0.0_1702415934440_0.42287687515640715","host":"s3://npm-registry-packages"}},"15.0.0-canary.7f224ddd4.0":{"name":"@material/slider","version":"15.0.0-canary.7f224ddd4.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.7f224ddd4.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"beba0d242fd110f063422fba40be3850cda01e44","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.7f224ddd4.0.tgz","fileCount":37,"integrity":"sha512-QU/WSaSWlLKQRqOhJrPgm29wqvvzRusMqwAcrCh1JTrCl+xwJ43q5WLDfjYhubeKtrEEgGu9tekkAiYfMG7EBw==","signatures":[{"sig":"MEUCIGxfMX7DlIjw+vzDDCgXc8xr61ArOB1+vBXCpCjZAtUwAiEAte2Y4Dt+C1UDtNBH1vQaMjSdySE/eXcxMpJ68YOdzI4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1228926},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\">\n    <!-- ... -->\n    <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"ff8ff3ce455054f1532d1ae0983f40634a524886","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.7f224ddd4.0","@material/rtl":"15.0.0-canary.7f224ddd4.0","@material/base":"15.0.0-canary.7f224ddd4.0","@material/theme":"15.0.0-canary.7f224ddd4.0","@material/ripple":"15.0.0-canary.7f224ddd4.0","@material/tokens":"15.0.0-canary.7f224ddd4.0","@material/animation":"15.0.0-canary.7f224ddd4.0","@material/elevation":"15.0.0-canary.7f224ddd4.0","@material/typography":"15.0.0-canary.7f224ddd4.0","@material/feature-targeting":"15.0.0-canary.7f224ddd4.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.7f224ddd4.0_1703743765664_0.10329800281432755","host":"s3://npm-registry-packages"}},"15.0.0-canary.a0b8a90c0.0":{"name":"@material/slider","version":"15.0.0-canary.a0b8a90c0.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.a0b8a90c0.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"2a8337745ecd78f26cc6eb123d2152ab9f8be9bb","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.a0b8a90c0.0.tgz","fileCount":37,"integrity":"sha512-jphd2GmJ2y0Gp8lBl5d73UDKxMdmpJ7MkNLuNRVXZMZ8wEuDsag2nmwNRCGohF0Y2aIcCC00yPeUOdX+IpeWLg==","signatures":[{"sig":"MEQCICc7DLJrDg2vCi/s+mg85uZ2NLiVWElt1JKKQ1j2tj3aAiBQMtGr52DxkA0vAfkURRx5jZGybUDLUiKz38ygY5KC6Q==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1228926},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\">\n    <!-- ... -->\n    <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"85d5965379b080c9f852ecbbd95031e363636dfd","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.a0b8a90c0.0","@material/rtl":"15.0.0-canary.a0b8a90c0.0","@material/base":"15.0.0-canary.a0b8a90c0.0","@material/theme":"15.0.0-canary.a0b8a90c0.0","@material/ripple":"15.0.0-canary.a0b8a90c0.0","@material/tokens":"15.0.0-canary.a0b8a90c0.0","@material/animation":"15.0.0-canary.a0b8a90c0.0","@material/elevation":"15.0.0-canary.a0b8a90c0.0","@material/typography":"15.0.0-canary.a0b8a90c0.0","@material/feature-targeting":"15.0.0-canary.a0b8a90c0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.a0b8a90c0.0_1707333587294_0.30217755308642413","host":"s3://npm-registry-packages"}},"15.0.0-canary.e50b478eb.0":{"name":"@material/slider","version":"15.0.0-canary.e50b478eb.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.e50b478eb.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"16cc38cf4a27bc379b12f7771d5fd15099a46f4f","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.e50b478eb.0.tgz","fileCount":37,"integrity":"sha512-FDYWZK9Fg3z40I9i37I+JBJAjLjJqbhczn/TBvt2rZtT/6p7U7tkVvcsSHCpxtxuWspY4dZcUfF53rFjlFLsaA==","signatures":[{"sig":"MEQCIB0iq6stZXhV1gtAWd91TxnL5Xr3KP6sFryNtTxq5DO3AiANdPDxz9BJUcpx7humxFcxm6P2SJl3CNfVR03Rw4k2tA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1228926},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\">\n    <!-- ... -->\n    <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"4691455eaee76f99b18be70913c9fefb7cf3c2ae","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.e50b478eb.0","@material/rtl":"15.0.0-canary.e50b478eb.0","@material/base":"15.0.0-canary.e50b478eb.0","@material/theme":"15.0.0-canary.e50b478eb.0","@material/ripple":"15.0.0-canary.e50b478eb.0","@material/tokens":"15.0.0-canary.e50b478eb.0","@material/animation":"15.0.0-canary.e50b478eb.0","@material/elevation":"15.0.0-canary.e50b478eb.0","@material/typography":"15.0.0-canary.e50b478eb.0","@material/feature-targeting":"15.0.0-canary.e50b478eb.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.e50b478eb.0_1707415698953_0.9535176884385714","host":"s3://npm-registry-packages"}},"15.0.0-canary.c43b3438b.0":{"name":"@material/slider","version":"15.0.0-canary.c43b3438b.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.c43b3438b.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"03487cb9966279906dabfa874c3707ce6669f7fe","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.c43b3438b.0.tgz","fileCount":37,"integrity":"sha512-09iHDiBlVw/iB1S2yYLc5Vgm5hZIYM7XRwlwz0tezWbhihb9tX48QAtcPd/JmciyDdYwk+MDytQkLx+vU0/Peg==","signatures":[{"sig":"MEUCIQCFrLhfDG5b14Cpr22rWiPQczA1uK6OiLk4j2o0c7YRPwIgIc+yINc9G3aqNrLYXwzZeEQt32yBk4B2CjsPqAIK8j4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1228926},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\">\n    <!-- ... -->\n    <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"e69adcf897de97b302f026f07bbc2571b1a488ca","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.c43b3438b.0","@material/rtl":"15.0.0-canary.c43b3438b.0","@material/base":"15.0.0-canary.c43b3438b.0","@material/theme":"15.0.0-canary.c43b3438b.0","@material/ripple":"15.0.0-canary.c43b3438b.0","@material/tokens":"15.0.0-canary.c43b3438b.0","@material/animation":"15.0.0-canary.c43b3438b.0","@material/elevation":"15.0.0-canary.c43b3438b.0","@material/typography":"15.0.0-canary.c43b3438b.0","@material/feature-targeting":"15.0.0-canary.c43b3438b.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.c43b3438b.0_1708719471285_0.03714605744975885","host":"s3://npm-registry-packages"}},"15.0.0-canary.819498d8c.0":{"name":"@material/slider","version":"15.0.0-canary.819498d8c.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.819498d8c.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"197cda094c6e70dc1877d8625c3eaa8cff5d679d","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.819498d8c.0.tgz","fileCount":37,"integrity":"sha512-Q8orsrsLeOVlMjl8fSZ7uI6aojExbMJ8j4v7+7k1PdKTdNrDeRoSijKpi7CuP4EwKBJXA9ZwPZY2HE9D3hw4gQ==","signatures":[{"sig":"MEUCIQDJtgXNDr/RYm6l+pacm/kPmRcCpPkdZYXLrvaeT+5jcgIgZMphKed/hWHQQcRNGg5Q+B5S+aYTXxjdlu2AlKVJN5k=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1228926},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\">\n    <!-- ... -->\n    <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"886876a8252aacefe1942b13ba9251af9204bcdd","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.819498d8c.0","@material/rtl":"15.0.0-canary.819498d8c.0","@material/base":"15.0.0-canary.819498d8c.0","@material/theme":"15.0.0-canary.819498d8c.0","@material/ripple":"15.0.0-canary.819498d8c.0","@material/tokens":"15.0.0-canary.819498d8c.0","@material/animation":"15.0.0-canary.819498d8c.0","@material/elevation":"15.0.0-canary.819498d8c.0","@material/typography":"15.0.0-canary.819498d8c.0","@material/feature-targeting":"15.0.0-canary.819498d8c.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.819498d8c.0_1710515716461_0.4192937112395134","host":"s3://npm-registry-packages"}},"15.0.0-canary.453a6248a.0":{"name":"@material/slider","version":"15.0.0-canary.453a6248a.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.453a6248a.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"e74c5bd5a5fd893ce5e108ee346febae87b7f0a6","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.453a6248a.0.tgz","fileCount":37,"integrity":"sha512-OLtYwgIVRsFk9mPJJrDkpb+Smp8xL2Y6wXZirZqBlI4HVmwlvXTY5HpC8oyVSHBy6hjYgCXdirzu8gDgJaOmaQ==","signatures":[{"sig":"MEUCIAT2cIHgpXPotDDG0givKzYrPP+fJRNdJPKMp6wPIhubAiEAyyXsxygBcPeRmXdVcBOkG4QNr7OI0JuHn3rR5LSb0jg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1228926},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\">\n    <!-- ... -->\n    <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"1eea6443d63f2bc64fe8f6f86664b54266c41244","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.453a6248a.0","@material/rtl":"15.0.0-canary.453a6248a.0","@material/base":"15.0.0-canary.453a6248a.0","@material/theme":"15.0.0-canary.453a6248a.0","@material/ripple":"15.0.0-canary.453a6248a.0","@material/tokens":"15.0.0-canary.453a6248a.0","@material/animation":"15.0.0-canary.453a6248a.0","@material/elevation":"15.0.0-canary.453a6248a.0","@material/typography":"15.0.0-canary.453a6248a.0","@material/feature-targeting":"15.0.0-canary.453a6248a.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.453a6248a.0_1711386831399_0.31881650130234784","host":"s3://npm-registry-packages"}},"15.0.0-canary.68edc03c6.0":{"name":"@material/slider","version":"15.0.0-canary.68edc03c6.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.68edc03c6.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"f7a89cd99318340c623b62ba022699a9acc2879d","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.68edc03c6.0.tgz","fileCount":37,"integrity":"sha512-Dx78f40+A7vG3UE9OBtRWulx9FXP0rLUo62MMolsv2nlTSPOY/uPPSX0hELd7qOMtK0TmKKksUUHPu5VyalaRQ==","signatures":[{"sig":"MEQCIHmHKRDnGxPJ9GzMRizYV/xyZPRLD7HqFoTZXwexvZ+uAiBk5wPUdDot0LGA0jpVIgAcpiZ1FS+nlih63WGP5QRmsg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1228926},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\">\n    <!-- ... -->\n    <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"04046ad51f4d581f93e797ec929d219422dd0235","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.68edc03c6.0","@material/rtl":"15.0.0-canary.68edc03c6.0","@material/base":"15.0.0-canary.68edc03c6.0","@material/theme":"15.0.0-canary.68edc03c6.0","@material/ripple":"15.0.0-canary.68edc03c6.0","@material/tokens":"15.0.0-canary.68edc03c6.0","@material/animation":"15.0.0-canary.68edc03c6.0","@material/elevation":"15.0.0-canary.68edc03c6.0","@material/typography":"15.0.0-canary.68edc03c6.0","@material/feature-targeting":"15.0.0-canary.68edc03c6.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.68edc03c6.0_1712603194541_0.008318867529863772","host":"s3://npm-registry-packages"}},"15.0.0-canary.5bebc0064.0":{"name":"@material/slider","version":"15.0.0-canary.5bebc0064.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.5bebc0064.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"9a3437462f7fdbd9f4f3b0ebda7122865bb25890","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.5bebc0064.0.tgz","fileCount":37,"integrity":"sha512-sLPo/Bq15Wnh0AsZNii/24Bb8g4hz8WucfQoxOeVf/vL7ZDYiximLuSB41muFoeOLPlZKfbGF4oF4AMDM8bd3A==","signatures":[{"sig":"MEUCIQDC0Mw0sX/jy+rIPJ/t8a3fT1kLaAcqJkZHxbu3ejLDWgIgDN6qkZGZlpv6PtXAXOC0LFBbscS0Wu4oS8mYM9NZgrQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1228926},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\">\n    <!-- ... -->\n    <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"ff39e65972de013a29dd14429e111139bc616366","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.5bebc0064.0","@material/rtl":"15.0.0-canary.5bebc0064.0","@material/base":"15.0.0-canary.5bebc0064.0","@material/theme":"15.0.0-canary.5bebc0064.0","@material/ripple":"15.0.0-canary.5bebc0064.0","@material/tokens":"15.0.0-canary.5bebc0064.0","@material/animation":"15.0.0-canary.5bebc0064.0","@material/elevation":"15.0.0-canary.5bebc0064.0","@material/typography":"15.0.0-canary.5bebc0064.0","@material/feature-targeting":"15.0.0-canary.5bebc0064.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.5bebc0064.0_1712871685177_0.7721833226715036","host":"s3://npm-registry-packages"}},"15.0.0-canary.311f29a60.0":{"name":"@material/slider","version":"15.0.0-canary.311f29a60.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.311f29a60.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"3e1cf7d7d262368ba8b4ce6df927472e200f083c","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.311f29a60.0.tgz","fileCount":37,"integrity":"sha512-PjSiKUZOmznI+SWqIjUwHsCUOJ+ZFMwqJKTHBo1lWvArBfCuD8vNvIrnvrJ66VnoZLGF0RDbXhUEH1tE1ITvYg==","signatures":[{"sig":"MEUCIQC9dazVX7sxyhSnJB96Lvc3z8b25N2IVpASYYs/L5UStwIgNuE90so6gIz8bddMPKtRDwAHnA72rPftqXR8eMghBqI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1228926},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\">\n    <!-- ... -->\n    <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"7bc0264e163e842f0f96c1dbf7a468c022db1497","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.311f29a60.0","@material/rtl":"15.0.0-canary.311f29a60.0","@material/base":"15.0.0-canary.311f29a60.0","@material/theme":"15.0.0-canary.311f29a60.0","@material/ripple":"15.0.0-canary.311f29a60.0","@material/tokens":"15.0.0-canary.311f29a60.0","@material/animation":"15.0.0-canary.311f29a60.0","@material/elevation":"15.0.0-canary.311f29a60.0","@material/typography":"15.0.0-canary.311f29a60.0","@material/feature-targeting":"15.0.0-canary.311f29a60.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.311f29a60.0_1713895224057_0.5492471493953073","host":"s3://npm-registry-packages"}},"15.0.0-canary.65c10a622.0":{"name":"@material/slider","version":"15.0.0-canary.65c10a622.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.65c10a622.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"e2065872d37f2a6c755f9730893a9c9b523b7ad6","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.65c10a622.0.tgz","fileCount":37,"integrity":"sha512-FptPCWgADKwB6/5zVbgmhtZt0ORRF317KoO3JakHKPfX4WOPBlNhgkxaqb74refGEdpoiwvJGcAutcXmCMz5yg==","signatures":[{"sig":"MEQCIHEPo2iBxEYhclUIeNkuOtZidQdxxucHco2wFlASV1n/AiAIw0oy9FaeaP0SoaKz8U9Jmme7OouOev9hwxNsoy5MYA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1228926},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\">\n    <!-- ... -->\n    <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"1f3126503c812250084b65b6edbb26f25ef4a174","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.65c10a622.0","@material/rtl":"15.0.0-canary.65c10a622.0","@material/base":"15.0.0-canary.65c10a622.0","@material/theme":"15.0.0-canary.65c10a622.0","@material/ripple":"15.0.0-canary.65c10a622.0","@material/tokens":"15.0.0-canary.65c10a622.0","@material/animation":"15.0.0-canary.65c10a622.0","@material/elevation":"15.0.0-canary.65c10a622.0","@material/typography":"15.0.0-canary.65c10a622.0","@material/feature-targeting":"15.0.0-canary.65c10a622.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.65c10a622.0_1714070952932_0.9068591616490487","host":"s3://npm-registry-packages"}},"15.0.0-canary.4b35cb7d0.0":{"name":"@material/slider","version":"15.0.0-canary.4b35cb7d0.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.4b35cb7d0.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"185b7156c00094e689de15fde7ddb15dea05a5a9","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.4b35cb7d0.0.tgz","fileCount":37,"integrity":"sha512-uvR8g7GJgOIx6GvmaoUhn/XvUTnvUIkCZGvpj68xnmWbs5ldJYOiby8SpyfW1VF2Q8V7kArwitqc5Gwx0Ht56g==","signatures":[{"sig":"MEYCIQDGfNIf+wRpn8DWdXG03mEsURxZEq0QOfOlVI7xbb++RwIhAJixe3QBq/BYZEAen8JjNdSjFBETgagIP6ldZMU5x7LE","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1228926},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\">\n    <!-- ... -->\n    <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"cba29aaa21c1bc2b1f1a02e5ddfa4a5110d9ef63","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.4b35cb7d0.0","@material/rtl":"15.0.0-canary.4b35cb7d0.0","@material/base":"15.0.0-canary.4b35cb7d0.0","@material/theme":"15.0.0-canary.4b35cb7d0.0","@material/ripple":"15.0.0-canary.4b35cb7d0.0","@material/tokens":"15.0.0-canary.4b35cb7d0.0","@material/animation":"15.0.0-canary.4b35cb7d0.0","@material/elevation":"15.0.0-canary.4b35cb7d0.0","@material/typography":"15.0.0-canary.4b35cb7d0.0","@material/feature-targeting":"15.0.0-canary.4b35cb7d0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.4b35cb7d0.0_1714651397522_0.5950576143378818","host":"s3://npm-registry-packages"}},"15.0.0-canary.f80ac92b0.0":{"name":"@material/slider","version":"15.0.0-canary.f80ac92b0.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.f80ac92b0.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"355367436e781c2dc1678c9b16487e71c01cff91","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.f80ac92b0.0.tgz","fileCount":37,"integrity":"sha512-VsEckrztb5Z+ze2I8Uq4P/Ogcpkf3yzFUtyWRvVKLleFw7XRbVtvYJsGMEefpAi+yU0M7CEv6NCg1uidg0iC1g==","signatures":[{"sig":"MEYCIQDyoqKiFZ3YftytCIaQQpZJmpqbVxrdqnVPLo7Kc5OcYQIhAPli9PRmJodlKiVQUdj4hiMBPWqzpqBQgPvpJoPfyRHN","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1228926},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\">\n    <!-- ... -->\n    <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"514a3afe9efc5bcebf1ace1e335357184ee1a9e0","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.f80ac92b0.0","@material/rtl":"15.0.0-canary.f80ac92b0.0","@material/base":"15.0.0-canary.f80ac92b0.0","@material/theme":"15.0.0-canary.f80ac92b0.0","@material/ripple":"15.0.0-canary.f80ac92b0.0","@material/tokens":"15.0.0-canary.f80ac92b0.0","@material/animation":"15.0.0-canary.f80ac92b0.0","@material/elevation":"15.0.0-canary.f80ac92b0.0","@material/typography":"15.0.0-canary.f80ac92b0.0","@material/feature-targeting":"15.0.0-canary.f80ac92b0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.f80ac92b0.0_1714652005653_0.4709546560013713","host":"s3://npm-registry-packages"}},"15.0.0-canary.2f5b899bc.0":{"name":"@material/slider","version":"15.0.0-canary.2f5b899bc.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.2f5b899bc.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"3e6a8a93c14e0d1ea8c375526ba41cf6ae41be2c","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.2f5b899bc.0.tgz","fileCount":37,"integrity":"sha512-bYh26Fn7UXTSAbErjiaBrfuoPnP/cnhc53Das0afWwXtfm5Jf7NEiWdHOha2M8LrqCJTH8Vyq7G/+LiSs1EiFw==","signatures":[{"sig":"MEYCIQD6aUkL3adCW4KET1Oi7oUXB4DntsAhltMNcm03x1MbtQIhAPbK6IS2fryY+omzfvg+2QQPjf/AGL2X5N1ydPad+TUL","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1228926},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\">\n    <!-- ... -->\n    <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"751553ca74ad43074c963487257a8862de87844b","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.2f5b899bc.0","@material/rtl":"15.0.0-canary.2f5b899bc.0","@material/base":"15.0.0-canary.2f5b899bc.0","@material/theme":"15.0.0-canary.2f5b899bc.0","@material/ripple":"15.0.0-canary.2f5b899bc.0","@material/tokens":"15.0.0-canary.2f5b899bc.0","@material/animation":"15.0.0-canary.2f5b899bc.0","@material/elevation":"15.0.0-canary.2f5b899bc.0","@material/typography":"15.0.0-canary.2f5b899bc.0","@material/feature-targeting":"15.0.0-canary.2f5b899bc.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.2f5b899bc.0_1716213393183_0.7579165984011726","host":"s3://npm-registry-packages"}},"15.0.0-canary.cfec83c74.0":{"name":"@material/slider","version":"15.0.0-canary.cfec83c74.0","keywords":["material components","material design","slider"],"license":"MIT","_id":"@material/slider@15.0.0-canary.cfec83c74.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"7a74d9c43398b7892366a25c757130ae64ef898c","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.cfec83c74.0.tgz","fileCount":37,"integrity":"sha512-3uNrBCiQMt/f63RhPZ3WmtC1wkunz23vx7FbtLNH39dKPvTVu8ho5BjK5Fxqv27MjaXz0m0Pg6BLP8zE79z56g==","signatures":[{"sig":"MEYCIQDhrSaZEbGHS6t/CY8F3qm3RPaHcaHju28EXv8+PhxEJQIhAM9BdHFDrFSKv1CkFC5GOJKv+fz/UOnDIWHaK9frgJyX","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1228926},"main":"dist/mdc.slider.js","module":"index.js","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\">\n    <!-- ... -->\n    <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","gitHead":"0ec8b129344ebbe45f00b6ad892b682b054ea892","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components for the web slider component","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.cfec83c74.0","@material/rtl":"15.0.0-canary.cfec83c74.0","@material/base":"15.0.0-canary.cfec83c74.0","@material/theme":"15.0.0-canary.cfec83c74.0","@material/ripple":"15.0.0-canary.cfec83c74.0","@material/tokens":"15.0.0-canary.cfec83c74.0","@material/animation":"15.0.0-canary.cfec83c74.0","@material/elevation":"15.0.0-canary.cfec83c74.0","@material/typography":"15.0.0-canary.cfec83c74.0","@material/feature-targeting":"15.0.0-canary.cfec83c74.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/slider_15.0.0-canary.cfec83c74.0_1716231420177_0.12725785324668681","host":"s3://npm-registry-packages"}},"15.0.0-canary.423edc3dc.0":{"name":"@material/slider","version":"15.0.0-canary.423edc3dc.0","description":"The Material Components for the web slider component","main":"dist/mdc.slider.js","module":"index.js","sideEffects":false,"license":"MIT","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web.git","directory":"packages/mdc-slider"},"keywords":["material components","material design","slider"],"publishConfig":{"access":"public"},"dependencies":{"@material/animation":"15.0.0-canary.423edc3dc.0","@material/base":"15.0.0-canary.423edc3dc.0","@material/dom":"15.0.0-canary.423edc3dc.0","@material/elevation":"15.0.0-canary.423edc3dc.0","@material/feature-targeting":"15.0.0-canary.423edc3dc.0","@material/ripple":"15.0.0-canary.423edc3dc.0","@material/rtl":"15.0.0-canary.423edc3dc.0","@material/theme":"15.0.0-canary.423edc3dc.0","@material/tokens":"15.0.0-canary.423edc3dc.0","@material/typography":"15.0.0-canary.423edc3dc.0","tslib":"^2.1.0"},"gitHead":"19b2c5a95782b4928b3aecb29a1075c42aee53e5","readme":"<!--docs:\ntitle: \"Sliders\"\nlayout: detail\nsection: components\nexcerpt: \"Sliders allow users to make selections from a range of values.\"\niconId: slider\npath: /catalog/input-controls/sliders/\n-->\n\n# Slider\n\n[Sliders](https://material.io/components/sliders/) allow users to make\nselections from a range of values.\n\nThe MDC Slider implementation supports both single point sliders (one thumb)\nand range sliders (two thumbs). It is backed by the browser\n`<input type=\"range\">` element, is fully accessible, and is RTL-aware.\n\n**Contents**\n\n*   [Using sliders](#using-sliders)\n*   [Sliders](#sliders)\n*   [Other variants](#other-variants)\n*   [Additional information](#additional-information)\n*   [API](#api)\n\n## Using sliders\n\n### Installing sliders\n\n```\nnpm install @material/slider\n```\n\n### Styles\n\n```scss\n@use \"@material/slider/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCSlider} from '@material/slider';\n\nconst slider = new MDCSlider(document.querySelector('.mdc-slider'));\n```\n\n**Note**: See [Importing the JS component](../../docs/importing-js.md) for more\ninformation on how to import JavaScript.\n\n### Making sliders accessible\n\nSliders are backed by an `<input>` element, meaning that they are fully\naccessible. Unlike the [ARIA-based slider](https://www.w3.org/TR/wai-aria-practices/#slider),\nMDC sliders are adjustable using touch-based assistive technologies such as\nTalkBack on Android.\n\nPer the spec, ensure that the following attributes are added to the\n`input` element(s):\n\n* `value`: Value representing the current value.\n* `min`: Value representing the minimum allowed value.\n* `max`: Value representing the maximum allowed value.\n* `aria-label` or `aria-labelledby`: Accessible label for the slider.\n\nIf the value is not user-friendly (e.g. a number to\nrepresent the day of the week), also set the following:\n\n* `aria-valuetext`: Set this input attribute to a string that makes the slider\nvalue understandable, e.g. 'Monday'.\n* Add a function to map the slider value to `aria-valuetext` via the\n`MDCSlider#setValueToAriaValueTextFn` method.\n\n## Sliders\n\nThere are two types of sliders:\n\n1.  [Continuous slider](#continuous-slider)\n1.  [Discrete slider](#discrete-slider)\n\n### Continuous slider\n\nContinuous sliders allow users to make meaningful selections that don’t require\na specific value.\n\nNote: The step size for value quantization is, by default, 1. To specify\na custom step size, provide a value for the `step` attribute on the `input`\nelement.\n\n<img src=\"images/continuous-slider.png\" alt=\"Continuous slider with a value of 50\">\n\n```html\n<div class=\"mdc-slider\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" aria-label=\"Continuous slider demo\">\n  </div>\n</div>\n```\n\n#### Continuous range slider\n\nNote: By default there's no minimum distance between the two thumbs. To specify\none, provide a value for the `data-min-range` attribute on the root element and\nadjust the `min` and `max` attributes on the input elements accordingly.\n\n<img src=\"images/continuous-range-slider.png\" alt=\"Continuous range slider with values of 30 and 70\">\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Continuous range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Continuous range slider demo\">\n  </div>\n</div>\n```\n\n### Discrete slider\n\nDiscrete sliders display a numeric value label upon pressing the thumb, which\nallows a user to select an exact value.\n\n<img src=\"images/discrete-slider.png\" alt=\"Discrete slider with a value of 50\">\n\nTo create a discrete slider, add the following:\n\n*   `mdc-slider--discrete` class on the root element.\n*   Value indicator element (`mdc-slider__value-indicator-container`), as shown\n    below.\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider demo\">\n  </div>\n</div>\n```\n\n#### Discrete slider with tick marks\n\nDiscrete sliders can optionally display tick marks. Tick marks represent\npredetermined values to which the user can move the slider.\n\n<img src=\"images/discrete-slider-tick-marks.png\" alt=\"Discrete slider (with tick marks), with a value of 50\">\n\nTo add tick marks to a discrete slider, add the following:\n\n*   `mdc-slider--tick-marks` class on the root element\n*   `mdc-slider__tick-marks` element as a child of the `mdc-slider__track`\n    element\n*   `mdc-slider__tick-mark--active` and `mdc-slider__tick-mark--inactive`\n    elements as children of the `mdc-slider__tick-marks` element\n\n```html\n<div class=\"mdc-slider mdc-slider--discrete mdc-slider--tick-marks\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n    <div class=\"mdc-slider__tick-marks\">\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--active\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n      <div class=\"mdc-slider__tick-mark--inactive\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" name=\"volume\" step=\"10\" aria-label=\"Discrete slider with tick marks demo\">\n  </div>\n</div>\n```\n\n#### Discrete range slider\n\n```html\n<div class=\"mdc-slider mdc-slider--range mdc-slider--discrete\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          20\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"50\" value=\"20\" step=\"10\" name=\"rangeStart\" aria-label=\"Discrete range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__value-indicator-container\" aria-hidden=\"true\">\n      <div class=\"mdc-slider__value-indicator\">\n        <span class=\"mdc-slider__value-indicator-text\">\n          50\n        </span>\n      </div>\n    </div>\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"20\" max=\"100\" value=\"50\" step=\"10\" name=\"rangeEnd\" aria-label=\"Discrete range slider demo\">\n  </div>\n</div>\n```\n\n## Other variants\n\n### Disabled slider\n\nTo disable a slider, add the following:\n\n*   `mdc-slider--disabled` class on the root element\n*   `disabled` attribute on the input element\n\n```html\n<div class=\"mdc-slider mdc-slider--disabled\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"100\" value=\"50\" step=\"10\" disabled name=\"volume\" aria-label=\"Disabled slider demo\">\n  </div>\n</div>\n```\n\n## Additional information\n\n### Initialization with custom ranges and values\n\nWhen `MDCSlider` is initialized, it reads the input element's `min`,\n`max`, and `value` attributes if present, using them to set\nthe component's internal `min`, `max`, and `value` properties.\n\nUse these attributes to initialize the slider with a custom range and values,\nas shown below:\n\n```html\n<div class=\"mdc-slider\">\n  <!-- ... -->\n  <div class=\"mdc-slider__thumb\">\n    <!-- ... -->\n    <input class=\"mdc-slider__input\" aria-label=\"Slider demo\" min=\"0\" max=\"100\" value=\"75\">\n  </div>\n</div>\n```\n\n### Setting slider position before component initialization\n\nWhen `MDCSlider` is initialized, it updates the slider track and thumb\npositions based on the internal value(s). To set the correct track and thumb\npositions before component initialization, mark up the DOM as follows:\n\n- Calculate `rangePercentDecimal`, the active track range as a percentage of\n  the entire track, i.e. `(valueEnd - valueStart) / (max - min)`.\n  Set `transform:scaleX(<rangePercentDecimal>)` as an inline style on the\n  `mdc-slider__track--active_fill` element.\n- Calculate `thumbEndPercent`, the initial position of the end thumb as a\n  percentage of the entire track. Set `left:calc(<thumbEndPercent>% - 24px)`\n  as an inline style on the end thumb (`mdc-slider__thumb`) element\n  (or `right` for RTL layouts).\n- *[Range sliders only]* Calculate `thumbStartPercent`, the initial position\n  of the start thumb as a percentage of the entire track. Set\n  `left:calc(<thumbStartPercent>% - 24px)` as an inline style on the\n  start thumb (`mdc-slider__thumb`) element (or `right` for RTL layouts).\n- *[Range sliders only]* Using the previously calculated `thumbStartPercent`,\n  set `left:<thumbStartPercent>%` as an inline style on the\n  `mdc-slider__track--active_fill` element (or `right` for RTL layouts).\n\nAdditionally, the MDCSlider component should be initialized with\n`skipInitialUIUpdate` set to true.\n\n#### Range slider example\n\nThis is an example of a range slider with internal values of\n`[min, max] = [0, 100]` and `[start, end] = [30, 70]`, and a minimum range of\n10.\n\n```html\n<div class=\"mdc-slider mdc-slider--range\" data-min-range=\"10\">\n  <div class=\"mdc-slider__track\">\n    <div class=\"mdc-slider__track--inactive\"></div>\n    <div class=\"mdc-slider__track--active\">\n      <div class=\"mdc-slider__track--active_fill\"\n           style=\"transform:scaleX(.4); left:30%\"></div>\n    </div>\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(30%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"0\" max=\"60\" value=\"30\" name=\"rangeStart\" aria-label=\"Range slider demo\">\n  </div>\n  <div class=\"mdc-slider__thumb\" style=\"left:calc(70%-24px)\">\n    <div class=\"mdc-slider__thumb-knob\"></div>\n    <input class=\"mdc-slider__input\" type=\"range\" min=\"40\" max=\"100\" value=\"70\" name=\"rangeEnd\" aria-label=\"Range slider demo\">\n  </div>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMixin | Description\n--- | ---\n`track-active-color($color)` | Sets the color of the active track.\n`track-inactive-color($color, $opacity)` | Sets the color and opacity of the inactive track.\n`thumb-color($color)` | Sets the color of the thumb.\n`thumb-ripple-color($color)` | Sets the color of the thumb ripple.\n`tick-mark-active-color($color)` | Sets the color of tick marks on the active track.\n`tick-mark-inactive-color($color)` | Sets the color of tick marks on the inactive track.\n`value-indicator-color($color, $opaicty)` | Sets the color and opacity of the value indicator.\n`value-indicator-text-color($color, $opaicty)` | Sets the color of the value indicator text.\n\n### `MDCSlider` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCSlider:change` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed and committed from a user event. Mirrors the native `change` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n`MDCSlider:input` | `MDCSliderChangeEventDetail` | Emitted when a value has been changed from a user event. Mirrors the native `input` event: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event\n\n### `MDCSlider` methods\n\nMethod Signature | Description\n--- | ---\n`getValueStart() => number` | Gets the value of the start thumb (only applicable for range sliders).\n`setValueStart(valueStart: number) => void` | Sets the value of the start thumb (only applicable for range sliders).\n`getValue() => number` | Gets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`setValue(value: number) => void` | Sets the value of the thumb (for single point sliders), or the end thumb (for range sliders).\n`getDisabled() => boolean` | Gets the disabled state of the slider.\n`setDisabled(disabled: boolean) => void` | Sets the disabled state of the slider.\n`setValueToAriaValueTextFn((mapFn: ((value: number) => string) \\| null) => void` | Sets a function that maps the slider value to value of the `aria-valuetext` attribute on the thumb element. If not set, the `aria-valuetext` attribute is unchanged when the value changes.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework such as React or Angular, you can create a slider for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCSliderAdapter](./adapter.ts) and [MDCSliderFoundation](./foundation.ts) for up-to-date code documentation of slider foundation API's.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"homepage":"https://github.com/material-components/material-components-web#readme","_id":"@material/slider@15.0.0-canary.423edc3dc.0","_nodeVersion":"14.21.3","_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","dist":{"integrity":"sha512-a1R85usrfXMo1S3+ykIFiqqtKrT7ZDGyS+EO+RqXfGhMk0exd7Pv/jla9MSw8osKhB800dRJ7dBWJZ1+WITfeA==","shasum":"e365c72849b2ede3a1418c3534e3220d79cb7e22","tarball":"https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.423edc3dc.0.tgz","fileCount":37,"unpackedSize":1228926,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIE/Rs5mGCrqiDIHJ1DZFqq2G5WWGi1aftnzLXe6tvUuvAiBI8zXpfpcCnZoB+gJERasVxptrQ2AQhuQ6hRVhf+XsfA=="}]},"_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/slider_15.0.0-canary.423edc3dc.0_1719425523253_0.4655338217286329"},"_hasShrinkwrap":false}},"time":{"created":"2016-08-10T10:39:42.900Z","modified":"2024-06-26T18:12:03.935Z","2.0.0-dev.20160810":"2016-08-10T10:39:42.900Z","2.0.0-dev.20160822":"2016-08-21T22:21:40.064Z","2.0.0-dev.20160822-1":"2016-08-22T00:38:42.014Z","2.0.0-dev.20160903":"2016-09-03T08:17:37.073Z","0.1.0":"2017-06-12T15:53:27.814Z","0.1.1":"2017-06-26T16:11:05.031Z","0.2.0":"2017-07-10T15:58:56.840Z","0.2.1":"2017-07-24T15:49:27.762Z","0.2.2":"2017-08-07T20:48:33.272Z","0.2.3":"2017-08-21T17:28:02.354Z","0.2.4":"2017-08-24T14:46:56.893Z","0.2.5":"2017-09-05T20:16:17.792Z","0.2.6":"2017-09-18T18:35:56.089Z","0.2.7":"2017-10-02T21:11:55.170Z","0.23.0":"2017-10-16T21:02:29.032Z","0.24.0":"2017-10-30T19:11:34.984Z","0.25.0":"2017-11-13T20:02:35.155Z","0.26.0":"2017-11-27T22:26:29.471Z","0.27.0":"2017-12-11T19:35:39.527Z","0.28.0":"2018-01-08T18:55:16.684Z","0.29.0":"2018-01-22T18:31:01.656Z","0.30.0":"2018-02-05T22:03:03.193Z","0.32.0":"2018-03-05T22:08:50.081Z","0.33.0":"2018-03-19T16:40:09.531Z","0.34.0":"2018-04-02T21:52:05.169Z","0.35.0":"2018-04-23T22:40:43.128Z","0.36.0":"2018-06-04T15:38:23.252Z","0.38.0":"2018-07-30T17:06:32.324Z","0.39.0":"2018-08-27T17:40:24.376Z","0.39.1":"2018-08-31T21:36:17.252Z","0.40.0":"2018-09-24T20:00:55.650Z","0.40.1":"2018-10-08T20:54:18.847Z","0.41.0":"2018-10-29T20:21:55.101Z","0.42.0":"2018-12-04T22:55:00.810Z","0.42.1":"2018-12-17T22:25:26.420Z","0.43.0":"2019-01-07T19:49:01.271Z","0.44.0":"2019-02-04T18:23:41.794Z","0.44.1":"2019-02-19T23:03:04.761Z","1.0.0-0":"2019-02-27T23:59:25.997Z","1.0.0-1":"2019-03-04T23:33:17.893Z","1.0.0":"2019-03-06T21:08:05.578Z","1.1.0":"2019-03-26T19:25:48.497Z","2.3.0":"2019-05-28T21:24:01.513Z","3.0.0-alpha.0":"2019-06-12T04:06:46.519Z","3.0.0-alpha.1":"2019-06-12T19:02:11.191Z","3.0.0":"2019-06-25T22:27:53.011Z","3.1.0-alpha.0":"2019-07-16T13:29:06.729Z","3.1.0":"2019-07-22T22:02:37.793Z","4.0.0-alpha.0":"2019-08-07T21:09:26.851Z","4.0.0-canary.0":"2019-09-05T04:37:51.790Z","4.0.0-canary.1":"2019-09-09T20:20:46.389Z","3.2.0":"2019-09-12T21:53:46.005Z","4.0.0-canary.79d881baf.0":"2019-09-13T02:21:35.155Z","4.0.0-canary.e851d4f40.0":"2019-09-13T04:07:24.090Z","4.0.0-canary.905884690.0":"2019-09-16T23:48:11.480Z","4.0.0-canary.199534d61.0":"2019-09-27T18:57:48.843Z","4.0.0-canary.22d7ad2fb.0":"2019-10-15T18:57:16.107Z","4.0.0-canary.735147131.0":"2019-10-16T01:23:35.919Z","4.0.0-canary.062ade5c0.0":"2019-10-17T01:01:36.183Z","4.0.0-canary.774ad4f8.0":"2019-10-17T04:04:37.854Z","4.0.0-canary.5916d18c.0":"2019-10-18T20:08:41.915Z","4.0.0-canary.d4141c95.0":"2019-10-24T01:38:19.965Z","4.0.0-canary.2b878b3e.0":"2019-10-25T02:10:45.292Z","4.0.0-canary.b06c0efe.0":"2019-10-26T01:35:13.747Z","4.0.0-canary.01628efa.0":"2019-10-29T00:03:07.730Z","4.0.0-canary.b5c6d66b.0":"2019-10-29T17:56:49.994Z","4.0.0-canary.cdf858ea.0":"2019-11-01T17:58:59.049Z","4.0.0-canary.719b57e1.0":"2019-11-01T20:01:40.562Z","4.0.0-canary.97cbbdc2.0":"2019-11-01T20:29:18.621Z","4.0.0-canary.8e36b3b7.0":"2019-11-01T21:01:24.389Z","4.0.0-canary.62d3a09b.0":"2019-11-01T21:10:54.322Z","4.0.0":"2019-11-02T18:11:46.169Z","5.0.0-canary.b5eb51e94.0":"2019-11-07T18:33:47.021Z","5.0.0-canary.58500806e.0":"2019-11-08T15:35:51.399Z","5.0.0-canary.66299b646.0":"2019-11-08T20:33:48.638Z","5.0.0-canary.821871e04.0":"2019-11-08T21:28:18.204Z","5.0.0-canary.491fddc31.0":"2019-11-08T22:07:20.765Z","5.0.0-canary.b0cecf145.0":"2019-11-09T18:42:31.237Z","5.0.0-canary.afe0dd1bc.0":"2019-11-11T15:37:48.056Z","5.0.0-canary.b4cfdc40b.0":"2019-11-14T15:58:45.572Z","5.0.0-canary.525989b5d.0":"2019-11-14T23:30:54.694Z","5.0.0-canary.7084b403a.0":"2019-11-15T01:06:01.374Z","5.0.0-canary.3cbee6dac.0":"2019-11-15T22:32:56.928Z","5.0.0-canary.591a6ad44.0":"2019-11-18T23:48:40.467Z","5.0.0-canary.5729943ba.0":"2019-11-20T05:19:32.262Z","5.0.0-canary.e89750dc7.0":"2019-11-27T02:09:56.246Z","5.0.0-canary.3e560b33a.0":"2019-11-27T02:10:42.999Z","5.0.0-canary.7fd17ce5e.0":"2019-11-27T02:11:00.679Z","5.0.0-canary.ec729683b.0":"2019-11-27T15:55:12.027Z","5.0.0-canary.b8bc4a26e.0":"2019-11-27T19:16:52.987Z","5.0.0-canary.f978109c3.0":"2019-12-02T17:07:32.969Z","5.0.0-canary.ad9dfe706.0":"2019-12-03T23:18:12.704Z","5.0.0-canary.5e45d77f3.0":"2019-12-03T23:19:31.422Z","5.0.0-canary.d10e8cdf3.0":"2019-12-03T23:20:28.484Z","5.0.0-canary.a5dbd8a2a.0":"2019-12-03T23:55:10.560Z","5.0.0-canary.ba879b68b.0":"2019-12-04T20:22:50.644Z","5.0.0-canary.aa0eba489.0":"2019-12-06T01:59:14.380Z","5.0.0-canary.cb7b71a86.0":"2019-12-06T23:55:59.113Z","5.0.0-canary.50f110a6c.0":"2019-12-10T16:59:55.890Z","5.0.0-canary.878a08b7c.0":"2019-12-11T20:16:27.874Z","5.0.0-canary.397905b4e.0":"2019-12-12T02:47:25.364Z","5.0.0-canary.1fbf5bd1d.0":"2019-12-12T18:59:26.063Z","5.0.0-canary.b723dfa78.0":"2019-12-12T20:10:12.793Z","5.0.0-canary.1c494e567.0":"2019-12-12T23:37:09.714Z","5.0.0-canary.c9e98a125.0":"2019-12-17T18:10:08.217Z","5.0.0-canary.5ffe8f7e3.0":"2019-12-17T22:33:25.288Z","5.0.0-canary.47949b08e.0":"2019-12-18T17:40:45.218Z","5.0.0-canary.b240bcc1b.0":"2019-12-18T19:16:58.693Z","5.0.0-canary.391674a26.0":"2019-12-18T19:17:26.752Z","5.0.0-canary.c4837746c.0":"2019-12-18T19:35:18.357Z","5.0.0-canary.e41a70425.0":"2019-12-18T23:20:23.896Z","5.0.0-canary.bac43eb43.0":"2019-12-18T23:24:12.935Z","5.0.0-canary.2e491de55.0":"2019-12-19T10:49:54.426Z","5.0.0-canary.ae101c144.0":"2019-12-19T16:25:00.458Z","5.0.0-canary.a51c31f26.0":"2019-12-19T17:14:23.767Z","5.0.0-canary.21fc4e13b.0":"2019-12-19T21:27:13.465Z","5.0.0-canary.d2ae6e17d.0":"2019-12-19T22:24:15.708Z","5.0.0-canary.ba30399ad.0":"2019-12-20T01:09:47.967Z","5.0.0-canary.a08ccec35.0":"2019-12-20T23:26:53.702Z","5.0.0-canary.a2f75105e.0":"2019-12-23T19:47:46.439Z","5.0.0-canary.c054a24c7.0":"2019-12-23T21:50:07.752Z","5.0.0-canary.c6808c51c.0":"2019-12-23T21:54:44.828Z","5.0.0-canary.7bce9cf77.0":"2019-12-26T18:45:46.322Z","5.0.0-canary.c92f038c3.0":"2019-12-30T22:03:08.886Z","5.0.0-canary.1f1ac7558.0":"2020-01-02T20:54:13.810Z","5.0.0-canary.ec26e799c.0":"2020-01-02T21:42:26.804Z","5.0.0-canary.0a40ced40.0":"2020-01-03T17:09:35.149Z","5.0.0-canary.3adf84899.0":"2020-01-03T18:22:31.474Z","5.0.0-canary.0d42ee650.0":"2020-01-03T21:37:06.099Z","5.0.0-canary.847dd1ada.0":"2020-01-06T19:26:25.044Z","5.0.0-canary.39df7e5df.0":"2020-01-07T00:55:35.406Z","5.0.0-canary.f1a2581ab.0":"2020-01-07T14:59:44.714Z","5.0.0-canary.7c7ddf347.0":"2020-01-07T15:16:13.624Z","5.0.0-canary.a1c84d4b5.0":"2020-01-07T18:10:15.223Z","5.0.0-canary.ec9f16578.0":"2020-01-07T19:39:36.211Z","5.0.0-canary.b602226ce.0":"2020-01-07T20:15:20.353Z","5.0.0-canary.b2d2dc08c.0":"2020-01-07T21:26:02.305Z","5.0.0-canary.61f2d7580.0":"2020-01-07T21:39:45.953Z","5.0.0-canary.d1be53a2e.0":"2020-01-07T22:17:05.941Z","5.0.0-canary.9b0d06e32.0":"2020-01-07T22:19:22.273Z","5.0.0-canary.730c807a0.0":"2020-01-07T22:20:58.430Z","5.0.0-canary.2213152cd.0":"2020-01-08T17:22:17.074Z","5.0.0-canary.5750f7169.0":"2020-01-08T17:56:58.513Z","5.0.0-canary.f7abc7a43.0":"2020-01-08T18:27:50.393Z","5.0.0-canary.bf7b4a061.0":"2020-01-08T18:41:36.612Z","5.0.0-canary.784fa7903.0":"2020-01-08T19:10:23.925Z","5.0.0-canary.823c050ba.0":"2020-01-08T20:10:47.562Z","5.0.0-canary.70c708dee.0":"2020-01-08T20:22:21.219Z","5.0.0-canary.5ed9d13d0.0":"2020-01-08T21:42:42.167Z","5.0.0-canary.4819cc7e5.0":"2020-01-08T21:58:14.672Z","5.0.0-canary.fe3ffd2c3.0":"2020-01-08T22:16:17.512Z","5.0.0-canary.c0e850090.0":"2020-01-08T22:23:16.335Z","5.0.0-canary.615f86f38.0":"2020-01-08T22:40:18.107Z","5.0.0-canary.1eb032637.0":"2020-01-08T23:00:02.644Z","5.0.0-canary.5bc5ebfea.0":"2020-01-08T23:00:53.050Z","5.0.0-canary.1112b8def.0":"2020-01-09T22:10:18.146Z","5.0.0-canary.aab102017.0":"2020-01-10T00:12:24.259Z","5.0.0-canary.426913342.0":"2020-01-10T01:44:16.348Z","5.0.0-canary.d4ea9a706.0":"2020-01-10T17:25:25.918Z","5.0.0-canary.7d4ee2996.0":"2020-01-10T17:56:57.465Z","5.0.0-canary.981ec9b6f.0":"2020-01-10T19:26:42.544Z","5.0.0-canary.737da83fc.0":"2020-01-10T21:18:53.936Z","5.0.0-canary.aca8e6c18.0":"2020-01-13T19:32:02.723Z","5.0.0-canary.c38d84e21.0":"2020-01-13T22:13:36.324Z","5.0.0-canary.a4db5fbad.0":"2020-01-14T02:15:27.603Z","5.0.0-canary.faa9af310.0":"2020-01-14T16:52:52.733Z","5.0.0-canary.60354c577.0":"2020-01-14T22:45:59.459Z","5.0.0-canary.d07c78daa.0":"2020-01-14T23:38:35.519Z","5.0.0-canary.8ddd5c6dc.0":"2020-01-15T01:43:04.684Z","5.0.0-canary.a9511d870.0":"2020-01-15T19:10:22.380Z","5.0.0-canary.7c8583c4c.0":"2020-01-15T22:47:46.078Z","5.0.0-canary.5d4b82bac.0":"2020-01-15T22:48:21.462Z","5.0.0-canary.57d0186e4.0":"2020-01-16T18:17:34.301Z","5.0.0-canary.071a6ab70.0":"2020-01-16T18:23:56.030Z","5.0.0-canary.22e0cb618.0":"2020-01-16T18:47:01.100Z","5.0.0-canary.f16f15b8f.0":"2020-01-17T00:07:03.084Z","5.0.0-canary.aa8e43e9a.0":"2020-01-17T00:36:42.553Z","5.0.0-canary.fe1f3ca07.0":"2020-01-17T01:00:16.949Z","5.0.0-canary.d405af26b.0":"2020-01-17T18:17:21.102Z","5.0.0-canary.6e857aae2.0":"2020-01-17T18:20:47.051Z","5.0.0-canary.e2e764f7c.0":"2020-01-17T18:36:00.502Z","5.0.0-canary.7ef986a87.0":"2020-01-17T19:30:50.992Z","5.0.0-canary.29402e2d4.0":"2020-01-17T20:39:50.490Z","5.0.0-canary.2b3ec563c.0":"2020-01-17T23:11:33.146Z","5.0.0-canary.e8a993677.0":"2020-01-21T16:49:41.254Z","5.0.0-canary.cd4903304.0":"2020-01-21T21:37:22.431Z","5.0.0-canary.7e4b04b25.0":"2020-01-21T22:46:05.239Z","5.0.0-canary.ebc296937.0":"2020-01-21T23:45:02.625Z","5.0.0-canary.cf33f113d.0":"2020-01-22T01:22:18.818Z","5.0.0-canary.e1d5f1be5.0":"2020-01-22T16:55:23.046Z","5.0.0-canary.6b6a4ff92.0":"2020-01-22T17:57:44.727Z","5.0.0-canary.6092f71ee.0":"2020-01-22T21:16:52.772Z","5.0.0-canary.d8d95020f.0":"2020-01-22T23:09:26.347Z","5.0.0-canary.b7facc628.0":"2020-01-23T18:12:40.674Z","5.0.0-canary.63f357dbf.0":"2020-01-23T21:55:14.843Z","5.0.0-canary.f2426d26e.0":"2020-01-23T23:55:13.269Z","5.0.0-canary.7f5e0c23f.0":"2020-01-24T16:47:41.348Z","5.0.0-canary.3fc3ab520.0":"2020-01-24T17:20:46.943Z","5.0.0-canary.80a4d326f.0":"2020-01-24T20:45:46.759Z","5.0.0-canary.ef7de4def.0":"2020-01-24T21:32:05.929Z","5.0.0-canary.93e2288b6.0":"2020-01-28T16:55:54.923Z","5.0.0-canary.34ef15f67.0":"2020-01-28T17:24:08.459Z","5.0.0-canary.d3d176ba5.0":"2020-01-28T17:29:22.667Z","5.0.0-canary.32c1df133.0":"2020-01-28T19:43:19.342Z","5.0.0-canary.f3adce86f.0":"2020-01-28T21:49:00.307Z","5.0.0-canary.a4423f890.0":"2020-01-29T21:09:31.708Z","5.0.0-canary.9351f167d.0":"2020-01-29T21:55:36.632Z","5.0.0-canary.29b89dbc1.0":"2020-01-29T22:16:44.458Z","5.0.0-canary.45985457b.0":"2020-01-29T23:32:54.937Z","5.0.0-canary.a1a0deb3e.0":"2020-01-30T17:37:11.919Z","5.0.0-canary.181486643.0":"2020-01-30T20:56:14.052Z","5.0.0-canary.3a85313ac.0":"2020-01-31T16:23:06.428Z","5.0.0-canary.b6c7f624b.0":"2020-01-31T17:03:00.818Z","5.0.0-canary.b3f70ebde.0":"2020-01-31T20:10:12.209Z","5.0.0-canary.3e782d8f8.0":"2020-02-02T01:12:38.646Z","5.0.0-canary.535398572.0":"2020-02-03T18:11:51.663Z","5.0.0-canary.5ff33802c.0":"2020-02-04T18:03:46.764Z","5.0.0-canary.1eb29491c.0":"2020-02-04T21:00:23.390Z","5.0.0-canary.4c7154b26.0":"2020-02-05T16:02:46.159Z","5.0.0-canary.ab5f49a2c.0":"2020-02-05T23:33:07.305Z","5.0.0-canary.c541ebe15.0":"2020-02-06T22:29:53.265Z","5.0.0-canary.98f7faa05.0":"2020-02-07T19:21:12.683Z","5.0.0-canary.b4727e43a.0":"2020-02-07T19:55:25.971Z","5.0.0-canary.91d9d5a65.0":"2020-02-07T22:59:18.853Z","5.0.0-canary.d5c006ed1.0":"2020-02-10T16:48:34.957Z","5.0.0-canary.559f1a570.0":"2020-02-10T17:24:48.459Z","5.0.0-canary.ad3bbf782.0":"2020-02-10T19:11:21.602Z","5.0.0-canary.570d8e49c.0":"2020-02-10T20:43:22.961Z","5.0.0-canary.48b06b89a.0":"2020-02-11T18:43:10.002Z","5.0.0-canary.612443dfb.0":"2020-02-11T19:48:49.831Z","5.0.0-canary.8c11ea2a3.0":"2020-02-12T08:51:25.105Z","5.0.0-canary.b2f3d311e.0":"2020-02-13T21:43:47.453Z","5.0.0-canary.4f488d0ee.0":"2020-02-13T23:06:08.126Z","6.0.0-canary.fe79de07d.0":"2020-02-13T23:23:32.101Z","5.0.0":"2020-02-14T00:08:50.045Z","6.0.0-canary.5e313b1f2.0":"2020-02-14T23:48:10.439Z","6.0.0-canary.6a56f387c.0":"2020-02-18T19:44:09.700Z","6.0.0-canary.bdfd52632.0":"2020-02-19T20:22:54.855Z","6.0.0-canary.ad2e4376a.0":"2020-02-20T23:16:34.339Z","6.0.0-canary.765caef18.0":"2020-02-21T17:33:09.460Z","6.0.0-canary.949562303.0":"2020-02-21T20:38:12.620Z","6.0.0-canary.7ec96974e.0":"2020-02-24T18:58:26.543Z","6.0.0-canary.265ecbad5.0":"2020-02-25T21:01:07.898Z","5.1.0":"2020-02-25T21:38:30.632Z","6.0.0-canary.2cf87456f.0":"2020-02-25T21:39:10.150Z","6.0.0-canary.781434a92.0":"2020-02-25T23:28:25.614Z","6.0.0-canary.d6f60c98b.0":"2020-02-28T22:03:58.129Z","6.0.0-canary.69edc6e28.0":"2020-02-28T22:12:34.506Z","6.0.0-canary.9372e4939.0":"2020-03-03T19:10:58.545Z","6.0.0-canary.9cf5e9842.0":"2020-03-03T23:26:20.354Z","6.0.0-canary.3657f8863.0":"2020-03-04T17:44:32.946Z","6.0.0-canary.98b843417.0":"2020-03-05T18:31:22.028Z","6.0.0-canary.17b9699c4.0":"2020-03-05T19:22:40.701Z","6.0.0-canary.6ee035572.0":"2020-03-09T16:47:17.682Z","6.0.0-canary.bd33cb56b.0":"2020-03-09T17:22:36.280Z","6.0.0-canary.26c049afa.0":"2020-03-10T17:02:59.102Z","6.0.0-canary.1db5c9fc8.0":"2020-03-10T20:37:35.440Z","6.0.0-canary.4971637f4.0":"2020-03-10T22:58:59.680Z","6.0.0-canary.1ae8130ce.0":"2020-03-10T23:05:47.034Z","6.0.0-canary.8639c2690.0":"2020-03-11T06:33:41.699Z","6.0.0-canary.d5808057f.0":"2020-03-11T16:26:07.919Z","6.0.0-canary.b3f58203d.0":"2020-03-11T19:38:26.950Z","6.0.0-canary.bec065920.0":"2020-03-12T20:20:30.042Z","6.0.0-canary.776291ef0.0":"2020-03-17T19:20:49.496Z","6.0.0-canary.ece19f3dd.0":"2020-03-17T22:01:35.207Z","6.0.0-canary.4dc45af6c.0":"2020-03-18T01:48:19.601Z","6.0.0-canary.6b48781bf.0":"2020-03-18T15:35:12.020Z","6.0.0-canary.a88c8e4dc.0":"2020-03-19T17:36:16.379Z","6.0.0-canary.cafe18860.0":"2020-03-20T14:53:53.711Z","6.0.0-canary.35a32aaea.0":"2020-03-20T19:59:36.422Z","6.0.0-canary.e75deb854.0":"2020-03-20T22:15:39.866Z","6.0.0-canary.2cc6966f6.0":"2020-03-24T18:44:02.874Z","6.0.0-canary.8707953b6.0":"2020-03-24T18:47:34.369Z","6.0.0-canary.10af6cf39.0":"2020-03-25T18:18:48.229Z","6.0.0-canary.7d8f9c8d7.0":"2020-03-27T18:05:21.945Z","6.0.0-canary.d6315efe2.0":"2020-03-27T19:56:51.455Z","6.0.0-canary.a3016368d.0":"2020-03-27T21:19:57.673Z","6.0.0-canary.4b45b6620.0":"2020-03-31T15:56:47.001Z","6.0.0-canary.e84b9c8.0":"2020-04-01T16:56:26.863Z","6.0.0-canary.e33c49e.0":"2020-04-02T00:09:59.102Z","6.0.0-canary.f1f8e60.0":"2020-04-02T19:14:27.932Z","6.0.0-canary.1e17c49b3.0":"2020-04-03T18:04:31.342Z","6.0.0-canary.6a40ef217.0":"2020-04-03T19:25:08.008Z","6.0.0-canary.5f24faacb.0":"2020-04-08T15:37:08.056Z","6.0.0-canary.82fa986b9.0":"2020-04-08T15:42:11.935Z","6.0.0-canary.9930d9cc5.0":"2020-04-08T19:32:54.614Z","6.0.0-canary.6601d24af.0":"2020-04-09T00:30:21.268Z","6.0.0-canary.05f5e1583.0":"2020-04-09T00:47:46.018Z","6.0.0-canary.bce00e186.0":"2020-04-09T15:23:36.444Z","6.0.0-canary.927fa902c.0":"2020-04-09T18:46:56.785Z","6.0.0-canary.eb28b6ecc.0":"2020-04-10T19:31:33.003Z","6.0.0-canary.816a43b42.0":"2020-04-10T20:53:11.742Z","6.0.0-canary.008c4d319.0":"2020-04-13T16:34:31.720Z","6.0.0-canary.cbb3f28ca.0":"2020-04-14T05:06:26.531Z","6.0.0-canary.f172b0f90.0":"2020-04-14T23:10:50.762Z","6.0.0-canary.c02642273.0":"2020-04-15T16:17:54.421Z","6.0.0-canary.8a299b568.0":"2020-04-15T22:43:44.936Z","6.0.0-canary.490fbdc09.0":"2020-04-16T06:00:11.494Z","6.0.0-canary.f838c6e55.0":"2020-04-16T14:27:15.540Z","6.0.0-canary.ce6cb7024.0":"2020-04-16T17:19:39.311Z","6.0.0-canary.0ab62a65b.0":"2020-04-16T18:54:59.804Z","6.0.0-canary.ca61b656f.0":"2020-04-16T20:00:34.327Z","6.0.0-canary.45a6615e3.0":"2020-04-16T20:33:21.797Z","6.0.0-canary.4b04cdb0f.0":"2020-04-17T17:41:45.454Z","6.0.0-canary.b273afa93.0":"2020-04-17T23:03:23.410Z","6.0.0-canary.b70bc601e.0":"2020-04-17T23:21:58.355Z","6.0.0-canary.c4b4bba96.0":"2020-04-18T00:18:25.242Z","6.0.0-canary.6c1ebc721.0":"2020-04-20T19:58:53.722Z","6.0.0-canary.9cff4318f.0":"2020-04-20T20:56:33.588Z","6.0.0-canary.7b4482402.0":"2020-04-20T22:20:48.028Z","6.0.0-canary.deda86d8c.0":"2020-04-21T01:15:25.024Z","6.0.0-canary.d10412cb2.0":"2020-04-21T18:19:00.986Z","6.0.0-canary.c141801d5.0":"2020-04-21T19:42:34.660Z","6.0.0-canary.28d10a96e.0":"2020-04-22T22:07:48.954Z","7.0.0-canary.8540808be.0":"2020-04-23T17:26:35.748Z","6.0.0":"2020-04-23T17:27:09.803Z","7.0.0-canary.2673adb74.0":"2020-04-23T22:46:12.846Z","7.0.0-canary.b10d0d7f1.0":"2020-04-24T00:21:37.998Z","7.0.0-canary.3bd8c1bac.0":"2020-04-24T21:06:32.038Z","7.0.0-canary.b83c8dc22.0":"2020-04-24T21:19:20.184Z","7.0.0-canary.1b3dd846d.0":"2020-04-25T00:44:23.565Z","7.0.0-canary.29debfea7.0":"2020-04-27T12:32:48.230Z","7.0.0-canary.28d32f8e0.0":"2020-04-27T14:07:41.061Z","7.0.0-canary.af71cfdd6.0":"2020-04-28T23:17:56.011Z","7.0.0-canary.99d2fc961.0":"2020-04-29T10:44:31.534Z","7.0.0-canary.0e052b24f.0":"2020-04-30T01:30:10.046Z","7.0.0-canary.ff4bc632a.0":"2020-04-30T08:28:19.916Z","7.0.0-canary.b0f83d2fd.0":"2020-04-30T14:33:24.021Z","7.0.0-canary.e59906a57.0":"2020-05-01T15:42:29.849Z","7.0.0-canary.c02712b59.0":"2020-05-01T18:26:17.968Z","7.0.0-canary.15d65448e.0":"2020-05-01T19:23:09.341Z","7.0.0-canary.142b1549e.0":"2020-05-01T22:36:19.604Z","7.0.0-canary.524b7b812.0":"2020-05-03T20:48:01.464Z","7.0.0-canary.bd8ca9678.0":"2020-05-04T17:19:34.370Z","7.0.0-canary.2553e86fe.0":"2020-05-04T17:31:19.661Z","7.0.0-canary.03dec929e.0":"2020-05-04T23:34:36.041Z","7.0.0-canary.d92d8c93e.0":"2020-05-05T16:59:48.356Z","7.0.0-canary.09f591967.0":"2020-05-05T21:04:56.933Z","7.0.0-canary.3846ce311.0":"2020-05-06T14:10:00.811Z","7.0.0-canary.ed7f32463.0":"2020-05-06T16:08:24.759Z","7.0.0-canary.8135cc085.0":"2020-05-06T19:55:35.281Z","7.0.0-canary.deb212de4.0":"2020-05-06T22:19:12.240Z","7.0.0-canary.f83e00898.0":"2020-05-07T16:49:56.211Z","7.0.0-canary.047e6b337.0":"2020-05-08T18:38:55.390Z","7.0.0-canary.119e21426.0":"2020-05-08T20:22:32.983Z","7.0.0-canary.2f052d824.0":"2020-05-08T21:07:56.437Z","7.0.0-canary.e84444387.0":"2020-05-08T21:32:03.128Z","7.0.0-canary.893eb1876.0":"2020-05-11T14:13:43.672Z","7.0.0-canary.a5aeb3001.0":"2020-05-11T14:29:47.783Z","7.0.0-canary.610c68d97.0":"2020-05-11T19:33:04.811Z","7.0.0-canary.ed52af767.0":"2020-05-11T20:27:45.914Z","7.0.0-canary.058cfd23c.0":"2020-05-11T21:25:36.308Z","7.0.0-canary.0a371b4fe.0":"2020-05-12T23:18:44.976Z","7.0.0-canary.2139200b3.0":"2020-05-13T14:47:53.642Z","7.0.0-canary.744d751a0.0":"2020-05-14T04:43:18.770Z","7.0.0-canary.ad0c0c103.0":"2020-05-14T14:51:58.692Z","7.0.0-canary.fd8f8f2b7.0":"2020-05-18T17:54:04.375Z","7.0.0-canary.730920fbb.0":"2020-05-18T19:44:37.947Z","7.0.0-canary.bcdad99bb.0":"2020-05-19T03:18:31.672Z","7.0.0-canary.4497b86ed.0":"2020-05-19T03:51:14.432Z","7.0.0-canary.2e60575da.0":"2020-05-19T16:09:52.267Z","7.0.0-canary.e3eacefcc.0":"2020-05-19T17:38:38.664Z","7.0.0-canary.b065a4d2b.0":"2020-05-20T14:37:27.786Z","7.0.0-canary.4ebce8d78.0":"2020-05-20T20:51:01.670Z","7.0.0-canary.b0fdca492.0":"2020-05-20T23:03:16.994Z","7.0.0-canary.c67667e8e.0":"2020-05-21T14:13:17.476Z","7.0.0-canary.62b5f37db.0":"2020-05-21T16:41:38.778Z","7.0.0-canary.2e218dbf8.0":"2020-05-21T17:02:32.679Z","7.0.0-canary.7fd792bb9.0":"2020-05-21T17:14:42.890Z","7.0.0-canary.a66493cd8.0":"2020-05-21T17:18:37.509Z","7.0.0-canary.da05f66e1.0":"2020-05-21T17:20:09.212Z","7.0.0-canary.740860e78.0":"2020-05-21T17:27:07.467Z","7.0.0-canary.5cea2610f.0":"2020-05-21T17:29:13.569Z","7.0.0-canary.cf7747ef7.0":"2020-05-21T17:29:37.104Z","7.0.0-canary.862d0d7bc.0":"2020-05-21T17:32:17.738Z","7.0.0-canary.0008c8a91.0":"2020-05-21T19:33:36.382Z","7.0.0-canary.541638fa2.0":"2020-05-21T19:48:34.486Z","7.0.0-canary.6167cd075.0":"2020-05-21T20:21:34.103Z","7.0.0-canary.863ac1b0f.0":"2020-05-21T20:59:56.733Z","7.0.0-canary.d30a214ac.0":"2020-05-21T21:04:30.651Z","7.0.0-canary.62abbc8d7.0":"2020-05-21T21:29:10.571Z","7.0.0-canary.49bf31d5c.0":"2020-05-21T21:32:30.415Z","7.0.0-canary.8e17857d0.0":"2020-05-21T21:33:26.086Z","7.0.0-canary.c113fc942.0":"2020-05-21T22:46:48.071Z","7.0.0-canary.912d9021d.0":"2020-05-26T18:45:52.261Z","7.0.0-canary.68a2af131.0":"2020-05-26T19:08:02.721Z","7.0.0-canary.01de07011.0":"2020-05-26T19:53:00.952Z","7.0.0-canary.51d4535fe.0":"2020-05-26T21:35:42.222Z","7.0.0-canary.b86d826b7.0":"2020-05-26T22:14:08.602Z","7.0.0-canary.d91794c7e.0":"2020-05-26T23:55:20.296Z","7.0.0-canary.8c6d7e076.0":"2020-05-27T18:59:53.809Z","7.0.0-canary.5b5f62f93.0":"2020-05-27T19:16:30.438Z","7.0.0-canary.d9972abb1.0":"2020-05-27T20:21:16.304Z","7.0.0-canary.6556eda2b.0":"2020-05-27T20:30:30.767Z","7.0.0-canary.32aa23641.0":"2020-05-27T21:38:42.305Z","7.0.0-canary.654934dfa.0":"2020-05-28T00:37:34.333Z","7.0.0-canary.41910b8b8.0":"2020-05-28T00:51:44.261Z","7.0.0-canary.d66d22bf9.0":"2020-05-28T19:55:50.280Z","7.0.0-canary.8904f3cbe.0":"2020-05-29T16:50:49.166Z","7.0.0-canary.51512a4ac.0":"2020-05-29T19:15:37.979Z","7.0.0-canary.0743288fb.0":"2020-05-29T20:05:30.907Z","7.0.0-canary.06ef147b5.0":"2020-05-29T20:41:11.772Z","7.0.0-canary.8073a20a9.0":"2020-05-29T23:26:02.859Z","7.0.0-canary.72ff42330.0":"2020-06-01T16:44:47.299Z","7.0.0-canary.9ea52070f.0":"2020-06-01T16:49:31.281Z","7.0.0-canary.d86ad3b60.0":"2020-06-01T17:49:17.190Z","7.0.0-canary.b9776b1d0.0":"2020-06-01T18:26:36.232Z","7.0.0-canary.ba6f7c294.0":"2020-06-02T17:03:13.160Z","7.0.0-canary.cf3b664ab.0":"2020-06-02T18:24:04.589Z","7.0.0-canary.4ba3c9a31.0":"2020-06-02T23:52:48.537Z","7.0.0-canary.388b042c7.0":"2020-06-03T13:47:11.774Z","7.0.0-canary.cca1ca84d.0":"2020-06-03T16:03:26.560Z","7.0.0-canary.9b0b5f2e0.0":"2020-06-03T18:58:08.209Z","7.0.0-canary.0a7895f4d.0":"2020-06-03T21:09:34.601Z","7.0.0-canary.7461aad68.0":"2020-06-03T22:13:05.670Z","7.0.0-canary.a0dc2b5c4.0":"2020-06-04T21:14:54.204Z","7.0.0-canary.2b420c5b3.0":"2020-06-08T16:15:02.758Z","7.0.0-canary.8fa22aacc.0":"2020-06-08T18:05:04.227Z","7.0.0-canary.21c4e4ed8.0":"2020-06-08T18:44:50.193Z","7.0.0-canary.dfde46516.0":"2020-06-08T19:42:33.794Z","7.0.0-canary.05cc5c206.0":"2020-06-08T20:57:44.127Z","7.0.0-canary.3ee488f1c.0":"2020-06-09T14:54:30.893Z","7.0.0-canary.b83d720ee.0":"2020-06-09T17:26:46.172Z","7.0.0-canary.afb1c11a9.0":"2020-06-09T20:16:42.824Z","7.0.0-canary.39e6f71e2.0":"2020-06-09T23:39:52.692Z","7.0.0-canary.d4c66dc7d.0":"2020-06-11T17:46:52.945Z","7.0.0-canary.be4a19f9f.0":"2020-06-12T06:08:39.782Z","7.0.0-canary.a6ac8f629.0":"2020-06-15T21:30:56.358Z","7.0.0-canary.9833dc287.0":"2020-06-16T19:49:37.524Z","7.0.0-canary.3aa33998e.0":"2020-06-16T20:21:31.674Z","7.0.0-canary.d2b54d183.0":"2020-06-18T01:15:57.575Z","7.0.0-canary.f2a488e95.0":"2020-06-18T15:04:34.196Z","7.0.0-canary.bd8d1aafa.0":"2020-06-18T15:16:38.102Z","7.0.0-canary.1321eb968.0":"2020-06-19T19:21:37.339Z","7.0.0-canary.db5cc0382.0":"2020-06-19T19:28:03.505Z","7.0.0-canary.6ac9bf031.0":"2020-06-19T19:48:31.663Z","7.0.0-canary.c21b5c367.0":"2020-06-19T20:10:50.182Z","7.0.0-canary.bfdd7fd39.0":"2020-06-19T20:20:11.575Z","7.0.0-canary.10b505785.0":"2020-06-19T20:21:39.428Z","7.0.0-canary.6483d3f44.0":"2020-06-19T20:37:53.127Z","7.0.0-canary.30a74e921.0":"2020-06-19T20:40:06.490Z","7.0.0-canary.c20727498.0":"2020-06-19T20:42:57.770Z","7.0.0-canary.4e360ae94.0":"2020-06-19T20:59:42.408Z","7.0.0-canary.8550fa53b.0":"2020-06-19T21:01:59.707Z","7.0.0-canary.93ade142e.0":"2020-06-19T21:03:13.165Z","7.0.0-canary.a0032f5bb.0":"2020-06-19T21:28:22.286Z","7.0.0-canary.3f342e721.0":"2020-06-19T21:30:22.275Z","7.0.0-canary.ff89457cc.0":"2020-06-19T21:31:35.134Z","7.0.0-canary.4a1855cf8.0":"2020-06-19T21:34:18.146Z","7.0.0-canary.8602f1b4d.0":"2020-06-22T17:23:58.327Z","7.0.0-canary.69f9f0982.0":"2020-06-22T21:14:50.985Z","7.0.0-canary.369a293f0.0":"2020-06-22T21:17:23.713Z","7.0.0-canary.f1432b5c6.0":"2020-06-22T21:25:28.784Z","7.0.0-canary.4757a16b4.0":"2020-06-22T21:53:37.460Z","7.0.0-canary.f8f472762.0":"2020-06-22T21:57:42.359Z","7.0.0-canary.7e4d55c34.0":"2020-06-22T22:29:34.224Z","7.0.0-canary.bd1dbc91f.0":"2020-06-23T14:28:26.148Z","7.0.0-canary.31523bc62.0":"2020-06-23T14:33:59.453Z","7.0.0-canary.a96b6d4d6.0":"2020-06-23T14:40:18.621Z","7.0.0-canary.ef3a09533.0":"2020-06-23T14:48:28.879Z","7.0.0-canary.080965f39.0":"2020-06-23T15:17:52.291Z","7.0.0-canary.1bd67b65d.0":"2020-06-23T16:00:16.357Z","7.0.0-canary.18ca31248.0":"2020-06-23T18:25:16.007Z","7.0.0-canary.39cf00836.0":"2020-06-23T18:48:10.866Z","7.0.0-canary.1bfda9e05.0":"2020-06-23T19:00:38.520Z","7.0.0-canary.08731bd95.0":"2020-06-23T19:03:15.138Z","7.0.0":"2020-06-23T19:11:01.557Z","8.0.0-canary.a3212b209.0":"2020-06-23T19:11:54.965Z","8.0.0-canary.15e81fe98.0":"2020-06-23T19:41:21.165Z","8.0.0-canary.004c9d392.0":"2020-06-23T22:56:10.437Z","8.0.0-canary.03bde00f5.0":"2020-06-24T00:31:52.890Z","8.0.0-canary.599b8c319.0":"2020-06-24T14:56:50.689Z","8.0.0-canary.87e3be418.0":"2020-06-24T17:53:29.247Z","8.0.0-canary.035cf2a6f.0":"2020-06-24T18:38:51.493Z","8.0.0-canary.2fed2c12f.0":"2020-06-25T20:02:00.618Z","8.0.0-canary.38197b443.0":"2020-06-25T21:22:44.551Z","8.0.0-canary.69a35e80c.0":"2020-06-26T17:38:59.235Z","8.0.0-canary.df7154fb3.0":"2020-06-26T18:16:59.417Z","8.0.0-canary.d5618602a.0":"2020-06-26T21:48:29.220Z","8.0.0-canary.e590b376b.0":"2020-06-26T23:23:48.139Z","8.0.0-canary.0c9d6bd2d.0":"2020-06-29T17:15:30.738Z","8.0.0-canary.c1fec4246.0":"2020-06-29T17:30:55.077Z","8.0.0-canary.c678a9d34.0":"2020-06-29T17:52:20.524Z","8.0.0-canary.521afaf6e.0":"2020-06-30T15:05:47.851Z","8.0.0-canary.a2ad48839.0":"2020-06-30T19:14:34.890Z","8.0.0-canary.ec2385881.0":"2020-06-30T21:47:14.503Z","8.0.0-canary.610c26c4a.0":"2020-07-01T14:56:26.744Z","8.0.0-canary.e2ea4a99e.0":"2020-07-01T19:27:25.429Z","8.0.0-canary.a78ceb112.0":"2020-07-01T19:39:12.204Z","8.0.0-canary.b0c456d33.0":"2020-07-06T22:41:44.196Z","8.0.0-canary.2e5711e04.0":"2020-07-08T16:48:26.117Z","8.0.0-canary.811fc5d24.0":"2020-07-08T17:16:06.853Z","8.0.0-canary.6ed717ddd.0":"2020-07-08T19:44:22.543Z","8.0.0-canary.d850de590.0":"2020-07-09T18:05:40.436Z","8.0.0-canary.e07a70841.0":"2020-07-09T18:35:28.249Z","8.0.0-canary.37947ed6c.0":"2020-07-09T20:36:49.700Z","8.0.0-canary.5d443afec.0":"2020-07-09T20:52:01.016Z","8.0.0-canary.9ac1ed914.0":"2020-07-09T21:20:51.994Z","8.0.0-canary.1e7cb6198.0":"2020-07-09T22:12:41.282Z","8.0.0-canary.843f636c0.0":"2020-07-10T17:42:59.165Z","8.0.0-canary.b2edaeead.0":"2020-07-10T18:07:28.469Z","8.0.0-canary.5dac1f624.0":"2020-07-13T16:34:31.463Z","8.0.0-canary.4497acef8.0":"2020-07-14T14:20:26.023Z","8.0.0-canary.e6e23019d.0":"2020-07-14T20:10:46.795Z","8.0.0-canary.d548d7a92.0":"2020-07-14T21:13:15.816Z","8.0.0-canary.58ce529cc.0":"2020-07-14T21:15:20.243Z","8.0.0-canary.a0f1202dc.0":"2020-07-14T21:34:37.616Z","8.0.0-canary.ad4df58c1.0":"2020-07-15T00:09:37.128Z","8.0.0-canary.01db89053.0":"2020-07-16T16:39:42.421Z","8.0.0-canary.fb5a4cdeb.0":"2020-07-20T19:20:13.837Z","8.0.0-canary.8df0f517c.0":"2020-07-20T23:55:54.564Z","8.0.0-canary.abcdbcfeb.0":"2020-07-21T00:50:25.823Z","8.0.0-canary.7bd5075de.0":"2020-07-21T18:47:24.695Z","8.0.0-canary.405a29a20.0":"2020-07-22T22:23:27.057Z","8.0.0-canary.f3693ac4c.0":"2020-07-22T22:34:01.554Z","8.0.0-canary.12a109680.0":"2020-07-22T23:03:43.122Z","8.0.0-canary.bbd06696e.0":"2020-07-22T23:53:08.417Z","8.0.0-canary.4951e7651.0":"2020-07-23T01:49:54.515Z","8.0.0-canary.75deebbef.0":"2020-07-23T17:46:56.514Z","8.0.0-canary.95aff33ee.0":"2020-07-23T18:47:39.612Z","8.0.0-canary.9d9f47473.0":"2020-07-23T19:59:05.627Z","8.0.0-canary.00dfbf6be.0":"2020-07-23T20:59:51.945Z","8.0.0-canary.b87e522d2.0":"2020-07-23T21:23:58.107Z","8.0.0-canary.5b3e150e5.0":"2020-07-24T01:24:15.812Z","8.0.0-canary.f0ae11786.0":"2020-07-24T01:43:52.341Z","8.0.0-canary.fb4ee66c0.0":"2020-07-24T02:11:01.009Z","8.0.0-canary.5511e0aeb.0":"2020-07-24T16:57:05.634Z","8.0.0-canary.8388a9bf6.0":"2020-07-24T20:13:33.410Z","8.0.0-canary.ac405eae1.0":"2020-07-27T15:06:51.721Z","8.0.0-canary.75553837c.0":"2020-07-27T15:12:49.484Z","8.0.0-canary.b96fbfc7a.0":"2020-07-27T15:38:24.244Z","8.0.0-canary.61f1a8d85.0":"2020-07-27T15:47:26.259Z","8.0.0-canary.81dc33377.0":"2020-07-27T15:59:33.758Z","8.0.0-canary.ffd9ede58.0":"2020-07-27T16:32:52.404Z","8.0.0-canary.52dc55acf.0":"2020-07-27T17:08:50.751Z","8.0.0-canary.d4274ff05.0":"2020-07-27T19:51:45.151Z","8.0.0-canary.b82d0696d.0":"2020-07-27T19:58:27.410Z","8.0.0-canary.c2852000d.0":"2020-07-27T20:58:40.755Z","8.0.0-canary.f86f83f54.0":"2020-07-27T21:54:22.698Z","8.0.0-canary.41eb1684c.0":"2020-07-28T17:50:40.449Z","8.0.0-canary.9e2f6c450.0":"2020-07-28T22:39:35.977Z","8.0.0-canary.e6950b55a.0":"2020-07-28T22:52:49.674Z","8.0.0-canary.5e51ee38e.0":"2020-07-28T23:16:23.012Z","8.0.0-canary.a3898ffcf.0":"2020-07-29T00:36:41.872Z","8.0.0-canary.bc5cc6c96.0":"2020-07-29T00:49:33.215Z","8.0.0-canary.9bdeaf928.0":"2020-07-29T01:21:00.862Z","8.0.0-canary.fde2c1f9d.0":"2020-07-29T01:35:19.512Z","8.0.0-canary.6b3876d5d.0":"2020-07-29T01:39:06.057Z","8.0.0-canary.30ce17873.0":"2020-07-29T17:15:08.911Z","8.0.0-canary.f6bb43bf0.0":"2020-07-29T18:25:47.545Z","8.0.0-canary.6af75f6ab.0":"2020-07-30T00:01:40.496Z","8.0.0-canary.42d7a65aa.0":"2020-07-30T00:10:49.096Z","8.0.0-canary.85abdabb7.0":"2020-07-30T00:15:37.997Z","8.0.0-canary.49fb20ca3.0":"2020-07-30T01:27:55.926Z","8.0.0-canary.962d4abbb.0":"2020-07-30T16:10:33.334Z","8.0.0-canary.2fcee40cb.0":"2020-07-30T17:21:49.775Z","8.0.0-canary.bd5987f5a.0":"2020-07-30T17:46:28.585Z","8.0.0-canary.005e86a9b.0":"2020-07-30T18:00:16.901Z","8.0.0-canary.e309c7c68.0":"2020-07-30T18:09:28.056Z","8.0.0-canary.935a51cc0.0":"2020-07-30T18:20:43.089Z","8.0.0-canary.74839da7b.0":"2020-07-30T18:31:42.317Z","8.0.0-canary.f041a48c9.0":"2020-07-30T22:59:56.323Z","8.0.0-canary.fbb1381e1.0":"2020-07-31T15:50:45.821Z","8.0.0-canary.7f61d5785.0":"2020-07-31T17:23:20.953Z","8.0.0-canary.e1bc84d10.0":"2020-08-03T17:51:35.236Z","8.0.0-canary.096a7a066.0":"2020-08-03T17:54:01.038Z","8.0.0-canary.aa3a3e5a4.0":"2020-08-03T17:54:34.117Z","8.0.0-canary.5903d39af.0":"2020-08-03T17:54:56.093Z","8.0.0-canary.72258f898.0":"2020-08-04T01:17:39.770Z","8.0.0-canary.1b44b43c8.0":"2020-08-04T16:48:36.315Z","8.0.0-canary.e9d2e2f96.0":"2020-08-04T20:24:30.882Z","8.0.0-canary.b9dff0a19.0":"2020-08-05T03:49:08.350Z","8.0.0-canary.2bd09a706.0":"2020-08-05T03:54:19.056Z","8.0.0-canary.e0560522f.0":"2020-08-05T17:20:18.105Z","8.0.0-canary.08ca4d0ec.0":"2020-08-05T17:39:43.297Z","8.0.0-canary.08090126b.0":"2020-08-06T19:32:56.630Z","8.0.0-canary.e8bf5b2ac.0":"2020-08-06T21:50:18.373Z","8.0.0-canary.e3b746208.0":"2020-08-06T22:27:04.490Z","8.0.0-canary.96a640534.0":"2020-08-06T22:41:47.778Z","8.0.0-canary.9f9aac825.0":"2020-08-07T20:51:40.051Z","8.0.0-canary.fc65fd00b.0":"2020-08-10T15:20:42.253Z","8.0.0-canary.02e372c5f.0":"2020-08-10T15:48:55.176Z","8.0.0-canary.66669e3b6.0":"2020-08-10T15:52:54.332Z","8.0.0-canary.6d1ea9761.0":"2020-08-11T14:31:10.082Z","8.0.0-canary.79414bf9f.0":"2020-08-11T19:02:13.087Z","8.0.0-canary.85a5272df.0":"2020-08-11T20:08:31.390Z","8.0.0-canary.fda053eb8.0":"2020-08-12T20:04:29.919Z","8.0.0-canary.760873445.0":"2020-08-12T21:43:33.987Z","8.0.0-canary.2f4711a30.0":"2020-08-12T21:53:32.889Z","8.0.0-canary.2d72f3659.0":"2020-08-12T22:01:01.702Z","8.0.0-canary.1fee70a5e.0":"2020-08-12T23:29:00.626Z","8.0.0-canary.023f3fa34.0":"2020-08-13T01:12:43.282Z","8.0.0-canary.80f3a9e5d.0":"2020-08-13T01:29:21.304Z","8.0.0-canary.a1dcfe97c.0":"2020-08-13T08:50:13.302Z","8.0.0-canary.af332d5be.0":"2020-08-13T21:17:44.205Z","8.0.0-canary.7dd4567c4.0":"2020-08-14T00:51:19.806Z","8.0.0-canary.ff870005a.0":"2020-08-14T01:16:30.561Z","8.0.0-canary.150f427a0.0":"2020-08-14T13:30:07.434Z","8.0.0-canary.bcc58290a.0":"2020-08-14T23:22:48.404Z","8.0.0-canary.4f55400bb.0":"2020-08-17T16:38:44.918Z","8.0.0-canary.000d64815.0":"2020-08-17T17:04:37.666Z","8.0.0-canary.defa599a8.0":"2020-08-17T20:32:08.631Z","8.0.0-canary.66b8ed7e6.0":"2020-08-18T18:37:08.983Z","8.0.0-canary.e2b1033df.0":"2020-08-19T18:42:18.180Z","8.0.0-canary.2e8c3dd2e.0":"2020-08-19T19:24:13.874Z","8.0.0-canary.b2e80a5d9.0":"2020-08-19T22:21:19.855Z","8.0.0-canary.ff88df637.0":"2020-08-19T22:33:17.988Z","8.0.0-canary.32fb314cd.0":"2020-08-20T10:37:59.808Z","8.0.0-canary.546277d32.0":"2020-08-20T16:43:30.224Z","8.0.0-canary.da72839f4.0":"2020-08-20T18:00:15.874Z","8.0.0-canary.346069ccb.0":"2020-08-20T18:18:46.124Z","8.0.0-canary.e27c5802f.0":"2020-08-20T19:15:27.049Z","8.0.0-canary.f4532b9c8.0":"2020-08-20T19:58:03.469Z","8.0.0-canary.fbf73c2a6.0":"2020-08-20T21:06:47.696Z","8.0.0-canary.cf800124f.0":"2020-08-20T21:52:54.445Z","8.0.0-canary.95e4eeea7.0":"2020-08-20T23:29:10.552Z","8.0.0-canary.91ab1c62a.0":"2020-08-21T15:12:04.589Z","8.0.0-canary.58eaa9f02.0":"2020-08-21T20:00:41.366Z","8.0.0-canary.238216fc4.0":"2020-08-24T15:41:10.409Z","8.0.0-canary.a1c65593d.0":"2020-08-25T03:04:09.364Z","8.0.0-canary.708cc09c4.0":"2020-08-25T15:56:43.588Z","8.0.0-canary.19bea2ad3.0":"2020-08-26T18:49:41.607Z","8.0.0-canary.911014711.0":"2020-08-27T16:08:22.614Z","8.0.0-canary.d3387f54c.0":"2020-09-03T20:55:53.639Z","8.0.0-canary.2ccf996cc.0":"2020-09-03T20:56:10.108Z","8.0.0-canary.744bfe5d8.0":"2020-09-03T20:56:52.864Z","8.0.0-canary.78da96eaf.0":"2020-09-08T19:13:09.954Z","8.0.0-canary.b0ed593cc.0":"2020-09-09T06:16:20.464Z","8.0.0-canary.85a1fa9ea.0":"2020-09-10T21:10:52.260Z","8.0.0-canary.0bc41a9c7.0":"2020-09-11T17:50:05.660Z","8.0.0-canary.fc0eb5013.0":"2020-09-11T19:55:55.945Z","8.0.0-canary.319bf66de.0":"2020-09-11T23:10:32.842Z","8.0.0-canary.5bfc305ec.0":"2020-09-13T23:00:33.876Z","8.0.0-canary.83d83f131.0":"2020-09-14T00:33:02.114Z","8.0.0-canary.40d8e4726.0":"2020-09-14T23:30:26.319Z","8.0.0-canary.c25d70a31.0":"2020-09-15T02:29:29.992Z","8.0.0-canary.d52b165b5.0":"2020-09-15T14:54:44.245Z","8.0.0-canary.a831d4799.0":"2020-09-15T17:52:13.696Z","8.0.0-canary.a306aa488.0":"2020-09-17T00:59:09.152Z","8.0.0-canary.fd608ff66.0":"2020-09-17T14:26:07.044Z","8.0.0-canary.3e435ba57.0":"2020-09-17T14:43:22.304Z","8.0.0-canary.c250ec52a.0":"2020-09-17T20:10:53.458Z","8.0.0-canary.e34e411b1.0":"2020-09-17T20:18:14.903Z","8.0.0-canary.4e9343929.0":"2020-09-17T20:43:30.806Z","8.0.0-canary.4e5c350c2.0":"2020-09-21T21:14:31.375Z","8.0.0-canary.16c563ef7.0":"2020-09-22T19:46:40.508Z","8.0.0-canary.fd8af3d43.0":"2020-09-23T19:32:43.017Z","8.0.0-canary.d4cd83a85.0":"2020-09-25T00:36:02.882Z","8.0.0-canary.199aecdfb.0":"2020-09-25T15:51:43.492Z","8.0.0-canary.38ef4501f.0":"2020-09-30T18:24:55.089Z","8.0.0-canary.774dcfc8e.0":"2020-10-01T09:54:33.007Z","8.0.0-canary.0f60323a8.0":"2020-10-08T21:10:27.964Z","8.0.0-canary.d71622574.0":"2020-10-09T16:32:14.610Z","8.0.0-canary.7a9afaf4b.0":"2020-10-09T22:54:23.272Z","8.0.0-canary.8a39352c8.0":"2020-10-12T17:46:47.974Z","8.0.0-canary.790ca85fd.0":"2020-10-12T21:57:11.549Z","8.0.0-canary.174c0becf.0":"2020-10-14T02:16:08.581Z","8.0.0-canary.c71ebfa02.0":"2020-10-14T04:18:01.397Z","8.0.0-canary.2ab716cbd.0":"2020-10-16T00:04:43.610Z","8.0.0-canary.43c1c5e2f.0":"2020-10-19T14:08:30.037Z","8.0.0-canary.ccc64eea3.0":"2020-10-26T22:52:00.231Z","8.0.0-canary.a79cdd019.0":"2020-10-27T16:31:57.199Z","8.0.0-canary.596e98424.0":"2020-10-28T16:04:00.273Z","8.0.0-canary.05d5facc2.0":"2020-10-28T16:12:37.333Z","8.0.0-canary.291b3553d.0":"2020-10-28T17:45:27.572Z","8.0.0-canary.dbc449b09.0":"2020-10-28T18:13:13.399Z","8.0.0-canary.4794b25da.0":"2020-10-28T18:41:38.558Z","8.0.0-canary.c61db90a5.0":"2020-10-28T19:00:13.545Z","8.0.0-canary.6d9648ab2.0":"2020-10-29T20:33:01.835Z","8.0.0-canary.5511c5254.0":"2020-10-30T18:00:41.061Z","8.0.0-canary.bd6e302a4.0":"2020-11-02T17:05:21.510Z","9.0.0-canary.d6b5cd418.0":"2020-11-02T22:59:38.418Z","8.0.0":"2020-11-02T23:00:02.360Z","9.0.0-canary.fdf9a2634.0":"2020-11-03T23:21:55.944Z","9.0.0-canary.4a86f30a0.0":"2020-11-03T23:28:22.501Z","9.0.0-canary.fc8b045f1.0":"2020-11-03T23:37:34.775Z","9.0.0-canary.a0b2db26b.0":"2020-11-04T00:09:32.721Z","9.0.0-canary.419e03572.0":"2020-11-04T01:33:27.625Z","9.0.0-canary.a432ad542.0":"2020-11-06T01:46:18.451Z","9.0.0-canary.e2e8aef1e.0":"2020-11-06T02:05:45.992Z","9.0.0-canary.ec6b68b34.0":"2020-11-06T18:56:58.713Z","9.0.0-canary.b39094d14.0":"2020-11-06T21:16:27.055Z","9.0.0-canary.8648b8258.0":"2020-11-12T10:45:01.350Z","9.0.0-canary.240c5f74f.0":"2020-11-12T20:21:11.301Z","9.0.0-canary.6cf6ba4f4.0":"2020-11-16T18:50:23.615Z","9.0.0-canary.07f3e01b7.0":"2020-11-16T21:46:13.220Z","9.0.0-canary.23491cf85.0":"2020-11-17T00:17:39.743Z","9.0.0-canary.b659d4fc3.0":"2020-11-17T00:25:32.553Z","9.0.0-canary.d8a3aed67.0":"2020-11-17T15:28:26.195Z","9.0.0-canary.482ff9091.0":"2020-11-17T17:58:29.644Z","9.0.0-canary.99cfb6bd5.0":"2020-11-18T18:44:17.931Z","9.0.0-canary.b98d15d90.0":"2020-11-18T22:35:15.451Z","9.0.0-canary.30c11bfc2.0":"2020-11-19T01:26:24.357Z","9.0.0-canary.1b731d51b.0":"2020-11-19T18:52:48.185Z","9.0.0-canary.4ae94ff78.0":"2020-11-19T18:55:42.543Z","9.0.0-canary.7ad038e1d.0":"2020-11-19T19:18:49.344Z","9.0.0-canary.a41527604.0":"2020-11-19T20:00:37.171Z","9.0.0-canary.7b0e2b377.0":"2020-11-20T22:56:09.421Z","9.0.0-canary.c927a5d05.0":"2020-11-23T19:47:53.112Z","9.0.0-canary.b349b5185.0":"2020-11-24T17:09:18.912Z","9.0.0-canary.9083b7d61.0":"2020-11-24T21:16:31.658Z","9.0.0-canary.eff7b46ac.0":"2020-11-24T23:31:24.936Z","9.0.0-canary.ae27b44b0.0":"2020-11-25T15:33:47.688Z","9.0.0-canary.2fbba2554.0":"2020-11-30T17:40:45.747Z","9.0.0-canary.6d8574fe1.0":"2020-11-30T17:51:44.904Z","9.0.0-canary.fd22355f7.0":"2020-11-30T22:59:57.301Z","9.0.0-canary.c4ab98722.0":"2020-12-02T00:57:02.986Z","9.0.0-canary.977585650.0":"2020-12-02T14:42:41.032Z","9.0.0-canary.c7edfc7b6.0":"2020-12-02T14:50:01.903Z","9.0.0-canary.4f3347306.0":"2020-12-02T15:07:56.610Z","9.0.0-canary.37fbae10d.0":"2020-12-02T18:16:56.344Z","9.0.0-canary.11da3c0db.0":"2020-12-02T20:22:52.320Z","9.0.0-canary.489d4c219.0":"2020-12-03T15:30:04.564Z","9.0.0-canary.6557a69d9.0":"2020-12-03T15:41:51.565Z","9.0.0-canary.4ea1b7c69.0":"2020-12-03T15:58:34.837Z","9.0.0-canary.eaeb78ce3.0":"2020-12-03T17:02:19.895Z","9.0.0-canary.1c156d69d.0":"2020-12-03T20:45:37.544Z","9.0.0-canary.832668d33.0":"2020-12-04T18:06:19.636Z","9.0.0-canary.4321323e4.0":"2020-12-07T11:29:23.796Z","9.0.0-canary.2d5f32d41.0":"2020-12-07T16:42:47.930Z","9.0.0-canary.8239afc64.0":"2020-12-07T19:49:54.222Z","9.0.0-canary.6871336f1.0":"2020-12-08T16:01:51.321Z","9.0.0-canary.9f718da94.0":"2020-12-08T16:13:38.828Z","9.0.0-canary.1fccb1418.0":"2020-12-08T16:28:43.456Z","9.0.0-canary.afb68894e.0":"2020-12-08T16:32:43.907Z","9.0.0-canary.fd88d40c2.0":"2020-12-08T16:46:03.329Z","9.0.0-canary.ba9e3109c.0":"2020-12-08T19:05:39.802Z","9.0.0-canary.1085c3b2d.0":"2020-12-09T19:11:23.374Z","9.0.0-canary.c5dda809d.0":"2020-12-09T20:50:14.212Z","9.0.0-canary.f5f1bd86a.0":"2020-12-09T21:08:37.165Z","9.0.0-canary.00f38200f.0":"2020-12-11T15:45:41.187Z","9.0.0-canary.ac41a5729.0":"2020-12-11T16:28:31.743Z","9.0.0-canary.7fe0e4f05.0":"2020-12-11T17:05:51.636Z","9.0.0-canary.9244508bd.0":"2020-12-11T19:07:44.213Z","9.0.0-canary.384a8eeb1.0":"2020-12-16T17:02:11.164Z","9.0.0-canary.eabf9d5c2.0":"2020-12-16T18:27:58.780Z","9.0.0-canary.30fdfd06e.0":"2020-12-16T19:07:49.571Z","9.0.0-canary.9590a8f90.0":"2020-12-22T17:42:18.887Z","9.0.0-canary.f89d8b8f2.0":"2020-12-22T23:05:24.404Z","9.0.0-canary.fb194dd35.0":"2020-12-28T20:45:58.112Z","9.0.0-canary.64f36e287.0":"2020-12-28T21:08:51.033Z","9.0.0-canary.b7bbe7022.0":"2020-12-29T18:48:20.941Z","9.0.0":"2020-12-29T19:46:26.582Z","10.0.0-canary.776c18681.0":"2020-12-30T00:40:28.833Z","10.0.0-canary.671d72d95.0":"2020-12-30T20:12:14.400Z","10.0.0-canary.b4f5a1c9e.0":"2020-12-30T21:46:47.327Z","10.0.0-canary.a94bd8deb.0":"2020-12-30T22:04:36.831Z","10.0.0-canary.5d128511b.0":"2020-12-30T22:10:02.296Z","10.0.0-canary.365c69360.0":"2021-01-05T17:48:37.427Z","10.0.0-canary.700a8261a.0":"2021-01-05T21:00:56.873Z","10.0.0-canary.766981c15.0":"2021-01-05T22:40:40.943Z","10.0.0-canary.b28c576d9.0":"2021-01-05T22:50:19.096Z","10.0.0-canary.968735356.0":"2021-01-06T15:51:11.924Z","10.0.0-canary.c5e18b020.0":"2021-01-06T19:44:35.210Z","10.0.0-canary.bcff8a66a.0":"2021-01-06T20:26:38.728Z","10.0.0-canary.79328c9ff.0":"2021-01-07T02:34:31.614Z","10.0.0-canary.121e1f303.0":"2021-01-07T23:20:10.412Z","10.0.0-canary.abdd10065.0":"2021-01-08T17:51:49.479Z","10.0.0-canary.089de519c.0":"2021-01-08T22:20:58.764Z","10.0.0-canary.163119837.0":"2021-01-08T23:45:38.636Z","10.0.0-canary.b8a1a58e4.0":"2021-01-11T16:25:12.785Z","10.0.0-canary.7584267ff.0":"2021-01-12T01:12:41.242Z","10.0.0-canary.251ac04c0.0":"2021-01-12T19:55:28.849Z","10.0.0-canary.772cc1068.0":"2021-01-14T00:07:24.877Z","10.0.0-canary.fe13dd130.0":"2021-01-14T01:10:38.483Z","10.0.0-canary.c7c5da28f.0":"2021-01-14T01:34:29.100Z","10.0.0-canary.b2faa116a.0":"2021-01-19T19:26:56.380Z","10.0.0-canary.0c95c9f7b.0":"2021-01-19T22:54:09.918Z","10.0.0-canary.5268222c4.0":"2021-01-20T19:19:30.634Z","10.0.0-canary.2ed2d829b.0":"2021-01-20T23:08:22.114Z","10.0.0-canary.df00c2b30.0":"2021-01-21T19:55:20.861Z","10.0.0-canary.fd61b0476.0":"2021-01-21T20:09:57.560Z","10.0.0-canary.3fb3a0265.0":"2021-01-22T00:05:12.101Z","10.0.0-canary.07deaec27.0":"2021-01-22T16:56:46.183Z","10.0.0-canary.d2959b16c.0":"2021-01-22T18:52:30.501Z","10.0.0-canary.75f3bfe7c.0":"2021-01-22T22:51:50.669Z","10.0.0-canary.b9adb7a0f.0":"2021-01-22T23:36:09.858Z","10.0.0-canary.d29ec2862.0":"2021-01-25T16:24:21.372Z","10.0.0-canary.96be07c68.0":"2021-01-26T00:10:31.545Z","10.0.0-canary.e383944e9.0":"2021-01-26T01:45:18.098Z","10.0.0-canary.623af861e.0":"2021-01-26T03:45:36.315Z","10.0.0-canary.6863fd43a.0":"2021-01-26T21:33:37.139Z","10.0.0-canary.ea55b87ca.0":"2021-01-26T23:46:29.409Z","10.0.0-canary.e902ff05f.0":"2021-01-27T00:04:24.666Z","10.0.0-canary.2c9fc538a.0":"2021-01-27T00:27:35.199Z","10.0.0-canary.6bf56aaa4.0":"2021-01-27T01:20:32.924Z","10.0.0-canary.994873795.0":"2021-01-27T14:51:27.385Z","10.0.0-canary.96878e1d0.0":"2021-01-27T18:02:41.380Z","10.0.0-canary.3c117cdcc.0":"2021-01-27T18:32:47.011Z","10.0.0-canary.b411e7033.0":"2021-01-27T22:04:00.060Z","10.0.0-canary.a9ac16b4a.0":"2021-01-27T23:03:56.528Z","10.0.0-canary.fec7b42ca.0":"2021-01-28T19:15:00.728Z","10.0.0-canary.8e66dbfee.0":"2021-02-01T23:20:49.833Z","10.0.0-canary.637d15da6.0":"2021-02-02T18:49:37.743Z","10.0.0-canary.fb793939e.0":"2021-02-02T23:43:23.280Z","10.0.0-canary.15a4d40dd.0":"2021-02-03T02:18:53.992Z","10.0.0-canary.7a003acf0.0":"2021-02-04T02:34:20.167Z","10.0.0-canary.05f249666.0":"2021-02-04T17:50:37.194Z","10.0.0-canary.1a3a39629.0":"2021-02-04T18:43:31.481Z","10.0.0-canary.8b1cdb1be.0":"2021-02-04T22:35:14.996Z","10.0.0-canary.8271f00f7.0":"2021-02-04T23:00:59.247Z","10.0.0-canary.533092a90.0":"2021-02-05T03:47:06.478Z","11.0.0-canary.633a9fc7a.0":"2021-02-05T16:17:51.260Z","10.0.0":"2021-02-05T16:19:19.715Z","11.0.0-canary.b5227247d.0":"2021-02-05T17:42:23.521Z","11.0.0-canary.95322b11e.0":"2021-02-05T23:32:00.138Z","11.0.0-canary.1f318ff0f.0":"2021-02-06T00:05:12.898Z","11.0.0-canary.ab12cf7a3.0":"2021-02-08T15:03:51.616Z","11.0.0-canary.98db2c5ec.0":"2021-02-08T15:34:50.308Z","11.0.0-canary.1f86b9f6d.0":"2021-02-08T17:17:47.697Z","11.0.0-canary.aac8f5d9a.0":"2021-02-08T18:00:47.164Z","11.0.0-canary.750e18fc7.0":"2021-02-08T21:41:41.416Z","11.0.0-canary.b62b1266d.0":"2021-02-09T21:53:03.751Z","11.0.0-canary.a6b3101fb.0":"2021-02-11T23:17:13.834Z","11.0.0-canary.ed88df700.0":"2021-02-12T00:07:14.206Z","11.0.0-canary.d30efe6b4.0":"2021-02-12T02:42:14.712Z","11.0.0-canary.0393bdc4b.0":"2021-02-12T04:31:15.501Z","11.0.0-canary.7cd26af4d.0":"2021-02-12T15:59:42.684Z","11.0.0-canary.71fe9a067.0":"2021-02-12T16:31:19.204Z","11.0.0-canary.0fd56a86b.0":"2021-02-13T00:12:05.170Z","11.0.0-canary.f19bbc4af.0":"2021-02-16T22:16:31.881Z","11.0.0-canary.f9cac96cc.0":"2021-02-17T16:10:14.583Z","11.0.0-canary.79ce0878b.0":"2021-02-17T19:25:29.216Z","11.0.0-canary.d6e507b5b.0":"2021-02-17T19:58:28.148Z","11.0.0-canary.f2658381b.0":"2021-02-17T22:45:06.508Z","11.0.0-canary.97c4d4035.0":"2021-02-18T02:35:24.999Z","11.0.0-canary.f5bb4648c.0":"2021-02-18T16:05:53.173Z","11.0.0-canary.302c7a960.0":"2021-02-18T18:38:10.208Z","11.0.0-canary.aa0aaf026.0":"2021-02-18T19:23:47.978Z","11.0.0-canary.07ff0c452.0":"2021-02-18T19:42:49.423Z","11.0.0-canary.bed7ecd3e.0":"2021-02-18T23:27:52.345Z","11.0.0-canary.06dead2d6.0":"2021-02-19T00:37:21.537Z","11.0.0-canary.cddb03553.0":"2021-02-19T03:13:30.479Z","11.0.0-canary.d6d8d0476.0":"2021-02-19T05:36:55.173Z","11.0.0-canary.0b4a4b2eb.0":"2021-02-19T15:46:01.353Z","11.0.0-canary.3201cae47.0":"2021-02-19T23:01:00.914Z","11.0.0-canary.f1b1fd5d3.0":"2021-02-22T19:49:46.888Z","11.0.0-canary.7899e0fe0.0":"2021-02-22T22:46:13.804Z","11.0.0-canary.f19c86d13.0":"2021-02-22T23:30:57.104Z","11.0.0-canary.60e892d79.0":"2021-02-23T01:14:23.647Z","11.0.0-canary.c96bfa495.0":"2021-02-23T19:33:14.764Z","11.0.0-canary.fa9b59f67.0":"2021-02-23T19:34:38.546Z","11.0.0-canary.869e3497c.0":"2021-02-23T19:35:07.191Z","11.0.0-canary.8ecd7c9a9.0":"2021-02-23T19:50:57.519Z","11.0.0-canary.9c85d505b.0":"2021-02-23T22:15:56.646Z","11.0.0-canary.9f2e85fb8.0":"2021-02-24T01:48:35.047Z","11.0.0-canary.19c4f29ef.0":"2021-02-25T19:22:43.601Z","11.0.0-canary.63df6e9bf.0":"2021-02-25T19:37:27.507Z","11.0.0-canary.981ad970a.0":"2021-02-26T00:07:42.079Z","11.0.0-canary.f9c9e39d6.0":"2021-02-26T18:39:06.997Z","11.0.0-canary.c97d7d881.0":"2021-03-01T20:53:27.498Z","11.0.0-canary.bf670dad7.0":"2021-03-03T00:21:17.442Z","11.0.0-canary.c7d98fcde.0":"2021-03-03T20:32:05.532Z","11.0.0-canary.4fef8bc1e.0":"2021-03-03T23:24:31.600Z","11.0.0-canary.afae3a3ec.0":"2021-03-03T23:42:29.889Z","11.0.0-canary.0a0b10f22.0":"2021-03-04T00:01:18.804Z","11.0.0-canary.6f678a91a.0":"2021-03-04T18:40:16.419Z","11.0.0-canary.f5f1b613c.0":"2021-03-04T20:49:50.900Z","11.0.0-canary.606e767ef.0":"2021-03-04T21:45:56.347Z","11.0.0-canary.f77a4dd1a.0":"2021-03-06T04:40:10.081Z","11.0.0-canary.2d6ba2c23.0":"2021-03-08T22:44:25.943Z","11.0.0-canary.7522dcaca.0":"2021-03-09T00:27:48.213Z","11.0.0-canary.5c0ab7401.0":"2021-03-09T22:52:36.242Z","11.0.0-canary.59010b6dc.0":"2021-03-10T16:57:33.648Z","11.0.0-canary.9e52f5544.0":"2021-03-10T23:25:13.343Z","11.0.0-canary.a678806f5.0":"2021-03-11T01:50:06.717Z","11.0.0-canary.b2d22df5b.0":"2021-03-11T17:02:59.957Z","11.0.0-canary.81911b707.0":"2021-03-11T18:23:34.631Z","11.0.0-canary.9eeb35c38.0":"2021-03-11T19:37:05.447Z","11.0.0-canary.12be3e95a.0":"2021-03-11T20:01:42.120Z","11.0.0-canary.e683bdf4a.0":"2021-03-11T20:09:01.750Z","11.0.0-canary.a07b6d486.0":"2021-03-11T20:33:23.950Z","11.0.0-canary.1e0653477.0":"2021-03-11T20:40:43.772Z","11.0.0-canary.148e8cfcc.0":"2021-03-11T22:44:26.705Z","11.0.0-canary.73a227194.0":"2021-03-12T00:24:13.761Z","11.0.0-canary.f8579b7ea.0":"2021-03-13T02:03:15.377Z","11.0.0-canary.d2a39d300.0":"2021-03-16T00:35:14.708Z","11.0.0-canary.7cf67823e.0":"2021-03-16T18:20:18.736Z","11.0.0-canary.67d780c79.0":"2021-03-16T19:48:01.970Z","11.0.0-canary.0f358ddae.0":"2021-03-16T22:12:31.729Z","11.0.0-canary.67eb0df80.0":"2021-03-16T22:39:44.616Z","11.0.0-canary.941ca3b3c.0":"2021-03-16T22:41:34.596Z","11.0.0-canary.3344d12ad.0":"2021-03-17T10:01:54.481Z","11.0.0-canary.6072ed604.0":"2021-03-17T22:59:37.059Z","11.0.0-canary.d3a6862af.0":"2021-03-18T16:20:14.016Z","11.0.0-canary.40dd242d5.0":"2021-03-18T21:17:27.291Z","11.0.0-canary.ec8f8465f.0":"2021-03-18T21:44:21.166Z","11.0.0-canary.da38969ec.0":"2021-03-18T22:18:02.999Z","11.0.0-canary.f5246264d.0":"2021-03-19T00:38:09.353Z","11.0.0-canary.03d34bbad.0":"2021-03-19T00:51:27.010Z","11.0.0-canary.cbc57c600.0":"2021-03-19T00:59:52.987Z","11.0.0-canary.d6c5bcf37.0":"2021-03-19T01:12:34.229Z","11.0.0-canary.fefc668d7.0":"2021-03-19T01:33:58.863Z","11.0.0-canary.faa7d3226.0":"2021-03-19T17:44:16.518Z","11.0.0-canary.c60449bc8.0":"2021-03-19T18:05:16.744Z","11.0.0-canary.5f0fc444a.0":"2021-03-19T18:37:53.369Z","11.0.0-canary.4567a750d.0":"2021-03-20T02:08:01.986Z","11.0.0-canary.0cde52f5a.0":"2021-03-23T00:03:04.940Z","11.0.0-canary.48f4b67fb.0":"2021-03-23T19:54:20.174Z","11.0.0-canary.0b8cff734.0":"2021-03-23T20:04:45.516Z","11.0.0-canary.8943b991f.0":"2021-03-23T20:29:46.712Z","11.0.0-canary.3955d8d3d.0":"2021-03-24T19:16:31.360Z","11.0.0-canary.23ea2d85e.0":"2021-03-25T17:32:51.733Z","11.0.0-canary.e3ec22f45.0":"2021-03-25T17:57:04.183Z","11.0.0-canary.4ceb42220.0":"2021-03-26T07:57:36.791Z","11.0.0-canary.dc9c84023.0":"2021-03-30T17:48:47.622Z","11.0.0-canary.56fc26962.0":"2021-03-31T00:21:00.317Z","11.0.0-canary.bc318250e.0":"2021-03-31T01:33:51.420Z","11.0.0-canary.edaee19aa.0":"2021-03-31T02:11:51.987Z","11.0.0-canary.24609b822.0":"2021-03-31T20:57:14.981Z","11.0.0-canary.b6cddc2b7.0":"2021-04-01T15:05:28.011Z","11.0.0-canary.94937c78c.0":"2021-04-01T21:01:00.892Z","11.0.0-canary.e7202cb57.0":"2021-04-01T22:47:30.849Z","11.0.0-canary.1f636b205.0":"2021-04-02T22:24:18.073Z","11.0.0-canary.94f50b260.0":"2021-04-05T15:05:23.332Z","11.0.0-canary.a4009b80a.0":"2021-04-05T22:00:42.966Z","11.0.0-canary.15604bd0d.0":"2021-04-05T22:42:26.570Z","11.0.0-canary.76da7876c.0":"2021-04-07T01:44:53.803Z","11.0.0-canary.6bcb6cbd2.0":"2021-04-07T18:54:01.395Z","11.0.0-canary.c91e8d141.0":"2021-04-07T18:57:57.343Z","11.0.0-canary.f77c50860.0":"2021-04-08T15:36:03.694Z","11.0.0-canary.367d88bdb.0":"2021-04-08T16:38:53.019Z","11.0.0-canary.0ec437d3b.0":"2021-04-08T19:35:34.011Z","11.0.0-canary.b2fa996a1.0":"2021-04-09T15:11:19.355Z","11.0.0-canary.24255c408.0":"2021-04-09T20:12:40.896Z","11.0.0-canary.7d6a4bb72.0":"2021-04-09T22:53:47.012Z","11.0.0-canary.352b295c1.0":"2021-04-12T18:15:45.759Z","11.0.0-canary.ab99b8064.0":"2021-04-13T14:43:41.919Z","11.0.0-canary.8f0a11e32.0":"2021-04-14T20:03:14.624Z","11.0.0-canary.f5c6db8fc.0":"2021-04-15T18:04:20.792Z","11.0.0-canary.3793a3143.0":"2021-04-15T18:31:35.216Z","11.0.0-canary.bc104bae7.0":"2021-04-15T19:46:18.985Z","12.0.0-canary.3f342c3f4.0":"2021-04-15T22:54:28.571Z","11.0.0":"2021-04-15T22:58:36.428Z","12.0.0-canary.2ebfc5374.0":"2021-04-16T20:45:17.062Z","12.0.0-canary.5631828e1.0":"2021-04-17T07:47:01.874Z","12.0.0-canary.bd685395b.0":"2021-04-19T18:41:33.148Z","12.0.0-canary.b52196498.0":"2021-04-19T19:58:02.973Z","12.0.0-canary.8ba3e298c.0":"2021-04-21T14:08:47.675Z","12.0.0-canary.c629eab71.0":"2021-04-21T19:57:26.167Z","12.0.0-canary.8ace3b810.0":"2021-04-21T20:38:05.923Z","12.0.0-canary.70beaf42d.0":"2021-04-21T20:49:38.698Z","12.0.0-canary.cad489689.0":"2021-04-22T16:49:45.789Z","12.0.0-canary.d928692b5.0":"2021-04-23T17:34:41.324Z","12.0.0-canary.8f68de8f3.0":"2021-04-23T18:13:27.573Z","12.0.0-canary.05753cf77.0":"2021-04-23T23:43:21.593Z","12.0.0-canary.ef43e6d96.0":"2021-04-23T23:49:41.600Z","12.0.0-canary.197f64fa2.0":"2021-04-26T17:10:09.550Z","12.0.0-canary.55ad2d7d8.0":"2021-04-27T01:20:05.351Z","12.0.0-canary.ec4ac5234.0":"2021-04-27T07:58:52.101Z","12.0.0-canary.b0579acdb.0":"2021-04-27T08:36:41.229Z","12.0.0-canary.81e2d4ff3.0":"2021-04-27T20:57:58.739Z","12.0.0-canary.c8edee52c.0":"2021-04-27T21:46:24.028Z","12.0.0-canary.f5b6110d6.0":"2021-04-27T22:07:45.645Z","12.0.0-canary.cee9b9e22.0":"2021-04-28T00:13:12.722Z","12.0.0-canary.96e83fca7.0":"2021-04-28T02:48:11.001Z","12.0.0-canary.4c497bd19.0":"2021-04-28T17:53:51.180Z","12.0.0-canary.105b15b96.0":"2021-04-28T21:45:06.327Z","12.0.0-canary.6e20259e3.0":"2021-04-28T21:49:32.651Z","12.0.0-canary.0f79a5d74.0":"2021-04-28T22:43:17.014Z","12.0.0-canary.84f3db9ed.0":"2021-04-29T14:18:18.745Z","12.0.0-canary.8fc29273c.0":"2021-04-29T21:24:03.221Z","12.0.0-canary.c50d20bab.0":"2021-04-29T23:02:16.168Z","12.0.0-canary.474836ad0.0":"2021-05-01T03:38:01.546Z","12.0.0-canary.f5ad92287.0":"2021-05-03T18:22:34.595Z","12.0.0-canary.af453daf8.0":"2021-05-03T18:53:48.211Z","12.0.0-canary.1f1918c24.0":"2021-05-03T19:22:51.413Z","12.0.0-canary.33148231f.0":"2021-05-03T19:39:06.459Z","12.0.0-canary.06b76fa74.0":"2021-05-03T19:46:09.076Z","12.0.0-canary.7c5000473.0":"2021-05-03T22:42:00.105Z","12.0.0-canary.de997644b.0":"2021-05-04T17:28:34.307Z","12.0.0-canary.d4d7f1cc2.0":"2021-05-04T17:55:23.405Z","12.0.0-canary.be999eb08.0":"2021-05-04T18:00:33.116Z","12.0.0-canary.eda1705fc.0":"2021-05-04T19:10:47.928Z","12.0.0-canary.718c90178.0":"2021-05-04T19:28:04.973Z","12.0.0-canary.0e3917299.0":"2021-05-04T19:30:45.267Z","12.0.0-canary.836b3c7db.0":"2021-05-04T20:34:12.469Z","12.0.0-canary.53d4e6d59.0":"2021-05-04T20:49:56.821Z","12.0.0-canary.18d147e27.0":"2021-05-04T20:58:24.866Z","12.0.0-canary.b9984794e.0":"2021-05-04T23:03:26.107Z","12.0.0-canary.b76f5fc9d.0":"2021-05-04T23:06:54.458Z","12.0.0-canary.055d4f10a.0":"2021-05-04T23:22:05.154Z","12.0.0-canary.5b6a46016.0":"2021-05-05T16:16:37.697Z","12.0.0-canary.33c9a737a.0":"2021-05-05T17:27:34.579Z","12.0.0-canary.9bc0effaf.0":"2021-05-05T21:00:21.418Z","12.0.0-canary.a1e0f2af5.0":"2021-05-05T21:41:21.333Z","12.0.0-canary.06930c96b.0":"2021-05-05T23:39:36.242Z","12.0.0-canary.03f525f9f.0":"2021-05-06T00:30:18.964Z","12.0.0-canary.e82ba2a26.0":"2021-05-06T15:56:43.353Z","12.0.0-canary.fc7c4e5ce.0":"2021-05-06T17:29:41.253Z","12.0.0-canary.65c04514d.0":"2021-05-06T18:43:55.115Z","12.0.0-canary.c97779ca6.0":"2021-05-06T21:43:28.265Z","12.0.0-canary.869d890d4.0":"2021-05-07T15:19:12.595Z","12.0.0-canary.ec22e1da9.0":"2021-05-10T18:23:48.823Z","12.0.0-nightly.7427449f0.0":"2021-05-10T18:45:05.928Z","12.0.0-canary.957cc3bf5.0":"2021-05-10T21:57:09.311Z","12.0.0-canary.88a33cd70.0":"2021-05-11T00:09:15.020Z","12.0.0-canary.d20dc6dba.0":"2021-05-11T00:25:06.438Z","12.0.0-canary.0ce2fdb02.0":"2021-05-11T00:58:52.953Z","12.0.0-canary.cb162da37.0":"2021-05-11T01:58:43.939Z","12.0.0-canary.573dc7ffd.0":"2021-05-11T02:17:35.249Z","12.0.0-canary.d5f6ad3fe.0":"2021-05-11T23:22:51.437Z","12.0.0-canary.25751d2ed.0":"2021-05-12T16:20:03.529Z","12.0.0-canary.a23ecb682.0":"2021-05-12T18:23:31.302Z","12.0.0-canary.33a954852.0":"2021-05-13T15:07:58.520Z","12.0.0-canary.a4484849b.0":"2021-05-13T15:31:19.012Z","12.0.0-canary.b4c3f513e.0":"2021-05-13T16:08:22.633Z","12.0.0-canary.1a8d06483.0":"2021-05-13T16:13:59.365Z","12.0.0-canary.8e6081836.0":"2021-05-14T21:40:57.787Z","12.0.0-canary.a2b0f4cee.0":"2021-05-14T21:54:09.190Z","12.0.0-canary.e8e39ad19.0":"2021-05-18T20:13:26.811Z","12.0.0-canary.4bb5eea2b.0":"2021-05-19T15:28:35.802Z","12.0.0-canary.ccce99cd6.0":"2021-05-20T00:57:07.115Z","12.0.0-canary.14767a8db.0":"2021-05-20T20:51:20.325Z","12.0.0-canary.22c6dcff9.0":"2021-05-24T15:18:57.900Z","12.0.0-canary.fadab3372.0":"2021-05-24T16:06:06.678Z","12.0.0-canary.caa73aeee.0":"2021-05-25T14:14:44.114Z","12.0.0-canary.ec31ae1ed.0":"2021-05-25T20:35:40.595Z","12.0.0-canary.8530d3514.0":"2021-05-27T16:05:10.991Z","12.0.0-canary.00b5899dc.0":"2021-06-01T22:45:52.445Z","12.0.0-canary.f1525ea3e.0":"2021-06-03T13:54:41.797Z","12.0.0-canary.464a00286.0":"2021-06-03T14:46:27.733Z","12.0.0-canary.474de7878.0":"2021-06-03T15:14:31.675Z","12.0.0-canary.b87ebf74d.0":"2021-06-03T17:46:33.780Z","12.0.0-canary.2daa49b35.0":"2021-06-04T16:14:24.304Z","12.0.0-canary.08db3d737.0":"2021-06-04T19:41:59.272Z","12.0.0-canary.5823407a7.0":"2021-06-08T00:48:40.620Z","12.0.0-canary.23b0c5e22.0":"2021-06-08T16:22:30.692Z","12.0.0-canary.2952c6a76.0":"2021-06-08T17:41:09.789Z","12.0.0-canary.f12425f88.0":"2021-06-10T01:06:30.690Z","12.0.0-canary.e543628c3.0":"2021-06-10T01:07:30.336Z","12.0.0-canary.e0c346286.0":"2021-06-10T16:36:07.352Z","12.0.0-canary.f43af5633.0":"2021-06-10T20:36:04.051Z","12.0.0-canary.8415ae585.0":"2021-06-11T16:06:09.281Z","12.0.0-canary.598fcccc8.0":"2021-06-11T21:46:42.486Z","12.0.0-canary.5d0605188.0":"2021-06-14T17:39:23.771Z","12.0.0-canary.f147a2271.0":"2021-06-14T19:18:22.080Z","12.0.0-canary.33579e00b.0":"2021-06-15T00:22:13.794Z","12.0.0-canary.a6909c0e6.0":"2021-06-15T18:30:23.675Z","12.0.0-canary.c18b5925b.0":"2021-06-15T21:03:50.047Z","12.0.0-canary.271fff902.0":"2021-06-15T22:51:21.306Z","12.0.0-canary.7ea2e830d.0":"2021-06-15T22:52:57.414Z","12.0.0-canary.d96f0a1e0.0":"2021-06-16T21:06:34.356Z","12.0.0-canary.a6183801a.0":"2021-06-16T22:05:45.209Z","12.0.0-canary.940550232.0":"2021-06-17T19:40:29.868Z","12.0.0-canary.f705e8048.0":"2021-06-18T15:24:48.200Z","12.0.0-canary.08d791f37.0":"2021-06-18T21:12:00.734Z","12.0.0-canary.e38d7440f.0":"2021-06-21T17:40:46.039Z","12.0.0-canary.75900a5a9.0":"2021-06-21T18:37:16.857Z","12.0.0-canary.33e6f50e9.0":"2021-06-23T00:12:21.049Z","12.0.0-canary.8c685301d.0":"2021-06-23T18:24:53.534Z","12.0.0-canary.8c7d994ae.0":"2021-06-23T19:27:41.587Z","12.0.0-canary.4ccd39bdd.0":"2021-06-24T16:15:12.141Z","12.0.0-canary.17553e9f8.0":"2021-06-28T22:52:51.018Z","12.0.0-canary.4c80072fd.0":"2021-06-29T18:41:09.596Z","12.0.0-canary.796811db7.0":"2021-07-01T00:03:42.427Z","12.0.0-canary.70e1efdca.0":"2021-07-01T17:06:52.235Z","12.0.0-canary.435866d32.0":"2021-07-02T18:21:29.661Z","12.0.0-canary.d0f9f3f2e.0":"2021-07-03T00:00:20.039Z","12.0.0-canary.adeac0549.0":"2021-07-08T15:09:33.049Z","12.0.0-canary.068fd5028.0":"2021-07-08T19:03:59.524Z","12.0.0-canary.5dfec7a14.0":"2021-07-12T20:04:29.524Z","12.0.0-canary.07a73750c.0":"2021-07-12T20:25:49.458Z","12.0.0-canary.3e4c6dca1.0":"2021-07-13T01:51:39.157Z","12.0.0-canary.ea77795b1.0":"2021-07-13T15:49:40.422Z","12.0.0-canary.15a179fad.0":"2021-07-13T18:09:40.297Z","12.0.0-canary.c73142a1b.0":"2021-07-13T18:44:33.006Z","12.0.0-canary.d923db73a.0":"2021-07-13T20:54:15.380Z","12.0.0-canary.22d29cbb4.0":"2021-07-13T22:50:51.547Z","12.0.0-canary.2749604bc.0":"2021-07-14T16:22:46.296Z","12.0.0-canary.e1703bed9.0":"2021-07-14T21:48:25.943Z","12.0.0-canary.de48eff0d.0":"2021-07-15T17:08:27.290Z","12.0.0-canary.4f060adc5.0":"2021-07-15T19:22:12.778Z","12.0.0-canary.bd25779b2.0":"2021-07-15T20:42:38.802Z","12.0.0-canary.9f68a932e.0":"2021-07-15T22:07:30.419Z","12.0.0-canary.4eecdeaf0.0":"2021-07-16T14:58:16.399Z","12.0.0-canary.7239684d4.0":"2021-07-16T15:59:28.994Z","12.0.0-canary.d5f1f7c72.0":"2021-07-16T16:14:21.806Z","12.0.0-canary.4d95812f9.0":"2021-07-16T19:43:27.703Z","12.0.0-canary.38d1846cc.0":"2021-07-19T18:42:19.364Z","12.0.0-canary.3f691eccf.0":"2021-07-20T16:09:06.176Z","12.0.0-canary.ebb5c73bb.0":"2021-07-20T16:57:09.624Z","12.0.0-nightly.778a0e8a.0":"2021-07-20T21:05:47.573Z","12.0.0-canary.791311bba.0":"2021-07-20T22:07:52.539Z","12.0.0-canary.85e9a6ac3.0":"2021-07-21T15:36:16.167Z","12.0.0-canary.6b0442278.0":"2021-07-21T18:50:13.550Z","12.0.0-canary.5f00e454a.0":"2021-07-22T17:06:45.050Z","12.0.0-canary.90e08fc6b.0":"2021-07-22T23:38:39.172Z","12.0.0-canary.cf5b9eb86.0":"2021-07-23T18:12:34.687Z","12.0.0-canary.3f36ac75c.0":"2021-07-23T18:32:32.278Z","12.0.0-canary.ea1e1b850.0":"2021-07-24T20:56:06.656Z","12.0.0-canary.22f390c43.0":"2021-07-27T19:00:13.671Z","12.0.0":"2021-07-27T19:50:12.458Z","13.0.0-canary.ae85f7eba.0":"2021-07-27T19:51:49.133Z","13.0.0-canary.5981207f7.0":"2021-07-27T23:18:31.889Z","13.0.0-canary.83bdd0222.0":"2021-07-28T17:26:11.317Z","13.0.0-canary.28656298a.0":"2021-07-29T18:13:24.815Z","13.0.0-canary.9e797daaf.0":"2021-07-29T18:35:40.891Z","13.0.0-canary.adb9f1ad8.0":"2021-07-30T19:05:24.111Z","13.0.0-canary.cc5377458.0":"2021-07-30T21:33:42.990Z","13.0.0-canary.a395972cf.0":"2021-08-03T21:23:40.709Z","13.0.0-canary.7c96e6b98.0":"2021-08-03T22:14:12.756Z","13.0.0-canary.a80c8b2c2.0":"2021-08-05T00:00:06.085Z","13.0.0-canary.3dd611091.0":"2021-08-05T03:56:47.427Z","13.0.0-canary.5dee37ff6.0":"2021-08-05T17:42:37.097Z","13.0.0-canary.bf405d22a.0":"2021-08-05T20:18:29.138Z","13.0.0-canary.b47dd37a6.0":"2021-08-05T20:50:14.619Z","13.0.0-canary.6c82b965b.0":"2021-08-06T16:15:13.220Z","13.0.0-canary.4ca11fe76.0":"2021-08-06T17:07:47.112Z","13.0.0-canary.510cf90f2.0":"2021-08-09T17:17:37.898Z","13.0.0-canary.17580ebf7.0":"2021-08-09T18:17:56.622Z","13.0.0-canary.7249a3060.0":"2021-08-09T18:21:54.554Z","13.0.0-canary.4c405863b.0":"2021-08-10T17:41:13.674Z","13.0.0-canary.f4241a42a.0":"2021-08-11T16:59:55.134Z","13.0.0-canary.0ad12ed3c.0":"2021-08-11T21:29:07.484Z","13.0.0-canary.077dcfcfe.0":"2021-08-12T17:55:40.795Z","13.0.0-canary.e3346766f.0":"2021-08-13T19:45:40.341Z","13.0.0-canary.2fb068fb0.0":"2021-08-13T19:48:51.246Z","13.0.0-canary.fb76c5069.0":"2021-08-16T20:08:27.675Z","13.0.0-canary.457d89aad.0":"2021-08-17T15:22:12.293Z","13.0.0-canary.0de2f2edc.0":"2021-08-17T20:54:37.164Z","13.0.0-canary.1f9259b9d.0":"2021-08-17T22:14:39.310Z","13.0.0-canary.3b9290351.0":"2021-08-18T05:23:58.058Z","13.0.0-canary.43d2eed2a.0":"2021-08-18T16:02:36.593Z","13.0.0-canary.0a9069300.0":"2021-08-19T16:18:00.359Z","13.0.0-canary.7da413ed8.0":"2021-08-20T15:49:11.219Z","13.0.0-canary.e1e69fd8e.0":"2021-08-20T19:32:39.379Z","13.0.0-canary.f5afc16df.0":"2021-08-20T20:27:01.107Z","13.0.0-canary.28d0d75bb.0":"2021-08-20T22:20:44.364Z","13.0.0-canary.21ece5360.0":"2021-08-20T23:44:38.688Z","13.0.0-canary.8de07c02a.0":"2021-08-23T15:27:03.916Z","13.0.0-canary.65aa63b0c.0":"2021-08-24T15:28:57.899Z","13.0.0-canary.15981e9d9.0":"2021-08-24T16:17:24.809Z","13.0.0-canary.fa7520f62.0":"2021-08-24T22:28:10.607Z","13.0.0-canary.ce25bc3ec.0":"2021-08-24T22:48:49.365Z","13.0.0-canary.12f5622e1.0":"2021-08-24T23:18:26.590Z","13.0.0-canary.d97f8f133.0":"2021-08-25T18:33:33.558Z","13.0.0-canary.d86fb6fac.0":"2021-08-25T18:54:05.208Z","13.0.0-canary.e8554dbbf.0":"2021-08-25T21:59:43.909Z","13.0.0-canary.877e3fb0d.0":"2021-08-26T15:38:25.901Z","13.0.0-canary.6236f3576.0":"2021-08-26T16:06:12.180Z","13.0.0-canary.1d19158a1.0":"2021-08-26T17:09:18.987Z","13.0.0-canary.6adc9e83f.0":"2021-08-30T22:44:37.481Z","13.0.0-canary.d082790f0.0":"2021-09-01T21:54:39.317Z","13.0.0-canary.e2c4f0196.0":"2021-09-02T02:11:41.954Z","13.0.0-canary.611db508e.0":"2021-09-02T03:15:23.288Z","13.0.0-canary.d4706933f.0":"2021-09-02T15:38:04.577Z","13.0.0-canary.c16fe03ce.0":"2021-09-02T17:45:05.003Z","13.0.0-canary.9203a958a.0":"2021-09-02T23:46:33.417Z","13.0.0-canary.fddd5ae93.0":"2021-09-03T07:30:04.545Z","13.0.0-canary.117599a8b.0":"2021-09-03T07:31:40.761Z","13.0.0-canary.e4180d07b.0":"2021-09-03T07:32:09.489Z","13.0.0-canary.42d175efc.0":"2021-09-03T15:42:59.797Z","13.0.0-canary.72464476c.0":"2021-09-07T15:34:22.186Z","13.0.0-canary.37d4db866.0":"2021-09-09T14:33:36.622Z","13.0.0-canary.6df682e74.0":"2021-09-09T15:43:20.648Z","13.0.0-canary.b49359c35.0":"2021-09-09T17:35:38.413Z","13.0.0-canary.470bd34e8.0":"2021-09-09T18:01:39.508Z","13.0.0-canary.d48a01771.0":"2021-09-09T18:10:30.359Z","13.0.0-canary.13db34b34.0":"2021-09-09T18:25:31.795Z","13.0.0-canary.864798678.0":"2021-09-09T18:36:55.082Z","13.0.0-canary.d04bda3fb.0":"2021-09-10T15:21:43.183Z","13.0.0-canary.5533f73d3.0":"2021-09-13T23:03:47.847Z","13.0.0-canary.08398f880.0":"2021-09-13T23:34:28.012Z","13.0.0-canary.818f4ee93.0":"2021-09-15T17:50:23.625Z","13.0.0-canary.8355e14dc.0":"2021-09-15T19:12:25.505Z","13.0.0-canary.d4e16a6c4.0":"2021-09-15T21:59:09.547Z","13.0.0-canary.65125b3a6.0":"2021-09-16T21:17:27.874Z","13.0.0-canary.80a583365.0":"2021-09-17T20:35:42.972Z","13.0.0-canary.83900936a.0":"2021-09-17T23:24:15.961Z","13.0.0-canary.860ad06a1.0":"2021-09-17T23:36:09.015Z","13.0.0-canary.3b8d4429e.0":"2021-09-20T17:47:31.565Z","13.0.0-canary.2da3606b9.0":"2021-09-20T19:37:38.509Z","13.0.0-canary.e8c598d1e.0":"2021-09-20T21:11:49.978Z","13.0.0-canary.1340ee9f7.0":"2021-09-22T17:58:04.850Z","13.0.0-canary.65084baff.0":"2021-09-23T21:25:38.722Z","13.0.0-canary.c79aa0cdd.0":"2021-09-24T13:42:04.665Z","13.0.0":"2021-09-24T19:45:46.638Z","14.0.0-canary.198431fcd.0":"2021-09-24T19:46:31.211Z","14.0.0-canary.9a02b6ef8.0":"2021-09-25T13:11:10.572Z","14.0.0-canary.758ce31d9.0":"2021-09-27T17:29:24.354Z","14.0.0-canary.86b50ef74.0":"2021-09-28T17:43:12.553Z","14.0.0-canary.b2fe3528b.0":"2021-09-29T22:56:50.135Z","14.0.0-canary.586e740dd.0":"2021-09-30T16:31:14.319Z","14.0.0-canary.2ac92d766.0":"2021-10-05T19:28:42.028Z","14.0.0-canary.353ca7e9f.0":"2021-10-08T18:46:51.739Z","14.0.0-canary.c78ff0429.0":"2021-10-11T17:22:15.156Z","14.0.0-canary.261f2db59.0":"2021-10-20T16:59:50.461Z","14.0.0-canary.9803d2dc1.0":"2021-10-20T19:21:47.010Z","14.0.0-canary.348665978.0":"2021-10-21T14:50:36.468Z","14.0.0-canary.b2b979a8a.0":"2021-10-28T15:12:12.034Z","14.0.0-canary.1af7c1c4a.0":"2021-10-28T17:53:00.316Z","14.0.0-canary.4afd353cd.0":"2021-10-29T15:01:43.952Z","14.0.0-canary.a986df922.0":"2021-10-29T21:35:12.358Z","14.0.0-canary.c3cdff07b.0":"2021-11-09T19:06:04.935Z","14.0.0-canary.468392606.0":"2021-11-11T19:40:04.745Z","14.0.0-canary.828f9803b.0":"2021-11-11T19:50:46.816Z","14.0.0-canary.8795cba87.0":"2021-11-11T19:56:43.374Z","14.0.0-canary.cd7f8cace.0":"2021-11-11T19:58:24.688Z","14.0.0-canary.207230eb8.0":"2021-11-11T22:24:41.517Z","14.0.0-canary.991fb99f7.0":"2021-11-11T22:36:23.218Z","14.0.0-canary.15db4f164.0":"2021-11-12T17:29:44.676Z","14.0.0-canary.8fcad5a3c.0":"2021-11-12T19:14:00.571Z","14.0.0-canary.f81fb1d23.0":"2021-11-12T22:40:13.022Z","14.0.0-canary.783f6fd5a.0":"2021-11-16T05:50:00.456Z","14.0.0-canary.d57ec74c7.0":"2021-11-16T16:16:26.798Z","14.0.0-canary.554c71829.0":"2021-11-16T16:19:19.728Z","14.0.0-canary.3ef470efe.0":"2021-11-16T16:24:09.636Z","14.0.0-canary.61a28b2b5.0":"2021-11-17T18:59:15.339Z","14.0.0-canary.fae6c652d.0":"2021-11-18T16:25:00.410Z","14.0.0-canary.978a3b5bb.0":"2021-11-19T19:39:16.967Z","14.0.0-canary.e6f43cf44.0":"2021-11-22T17:35:08.725Z","14.0.0-canary.39cf14bc3.0":"2021-11-22T23:04:31.996Z","14.0.0-canary.93134d453.0":"2021-11-23T15:39:04.881Z","14.0.0-canary.bbd11268f.0":"2021-11-23T22:32:16.482Z","14.0.0-canary.3db9c4d3d.0":"2021-11-24T15:37:25.394Z","14.0.0-canary.78305b6d5.0":"2021-11-24T19:50:39.537Z","14.0.0-canary.43d08ba77.0":"2021-11-30T22:56:04.051Z","14.0.0-canary.17a072535.0":"2021-12-02T18:05:17.211Z","14.0.0-canary.5d809696c.0":"2021-12-08T17:44:27.256Z","14.0.0-canary.b6510c8c1.0":"2021-12-08T18:06:27.768Z","14.0.0-canary.f460e23da.0":"2021-12-10T15:25:22.591Z","14.0.0-canary.7d8ea4624.0":"2021-12-10T19:29:35.384Z","14.0.0-canary.8fffcb5dd.0":"2021-12-14T08:55:05.813Z","14.0.0-canary.21e1cb9be.0":"2021-12-14T19:39:51.373Z","14.0.0-canary.ba78e8724.0":"2021-12-15T22:12:59.578Z","14.0.0-canary.e3e073c00.0":"2021-12-20T21:09:45.227Z","14.0.0-canary.3366a71d7.0":"2021-12-22T12:32:48.088Z","14.0.0-canary.c047f7c19.0":"2022-01-05T16:45:53.047Z","14.0.0-canary.05db65ec0.0":"2022-01-06T17:14:15.923Z","14.0.0-canary.6ca8b8f85.0":"2022-01-07T16:01:36.093Z","14.0.0-canary.173ee7a7a.0":"2022-01-10T16:54:16.487Z","14.0.0-canary.b704e4dfc.0":"2022-01-10T18:33:04.072Z","14.0.0-canary.c14e977ee.0":"2022-01-11T15:49:38.194Z","14.0.0-canary.b094eaa4e.0":"2022-01-14T18:42:23.635Z","14.0.0-canary.390220e42.0":"2022-01-17T16:46:12.357Z","14.0.0-canary.4b5391f8b.0":"2022-01-19T23:52:47.565Z","14.0.0-canary.cef6bc623.0":"2022-01-20T00:17:31.921Z","14.0.0-canary.0379179c4.0":"2022-01-20T18:54:24.930Z","14.0.0-canary.e62f3dabf.0":"2022-01-21T23:03:24.215Z","14.0.0-canary.3e20c1de8.0":"2022-01-25T15:31:56.531Z","14.0.0-canary.9f9d928b2.0":"2022-01-27T18:13:14.516Z","14.0.0-canary.a2bcb065c.0":"2022-01-28T19:37:06.117Z","14.0.0-canary.4e66fb2e1.0":"2022-01-28T19:41:28.621Z","14.0.0-canary.9736ddce9.0":"2022-01-29T09:49:55.599Z","14.0.0-canary.cc4ed13cc.0":"2022-02-04T18:22:45.681Z","14.0.0-canary.dcba26fe1.0":"2022-02-04T21:57:13.654Z","14.0.0-canary.ec54d9046.0":"2022-02-07T15:46:39.007Z","14.0.0-canary.ea9b5b463.0":"2022-02-09T17:53:43.356Z","14.0.0-canary.96ea061c1.0":"2022-02-09T18:59:34.434Z","14.0.0-canary.e00181e59.0":"2022-02-10T20:06:34.332Z","14.0.0-canary.037285f9b.0":"2022-02-11T18:29:31.672Z","14.0.0-canary.1aaa68dda.0":"2022-02-16T19:49:00.846Z","14.0.0-canary.ab4aba1af.0":"2022-02-17T18:16:20.902Z","14.0.0-canary.e58552c6e.0":"2022-02-18T18:04:07.430Z","14.0.0-canary.868793776.0":"2022-02-22T19:35:31.819Z","14.0.0-canary.fdc37a445.0":"2022-02-28T18:46:10.222Z","14.0.0-canary.43c7d87dc.0":"2022-03-01T15:33:11.418Z","14.0.0-canary.23043acd0.0":"2022-03-02T20:27:25.773Z","14.0.0-canary.6505e61c5.0":"2022-03-03T20:00:29.690Z","14.0.0-canary.16c166154.0":"2022-03-08T23:22:22.300Z","14.0.0-canary.bdf1d3771.0":"2022-03-14T14:28:33.694Z","14.0.0-canary.cf4292778.0":"2022-03-15T00:29:36.035Z","14.0.0-canary.bbd43e0e0.0":"2022-03-16T20:50:04.481Z","14.0.0-canary.1b6afad86.0":"2022-03-16T21:03:35.488Z","14.0.0-canary.bdf9d4af9.0":"2022-03-16T21:17:51.491Z","14.0.0-canary.32b391398.0":"2022-03-17T17:59:12.015Z","14.0.0-canary.ae8a6a3a3.0":"2022-03-18T16:39:13.447Z","14.0.0-canary.cbd9358a6.0":"2022-03-18T22:52:00.241Z","14.0.0-canary.dcfe49c98.0":"2022-03-21T18:44:04.063Z","14.0.0-canary.f31a833fa.0":"2022-03-23T00:50:45.051Z","14.0.0-canary.4b92e210a.0":"2022-03-24T20:18:33.579Z","14.0.0-canary.a657abb61.0":"2022-03-24T20:39:55.571Z","14.0.0-canary.443f63f50.0":"2022-03-25T23:04:35.293Z","14.0.0-canary.eb382f318.0":"2022-03-29T17:34:55.092Z","14.0.0-canary.344d52823.0":"2022-03-29T18:43:15.717Z","14.0.0-canary.4e372fb49.0":"2022-04-07T20:32:55.389Z","14.0.0-canary.3e30054fb.0":"2022-04-13T22:14:14.880Z","14.0.0-canary.8c4da223a.0":"2022-04-19T15:24:11.442Z","14.0.0-canary.7de8965cc.0":"2022-04-19T20:23:23.146Z","14.0.0-canary.641ed0851.0":"2022-04-20T16:05:42.010Z","14.0.0-canary.e88f83024.0":"2022-04-20T17:47:41.005Z","14.0.0-canary.7321d6254.0":"2022-04-20T20:11:13.299Z","14.0.0-canary.3ab956515.0":"2022-04-25T15:01:52.159Z","14.0.0-canary.53b3cad2f.0":"2022-04-27T12:45:21.686Z","14.0.0":"2022-04-28T16:55:53.208Z","15.0.0-canary.432c815e5.0":"2022-04-28T16:57:00.393Z","15.0.0-canary.a0f01f669.0":"2022-05-06T20:14:39.237Z","15.0.0-canary.276cb39a4.0":"2022-05-06T21:31:29.505Z","15.0.0-canary.4fe98ed70.0":"2022-05-06T21:56:01.972Z","15.0.0-canary.58b130a3d.0":"2022-05-06T21:58:21.732Z","15.0.0-canary.ae278a2fe.0":"2022-05-09T15:25:07.447Z","15.0.0-canary.bebf5bfdf.0":"2022-05-11T02:40:19.692Z","15.0.0-canary.e6072cd6a.0":"2022-05-11T20:18:26.709Z","15.0.0-canary.5b40eb988.0":"2022-05-12T02:44:13.758Z","15.0.0-canary.6a61d62f6.0":"2022-05-12T20:26:51.129Z","15.0.0-canary.05930a453.0":"2022-05-13T18:47:28.802Z","15.0.0-canary.c0a11ef0d.0":"2022-05-18T22:01:01.703Z","15.0.0-canary.2f9b268c0.0":"2022-05-20T19:32:39.706Z","15.0.0-canary.7741345b8.0":"2022-05-20T20:02:46.623Z","15.0.0-canary.f807e793f.0":"2022-05-20T22:22:06.517Z","15.0.0-canary.9f53d4a8a.0":"2022-05-23T14:57:42.682Z","15.0.0-canary.77cf00e37.0":"2022-05-31T17:39:54.650Z","15.0.0-canary.3c7b844c2.0":"2022-06-07T22:20:55.882Z","15.0.0-canary.df47894db.0":"2022-06-13T17:08:38.511Z","15.0.0-canary.b18a873dc.0":"2022-06-14T06:29:51.927Z","15.0.0-canary.ba9c29637.0":"2022-06-14T18:57:30.389Z","15.0.0-canary.9bfd12f01.0":"2022-06-22T19:22:38.735Z","15.0.0-canary.764de225d.0":"2022-06-29T16:27:09.529Z","15.0.0-canary.31e517cea.0":"2022-07-01T18:28:29.893Z","15.0.0-canary.9ea4e8e9c.0":"2022-07-01T22:55:05.395Z","15.0.0-canary.cd5bafabb.0":"2022-07-06T17:54:29.960Z","15.0.0-canary.a02fe49d3.0":"2022-07-06T18:51:10.596Z","15.0.0-canary.826a3d8be.0":"2022-07-06T19:31:09.175Z","15.0.0-canary.ef276aa93.0":"2022-07-07T17:02:45.391Z","15.0.0-canary.59cf61d6b.0":"2022-07-07T17:31:30.907Z","15.0.0-canary.8647092f7.0":"2022-07-07T20:38:46.795Z","15.0.0-canary.02ecd4d85.0":"2022-07-11T16:39:22.928Z","15.0.0-canary.63d3a146e.0":"2022-07-12T11:37:24.506Z","15.0.0-canary.88db01990.0":"2022-07-12T11:40:09.000Z","15.0.0-canary.6432d8fd7.0":"2022-07-14T07:29:02.576Z","15.0.0-canary.085f9b25c.0":"2022-07-14T16:35:05.108Z","15.0.0-canary.39f9424b3.0":"2022-07-14T17:05:22.392Z","15.0.0-canary.ae9fce587.0":"2022-07-14T18:08:19.409Z","15.0.0-canary.1ebddc343.0":"2022-07-15T08:49:29.839Z","15.0.0-canary.c5018840c.0":"2022-07-18T09:43:19.064Z","15.0.0-canary.551b40d18.0":"2022-07-18T10:01:12.127Z","15.0.0-canary.cf9f12371.0":"2022-07-18T10:05:13.800Z","15.0.0-canary.2797ff8b6.0":"2022-07-19T00:24:18.705Z","15.0.0-canary.110fafa17.0":"2022-07-20T07:46:50.311Z","15.0.0-canary.386ef1d2f.0":"2022-07-20T18:19:56.061Z","15.0.0-canary.c3924efef.0":"2022-07-20T18:29:42.747Z","15.0.0-canary.cf5c5907c.0":"2022-07-20T21:22:00.940Z","15.0.0-canary.0617e2319.0":"2022-07-20T21:40:16.592Z","15.0.0-canary.a743b7967.0":"2022-07-20T21:57:18.738Z","15.0.0-canary.69fd619d0.0":"2022-07-20T22:09:25.723Z","15.0.0-canary.2a6ddc1cf.0":"2022-07-29T16:04:52.428Z","15.0.0-canary.86efd56f6.0":"2022-08-02T14:45:45.932Z","15.0.0-canary.ccfc24d19.0":"2022-08-03T18:13:43.162Z","15.0.0-canary.e4570146f.0":"2022-08-03T18:40:50.142Z","15.0.0-canary.6683a36cb.0":"2022-08-03T19:20:51.672Z","15.0.0-canary.10196647d.0":"2022-08-03T21:54:00.664Z","15.0.0-canary.b20d3d73c.0":"2022-08-04T22:43:05.066Z","15.0.0-canary.47c0c6b1e.0":"2022-08-09T15:20:38.212Z","15.0.0-canary.0e3dc8e38.0":"2022-08-11T18:46:05.669Z","15.0.0-canary.d5a11f1c8.0":"2022-08-30T23:01:25.998Z","15.0.0-canary.bac992a95.0":"2022-09-01T07:05:47.400Z","15.0.0-canary.d25f3404c.0":"2022-09-01T09:44:53.606Z","15.0.0-canary.920d8a79e.0":"2022-09-01T20:21:07.022Z","15.0.0-canary.c363f267b.0":"2022-09-01T21:18:24.835Z","15.0.0-canary.a4eb4937a.0":"2022-09-06T18:19:55.520Z","15.0.0-canary.4299717da.0":"2022-09-07T16:15:56.843Z","15.0.0-canary.fa7d8d44b.0":"2022-09-07T19:19:08.996Z","15.0.0-canary.a40e3c768.0":"2022-09-09T20:04:04.733Z","15.0.0-canary.18cdc9a00.0":"2022-09-12T21:03:05.249Z","15.0.0-canary.7ab3cd3c8.0":"2022-09-13T22:39:20.350Z","15.0.0-canary.2860d244d.0":"2022-09-16T22:54:58.583Z","15.0.0-canary.e8726533c.0":"2022-09-20T20:17:50.691Z","15.0.0-canary.00d8de0aa.0":"2022-09-21T15:20:26.043Z","15.0.0-canary.271aedc30.0":"2022-09-21T15:36:06.705Z","15.0.0-canary.9f17ff2cb.0":"2022-09-21T18:08:23.200Z","15.0.0-canary.d3344c16f.0":"2022-09-22T09:24:32.193Z","15.0.0-canary.94f20ccb8.0":"2022-09-22T20:47:51.023Z","15.0.0-canary.81e4cb7b2.0":"2022-09-23T15:09:04.432Z","15.0.0-canary.aa85f9413.0":"2022-09-26T17:57:18.539Z","15.0.0-canary.7134a7752.0":"2022-09-26T21:58:30.350Z","15.0.0-canary.70b8ac16e.0":"2022-09-27T22:45:42.565Z","15.0.0-canary.c20d74405.0":"2022-09-27T23:32:03.824Z","15.0.0-canary.f033fc8d1.0":"2022-09-27T23:58:11.753Z","15.0.0-canary.8d7ae912a.0":"2022-09-28T07:56:54.289Z","15.0.0-canary.db414b864.0":"2022-09-28T14:53:34.410Z","15.0.0-canary.28cc6791f.0":"2022-09-28T18:07:57.610Z","15.0.0-canary.a515a2d18.0":"2022-09-28T18:56:37.757Z","15.0.0-canary.ce9523167.0":"2022-09-29T20:32:04.181Z","15.0.0-canary.b2310f7dc.0":"2022-09-30T00:14:38.891Z","15.0.0-canary.a44241e54.0":"2022-09-30T08:21:55.090Z","15.0.0-canary.0ce81e115.0":"2022-09-30T18:19:04.727Z","15.0.0-canary.3cc30f6ad.0":"2022-10-04T17:20:22.113Z","15.0.0-canary.d9cf98e60.0":"2022-10-04T19:04:34.421Z","15.0.0-canary.d71935c8b.0":"2022-10-06T08:15:41.588Z","15.0.0-canary.49c56a25d.0":"2022-10-06T18:51:44.304Z","15.0.0-canary.07acddef3.0":"2022-10-07T21:38:23.813Z","15.0.0-canary.1c74eb2c0.0":"2022-10-07T21:56:16.899Z","15.0.0-canary.dadfb713e.0":"2022-10-08T05:06:35.723Z","15.0.0-canary.395f1ce61.0":"2022-10-08T05:08:36.181Z","15.0.0-canary.e741b5c82.0":"2022-10-10T17:38:59.237Z","15.0.0-canary.582f3cc1c.0":"2022-10-11T04:49:54.594Z","15.0.0-canary.b1a6e3e88.0":"2022-10-12T12:03:10.974Z","15.0.0-canary.c9b1a31e4.0":"2022-10-12T16:59:23.110Z","15.0.0-canary.13e9b0d1f.0":"2022-10-12T19:22:01.541Z","15.0.0-canary.1dc797e7f.0":"2022-10-14T09:42:23.314Z","15.0.0-canary.ed4009397.0":"2022-10-14T16:52:01.522Z","15.0.0-canary.95ef196bc.0":"2022-10-14T23:14:42.053Z","15.0.0-canary.13eea1b2d.0":"2022-10-17T03:52:19.833Z","15.0.0-canary.ef9b2babb.0":"2022-10-17T09:18:49.449Z","15.0.0-canary.cec7fb987.0":"2022-10-17T10:57:05.796Z","15.0.0-canary.4fff58b08.0":"2022-10-17T15:23:23.841Z","15.0.0-canary.587d8f871.0":"2022-10-17T15:57:51.358Z","15.0.0-canary.edf4b98d0.0":"2022-10-17T16:41:13.199Z","15.0.0-canary.024ac5f16.0":"2022-10-17T22:43:06.571Z","15.0.0-canary.c8bdf6144.0":"2022-10-18T18:24:09.655Z","15.0.0-canary.bacda4885.0":"2022-10-18T18:43:32.836Z","15.0.0-canary.92b2556cf.0":"2022-10-19T01:14:10.284Z","15.0.0-canary.cc804509a.0":"2022-10-19T01:17:54.780Z","15.0.0-canary.982bedae9.0":"2022-10-19T01:37:56.563Z","15.0.0-canary.ee40081f4.0":"2022-10-19T20:12:40.294Z","15.0.0-canary.98f1b54e2.0":"2022-10-20T22:57:29.756Z","15.0.0-canary.e74b7ba7e.0":"2022-10-21T17:06:32.863Z","15.0.0-canary.ab55c07d2.0":"2022-10-22T18:19:55.053Z","15.0.0-canary.fc539db34.0":"2022-10-24T18:59:54.437Z","15.0.0-canary.e340b04c5.0":"2022-10-25T23:45:48.287Z","15.0.0-canary.2c1a8f8fd.0":"2022-10-26T17:31:24.763Z","15.0.0-canary.ecfee946f.0":"2022-10-26T20:16:06.334Z","15.0.0-canary.73ca9dbb0.0":"2022-10-31T17:33:14.986Z","15.0.0-canary.357f2e5f1.0":"2022-10-31T18:50:18.290Z","15.0.0-canary.eb103d4b5.0":"2022-10-31T19:57:12.253Z","15.0.0-canary.af5f01223.0":"2022-11-01T18:37:38.757Z","15.0.0-canary.58733ef41.0":"2022-11-02T18:11:31.608Z","15.0.0-canary.909b48215.0":"2022-11-03T04:08:42.240Z","15.0.0-canary.7f17127d5.0":"2022-11-03T18:19:58.278Z","15.0.0-canary.da95e2a05.0":"2022-11-04T16:59:52.668Z","15.0.0-canary.4832e2750.0":"2022-11-04T20:57:49.328Z","15.0.0-canary.215506426.0":"2022-11-05T01:06:45.697Z","15.0.0-canary.4cf917476.0":"2022-11-05T18:04:50.843Z","15.0.0-canary.eef14bd32.0":"2022-11-06T17:25:20.884Z","15.0.0-canary.6faa29fe9.0":"2022-11-07T03:14:10.048Z","15.0.0-canary.9af09b967.0":"2022-11-07T18:28:39.779Z","15.0.0-canary.0f54fbb93.0":"2022-11-08T21:57:19.678Z","15.0.0-canary.a8d47f9fe.0":"2022-11-09T04:18:47.312Z","15.0.0-canary.66a1e75e6.0":"2022-11-09T09:36:20.214Z","15.0.0-canary.5e5c2afc0.0":"2022-11-09T11:54:02.286Z","15.0.0-canary.3e3f43359.0":"2022-11-09T20:03:40.259Z","15.0.0-canary.3f667fac6.0":"2022-11-09T22:06:55.028Z","15.0.0-canary.faa28c1c5.0":"2022-11-11T16:36:38.655Z","15.0.0-canary.a868c7866.0":"2022-11-11T16:37:18.199Z","15.0.0-canary.602fe8efa.0":"2022-11-11T17:12:38.445Z","15.0.0-canary.558c2be62.0":"2022-11-11T22:46:01.896Z","15.0.0-canary.b5c13a7a8.0":"2022-11-14T15:59:22.351Z","15.0.0-canary.a6e1c0702.0":"2022-11-14T17:27:49.445Z","15.0.0-canary.b6f8a06de.0":"2022-11-15T09:29:14.549Z","15.0.0-canary.0163f3ba5.0":"2022-11-15T18:02:57.257Z","15.0.0-canary.66c5cbb94.0":"2022-11-15T19:30:57.281Z","15.0.0-canary.b01136063.0":"2022-11-16T00:16:41.458Z","15.0.0-canary.01da0cabb.0":"2022-11-16T09:14:05.282Z","15.0.0-canary.4ac393164.0":"2022-11-16T16:16:23.633Z","15.0.0-canary.6048fb563.0":"2022-11-16T16:18:27.067Z","15.0.0-canary.f7f56fff7.0":"2022-11-16T19:56:49.204Z","15.0.0-canary.7c73f6134.0":"2022-11-16T20:00:58.831Z","15.0.0-canary.f1e037150.0":"2022-11-16T20:06:08.466Z","15.0.0-canary.40b18d043.0":"2022-11-16T22:59:35.618Z","15.0.0-canary.86bde5c06.0":"2022-11-16T23:09:43.600Z","15.0.0-canary.bb7751002.0":"2022-11-17T00:00:58.429Z","15.0.0-canary.63aca9af6.0":"2022-11-17T19:02:15.054Z","15.0.0-canary.56482dc2e.0":"2022-11-17T21:56:02.166Z","15.0.0-canary.953e689f3.0":"2022-11-17T22:05:31.139Z","15.0.0-canary.b5606a793.0":"2022-11-18T10:21:58.932Z","15.0.0-canary.8c5675942.0":"2022-11-18T15:17:09.711Z","15.0.0-canary.697fbdebd.0":"2022-11-18T17:01:42.563Z","15.0.0-canary.d58410453.0":"2022-11-18T19:25:57.255Z","15.0.0-canary.7971d6ad5.0":"2022-11-19T08:46:01.556Z","15.0.0-canary.a0ae73b0e.0":"2022-11-21T10:54:44.302Z","15.0.0-canary.96f472604.0":"2022-11-21T12:53:34.576Z","15.0.0-canary.18b8f31e1.0":"2022-11-21T16:03:17.455Z","15.0.0-canary.912f33ce4.0":"2022-11-21T17:54:54.034Z","15.0.0-canary.1e1b1c369.0":"2022-11-23T19:01:33.958Z","15.0.0-canary.a2ec49244.0":"2022-11-23T19:31:45.444Z","15.0.0-canary.a7458ba0b.0":"2022-11-23T20:17:20.929Z","15.0.0-canary.7c35e5036.0":"2022-11-24T08:40:18.725Z","15.0.0-canary.4356e05c5.0":"2022-11-24T09:57:38.831Z","15.0.0-canary.cb605f8af.0":"2022-11-24T10:16:44.967Z","15.0.0-canary.05fb07f9f.0":"2022-11-24T17:14:36.114Z","15.0.0-canary.a911b386b.0":"2022-11-28T16:48:14.305Z","15.0.0-canary.2aa8050b4.0":"2022-11-28T19:12:31.515Z","15.0.0-canary.323904a9f.0":"2022-11-29T15:34:58.076Z","15.0.0-canary.168a629a4.0":"2022-11-29T16:49:58.716Z","15.0.0-canary.65c411674.0":"2022-11-29T17:39:28.841Z","15.0.0-canary.a86d36fd2.0":"2022-11-30T02:15:08.250Z","15.0.0-canary.3a1f46c66.0":"2022-11-30T12:08:34.691Z","15.0.0-canary.32d8a9648.0":"2022-12-01T17:30:08.840Z","15.0.0-canary.03618ab70.0":"2022-12-01T20:55:19.022Z","15.0.0-canary.68aaed940.0":"2022-12-01T21:25:04.165Z","15.0.0-canary.f0a0bbc75.0":"2022-12-02T09:02:42.509Z","15.0.0-canary.dd99c8764.0":"2022-12-02T14:01:57.032Z","15.0.0-canary.fabdcca3a.0":"2022-12-02T15:07:47.764Z","15.0.0-canary.2d26722d2.0":"2022-12-02T16:27:32.241Z","15.0.0-canary.eaa0c3a86.0":"2022-12-02T17:43:36.110Z","15.0.0-canary.79a613bbd.0":"2022-12-06T14:26:37.442Z","15.0.0-canary.c871fe61e.0":"2022-12-07T07:52:48.057Z","15.0.0-canary.9eaee7936.0":"2022-12-07T20:03:57.889Z","15.0.0-canary.1d37bf601.0":"2022-12-07T20:42:15.281Z","15.0.0-canary.a5fe069d5.0":"2022-12-09T18:45:22.214Z","15.0.0-canary.ce8b5326f.0":"2022-12-09T23:31:43.077Z","15.0.0-canary.43f5323bc.0":"2022-12-12T16:47:29.400Z","15.0.0-canary.5490e32e7.0":"2022-12-12T17:03:11.715Z","15.0.0-canary.817002c29.0":"2022-12-13T21:55:03.551Z","15.0.0-canary.313a1326a.0":"2022-12-14T10:29:51.987Z","15.0.0-canary.a69c14e10.0":"2022-12-14T11:20:01.406Z","15.0.0-canary.f43e0ceb5.0":"2022-12-14T16:45:50.642Z","15.0.0-canary.34767110.0":"2022-12-14T17:22:11.642Z","15.0.0-canary.1f99f3c50.0":"2022-12-15T14:26:32.406Z","15.0.0-canary.cfd69490f.0":"2022-12-16T20:09:32.654Z","15.0.0-canary.94ad8d986.0":"2022-12-19T19:28:05.569Z","15.0.0-canary.604264203.0":"2022-12-21T21:41:45.893Z","15.0.0-canary.85bcff6af.0":"2022-12-22T10:26:22.584Z","15.0.0-canary.ece3e8d21.0":"2022-12-22T17:13:11.116Z","15.0.0-canary.278ad53d1.0":"2022-12-27T17:06:08.176Z","15.0.0-canary.a7d8389e1.0":"2022-12-27T19:04:55.347Z","15.0.0-canary.8175d5eff.0":"2022-12-28T01:52:38.514Z","15.0.0-canary.e21dcb86d.0":"2022-12-29T14:03:11.204Z","15.0.0-canary.20ab6f5a8.0":"2022-12-29T19:41:55.107Z","15.0.0-canary.b9806f623.0":"2022-12-29T23:06:54.365Z","15.0.0-canary.50c9f550e.0":"2023-01-03T15:48:39.972Z","15.0.0-canary.af490a848.0":"2023-01-03T15:58:38.616Z","15.0.0-canary.7cf487c98.0":"2023-01-03T17:39:46.577Z","15.0.0-canary.a52be2d5e.0":"2023-01-03T19:14:07.135Z","15.0.0-canary.e38ba17c5.0":"2023-01-03T22:33:25.579Z","15.0.0-canary.49041a6c3.0":"2023-01-04T15:18:45.868Z","15.0.0-canary.c492898c2.0":"2023-01-04T17:38:20.533Z","15.0.0-canary.d7a2277de.0":"2023-01-04T21:36:43.021Z","15.0.0-canary.fd95ca7ef.0":"2023-01-05T01:03:50.549Z","15.0.0-canary.1eb44faf9.0":"2023-01-05T09:10:19.760Z","15.0.0-canary.adcdb7db9.0":"2023-01-05T16:22:51.676Z","15.0.0-canary.067af7eff.0":"2023-01-06T23:17:02.497Z","15.0.0-canary.21d1196a7.0":"2023-01-09T10:44:18.927Z","15.0.0-canary.8d2d8d3c4.0":"2023-01-09T22:24:56.426Z","15.0.0-canary.fc6ee6c32.0":"2023-01-10T16:29:05.827Z","15.0.0-canary.73537ab0f.0":"2023-01-10T18:12:33.142Z","15.0.0-canary.684e33d25.0":"2023-01-10T19:19:32.623Z","15.0.0-canary.0e89aab6b.0":"2023-01-11T16:18:56.282Z","15.0.0-canary.b0103d10a.0":"2023-01-11T19:13:30.265Z","15.0.0-canary.50e7a5312.0":"2023-01-11T20:55:12.476Z","15.0.0-canary.202823f54.0":"2023-01-11T21:36:44.219Z","15.0.0-canary.199fe2a2a.0":"2023-01-11T21:56:43.042Z","15.0.0-canary.8c0786d6f.0":"2023-01-12T14:37:20.375Z","15.0.0-canary.8a74f7c6d.0":"2023-01-17T19:25:37.038Z","15.0.0-canary.b4687fdc1.0":"2023-01-19T19:50:33.624Z","15.0.0-canary.b836b9892.0":"2023-01-24T22:40:11.646Z","15.0.0-canary.e8912fd37.0":"2023-01-26T18:30:45.416Z","15.0.0-canary.16fbd30ff.0":"2023-01-26T18:35:50.563Z","15.0.0-canary.033ae083a.0":"2023-01-26T19:27:50.750Z","15.0.0-canary.3a705fa1d.0":"2023-01-27T22:44:30.689Z","15.0.0-canary.d6bea2ff2.0":"2023-01-31T15:31:02.503Z","15.0.0-canary.0c94182c8.0":"2023-02-01T17:45:06.769Z","15.0.0-canary.15b221540.0":"2023-02-01T17:53:35.049Z","15.0.0-canary.6a4b3f834.0":"2023-02-01T18:59:23.180Z","15.0.0-canary.b177b40e2.0":"2023-02-02T03:35:12.078Z","15.0.0-canary.d9f821042.0":"2023-02-02T17:39:17.714Z","15.0.0-canary.47c7deb19.0":"2023-02-03T09:09:51.386Z","15.0.0-canary.a16dbd1a6.0":"2023-02-04T06:15:26.938Z","15.0.0-canary.93416f87a.0":"2023-02-07T13:25:06.865Z","15.0.0-canary.49b8e7442.0":"2023-02-07T23:10:31.641Z","15.0.0-canary.de38de758.0":"2023-02-09T15:43:21.693Z","15.0.0-canary.4d62de70c.0":"2023-02-09T22:04:00.008Z","15.0.0-canary.6fcd8d418.0":"2023-02-13T11:50:45.747Z","15.0.0-canary.066d9439b.0":"2023-02-15T19:58:43.248Z","15.0.0-canary.7ab32468c.0":"2023-02-21T18:35:04.450Z","15.0.0-canary.fa27ba61d.0":"2023-02-27T16:20:50.100Z","15.0.0-canary.311ab4d4a.0":"2023-02-27T16:42:25.242Z","15.0.0-canary.5cb8e2174.0":"2023-03-01T16:36:45.663Z","15.0.0-canary.f32339937.0":"2023-03-06T15:16:33.120Z","15.0.0-canary.7644d63d5.0":"2023-03-06T22:28:22.998Z","15.0.0-canary.d96330c08.0":"2023-03-08T11:42:45.658Z","15.0.0-canary.c99cae77c.0":"2023-03-08T23:43:49.821Z","15.0.0-canary.6023b1cd3.0":"2023-03-09T14:27:16.138Z","15.0.0-canary.274610c77.0":"2023-03-09T14:59:39.207Z","15.0.0-canary.a274583b9.0":"2023-03-09T19:53:33.351Z","15.0.0-canary.da22ca960.0":"2023-03-09T20:19:22.376Z","15.0.0-canary.304a94e8b.0":"2023-03-09T20:45:53.309Z","15.0.0-canary.6c265915c.0":"2023-03-09T21:48:11.367Z","15.0.0-canary.de5224633.0":"2023-03-09T23:56:37.223Z","15.0.0-canary.8879557e6.0":"2023-03-10T14:08:47.832Z","15.0.0-canary.23073a303.0":"2023-03-10T14:15:54.860Z","15.0.0-canary.51c7d4014.0":"2023-03-10T16:48:19.871Z","15.0.0-canary.1175a5be0.0":"2023-03-10T20:48:53.602Z","15.0.0-canary.7adf3af80.0":"2023-03-11T01:25:51.819Z","15.0.0-canary.82554d770.0":"2023-03-11T01:38:06.014Z","15.0.0-canary.93fc524b7.0":"2023-03-13T08:39:49.930Z","15.0.0-canary.50be0fbae.0":"2023-03-13T17:45:06.208Z","15.0.0-canary.6b5ffccd9.0":"2023-03-13T17:48:28.804Z","15.0.0-canary.1c8013f4e.0":"2023-03-13T18:03:50.077Z","15.0.0-canary.112715df5.0":"2023-03-13T18:40:09.405Z","15.0.0-canary.d250911f2.0":"2023-03-13T19:32:21.460Z","15.0.0-canary.7cd925c12.0":"2023-03-13T19:40:00.029Z","15.0.0-canary.b2ddacf73.0":"2023-03-13T19:44:18.983Z","15.0.0-canary.989ae2ecc.0":"2023-03-13T19:53:34.210Z","15.0.0-canary.89c66483a.0":"2023-03-13T20:17:18.792Z","15.0.0-canary.6a85742c2.0":"2023-03-14T02:48:12.985Z","15.0.0-canary.bb6cd78d5.0":"2023-03-14T18:17:46.453Z","15.0.0-canary.5f94aa37d.0":"2023-03-14T18:21:03.335Z","15.0.0-canary.1bd317240.0":"2023-03-14T18:24:53.856Z","15.0.0-canary.d441d2a2a.0":"2023-03-14T18:27:41.552Z","15.0.0-canary.fff4066c6.0":"2023-03-14T18:28:19.024Z","15.0.0-canary.87809c710.0":"2023-03-14T18:44:19.370Z","15.0.0-canary.48d30012d.0":"2023-03-14T18:48:38.843Z","15.0.0-canary.419b23cc6.0":"2023-03-14T18:59:39.877Z","15.0.0-canary.bf86521f4.0":"2023-03-14T23:14:18.756Z","15.0.0-canary.11f3d280e.0":"2023-03-15T00:12:09.495Z","15.0.0-canary.b281a409a.0":"2023-03-21T15:42:11.433Z","15.0.0-canary.39e473690.0":"2023-03-21T17:52:24.617Z","15.0.0-canary.cedffb44c.0":"2023-03-21T17:59:22.687Z","15.0.0-canary.36a4cba99.0":"2023-03-28T17:50:58.671Z","15.0.0-canary.ed7e82ded.0":"2023-03-28T20:35:36.423Z","15.0.0-canary.55093ee1e.0":"2023-03-29T18:49:50.539Z","15.0.0-canary.0c53abc81.0":"2023-04-07T01:41:56.982Z","15.0.0-canary.51311e69e.0":"2023-04-07T18:08:42.005Z","15.0.0-canary.113b1a38e.0":"2023-04-10T21:54:38.061Z","15.0.0-canary.ea2191426.0":"2023-04-11T21:56:32.277Z","15.0.0-canary.5a5c38538.0":"2023-04-11T22:31:09.013Z","15.0.0-canary.e4b5ea7eb.0":"2023-04-11T23:05:13.977Z","15.0.0-canary.a094dd9c1.0":"2023-04-14T22:43:19.989Z","15.0.0-canary.f771b091c.0":"2023-04-17T15:39:10.595Z","15.0.0-canary.79b1b612b.0":"2023-04-19T23:41:02.160Z","15.0.0-canary.6f50071e5.0":"2023-04-20T18:01:50.036Z","15.0.0-canary.ef754381c.0":"2023-04-24T20:51:47.022Z","15.0.0-canary.69ebf61ea.0":"2023-04-27T17:22:26.322Z","15.0.0-canary.b90be86de.0":"2023-04-29T00:22:28.780Z","15.0.0-canary.51f9c0c28.0":"2023-04-29T00:32:13.760Z","15.0.0-canary.4e840d685.0":"2023-05-02T15:34:32.172Z","15.0.0-canary.10b8563e4.0":"2023-05-02T23:42:38.838Z","15.0.0-canary.736b7fda4.0":"2023-05-03T15:10:20.300Z","15.0.0-canary.0e533c5a1.0":"2023-05-05T16:57:19.255Z","15.0.0-canary.5f01c15a2.0":"2023-05-05T17:27:07.262Z","15.0.0-canary.3b5b55e31.0":"2023-05-05T18:40:06.800Z","15.0.0-canary.d0788120f.0":"2023-05-09T08:24:02.770Z","15.0.0-canary.f52358dd0.0":"2023-05-12T14:31:20.217Z","15.0.0-canary.576d3d2c8.0":"2023-05-16T02:00:51.873Z","15.0.0-canary.19bb36a46.0":"2023-05-16T19:54:51.614Z","15.0.0-canary.aa5ac7fe5.0":"2023-05-22T17:26:39.786Z","15.0.0-canary.90291f2e2.0":"2023-05-23T17:43:37.727Z","15.0.0-canary.446734f27.0":"2023-05-30T21:49:04.198Z","15.0.0-canary.19de312d8.0":"2023-06-06T17:19:18.234Z","15.0.0-canary.6081d829b.0":"2023-06-07T01:14:53.132Z","15.0.0-canary.b26c34a68.0":"2023-06-07T20:19:14.987Z","15.0.0-canary.4fe911371.0":"2023-06-07T23:06:54.899Z","15.0.0-canary.a9ff9866f.0":"2023-06-13T11:39:05.602Z","15.0.0-canary.b994146f6.0":"2023-06-14T21:04:41.078Z","15.0.0-canary.1fb4b1a06.0":"2023-06-27T18:58:10.342Z","15.0.0-canary.c64a2776e.0":"2023-06-27T20:17:38.341Z","15.0.0-canary.b05d9eb7c.0":"2023-06-29T16:24:36.837Z","15.0.0-canary.2a9697dc5.0":"2023-06-30T22:14:45.410Z","15.0.0-canary.0c52adeab.0":"2023-07-05T16:26:45.213Z","15.0.0-canary.83355c322.0":"2023-07-10T15:06:37.682Z","15.0.0-canary.bc9ae6c9c.0":"2023-08-03T21:22:23.673Z","15.0.0-canary.3c44cd956.0":"2023-08-07T17:48:58.027Z","15.0.0-canary.02702296e.0":"2023-08-25T12:05:56.691Z","15.0.0-canary.872b65832.0":"2023-08-30T12:14:24.950Z","15.0.0-canary.89b2e4122.0":"2023-08-31T16:07:47.521Z","15.0.0-canary.7a3942e7a.0":"2023-08-31T18:40:39.505Z","15.0.0-canary.54feb3020.0":"2023-09-11T21:05:59.546Z","15.0.0-canary.6cda3ce8d.0":"2023-09-12T01:46:09.280Z","15.0.0-canary.205b20b36.0":"2023-09-13T17:18:27.364Z","15.0.0-canary.22bf82024.0":"2023-09-18T09:12:48.704Z","15.0.0-canary.a246a4439.0":"2023-09-18T17:46:58.510Z","15.0.0-canary.d153db62b.0":"2023-09-19T19:15:58.051Z","15.0.0-canary.2528c1c3b.0":"2023-09-20T18:07:27.776Z","15.0.0-canary.1728a6dcf.0":"2023-09-26T01:24:02.347Z","15.0.0-canary.ebb636f3d.0":"2023-09-29T19:45:12.322Z","15.0.0-canary.c0d21ecc9.0":"2023-10-09T19:37:37.329Z","15.0.0-canary.127a44b28.0":"2023-10-12T20:01:25.542Z","15.0.0-canary.0ad128337.0":"2023-10-19T18:52:55.599Z","15.0.0-canary.9cec94097.0":"2023-10-19T23:10:14.417Z","15.0.0-canary.c51a0bbcc.0":"2023-11-15T20:58:57.404Z","15.0.0-canary.d76666ad4.0":"2023-11-27T22:13:22.329Z","15.0.0-canary.8656bf0e0.0":"2023-12-12T21:18:54.799Z","15.0.0-canary.7f224ddd4.0":"2023-12-28T06:09:25.893Z","15.0.0-canary.a0b8a90c0.0":"2024-02-07T19:19:47.488Z","15.0.0-canary.e50b478eb.0":"2024-02-08T18:08:19.282Z","15.0.0-canary.c43b3438b.0":"2024-02-23T20:17:51.590Z","15.0.0-canary.819498d8c.0":"2024-03-15T15:15:16.684Z","15.0.0-canary.453a6248a.0":"2024-03-25T17:13:51.736Z","15.0.0-canary.68edc03c6.0":"2024-04-08T19:06:34.809Z","15.0.0-canary.5bebc0064.0":"2024-04-11T21:41:25.414Z","15.0.0-canary.311f29a60.0":"2024-04-23T18:00:24.308Z","15.0.0-canary.65c10a622.0":"2024-04-25T18:49:13.077Z","15.0.0-canary.4b35cb7d0.0":"2024-05-02T12:03:17.719Z","15.0.0-canary.f80ac92b0.0":"2024-05-02T12:13:25.900Z","15.0.0-canary.2f5b899bc.0":"2024-05-20T13:56:33.326Z","15.0.0-canary.cfec83c74.0":"2024-05-20T18:57:00.414Z","15.0.0-canary.423edc3dc.0":"2024-06-26T18:12:03.545Z"},"maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-slider"},"keywords":["material components","material design","slider"],"license":"MIT","homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"readme":"","readmeFilename":""}